Re: Das neue Auswendig lernen und die neuen Übungen -

Image Screenshot_20240411_090950

<?php
session_start ();
?>

<form method="POST" action="./form20240411.php">
<input type="text" name="form20240411a"></input>
<input type="submit">
</form>

<?php
echo session_id () . "<br>n";

setcookie ("form20240411b", "Ich bin das erste Cookie", time () + 1200);

echo htmlentities (\$_POST ["form20240411a"]) . "<br>n";
echo htmlentities (\$_COOKIE ["form20240411b"]) . "<br>n";
echo htmlentities (\$_COOKIE ["form20240411c"]) . "<br>n";

session_destroy ();
?>

POST http://localhost/mysql20240217/20240411/form20240411.php HTTP/1.1
host: localhost
Cookie: form20240411c=Hallo, ich bin Cookie 2
Content-Length: 44
Content-Type: application/x-www-form-urlencoded

form20240411a=Hallo, ich bin das erste Datum

Trying ::1...
Connected to localhost.
Escape character is '\^]'.
HTTP/1.1 200 OK
Date: Thu, 11 Apr 2024 07:17:05 GMT
Server: Apache/2.4.57 (Debian)
Set-Cookie: PHPSESSID=718b7fq4abmjua0sbcbif35u8c; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: form20240411b=Ich%20bin%20das%20erste%20Cookie; expires=Thu, 11 Apr 2024 07:37:05 GMT; Max-Age=1200
Vary: Accept-Encoding
Content-Length: 229
Content-Type: text/html; charset=UTF-8


<form method="POST" action="./form20240411.php">
<input type="text" name="form20240411a"></input>
<input type="submit">
</form>

718b7fq4abmjua0sbcbif35u8c<br>
Hallo, ich bin das erste Datum<br>
<br>
Hallo, ich bin Cookie 2<br>

<?php
session_start ();

include ("/home/david/mysqldata.php");

\$db = new PDO ("mysql: host=localhost", \$MYSQL_USER, \$MYSQL_PASSWORD);

\$sql = "CREATE DATABASE mysql20240411" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "USE mysql20240411" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "CREATE TABLE a (x1 INTEGER, x2 INTEGER); CREATE TABLE b (y1 INTEGER, y2 INTEGER); ";
\$db->query (\$sql);

\$sql = "INSERT INTO a (x1, x2) VALUES (0, 0); INSERT INTO a (x1, x2) VALUES (0, 1); INSERT INTO a (x1, x2) VALUES (1, 0); INSERT INTO a (x1, x2) VALUES (1, 1); INSERT INTO a (x1, x2) VALUES (2, 7); INSERT INTO b (y1, y2) VALUES (0, 1); INSERT INTO b (y1, y2) VALUES (0, 1); INSERT INTO b (y2, y1) VALUES (7, 2); ";
\$db->query (\$sql);

\$sql = "SELECT x1, x2 FROM a; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", " . \$row [1] . "; ";
echo "<br>n";

\$sql = "SELECT y1, y2 FROM b; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", " . \$row [1] . "; ";
echo "<br>n";

\$sql = "SELECT x1, x2, y1, y2 FROM a INNER JOIN b ON a.x1 = b.y1; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", " . \$row [1] . ", " . \$row [2] . ", " . \$row [3] . "<br>n";
echo "<br>n";

\$sql = "DROP DATABASE mysql20240411" . session_id () . "; ";
\$db->query (\$sql);

session_destroy ();
?>

0, 0; 0, 1; 1, 0; 1, 1; 2, 7; <br>
0, 1; 0, 1; 2, 7; <br>
0, 0, 0, 1<br>
0, 0, 0, 1<br>
0, 1, 0, 1<br>
0, 1, 0, 1<br>
2, 7, 2, 7<br>
<br>

<?php
session_start ();

include ("/home/david/mysqldata.php");

\$db = new PDO ("mysql: host=localhost", \$MYSQL_USER, \$MYSQL_PASSWORD);

\$sql = "CREATE DATABASE q20240411" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "USE q20240411" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "CREATE TABLE a (x INTEGER); CREATE TABLE b (x INTEGER); CREATE TABLE c (x INTEGER); ";
\$db->query (\$sql);

for (\$i = 0;  \$i < 24;  \$i++) {
    \$sql = "INSERT INTO a (x) VALUES (" . rand () % 32 . "); ";
    \$sql .= "INSERT INTO b (x) VALUES (" . rand () % 64 . "); ";
    \$sql .= "INSERT INTO c (x) VALUES (" . rand () % 128 . "); ";
    \$db->query (\$sql);
}

