From 2cbeb5d2e7fba702d7d7cd30d7b35c5f0f76983d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 21 Oct 2021 17:57:53 +0200 Subject: [PATCH] Audio, Pygame, Pandas --- README.md | 8 ++++---- index.html | 12 ++++++------ parse.js | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index eebf882..960e795 100644 --- a/README.md +++ b/README.md @@ -2825,7 +2825,7 @@ nframes = .getnframes() # Number of frames. * **Bytes object contains a sequence of frames, each consisting of one or more samples.** * **In a stereo signal, the first sample of a frame belongs to the left channel.** * **Each sample consists of one or more bytes that, when converted to an integer, indicate the displacement of a speaker membrane at a given moment.** -* **If sample width is one, then the integer should be encoded unsigned.** +* **If sample width is one byte, then the integer should be encoded unsigned.** * **For all other sizes, the integer should be encoded signed with little-endian byte order.** ### Sample Values @@ -2949,7 +2949,7 @@ while all(event.type != pg.QUIT for event in pg.event.get()): ```python = pg.Rect(x, y, width, height) # Floats get truncated into ints. = .x/y/centerx/centery/… # Top, right, bottom, left. Allows assignments. - = .topleft/center/… # Topright, bottomright, bottomleft. + = .topleft/center/… # Topright, bottomright, bottomleft. Same. = .move((x, y)) # Use move_ip() to move in place. ``` @@ -3014,7 +3014,7 @@ SIZE, MAX_SPEED = 50, P(5, 10) # Screen size, Speed limit def main(): def get_screen(): pg.init() - return pg.display.set_mode(2 * [SIZE*16]) + return pg.display.set_mode((SIZE*16, SIZE*16)) def get_images(): url = 'https://gto76.github.io/python-cheatsheet/web/mario_bros.png' img = pg.image.load(io.BytesIO(urllib.request.urlopen(url).read())) @@ -3230,7 +3230,7 @@ c 6 7 | pd.concat([l, r], | x y z | y | | Adds rows at the bottom. | | axis=0, | a 1 2 . | 2 | | Uses 'outer' by default. | | join=…) | b 3 4 . | 4 | | A series is treated as a | -| | b . 4 5 | 4 | | column. Use l.append(r) | +| | b . 4 5 | 4 | | column. Use l.append(sr) | | | c . 6 7 | 6 | | to add a row instead. | +------------------------+---------------+------------+------------+--------------------------+ | pd.concat([l, r], | x y y z | | | Adds columns at the | diff --git a/index.html b/index.html index 6af908e..85803a8 100644 --- a/index.html +++ b/index.html @@ -226,7 +226,7 @@ pre.prettyprint {
- +
@@ -2440,7 +2440,7 @@ nframes = <Wave_read>.getnframes() Bytes object contains a sequence of frames, each consisting of one or more samples.
  • In a stereo signal, the first sample of a frame belongs to the left channel.
  • Each sample consists of one or more bytes that, when converted to an integer, indicate the displacement of a speaker membrane at a given moment.
  • -
  • If sample width is one, then the integer should be encoded unsigned.
  • +
  • If sample width is one byte, then the integer should be encoded unsigned.
  • For all other sizes, the integer should be encoded signed with little-endian byte order.
  • Sample Values

    ┏━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━┯━━━━━━━━━━━━━┓
    @@ -2539,7 +2539,7 @@ rect = pg.Rect(240, 2
     
     

    Rectangle

    Object for storing rectangular coordinates.

    <Rect> = pg.Rect(x, y, width, height)           # Floats get truncated into ints.
     <int>  = <Rect>.x/y/centerx/centery/…           # Top, right, bottom, left. Allows assignments.
    -<tup.> = <Rect>.topleft/center/…                # Topright, bottomright, bottomleft.
    +<tup.> = <Rect>.topleft/center/…                # Topright, bottomright, bottomleft. Same.
     <Rect> = <Rect>.move((x, y))                    # Use move_ip() to move in place.
     
    @@ -2589,7 +2589,7 @@ SIZE, MAX_SPEED = 50, P(def main(): def get_screen(): pg.init() - return pg.display.set_mode(2 * [SIZE*16]) + return pg.display.set_mode((SIZE*16, SIZE*16)) def get_images(): url = 'https://gto76.github.io/python-cheatsheet/web/mario_bros.png' img = pg.image.load(io.BytesIO(urllib.request.urlopen(url).read())) @@ -2768,7 +2768,7 @@ c 6 7 ┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃ ┃ axis=0, │ a 1 2 . │ 2 │ │ Uses 'outer' by default. ┃ ┃ join=…) │ b 3 4 . │ 4 │ │ A series is treated as a ┃ -┃ │ b . 4 54 │ │ column. Use l.append(r) ┃ +┃ │ b . 4 54 │ │ column. Use l.append(sr) ┃ ┃ │ c . 6 76 │ │ to add a row instead. ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ ┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃ @@ -3017,7 +3017,7 @@ $ pyinstaller script.py --add-data '<path>:.' diff --git a/parse.js b/parse.js index b3bba3b..0dea0f8 100755 --- a/parse.js +++ b/parse.js @@ -350,7 +350,7 @@ const DIAGRAM_15_B = "┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃\n" + "┃ axis=0, │ a 1 2 . │ 2 │ │ Uses 'outer' by default. ┃\n" + "┃ join=…) │ b 3 4 . │ 4 │ │ A series is treated as a ┃\n" + - "┃ │ b . 4 5 │ 4 │ │ column. Use l.append(r) ┃\n" + + "┃ │ b . 4 5 │ 4 │ │ column. Use l.append(sr) ┃\n" + "┃ │ c . 6 7 │ 6 │ │ to add a row instead. ┃\n" + "┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" + "┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃\n" +