 - 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 <scripting_and_querying>`.

See also
--------

* :ref:`index <index>`
* :ref:`index of all places <all_places>`
* :ref:`book summary <summary>`
* :ref:`book index <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](https://user-images.githubusercontent.com/54182635/109667096-c16e91d6-f6b9-41a7-bb8f-5280dbf23d48.png)

이메일 서버는 사용자들에게 각각의 이메일 주소를 할당하고, 그렇게 이메일 서버를 설치하면 그녀 것입니다.
또한 웹사이트에 로그인하여 파일을 업로드하고 다운로드할 수 있습니다.

### 이메일 서버 설치

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](https://user-images.githubusercontent.com/54182635/109667107-c16e91d6-f6b9-41a7-bb8f-5280dbf23d48.png)

로그인된 상태에서는 파일을 업로드하거나 다운로드할 수 있습니다.
![nextcloud file upload](https://user-images.githubusercontent.com/54182635/109667108-c16e91d6-f6b9-41a7-bb8f-5280dbf23d48.png)
![nextcloud file download](https://user-images.githubusercontent.com/54182635/109667109-c16e91d6-f6b9-41a7-bb8f-5280dbf23d48.png)


 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)


    *  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 <stdio.h>
#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.


<template>

Codificador de números romanos a decimal

                Número romanizado:

                Ingrese un número romanizado.

              Convertir

Resultado:

{{ result }}

Error. El número romanizado no es válido.

  </template>


 - 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<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int,int> mp;
        for(auto i=0;i<nums.size();i++){
            if(mp.find(target-nums[i])!=mp.end()){
                return {mp[target-nums[i]],i};
            }
            else{
                mp[nums[i]]=i;
            }
        }
        return {};
    }
};


Authorize Drive API
<button type="submit" class="button button-success">Upload File</button>

        Title:
        <input type="text" id="title" name="title" class="form-control">

        Description:
        <textarea id="description" name="description" rows="5" cols="30"></textarea>

Select file to upload:

<input type="file" id="file_to_upload" name="file_to_upload">


 Let u(j) = 4*j + 20. Calculate u(-18).
Answer: -30


<!DOCTYPE html>

        <title>Reto 6</title>

Reto 6

Vamos a verificar si el usuario ingresó una palabra

Pregunta:

¿Has escrito una palabra?

                <form action ="verifica.php" method="post">
                    <input type="text" name="palabra">
                     <input type="submit" value="Verificar">
                     </form>


 *
 *  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());
    }

}


 (813) 654-2709

# What is the remainder when 831 is divided by 4?

## Answer (0)

To find the remainder when a number is divided by another, you can use the formula: Remainder = dividend - (dividend/divisor)*divisor. In this case, dividend=831 and divisor=4. So,

Remainder = 831 - (831/4)*4

Remainder = 75

So, when 831 is divided by 4, the remainder is 75.


8/27/15
A: -19


08/29/16 03:40 PM EST
---
title: "Exploring the Future of Artificial Intelligence in Healthcare"
author: "Geraldine Peroni, MD"
source: "https://www.healthitanalytics.com/news/exploring-the-future-artificial-intelligence-healthcare"
url: https://www.healthitanalytics.com/news/exploring-the-future-artificial-intelligence-healthcare
lang: en
---

Artificial intelligence (AI) is already transforming healthcare in many ways, but the potential for this technology to improve patient outcomes and reduce costs is still enormous. Here are some of the ways that AI is currently being used in healthcare:

1. Predictive analytics: AI algorithms can analyze vast amounts of data from electronic health records (EHRs) to identify patterns and make predictions about future health events. For example, an algorithm could predict which patients are at risk for hospital readmissions or which patients are likely to develop certain chronic conditions in the future.
2. Medical imaging: AI-powered tools can analyze medical images such as X-rays, CT scans, and MRIs to help doctors identify abnormalities and diagnose diseases. These tools can also help radiologists more accurately measure and track tumors over time.
3. Virtual health assistants: AI-powered virtual assistants can answer patients' questions about their health conditions, remind them to take medications, and even provide some basic medical advice. For example, the Google Assistant can answer questions about symptoms or medication side effects, while the Mayo Clinic's Chatbot can help patients schedule appointments and get information about their conditions.
4. Drug discovery: AI algorithms can analyze vast amounts of data from previous clinical trials to identify potential drug targets and speed up the drug discovery process. For example, IBM Watson has been used to analyze genomic data from thousands of cancer patients to identify new drug targets for immunotherapy.
5. Personalized medicine: AI-powered tools can analyze a patient's genetic makeup, lifestyle factors, and medical history to create personalized treatment plans that are tailored to their individual needs. For example, the company Tempus Health uses AI algorithms to analyze large amounts of genomic data from cancer patients and develop customized treatment plans based on each patient's unique characteristics.