\$sql = "SELECT x FROM (SELECT x FROM a UNION SELECT x FROM b) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a UNION SELECT x FROM c) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM b UNION SELECT x FROM c) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM b) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a UNION SELECT x FROM b) x
                INTERSECT
            SELECT x FROM c
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM c INTERSECT SELECT x FROM b) x
                UNION
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a UNION SELECT x FROM c) x
                INTERSECT
            SELECT x FROM b
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM b) x
                UNION
            SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM c UNION SELECT x FROM b) x
                INTERSECT
            SELECT x FROM a
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM b) x
                UNION
            SELECT x FROM (SELECT x FROM c INTERSECT SELECT x FROM a) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";


\$sql = "DROP DATABASE q20240411" . session_id () . "; ";
\$db->query (\$sql);

session_destroy ();
?>

0, 2, 3, 5, 6, 7, 10, 11, 12, 13, 14, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 33, 34, 35, 36, 38, 41, 45, 47, 53, 57, 58, 63, <br>
0, 2, 6, 7, 10, 11, 12, 13, 14, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, 32, 35, 37, 40, 41, 48, 61, 65, 67, 74, 76, 81, 90, 100, 109, 123, <br>
0, 2, 3, 5, 11, 12, 17, 20, 21, 22, 23, 24, 26, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 45, 47, 48, 53, 57, 58, 61, 63, 65, 67, 74, 76, 81, 90, 100, 109, 123, <br>
0, 11, 12, 20, 21, 26, <br>
2, 20, 24, 31, <br>
20, 35, 41, <br>
2, 20, 24, 31, 35, 41, <br>
2, 20, 24, 31, 35, 41, <br>
0, 11, 12, 20, 21, 26, 35, 41, <br>
0, 11, 12, 20, 21, 26, 35, 41, <br>
0, 2, 11, 12, 20, 21, 24, 26, 31, <br>
0, 2, 11, 12, 20, 21, 24, 26, 31, <br>

global      _start
section     .data
            ToSrtStr:       db      "aasjasdghasdasdjjasd", 0x00
            ToSrtStrLen:    equ     \$-ToSrtStr
section     .text
            _start:

            mov esi, ToSrtStr
            loop1:
                mov ah, [esi]
                cmp ah, 0x00
                je loop1end
                mov edi, esi
                loop2:
                    inc edi
                    mov al, [edi]
                    cmp al, 0x00
                    je loop2end
                    mov ah, [esi]
                    mov al, [edi]
                    cmp al, ah
                    jge goon
                        mov ah, [esi]
                        mov al, [edi]
                        mov [esi], al
                        mov [edi], ah
                    goon:
                    jmp loop2
                loop2end:
                inc esi
            jmp loop1
            loop1end:

            mov edx, ToSrtStrLen
            mov ecx, ToSrtStr
            mov ebx, 1
            mov eax, 4
            int 0x80

            mov ebx, 0
            mov eax, 1
            int 0x80

assemble:
	nasm -f elf64 -g asm20240411.asm
link:
	ld -m elf_x86_64 -g asm20240411.o -o asm20240411
run:
	./asm20240411

david@laptop-peaq:~\$ make
nasm -f elf64 -g asm20240411.asm
david@laptop-peaq:~\$ make link
ld -m elf_x86_64 -g asm20240411.o -o asm20240411
david@laptop-peaq:~\$ make run
./asm20240411
aaaaaaddddghjjjsssssdavid@laptop-peaq:~\$

Image Screenshot_20240411_102919

 0 0 0 0 0    1
 1 0 0 0 1    0
 2 0 0 1 0    1
 3 0 0 1 1    1
 4 0 1 0 0    0
 5 0 1 0 1    0
 6 0 1 1 0    1
 7 0 1 1 1    1
 8 1 0 0 0    1
 9 1 0 0 1    1
10 1 0 1 0    1
11 1 0 1 1    1
12 1 1 0 0    1
13 1 1 0 1    0
14 1 1 1 0    0
15 1 1 1 1    0

 0 0 0 0 0    1
 2 0 0 1 0    1
 3 0 0 1 1    1
 6 0 1 1 0    1
 7 0 1 1 1    1
 8 1 0 0 0    1
 9 1 0 0 1    1
10 1 0 1 0    1
11 1 0 1 1    1
12 1 1 0 0    1

Gruppe 0:
 0 0 0 0 0    1
Gruppe 1:
 2 0 0 1 0    1
 8 1 0 0 0    1
Gruppe 2:
 3 0 0 1 1    1
 6 0 1 1 0    1
 9 1 0 0 1    1
