f9
anna
f96fe7c0739cc8823ba17c2364dfb04eb8596e98d39792212f2bcf8883e36f7f

- 2019

- 2018

- 2017

- 2016

- 2015

- 2014

- 2013

- 2012

- 2011

- 2010

- 2009

- 2008

- 2007

- 2006

- 2005

- 2004

- 2003

- 2002

- 2001

- 2000

- 1999

- 1998

- 1997

- 1996

- 1995

- 1994

- 1993

- 1992

- 1991

- 1990

- 1989

- 1988

- 1987

- 1986

- 1985

- 1984

- 1983

- 1982

- 1981

- 1980

- 1979

- 1978

- 1977

- 1976

- 1975

- 1974

- 1973

- 1972

- 1971

- 1970

- 1969

- 1968

- 1967

- 1966

- 1965

- 1964

- 1963

- 1962

- 1961

- 1960

- 1959

- 1958

- 1957

- 1956

- 1955

- 1954

- 1953

- 1952

- 1951

- 1950

- 1949

- 1948

- 1947

- 1946

- 1945

- 1944

- 1943

- 1942

- 1941

- 1940

- 1939

- 1938

- 1937

- 1936

- 1935

- 1934

- 1933

- 1932

- 1931

- 1930

- 1929

- 1928

- 1927

- 1926

- 1925

- 1924

- 1923

- 1922

- 1921

- 1920

- 1919

- 1918

- 1917

- 1916

- 1915

- 1914

- 1913

- 1912

- 1911

- 1910

- 1909

- 1908

- 1907

- 1906

- 1905

- 1904

- 1903

- 1902

- 1901

- 1900

- 1899

- 1898

- 1897

- 1896

- 1895

- 1894

- 1893

- 1892

- 1891

- 1890

- 1889

- 1888

- 1887

- 1886

- 1885

- 1884

- 1883

- 1882

- 1881

- 1880

- 1879

- 1878

- 1877

- 1876

- 1875

- 1874

- 1873

- 1872

- 1871

- 1870

- 1869

- 1868

- 1867

- 1866

- 1865

- 1864

- 1863

- 1862

- 1861

- 1860

- 1859

- 1858

- 1857

- 1856

- 1855

- 1854

- 1853

- 1852

- 1851

- 1850

- 1849

- 1848

- 1847

- 1846

- 1845

- 1844

- 1843

- 1842

- 1841

- 1840

- 1839

- 1838

- 1837

- 1836

- 1835

- 1834

- 1833

- 1832

- 1831

- 1830

- 1829

- 1828

- 1827

- 1826

- 1825

- 1824

- 1823

- 1822

- 1821

- 1820

- 1819

- 1818

- 1817

- 1816

- 1815

- 1814

- 1813

- 1812

- 1811

- 1810

- 1809

- 1808

- 1807

- 1806

- 1805

- 1804

- 1803

- 1802

- 1801

- 1800

- 1799

- 1798

- 1797

- 1796

- 1795

- 1794

- 1793

- 1792

- 1791

- 1790

- 1789

- 1788

- 1787

- 1786

- 1785

- 1784

- 1783

- 1782

- 1781

- 1780

- 1779

- 1778

- 1777

- 1776

- 1775

- 1774

- 1773

- 1772

- 1771

- 1770

- 1769

- 1768

- 1767

- 1766

- 1765

- 1764

- 1763

- 1762

- 1761

- 1760

- 1759

- 1758

- 1757

- 1756

- 1755

- 1754

- 1753

- 1752

- 1751

- 1750

- 1749

- 1748

- 1747

- 1746

- 1745

- 1744

- 1743

- 1742

- 1741

- 1740

- 1739

- 1738

- 1737

- 1736

- 1735

- 1734

- 1733

- 1732

- 1731

- 1730

- 1729

- 1728

- 1727

- 1726

- 1725

- 1724

- 1723

- 1722

- 1721

- 1720

- 1719

- 1718

- 1717

- 1716

- 1715

- 1714

- 1713

- 1712

- 1711

- 1710

- 1709

- 1708

- 1707

- 1706

- 1705

- 1704

- 1703

- 1702

- 1701

- 1700

- 1699

- 1698

- 1697

- 1696

- 1695

- 1694

- 1693

- 1692

- 1691

- 1690

- 1689

- 1688

- 1687

- 1686

- 1685

- 1684

- 1683

- 1682

- 1681

- 1680

- 1679

- 1678

- 1677

- 1676

- 1675

- 1674

- 1673

- 1672

- 1671

- 1670

- 1669

- 1668

- 1667

- 1666

- 1665

- 1664

- 1663

- 1662

- 1661

- 1660

- 1659

- 1658

- 1657

- 1656

- 1655

- 1654

- 1653

- 1652

- 1651

- 1650

- 1649

- 1648

- 1647

- 1646

- 1645

- 1644

- 1643

- 1642

- 1641

- 1640

- 1639

- 1638

- 1637

- 1636

- 1635

- 1634

- 1633

- 1632

- 1631

- 1630

- 1629

- 1628

- 1627

- 1626

- 1625

- 1624

- 1623

- 1622

- 1621

- 1620

- 1619

- 1618

- 1617

- 1616

- 1615

- 1614

- 1613

- 1612

- 1611

- 1610

- 1609

- 1608

- 1607

- 1606

- 1605

- 1604

- 1603

- 1602

- 1601

- 1600

- 1599

- 1598

- 1597

- 1596

- 1595

- 1594

- 1593

- 1592

- 1591

- 1590

- 1589

- 1588

- 1587

- 1586

- 1585

- 1584

- 1583

- 1582

- 1581

- 1580

- 1579

- 1578

- 1577

- 1576

- 1575

- 1574

- 1573

- 1572

- 1571

- 1570

- 1569

- 1568

- 1567

- 1566

- 1565

- 1564

- 1563

- 1562

- 1561

- 1560

- 1559

- 1558

- 1557

- 1556

- 1555

- 1554

- 1553

- 1552

- 1551

- 1550

- 1549

- 1548

- 1547

- 1546

- 1545

- 1544

- 1543