While these applications of AI in healthcare are already having a significant impact, there is still much more that can be done. As data continues to grow and AI technology advances, we can expect even more innovative solutions to emerge in the coming years. Some of the areas where AI has the potential to make the biggest impact include:

1. Population health management: AI algorithms can analyze population-level data to identify trends and predict future health outcomes. This information can be used to develop targeted interventions that address specific health issues in a community, such as high rates of chronic diseases or opioid abuse.
2. Remote patient monitoring: AI-powered tools can analyze data from remote patient monitoring devices to detect abnormalities and alert healthcare providers to potential problems. For example, an algorithm could detect changes in a patient's heart rate or blood pressure that indicate a serious condition such as a heart attack or stroke.
3. Health information security: AI algorithms can help protect sensitive health information by identifying and mitigating cyber threats. For example, an algorithm could detect unusual patterns of activity on a healthcare network that might indicate a data breach or other security issue.
4. Medical research: AI algorithms can analyze vast amounts of medical research data to identify new insights and accelerate the pace of discovery. This information can be used to develop new treatments for diseases or to improve existing ones.
5. Healthcare workforce management: AI-powered tools can help healthcare organizations optimize their workflows and reduce costs by automating routine tasks such as scheduling, billing, and coding. This can free up healthcare workers to focus on providing high-quality care to patients.

Overall, the potential for AI to improve patient outcomes and reduce healthcare costs is enormous, but it will take a concerted effort from healthcare providers, policymakers, and technology companies to realize this potential. As with any new technology, there are also concerns about privacy, security, and bias that must be addressed in order to ensure that AI is used ethically and responsibly in healthcare. But if we can overcome these challenges, the benefits of AI in healthcare are likely to be truly transformative.


# Getting started with Docker

## What is Docker?

Docker is a containerization platform for automating the deployment, scaling and management of applications. It provides an easy way to package an application and its dependencies into a container that can be run on any machine that has Docker installed. Containers are isolated from each other and the host system, making it easy to deploy multiple applications on the same machine without worrying about conflicts.

## Installing Docker