10 1 0 1 0    1
12 1 1 0 0    1
Gruppe 3:
 7 0 1 1 1    1
11 1 0 1 1    1

0:2             0 0 - 0
0:8             - 0 0 0
2:3             0 0 1 -
2:6             0 - 1 0
2:10            - 0 1 0
8:9             1 0 0 -
1:10            1 0 - 0
8:12            1 - 0 0
3:7             0 - 1 1
3:11            - 0 1 1
6:7             0 1 1 -
9:11            1 0 - 1
10:11           1 0 1 -





8:9             1 0 0 -
2:3             0 0 1 -
10:11           1 0 1 -
6:7             0 1 1 -
9:11            1 0 - 1
1:10            1 0 - 0
0:2             0 0 - 0
2:6             0 - 1 0
8:12            1 - 0 0
3:7             0 - 1 1
2:10            - 0 1 0
3:11            - 0 1 1
0:8             - 0 0 0




Gruppe 1:
8:9             1 0 0 -
2:3             0 0 1 -
Gruppe 2:
10:11           1 0 1 -
6:7             0 1 1 -

Gruppe 0:
0:2             0 0 - 0
Gruppe 1:
1:10            1 0 - 0
Gruppe 2:
9:11            1 0 - 1


Gruppe 1:
2:6             0 - 1 0
8:12            1 - 0 0
Gruppe 2:
3:7             0 - 1 1

Gruppe 0:
0:8             - 0 0 0
Gruppe 1:
2:10            - 0 1 0
Gruppe 2:
3:11            - 0 1 1






Gruppe 1:
8:9             1 0 0 -
2:3             0 0 1 -
Gruppe 2:
10:11           1 0 1 -
6:7             0 1 1 -

8:9:10:11               1 0 - -
2:3:10:11               - 0 1 -
2:3:6:7                 0 - 1 -

Gruppe 0:
0:2             0 0 - 0
Gruppe 1:
1:10            1 0 - 0
Gruppe 2:
9:11            1 0 - 1

0:2:1:10                - 0 - 0
1:10:9:11               1 0 - -


Gruppe 1:
2:6             0 - 1 0
8:12            1 - 0 0
Gruppe 2:
3:7             0 - 1 1

2:6:3:7                 0 - 1 -
8:12                    1 - 0 0

Gruppe 0:
0:8             - 0 0 0
Gruppe 1:
2:10            - 0 1 0
Gruppe 2:
3:11            - 0 1 1

0:8:2:19                - 0 - 0
2:10:3:11               - 0 1 -




8:9:10:11               1 0 - -
2:3:10:11               - 0 1 -
2:3:6:7                 0 - 1 -
0:2:1:10                - 0 - 0
1:10:9:11               1 0 - -
2:6:3:7                 0 - 1 -
8:12                    1 - 0 0
0:8:2:19                - 0 - 0
2:10:3:11               - 0 1 -




8:9:10:11               1 0 - -
1:10:9:11               1 0 - -
2:3:10:11               - 0 1 -
2:10:3:11               - 0 1 -
2:3:6:7                 0 - 1 -
2:6:3:7                 0 - 1 -
0:2:1:10                - 0 - 0
0:8:2:19                - 0 - 0
8:12                    1 - 0 0


8:9:10:11               1 0 - -
2:3:10:11               - 0 1 -
2:3:6:7                 0 - 1 -
0:2:1:10                - 0 - 0
8:12                    1 - 0 0

                    0   1   2   3   6   7   8   9   10  11
8:9:10:11                                   *   *   *   *
2:3:10:11                   *   *                   *   *
2:3:6:7                     *   *   *   *
0:2:1:10            *   *   *                       *
8:12                                        *       *




                    0   1   2   3   6   7   8   9   10  11
8:9:10:11                                   *   *   *   *
2:3:10:11                   *   *                   *   *
2:3:6:7                     *   *   *   *                       p
0:2:1:10            *   *   *                       *           p
8:12                                        *       *



                    0   1   2   3   6   7   8   9   10  11
8:9:10:11                                   *   *   *   *
2:3:6:7                     *   *   *   *                       p
0:2:1:10            *   *   *                       *           p




8:9:10:11               1 0 - -
2:3:6:7                 0 - 1 -
0:2:1:10                - 0 - 0

    y <=    (x3 and not x2) or
            (not x3 and x1) or
            (not x2 and not x0);
    y <=    not ((not x3 or x2) and
            (x3 or not x1) and
            (x2 or x0));

library ieee;
use ieee.std_logic_1164.all;

entity quine20240411 is
port (
    x3, x2, x1, x0: in std_logic;
    y: out std_logic
);
end;

