Verifying that I control the following Nostr public key: npub1hde4znyq57gkml2zexk642yj0z2739xu7u6tczrvege73fhg9fsqfrxxd5
while True: | |
n = int(input("Please, enter number of rays for snowflake: ")) | |
if n > 360: | |
print("Too much!!! Try again!!!") | |
else: break | |
import turtle as t | |
t.reset() | |
for ray in range(n): |
/** | |
* Get the world XY position of a tile that takes into account the offset of the container with this map in it. | |
* This returns the origin of the tile sprite which is 64x64 whereas the actual tilemap tile size is only 64x32, so | |
* the world position is actually outside of the individual tile bounds. The tiles overlap in the isometric grid | |
* though so we only really care about the specific point. | |
* @param tileX | |
* @param tileY | |
*/ | |
public tileToWorldXY(tileX: number, tileY: number): Phaser.Math.Vector2 { | |
const worldPos = this.map.tileToWorldXY(tileX, tileY, null, null, "floor"); |
""" | |
Single Responsibility Principle | |
“…You had one job” — Loki to Skurge in Thor: Ragnarok | |
A class should have only one job. | |
If a class has more than one responsibility, it becomes coupled. | |
A change to one responsibility results to modification of the other responsibility. | |
""" | |
class Animal: | |
def __init__(self, name: str): |
Каждый язык программирования имеет достоинства и недостатки. Вы должны знать отдельные достоинства и недостатки используемого языка. Определите конвенции программирования до начала программирования. Позднее адаптировать к ним код станет почти невозможно. Методик конструирования слишком много, чтобы использовать все в одном проекте. Тщательно выбирайте методики, наиболее подходящие для вашего проекта. Спросите себя, являются ли используемые вами методики программирования ответом на выбранный язык программирования или их выбор был определен языком. Помните, что программировать следует с использованием языка, а не на языке. Эффективность конкретных подходов и даже возможность их применения зависит от стадии развития соответствующей технологии.
People
![]() :bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
<div class="table-responsive" style="max-width:400px"><table class="table table-hover table-bordered table-condensed table-list"> <tbody> <tr bgcolor="#FCF8F8" class="scrollable bordered"> <td height="33"><div align="left">AGE</div></td> <td>DEATH RATE<br> confirmed cases <br></td> <td>DEATH RATE<br> all cases</td> </tr> <tr class="scrollable bordered"> <td width="244"><div align="left"><strong>80+ years old </strong></div></td> <td width="125"><div align="right"><strong>21.9%</strong></div></td> <td width="125"><div align="right"><strong>14.8%</strong></div></td> </tr> <tr class="scrollable bordered"> <td><div align="left"><strong>70-79 years old </strong></div></td> <td><div align="right"></div></td> <td><div align="right"><strong>8.0%</strong></div></td> </tr> <tr class="scrollable bordered"> <td><div align="left"><strong>60-69 years old </strong></div></td> <td><div align="right"></div></td> <td><div align="right"><strong>3.6%</strong></div></td> </tr> <tr class="scrollable bordered"> <td><div align="left |
Problem | |
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. | |
For example, | |
Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6. | |
The below elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. | |
defprotocol
: defines an interfacedeftype
: create a bare-bones object which implements a protocoldefrecord
: creates an immutable persistent map which implements a protocol
Typically you'll use defrecord
(or even a basic map
);
unless you need some specific Java inter-op,
where by you'll want to use deftype
instead.
Note:
defprotocol
allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,
# 1.Cannonballs | |
# | |
# A new kind of cannon is being tested. The cannon shoots cannonballs in a fixed direction. Each cannonball flies horizontally until it hits the ground, and then it rests there. Cannonballs are shot from different heights, so they hit the ground at different points. | |
# You are given two zero-indexed arrays, A and B, containing M and N integers respectively. Array A describes the landscape in the direction along which the cannon is shooting. Elements of array A represent the height of the ground, going from the cannon outwards. Array B contains levels from which consecutive cannonballs are shot. | |
# Assume that a cannonball is shot at level H. | |
# Let I be the smallest index, such that 0 < I < M and A[I] ≥ H. The cannonball falls at position I − 1 and increases the ground level A[I−1] by 1. | |
# If there is no such I, and H > A[I] for all 0 ≤ I < M, then the cannonball flies beyond the horizon and has no effect on the result. | |
# If H ≤ A[0], then the cannonball ricochets away and has no effect on the |