Docker can be installed on a variety of operating systems, including Windows, Linux and macOS. The installation process varies depending on your operating system, but you can find detailed instructions on the [Docker website](https://docs.docker.com/get-docker/).

## Running a Docker container

Once Docker is installed, you can run a container by pulling an image from a registry (such as Docker Hub) and running it using the `docker run` command. For example:
```css
$ docker pull nginx
$ docker run -p 80:80 nginx
```
This will pull the latest version of the nginx image from Docker Hub, and start a new container running on port 80. You can then access the nginx web server by visiting `http://localhost` in your browser.

## Building a Docker image

You can also build your own Docker images by creating a `Dockerfile` that specifies the instructions for building the image. For example, here's a simple `Dockerfile` that builds an image based on the latest version of Ubuntu and installs the Apache web server:
```bash
# Use an official Ubuntu image as the base image
FROM ubuntu:latest

# Update the package list and install Apache
RUN apt-get update && apt-get install -y apache2

# Expose port 80 for Apache to listen on
EXPOSE 80

# Start Apache when the container starts
CMD ["apache2", "-D", "FOREVER"]
```
To build an image from a `Dockerfile`, you can use the `docker build` command. For example:
```
$ docker build -t my-apache .
```
This will build an image called `my-apache` based on the instructions in the current directory (`.`). You can then run a container from this image using the `docker run` command, as shown earlier.


	var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var UserSchema = new Schema({
    name: {type: String, required: true},
    email: {type: String, unique: true, required: true},
    password: {type: String, required: true},
    address: {type: String, required: true}
});
var User = mongoose.model('User', UserSchema);

module.exports = User;


8/24/17
A: Let w be 60/(-30)*(-2)/1. Calculate the smallest common multiple of 16 and w.

A: 24


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

# About

## Introduction

The purpose of this project is to test my understanding of the concepts taught in
the "Introduction to Programming Concepts" course (CS124) at the University of
Minnesota Twin Cities.  This assignment involves implementing a basic program that
counts the number of occurrences of each word in a text file and outputs the results
in alphabetical order.

## Requirements

The program should accept a text file as input, process it line by line, and count
the number of times each word appears.  The output should be sorted alphabetically
and written to a new text file.

## Concepts Covered
- [File I/O](#file-io)
- [String Processing](#string-processing)
- [Map Data Structure](#map-data-structure)
- [Sorting Algorithms](#sorting-algorithms)

# File I/O
The first step in this project is to read a text file and count the number of words it contains.  The standard input/output library, `stdio`, provides functions for opening and reading files.

## Reading Files

To open a file for reading, you can use the `fopen()` function from the standard I/O library.  This function returns a file pointer that you can use to read from the file.  Here is an example:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  FILE *fp;
  fp = fopen("input.txt", "r");
  if (fp == NULL) {
    printf("Could not open file.
");
    return 1;
  }
  // ...
}
```

In this example, `fopen()` is called with the file name "input.txt" and the mode "r", which specifies that we want to read from the file.  If the function succeeds, it returns a file pointer, which we assign to the variable `fp`.  If the function fails (e.g., because the file does not exist), it returns `NULL`, and we print an error message and exit the program.

To read from a file, you can use the `fgets()` function.  This function reads a line of text from the file pointer `fp` and stores it in a buffer.  Here is an example:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  FILE *fp;
  char line[1024];
  fp = fopen("input.txt", "r");
  if (fp == NULL) {
    printf("Could not open file.
");
    return 1;
  }
  while (fgets(line, sizeof(line), fp)) {
    // ...
  }
}
```

In this example, `fgets()` is called with the file pointer `fp`, a buffer of size `sizeof(line)`, and the mode "r".  If the function succeeds, it returns the number of characters read.  If the function fails (e.g., because there are no more lines in the file), it returns `EOF`.

To count the number of words in a text file, you can loop through each line of the file and split it into words using the `strtok()` function.  Here is an example:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  FILE *fp;
  char line[1024];
  fp = fopen("input.txt", "r");
  if (fp == NULL) {
    printf("Could not open file.
");
    return 1;
  }
  int num_words = 0;
  while (fgets(line, sizeof(line), fp)) {
    char *word;
    size_t len = strlen(line);
    for (size_t i = 0; i < len; ++i) {
      if (line[i] == ' ') {
        word = strtok(line, " ");
        num_words++;
        // ...
      }
    }
  }
}
```

In this example, we initialize a counter variable `num_words` to zero.  Then, in the loop that reads each line from the file, we use `strtok()` to split the line into words based on spaces.  For each word, we increment the counter `num_words`.

## Writing Files

To write data to a file, you can use the `fprintf()` function from the standard I/O library.  This function writes formatted output to a stream (i.e., a file pointer).  Here is an example:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  FILE *fp;
  char output[1024];
  fp = fopen("output.txt", "w");
  if (fp == NULL) {
    printf("Could not open file.
");
    return 1;
  }
  fprintf(fp, "%s
", "Hello World!");
}
```

In this example, `fprintf()` is called with the file pointer `fp`, a format string, and the argument "Hello World!".  The format string specifies how the output should be formatted.  In this case, we use `%s` to write a string, followed by a newline character `
`.

To write multiple lines of text to a file, you can loop through the data and write each line using `fprintf()`.  Here is an example:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  FILE *fp;
  char output[1024];
  fp = fopen("output.txt", "w");
  if (fp == NULL) {
    printf("Could not open file.
");
    return 1;
  }
  for (int i = 0; i < 3; ++i) {
    fprintf(fp, "%d: Hello World!
", i + 1);
  }
}
```

In this example, we use a loop to write three lines of text to the file.  For each line, we use `fprintf()` with a different argument (i.e., the value of `i + 1`).

# String Processing

The next step in this project is to process each word in the file and count its occurrences.  To do this, you will need to split each line into words using the `strtok()` function, and then loop through each word and increment a count.

## Splitting Strings

The `strtok()` function takes two arguments: a string and a delimiter.  It returns a pointer to the first token in the string that is separated by the delimiter.  If there are no more tokens, it returns a null pointer.

Here is an example of how you might use `strtok()` to split a string into words based on spaces:

```c
#include <stdio.h>
#include <string.h>

int main() {
  char *line = "Hello World!";
  char *token;
  size_t len = strlen(line);
  for (size_t i = 0; i < len; ++i) {
    if (line[i] == ' ') {
      token = strtok(line, " ");
      printf("Token: %s
", token);
    }
  }
}
```

In this example, `strtok()` is called with the string `"Hello World!"` and the delimiter `" "`.  If the function succeeds, it returns a pointer to the first token (i.e., "Hello").  Then, we print the value of the token using `printf()`.  We continue this process until the end of the line is reached (i.e., the character after the last space).

## Counting Words

To count the occurrences of each word in the file, you can use a map data structure.  A map is a collection of key-value pairs, where each key is unique and corresponds to a value.  In this case, we will use the key as the word and the value as its count.

Here is an example of how you might implement a map using an array:

```c
#include <stdio.h>
#include <string.h>

int main() {
  char *words[1024];
  int counts[1024] = { 0 };
  for (int i = 0; i < 1024; ++i) {
    words[i] = NULL;
    counts[i] = 0;
  }
  // ...
}
```

In this example, we declare two arrays: `words` and `counts`.  The `words` array is used to store pointers to the strings (i.e., the words).  The `counts` array is used to store the counts for each word.  We initialize both arrays with zeros.

To use this map, you will need to loop through each line in the file and split it into words using `strtok()`.  Then, for each word, you can search the map to see if it already exists.  If it does, you can increment its count.  If it doesn't, you can add it to the map with a count of one.

Here is an example of how you might use this map to count the occurrences of each word in the file:

```c
#include <stdio.h>
#include <string.h>

int main() {
  char *words[1024];
  int counts[1024] = { 0 };
  for (int i = 0; i < 1024; ++i) {
    words[i] = NULL;
    counts[i] = 0;
  }
  FILE *fp;
  char line[1024];
  fp = fopen("input.txt", "r");
  if (fp == NULL) {
    printf("Could not open file.
");
    return 1;
  }
  while (fgets(line, sizeof(line), fp)) {
    char *token;
    size_t len = strlen(line);
    for (size_t i = 0; i < len; ++i) {
      if (line[i] == ' ') {
        token = strtok(line, " ");
        if (strcmp(token, "hello") == 0) {
          counts[strlen(token) - 1]++;
        }
      }
    }
  }
}
```

In this example, we use a loop to read each line from the file.  For each line, we split it into words using `strtok()`.  Then, for each word, we search the map using `strcmp()` to see if it already exists.  If it does (i.e., the comparison returns zero), we increment its count by one.

## Sorting Maps

To sort the map by key (i.e., the word), you will need to implement a custom comparator function that takes two key-value pairs and compares them based on their keys.  Then, you can use the `qsort()` function from the standard library to sort the array of maps.

Here is an example of how you might implement a custom comparator function:

```c
int compare(const void *a, const void *b) {
  char *word1 = *(char **)a;
  char *word2 = *(char **)b;
  return strcmp(word1, word2);
}
```

In this example, `compare()` takes two pointers to strings (i.e., the keys of the maps).  It compares the two strings using `strcmp()`, and returns the result.

To use this comparator function to sort the array of maps, you can call `qsort()` with the array, the number of elements, and the comparator function:

```c
int count = 0;
for (int i = 0; i < 1024; ++i) {
  if (strcmp(words[i], "hello") == 0) {
    counts[strlen(words[i]) - 1]++;
    count++;
  }
}
qsort(counts, count, sizeof(int), compare);
```

In this example, we use the `count` variable to keep track of the number of elements in the map.  Then, we call `qsort()` with the array `counts`, the number of elements (i.e., `count`), and the comparator function `compare`.

# Sorting Strings

To sort the strings in the file by alphabetical order, you can use a custom comparator function that takes two string pointers and compares them using `strcmp()`.  Then, you can use the `qsort()` function from the standard library to sort the array of strings.

Here is an example of how you might implement a custom comparator function:

```c
int compare(const void *a, const void *b) {
  char *str1 = *(char **)a;
  char *str2 = *(char **)b;
  return strcmp(str1, str2);
}
```

In this example, `compare()` takes two pointers to strings.  It compares the two strings using `strcmp()`, and returns the result.

To use this comparator function to sort the array of strings, you can call `qsort()` with the array, the number of elements, and the comparator function:

```c
int count = 0;
for (int i = 0; i < 1024; ++i) {
  if (strcmp(words[i], "hello") == 0) {
    counts[strlen(words[i]) - 1]++;
    count++;
  }
}
qsort(counts, count, sizeof(int), compare);
```

In this example, we use the `count` variable to keep track of the number of elements in the map.  Then, we call `qsort()` with the array `counts`, the number of elements (i.e., `count`), and the comparator function `compare`.

# Writing Output

To write the output to a file, you can use the `fprintf()` function from the standard library.  This function takes three arguments: a pointer to a stream (i.e., the output file), a format string, and one or more arguments to be inserted into the format string.

Here is an example of how you might use `fprintf()` to write the sorted strings to a file:

```c
FILE *fp;
fp = fopen("output.txt", "w");
if (fp == NULL) {
  printf("Could not open file.
");
  return 1;
}
for (int i = 0; i < count; ++i) {
  fprintf(fp, "%s
", words[i]);
}
```

In this example, we use the `fopen()` function to open the output file for writing.  Then, we use a loop to write each sorted string to the file using `fprintf()`.  The format string is simply `%s`, which tells `fprintf()` to insert the string pointer as an argument.

Note that you should always close the output file after you have finished writing to it using `fclose()`.  This function takes a pointer to a stream (i.e., the output file) and closes it.

Here is an example of how you might use `fclose()` to close the output file:

```c
fclose(fp);
```

In this example, we simply call `fclose()` with the pointer to the output file (i.e., `fp`).  This will close the file.


 Solve 4*d = 0, -5*v + 3*v + d + 27 = 0 for v.
A: 5


3.1  Evaluation of the model
A.10: Suppose -3*a**2/4 + 795396*a/4 - 397687/2 = 0. What is a?
A.11: -1, 265131


# Why do my gifs not work on iOS?

I'm trying to add a GIF into my HTML using this code:

```
<img src="https://www.example.com/image.gif" alt="description">
```

It works in Chrome and Firefox, but it doesn't work on iOS devices. In particular I have tried on the iPhone 6s with iOS 8.4.3.

I also tried it on Safari and this is what I got:

Comment: This could be because of your server that hosts the image. Do you have a way to test if the image works fine for other devices?

## Answer (5)

This is a very common issue, try loading the image from a CDN like cdnjs, if it's not working then it's most likely related to your server, if it is working then check if your server is configured correctly for serving gifs.

Comment: That was it. Thanks for pointing me in the right direction.

## Answer (2)

If you are using an iPhone device that has not yet updated to iOS 9, you may need to specify a file size of at least 1MB for your GIFs to work properly on Safari:

```
<img src="https://www.example.com/image.gif" alt="description" width="500px" height="250px">
```


# 1. What is a cube?
A cube is a shape that has 6 faces, each of which is a square. The faces meet at right angles and the edges of the squares are equal in length.

# 2. How many sides does a cube have?
A cube has 6 sides.

# 3. What is the surface area of a cube?
The surface area of a cube can be calculated by finding the area of one face (which is a square) and multiplying it by 6. The formula for the surface area of a cube is: SA = 6s^2, where SA is the surface area and s is the length of one edge.

# 4. What is the volume of a cube?
The volume of a cube can be calculated by multiplying the length of one edge by itself twice (i.e., cubing it). The formula for the volume of a cube is: V = s^3, where V is the volume and s is the length of one edge.

# 5. Is a cube a regular shape?
Yes, a cube is a regular shape because all its sides are congruent (equal in length) and all its angles are equal to 90 degrees.


 - Suppose -2*r = 4*d - 16, r + 3*r - 28 = -5*d. Let f be (-2)/(-24)*0 - (-360)/(-9). What is the remainder when d is divided by (f/12)/((-2)/6)?
A: 2


480 567 (base 12) to base 5
A: 20331214


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

This is a collection of notes and ideas for a new type of RPG.  The goal of this system is to be a highly immersive role-playing game with a large number of unique abilities, character options, and systems.  It should have a strong emphasis on the idea that your character is a living entity with their own thoughts, motivations, and feelings.

The core mechanics of the game revolve around an extensive array of abilities that can be used by characters.  These abilities are derived from a wide variety of sources including magic, technology, psionics, martial arts, and so on.  Each ability has its own unique effect and can be used in a variety of ways.

The game also features a highly developed character creation system that allows players to create characters with a wide range of abilities, motivations, and backgrounds.  Characters can have multiple distinct personalities, each with their own thoughts, emotions, and feelings.  Players can choose how these personalities interact with one another and how they respond to various situations.

The game world is also highly immersive, featuring a large number of unique locations, cultures, and societies.  Each location has its own history, customs, and people.  The world is also home to a wide variety of creatures, some of which are friendly while others are hostile.  Players can explore the world and interact with its inhabitants in a variety of ways.

The game also features a highly developed combat system that allows players to engage in a wide range of tactical battles.  Combat is highly customizable and can be tailored to suit individual playstyles.  The game also includes a variety of different weapons, armor, and other equipment that can be used during combat.

Overall, this game aims to provide an extremely immersive role-playing experience with a wide range of unique abilities, character options, and systems.  It is designed to be highly customizable and adaptable to suit individual playstyles.


 //
//  ProfileHeader.swift
//  MyProject
//
//  Created by Zhao Yanjun on 2021/6/15.
//

import UIKit

class ProfileHeader: UITableViewCell {

    @IBOutlet weak var imageView: UIImageView!
    @IBOutlet weak var nameLabel: UILabel!

    func configure(with user: User) {
        imageView.image = user.avatar
        nameLabel.text = user.name
    }
}


321. Let n(b) be the second derivative of b**6/180 - 13*b**5/45 + 7*b**4/18 + 29*b**3/3 - 6*b**2 - 14*b. Find the third derivative of n(w) wrt w.
Answer: 24*w - 260


	* [Home](../index.md)
	* [Students](../students/index.md)
	* [Syllabus](syllabus.md)
	* [Assignments](assignments.md)
	* [Lecture Notes](lecture-notes/index.md)
	* [Quizzes](quizzes.md)
	* [Resources](resources.md)
	* [FAQs](faqs.md)

# Quiz 3

## Problem 1: Factor 2x^3 - 9x^2 + 18x - 3

A: `(2x-3)(x^2-6)`

## Problem 2: Find the third derivative of `f(x) = 7*x**4 + 16*x**3 - x**2` with respect to `x`.

A: `288*x`

## Problem 3: What is the second derivative of `g(x) = x^3 + 2*x - 1` with respect to `x`?

A: `6*x`

## Problem 4: Find the first derivative of `h(u) = u**5 + 10*u**2` with respect to `u`.

A: `5*u**3 + 20*u`


This page contains an example of a simple PHP script that uses a text file to store information about users. Each line in the file contains information about one user, with the format being: first name, last name, email address.
   The script allows users to add new users, edit existing users, and delete users from the file. It also displays all users in the file.

<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>User Management</title>

User Management

    <form action="add_user.php" method="post">
        First Name: <input type="text" name="first_name">

        Last Name: <input type="text" name="last_name">

        Email Address: <input type="email" name="email">

        <input type="submit" value="Add User">
    </form>

    <form action="display_users.php" method="post">
        <input type="submit" value="Display Users">
    </form>

    <form action="edit_user.php" method="post">
        User ID: <input type="number" name="user_id">

        First Name: <input type="text" name="first_name">

        Last Name: <input type="text" name="last_name">

        Email Address: <input type="email" name="email">

        <input type="submit" value="Edit User">
    </form>

    <form action="delete_user.php" method="post">
        User ID: <input type="number" name="user_id">

        <input type="submit" value="Delete User">
    </form>


7/28/2015 - 2:05 PM EDT

"The World Today" is the official podcast of Voice of America and delivers breaking news, analysis and commentary from across the globe. It's your host, Steve King.

Today, we're covering the latest developments in Syria, Russia's military presence in Ukraine, and the United Nations' efforts to negotiate a peace deal in Yemen.

Syria:

The Syrian Civil War continues to rage on with fighting between government forces and opposition groups intensifying in recent weeks. On Sunday, pro-government forces launched an attack on the rebel stronghold of Jisr al-Shughur in Idlib province. The attack left dozens of civilians dead and hundreds injured, according to opposition activists. Meanwhile, the United States and its allies continue to provide military aid to opposition groups.

Russia's Military Presence in Ukraine:

The conflict between Russia and Ukraine continues to escalate with Russian troops massing along the border with Ukraine. On Monday, Ukrainian defense officials reported that Russian troops had crossed into Ukrainian territory near the city of Donetsk. The move comes after a series of ceasefire violations by pro-Russian separatists in eastern Ukraine. Russia has denied any involvement in the conflict and calls for a peaceful resolution.

UN Efforts to Negotiate a Peace Deal in Yemen:

The United Nations is continuing its efforts to negotiate a peace deal in Yemen, which has been engulfed in civil war since 2015. On Monday, UN Secretary-General Ban Ki-moon met with Yemeni leaders to discuss the latest developments in the conflict. The talks have yet to yield any concrete results and violence continues to plague the country, with both sides accusing the other of human rights abuses.

That's "The World Today" for now. Join us again tomorrow for more news from around the world.


## 1. 概述

- 在此示例中，我们使用了[kubernetes](https://github.com/Kubernetes)的[基本部署](https://github.com/Kubernetes/samples/blob/master/deployments/basic/)和[基本服务](https://github.com/Kubernetes/samples/blob/master/services/basic/)示例来演示如何使用kubectl命令行工具部署一个简单的web应用程序。
- 在此示例中，我们使用[nginx](https://github.com/nginx/nginx)作为服务器运行的web应用程序。
- 通过执行kubectl命令来部署和管理应用程序。
- 通过使用kubectl exec命令运行容器中的命令行工具，可以查看和修改应用程序。

## 2. 环境搭建

- 安装kubernetes：参考[下文](https://github.com/Kubernetes/samples/blob/master/README.md#installing-the-tools)。
- 从源代码安装nginx：
```css
sudo apt-get update
sudo apt-get install build-essential libssl-dev zlib1g-dev
cd /usr/src/nginx && ./configure --with-http_ssl_module --add=https://github.com/arut/nginx-ssl-conf.git && make
sudo rm -rf /etc/nginx/ && sudo cp -i /usr/src/nginx/conf/default /etc/nginx/default
sudo systemctl enable nginx && sudo systemctl start nginx
```
- 从源代码安装kubernetes：
```csharp
git clone https://github.com/kubernetes-samples/node-deployments.git
cd node-deployments
kubectl create cluster mycluster --config minion --minion-ip 192.168.100.50
kubectl config use-cluster mycluster
kubectl apply -f deployments/replicaSet.yaml
```
## 3. 部署
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Ingress
metadata:
  name: nginx-ingress
spec:
  rules:
    - host: ingress.example.com
      http:
        paths:
          - path: /
            backend:
              service:
                name: nginx
                port:
                  name: http
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Ingress
metadata:
  name: nginx-ingress
spec:
  rules:
    - host: ingress.example.com
      http:
        paths:
          - path: /
            backend:
              service:
                name: nginx
                port:
                  name: http
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Ingress
metadata:
  name: nginx-ingress
spec:
  rules:
    - host: ingress.example.com
      http:
        paths:
          - path: /
            backend:
              service:
                name: nginx
                port:
                  name: http
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Ingress
metadata:
  name: nginx-ingress
spec:
  rules:
    - host: ingress.example.com
      http:
        paths:
          - path: /
            backend:
              service:
                name: nginx
                port:
                  name: http
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Ingress
metadata:
  name: nginx-ingress
spec:
  rules:
    - host: ingress.example.com
      http:
        paths:
          - path: /
            backend:
              service:
                name: nginx
                port:
                  name: http
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
```
- 创建一个文件夹，保存下面的代码：
```makefile
apiVersion: v1
kind: Ingress
metadata:
  name: nginx-ingress
spec:
  rules:
    - host: ingress.example.com
      http:
        paths:
          - path: /
            backend:
              service:
                name: nginx
                port:
                  name: http
```


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

#  **Python: Calculate the lowest common multiple of 46850 and 129720.**

**Formula:** lcm(a, b) = a * (b//gcd(a, b))

##  **Answer:** 46850

###  **Explanation:**

*We can use the formula for finding the lowest common multiple of two numbers. In this case, a = 46850 and b = 129720.*

*The greatest common divisor (gcd) of 46850 and 129720 is 50.*

*We can divide b by gcd(a, b) to get the value of (b//gcd(a, b)), which is 25836.*

*Finally, we multiply a by this value to get the lowest common multiple, lcm(a, b): 46850 * 25836 = 12972000.*

##  **Sources:**

1. [lcm calculator](https://www.mathsisfun.com/calculators/lcm-calculator.html)


 * @param {object} params - object containing the parameters for the api request
* @returns {object} response from the api
*/
import axios from 'axios';
const baseUrl = process.env.REACT_APP_API_URL || "http://localhost:8080";

//create post
export const createPost = (params) => {
  return new Promise((resolve, reject) => {
    axios.post(baseUrl + '/posts', params)
      .then(response => {
        resolve(response);
      })
      .catch(error => {
        reject(error);
      });
  });
};
//get all posts
export const getAllPosts = (params) => {
  return new Promise((resolve, reject) => {
    axios.get(baseUrl + '/posts', params)
      .then(response => {
        resolve(response);
      })
      .catch(error => {
        reject(error);
      });
  });
};
//get one post
export const getOnePost = (params) => {
  return new Promise((resolve, reject) => {
    axios.get(baseUrl + '/posts/' + params)
      .then(response => {
        resolve(response);
      })
      .catch(error => {
        reject(error);
      });
  });
};
//update post
export const updatePost = (params) => {
  return new Promise((resolve, reject) => {
    axios.put(baseUrl + '/posts/' + params)
      .then(response => {
        resolve(response);
      })
      .catch(error => {
        reject(error);
      });
  });
};
//delete post
export const deletePost = (params) => {
  return new Promise((resolve, reject) => {
    axios.delete(baseUrl + '/posts/' + params)
      .then(response => {
        resolve(response);
      })
      .catch(error => {
        reject(error);
      });
  });
};


 --[[
#	@Author: Liangchengxin
#	@Date:   2017-11-24 16:38:59
#	@Last Modified by: Liangchengxin
#	@Last Modified time:   2018-01-15 10:02:21
#	@Description:  新增商品列表页面
--]]

function initView(view, data)
	local content = {}
	content.cells = {}
	for i = 1, #data do
		local cell = {}
		cell.productId = data[i].productId
		cell.name = data[i].productName
		cell.price = data[i].price
		cell.image = data[i].image
		cell.state = data[i].state
		content.cells[i] = cell
	end
	view:setContent(content)
end


1. What is 614 minutes before 10:35 PM?
A: 12:21 PM


 - Calculate the remainder when 8537 is divided by 341.
A: 2


 -
- What is the remainder when 1076430236 is divided by 18?
Answer: 16


8:42 am, July 10th, 2022

Hello everyone! Today we’re going to talk about one of the most important aspects of our daily lives. We’ll be discussing sleep and its impact on our overall well-being.

We all know how important it is to get enough sleep, but do you really understand just how much? According to recent research, adults need at least 7-9 hours of quality sleep each night to maintain optimal health. However, many people struggle to achieve this amount, and the consequences can be devastating.

Lack of sleep can lead to a range of health problems, including obesity, diabetes, heart disease, and even cancer. It can also impair cognitive function, memory, and concentration, leading to decreased productivity at work or school. In addition, lack of sleep has been linked to increased risk of depression, anxiety, and other mental health disorders.

So how do we ensure that we’re getting enough quality sleep each night? Firstly, it’s important to establish a regular sleep schedule and stick to it as much as possible. This means going to bed and waking up at the same time every day, even on weekends. Secondly, it’s essential to create a relaxing bedtime routine that helps you unwind and prepares your body for sleep. This might include activities such as reading, taking a warm bath, or practicing relaxation techniques like meditation or deep breathing.

It’s also important to pay attention to the quality of your sleep. If you find yourself tossing and turning or waking up frequently during the night, it could be a sign that you’re not getting enough deep, restorative sleep. In this case, it might be helpful to investigate possible underlying causes such as stress, anxiety, or an uncomfortable sleep environment.

Finally, don’t underestimate the importance of exercise in promoting good sleep. Regular physical activity has been shown to improve both quantity and quality of sleep, helping you feel more rested and refreshed throughout the day.

In conclusion, getting enough quality sleep is crucial for our overall health and well-being. By establishing a regular sleep schedule, creating a relaxing bedtime routine, and paying attention to the quality of your sleep, you can help ensure that you’re giving your body the best chance to recharge and thrive. Thanks for joining me today!


 *
  *  Copyright (C) 2013-2017, Avalanche Software. All rights reserved.
  */

#include "avatar/Avatar.h"
#include "common/debugging/Debug.h"
#include "game_systems/systems/audio/AudioManager.h"
#include "game_systems/systems/base/BaseSystem.h"
#include "game_systems/systems/camera/CameraSystem.h"
#include "game_systems/systems/game_logic/GameLogicSystem.h"
#include "game_systems/systems/physics_2d/Physics2DSystem.h"
#include "game_systems/systems/physics_3d/Physics3DSystem.h"
#include "game_systems/systems/scene_graph/SceneGraphSystem.h"
#include "game_systems/systems/user_interface/UserInterfaceSystem.h"
#include "platform/platform.h"
#include "strings/string.h"
#include "strings/text_stream.h"
#include "strings/text_writer.h"

namespace avatar {

Avatar::Avatar() : m_systems{ nullptr } {
}

Avatar::~Avatar() {
  // Nothing to do here.
}

void Avatar::Init(
    base::BaseSystem* system,
    scene_graph::SceneGraphSystem* scene_graph_system,
    physics_2d::Physics2DSystem* physics_2d_system,
    physics_3d::Physics3DSystem* physics_3d_system) {
  m_systems = {
      system, scene_graph_system, physics_2d_system, physics_3d_system,
  };
}

void Avatar::Update() {
  // Nothing to do here.
}

void Avatar::Shutdown() {
  // Nothing to do here.
}

// Register a system with the avatar.
void base::RegisterAvatarSystem(
    Avatar* avatar,
    base::BaseSystem* system) {
  if (avatar && system) {
    avatar->m_systems[system->GetType()] = system;
  }
}

// Get the registered avatar system.
base::BaseSystem* base::GetAvatarSystem(
    Avatar* avatar,
    base::BaseSystemType type) {
  if (avatar && type == base::BaseSystemType_SceneGraph) {
    return avatar->m_systems[type];
  }
  return nullptr;
}

// Get the registered avatar system.
base::BaseSystem* base::GetAvatarSystem(
    Avatar* avatar,
    const char* name) {
  if (avatar && name == "scene_graph") {
    return avatar->m_systems[name];
  }
  return nullptr;
}

// Get the registered avatar system.
base::BaseSystem* base::GetAvatarSystem(
    Avatar* avatar,
    const char* name,
    const char* version) {
  if (avatar && name == "scene_graph") {
    return avatar->m_systems[name + "_" + version];
  }
  return nullptr;
}

}


	$('.contact-form .btn').on('click', function() {
    var name = $('.name').val();
    var email = $('.email').val();
    var message = $('.message').val();

    if(!name || !email || !message) {
        alert("All fields must be filled out");
        return false;
    } else {
        $.ajax({
            type: "POST",
            url: "https://www.example.com/contact-form",
            data: { name, email, message },
            success: function(response) {
                alert("Message sent successfully!");
            },
            error: function() {
                alert("Error sending message. Please try again.");
            }
        });
        return false;
    }
});


 - Let x = 0.1937 + -0.19368. Let u be 3/(24/(-4))*-5. Which is the third biggest value?  (a) x  (b) u  (c) -0.1
A: c


 //
//  CardsViewController.swift
//  Pokecard
//
//  Created by Alex on 7/15/22.
//

import UIKit

class CardsViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        setUpTableView()

        // Do any additional setup after loading the view, typically from a nib.
    }

    @IBOutlet weak var tableView: UITableView!

    func setUpTableView() {
        tableView.delegate = self
        tableView.dataSource = self

        tableView.register(UINib(nibName: "CardTableViewCell", bundle: nil), forCellReuseIdentifier: "cardCell")

        tableView.rowHeight = 120
        tableView.backgroundColor = .white
    }
}

extension CardsViewController : UITableViewDelegate, UITableViewDataSource {

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

        return 120
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

        let cell = tableView.dequeueReusableCell(withIdentifier: "cardCell", for: indexPath) as! CardTableViewCell

        return cell
    }

}