File size: 189,539 Bytes
7ec75e2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 | {
"course": "Advanced_Programming",
"course_id": "CO2039",
"schema_version": "material.v1",
"slides": [
{
"page_index": 0,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_001.png",
"page_index": 0,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:18+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP. HÖ CHi MINH TP.HCM Advancea Programming C02039 Chapter 1: Object Oriented Programming Revision - Encapsulation DAI HQC QUÖC GIA THANH PHÖ HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 1,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_002.png",
"page_index": 1,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:21+07:00"
},
"raw_text": "CONTE NT 01 NTRODUCTION TO OOP 02 ENCAPSULATION HOW ENCAPSULATION 03 WORKS? 04 BEST PRACTICES 05 CONCLUSION 06 EXTENSIONE CLASS DIAGRAM 2"
},
{
"page_index": 2,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_003.png",
"page_index": 2,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:24+07:00"
},
"raw_text": "NTRODUCTIO N I TO OBJECT 01 ORIENTED PROGRAMMIN G 3"
},
{
"page_index": 3,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_004.png",
"page_index": 3,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:28+07:00"
},
"raw_text": "What is OOP? Abstraction Object-oriented programming (OOP) is a Polymorphism Encapsulation programming paradigm 1 that organizes software Object-Oriented design around objects, which Programming / can represent real-world entities or abstract concepts Inheritance Classes Each object contains data Objects (attributes or properties) and behavior (methods or functions) 4"
},
{
"page_index": 4,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_005.png",
"page_index": 4,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:31+07:00"
},
"raw_text": "Key principles of OOP Abstraction Encapsulation: Bundles data (attributes) and methods Polymorphism Encapsulation (behavior) into a single unit 1 (class) and restricts access to Object-Oriented protect data integrity Programming Example: A Car object has Inheritance Classes private attribute speed and a Objects public method getSpeed() to access it. => Protects data integrity by 5"
},
{
"page_index": 5,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_006.png",
"page_index": 5,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:35+07:00"
},
"raw_text": "Key principles of OOP Abstraction Inheritance: Allows one class to inherit attributes and Polymorphism Encapsulation methods from another, 1 promoting code reuse and Object-Oriented hierarchical relationships Programming Example: A Truck class can Inheritance Classes inherit from a Vehic/e class Objects => Promotes code reuse 6"
},
{
"page_index": 6,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_007.png",
"page_index": 6,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:38+07:00"
},
"raw_text": "Key principles of OOP Abstraction Polymorphism: Allows objects to take on many Polymorphism Encapsulation forms, e.g., a single method 1 or class to represent different Object-Oriented underlying data types or Programming behaviors Inheritance Classes Example: A draw( method Objects behaves differently for Circ/e and Rectang/e objects. =>Simplifies code and makes 7"
},
{
"page_index": 7,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_008.png",
"page_index": 7,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:42+07:00"
},
"raw_text": "Key principles of OOP Abstraction Abstraction: Hides implementation details and Polymorphism Encapsulation exposes only essential 1 features, simplifying complex Object-Oriented systems for the user. Programming Example: A user presses a Inheritance Classes car's \"start\" button without Objects needing to understand the engine mechanics. =>Reduce complexity 8"
},
{
"page_index": 8,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_009.png",
"page_index": 8,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:46+07:00"
},
"raw_text": "Why OOP? Create systems that are modular, scalable, reusable and easier to understand. Think of a car in the real world. It has: Attributes: color, brand, speed, fuel capacity Behaviors: start, stop, accelerate. Modular -> divides programs into independent, self- contained classes Scalable -> allows new functionality to be added or extended Reusable -> creating generic classes or extending existing classes 9"
},
{
"page_index": 9,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_010.png",
"page_index": 9,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:48+07:00"
},
"raw_text": "ENCAPSULATI 02 ON 10"
},
{
"page_index": 10,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_011.png",
"page_index": 10,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:51+07:00"
},
"raw_text": "What is Encapsulation? When creating new data types (classes) the details of the actual data and the way operations work is hidden from the other programmers who will use those new data types Encapsulation IN - CAPSULE - ation class Variables Methods 11"
},
{
"page_index": 11,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_012.png",
"page_index": 11,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:55+07:00"
},
"raw_text": "Why is Encapsulation important? By controlling how data and methods are accessed or modified Why? encapsulation ensures: Data Integrity: Prevents unauthorized or accidental changes to data. Security: Sensitive data is hidden from unauthorized access. Ease of Use: Users of the class do not need to understand its internal complexities. 12"
},
{
"page_index": 12,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_013.png",
"page_index": 12,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:28:58+07:00"
},
"raw_text": "Core principles of Encapsulation Data Hiding: The internal state of an object is kept private and can only be accessed through public methods (getters and setters). Access Control: Access specifiers are used to control the visibility of class members: private: Accessible only within the defining class. default: Accessible only within the same package protected: Accessible within the same package and by subclasses (even in different packages)) public: Accessible from anywhere (any class, any package, and any subclass). 13"
},
{
"page_index": 13,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_014.png",
"page_index": 13,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:03+07:00"
},
"raw_text": "Example public class Person { // Public: Accessible anywhere public String name; // Protected: Accessible within the same package or by subclasses protected int age; // Default (Package-private): Accessible only within the same package String address; // Private: Accessible only within this class private String password; // Constructor to initialize the object public Person String name, : int age, String address, String password) { this name = name this age = age this address = address this password = password } / Getter for password to demonstrate controlled access public String getPassword() { return password; } 14"
},
{
"page_index": 14,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_015.png",
"page_index": 14,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:06+07:00"
},
"raw_text": "HOW 03 ENCAPSULATI ON WORKS? 15"
},
{
"page_index": 15,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_016.png",
"page_index": 15,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:09+07:00"
},
"raw_text": "Class vs struct structure class Defining Classes and struct struct_name class class-name Objects // struct data members // data } // functions }; = Can I use Struct instead of Class? Java: no struct Struct Class Default Access Public Private Encapsulatior Less support Full support Use case Light weight objects All 16"
},
{
"page_index": 16,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_017.png",
"page_index": 16,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:13+07:00"
},
"raw_text": "Constructor in Encapsulation A constructor is a special function in a class: Same name as the class. Not have a return value. It is automatically called when an object is created (the programmer does not call it directly). If no constructor is declared, the program automatically provides a default empty constructor. What is the access modifier for the default constructor? - Can we create a private constructor? (Sing/eton Pattern 17"
},
{
"page_index": 17,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_018.png",
"page_index": 17,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:17+07:00"
},
"raw_text": "Getters and Setters Getters and Setters Example: public class Getset are methods used to private int age access and modify // Getter for 'age public int getAge the private fields of a return age class, adhering to the principles of // Setter for 'age' with validation public void setAge int age encapsulation if age 0 this age age, else System out.println \"Age cannot be negative.\" public static void main String args 18"
},
{
"page_index": 18,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_019.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_019.png",
"page_index": 18,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:20+07:00"
},
"raw_text": "Getters and Setters -Encapsulation: Protects the internal state of an object. -Control: Allows you to validate or modify data before it's set. -Consistency: Helps maintain consistent object state. -Flexibility: Makes it easier to change the internal implementation without affecting other code -Readability: Improves the readability and maintainability of the code. -Access Control: Allows creation of read-only or write-only properties. -Debugging: Enables easy tracking and debugging of changes to the data. 19"
},
{
"page_index": 19,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_020.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_020.png",
"page_index": 19,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:22+07:00"
},
"raw_text": "BEST 04 PRACTICES 20"
},
{
"page_index": 20,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_021.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_021.png",
"page_index": 20,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:26+07:00"
},
"raw_text": "Exercise 1 - Multiple constructor Create a Car class with the following private attributes: brand (string) model (string) year (int) Add the following: A default constructor that sets default values. A parameterized constructor to initialize all attributes. Setters and getters for all attributes. Write a main function to: Create an object using the default constructor and display its details. Create another object using the parameterized constructor and display its details. 21"
},
{
"page_index": 21,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_022.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_022.png",
"page_index": 21,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:28+07:00"
},
"raw_text": "Exercise 2 - Constructor chaining Create a Laptop class with attributes: brand (string) model (string) price (double) Add the following: A default constructor. A parameterized constructor to initialize all attributes. Use constructor chaining to call one constructor from another Write a main function to test the class 22"
},
{
"page_index": 22,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_023.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_023.png",
"page_index": 22,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:31+07:00"
},
"raw_text": "Exercise 3 (Bonus) Create a Library system using encapsulation and constructors. 1. Create a Book class with attributes: tit/e, author, /sBN, price and stock. 2. Create a Library class with: a. An array of Book objects b. Methods to: I. Add new books. ii. Search for books by title or author. iii. Borrow books (reduce stock) 3. Write a main function to simulate library operations 23"
},
{
"page_index": 23,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_024.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_024.png",
"page_index": 23,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:33+07:00"
},
"raw_text": "05 CONCLUSION 24"
},
{
"page_index": 24,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_025.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_025.png",
"page_index": 24,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:36+07:00"
},
"raw_text": "Conclusion 1. Encapsulation is the foundation of OOP, focusing on bundling data and functions within a class. 2. The main difference between a class and a struct lies in the Ievel of data security (private/public). 3. A constructor is a special mechanism in OOP that automatically executes when an object is created and can cause errors if not properly designed 25"
},
{
"page_index": 25,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_026.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_026.png",
"page_index": 25,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:37+07:00"
},
"raw_text": "EXTENSION: 06 CLASS DIAGRAM 26"
},
{
"page_index": 26,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_027.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_027.png",
"page_index": 26,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:40+07:00"
},
"raw_text": "Class diagram Circle tvarName:type = default-value radius:double = 1.0 - denotes private access -color:String = \"red\" + denotes public access +Circle() +Circle(r:double) +getRadiusO:double tmethodName(parmName: type, : . :) :retunType +getAreaO:double Can you write a program based on the above class diagram? 27"
},
{
"page_index": 27,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_028.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_028.png",
"page_index": 27,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:47+07:00"
},
"raw_text": "A class called Ball which models a bouncing ball, is Hands-on exercise designed as shown in the following class diagram Ball It contains its radius, x -x:float -y:float Each move step advances x and y and y position. Each -radius:int by x and y. x and y could be -xDelta:float move-step advances the x positive or negative. -yDelta:float and y by delta-x and +Ball(x:float,y:float,radius:int delta-y, respectively. xDelta:float,yDelta:float +getXQ:float delta-x and delta-y could +setx(x:float):void +getYQ:float be positive or negative +setY(y:float):void The reflectHorizontalO +getRadius():int +setRadius(radius:int):void and reflectVerticalO Move one step: +getXDeltaO:float x += 4x; y += Oy; methods could be used to +setXDelta(xDelta:float):void +getYDelta:float 4x = -Ax bounce the ball off the +setYDelta(yDelta:float):void +moveQ:void- walls, Write the Ball class. 4y = -4y treflectHorizontalQ:voido Study the mainO on how +reflectVerticalQ:void- \"Ball[(x,y),speed=(Ax,4y)] +toStringQ:String° the ball bounces. https://www.programiz.co m/online-compiler/5VrKcT 28"
},
{
"page_index": 28,
"chapter_num": 1,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_029.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_1/slide_029.png",
"page_index": 28,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:49+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 29,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_001.png",
"page_index": 29,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:52+07:00"
},
"raw_text": "DAI HOC BK QUOC GIA TP. HÖ CHi MINH TP.HCM Advanced Programming CO2039 Chapter 2: Object Oriented Programming Revision - Inheritance DAI HQC QUÖC GIA THANH PHÖ HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 30,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_002.png",
"page_index": 30,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:56+07:00"
},
"raw_text": "Additional Notes Call constructor of the superclass Default baseclass Class Object Overloading method Subclass inherits ALl members of the superclass 2"
},
{
"page_index": 31,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_003.png",
"page_index": 31,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:29:59+07:00"
},
"raw_text": "CONTE NT 01 NTRODUCTION TO INHERITANCE KEY CONCEPTS OF 02 NHERITANCE HOW INHERITANCE 03 WORKS? 04 BEST PRACTICES 05 CONCLUSION 06 EXTENSIONE COMPOSITION 3"
},
{
"page_index": 32,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_004.png",
"page_index": 32,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:01+07:00"
},
"raw_text": "INTRODUCTIO 01 N TO NHERITANCE 4"
},
{
"page_index": 33,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_005.png",
"page_index": 33,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:04+07:00"
},
"raw_text": "What is lnheritance? A mechanism for creating a new class (called a derived class or child class) from an existing class (called a base class or parent class) to reuse and extend its functionality Animal Inheritance Dog Cat 5"
},
{
"page_index": 34,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_006.png",
"page_index": 34,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:07+07:00"
},
"raw_text": "Why is Inheritance important? Code Reusability: Reuse of common logic from base classes = codebase more efficient and maintainable Extensibility: New features can be added by extending the base class - easy updates without affecting existing code. Polymorphism: Introduced in Chap 3 later. Hierarchical Organization: 6"
},
{
"page_index": 35,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_007.png",
"page_index": 35,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:09+07:00"
},
"raw_text": "KEY 02 CONCEPTS OF INHERITANCE 7"
},
{
"page_index": 36,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_008.png",
"page_index": 36,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:13+07:00"
},
"raw_text": "Base class & Derived class Base class (Parent/Superclass) : The class whose properties (attributes) and methods (functions) are inherited by another class. Exanva caimatiria/sscflas: Animal Deri The class inheriting from the base Inheritance class. It can use or override the members of the base class and add its own = \"is-a\" relationship Dog Cat Examp/e: Dog inherits from Animal = Dog \"is-a\" Animal. 8"
},
{
"page_index": 37,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_009.png",
"page_index": 37,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:17+07:00"
},
"raw_text": "Method overriding A derived class can redefine (override) a method from the base class to provide specific functionality. The method in the base class must have the same name, return type, and parameters as the created, the base class constructor is called first followed by the derived cJass constructor. Destructors: When an öbject is destroyéd, the derived class destructor is called first, followed by the base class destructor. Introduced more detailed in Chap 3 - 9 Polymorphism"
},
{
"page_index": 38,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_010.png",
"page_index": 38,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:20+07:00"
},
"raw_text": "Types of Inheritance Single Inheritance: A derived class inherits from one base class. Multiple Inheritance: A class inherits from more than one base class. (Supported in C++ but not in Java) Multilevel Inheritance: A class inherits from a derived class, forming a chain. Hierarchical Inheritance: Multiple derived classes inherit from one base class. Hybrid Inheritance: A combination of two or more types of inheritance. 10"
},
{
"page_index": 39,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_011.png",
"page_index": 39,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:23+07:00"
},
"raw_text": "Types of Inheritance ClassA ClassA ClassA ClassB ClassB ClassB ClassC Single Inheritance HierarchicalInheritance ClassC ClassA MultilevelInheritance Diamo nd ClassA ClassB ClassB ClassC Proble m? ClassC ClassD Multiple Inheritance Hybrid Inheritance 11"
},
{
"page_index": 40,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_012.png",
"page_index": 40,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:25+07:00"
},
"raw_text": "HOW 03 INHERITANCE WORKS? 12"
},
{
"page_index": 41,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_013.png",
"page_index": 41,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:28+07:00"
},
"raw_text": "Subclass inherits all members from WHpersloaass inherits from a superclass: All members of the superclass, whether public or private, are technically inherited. However, accessibility depends on the access specifier: O Public and protected members can be direct/y accessed in the subclass. Private members are inherited but not accessible direct/y; they are accessible through public or protected getters and setters in the superclass. 13"
},
{
"page_index": 42,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_014.png",
"page_index": 42,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:32+07:00"
},
"raw_text": "Subclass inherits all members s from Superclass MODE OF INHERITANCE Base class member Public Protected Private access specifier Public Public Protected Private Protected Protected Protected Private Private NotAccessible Not Accessible Not Accessible (Hidden) (Hidden) (Hidden) 14"
},
{
"page_index": 43,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_015.png",
"page_index": 43,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:36+07:00"
},
"raw_text": "Pointers for Polymorphism (1) class Superclass { public: }; Subclass s class Subclass : public Superclass { public: void display() override { cout << \"Subclas$n\"; } }; sup sub int main( { Subclass sub; Superclass sup = sub, sup.displayO; // Output: ??? 15"
},
{
"page_index": 44,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_016.png",
"page_index": 44,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:39+07:00"
},
"raw_text": "Pointers for Polymorphism (2) class Superclass { public: }; Subclass s class Subclass : public Superclass { public: void display() override { cout << \"Subclas$n\"; } }; sup sub int main( { Subclass sub; Superclass* sup = ⊂ sup->displayO; // Output: ??? 16"
},
{
"page_index": 45,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_017.png",
"page_index": 45,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:42+07:00"
},
"raw_text": "Implicit use of pointers class Superclass { public void display( { System.out.println(\"Superclass\"); } } In Java (and many other OOP class Subclass extends Superclass languages): All objects are @Override public void display() { accessed via references System.out.println(\"Subclass\") (similar to pointers in C++): } } public class Main { public static void main(String[] args) { Superclass obj = new SubclassO; obj.displayO; // Output: ??? } } 17"
},
{
"page_index": 46,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_018.png",
"page_index": 46,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:44+07:00"
},
"raw_text": "BEST 04 PRACTICES 18"
},
{
"page_index": 47,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_019.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_019.png",
"page_index": 47,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:47+07:00"
},
"raw_text": "Exercise 1 - Inheritance in Vehicle classes (1 Create a base class Vehicle with the following private attributes: brand (string) year(int) Add the following to Vehicle: A default constructor that sets default values \"Unknown\" for brand, 0 for year) A parameterized constructor to initialize brand and year. Setters and getters for brand and year. A method displaylnfo() to print details of the vehicle. 19"
},
{
"page_index": 48,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_020.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_020.png",
"page_index": 48,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:51+07:00"
},
"raw_text": "Exercise 1 - Inheritance in Vehicle classes Add a private attribute: mode/ (string)) Provide a default constructor and a parameterized constructor for Car using constructor chaining. Override the displaylnfo() method to include model. Create another derived class Bike that inherits from Vehicle: Add a private attribute: engineCapacity (int) Provide constructors and override displaylnfo() to include engineCapacity In the main function: Create a Car object using both default and parameterized constructors and display its details. Create a Bike object using both default and parameterized constructors and display its details. 20"
},
{
"page_index": 49,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_021.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_021.png",
"page_index": 49,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:30:55+07:00"
},
"raw_text": "Exercise 2 - Enhanced Library System withalnberitance (1) Attributes: title, author, ISBN, price, and stock. Methods: Constructor to initialize attributes. Getter and setter methods A virtual displayDetails() method to display book information. Derived Classes: EBook (inherits Book) Additional attribute: fileSize (in MB Override displayDetails() to include file size PrintedBook (inherits Book) Additional attribute: pageCount. Override displayDetails() to include page count 21"
},
{
"page_index": 50,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_022.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_022.png",
"page_index": 50,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:00+07:00"
},
"raw_text": "Exercise 2 - Enhanced Library System W A dynamic array or vector of pointers to Book objects (supporting both EBook and PrintedBook) Methods: addBook(Book*): Add a new book (of any type) searchByTitle(string) and searchByAuthor(string): Search books by title/author. borrowBook(string ISBN): Reduce stock of the specified book by 1. displayAllBooks(): Display all books in the library Main Function: Add a mix of EBook and PrintedBook objects to the library Simulate user operations: Search for books by title/author, Borrow books, Display all books. 22"
},
{
"page_index": 51,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_023.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_023.png",
"page_index": 51,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:05+07:00"
},
"raw_text": "Exercise 3 - Point2D and Point3D Point2D -x:float = 0.0f -y:float = 0.0f +Point2D(x:float,y:float) +Point2D() +getXQ:float +setX(x:float):void +getY(:float Can you write a +setY(y:float):void +setXY(x:float,y:float):void Array of{x,y} program based on this +getXY():float[2] class diagram? +toStringO:String \"(x,y)\" extends Point3D -z:float = 0.0f +Point3D(x:float,y:float,z:float) +Point3D() +getZQ:float +setZz:flaot):void +setXYZ(x:float,y:flaot,z:float):void,- Array of{x,y,z} +getXYZ(:f1oat[3] +toString: String \"(x,y,z)\" 23"
},
{
"page_index": 52,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_024.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_024.png",
"page_index": 52,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:07+07:00"
},
"raw_text": "05 CONCLUSION 24"
},
{
"page_index": 53,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_025.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_025.png",
"page_index": 53,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:10+07:00"
},
"raw_text": "Conclusion 1. Inheritance is a fundamental concept of OOP, enabling the creation of new classes by reusing and extending existing ones. 2. The primary benefit of inheritance lies in code reuse and the establishment of hierarchical relationships between classes. 3. Method overriding and dynamic binding' are key mechanisms in inheritance, supporting polymorphism and enhancing flexibility in design lntroduced in Chap 3 - Polymorphism 25"
},
{
"page_index": 54,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_026.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_026.png",
"page_index": 54,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:11+07:00"
},
"raw_text": "EXTENSION: 06 COMPOSITION 26"
},
{
"page_index": 55,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_027.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_027.png",
"page_index": 55,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:17+07:00"
},
"raw_text": "OOP Composition Book 1 -name: String Author has -author:Author -name : String -price:double -email: String -qty:int = 0 -gender:char Author +Book(name:String,author:Author, -name : String No default values for the variables price:double) -email: String +Book(name:String,author:Author, -gender: char char of 'm' or 'f' price:double,qty:int) +getName() : String +Author(name:String +getAuthor:Author email:String, gender:char) +getName(): String +getPrice:double +setPrice(price:double):void +getEmail:String +getQty:int +setEmail(email:String):void +setQty(qty:int):void +getGenderO:char +toStringQ:String \"Author[name=?,email=?,gender=?]' +toStringQ : String \"Book[name=?,Author[name=?,email=?,gender=?]price=?,gty=?]\" You need to reuse Author's toString(). Complete this code: https://www.programiz.com/online-compiler/03auguyMRlCj0 27"
},
{
"page_index": 56,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_028.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_028.png",
"page_index": 56,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:22+07:00"
},
"raw_text": "Hands-on exercise Book m Author -name: String -name : String -authors:Author[] -email: String -price:double -gender: char -qty:int = 0 +Book(name: String,authors:Author[] price:double) +Book(name: String,authors:Author[] price:double,qty:int) +getName() : String +getAuthors):Author[] +getPrice:double \"Book[name=n,authors={Author[name=n, +setPrice(price:double):void email=e,gender=g], : : ..},price=p, +getQty:int qty=q]\" +setQty(qty:int):void +toString: Stringo 'authorName1,authorName2' +getAuthorNames():Stringo Complete this code: https://www.programiz.com/online-compiler/74XUfgm8cwc0G 28"
},
{
"page_index": 57,
"chapter_num": 2,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_029.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_2/slide_029.png",
"page_index": 57,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:25+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 58,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_001.png",
"page_index": 58,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:28+07:00"
},
"raw_text": "DAI HOC BK QUOC GIA TP. HO CHi MINH TP.HCM Advanced Programming C02039 Chapter 3: Object Oriented Programming Revision - Polymorphism DAI HQC QUÖC GIA THANH PHÖ HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 59,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_002.png",
"page_index": 59,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:30+07:00"
},
"raw_text": "CONTE NT INTRODUCTION TO 01 POLYMORPHISM KEY CONCEPTS OF 02 POLYMORPHISM 03 CONCLUSION 2"
},
{
"page_index": 60,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_003.png",
"page_index": 60,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:33+07:00"
},
"raw_text": "NTRODUCTIO N TO 01 POLYMORPHI SM 3"
},
{
"page_index": 61,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_004.png",
"page_index": 61,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:36+07:00"
},
"raw_text": "What is Polymorphism? In Java, polymorphism refers to the fact that you can have multiple methods with the same name in the same class Two kinds of polymorphism: Overloading: two or more methods with different signatures. Overriding: replacing an inherited method with another having the same signature 4"
},
{
"page_index": 62,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_005.png",
"page_index": 62,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:39+07:00"
},
"raw_text": "Polymorphism overview Iwo methods have to differ in their names or in the number or types of their parameters. Example: foo(int i) and foo(int t i, int j) are different foo(int i) and foo(int k) are the same foo(int i, double d) and foo(double d, int i) are different 5"
},
{
"page_index": 63,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_006.png",
"page_index": 63,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:43+07:00"
},
"raw_text": "Overloading vs. Overriding Overriding Overloading class Dog{ class Dog{ public voidbark}{ public voidbark(]{ System.out.prlntln(woof\": System.out.println(\"woof\"); } Same Method Name. } Same Method Name Different Parameter } Same parameter //overloading method class Hound extends Dog{ public voidbarkint num){ public void sniff(){ for(int i-0; i<num; i++) System.out.priptln(\"sniff\"); System.out.println(\"woof\"); } } } public voidbark({ System.out.println(\"bowl\"); } 6"
},
{
"page_index": 64,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_007.png",
"page_index": 64,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:46+07:00"
},
"raw_text": "int mainO #include <iostream> 1 Aa; B b; class A a.n = 1; b.n =2: a.f20; b.f20: public: int n; int fO {n++; return n;} return O; int f2O {fO; return n;} } }; class B: public A 1 public: int fO{n--; return n;} };"
},
{
"page_index": 65,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_008.png",
"page_index": 65,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:49+07:00"
},
"raw_text": "class A public class Main public int n; public static void main(String[] args) { public int fO {n++; return n;} A a = new AO; B b = new BO; public int f20 {fO; return n;} a.n = 1; b.n = 2; a.f20; b.f20; System.out.println(a.n)) }; System.out.println(b.n) class B extends A public int fO{n--; return n;} };"
},
{
"page_index": 66,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_009.png",
"page_index": 66,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:52+07:00"
},
"raw_text": "#include <iostream> int main0 class A Aa; B b; a=b; public: a.n=1; int n; a.f20; virtual int fO {n++; return n;} std: :cout<<a.n; int f2O {fO; return n;} return 0; }; } class B: public A public: virtual int fO{n--; return n; };"
},
{
"page_index": 67,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_010.png",
"page_index": 67,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:55+07:00"
},
"raw_text": "public class Main class A public static void main(String[] args) { public int n; Aa= newAO; B b = new BO; a = b; public int fO {n++; return n;} a.n = 1; a.f20; public int f2O {fO; return n;} System.out.println(a.n); //System.out.println(b.n) }; class B extends A 1 public int fO{n--; return n;} }; 10"
},
{
"page_index": 68,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_011.png",
"page_index": 68,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:31:57+07:00"
},
"raw_text": "KEY CONCEPTS OF 02 POLYMORPHI SM 11"
},
{
"page_index": 69,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_012.png",
"page_index": 69,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:01+07:00"
},
"raw_text": "Binding Dynamic Binding vs. Static Binding: Static Binding: Determined at compile-time. Dynamic Binding: Determined at runtime. Polymorphism requires dynamic binding Binding Static Dynamic 12"
},
{
"page_index": 70,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_013.png",
"page_index": 70,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:07+07:00"
},
"raw_text": "Binding in OOP languages ln C++: Static binding (default): the function to be called is determined during compilation Dynamic binding (using virtual): enables polymorphism by resolving function calls at runtime. In Java: Java uses dynamic binding by default for method overriding. The method invoked is determined at runtime based on the actual object, not the reference type. 13"
},
{
"page_index": 71,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_014.png",
"page_index": 71,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:11+07:00"
},
"raw_text": "Hands-on exercise class A { 1. What is the output? void f( { cout << \"A::f\"; } void f2( { fO; } 2. Is polymorphism used in this }; code? class B: public A { If it isn't, how can we implement void f( { cout << \"B::f\"; } }; it? int main) 3. Can you rewrite the code in A* a = new B; Python and Java? a->f2Oi // Output: ??? return 0: } 14"
},
{
"page_index": 72,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_015.png",
"page_index": 72,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:15+07:00"
},
"raw_text": "Key differences: c++ vs. Java Features C++ Java Default binding Static binding Dynamic binding Enabling dynamic Use virtual Always enabled for binding keyword overrides Polymorphism Requires explicit Default behaviour virtual Behind the scenes Requires explicit Abstracted as pointers object references 15"
},
{
"page_index": 73,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_016.png",
"page_index": 73,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:19+07:00"
},
"raw_text": "Why use r pointers for dynamic binding in Reaslon: In C++, the vtable (virtual table) is used to enable dynamic method resolution. When using pointers or references, the program accesses the vtable of the actual object to determine the appropriate method. Static Objects (No Pointer): Vtable lookup is skipped, leading to static binding Dynamic Objects (Pointer/Reference): Vtable is consulted, allowing polymorphism to work 16"
},
{
"page_index": 74,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_017.png",
"page_index": 74,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:20+07:00"
},
"raw_text": "03 CONCLUSION 17"
},
{
"page_index": 75,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_018.png",
"page_index": 75,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:24+07:00"
},
"raw_text": "Conclusion Polymorphism O A key OOP feature that enables objects to behave differently based on their actual type. Dynamic Binding: Required for polymorphism. Default in pure OOP languages like Java. C++ vs. Java: O C++: Static binding by default; use virtual for dynamic binding. O Java: Always dynamic binding 18"
},
{
"page_index": 76,
"chapter_num": 3,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_019.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_3/slide_019.png",
"page_index": 76,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:27+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 77,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_001.png",
"page_index": 77,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:30+07:00"
},
"raw_text": "DAI HOC BK QUOC GIA TP.HO CHi MINH TP.HCM Advanced Programming C02039 Chapter 4: Abstract class & Interface DAI HQC QUÖC GIA THANH PHÖ HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 78,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_002.png",
"page_index": 78,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:33+07:00"
},
"raw_text": "CONTE NT NTRODUCTION TO ABSTRACT CLASS 01 & INTERFACE 02 NTERFACE IN DEPTH 03 CONCLUSION 04 ADVANCED SECTION 2"
},
{
"page_index": 79,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_003.png",
"page_index": 79,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:35+07:00"
},
"raw_text": "NTRODUCTIO N TO 01 ABSTRACT CLASS & NTERFACE 3"
},
{
"page_index": 80,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_004.png",
"page_index": 80,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:38+07:00"
},
"raw_text": "What is Abstract class? An abstract class is a class that cannot be instantiated. It serves as a blueprint for other classes Key characteristics: Can include abstract methods (methods without implementation May also include concrete methods (methods with implementation Used when classes share common behavior but also require customization in subclasses. 4"
},
{
"page_index": 81,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_005.png",
"page_index": 81,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:42+07:00"
},
"raw_text": "Example in Java abstract class Shape { abstract void draw(); // Abstract method void infoQ { // Concrete method System.out.println(\"This is a shape\"); class Circle extends Shape { void draw { System.out.println(\"Drawing Circle\"); 5"
},
{
"page_index": 82,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_006.png",
"page_index": 82,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:45+07:00"
},
"raw_text": "What is lnterface? An interface is a classlike construct that contains only constants and abstract methods. Key characteristics: Cannot be instantiated (only classes that implements interfaces can be instantiated Why not just use Abstract class? = Java does not permit multiple inheritance but allow a class can implement multiple interfaces. Can an interface be implemented by multiple classes? 6 Mlo instancc ariahlas only constants alowed"
},
{
"page_index": 83,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_007.png",
"page_index": 83,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:48+07:00"
},
"raw_text": "Creating an Interface File InterfaceName.java: modifier is public or not modifier interface InterfaceName used. constants declarations; methods signatures; File ClassName.java: modifier Class ClassName implements InterfaceName : methods implementation; 7"
},
{
"page_index": 84,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_008.png",
"page_index": 84,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:51+07:00"
},
"raw_text": "Hands-on exercise interface Drawable { void draw); // Abstract method } class Rectangle implements Drawable { public void draw( { System.out.println(\"Drawing Rectangle\") : 2 Add new interface Area to calculate the area of a shape and implement it in Rectangle. Write main function to test. 8"
},
{
"page_index": 85,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_009.png",
"page_index": 85,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:53+07:00"
},
"raw_text": "NTERFACE IN 02 DEPTH 9"
},
{
"page_index": 86,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_010.png",
"page_index": 86,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:32:57+07:00"
},
"raw_text": "More in Interfaces (1) Compile-Time Dependency Problem: Normally, methods from one class to another need compile-time presence for signature checks. This creates rigid inheritance hierarchies, pushing shared functionality higher in the class tree Interfaces to the Rescue: Allow dynamic method resolution at runtime. Decouple method definitions from the class inheritance hierarchy Enable unrelated classes to implement the same interface. Key Benefit: Promote composition over inheritance and avoid the rigidity of deep class hierarchies. 10"
},
{
"page_index": 87,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_011.png",
"page_index": 87,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:00+07:00"
},
"raw_text": "More in Interfaces (2) Dynamic Method Resolution: The actual method is determined at runtime, not compile time. Calling code interacts with an interface or abstract class reference, not specific implementations. Benefit: Decouples calling code from concrete classes. Allows flexibility to add/change implementations without modifying the calling code 11"
},
{
"page_index": 88,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_012.png",
"page_index": 88,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:04+07:00"
},
"raw_text": "More in Interfaces - Example interface Shape { void draw(; } class circle implements Shape { public void draw( { System.out.println(\"Drawing a Circle\"); } } class Square implements Shape { public void draw( { System.out.println(\"Drawing a Square\"); } } public class Main { public static void main(String[] args) { Shape shape = new circle(); // Interface reference, dynamic resolution shape.drawO ; // Calls Circle's draw() method shape = new SquareO; : // Switch to a different implementation shape. drawO ; // Calls Square's draw() method 12"
},
{
"page_index": 89,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_013.png",
"page_index": 89,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:08+07:00"
},
"raw_text": "Does interface solve diamond problem? Interfaces help address the diamond problem in multiple inheritance, but indirectly: The diamond problem arises when a class inherits from two parent classes that define methods with the same name and signature leading to ambiguity In Java: Classes do not support multiple inheritance, which avoids this issue. Interfaces support multiple inheritance, but there's no ambiguity because a class implementing multiple interfaces 13 must explicitly define the methods it inherits."
},
{
"page_index": 90,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_014.png",
"page_index": 90,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:11+07:00"
},
"raw_text": "Example: lnterface in diamond problem interface A { default void show( { System.out.println(\"A\"); } interface B { default void show( { System.out.println(\"B\"); } } class C implements A, B { // Resolving the diamond problem @override public void show() { A.super.show(); // Explicitly choose which interface method to call } 14"
},
{
"page_index": 91,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_015.png",
"page_index": 91,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:13+07:00"
},
"raw_text": "03 CONCLUSION 15"
},
{
"page_index": 92,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_016.png",
"page_index": 92,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:18+07:00"
},
"raw_text": "Abstract class vs. Interface Feature Abstract class Interface Instantiation Cannot be Cannot be instantiated instantiated Methods Can have abstract Only abstract and concrete methods Variables Can have instance Only constants variables allowed Inheritance Supports single Supports multiple inheritance inheritance Accessibility Methods can have Methods are Modifiers any modifier implicitly public 16"
},
{
"page_index": 93,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_017.png",
"page_index": 93,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:20+07:00"
},
"raw_text": "ADVANCED 04 SECTION 17"
},
{
"page_index": 94,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_018.png",
"page_index": 94,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:22+07:00"
},
"raw_text": "Class diagram: Interface UML Notation: The interface name and the method names are italicized The dashed lines and hollow Shape K Circle Cylinder triangles are used to point to the interface. java.lang.Comparable compareTo 18"
},
{
"page_index": 95,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_019.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_019.png",
"page_index": 95,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:26+07:00"
},
"raw_text": "Classes & lnterfaces Interface1_2 Interface2_2K Interfacel Interface2_1K Interfacel . Object K Class1 Class2 Can you write a Java pseudocode for the above diagram? 19"
},
{
"page_index": 96,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_020.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_020.png",
"page_index": 96,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:30+07:00"
},
"raw_text": "The cloneable interface public class Circle extends Shape implements cloneable { private int x, y, radius; // Constructor // clone method @override public Object clone() { try { return super.clone(); } // Shallow copy catch (cloneNotSupportedException ex) { return null; } } Main function : Circle c1 = new circle(1, 2, 3); // Create an instance of circle Circle c2 = (circle) c1.clone(); // clone c1 into c2 20"
},
{
"page_index": 97,
"chapter_num": 4,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_021.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_4/slide_021.png",
"page_index": 97,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:32+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 98,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_001.png",
"page_index": 98,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:34+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Advanced Programming C02039 Chapter 5: Design Patterns DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 99,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_002.png",
"page_index": 99,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:38+07:00"
},
"raw_text": "CONTE NT NTRODUCTION TO DESIGN 01 PATTERNS CREATIONAL PATTERNS - 02 SINGLETON 03 STRUCTURAL PATTERNS - ADAPTER 04 BEHAVIORAL PATTERNS - OBSERVER 05 CONCLUSION 2"
},
{
"page_index": 100,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_003.png",
"page_index": 100,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:40+07:00"
},
"raw_text": "INTRODUCTIO 01 N TO DESIGN PATTERNS 3"
},
{
"page_index": 101,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_004.png",
"page_index": 101,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:46+07:00"
},
"raw_text": "What is a design pattern? Design patterns are typical The Software Design Khalil Stemmler & Architecture Stack @stemmlerjs solutions to commonly DTOs, Domain-Models, Transaction Scripts, Enterprise Patterns Repositories, Mappers, Value Objects occurring problems in Architectural Patterns Model-View-Controller, Domain-Driven Design Layered, Client-Server, Monolithic, software design Architectural Styles Component-based Policy vs. details, Coupling & cohesion, Architectural Principles dependencies, boundaries They are like pre-made scooe Design Patterns Observer, strategy, Factory, etc Composition Over Inheritance, Hollywood Principle, blueprints that you can Design Principles encapsulate what varies, SOLID, DRY, YAGNI Object-Oriented Inheritance, Polymorphism, Encapsulation, customize to solve a Programming Abstraction Programming Structured, Object-Oriented, Functional Paradigms recurring design problem in Name, construct, structure, style. Clean Code readability your code 4"
},
{
"page_index": 102,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_005.png",
"page_index": 102,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:49+07:00"
},
"raw_text": "Why should l learn I patterns? Design patterns are a toolkit of tried and tested solutions to common problems in software design. Even if you never encounter these problems, knowing patterns is still useful because it teaches you how to solve all sorts of problems using principles of object-oriented design. Design patterns define a common language that you and your teammates can use to communicate more efficiently Good designers don't always start from scratch to solve problems. They often use existing solutions! 5"
},
{
"page_index": 103,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_006.png",
"page_index": 103,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:54+07:00"
},
"raw_text": "Organiza Creational Design Structural Design Behavioral Design Pattern Pattern Pattern For handling Object creation For identifying ways to For handling communication mechanisms realize relationships between different objects between objects Constructor Adapter Chain of Responsibility Factory Bridge Command Abstract Composite Iterator Factory Prototype Decorator Mediator Singleton Facade Memento Builder Flyweight Observer Proxy State Strategy Template method Visitor 6"
},
{
"page_index": 104,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_007.png",
"page_index": 104,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:56+07:00"
},
"raw_text": "CREATIONAL 02 PATTERNS SINGLETON 7"
},
{
"page_index": 105,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_008.png",
"page_index": 105,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:33:59+07:00"
},
"raw_text": "What is Singleton? Singleton is a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance WHY? Solve 2 problems violating Sing/e Responsibility Principle Ensure a single instance Prevent multiple instances of a class Control access to shared resources (e.g., database, files) Provide global access 8 Act livo ccidonta"
},
{
"page_index": 106,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_009.png",
"page_index": 106,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:02+07:00"
},
"raw_text": "Implementation All implementations of the Singleton have these two steps in common: Make the default constructor private, to prevent other objects from using the new operator with the Singleton class. Create a static creation method that acts as a constructor. Under the hood, this method calls the private constructor to create an object and saves it in a static field. All following calls to this method return 9"
},
{
"page_index": 107,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_010.png",
"page_index": 107,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:05+07:00"
},
"raw_text": "Structure Singleton instance: Singleton - Singleton0 Client + getlnstance0: Singleton I if (instance == null) { /Note: if you're creating an app with // multithreading support,you should place a thread lock here. instance = new Singleton0 return instance 10"
},
{
"page_index": 108,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_011.png",
"page_index": 108,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:08+07:00"
},
"raw_text": "Step-by-step instructions 1. Add a private static field to the class for storing the singleton instance. 2. Declare a public static creation method for getting the singleton instance. 3. Implement \"/azy initialization\" inside the static method It should create a new object on its first call and put it into the static field. The method should always return that instance on all subsequent calls. 4. Make the constructor of the class private. The static method of the class will still be able to call the constructor, 11"
},
{
"page_index": 109,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_012.png",
"page_index": 109,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:10+07:00"
},
"raw_text": "STRUCTURAL 03 PATTERNS ADAPTER 12"
},
{
"page_index": 110,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_013.png",
"page_index": 110,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:14+07:00"
},
"raw_text": "What is Adapter? Adapter is a structural design pattern that allows objects with incompatible interfaces to collaborate WHY? Solve compatibility issue - bridge incompatible interfaces Allow two incompatible classes to work together. Convert one interface into another expected by the client 13"
},
{
"page_index": 111,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_014.png",
"page_index": 111,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:17+07:00"
},
"raw_text": "Implementation Hide complexity: Wrap an object to handle conversion behind the scenes. Bridge interface: Allow incompatible objects to work together. How it works: 1. Adapter provides an interface matching the client's needs. 2. Client calls the adapter's methods 3. Adapter translates the reguest and forwards it to 14"
},
{
"page_index": 112,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_015.png",
"page_index": 112,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:20+07:00"
},
"raw_text": "Structure - Object adapter <interface> Client Interface Client + method(data A Adapter Service adaptee: Service + method(data) + serviceMethod(specialData - specialData = convertToServiceFormat(data) return adaptee.serviceMethod(specialData) 15"
},
{
"page_index": 113,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_016.png",
"page_index": 113,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:23+07:00"
},
"raw_text": "Structure - Class adapter Existing Class Service Client + method(data + serviceMethod(specialData 4 Adapter + method(data) specialData = convertToServiceFormat(data) return serviceMethod(specialData 16"
},
{
"page_index": 114,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_017.png",
"page_index": 114,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:27+07:00"
},
"raw_text": "Step-by-step instructions 1. Make sure that you have at least two classes with incompatible interfaces: a. A useful service class, which you can't change b. One or several client classes that would benefit from using the service class 2. Declare the client interface and describe how clients communicate with the service. 3. Create the adapter class and make it follow the client interface Leave all the methods empty for now. 4. Add a field to the adapter class to store a reference to the service object 17"
},
{
"page_index": 115,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_018.png",
"page_index": 115,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:30+07:00"
},
"raw_text": "Example: Sensor problem class TS7000 native double getTempO; // New sensor device class SuperTempReader { // NoTE: temperature is Celsius tenths of a degree native double current_readingQ; double sum = 0.0; } for/(int i = 0; i < sensors.length; i++) sum +=9 sensors[i].getTemp(D; double meanTemp = sum / sensors.length; 18"
},
{
"page_index": 116,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_019.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_019.png",
"page_index": 116,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:33+07:00"
},
"raw_text": "Without adapter pattern for (int i = 0; i < sensors.length; i++){ if (sensors[i] instanceof Ts70oo) += ((Ts70oo)sensors[i]).getTemp(); sum else // Must be a SuperTemp! * 10: sum += ((SuperTempReader)sensors[i]).current_reading 19"
},
{
"page_index": 117,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_020.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_020.png",
"page_index": 117,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:37+07:00"
},
"raw_text": "Adapter to the rescue (1) TempSensor Client TS7000 getTemperature getTemp0 sensor STRAdapter TS7000Adapter getTemperature0 getTemperatureO sensorw sensor->getTemp( SuperTempReader current_reading0 sensor->current_reading 20"
},
{
"page_index": 118,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_021.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_021.png",
"page_index": 118,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:41+07:00"
},
"raw_text": "Adapter to the rescue (2) abstract class TempSensor{ class TS7oooAdapter extends TempSensor{ abstract double getTemperatureD : public double getTemperature({ } return sensor.getTempQ : } class STRAdapter extends TempSensor{ } public double getTemperatureQ{ return sensor.current_reading ? 10 ; double sum = 0.0: } for (int i = 0; i < sensors.length; i++ } sum += sensors[i]:getTemperatureD : 21"
},
{
"page_index": 119,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_022.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_022.png",
"page_index": 119,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:42+07:00"
},
"raw_text": "BEHAVIORAL 04 PATTERNS OBSERVER 22"
},
{
"page_index": 120,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_023.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_023.png",
"page_index": 120,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:47+07:00"
},
"raw_text": "What is Observer? Observer is a behavioral design pattern that lets you define a subscription mechanism to notify multiple objects about any events that happen to the object they're observing WTF?! STORE WTF?! WTF?! SOON! H H WTF?! WTF?! AY WTF?! WTF?! H 23"
},
{
"page_index": 121,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_024.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_024.png",
"page_index": 121,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:51+07:00"
},
"raw_text": "Implementation Subscriber + update0 ber Hey, sign me Publisher Publisher up, please! Subscriber Subscriber - subscribers[] notifySubscribers0 + update0 + addSubscriber(subscriber) Subscriber + removeSubscriber(subscriber) Me too! Guys, I just want Subscriber to let you know that A subscription mechanism lets something has just happened to me. + update0 individual objects subscribe to event notifications. Publisher notifies subscribers by calling the specific notification method on their objects. 24"
},
{
"page_index": 122,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_025.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_025.png",
"page_index": 122,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:54+07:00"
},
"raw_text": "Structure Publisher <interface> - subscribers: Subscriber[ Subscriber mainState foreach (s in subscribers) + update(context s.update(this) + subscribe(s: Subscriber) 4 + unsubscribe(s: Subscriber) mainState = newState + notifySubscribers0 Concrete notifySubscribers0 + mainBusinessLogic0 Subscribers s= new ConcreteSubscriber0 + update(context publisher.subscribe(s) Client 25"
},
{
"page_index": 123,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_026.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_026.png",
"page_index": 123,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:34:59+07:00"
},
"raw_text": "Step-by-step instructions 1. Separate Business Logic Identify core functionality - Acts as the Publisher Identify dependent components -> Act as Subscribers 1. Define Interfaces Subscriber Interface - Declares update() method Publisher Interface -> Methods to add/remove subscribers 1. Manage Subscriptions Store subscriber list in an abstract class (for reusability) Alternative: Use composition to separate subscription logic L. Implement Concrete Classes Publisher: Notifies all subscribers when an event occurs Subscriber: Implements update() method to react to changes 1./Register Subscribers: Clients create subscribers and attach them to publishers 26"
},
{
"page_index": 124,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_027.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_027.png",
"page_index": 124,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:01+07:00"
},
"raw_text": "05 CONCLUSION 27"
},
{
"page_index": 125,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_028.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_028.png",
"page_index": 125,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:04+07:00"
},
"raw_text": "Conclusion Design Patterns provide reusable solutions to common software design problems, improving code structure and maintainability. singleton ensures a class has only one instance and provides global access, useful for managing shared resources Adapter acts as a bridge between incompatible interfaces, enabling seamless integration of different systems 28"
},
{
"page_index": 126,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_029.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_029.png",
"page_index": 126,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:06+07:00"
},
"raw_text": "References [1] Alexander Shvets (2018). Dive /nto Design Patterns 29"
},
{
"page_index": 127,
"chapter_num": 5,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_030.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_5/slide_030.png",
"page_index": 127,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:09+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 128,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_001.png",
"page_index": 128,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:11+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Advanced Programming CO2039 Chapter 1: Stateless Programming DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 129,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_002.png",
"page_index": 129,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:13+07:00"
},
"raw_text": "CONTE NT IMPERATIVE VS 01 DECLARATIVE CORE PRINCIPLES OF FUNCTIONAL 02 PROGRAMMING 03 CONCLUSION 2"
},
{
"page_index": 130,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_003.png",
"page_index": 130,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:15+07:00"
},
"raw_text": "IMPERATIVE 01 VS DECLARATIVE 3"
},
{
"page_index": 131,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_004.png",
"page_index": 131,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:19+07:00"
},
"raw_text": "Imperative languages Based on von Neumann architecture Relies on modifying variables (state changes) Use assignment to modify program state Central Processing Unit Control Unit Figure 1: von Input Output Arithmetic/Logic Unit Neumann Device Device architecture Memory Unit 4"
},
{
"page_index": 132,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_005.png",
"page_index": 132,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:22+07:00"
},
"raw_text": "What is a state? Programs in imperative languages rely heavily on modifying the values of a collection of variables, called the state Before execution, the state has some initial value o. During execution, each command changes the state: 0=0.-01-02-...-0=0 5"
},
{
"page_index": 133,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_006.png",
"page_index": 133,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:26+07:00"
},
"raw_text": "Declarative languages No state - State-oriented computations are accomplished by carrying the state around explicitly rather than implicitly Uses expressions instead of commands Loops are replaced by recursion Functional Languages: The underlying model of computation is function. Logic Programming Languages: The underlying model of computation is predicates 6"
},
{
"page_index": 134,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_007.png",
"page_index": 134,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:30+07:00"
},
"raw_text": "Example: Factorial (1) n := X : def factorial(x) : a := 1: if x == 1: while e n > 0 do return 1 begin else : a a n; return x n : = n factorial(x-1) 1; Factodal in Imperative Factorial in Functiona Style Style The value of the program is the desired factorial rather than storing it in a store. Declarative programming is often described as expressing what is being computed rather than how. 7"
},
{
"page_index": 135,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_008.png",
"page_index": 135,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:33+07:00"
},
"raw_text": "CORE PRINCIPLES 02 OF FUNCTIONAL PROGRAMMING 8"
},
{
"page_index": 136,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_009.png",
"page_index": 136,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:36+07:00"
},
"raw_text": "Functional Programming Functions are first class values. O A data type is first class if it can be used anywhere passed to and returned from functions, assigned to variables May also have imperative constructs. O Examples: Lisp, Scheme, ML, Erlang Pure functional languages have no implicit side-effects or other imperative features. Examples: Miranda, Haskell 9"
},
{
"page_index": 137,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_010.png",
"page_index": 137,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:39+07:00"
},
"raw_text": "Example: Factorial (2) 1;x = 1 fact(x) = x * fact(x - 1) factorial : : Integer -> Integer factorial 0 1 factorial * factorial n - n (n - 1 Factorial in Haskell 10"
},
{
"page_index": 138,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_011.png",
"page_index": 138,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:42+07:00"
},
"raw_text": "Why functional programming? John Backus (Fortran Creator) argued Fp is better than imperative programming. Functional programming removes state and assignments. Enables parallel execution (Concurrency without race conditions) Algebraic laws Reason about programs Optimizing compilers 11"
},
{
"page_index": 139,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_012.png",
"page_index": 139,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:46+07:00"
},
"raw_text": "Von Neumann bottleneck Von Neumann bottleneck: pumping single words back and forth between CPU and store = Task of a program: change store in some major way It has kept us tied to word-at-a-time thinking Instead of encouraging us to think in terms of the larger conceptual units of the task at hand. The assignment statement is the von Neumann bottleneck of programming languages = Pure functional programming languages remove state and assignments. Concurrency possible: order of evaluation doesn't matter. 12"
},
{
"page_index": 140,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_013.png",
"page_index": 140,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:50+07:00"
},
"raw_text": "A referentially transparent function is a function that, given Referential transparency result - Do we have such property in imperative languages? If the function has side-effects (updating a global variable doing input or output), then f(3) + f(3) may not be the same as 2 *f(3). The second f(3) has a different meaning than the first Purely declarative languages guarantee referential transparency The importance of referential transparency is that it allows a 13"
},
{
"page_index": 141,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_014.png",
"page_index": 141,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:52+07:00"
},
"raw_text": "03 CONCLUSION 14"
},
{
"page_index": 142,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_015.png",
"page_index": 142,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:56+07:00"
},
"raw_text": "Conclusion Imperative vs Declarative Programming Imperative: State-based, step-by-step execution Declarative: Focus on \"what\" rather than \"how' Core Principles of Functional Programming Pure Functions - No side effects Immutability - Data doesn't change after creation Higher-Order Functions - Functions as first-class values Recursion replaces loops Von Neumann Bottleneck Traditional imperative programming relies on modifying shared memory Functional Programming removes mutable state - better parallelism 15"
},
{
"page_index": 143,
"chapter_num": 6,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_6/slide_016.png",
"page_index": 143,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:35:59+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 144,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_001.png",
"page_index": 144,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:01+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Advanced Programming CO2039 Chapter 2: Programming with Python DAI HQC QUÖC GIA THANH PHÖ HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 145,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_002.png",
"page_index": 145,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:04+07:00"
},
"raw_text": "CONTE NT 01 VARIABLES & DATA TYPES 02 DATA STRUCTURES 03 CONDITIONALS. LOOPS AND EXCEPTIONS 04 CONCLUSION 2"
},
{
"page_index": 146,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_003.png",
"page_index": 146,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:06+07:00"
},
"raw_text": "VARIABLES & 01 DATA 1TYPES 3"
},
{
"page_index": 147,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_004.png",
"page_index": 147,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:09+07:00"
},
"raw_text": "Python Syntax Overview # Python (No semicolons, indentation-based) print(\"Hello, Python!\" # Java (curly braces, semicolons) public class Main { public static void main(String[] args) { System.out.println(\"Hello, Java!\"); } Python uses indentation instead of {} No semicolons required 4"
},
{
"page_index": 148,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_005.png",
"page_index": 148,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:13+07:00"
},
"raw_text": "Variables & Data Types in Python Python is dynamically typed - No need to declare data types explicitly Data Type Example Description Integer X = 10 Whole numbers Float pi = 3.14 Decimal numbers String \"Alice\" name Text is valid = True Boolean True or False NoneType x = None Represents \"nothing 5"
},
{
"page_index": 149,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_006.png",
"page_index": 149,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:14+07:00"
},
"raw_text": "DATA 02 STRUCTURES 6"
},
{
"page_index": 150,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_007.png",
"page_index": 150,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:18+07:00"
},
"raw_text": "Python Built-in Data Structures Lists (Ordered, Mutable) fruits = [\"apple\", \"banana\", \"cherry\"] fruits.append(\"orange\") # Add element print(fruits[1]) # Output : banana - Ordered, allows duplicates, mutable Tuples (Ordered, Immutable) coordinates = (10, 20) print(coordinates[o]) # 0utput: 10 - Like lists but immutable 7"
},
{
"page_index": 151,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_008.png",
"page_index": 151,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:21+07:00"
},
"raw_text": "Python Built-in Data Structures Sets (Unordered, Unique Elements) unique_numbers = {1, 2, 3, 3} print(unique_numbers) # 0utput: {1, 2, 3} - No duplicates, unordered Dictionaries (Key-Value Pairs) student = {\"name\": \"Alice\", \"age\": 2o} print(student[\"name\"] # Output: Alice - Stores data as key-value pairs 8"
},
{
"page_index": 152,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_009.png",
"page_index": 152,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:23+07:00"
},
"raw_text": "lype conversions X = 1 10 y = str(x) # Convert int to string print(y) # Output: \"10\" Common conversions: int(\"1oo\") -> Converts string to integer float(\"3.14\") - Converts string to float str(5o) - Converts integer to string 9"
},
{
"page_index": 153,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_010.png",
"page_index": 153,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:26+07:00"
},
"raw_text": "CONDITIONAL 03 S, LOOPS & EXCEPTIONS 10"
},
{
"page_index": 154,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_011.png",
"page_index": 154,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:29+07:00"
},
"raw_text": "Conditional Statements age = 18 if age >= 18: print(\"Adult\" elif age >= 13: print(\"Teenager\") else : print(\"child\") - Indentation is required (No {} like Java or C++) 11"
},
{
"page_index": 155,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_012.png",
"page_index": 155,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:32+07:00"
},
"raw_text": "Loops for Loop (lterate over a sequence for i in range(5) : print(i) # Output: 0 1 2 3 4 - Loops through a range or collection while Loop (Repeats until condition is false) x = 0 while x < 5: print(x) X += 1 - Use break to stop the loop early 12"
},
{
"page_index": 156,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_013.png",
"page_index": 156,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:35+07:00"
},
"raw_text": "Functions Defining and calling a function def greet(name) : return \"Hello, i + name print(greet(\"Alice\")) # Output: Hello, Alice Supports default and keyword arguments def greet(name=\"Guest\") : print(greetO) # Output: Hello, Guest 13"
},
{
"page_index": 157,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_014.png",
"page_index": 157,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:39+07:00"
},
"raw_text": "Classes Defining a simple class for data storage class Student : def - init_-(self, name, age) : self.name = name self.age = age student1 = Student(\"Alice\", 20 print(student1.name) # 0utput: Alice init_) - Constructor that initializes object properties self - Refers to the instance of the class 14"
},
{
"page_index": 158,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_015.png",
"page_index": 158,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:41+07:00"
},
"raw_text": "Exception Handling Handling errors with try-except try : x = int(\"abc\" # Error: Cannot convert string to int except ValueError : print(\"Invalid input\") - Prevents program crashes due to runtime errors 15"
},
{
"page_index": 159,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_016.png",
"page_index": 159,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:43+07:00"
},
"raw_text": "03 CONCLUSION 16"
},
{
"page_index": 160,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_017.png",
"page_index": 160,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:45+07:00"
},
"raw_text": "Conclusion Python is dynamically typed and easy to use Supports various built-in data structures Uses indentation for code blocks Includes conditional statements, loops, functions, classes and exception handling 17"
},
{
"page_index": 161,
"chapter_num": 7,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_7/slide_018.png",
"page_index": 161,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:48+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 162,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_001.png",
"page_index": 162,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:51+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP. HÖ CHi MINH TP.HCM Advanced Programming CO2039 Chapter 3: List comprehension Part of the Functional Programming paradigm DAI HQC QUÖC GIA THANH PHÖ HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 163,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_002.png",
"page_index": 163,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:54+07:00"
},
"raw_text": "CONTE NT NTRODUCTION TO PYTHON LISTS: 01 CREATION, ACCESS, SLICING MODIEYING AND ITERATING THROUGH 02 LIsts 03 CONCLUSION 2"
},
{
"page_index": 164,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_003.png",
"page_index": 164,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:56+07:00"
},
"raw_text": "INTRODUCTIO 01 N TO PYTHON LISTS 3"
},
{
"page_index": 165,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_004.png",
"page_index": 165,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:36:59+07:00"
},
"raw_text": "Creating a Python List Create a list by placing elements inside square brackets [] separated by commas. Can also store data of different data types in a list. In Python, lists are: Ordered - They maintain the order of elements. Mutable - Items can be changed after creation Allow duplicates - They can contain duplicate values 4"
},
{
"page_index": 166,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_005.png",
"page_index": 166,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:02+07:00"
},
"raw_text": "Access List Elements The index of first item is 0, the index of second item is 1 and so on. Can also have negative indices. - The index of the last element is -1, the second last element is -2 and so on. ['Python', 'Swift', 'C++'] Index 0 1 2 Negativelndex -3 -2 -1 5"
},
{
"page_index": 167,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_006.png",
"page_index": 167,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:05+07:00"
},
"raw_text": "Slicing of a List in Python (1 The format for list slicing is list_name[start : stop : step] start is the index of the list where slicing starts. stop is the index of the list where slicing ends step allows you to select nth item within the range start to stop. 6"
},
{
"page_index": 168,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_007.png",
"page_index": 168,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:09+07:00"
},
"raw_text": "Slicing of a List in Python (2) Example my_list = ['p', 'r', 'o', 'g', 'r', 'a', 'm'] print(\"my_list =\", my_list) => full list print(\"my_list[2:5] l =\", my_list[2:5] => o, g, r print(\"my_list[2:-2] ] =\", my_list[2:-2] => o, g, r print(\"my_list[0:3] =\", my_list[0:3])=> p, r o 7"
},
{
"page_index": 169,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_008.png",
"page_index": 169,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:12+07:00"
},
"raw_text": "Omitting Start and End Indices in Slicing If you omit the start index, the slicing starts from the first element. If you omit the last index, the slicing ends at the last element Example: my_list = ['p', 'r', 'o', 'g', ' 'a', 'm'] print(\"my_list[5: ] =\", my_list[5: ] => a, m print(\"my_list[:-4] =\", my_1ist[:-4] => p, r, o print(\"my_list[:] =\", my_list[:])=> full list print(\"my_list[::2] =\", my_list[::2] => p , o, r, m 8"
},
{
"page_index": 170,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_009.png",
"page_index": 170,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:14+07:00"
},
"raw_text": "MODIFYING AND 02 ITERATING THROUGH LISTS 9"
},
{
"page_index": 171,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_010.png",
"page_index": 171,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:17+07:00"
},
"raw_text": "Add Elements to a Python List Add an item to the end of a list = append() Insert an element at the specified index to a list = insert() Add all the items of the specified iterable to the end of a list extend) Example fruits = ['apple', 'banana', 'orange'] fruits.append('cherry') fruits.insert(2, 'kiwi') favorite_fruits = ['mango', 'lemon', 'pineapple' fruits.extend(favorite_fruits 10"
},
{
"page_index": 172,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_011.png",
"page_index": 172,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:20+07:00"
},
"raw_text": "Maaifye@heimandts iint by Psyithemewistlues - - operator. Remove the specified item from a list = remove( Can also delete an item from a list = de1 statement - de1 can also be used to delete multiple elements or even the entire list. Example: names = ['John','Eva', 'Laura', 'Nick', 'Jack'] names.remove( Laura' ) del names[1] del names[1:3] 11 del names"
},
{
"page_index": 173,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_012.png",
"page_index": 173,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:23+07:00"
},
"raw_text": "Iterating Through a List Find the number of elements (length) of a list = built-in 1en( We can use a for loop to iterate over the elements of a list Example: fruits = ['apple', 'banana', 'orange'] for fruit in fruits: print(fruit) 12"
},
{
"page_index": 174,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_013.png",
"page_index": 174,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:25+07:00"
},
"raw_text": "Python List Comprehension (1) List comprehension offers a concise way to create a new list based on the values of an existing list Syntax: [expression for item in list if condition == True] for every item in list, execute the expression if the condition is True. The if statement in list comprehension is optional. 13"
},
{
"page_index": 175,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_014.png",
"page_index": 175,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:29+07:00"
},
"raw_text": "Python List Comprehension (2) Example : numbers = [1, 2, 3, 4] doubled_numbers = [num * 2 for num in numbers] print(doubled_numbers) # 0utput: [2, 4, 6, 8] Create a new list with items num*2 where num is item of numbers doubled_numbers for num 2 num in numbers X 14"
},
{
"page_index": 176,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_015.png",
"page_index": 176,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:33+07:00"
},
"raw_text": "Python List Comprehension (2 Example: numbers = [1, 2, 3, 4] doubled evens = [num n * 2 for num in numbers if num % 2 == 01 print(doubled_evens # 0utput: [4, 8] Create a new list with items num*2 where num is item of numbers doubled numbers 2 for num X num in numbers 15"
},
{
"page_index": 177,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_016.png",
"page_index": 177,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:35+07:00"
},
"raw_text": "03 CONCLUSION 16"
},
{
"page_index": 178,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_017.png",
"page_index": 178,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:38+07:00"
},
"raw_text": "Conclusion Lists in Python are versatile and mutable, making them essential for data manipulation. You can create, access, and slice lists efficiently Lists allow adding, removing, and modifying elements dynamically Iteration techniques, including loops and list comprehensions, provide powerful ways to process data. 17"
},
{
"page_index": 179,
"chapter_num": 8,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_8/slide_018.png",
"page_index": 179,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:41+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 180,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_001.png",
"page_index": 180,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:44+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Advanced Programming CO2039 Chapter 4: Lambda calculus Part of the Functional Programming paradigm DAI HQC QUÖC GIA THANH PHÖ HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 181,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_002.png",
"page_index": 181,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:47+07:00"
},
"raw_text": "CONTE NT 01 CALCULATING WITH LAMBDA CALCULUS 02 REDUCTION IMPLEMENTING BUILTEIN CONSTANTS & 03 FUNCTIONS 04 CONCLUSION 2"
},
{
"page_index": 182,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_003.png",
"page_index": 182,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:50+07:00"
},
"raw_text": "Brief History Origin: formal theory of substitution O For first-order logic, etc. More successful with computable functions Substitution - symbolic computation Church-Turing thesis cacuus in 1936 3"
},
{
"page_index": 183,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_004.png",
"page_index": 183,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:52+07:00"
},
"raw_text": "Church-Turing Test Any natural / reasonable notion of computation realizable in the physical world can be simulated by a TM (or equivalently, by lambda calculus). 4"
},
{
"page_index": 184,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_005.png",
"page_index": 184,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:54+07:00"
},
"raw_text": "CALCULATING 01 WITH LAMBDA CALCULUS 5"
},
{
"page_index": 185,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_006.png",
"page_index": 185,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:37:57+07:00"
},
"raw_text": "What is Functional Language? \"No side effects\" Pure functional language: a language with functions, but without side effects or other imperative features 6"
},
{
"page_index": 186,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_007.png",
"page_index": 186,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:00+07:00"
},
"raw_text": "No-Side-Effects Language Test begin integer x=3; integer y=4; 5*(x+y)-3 // no new declaration of x or y // 4*(x+y)+1 end 7"
},
{
"page_index": 187,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_008.png",
"page_index": 187,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:02+07:00"
},
"raw_text": "Expressions and Functions Expressions x + y x + 2*y + z Functions x.(x+y) Az.(x+2*y+z) Application (Ax.(x+y) 3) 3 + y (z.(x+2*y+z)) 5 X + 2*y + 5 Parsing: Ax.f (f x) = Ax.(f (f(x))) 8"
},
{
"page_index": 188,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_009.png",
"page_index": 188,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:05+07:00"
},
"raw_text": "Terminology Ax.t the scope of x is the term t x.x y y is free in the term Ax.x y x is bound in the term Ax.x y 9"
},
{
"page_index": 189,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_010.png",
"page_index": 189,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:08+07:00"
},
"raw_text": "Free & Bound Variables (1) Bound variable is a \"placeholder\" O Variable x is bound in x.(x+y) Function Ax. (x+y) is same function as Az. (z+y) Name of free (i.e., unbound) variable matters! Variable y is free in x. (x+y) Function Ax.(x+y) is not same as Ax.(x+z) Occurrences: y is free and bound in Ax.((y.y+2) x + y 10"
},
{
"page_index": 190,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_011.png",
"page_index": 190,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:10+07:00"
},
"raw_text": "Free & Bound Variables (2) In A Calculus all variab/es are local to function definitions Examples: x.xy: x is bound, while y is free; (x.x) (y .yx) : x is bound in the first function, but free in the second function Ax. (Ay. yx) : x and y are both bound variables. (it can be abbreviated as Axy .yx) 11"
},
{
"page_index": 191,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_012.png",
"page_index": 191,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:12+07:00"
},
"raw_text": "02 REDUCTION 12"
},
{
"page_index": 192,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_013.png",
"page_index": 192,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:15+07:00"
},
"raw_text": "CBV Operational Semantics Single-step, call-by-value Os: t - t' Values are: v : : = x.t Primary rule (B-reduction): (Ax.t)v - t[v/x] t[v/x] is the term in which all occurrences of x in t are replaced with v This replacement operation is called substitution 13"
},
{
"page_index": 193,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_014.png",
"page_index": 193,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:18+07:00"
},
"raw_text": "Examples Example 1: (Ax.x x)(y.y) X X [yy/x] (y.y)(y.y) - y [y.y/y] y.y Example 2: (x.x x)(x.x x) , X X x.x x/x] (Ax.x x)(Ax.x x) 14"
},
{
"page_index": 194,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_015.png",
"page_index": 194,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:21+07:00"
},
"raw_text": "Higher-order Functions Given function f, return function f o f: Af.Ax.f (f x) How does this work? (Af.Ax.f (f x))(y.y+1 Ax.(y.y+1)((y.y+1)x Ax.(y.y+1)(x+1) - Ax.(x+1)+1 15"
},
{
"page_index": 195,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_016.png",
"page_index": 195,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:23+07:00"
},
"raw_text": "Declaration of \"Syntactic Sugar\" def f(x): return x + 2 print(f(5)) # 0utput: 7 (f.f(5))(Ax.x+2) bock declared body func 16"
},
{
"page_index": 196,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_017.png",
"page_index": 196,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:27+07:00"
},
"raw_text": "Rules a-reduction (renaming) y.m AV.(M [y v]) = a where v does not occur in M. B-reduction (substitution) (ax.m) N =s M [x N] 17"
},
{
"page_index": 197,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_018.png",
"page_index": 197,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:29+07:00"
},
"raw_text": "Attention Some A-calculus terms can be B-reduced forever! Example: Let D be this expression: (Ax.x x) . What is the value of this expression (D D)? (D D) = (Ax.x x (Ax.x x) - (Ax.x x (Ax.x x) - .) - It NEVER terminates! The order in which you choose to do the reductions might change the result! 18"
},
{
"page_index": 198,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_019.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_019.png",
"page_index": 198,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:32+07:00"
},
"raw_text": "Attention (cont.) Now consider this expression: (Ax.3 (D D) 1. Lazy Evaluation (Call-by-name): Only evaluate the argument if it's needed. No need to evaluate (D D) because x is not used inside the body 3 Skip evaluating D D entirely and return 3 immediately 2. Eager Evaluation (Call-by-value): Evaluate the argument before calling the function - Before applying (Ax.3) to (D D), we try to compute (D D)... 19"
},
{
"page_index": 199,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_020.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_020.png",
"page_index": 199,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:34+07:00"
},
"raw_text": "IMPLEMENTING BUILT-IN 03 CONSTANTS & FUNCTIONS 20"
},
{
"page_index": 200,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_021.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_021.png",
"page_index": 200,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:38+07:00"
},
"raw_text": "WuffldiRrgenhthirgnistantsmana\"rnationsaraysing A-abstractions. Example : We can encode booleans, consider representing \"true\" and \"false\" as functions named \"tru\" and \"fls' How do we define these functions? Think about how \"true\" and \"false\" can be used. They can be used by a testing function: \"test b then else\" returns \"then\" if b is true and returns \"else\" if b is false The only thing the implementation of test will do with b is to apply it. The functions \"tru\" and \"fls\" must distinguish themselves when 21"
},
{
"page_index": 201,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_022.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_022.png",
"page_index": 201,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:42+07:00"
},
"raw_text": "Building in Constants and Functions (2) The encoding: tru =At.Af.t fls = At:Af.f test = Ax.Athen.Aelse.x then else Example: testtru (Ax.t1 (ax.t2) X (at:Af.t) (ax.t1) (ax.t2) * x.t1 22"
},
{
"page_index": 202,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_023.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_023.png",
"page_index": 202,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:46+07:00"
},
"raw_text": "Building in Constants and Functions (3) tru = At.Af.t fls = At.Af.f and : = Ab.Ac.b c fls and l tru tru 1 * tru tru fls tru and fls fls fls tru fls y * * fls 23"
},
{
"page_index": 203,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_024.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_024.png",
"page_index": 203,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:49+07:00"
},
"raw_text": "Numbers 0 := Af.Ax.x 1 := Af.Ax.f x 2 := Af.Ax.f (f x) 3 := Af.Ax.f (f (f x)) 4 := Af.Ax.f (f (f (f x)) SUM := Am.An.Af.Ax.m f (n f x PROD:= Am.An.Af.Ax.m (n f) x SUBTRACT := Am.An.n PRED m Apply the predecessor function (PRED) n times to m How to compute predecessor? Can implement using pairs! 24"
},
{
"page_index": 204,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_025.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_025.png",
"page_index": 204,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:52+07:00"
},
"raw_text": "Data Structures - Pair Let E, F be arbitrary normal form expressions. A pair (E, F) can be represented as the normal form lambda expression: Af:f E F The function to construct a pair is then: PAIR := Ax.Ay.Af.f x y If p is a pair (E, F), i.e., Af.f E F then how do we get its parts? = p TRUE gives us E,and p FALSE gives us F. FIRST := Ap.P TRUE SECOND := Ap.P FALSE 25"
},
{
"page_index": 205,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_026.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_026.png",
"page_index": 205,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:55+07:00"
},
"raw_text": "Data Structures - List Can turn our method of pairing arbitrary normal form expressions into building up lists. All we need is a way to mark the end of the list (NIL) and a way to tell if we're at the end of the list (ISEMPTY) NIL := AX.TRUE ISEMPTY := p.p (AX.y.FALSE ISEMPTY NIL = (p.P (Ax.Ay.FALSE)) (AX. TRUE) (AX.TRUE ) (AX.Ay.FALSE) - TRUE ISEMPTY (PAIR E F) = (p.p (Ax.Ay.FALSE)) (Af.f E F (Af.f E F) (AX.Ay.FALSE) - (AX.Ay.FALSE) E F - FALSE 26"
},
{
"page_index": 206,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_027.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_027.png",
"page_index": 206,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:38:59+07:00"
},
"raw_text": "Predecessor To compute m-n, apply the predecessor function n times to m SUBTRACT := Am.An.n PRED m Predecessor using pairs: PRED := An.FIRST (n NEXT (PAIR O O)) NEXT := p.PAIR (SECOND p) (SUM 1 (SECOND p) 27"
},
{
"page_index": 207,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_028.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_028.png",
"page_index": 207,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:00+07:00"
},
"raw_text": "04 CONCLUSION 28"
},
{
"page_index": 208,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_029.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_029.png",
"page_index": 208,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:03+07:00"
},
"raw_text": "Conclusion Lambda calculus is a minimal yet powerful model of computation. Encodes numbers, booleans, data structures, and even control flow In lambda calculus, some expressions can lead to infinite loops. 29"
},
{
"page_index": 209,
"chapter_num": 9,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_030.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_9/slide_030.png",
"page_index": 209,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:06+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
},
{
"page_index": 210,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_001.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_001.png",
"page_index": 210,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:09+07:00"
},
"raw_text": "DAI HOC BK QUOC GIA TP. HO CHi MINH TP.HCM Advanced Programming C02039 Chapter 5: Functions as First- Class Citizens - Lambda, Higher-Order, Currying Part of the Functional Programming paradigm DAI HQC QUOC GIA THANH PHO HO CHi MINH TRUONG DAI HOC BACH KHOA TP.HCM,03/01/2025"
},
{
"page_index": 211,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_002.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_002.png",
"page_index": 211,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:12+07:00"
},
"raw_text": "CONTE NT 01 LAMBDA FUNCTION 02 HIGHER-ORDER FUNCTION 03 CURRYING 04 CONCLUSION 2"
},
{
"page_index": 212,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_003.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_003.png",
"page_index": 212,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:13+07:00"
},
"raw_text": "LAMBDA 01 FUNCTION 3"
},
{
"page_index": 213,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_004.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_004.png",
"page_index": 213,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:17+07:00"
},
"raw_text": "ambda Function Also called anonymous function - function defined without a name No need to use def keyword = use lambda to define the functions Have its own local namespace & cannot access variables other than those in its parameter list and those in the global namespace Syntax lambda [arg [, arga, argn: expression 4"
},
{
"page_index": 214,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_005.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_005.png",
"page_index": 214,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:20+07:00"
},
"raw_text": "Example Lambda calculus: Ax.y.+ x y Python: sum = lambda arg1, arg2: arg1 + arg2 print(\"value of total : \" sum(10, 20)) print(\"value of total : \" sum(20, 20)) Q: Given a lambda expression as follows: (Af.f(5) (Ax.+ x 2) Write the corresponding Python code. 5"
},
{
"page_index": 215,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_006.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_006.png",
"page_index": 215,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:22+07:00"
},
"raw_text": "HIGHER-ORDER 02 FUNCTION 6"
},
{
"page_index": 216,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_007.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_007.png",
"page_index": 216,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:24+07:00"
},
"raw_text": "Higher-order Function (1) Given function f, return function f . f Af.Ax.f (f x) How does this work? (Af.Ax.f (f x)) (Ay.+ y 1 = Ax.(Ay.+ y 1) ((Xy.+ y 1) x =Ax.(Ay.+ y 1) (+ x 1) Ax.+ (+ x 1) 1 7"
},
{
"page_index": 217,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_008.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_008.png",
"page_index": 217,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:28+07:00"
},
"raw_text": "Higher-order Function (2) Function that takes another function as a parameter. 'Higher-order\" because it is a function of a function. Examples: 0 map 0 reduce fi1ter Lambda works great as a parameter to higher-order functions if you can deal with its limitations = What are those limitations? 8"
},
{
"page_index": 218,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_009.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_009.png",
"page_index": 218,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:31+07:00"
},
"raw_text": "Map map(function, iterable, ...) Map applies function to each element of iterable and creates a list of the results You can optionally provide more iterables as parameters to map and it will place tuples in the result list. Map returns an iterator which can be cast to list. Example: nums [0, 4, 7, 2, 1, 0 9 , 3, 5, 6, 8, 0, 3 nums = list(map(lambda x : x % 5, nums)) print(nums) #[0, 4, 2, 2, 1, 0, 4, 3, 0, 1, 3, 0, 3] 9"
},
{
"page_index": 219,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_010.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_010.png",
"page_index": 219,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:34+07:00"
},
"raw_text": "Filter filter(function, iterable) The filter runs through each element of iterable (any iterable object such as a List or another collection It applies function to each element of iterable. If function returns True for that element then the element is put into a List. Example: nums [0, 4, 7, 2, 1, 0 , 9 , 3, 5, 6, 8, 0, 3] nums = list(filter(lambda x : x != 0, nums)) print(nums) #[4, 7, 2, 1, 9, 3, 5, 6, 8, 3] 10"
},
{
"page_index": 220,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_011.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_011.png",
"page_index": 220,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:38+07:00"
},
"raw_text": "Reduce reduce(function, iterable[, initializer] Reduce will apply function to each element in iterable along with the sum so far and create a cumulative sum of the results function must take two parameters. If initializer is provided, initializer will stand as the first argument in the sum. Example: nums = [1, 2, 3, 4, 5, 6, 7, 8] : nums = list(reduce(lambda x, y : (x, y), nums)) print(nums) #(((((((1, 2), 3), 4), 5), 6), 7), 8 11"
},
{
"page_index": 221,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_012.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_012.png",
"page_index": 221,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:40+07:00"
},
"raw_text": "Another example 0 2 3 4 reduce(lambda acc, e: acc - e, 0 - 1 = -1 [1, 2, 3, 4], 0 -1 - 2 = -3 1 # 0utput: -10 -3 - 3 = -6 -6 - 4 = -10 12"
},
{
"page_index": 222,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_013.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_013.png",
"page_index": 222,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:43+07:00"
},
"raw_text": "Zip zip(iterable1, iterable2, ..:) Combine multiple iterables (like lists or tuples) into a single iterable of tuples Each tuple contains elements from the input iterables that are at the same position (index) Example: names = [\"Alice\", \"Bob\", \"Charlie\"] ages 25,30,35] combined = zip(names, ages) print(list(combined)) Results: [('Alice', 25), ('Bob', 30), ('Charlie', 35)] 13"
},
{
"page_index": 223,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_014.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_014.png",
"page_index": 223,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:45+07:00"
},
"raw_text": "03 CURRYING 14"
},
{
"page_index": 224,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_015.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_015.png",
"page_index": 224,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:50+07:00"
},
"raw_text": "Currying Function Currying is the technique of breaking down the evaluation of a function that takes multiple arguments into evaluating a sequence of single- argument functions. In mathematical notation it looks like this: If we have a function f which takes n arguments, we can \"replace\" it by a composition of n functions f,, f,' ... f, where each takes only one argument: let x = f(a a21 i ar we will get the same value x as if we call: fz = f1(a1) f3 = fz(az) and 15"
},
{
"page_index": 225,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_016.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_016.png",
"page_index": 225,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:53+07:00"
},
"raw_text": "Example def f(a1, a2, a3) : return a1 a2 * a3 def f1(a1) : def f2(a2) def f3(a3) : return f(a1, a2, a3 return f3 return f2 for i in range(1, 1o): print(f(i, i+1, i+2), f1(i)(i+1)(i+2)) # What is the output? 16"
},
{
"page_index": 226,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_017.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_017.png",
"page_index": 226,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:39:57+07:00"
},
"raw_text": "Partially Applied Function A partially applied function is a new function that is derived from an existing function by fixing a certain number of arguments in advance. The result is a function that can be called with the remaining arguments. We can use it for the composition of functions. Example: def f(a1, a a2) : r e t ur n a1 * a2 partial(f, 3)(4) # 0utput: 12 17"
},
{
"page_index": 227,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_018.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_018.png",
"page_index": 227,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:40:00+07:00"
},
"raw_text": "Decorator for Currying def curry(func) : def curried(*args) : if len(args) == func._ code_-.co_argcount: return func(*args) else : return lambda x: curried(*(args + (x,))) return curried @curry def prod3(x, y, z): return x + y + z print(prod3(1)(2)(3)) # 0utput: 6 18"
},
{
"page_index": 228,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_019.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_019.png",
"page_index": 228,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:40:02+07:00"
},
"raw_text": "04 CONCLUSION 19"
},
{
"page_index": 229,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_020.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_020.png",
"page_index": 229,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:40:05+07:00"
},
"raw_text": "Conclusion Lambda Function: Anonymous, inline functions using lambda keyword Higher-Order Function: Accept other functions as arguments or return them Examples: map(, filter, reduce Currying Convert multi-arg functions into chained single-arg functions Enables partial application 20"
},
{
"page_index": 230,
"chapter_num": 10,
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_021.png",
"metadata": {
"doc_type": "slide",
"course_id": "CO2039",
"source_file": "/workspace/data/converted/CO2039_Advanced_Programming/Chapter_10/slide_021.png",
"page_index": 230,
"language": "en",
"ocr_engine": "PaddleOCR 3.2",
"extractor_version": "1.0.0",
"timestamp": "2025-10-31T12:40:08+07:00"
},
"raw_text": "DAI HOC QUOC GIA BK TP.HO CHi MINH TP.HCM Thank you for your attention! https://www.cse.hcmut.edu.vn DAI HOC QUOC GIA THANH PHO HÖ CHi MINH TRUONG DAI HOC BACH KHOA"
}
]
} |