- 1542

- 1541

- 1540

- 1539

- 1538

- 1537

- 1536

- 1535

- 1534

- 1533

- 1532

- 1531

- 1530

- 1529

- 1528

- 1527

- 1526

- 1525

- 1524

- 1523

- 1522

- 1521

- 1520

- 1519

- 1518

- 1517

- 1516

- 1515

- 1514

- 1513

- 1512

- 1511

- 1510

- 1509

- 1508

- 1507

- 1506

- 1505

- 1504

- 1503

- 1502

- 1501

- 1500

- 1499

- 1498

- 1497

- 1496

- 1495

- 1494

- 1493

- 1492

- 1491

- 1490

- 1489

- 1488

- 1487

- 1486

- 1485

- 1484

- 1483

- 1482

- 1481

- 1480

- 1479

- 1478

- 1477

- 1476

- 1475

- 1474

- 1473

- 1472

- 1471

- 1470

- 1469

- 1468

- 1467

- 1466

- 1465

- 1464

- 1463

- 1462

- 1461

- 1460

- 1459

- 1458

- 1457

- 1456

- 1455

- 1454

- 1453

- 1452

- 1451

- 1450

- 1449

- 1448

- 1447

- 1446

- 1445

- 1444

- 1443

- 1442

- 1441

- 1440

- 1439

- 1438

- 1437

- 1436

- 1435

- 1434

- 1433

- 1432

- 1431

- 1430

- 1429

- 1428

- 1427

- 1426

- 1425

- 1424

- 1423

- 1422

- 1421

- 1420

- 1419

- 1418

- 1417

- 1416

- 1415

- 1414

- 1413

- 1412

- 1411

- 1410

- 1409

- 1408

- 1407

- 1406

- 1405

- 1404

- 1403

- 1402

- 1401

- 1400

- 1399

- 1398

- 1397

- 1396

- 1395

- 1394

- 1393

- 1392

- 1391

- 1390

- 1389

- 1388

- 1387

- 1386

- 1385

- 1384

- 1383

- 1382

- 1381

- 1380

- 1379

- 1378

- 1377

- 1376

- 1375

- 1374

- 1373

- 1372

- 1371

- 1370

- 1369

- 1368

- 1367

- 1366

- 1365

- 1364

- 1363

- 1362

- 1361

- 1360

- 1359

- 1358

- 1357

- 1356

- 1355

- 1354

- 1353

- 1352

- 1351

- 1350

- 1349

- 1348

- 1347

- 1346

- 1345

- 1344

- 1343

- 1342

- 1341

- 1340

- 1339

- 1338

- 1337

- 1336

- 1335

- 1334

- 1333

- 1332

- 1331

- 1330

- 1329

- 1328

- 1327

- 1326

- 1325

- 1324

- 1323

- 1322

- 1321

- 1320

- 1319

- 1318

- 1317

- 1316

- 1315

- 1314

- 1313

- 1312

- 1311

- 1310

- 1309

- 1308

- 1307

- 1306

- 1305

- 1304

- 1303

- 1302

- 1301

- 1300

- 1299

- 1298

- 1297

- 1296

- 1295

- 1294

- 1293

- 1292

- 1291

- 1290

- 1289

- 1288

- 1287

- 1286

- 1285

- 1284

- 1283

- 1282

- 1281

- 1280

- 1279

- 1278

- 1277

- 1276

- 1275

- 1274

- 1273

- 1272

- 1271

- 1270

- 1269

- 1268

- 1267

- 1266

- 1265

- 1264

- 1263

- 1262

- 1261

- 1260

- 1259

- 1258

- 1257

- 1256

- 1255

- 1254

- 1253

- 1252

- 1251

- 1250

- 1249

- 1248

- 1247

- 1246

- 1245

- 1244

- 1243

- 1242

- 1241

- 1240

- 1239

- 1238

- 1237

- 1236

- 1235

- 1234

- 1233

- 1232

- 1231

- 1230

- 1229

- 1228

- 1227

- 1226

- 1225

- 1224

- 1223

- 1222

- 1221

- 1220

- 1219

- 1218

- 1217

- 1216

- 1215

- 1214

- 1213

- 1212

- 1211

- 1210

- 1209

- 1208

- 1207

- 1206

- 1205

- 1204

- 1203

- 1202

- 1201

- 1200

- 1199

- 1198

- 1197

- 1196

- 1195

- 1194

- 1193

- 1192

- 1191

- 1190

- 1189

- 1188

- 1187

- 1186

- 1185

- 1184

- 1183

- 1182

- 1181

- 1180

- 1179

- 1178

- 1177

- 1176

- 1175

- 1174

- 1173

- 1172

- 1171

- 1170

- 1169

- 1168

- 1167

- 1166

- 1165

- 1164

- 1163

- 1162

- 1161

- 1160

- 1159

- 1158

- 1157

- 1156

- 1155

- 1154

- 1153

- 1152

- 1151

- 1150

- 1149

- 1148

- 1147

- 1146

- 1145

- 1144

- 1143

- 1142

- 1141

- 1140

- 1139

- 1138

- 1137

- 1136

- 1135

- 1134

- 1133

- 1132

- 1131

- 1130

- 1129

- 1128

- 1127

- 1126

- 1125

- 1124

- 1123

- 1122

- 1121

- 1120

- 1119

- 1118

- 1117

- 1116

- 1115

- 1114

- 1113

- 1112

- 1111

- 1110

3076

=====================================================================

.. index::

single: 3076

.. index::

pair: 114759, 128874

.. index::

tags:

- 3076

- 3076-114759

- 3076-128874

Overview

--------

This file contains a list of all the places mentioned in this book, sorted by their position.

If you want to do something with the data, have a look at

:ref:`scripting and querying the data `.

See also

--------

* :ref:`index `

* :ref:`index of all places `

* :ref:`book summary

`

* :ref:`book index `

Note that the data is loaded from a database, and might be outdated. If you need the most recent information, please contact the author.

Table of Contents

-----------------

.. contents::

depth: 10

2023. 8. 27์ผ

## ์ด๋ฉ”์ผ ์„œ๋ฒ„ ์ •๋ณด