architecture behaviour of quine20240411 is
begin
    y <=    (x3 and not x2) or
            (not x3 and x1) or
            (not x2 and not x0);
end;

library ieee;
use ieee.std_logic_1164.all;

entity quine20240411testbench is
port (
    y: out std_logic
);
end;

architecture behaviour of quine20240411testbench is
    component quine20240411
    port (
        x3, x2, x1, x0: in std_logic;
        y: out std_logic
    );
    end component;
    signal x3, x2, x1, x0: std_logic;
begin
    q: quine20240411 PORT MAP (x3=>x3, x2=>x2, x1=>x1, x0=>x0, y=>y);

library ieee;
use ieee.std_logic_1164.all;

entity quine20240411 is
port (
    x3, x2, x1, x0: in std_logic;
    y: out std_logic
);
end;

architecture behaviour of quine20240411 is
begin
    y <=    (x3 and not x2) or
            (not x3 and x1) or
            (not x2 and not x0);
end;

library ieee;
use ieee.std_logic_1164.all;

entity quine20240411testbench is
port (
    y: out std_logic
);
end;

architecture behaviour of quine20240411testbench is
    component quine20240411
    port (
        x3, x2, x1, x0: in std_logic;
        y: out std_logic
    );
    end component;
    signal x3, x2, x1, x0: std_logic;
begin
    q: quine20240411 PORT MAP (x3=>x3, x2=>x2, x1=>x1, x0=>x0, y=>y);
    x0 <= '0' after 0 ns, '1' after 10 ns, '0' after 20 ns, '1' after 30 ns, '0' after 40 ns, '1' after 50 ns, '0' after 60 ns, '1' after 70 ns, '0' after 80 ns, '1' after 90 ns, '0' after 100 ns, '1' after 110 ns, '0' after 120 ns, '1' after 130 ns, '0' after 140 ns, '1' after 150 ns;

    x1 <= '0' after 0 ns, '0' after 10 ns, '1' after 20 ns, '1' after 30 ns, '0' after 40 ns, '0' after 50 ns, '1' after 60 ns, '1' after 70 ns, '0' after 80 ns, '0' after 90 ns, '1' after 100 ns, '1' after 110 ns, '0' after 120 ns, '0' after 130 ns, '1' after 140 ns, '1' after 150 ns;

    x2 <= '0' after 0 ns, '0' after 10 ns, '0' after 20 ns, '0' after 30 ns, '1' after 40 ns, '1' after 50 ns, '1' after 60 ns, '1' after 70 ns, '0' after 80 ns, '0' after 90 ns, '0' after 100 ns, '0' after 110 ns, '1' after 120 ns, '1' after 130 ns, '1' after 140 ns, '1' after 150 ns;

    x3 <= '0' after 0 ns, '0' after 10 ns, '0' after 20 ns, '0' after 30 ns, '0' after 40 ns, '0' after 50 ns, '0' after 60 ns, '0' after 70 ns, '1' after 80 ns, '1' after 90 ns, '1' after 100 ns, '1' after 110 ns, '1' after 120 ns, '1' after 130 ns, '1' after 140 ns, '1' after 150 ns;
end;

Image Screenshot_20240411_102919

1.) Rechne die Zahl in binaer Darstellung  in eine Dezimale Darstellung um
1001100010011100b 39068d
2.) Rechne die Zahl in dezimal darstellung in eine Binaerdarstellung um
52655 1100110110101111
3.) Addiere die drei Zahlen schriftlich
            28720
+           33877
+           24691
-----------------
            87288
4.) Subtrahiere die letzten drei Zahlen schriftlich von der ersten schriftlich
            25972
-           15080
-           11823
-            1243
-----------------
            -2174
5.) Rechne die Zahl ins zweier komplement um, mit 8 Bit - und subtrahiere diese zahl von der ersten und rechne das Ergebnis nach dezimal
-80 -86 = -166
10110000 10101010 = 01011010
6.) Multipliziere die zwei Zahlen schriftlich
6333*25720 = 162884760
7.) Dividiere die zwei Zahlen schriftlich
60630/22315 = 2
8.) Errechne x Logarithmisch mit dem Taschenrechner
19608\^x = 845988269
Rechne die Zahl in IEEE-754 um 18540.925781

Image 20240411_121142

Image 20240411_122211

Image 20240411_122217

Image 20240411_123400

Image 20240411_124125

https://www.ituenix.de/nextcloud/data/dave/files/complex20240411.tex">

https://www.ituenix.de/nextcloud/data/dave/files/complex20240411.pdf">

Image complex20240411-1

Image 20240411_130621