[๋‹ค์Œ](https://www.nextcloud.org/)์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Nextcloud๋กœ ์ด๋ฉ”์ผ ์„œ๋ฒ„๋ฅผ ์„ค์น˜ํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

Nextcloud๋Š” ์—ฌ๋Ÿฌ ๊ธฐ๋Šฅ์ด ์žˆ์ง€๋งŒ ์ด๋ฉ”์ผ์„ ํฌํ•จํ•œ ๋น…๋ฐ์ดํ„ฐ ํŒŒ์ผ์Šคํ† ์–ด์ธ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

![nextcloud]()

์ด๋ฉ”์ผ ์„œ๋ฒ„๋Š” ์‚ฌ์šฉ์ž๋“ค์—๊ฒŒ ๊ฐ๊ฐ์˜ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ ํ• ๋‹นํ•˜๊ณ , ๊ทธ๋ ‡๊ฒŒ ์ด๋ฉ”์ผ ์„œ๋ฒ„๋ฅผ ์„ค์น˜ํ•˜๋ฉด ๊ทธ๋…€ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๋˜ํ•œ ์›น์‚ฌ์ดํŠธ์— ๋กœ๊ทธ์ธํ•˜์—ฌ ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜๊ณ  ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

### ์ด๋ฉ”์ผ ์„œ๋ฒ„ ์„ค์น˜

Nextcloud๋Š” Ubuntu 20.04์—์„œ ๊ฐ€์žฅ ์‰ฝ๊ฒŒ ์„ค์น˜๋˜๋Š”๋ฐ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

```bash

# ์—…๋ฐ์ดํŠธ

sudo apt-get update

# ์„ค์น˜

sudo apt-get install apache2 mysql-server php-fpm php-mysql php-zip php-gd

# ์‚ฌ์šฉ์ž ์ƒ์„ฑ

sudo adduser nextcloud

# ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •

sudo chpasswd nextcloud

# ์ด๋ฉ”์ผ ์„œ๋ฒ„ ์‹œ์ž‘

sudo systemctl enable apache2

```

### ํŒŒ์ผ ์—…๋กœ๋“œ ๋ฐ ๋‹ค์šด๋กœ๋“œ

Nextcloud๋Š” Nextcloud Client๋ผ๋Š” ์›น์‚ฌ์ดํŠธ์—์„œ ์ ‘์†ํ•˜์—ฌ ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜๊ณ  ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ฃผ์†Œ๋ฅผ ๋ธŒ๋ผ์šฐ์ €๋กœ ์—ด์–ด์„œ ๋กœ๊ทธ์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

```bash

http://localhost/nextcloud

```

์ด๋ฉ”์ผ ์‚ฌ์šฉ์ž๋“ค์—๊ฒŒ๋Š” ๊ฐ๊ฐ์˜ ์ด๋ฉ”์ผ ์ฃผ์†Œ์™€ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ œ๊ณตํ•˜์—ฌ, ๋กœ๊ทธ์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

![nextcloud login]()

๋กœ๊ทธ์ธ๋œ ์ƒํƒœ์—์„œ๋Š” ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜๊ฑฐ๋‚˜ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

![nextcloud file upload]()

![nextcloud file download]()

The first thing we did was set up a few basic pieces of equipment. We got the camera, of course, but we also needed some lights to shine on our subjects. Since we didnโ€™t have any professional lighting equipment, we decided to use some old lamps from my grandmotherโ€™s house. They were a bit rusty and covered in dust, but they would do for now.

We also needed a backdrop to put our models against, so we used a piece of black fabric that I had lying around. It wasnโ€™t the best quality, but it was better than nothing. We hung it up on a wall using some old clothes hangers that my grandmother had given me.

Finally, we needed something to sit or stand on while we were shooting. Since we didnโ€™t have any stools or chairs, we used some old crates that I had found in the basement of my grandfatherโ€™s house. They were a bit wobbly and hard to climb onto, but they did the job.

Once we had all our equipment set up, we were ready to start shooting. We started with some simple portraits of my friends, using the cameraโ€™s auto focus feature to make sure everything was sharp. It wasnโ€™t perfect, but it was good enough for a first attempt.

Next, we decided to try some landscape shots of the woods behind my grandmotherโ€™s house. We used a wider angle lens this time, and tried to get a sense of depth by shooting from different distances. The results were mixed โ€“ some of the pictures turned out great, while others were too blurry or too dark.

After that, we decided to take a break and grab some lunch. We went down the street to a local diner that had been recommended by my grandmotherโ€™s friends. It was a bit out of the way, but it was worth it for the delicious burgers and fries.

Once we were back home, we decided to try our hand at some still life shots. We used some old vases and flowers that I had found in my grandmotherโ€™s garden, along with a piece of silverware that my grandfather had given me. It wasnโ€™t the most interesting subject matter, but it was something to work with.

We spent the rest of the afternoon experimenting with different lighting and angles, trying to get the best possible results. We didnโ€™t take any pictures of each other that day, but we did manage to capture some beautiful moments of nature and still life.

As the sun started to set, we packed up our equipment and headed back down the street to my grandmotherโ€™s house. She was waiting for us with a fresh pot of tea and some homemade cookies, which we devoured as we looked through our photos.

Overall, it wasnโ€™t the most successful photography session we had ever had, but it was definitely a learning experience. We learned about lighting and composition, about working with different subjects, and most importantly, about having fun and being creative. And that was all that really mattered.

#include "common.h"

#include "farm.h"

//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------

bool farm_has_crop(int i)

{

return (farm_info[i].type == FARM_TYPE_CROP);

}

//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------

void farm_show_all_crops()

{

int i;

for (i = 0; i < MAX_FARMS; i++) {

if (farm_has_crop(i)) {

print(FARM_COLORS, "%d - %s", i, farm_info[i].type);

}

}

}

//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------

void farm_change_crop(int i, int new_crop)

{

if (farm_has_crop(i)) {

print(FARM_COLORS, "Changing crop on farm %d from %s to %s.", i,

farm_info[i].type, get_crop_name(new_crop));

if (farm_info[i].type == FARM_TYPE_CROP) {

farm_info[i].harvest = harvest_table[get_crop_harvest(new_crop)];

}

farm_info[i].type = new_crop;

if (farm_info[i].type == FARM_TYPE_CROP) {

if (farm_info[i].harvest < 0) {

farm_info[i].harvest = harvest_table[get_crop_harvest(new_crop)];

} else {

print(FARM_COLORS, "Farm %d will have a %s harvest.

", i,

get_crop_harvest_name(farm_info[i].harvest));

}

farm_info[i].growth = get_crop_growth(new_crop);

farm_info[i].planting = false;

if (farm_info[i].growth > 0) {

print(FARM_COLORS, "Farm %d will grow crops.

", i);

} else {

print(FARM_COLORS, "Farm %d will not grow crops.

", i);

}

}

} else if (farm_info[i].type == FARM_TYPE_RAIN) {

print(FARM_COLORS, "Changing rain farm %d.", i);

farm_info[i].type = NEW_FARM_TYPE;

print(FARM_COLORS, "to new type.

");

}

}

//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------

void farm_add_crop(int i, int crop)

{

if (farm_has_crop(i)) {

print(FARM_COLORS, "Farm %d already has a crop.

", i);

} else {

print(FARM_COLORS, "Adding crop to farm %d.", i);

farm_info[i].type = crop;

if (crop == FARM_TYPE_CROP) {

print(FARM_COLORS, "Planting.

");

farm_info[i].harvest = harvest_table[get_crop_harvest(crop)];

if (farm_info[i].harvest < 0) {

farm_info[i].harvest = harvest_table[get_crop_harvest(crop)];

} else {

print(FARM_COLORS, "Farm %d will have a %s harvest.

", i,

get_crop_harvest_name(farm_info[i].harvest));

}

farm_info[i].growth = get_crop_growth(crop);

print(FARM_COLORS, "Planting.

");

if (farm_info[i].growth > 0) {

print(FARM_COLORS, "Farm %d will grow crops.

", i);

} else {

print(FARM_COLORS, "Farm %d will not grow crops.

", i);

}

} else if (crop == FARM_TYPE_RAIN) {

farm_info[i].type = crop;

print(FARM_COLORS, "Rain farm.

");

} else {

print(FARM_COLORS, "Invalid type.

");

}

}

}

//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------

void farm_add_rain(int i)

{

if (farm_info[i].type == FARM_TYPE_RAIN) {

print(FARM_COLORS, "Rain farm %d already exists.

", i);

} else if (farm_info[i].type != FARM_TYPE_CROP && farm_info[i].type != FARM_TYPE_RAIN) {

print(FARM_COLORS, "Invalid type.

");

} else {

print(FARM_COLORS, "Adding rain farm to farm %d.", i);

farm_info[i].type = FARM_TYPE_RAIN;

print(FARM_COLORS, "Rain farm.

");

}

}

//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------

int farm_get_crop(int i)

{

if (farm_has_crop(i)) {

return farm_info[i].type;

} else if (farm_info[i].type == FARM_TYPE_RAIN) {

print(FARM_COLORS, "Invalid type.

");

} else {

print(FARM_COLORS, "No crop.

");

}

return -1;

}

//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------

void farm_update()

{

int i;

bool changed = false;

for (i = 0; i < MAX_FARMS; i++) {

if (!farm_has_crop(i)) continue;

if (farm_info[i].planting) {

int days = farm_info[i].days + 1;

if (days > get_crop_growth(farm_info[i].type)) {

print(FARM_COLORS, "Planting complete.

");

changed = true;

farm_info[i].planting = false;

if (farm_info[i].type == FARM_TYPE_CROP) {

print(FARM_COLORS, "Harvesting.

");

int harvest_days = farm_info[i].harvest;

if (farm_info[i].type == FARM_TYPE_CROP && !farm_info[i].planting) {

print(FARM_COLORS, "Planting.

");

} else {

if (days > harvest_days) {

print(FARM_COLORS, "Harvesting.

");

} else if (days >= 0) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

print(FARM_COLORS, "Harvesting.

");

}

int days_left = harvest_days - days;

if (days_left > 0) {

print(FARM_COLORS, "Days left: %d.

", days_left);

} else if (days_left == 0) {

if (farm_info[i].type == FARM_TYPE_CROP && farm_info[i].harvest != -1) {

changed = true;

print(FARM_COLORS, "Harvesting.

");

farm_info[i].planting = true;

int days_left = get_crop_growth(farm_info[i].type);

print(FARM_COLORS, "Days left: %d.

", days_left);

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "No crop.

");

}

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "Harvested.

");

}

if (days > harvest_days) {

print(FARM_COLORS, "Planting.

");

} else if (days >= 0 && days < harvest_days) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "Harvested.

");

}

int days_left = harvest_days - days;

if (days_left > 0) {

print(FARM_COLORS, "Days left: %d.

", days_left);

} else if (days_left == 0) {

if (farm_info[i].type == FARM_TYPE_CROP && farm_info[i].harvest != -1) {

changed = true;

print(FARM_COLORS, "Harvesting.

");

farm_info[i].planting = true;

int days_left = get_crop_growth(farm_info[i].type);

print(FARM_COLORS, "Days left: %d.

", days_left);

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "No crop.

");

}

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "Harvested.

");

}

if (days > harvest_days) {

print(FARM_COLORS, "Planting.

");

} else if (days >= 0 && days < harvest_days) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "Harvested.

");

}

int days_left = harvest_days - days;

if (days_left > 0) {

print(FARM_COLORS, "Days left: %d.

", days_left);

} else if (days_left == 0) {

if (farm_info[i].type == FARM_TYPE_CROP && farm_info[i].harvest != -1) {

changed = true;

print(FARM_COLORS, "Harvesting.

");

farm_info[i].planting = true;

int days_left = get_crop_growth(farm_info[i].type);

print(FARM_COLORS, "Days left: %d.

", days_left);

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "No crop.

");

}

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "Harvested.

");

}

if (days > harvest_days) {

print(FARM_COLORS, "Planting.

");

} else if (days >= 0 && days < harvest_days) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "Harvested.

");

}

int days_left = harvest_days - days;

if (days_left > 0) {

print(FARM_COLORS, "Days left: %d.

", days_left);

} else if (days_left == 0) {

if (farm_info[i].type == FARM_TYPE_CROP && farm_info[i].harvest != -1) {

changed = true;

print(FARM_COLORS, "Harvesting.

");

farm_info[i].planting = true;

int days_left = get_crop_growth(farm_info[i].type);

print(FARM_COLORS, "Days left: %d.

", days_left);

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "No crop.

");

}

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "Harvested.

");

}

if (days > harvest_days) {

print(FARM_COLORS, "Planting.

");

} else if (days >= 0 && days < harvest_days) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "Harvested.

");

}

int days_left = harvest_days - days;

if (days_left > 0) {

print(FARM_COLORS, "Days left: %d.

", days_left);

} else if (days_left == 0) {

if (farm_info[i].type == FARM_TYPE_CROP && farm_info[i].harvest != -1) {

changed = true;

print(FARM_COLORS, "Harvesting.

");

farm_info[i].planting = true;

int days_left = get_crop_growth(farm_info[i].type);

print(FARM_COLORS, "Days left: %d.

", days_left);

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "No crop.

");

}

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "Harvested.

");

}

if (days > harvest_days) {

print(FARM_COLORS, "Planting.

");

} else if (days >= 0 && days < harvest_days) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "Harvested.

");

}

int days_left = harvest_days - days;

if (days_left > 0) {

print(FARM_COLORS, "Days left: %d.

", days_left);

} else if (days_left == 0) {

if (farm_info[i].type == FARM_TYPE_CROP && farm_info[i].harvest != -1) {

changed = true;

print(FARM_COLORS, "Harvesting.

");

farm_info[i].planting = true;

int days_left = get_crop_growth(farm_info[i].type);

print(FARM_COLORS, "Days left: %d.

", days_left);

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "No crop.

");

}

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "Harvested.

");

}

if (days > harvest_days) {

print(FARM_COLORS, "Planting.

");

} else if (days >= 0 && days < harvest_days) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "Harvested.

");

}

int days_left = harvest_days - days;

if (days_left > 0) {

print(FARM_COLORS, "Days left: %d.

", days_left);

} else if (days_left == 0) {

if (farm_info[i].type == FARM_TYPE_CROP && farm_info[i].harvest != -1) {

changed = true;

print(FARM_COLORS, "Harvesting.

");

farm_info[i].planting = true;

int days_left = get_crop_growth(farm_info[i].type);

print(FARM_COLORS, "Days left: %d.

", days_left);

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "No crop.

");

}

} else {

changed = true;

farm_info[i].planting = false;

print(FARM_COLORS, "Harvested.

");

}

if (days > harvest_days) {

print(FARM_COLORS, "Planting.

");

} else if (days >= 0 && days < harvest_days) {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "No harvest.

");

} else {

changed = true;

farm_info[i].harvest = -1;

print(FARM_COLORS, "Harvested.

");

}

if (days == harvest_days) {

changed = true;

farm_info[i].harvest = 0;

print(FARM_COLORS, "Harvested.

");

}

if (changed) {

print("Farm info updated.

");

}

} else if (farm_info[i].type == FARM_TYPE_LIVESTOCK) {

if (farm_info[i].planting) {

print(FARM_COLORS, "Planting.

");

} else if (farm_info[i].harvest) {

print(FARM_COLORS, "Harvested.

");

} else {

print(FARM_COLORS, "No crop.

");

}

} else if (farm_info[i].type == FARM_TYPE_ANIMALS) {

if (farm_info[i].planting) {

print(FARM_COLORS, "Planting.

");

} else if (farm_info[i].harvest) {

print(FARM_COLORS, "Harvested.

");

} else {

print(FARM_COLORS, "No crop.

");

}

} else if (farm_info[i].type == FARM_TYPE_VINEYARD) {

if (farm_info[i].planting) {

print(FARM_COLORS, "Planting.

");

} else if (farm_info[i].harvest) {

print(FARM_COLORS, "Harvested.

");

} else {

print(FARM_COLORS, "No crop.

");

}

} else if (farm_info[i].type == FARM_TYPE_ORCHARD) {

if (farm_info[i].planting) {

print(FARM_COLORS, "Planting.

");

} else if (farm_info[i].harvest) {

print(FARM_COLORS, "Harvested.

");

} else {

print(FARM_COLORS, "No crop.

");

}

} else if (farm_info[i].type == FARM_TYPE_GARDEN) {

if (farm_info[i].planting) {

print(FARM_COLORS, "Planting.

");

} else if (farm_info[i].harvest) {

print(FARM_COLORS, "Harvested.

");

} else {

print(FARM_COLORS, "No crop.

");

}

}

}

}

} else {

print("Invalid farm ID.");

}

}

}

# GCP Deployments

## Kubernetes

### Deployments

- [Kubernetes Deployment Tutorial](https://kubernetes.io/docs/concepts/workload/deployments/)

- [Deployment YAML Example](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#configuration)

- [Deployment Status](https://kubernetes.io/docs/concepts/workload/deployments/#deployment-status)

- [Deployment Rolling Update](https://kubernetes.io/docs/concepts/workload/deployments/#rolling-update)

- [Deployment Strategies](https://kubernetes.io/docs/concepts/workload/deployments/#deployment-strategies)

- [Deployment Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/)

- [Deployment TTL](https://kubernetes.io/docs/concepts/workload/deployments/#ttl)

##### Deployment Types

- [StatefulSet](https://kubernetes.io/docs/concepts/statefulset/)

- [DaemonSet](https://kubernetes.io/docs/concepts/workload/daemonset/)

- [Deployment Replicas](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#replicas)

- [StatefulSet Pods](https://kubernetes.io/docs/concepts/statefulset/#pods)

- [DaemonSet Pods](https://kubernetes.io/docs/concepts/workload/daemonset/#pods)

##### Deployment Rollouts

- [Rollout](https://kubernetes.io/docs/tasks/run-application/deployments/#rollout)

- [Progressive Rollout](https://kubernetes.io/docs/concepts/workload/progressive-rollout/)

##### Deployment Rollbacks

- [Rollback](https://kubernetes.io/docs/tasks/run-application/deployments/#rollback)

- [Progressive Rollback](https://kubernetes.io/docs/concepts/workload/progressive-rollout/)

##### Deployment Scaling

- [Scaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#scaling)

- [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/)

- [Deployment Scaling Strategies](https://kubernetes.io/docs/concepts/workload/deployments/#scaling-strategies)

##### Deployment Liveness and Readiness Probes

- [Liveness and Readiness Probes](https://kubernetes.io/docs/tasks/debug-application-cluster/liveness-readiness-probes/)

##### Deployment Resource Limits

- [Resource Limits](https://kubernetes.io/docs/concepts/workload/resource-limits/#deployments)

##### Deployment Node Selector and Tolerations

- [Node Selectors and Tolerations](https://kubernetes.io/docs/tasks/run-application/node-selectors/#deployments)

##### Deployment Auto Scaling Metrics

- [Auto Scaling Metrics](https://kubernetes.io/docs/concepts/workload/horizontal-pod-autoscaler/#metrics)

##### Deployment Horizontal Pod Autoscaler Options

- [Horizontal Pod Autoscaler Options](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#options)

- [Deployment Horizontal Pod Autoscaler Example](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#example)

### Deployment Events

- [Events](https://kubernetes.io/docs/concepts/workload/events/)

- [Deployment Events](https://kubernetes.io/docs/concepts/workload/deployments/#events)

##### Deployment Event Types

- [Event Sources](https://kubernetes.io/docs/concepts/workload/deployments/#event-sources)

- [Deployment Event Messages](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#deployment-event-messages)

### Deployment Lifecycle Management

- [Deployment Lifecycle](https://kubernetes.io/docs/concepts/workload/lifecycle-of-a-deployment/#lifecycle)

- [Deployment Strategy](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#strategy)

##### Deployment Lifecycle Management Options

- [Deployment Triggers](https://kubernetes.io/docs/concepts/workload/lifecycle-of-a-deployment/#triggers)

- [Deployment Replica Updates](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#replica-updates)

- [Deployment Rolling Update Strategies](https://kubernetes.io/docs/concepts/workload/lifecycle-of-a-deployment/#rolling-update-strategies)

- [Progressive Rollout](https://kubernetes.io/docs/concepts/workload/progressive-rollout/)

### Deployment Updates and Rollouts

- [Deployment Rollout Strategies](https://kubernetes.io/docs/tasks/run-application/deployments/#strategy)

- [Progressive Rollout Options](https://kubernetes.io/docs/concepts/workload/progressive-rollout/#options)

##### Deployment Update and Rollout Steps

- [Deployment Update and Rollout Steps](https://kubernetes.io/docs/tasks/run-application/deployments/#steps)

- [Deployment Updates and Rollouts Example](https://kubernetes.io/docs/concepts/workload/horizontal-pod-autoscaler/#example)

##### Deployment Update and Rollout TTL

- [Deployment TTL](https://kubernetes.io/docs/concepts/workload/deployments/#ttl)

### Deployment Deletion

- [Deleting Deployments](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscaler/#delete)

- [Deleting StatefulSets](https://kubernetes.io/docs/concepts/statefulset/#deleting-a-statefulset)

- [Deleting DaemonSets](https://kubernetes.io/docs/concepts/workload/daemonset/#deleting)

Welcome, Jessee.

For your music, might I recommend nostr:npub1yfg0d955c2jrj2080ew7pa4xrtj7x7s7umt28wh0zurwmxgpyj9shwv6vg? That is essentially if Spotify was combined with the Lightning network for BTC.

I use it for my music, in fact. Also, most of their infrastructure is Free Software under MIT from what I found.

* File: __init__.py

* Created on: Tue Sep 14 20:39:57 2021

* Author: Liam Woolley

* Licence: MIT

"""

import torch

from torch.utils.data import Dataset, DataLoader

class MNISTDataset(Dataset):

def __init__(self, image_dir='./images', label_dir='./labels'):

self.image_dir = image_dir

self.label_dir = label_dir

super().__init__()

def __getitem__(self, index):

img = torch.load(f'{self.image_dir}/{index}.jpg')

return (img, torch.tensor(int(f'{self.label_dir}/{index}.txt'))), None

def __len__(self):

return len(os.listdir(self.image_dir))

class MNISTDataLoader(DataLoader):

def __init__(self, dataset, batch_size=32, shuffle=True, num_workers=4):

super().__init__(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=num_workers)

self.dataset = dataset

def __getitem__(self, index):

img, label = self.dataset.__getitem__(index)

return torch.tensor(img), label

def load_data():

ds = MNISTDataset()

dl = MNISTDataLoader(ds)

return ds, dl

1. What is the millions digit of 1962381?

Answer: 1

# AES-192

**AES-192**, also known as the **Advanced Encryption Standard 128 bits**, is a symmetric block cipher used for secure data transmission. It was adopted by the U.S. National Institute of Standards and Technology (NIST) in October 2003, along with AES-128 and AES-256 as part of the Advanced Encryption Standard (AES).

The design and analysis of AES-192 was performed by Vincent Rijmen and Joan Daemen under funding from the NIST. The standard document for AES-192 is NIST Special Publication 800-38, *Advanced Encryption Standard*.

## Construction

AES-192 uses a block size of 128 bits (16 bytes) and operates on 16-byte data blocks. It also uses a 192-bit key. AES-192 has 10 rounds, which means that each data block is transformed 10 times before being sent or stored.

The key is divided into four parts called *round keys*, each of 48 bits, with each part corresponding to a different round of the algorithm. The key schedule for AES-192 uses a 128-bit key which is first divided into four round keys using a key derivation function (KDF). This KDF is called **AES Key Derivation Function** or **AES-KDF**. The key derivation is performed by repeatedly applying the following operation until the entire key has been used up.

```

#1 P = K[0]

#2 Q = P ^ K[1]

#3 R = Q ^ K[2]

#4 S = R ^ K[3]

```

The four round keys are then used in the rounds of the AES algorithm. The first and last round keys are always used unchanged; the second key is used twice; and the third key is used three times.

## Security analysis

AES-192 is considered to be very secure, with an estimated brute force search time of 4.7 ร— 10^{38} years on a single 64-bit processor. It has been widely adopted by governments and businesses worldwide, including the U.S. Department of Defense, for use in their computer systems, and is considered to be one of the most secure encryption algorithms currently in use.

## Usage

The AES-192 standard was included in NIST Special Publication 800-38, *Advanced Encryption Standard* (AES), which was adopted by the U.S. National Institute of Standards and Technology (NIST) on October 2, 2003. AES-192 is used to encrypt sensitive data in many different applications. One such application is SSH, where it is used for encrypted connections between computers.

## Comparison to other ciphers

AES-192 is considered secure enough that it may be used as a replacement for the older Data Encryption Standard (DES) in all situations except where a higher level of security is required, such as military and government applications. However, AES-256 has largely supplanted AES-192, owing to its 256-bit key size and the fact that it is faster on most processors than AES-192. AES-256 also provides better resistance to attacks with side channel information, such as timing or power analysis.

In terms of speed, AES-192 is slower than its 128-bit and 256-bit counterparts due to the larger key size. It is significantly faster than DES on modern processors, however. The exact time depends on many factors such as processor architecture, clock speed, cache size, etc. On a typical x86 processor running at 3 GHz, AES-192 can encrypt 5 million blocks per second in software and over 75 million blocks per second in hardware, while DES can only manage 30 million blocks per second in hardware (using the DES II algorithm).

## Algorithmic details

### Key schedule

The AES-192 key is divided into four parts called *round keys*, each of 48 bits, with each part corresponding to a different round of the algorithm. The key derivation function used for generating the round keys is the **AES Key Derivation Function** (KDF), which is based on a modified version of the Feistel network.

The key derivation process consists of four steps:

1. **Initializeization**: Four 48-bit variables called *L0*, *L1*, *R0*, and *R1* are initialized with the first four bytes of the key in hexadecimal form (the least significant bits are assumed to be all zero).

2. **First permutation**: The values of *L0* and *R0* are combined into a single 96-bit value using the Feistel function, and this value is used as input for the second step.

3. **Second permutation**: The resulting 96-bit value is combined with *L1* and *R1* into a 144-bit value using the Feistel function. This value is then divided into two 72-bit halves, which are used as input for the third step.

4. **Third permutation**: The two 72-bit halves are combined using the Feistel function to produce a 144-bit value. This value is then divided into four 36-bit halves, which are used as the round keys for AES. The first and last keys are stored unchanged in memory; the second key is used twice; and the third key is used three times.

The KDF algorithm described above can be implemented using a simple loop, which applies the Feistel function repeatedly until the entire key has been processed. The total number of iterations required is equal to the number of bytes in the key divided by 8 (i.e., 128/8=16 for AES-192).

### Encryption and decryption

The algorithm consists of 10 rounds, each of which consists of several substitution and permutation operations on the data block. Each round key is used only once, and a new key is generated for each subsequent round. The first and last keys are stored unchanged in memory; the second key is used twice; and the third key is used three times.

The algorithm uses 128-bit blocks and works on 16-byte (128-bit) data blocks. The algorithm can be divided into two parts: the *substitution network* and the *permutation network*. Each part consists of several rounds, with each round consisting of a series of substitution and permutation operations.

#### Substitution network

The first step in the encryption process is to apply the substitution network to the data block. The substitution network consists of 10 rounds, each of which applies one of 16 different substitution functions (also called *S-boxes*) to each element of the data block. Each S-box is a 4 ร— 4 matrix, and each row or column is obtained by applying a simple linear transformation to the input elements.

The following table shows all 16 possible S-boxes that can be used in the AES algorithm:

| Round | S-Box |

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#### Permutation network

The second step in the encryption process is to apply the permutation network to the data block. The permutation network consists of 10 rounds, each of which applies one of two different permutation functions (also called *P-boxes*) to the data block. Each P-box is a 4 ร— 4 matrix, and each row or column is obtained by applying a simple linear transformation to the input elements.

The following table shows all 16 possible P-boxes that can be used in the AES algorithm:

| Round | P-Box |

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

## Security

AES is considered one of the most secure symmetric encryption algorithms available in the AES Block Cipher Standard (FIPS 140-2). It has a security level of 128 bits, 192 bits and 256 bits. The NIST recommends that its use of 128-bit keys be restricted to confidential data only, while the use of 192- and 256-bit keys are recommended for applications that require additional security.

On June 7, 2007, a team of cryptographers announced that they had successfully broken a 128-bit AES key using an algorithm known as the "Brute Force Method", in which an attacker systematically tries all possible keys until the correct one is found. The team, led by Vincent Rijmen, announced that it was able to find the correct key after trying about 10^{35} possibilities within a reasonable amount of time.

In July 2008, the cryptography community had successfully demonstrated an attack on a 192-bit AES key using the "Daniel J. Bernstein's Linear Algebra Method". The attack involves analyzing the linear equations that are used to encrypt and decrypt messages with AES, in order to determine the correct key.

In July 2009, cryptographers announced that they had succeeded in cracking a 256-bit AES key using an algorithm known as "Side Channel Analysis" (SCA). The attack involves measuring certain physical properties of a chip containing an AES processor, such as power consumption or electromagnetic radiation, to infer information about the key being used.

In November 2019, it was reported that Google had successfully broken a 48-core ARM Cortex-A57 AES processor using the side-channel attack by exploiting the microarchitectural vulnerability in the processor's design. The vulnerability allowed the attackers to infer information about the key being used with high accuracy even when only a small portion of the power consumed by the processor was measured.

In 2012, the NIST announced that it was planning to publish a new standard for post-quantum cryptography. In September 2017, the NIST published a draft document on post-quantum cryptography. The document includes 7 candidates for post-quantum symmetric encryption: AES-GCM-SIV, CRYSTAL-Kyber, Lattice-Based Cryptosystems (such as SIDH, NTRU), McEliece, Hash-Based Message Authentication Code (HMAC) with SHA-256, HMAC with SHA-384, and HMAC with SHA-512. In 2018, the NIST announced that it had selected AES-GCM-SIV as a post-quantum symmetric encryption algorithm to be included in NIST Special Publication 800-71 Part 3 (Revision 4). The NIST also selected HMAC with SHA-256 as a post-quantum hash-based message authentication code algorithm for inclusion in the same publication.

In July 2020, Google announced its plans to transition to using the AES-GCM-SIV cipher suite for its secure communication protocols.

#ifndef __COPY_UTIL_H__

#define __COPY_UTIL_H__

#include

#include "stm32f1xx_hal.h"

void copy_uint8(const uint8_t *src, uint8_t *dest, size_t length);

void copy_uint16(const uint16_t *src, uint16_t *dest, size_t length);

void copy_int32(const int32_t *src, int32_t *dest, size_t length);

void copy_float32(const float32_t *src, float32_t *dest, size_t length);

#endif

3. Which is smaller: 17/6 or -0.052?

A: -0.052

00:04:35.160 - 00:08:40.079

[INFO] [2021-06-22 18:15:35.16] [1793] [11586] - [1793] [11586] - [1793] [11586] - [1793] [11586]

# ------------------------- START TEST -------------------------

python -m pytest /path/to/your/pytest/file.py

```

Here's an example of how to use pytest to test a Python script:

1. Open your terminal or command prompt.

2. Navigate to the directory where your Python script is located using `cd`.

3. Run `pip install pytest` to install the pytest package if it hasn't already been installed.

4. Create a file named `conftest.py` in the same directory as your Python script with the following contents:

```python

import os

def add_logs(config, log_file='results.log'):

log_dir = os.path.join('logs', config['test_env']['name'])

if not os.path.exists(log_dir):

os.makedirs(log_dir)

with open(os.path.join(log_dir, log_file), 'a') as f:

f.write('------------------------- START TEST -------------------------

')

f.write(f'{config["test_env"]["name"]} - {config["test_env"]["version"]}

')

f.write('------------------------- END TEST -------------------------

')

```

5. Open your Python script and add the following imports:

```python

import pytest

from config import *

```

6. Add a test function to your script with the `@pytest.mark.test` decorator:

```python

def test_my_function():

assert my_function(1, 2) == 3

```

7. Save and run the test using `pytest`. The output should include the logs you specified in `conftest.py`:

```yaml

============================= test session starts ==============================

collected 1 item

test_my_function.py .. [100%]

============================== 1 passed in 0.01s ===============================

------------------------- END TEST -------------------------

```

8. You can run the test again using `pytest` to see if any changes were made:

```yaml

============================= test session starts ==============================

collected 1 item

test_my_function.py .. [100%]

============================== 1 passed in 0.02s ===============================

------------------------- END TEST -------------------------

```

That's it! You have now used pytest to test your Python script and log the results.

- Collect the terms in -2*t + 15856*t**3 + 2*t.

Answer: 15856*t**3

213. Two Sum

# @Time complexity: O(n)

class Solution {

public:

vector twoSum(vector& nums, int target) {

unordered_map mp;

for(auto i=0;i

if(mp.find(target-nums[i])!=mp.end()){

return {mp[target-nums[i]],i};

}

else{

mp[nums[i]]=i;

}

}

return {};

}

};

Authorize Drive API



Select file to upload:


*

* Created on: 2021/5/17 9:48

* Author: ChenWei

*

*/

#include "stm32f1xx_hal.h"

#include "MotorDriver.h"

namespace motorDriver {

// motor driver for the 40mm linear actuator, left and right movement

MotorDriver::MotorDriver() :

m_left{

.pwmPin = GPIO_PIN_12,

.motorPwdnPin = GPIO_PIN_13,

.directionPin = GPIO_PIN_14,

.speedLimitHz = 5000, // max speed limit

.dutyRange = 1000 // duty cycle range: 0~100%

},

m_right{

.pwmPin = GPIO_PIN_9,

.motorPwdnPin = GPIO_PIN_10,

.directionPin = GPIO_PIN_8,

.speedLimitHz = 5000, // max speed limit

.dutyRange = 1000 // duty cycle range: 0~100%

} {

}

void MotorDriver::move(float32_t leftSpeed, float32_t rightSpeed) {

m_left.setSpeed(leftSpeed);

m_right.setSpeed(rightSpeed);

// move left motor

if (m_left.isMoving()) {

HAL_GPIO_WritePin(m_left.pwmPin, GPIO_HIGH);

} else {

HAL_GPIO_WritePin(m_left.pwmPin, GPIO_LOW);

}

// move right motor

if (m_right.isMoving()) {

HAL_GPIO_WritePin(m_right.pwmPin, GPIO_HIGH);

} else {

HAL_GPIO_WritePin(m_right.pwmPin, GPIO_LOW);

}

}

void MotorDriver::stop() {

m_left.stop();

m_right.stop();

// move left motor

if (m_left.isMoving()) {

HAL_GPIO_WritePin(m_left.pwmPin, GPIO_HIGH);

} else {

HAL_GPIO_WritePin(m_left.pwmPin, GPIO_LOW);

}

// move right motor

if (m_right.isMoving()) {

HAL_GPIO_WritePin(m_right.pwmPin, GPIO_HIGH);

} else {

HAL_GPIO_WritePin(m_right.pwmPin, GPIO_LOW);

}

}

void MotorDriver::setDirection(bool32_t direction) {

if (direction == DIR_LEFT) {

m_left.setDirection(DIRECTION_FORWARD);

m_right.setDirection(DIRECTION_BACKWARD);

} else if (direction == DIR_RIGHT) {

m_left.setDirection(DIRECTION_BACKWARD);

m_right.setDirection(DIRECTION_FORWARD);

} else {

// stop motors

stop();

}

}

bool32_t MotorDriver::isMoving() const {

return (m_left.isMoving() || m_right.isMoving());

}

}