cell_dependenciesa$4dad1e1b-2288-49b9-8190-f2f374ca353cprecedence_heuristic cell_id$4dad1e1b-2288-49b9-8190-f2f374ca353cdownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48qa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4aprecedence_heuristic cell_id$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4adownstream_cells_mapupstream_cells_map@md_strgetindex$9cb862ff-275e-4f1d-8104-c1b8350725daprecedence_heuristic cell_id$9cb862ff-275e-4f1d-8104-c1b8350725dadownstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$d107cd6f-c45c-4289-bd0f-5f329633fddaprecedence_heuristic cell_id$d107cd6f-c45c-4289-bd0f-5f329633fddadownstream_cells_maptutor$a8783da7-4e44-4012-be6e-88705697b0c5$324b41a3-4b01-4589-8ca5-28ec148cdeb1$654184b1-4b5e-4c90-800e-b413a04eeea1$2d35189b-46aa-4922-ad4f-432533da2a80$85e1517c-f7d9-4df5-acde-00657cdf3dbe$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2$accfaade-96ce-4869-83ce-9dd5489b65a2upstream_cells_mapIOBufferislessCode$c132bea8-1ffe-4015-aaa7-66a67a806f48HTTP.escapeurisource_extension$c132bea8-1ffe-4015-aaa7-66a67a806f48HTTP$ecc856dc-e6f2-4a91-8c37-0bb920531297minHTMLcountlines+*$378c90d9-e206-4858-b362-4015ca46bbb0precedence_heuristic cell_id$378c90d9-e206-4858-b362-4015ca46bbb0downstream_cells_mapsection$49f0db66-da21-42b0-91d5-db04075e559aupstream_cells_map@md_strgetindex$44c8617f-ba56-40fe-80b4-963cf6e6f4b5precedence_heuristic cell_id$44c8617f-ba56-40fe-80b4-963cf6e6f4b5downstream_cells_mapupstream_cells_map@md_strgetindex$d85db8cc-56b6-42e5-8175-3c53d345282eprecedence_heuristic cell_id$d85db8cc-56b6-42e5-8175-3c53d345282edownstream_cells_mapupstream_cells_map@md_strBase.getindex@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48Baseqa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$a6ca2092-6435-4081-a407-c3d0286efb62precedence_heuristic cell_id$a6ca2092-6435-4081-a407-c3d0286efb62downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$7f150e04-b56b-499f-ad50-4f586e76a0abprecedence_heuristic cell_id$7f150e04-b56b-499f-ad50-4f586e76a0abdownstream_cells_mapupstream_cells_map@md_strBase.getindex@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48Baseqa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$a8783da7-4e44-4012-be6e-88705697b0c5precedence_heuristic cell_id$a8783da7-4e44-4012-be6e-88705697b0c5downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48wrap_in_main$c132bea8-1ffe-4015-aaa7-66a67a806f48tutor$d107cd6f-c45c-4289-bd0f-5f329633fdda$03847d85-c675-4b4a-9331-fd7a32b26938precedence_heuristic cell_id$03847d85-c675-4b4a-9331-fd7a32b26938downstream_cells_mapupstream_cells_map@md_strgetindex$27b6779a-5624-4e8e-ae32-8a8971923d01precedence_heuristic cell_id$27b6779a-5624-4e8e-ae32-8a8971923d01downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$a39d8ac8-70e6-47a5-b80d-e1443c19ae15precedence_heuristic cell_id$a39d8ac8-70e6-47a5-b80d-e1443c19ae15downstream_cells_mapupstream_cells_map@md_strgetindex$6d3d7f63-766b-4a1f-91c3-46b401c4c280precedence_heuristic cell_id$6d3d7f63-766b-4a1f-91c3-46b401c4c280downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48compile_and_run$c132bea8-1ffe-4015-aaa7-66a67a806f48$8f156e1d-5816-4c56-9aec-ad665d2bc782precedence_heuristic cell_id$8f156e1d-5816-4c56-9aec-ad665d2bc782downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48wrap_compile_and_run$c132bea8-1ffe-4015-aaa7-66a67a806f48$ecc856dc-e6f2-4a91-8c37-0bb920531297precedence_heuristic cell_id$ecc856dc-e6f2-4a91-8c37-0bb920531297downstream_cells_mapMultilineStrings$c132bea8-1ffe-4015-aaa7-66a67a806f48HTTP$d107cd6f-c45c-4289-bd0f-5f329633fddaClang_jll$c132bea8-1ffe-4015-aaa7-66a67a806f48upstream_cells_map$2140d0e6-cd51-465b-bfc5-bdbfe077bc58precedence_heuristic cell_id$2140d0e6-cd51-465b-bfc5-bdbfe077bc58downstream_cells_mapqa$62198fa2-4e96-4950-a99e-a3808bbf811a$488d8bed-855f-470a-a2fa-68c13fd08739$419f48c0-8377-4a67-a801-e87d2a61c17a$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e$4dad1e1b-2288-49b9-8190-f2f374ca353c$e5e45ef0-32ac-403c-a05e-de267209fb8b$7f150e04-b56b-499f-ad50-4f586e76a0ab$d85db8cc-56b6-42e5-8175-3c53d345282e$e1b6f1d3-9d06-4ee4-854d-8ede288f369c_inline_htmlupstream_cells_mapHTMLsprintHypertextLiteral.ResultHypertextLiteral$90a4fe3c-02c7-46e6-b2fb-526e73508101HypertextLiteral.BypassHypertextLiteral.contentMarkdown@htl$4072072d-c543-43bf-87ad-1f201bd21c59precedence_heuristic cell_id$4072072d-c543-43bf-87ad-1f201bd21c59downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$488d8bed-855f-470a-a2fa-68c13fd08739precedence_heuristic cell_id$488d8bed-855f-470a-a2fa-68c13fd08739downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48qa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$b8392f14-05d4-43e4-bd2a-3d4ba6ced65bprecedence_heuristic cell_id$b8392f14-05d4-43e4-bd2a-3d4ba6ced65bdownstream_cells_mapupstream_cells_map@md_strgetindex$1f190c17-4feb-41b2-a10a-60fb191d250eprecedence_heuristic cell_id$1f190c17-4feb-41b2-a10a-60fb191d250edownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48wrap_compile_and_run$c132bea8-1ffe-4015-aaa7-66a67a806f48$406d30a9-f477-4898-9caf-770fcc25b2a9precedence_heuristic cell_id$406d30a9-f477-4898-9caf-770fcc25b2a9downstream_cells_mapupstream_cells_map@md_strgetindex$accfaade-96ce-4869-83ce-9dd5489b65a2precedence_heuristic cell_id$accfaade-96ce-4869-83ce-9dd5489b65a2downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48tutor$d107cd6f-c45c-4289-bd0f-5f329633fdda$6531f0d6-cf62-46ca-8dd2-befda43806d7precedence_heuristic cell_id$6531f0d6-cf62-46ca-8dd2-befda43806d7downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3precedence_heuristic cell_id$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3downstream_cells_mapupstream_cells_mapBaseBase.Docs.HTML@html_str$4e5e1340-c2e6-4b4a-bfb9-e1096d179040precedence_heuristic cell_id$4e5e1340-c2e6-4b4a-bfb9-e1096d179040downstream_cells_mapupstream_cells_map@md_strgetindex$facc8d63-d620-40ff-939a-78ff58fff04fprecedence_heuristic cell_id$facc8d63-d620-40ff-939a-78ff58fff04fdownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$4b009812-191d-4969-bf32-5941ca707f37precedence_heuristic cell_id$4b009812-191d-4969-bf32-5941ca707f37downstream_cells_mapupstream_cells_map@md_strgetindex$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4precedence_heuristic cell_id$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$c81abb3d-7192-499e-a47a-c0b960aa49cdprecedence_heuristic cell_id$c81abb3d-7192-499e-a47a-c0b960aa49cddownstream_cells_mapupstream_cells_map@md_strgetindex$2e1fc3ec-c1ca-43b8-893c-bda691635475precedence_heuristic cell_id$2e1fc3ec-c1ca-43b8-893c-bda691635475downstream_cells_mapupstream_cells_map@md_strgetindex$a13bf677-9c63-4f8e-b3dd-27b3aad7f956precedence_heuristic cell_id$a13bf677-9c63-4f8e-b3dd-27b3aad7f956downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$419f48c0-8377-4a67-a801-e87d2a61c17aprecedence_heuristic cell_id$419f48c0-8377-4a67-a801-e87d2a61c17adownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48qa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$f386a8d4-35be-4612-91c7-31ff0f004e2dprecedence_heuristic cell_id$f386a8d4-35be-4612-91c7-31ff0f004e2ddownstream_cells_mapupstream_cells_map@md_strgetindex$336f53c9-5982-4694-8bd4-92c2a1d1b5ccprecedence_heuristic cell_id$336f53c9-5982-4694-8bd4-92c2a1d1b5ccdownstream_cells_mapupstream_cells_map@md_strgetindex$2d35189b-46aa-4922-ad4f-432533da2a80precedence_heuristic cell_id$2d35189b-46aa-4922-ad4f-432533da2a80downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48wrap_in_main$c132bea8-1ffe-4015-aaa7-66a67a806f48tutor$d107cd6f-c45c-4289-bd0f-5f329633fdda$8c115304-6a8e-4c2e-aeb2-9199c9d3b704precedence_heuristic cell_id$8c115304-6a8e-4c2e-aeb2-9199c9d3b704downstream_cells_mapthree_columns$ad6a791b-14f0-4a20-ad5b-ec1690253bd9upstream_cells_mapDicthboxBaseBase.Docs.HTML@html_strDiv=>$a07e8aea-790b-4307-9de1-e45c6a3f7cf4precedence_heuristic cell_id$a07e8aea-790b-4307-9de1-e45c6a3f7cf4downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$37f6e305-fb5c-4215-b8a1-564a7632a377precedence_heuristic cell_id$37f6e305-fb5c-4215-b8a1-564a7632a377downstream_cells_mapupstream_cells_map@md_strgetindex$b66272c8-02b0-4d22-84d6-7274efe11e2aprecedence_heuristic cell_id$b66272c8-02b0-4d22-84d6-7274efe11e2adownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$848723a1-4a62-47b2-957c-167ce9be19f8precedence_heuristic cell_id$848723a1-4a62-47b2-957c-167ce9be19f8downstream_cells_mapupstream_cells_map@md_strgetindex$20d23ab4-ae24-4169-92be-ed9ec77c5518precedence_heuristic cell_id$20d23ab4-ae24-4169-92be-ed9ec77c5518downstream_cells_mapupstream_cells_map@md_strasidegetindex$fc027d24-619e-4f6f-95ed-3dd12f61b60cprecedence_heuristic cell_id$fc027d24-619e-4f6f-95ed-3dd12f61b60cdownstream_cells_mapupstream_cells_map@md_strgetindex$62198fa2-4e96-4950-a99e-a3808bbf811aprecedence_heuristic cell_id$62198fa2-4e96-4950-a99e-a3808bbf811adownstream_cells_mapupstream_cells_map@md_strBase.getindex@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48Baseqa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$e1b6f1d3-9d06-4ee4-854d-8ede288f369cprecedence_heuristic cell_id$e1b6f1d3-9d06-4ee4-854d-8ede288f369cdownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48qa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$92428490-6d76-44a7-9d5b-a9e988f5ff25precedence_heuristic cell_id$92428490-6d76-44a7-9d5b-a9e988f5ff25downstream_cells_mapupstream_cells_map@md_strgetindex$cfc54158-a170-4f1d-b1dd-ab8e0f1a172eprecedence_heuristic cell_id$cfc54158-a170-4f1d-b1dd-ab8e0f1a172edownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48qa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$324b41a3-4b01-4589-8ca5-28ec148cdeb1precedence_heuristic cell_id$324b41a3-4b01-4589-8ca5-28ec148cdeb1downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48wrap_in_main$c132bea8-1ffe-4015-aaa7-66a67a806f48tutor$d107cd6f-c45c-4289-bd0f-5f329633fdda$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2precedence_heuristic cell_id$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$5b8e5130-bf78-4529-b3be-02a0ba093f12precedence_heuristic cell_id$5b8e5130-bf78-4529-b3be-02a0ba093f12downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$5bd30ea4-3193-4fb4-9bf8-369fcfa6547bprecedence_heuristic cell_id$5bd30ea4-3193-4fb4-9bf8-369fcfa6547bdownstream_cells_mapupstream_cells_map@md_strgetindex$7808e8d0-597c-422a-95eb-cc581fb65d87precedence_heuristic cell_id$7808e8d0-597c-422a-95eb-cc581fb65d87downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$3ddd22b2-7d1b-4b3a-8737-09552b51726dprecedence_heuristic cell_id$3ddd22b2-7d1b-4b3a-8737-09552b51726ddownstream_cells_mapupstream_cells_map@md_strgetindex$ad6a791b-14f0-4a20-ad5b-ec1690253bd9precedence_heuristic cell_id$ad6a791b-14f0-4a20-ad5b-ec1690253bd9downstream_cells_mapwooclap$a07e8aea-790b-4307-9de1-e45c6a3f7cf4$38e67b29-707f-4718-b9cc-2a1a62f32143$6531f0d6-cf62-46ca-8dd2-befda43806d7$ec120913-bafb-4abb-8ebd-a0e3b72578f6$9cb862ff-275e-4f1d-8104-c1b8350725da$a6ca2092-6435-4081-a407-c3d0286efb62$dd918d12-bde4-4a1d-88c2-a9a643f39b2e$7808e8d0-597c-422a-95eb-cc581fb65d87$594773b5-7e89-41a1-a873-387a096ee3b5$986cdd2f-c22a-497b-8ce4-d6755a871c15$a13bf677-9c63-4f8e-b3dd-27b3aad7f956upstream_cells_mapthree_columns$8c115304-6a8e-4c2e-aeb2-9199c9d3b704HTML=>img$65ae6528-ef2c-48fd-94e9-56224e19863e$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2precedence_heuristic cell_id$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2downstream_cells_mapupstream_cells_map@md_strgetindex$acfa3f43-215e-4c97-bf2a-0069e78f95b4precedence_heuristic cell_id$acfa3f43-215e-4c97-bf2a-0069e78f95b4downstream_cells_mapupstream_cells_map@md_strgetindex$319bc8b4-7139-43b0-a57b-66c6a9da7cb9precedence_heuristic cell_id$319bc8b4-7139-43b0-a57b-66c6a9da7cb9downstream_cells_mapupstream_cells_map@md_strgetindex$47279972-433b-46be-b511-170698ff8753precedence_heuristic cell_id$47279972-433b-46be-b511-170698ff8753downstream_cells_mapupstream_cells_map@md_strgetindex$0e0ddf7c-a34b-447a-8142-334d14f96ae1precedence_heuristic cell_id$0e0ddf7c-a34b-447a-8142-334d14f96ae1downstream_cells_mapupstream_cells_map@md_strgetindex$38e67b29-707f-4718-b9cc-2a1a62f32143precedence_heuristic cell_id$38e67b29-707f-4718-b9cc-2a1a62f32143downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$0b41747b-fe00-49a0-9ed9-99f0b2046b2eprecedence_heuristic cell_id$0b41747b-fe00-49a0-9ed9-99f0b2046b2edownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$67cf8ac0-5b91-4d19-aca4-4309f3109a0cprecedence_heuristic cell_id$67cf8ac0-5b91-4d19-aca4-4309f3109a0cdownstream_cells_mapupstream_cells_map@md_strgetindex$87877209-958b-4635-bdbc-97548acdfb3fprecedence_heuristic cell_id$87877209-958b-4635-bdbc-97548acdfb3fdownstream_cells_mapupstream_cells_map@md_strgetindex$9160427d-4db7-4a97-9dde-14d19d59b1efprecedence_heuristic cell_id$9160427d-4db7-4a97-9dde-14d19d59b1efdownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$14a56b43-789a-42f0-9228-0c6a660629c9precedence_heuristic cell_id$14a56b43-789a-42f0-9228-0c6a660629c9downstream_cells_mapupstream_cells_map@md_strgetindex$90a4fe3c-02c7-46e6-b2fb-526e73508101precedence_heuristiccell_id$90a4fe3c-02c7-46e6-b2fb-526e73508101downstream_cells_mapPlutoUI$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411$65ae6528-ef2c-48fd-94e9-56224e19863eHypertextLiteral$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411$65ae6528-ef2c-48fd-94e9-56224e19863e$2140d0e6-cd51-465b-bfc5-bdbfe077bc58ExperimentalLayoutPlutoTeachingTools$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411$65ae6528-ef2c-48fd-94e9-56224e19863eupstream_cells_map$49f0db66-da21-42b0-91d5-db04075e559aprecedence_heuristic cell_id$49f0db66-da21-42b0-91d5-db04075e559adownstream_cells_mapupstream_cells_mapsection$378c90d9-e206-4858-b362-4015ca46bbb0$cb9c27b9-ce7d-4bdf-af7d-c88883a210bcprecedence_heuristic cell_id$cb9c27b9-ce7d-4bdf-af7d-c88883a210bcdownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$3b5e218f-c134-40a9-9bc3-1fbab8d64d62precedence_heuristic cell_id$3b5e218f-c134-40a9-9bc3-1fbab8d64d62downstream_cells_mapupstream_cells_map@md_strgetindex$90532252-a756-40a1-8867-76041f5545a0precedence_heuristic cell_id$90532252-a756-40a1-8867-76041f5545a0downstream_cells_mapupstream_cells_map@md_strgetindex$ec120913-bafb-4abb-8ebd-a0e3b72578f6precedence_heuristic cell_id$ec120913-bafb-4abb-8ebd-a0e3b72578f6downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$4643cd02-67f4-40cd-aa7d-cfdb83fc62beprecedence_heuristic cell_id$4643cd02-67f4-40cd-aa7d-cfdb83fc62bedownstream_cells_mapupstream_cells_map@md_strgetindex$6f257725-72c3-404c-bb35-079265058a43precedence_heuristic cell_id$6f257725-72c3-404c-bb35-079265058a43downstream_cells_mapupstream_cells_map@md_strgetindex$dd918d12-bde4-4a1d-88c2-a9a643f39b2eprecedence_heuristic cell_id$dd918d12-bde4-4a1d-88c2-a9a643f39b2edownstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$b588a04d-6a3f-424e-a83a-eec1dfafc9ddprecedence_heuristic cell_id$b588a04d-6a3f-424e-a83a-eec1dfafc9dddownstream_cells_mapupstream_cells_map@md_strgetindex$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7dprecedence_heuristic cell_id$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7ddownstream_cells_mapupstream_cells_map@md_strgetindex$3b6a95e0-96e9-4634-9207-42ace759e738precedence_heuristic cell_id$3b6a95e0-96e9-4634-9207-42ace759e738downstream_cells_mapframetitleupstream_cells_map@md_strgetindex$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411precedence_heuristic cell_id$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411downstream_cells_mapupstream_cells_mapPlutoUI.TableOfContentsHypertextLiteral.BypassHypertextLiteral.ResultHypertextLiteral$90a4fe3c-02c7-46e6-b2fb-526e73508101PlutoUI$90a4fe3c-02c7-46e6-b2fb-526e73508101HypertextLiteral.content$PlutoTeachingTools.ChooseDisplayModePlutoTeachingTools$90a4fe3c-02c7-46e6-b2fb-526e73508101@htl$b58ba8eb-0661-4eac-8ead-2daff4126d57precedence_heuristic cell_id$b58ba8eb-0661-4eac-8ead-2daff4126d57downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$c132bea8-1ffe-4015-aaa7-66a67a806f48precedence_heuristic cell_id$c132bea8-1ffe-4015-aaa7-66a67a806f48downstream_cells_mapCCode$c132bea8-1ffe-4015-aaa7-66a67a806f48@java_strmd_codecompileemit_llvmJavaCode$c132bea8-1ffe-4015-aaa7-66a67a806f48codesnippet$c132bea8-1ffe-4015-aaa7-66a67a806f48codeCode$c132bea8-1ffe-4015-aaa7-66a67a806f48$d107cd6f-c45c-4289-bd0f-5f329633fddasource_extension$d107cd6f-c45c-4289-bd0f-5f329633fddaBase.show@cpp_str@cl_strCppCode$c132bea8-1ffe-4015-aaa7-66a67a806f48CLCode$c132bea8-1ffe-4015-aaa7-66a67a806f48inline_codeExample$c132bea8-1ffe-4015-aaa7-66a67a806f48compile_and_run$6d3d7f63-766b-4a1f-91c3-46b401c4c280compile_libwrap_in_main$a8783da7-4e44-4012-be6e-88705697b0c5$324b41a3-4b01-4589-8ca5-28ec148cdeb1$654184b1-4b5e-4c90-800e-b413a04eeea1$2d35189b-46aa-4922-ad4f-432533da2a80@c_str!$a8783da7-4e44-4012-be6e-88705697b0c5$6d3d7f63-766b-4a1f-91c3-46b401c4c280$1f190c17-4feb-41b2-a10a-60fb191d250e$8f156e1d-5816-4c56-9aec-ad665d2bc782$324b41a3-4b01-4589-8ca5-28ec148cdeb1$654184b1-4b5e-4c90-800e-b413a04eeea1$0b41747b-fe00-49a0-9ed9-99f0b2046b2e$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2$9160427d-4db7-4a97-9dde-14d19d59b1ef$62198fa2-4e96-4950-a99e-a3808bbf811a$2d35189b-46aa-4922-ad4f-432533da2a80$b66272c8-02b0-4d22-84d6-7274efe11e2a$488d8bed-855f-470a-a2fa-68c13fd08739$419f48c0-8377-4a67-a801-e87d2a61c17a$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e$4dad1e1b-2288-49b9-8190-f2f374ca353c$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1$facc8d63-d620-40ff-939a-78ff58fff04f$c2928a50-8f63-477e-ada3-1352d5c72712$1ca8b74a-ce74-44a3-9e74-1447eb5141a7$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4$b58ba8eb-0661-4eac-8ead-2daff4126d57$85e1517c-f7d9-4df5-acde-00657cdf3dbe$4072072d-c543-43bf-87ad-1f201bd21c59$5b8e5130-bf78-4529-b3be-02a0ba093f12$7f150e04-b56b-499f-ad50-4f586e76a0ab$c306afc9-f86e-4407-8757-272561980a72$d85db8cc-56b6-42e5-8175-3c53d345282e$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc$e1b6f1d3-9d06-4ee4-854d-8ede288f369c$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2$27b6779a-5624-4e8e-ae32-8a8971923d01$accfaade-96ce-4869-83ce-9dd5489b65a2compilerwrap_compile_and_run$1f190c17-4feb-41b2-a10a-60fb191d250e$8f156e1d-5816-4c56-9aec-ad665d2bc782upstream_cells_mapE!InteractiveUtils.print_llvmJavaCode$c132bea8-1ffe-4015-aaa7-66a67a806f48MultilineStrings$ecc856dc-e6f2-4a91-8c37-0bb920531297Clang_jll$ecc856dc-e6f2-4a91-8c37-0bb920531297splitBase.throw#___this_pluto_module_nameBasecontains-write+*MarkdownCoreifelseIOCCode$c132bea8-1ffe-4015-aaa7-66a67a806f48joinpathCode$c132bea8-1ffe-4015-aaa7-66a67a806f48mktempdir@info!===CppCode$c132bea8-1ffe-4015-aaa7-66a67a806f48infindfirst:typeofBool@MIME_strstdoutjoinrunCore._exprappend!@assertAbstractString@warnnothingCmdisemptyCLCode$c132bea8-1ffe-4015-aaa7-66a67a806f48Clang_jll.clangBase.AssertionErrorerrordirnameisaMarkdown.parsepush!ProcessFailedException@__DIR__stringIOBufferescMultilineStrings.indentcodesnippet$c132bea8-1ffe-4015-aaa7-66a67a806f48StringrethrowisnothingreadlinesExample$c132bea8-1ffe-4015-aaa7-66a67a806f48endInteractiveUtilsfindlastHTML>=read$6cc7a1d4-df02-494f-bf18-0652d49280e5precedence_heuristic cell_id$6cc7a1d4-df02-494f-bf18-0652d49280e5downstream_cells_mapupstream_cells_map@md_strgetindex$c306afc9-f86e-4407-8757-272561980a72precedence_heuristic cell_id$c306afc9-f86e-4407-8757-272561980a72downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$132663c2-dfdd-4426-991a-bc9c95bbdad1precedence_heuristic cell_id$132663c2-dfdd-4426-991a-bc9c95bbdad1downstream_cells_mapupstream_cells_map@md_strhbox=>img$65ae6528-ef2c-48fd-94e9-56224e19863egetindex$c73a9ebe-9597-4c49-8493-aec1d71a281aprecedence_heuristic cell_id$c73a9ebe-9597-4c49-8493-aec1d71a281adownstream_cells_mapupstream_cells_map@md_strgetindex$b66c9e2f-17b3-44dc-83e4-cb3a9329039bprecedence_heuristic cell_id$b66c9e2f-17b3-44dc-83e4-cb3a9329039bdownstream_cells_mapupstream_cells_map@md_strgetindex$7838b43b-428d-4045-8cfe-17c9a824ac65precedence_heuristic cell_id$7838b43b-428d-4045-8cfe-17c9a824ac65downstream_cells_mapupstream_cells_map@md_strgetindex$594773b5-7e89-41a1-a873-387a096ee3b5precedence_heuristic cell_id$594773b5-7e89-41a1-a873-387a096ee3b5downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$654184b1-4b5e-4c90-800e-b413a04eeea1precedence_heuristic cell_id$654184b1-4b5e-4c90-800e-b413a04eeea1downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48wrap_in_main$c132bea8-1ffe-4015-aaa7-66a67a806f48tutor$d107cd6f-c45c-4289-bd0f-5f329633fdda$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2precedence_heuristic cell_id$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48tutor$d107cd6f-c45c-4289-bd0f-5f329633fdda$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1precedence_heuristic cell_id$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$1ca8b74a-ce74-44a3-9e74-1447eb5141a7precedence_heuristic cell_id$1ca8b74a-ce74-44a3-9e74-1447eb5141a7downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$e5e45ef0-32ac-403c-a05e-de267209fb8bprecedence_heuristic cell_id$e5e45ef0-32ac-403c-a05e-de267209fb8bdownstream_cells_mapupstream_cells_map@md_strqa$2140d0e6-cd51-465b-bfc5-bdbfe077bc58getindex$65ae6528-ef2c-48fd-94e9-56224e19863eprecedence_heuristic cell_id$65ae6528-ef2c-48fd-94e9-56224e19863edownstream_cells_mapsave_imagePath$65ae6528-ef2c-48fd-94e9-56224e19863eimgpathURL$65ae6528-ef2c-48fd-94e9-56224e19863eimg$132663c2-dfdd-4426-991a-bc9c95bbdad1$ad6a791b-14f0-4a20-ad5b-ec1690253bd9upstream_cells_map!PlutoUI$90a4fe3c-02c7-46e6-b2fb-526e73508101joinpathStringstartswith@htlPlutoTeachingTools$90a4fe3c-02c7-46e6-b2fb-526e73508101HypertextLiteral.ResultinsplitHypertextLiteral.BypassPlutoUI.LocalResourceHypertextLiteral.contentendHypertextLiteral.attribute_pair&PlutoTeachingTools.RobustLocalResourcePath$65ae6528-ef2c-48fd-94e9-56224e19863eURL$65ae6528-ef2c-48fd-94e9-56224e19863eHypertextLiteral$90a4fe3c-02c7-46e6-b2fb-526e73508101*@__DIR__$c2928a50-8f63-477e-ada3-1352d5c72712precedence_heuristic cell_id$c2928a50-8f63-477e-ada3-1352d5c72712downstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48$986cdd2f-c22a-497b-8ce4-d6755a871c15precedence_heuristic cell_id$986cdd2f-c22a-497b-8ce4-d6755a871c15downstream_cells_mapupstream_cells_mapwooclap$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$85e1517c-f7d9-4df5-acde-00657cdf3dbeprecedence_heuristic cell_id$85e1517c-f7d9-4df5-acde-00657cdf3dbedownstream_cells_mapupstream_cells_map@c_str$c132bea8-1ffe-4015-aaa7-66a67a806f48tutor$d107cd6f-c45c-4289-bd0f-5f329633fdda$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40precedence_heuristic cell_id$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40downstream_cells_mapupstream_cells_map@md_strgetindexcell_execution_ordera$90a4fe3c-02c7-46e6-b2fb-526e73508101$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411$3ddd22b2-7d1b-4b3a-8737-09552b51726d$fc027d24-619e-4f6f-95ed-3dd12f61b60c$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7d$5bd30ea4-3193-4fb4-9bf8-369fcfa6547b$acfa3f43-215e-4c97-bf2a-0069e78f95b4$47279972-433b-46be-b511-170698ff8753$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40$b588a04d-6a3f-424e-a83a-eec1dfafc9dd$848723a1-4a62-47b2-957c-167ce9be19f8$a39d8ac8-70e6-47a5-b80d-e1443c19ae15$3b5e218f-c134-40a9-9bc3-1fbab8d64d62$336f53c9-5982-4694-8bd4-92c2a1d1b5cc$37f6e305-fb5c-4215-b8a1-564a7632a377$c73a9ebe-9597-4c49-8493-aec1d71a281a$67cf8ac0-5b91-4d19-aca4-4309f3109a0c$c81abb3d-7192-499e-a47a-c0b960aa49cd$92428490-6d76-44a7-9d5b-a9e988f5ff25$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2$90532252-a756-40a1-8867-76041f5545a0$7838b43b-428d-4045-8cfe-17c9a824ac65$f386a8d4-35be-4612-91c7-31ff0f004e2d$87877209-958b-4635-bdbc-97548acdfb3f$6cc7a1d4-df02-494f-bf18-0652d49280e5$b66c9e2f-17b3-44dc-83e4-cb3a9329039b$0e0ddf7c-a34b-447a-8142-334d14f96ae1$2e1fc3ec-c1ca-43b8-893c-bda691635475$4b009812-191d-4969-bf32-5941ca707f37$44c8617f-ba56-40fe-80b4-963cf6e6f4b5$03847d85-c675-4b4a-9331-fd7a32b26938$406d30a9-f477-4898-9caf-770fcc25b2a9$6f257725-72c3-404c-bb35-079265058a43$14a56b43-789a-42f0-9228-0c6a660629c9$4e5e1340-c2e6-4b4a-bfb9-e1096d179040$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4a$b8392f14-05d4-43e4-bd2a-3d4ba6ced65b$4643cd02-67f4-40cd-aa7d-cfdb83fc62be$319bc8b4-7139-43b0-a57b-66c6a9da7cb9$20d23ab4-ae24-4169-92be-ed9ec77c5518$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3$378c90d9-e206-4858-b362-4015ca46bbb0$49f0db66-da21-42b0-91d5-db04075e559a$3b6a95e0-96e9-4634-9207-42ace759e738$ecc856dc-e6f2-4a91-8c37-0bb920531297$c132bea8-1ffe-4015-aaa7-66a67a806f48$6d3d7f63-766b-4a1f-91c3-46b401c4c280$1f190c17-4feb-41b2-a10a-60fb191d250e$8f156e1d-5816-4c56-9aec-ad665d2bc782$0b41747b-fe00-49a0-9ed9-99f0b2046b2e$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2$9160427d-4db7-4a97-9dde-14d19d59b1ef$b66272c8-02b0-4d22-84d6-7274efe11e2a$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1$facc8d63-d620-40ff-939a-78ff58fff04f$c2928a50-8f63-477e-ada3-1352d5c72712$1ca8b74a-ce74-44a3-9e74-1447eb5141a7$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4$b58ba8eb-0661-4eac-8ead-2daff4126d57$4072072d-c543-43bf-87ad-1f201bd21c59$5b8e5130-bf78-4529-b3be-02a0ba093f12$c306afc9-f86e-4407-8757-272561980a72$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc$27b6779a-5624-4e8e-ae32-8a8971923d01$d107cd6f-c45c-4289-bd0f-5f329633fdda$a8783da7-4e44-4012-be6e-88705697b0c5$324b41a3-4b01-4589-8ca5-28ec148cdeb1$654184b1-4b5e-4c90-800e-b413a04eeea1$2d35189b-46aa-4922-ad4f-432533da2a80$85e1517c-f7d9-4df5-acde-00657cdf3dbe$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2$accfaade-96ce-4869-83ce-9dd5489b65a2$65ae6528-ef2c-48fd-94e9-56224e19863e$132663c2-dfdd-4426-991a-bc9c95bbdad1$8c115304-6a8e-4c2e-aeb2-9199c9d3b704$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$a07e8aea-790b-4307-9de1-e45c6a3f7cf4$38e67b29-707f-4718-b9cc-2a1a62f32143$6531f0d6-cf62-46ca-8dd2-befda43806d7$ec120913-bafb-4abb-8ebd-a0e3b72578f6$9cb862ff-275e-4f1d-8104-c1b8350725da$a6ca2092-6435-4081-a407-c3d0286efb62$dd918d12-bde4-4a1d-88c2-a9a643f39b2e$7808e8d0-597c-422a-95eb-cc581fb65d87$594773b5-7e89-41a1-a873-387a096ee3b5$986cdd2f-c22a-497b-8ce4-d6755a871c15$a13bf677-9c63-4f8e-b3dd-27b3aad7f956$2140d0e6-cd51-465b-bfc5-bdbfe077bc58$62198fa2-4e96-4950-a99e-a3808bbf811a$488d8bed-855f-470a-a2fa-68c13fd08739$419f48c0-8377-4a67-a801-e87d2a61c17a$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e$4dad1e1b-2288-49b9-8190-f2f374ca353c$e5e45ef0-32ac-403c-a05e-de267209fb8b$7f150e04-b56b-499f-ad50-4f586e76a0ab$d85db8cc-56b6-42e5-8175-3c53d345282e$e1b6f1d3-9d06-4ee4-854d-8ede288f369clast_hot_reload_timeprocess_statusreadypath6/home/runner/work/LEPL1503/LEPL1503/Lectures/Cours2.jlpluto_versionv0.20.21cell_ordera$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411$3ddd22b2-7d1b-4b3a-8737-09552b51726d$fc027d24-619e-4f6f-95ed-3dd12f61b60c$a8783da7-4e44-4012-be6e-88705697b0c5$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7d$5bd30ea4-3193-4fb4-9bf8-369fcfa6547b$6d3d7f63-766b-4a1f-91c3-46b401c4c280$acfa3f43-215e-4c97-bf2a-0069e78f95b4$47279972-433b-46be-b511-170698ff8753$1f190c17-4feb-41b2-a10a-60fb191d250e$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40$b588a04d-6a3f-424e-a83a-eec1dfafc9dd$848723a1-4a62-47b2-957c-167ce9be19f8$8f156e1d-5816-4c56-9aec-ad665d2bc782$a39d8ac8-70e6-47a5-b80d-e1443c19ae15$324b41a3-4b01-4589-8ca5-28ec148cdeb1$3b5e218f-c134-40a9-9bc3-1fbab8d64d62$654184b1-4b5e-4c90-800e-b413a04eeea1$336f53c9-5982-4694-8bd4-92c2a1d1b5cc$37f6e305-fb5c-4215-b8a1-564a7632a377$0b41747b-fe00-49a0-9ed9-99f0b2046b2e$a07e8aea-790b-4307-9de1-e45c6a3f7cf4$c73a9ebe-9597-4c49-8493-aec1d71a281a$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2$38e67b29-707f-4718-b9cc-2a1a62f32143$67cf8ac0-5b91-4d19-aca4-4309f3109a0c$9160427d-4db7-4a97-9dde-14d19d59b1ef$6531f0d6-cf62-46ca-8dd2-befda43806d7$c81abb3d-7192-499e-a47a-c0b960aa49cd$92428490-6d76-44a7-9d5b-a9e988f5ff25$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2$62198fa2-4e96-4950-a99e-a3808bbf811a$ec120913-bafb-4abb-8ebd-a0e3b72578f6$90532252-a756-40a1-8867-76041f5545a0$2d35189b-46aa-4922-ad4f-432533da2a80$49f0db66-da21-42b0-91d5-db04075e559a$7838b43b-428d-4045-8cfe-17c9a824ac65$b66272c8-02b0-4d22-84d6-7274efe11e2a$488d8bed-855f-470a-a2fa-68c13fd08739$419f48c0-8377-4a67-a801-e87d2a61c17a$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e$4dad1e1b-2288-49b9-8190-f2f374ca353c$9cb862ff-275e-4f1d-8104-c1b8350725da$f386a8d4-35be-4612-91c7-31ff0f004e2d$87877209-958b-4635-bdbc-97548acdfb3f$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1$6cc7a1d4-df02-494f-bf18-0652d49280e5$facc8d63-d620-40ff-939a-78ff58fff04f$b66c9e2f-17b3-44dc-83e4-cb3a9329039b$c2928a50-8f63-477e-ada3-1352d5c72712$a6ca2092-6435-4081-a407-c3d0286efb62$0e0ddf7c-a34b-447a-8142-334d14f96ae1$1ca8b74a-ce74-44a3-9e74-1447eb5141a7$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4$e5e45ef0-32ac-403c-a05e-de267209fb8b$b58ba8eb-0661-4eac-8ead-2daff4126d57$dd918d12-bde4-4a1d-88c2-a9a643f39b2e$2e1fc3ec-c1ca-43b8-893c-bda691635475$85e1517c-f7d9-4df5-acde-00657cdf3dbe$4b009812-191d-4969-bf32-5941ca707f37$4072072d-c543-43bf-87ad-1f201bd21c59$5b8e5130-bf78-4529-b3be-02a0ba093f12$7f150e04-b56b-499f-ad50-4f586e76a0ab$7808e8d0-597c-422a-95eb-cc581fb65d87$44c8617f-ba56-40fe-80b4-963cf6e6f4b5$c306afc9-f86e-4407-8757-272561980a72$d85db8cc-56b6-42e5-8175-3c53d345282e$594773b5-7e89-41a1-a873-387a096ee3b5$03847d85-c675-4b4a-9331-fd7a32b26938$406d30a9-f477-4898-9caf-770fcc25b2a9$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc$e1b6f1d3-9d06-4ee4-854d-8ede288f369c$986cdd2f-c22a-497b-8ce4-d6755a871c15$6f257725-72c3-404c-bb35-079265058a43$14a56b43-789a-42f0-9228-0c6a660629c9$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2$4e5e1340-c2e6-4b4a-bfb9-e1096d179040$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4a$b8392f14-05d4-43e4-bd2a-3d4ba6ced65b$27b6779a-5624-4e8e-ae32-8a8971923d01$a13bf677-9c63-4f8e-b3dd-27b3aad7f956$4643cd02-67f4-40cd-aa7d-cfdb83fc62be$accfaade-96ce-4869-83ce-9dd5489b65a2$319bc8b4-7139-43b0-a57b-66c6a9da7cb9$132663c2-dfdd-4426-991a-bc9c95bbdad1$20d23ab4-ae24-4169-92be-ed9ec77c5518$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3$378c90d9-e206-4858-b362-4015ca46bbb0$3b6a95e0-96e9-4634-9207-42ace759e738$90a4fe3c-02c7-46e6-b2fb-526e73508101$ecc856dc-e6f2-4a91-8c37-0bb920531297$c132bea8-1ffe-4015-aaa7-66a67a806f48$d107cd6f-c45c-4289-bd0f-5f329633fdda$ad6a791b-14f0-4a20-ad5b-ec1690253bd9$65ae6528-ef2c-48fd-94e9-56224e19863e$8c115304-6a8e-4c2e-aeb2-9199c9d3b704$2140d0e6-cd51-465b-bfc5-bdbfe077bc58published_objectsnbpkgwaiting_for_permission,waiting_for_permission_but_probably_disabled²installed_versionsMultilineStrings0.1.1HTTP1.10.19PlutoUI0.7.79Clang_jll18.1.7+4HypertextLiteral0.9.5PlutoTeachingTools0.4.7terminal_outputsMultilineStringsp Waiting for other notebooks to finish Pkg operations... === Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Manifest.toml` Instantiating... === Precompiling... === Waiting for notebook process to start... Done. Starting precompilation...HTTPp Waiting for other notebooks to finish Pkg operations... === Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Manifest.toml` Instantiating... === Precompiling... === Waiting for notebook process to start... Done. Starting precompilation...nbpkg_syncp Waiting for other notebooks to finish Pkg operations... === Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Manifest.toml` Instantiating... === Precompiling... === Waiting for notebook process to start... Done. Starting precompilation...PlutoUIp Waiting for other notebooks to finish Pkg operations... === Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Manifest.toml` Instantiating... === Precompiling... === Waiting for notebook process to start... Done. Starting precompilation...HypertextLiteralp Waiting for other notebooks to finish Pkg operations... === Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Manifest.toml` Instantiating... === Precompiling... === Waiting for notebook process to start... Done. Starting precompilation...Clang_jllp Waiting for other notebooks to finish Pkg operations... === Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Manifest.toml` Instantiating... === Precompiling... === Waiting for notebook process to start... Done. Starting precompilation...PlutoTeachingToolsp Waiting for other notebooks to finish Pkg operations... === Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_svlzdpsszs/Manifest.toml` Instantiating... === Precompiling... === Waiting for notebook process to start... Done. Starting precompilation...enabledìinstantiated÷restart_recommended_msgrestart_required_msginstall_time_ns"Jbusy_packagescell_inputsa$4dad1e1b-2288-49b9-8190-f2f374ca353ccell_id$4dad1e1b-2288-49b9-8190-f2f374ca353ccodeVqa(c"void destroy(struct vector_t *vect) {", c""" free(vect->v); free(vect); }""")metadatashow_logsèdisabled®skip_as_script«code_folded$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4acell_id$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4acodemd"## Heap ou stack ?"metadatashow_logsèdisabled®skip_as_script«code_folded$9cb862ff-275e-4f1d-8104-c1b8350725dacell_id$9cb862ff-275e-4f1d-8104-c1b8350725dacodewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$d107cd6f-c45c-4289-bd0f-5f329633fddacell_id$d107cd6f-c45c-4289-bd0f-5f329633fddacode # No need to go beyond `620` because pythontutor will just add an internal slider an not show full code function tutor(code::Code; width = 800, height = min(620, 260 + 20 * countlines(IOBuffer(code.code))), frameborder = 0, curInstr = 0) esc_code = HTTP.escapeuri(code.code) src = "https://pythontutor.com/iframe-embed.html#code=$esc_code&cumulative=false&py=$(source_extension(code))&curInstr=$curInstr" return HTML("""""") endmetadatashow_logsèdisabled®skip_as_script«code_folded$378c90d9-e206-4858-b362-4015ca46bbb0cell_id$378c90d9-e206-4858-b362-4015ca46bbb0codesection(s) = md"# $s"metadatashow_logsèdisabled®skip_as_script«code_folded$44c8617f-ba56-40fe-80b4-963cf6e6f4b5cell_id$44c8617f-ba56-40fe-80b4-963cf6e6f4b5code"md"## Modification d'un élément"metadatashow_logsèdisabled®skip_as_script«code_folded$d85db8cc-56b6-42e5-8175-3c53d345282ecell_id$d85db8cc-56b6-42e5-8175-3c53d345282ecodeفqa(md"Comment implémenter `set` ?", c""" if (i < 0 || i >= v->length) return -1; *(v->tab + i) = val; return 0; } """)metadatashow_logsèdisabled®skip_as_script«code_folded$a6ca2092-6435-4081-a407-c3d0286efb62cell_id$a6ca2092-6435-4081-a407-c3d0286efb62codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$7f150e04-b56b-499f-ad50-4f586e76a0abcell_id$7f150e04-b56b-499f-ad50-4f586e76a0abcodeقqa(md"Comment implémenter `get` ?", c""" if (i < 0 || i >= v->length) return -1; *val = *(v->tab + i); return 0; } """)metadatashow_logsèdisabled®skip_as_script«code_folded$a8783da7-4e44-4012-be6e-88705697b0c5cell_id$a8783da7-4e44-4012-be6e-88705697b0c5codeٲtutor(wrap_in_main(c""" int x; int *px; int **ppx; x=1; px=(int *) malloc(sizeof(int)); *px=2; ppx=(int **) malloc(sizeof(int*)); *ppx=(int *) malloc(sizeof(int)); **ppx=3; """))metadatashow_logsèdisabled®skip_as_script«code_folded$03847d85-c675-4b4a-9331-fd7a32b26938cell_id$03847d85-c675-4b4a-9331-fd7a32b26938code!md"## Libération de la mémoire"metadatashow_logsèdisabled®skip_as_script«code_folded$27b6779a-5624-4e8e-ae32-8a8971923d01cell_id$27b6779a-5624-4e8e-ae32-8a8971923d01codeٵc""" int *stack() { int v[] = {1, 2, 3}; return v; } int *heap() { int *v = (int *)malloc(3 * sizeof(int)); v[0] = 1; v[1] = 2; v[2] = 3; return v; }"""metadatashow_logsèdisabled®skip_as_script«code_folded$a39d8ac8-70e6-47a5-b80d-e1443c19ae15cell_id$a39d8ac8-70e6-47a5-b80d-e1443c19ae15code.md"## Première approche, un malloc par ligne"metadatashow_logsèdisabled®skip_as_script«code_folded$6d3d7f63-766b-4a1f-91c3-46b401c4c280cell_id$6d3d7f63-766b-4a1f-91c3-46b401c4c280codecompile_and_run(c""" #include int main(int argc, char **argv) { for (int i = 0; i < argc; i++) { printf("arg[%d]: %s\n", i, argv[i]); } } """, args = ["ab", "cd", "ef"])metadatashow_logsèdisabled®skip_as_script«code_folded$8f156e1d-5816-4c56-9aec-ad665d2bc782cell_id$8f156e1d-5816-4c56-9aec-ad665d2bc782codehwrap_compile_and_run(c""" float *matrice1 = (float *)malloc(4 * sizeof(float)); matrice1[1][1] = 4; """)metadatashow_logsèdisabled®skip_as_script«code_folded$ecc856dc-e6f2-4a91-8c37-0bb920531297cell_id$ecc856dc-e6f2-4a91-8c37-0bb920531297code(import HTTP, Clang_jll, MultilineStringsmetadatashow_logsèdisabled®skip_as_script«code_folded$2140d0e6-cd51-465b-bfc5-bdbfe077bc58cell_id$2140d0e6-cd51-465b-bfc5-bdbfe077bc58codebegin function qa(question, answer) return @htl("
$question$answer
") end function _inline_html(m::Markdown.Paragraph) return sprint(Markdown.htmlinline, m.content) end function qa(question::Markdown.MD, answer) # `html(question)` will create `

` if `question.content[]` is `Markdown.Paragraph` # This will print the question on a new line and we don't want that: h = HTML(_inline_html(question.content[])) return qa(h, answer) end endmetadatashow_logsèdisabled®skip_as_script«code_folded$4072072d-c543-43bf-87ad-1f201bd21c59cell_id$4072072d-c543-43bf-87ad-1f201bd21c59codehc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""metadatashow_logsèdisabled®skip_as_script«code_folded$488d8bed-855f-470a-a2fa-68c13fd08739cell_id$488d8bed-855f-470a-a2fa-68c13fd08739codeqa(c"struct vector_t * init(int size, float val) {", c""" // manque tests erreur malloc struct vector_t *t = (struct vector_t *)malloc(sizeof(struct vector_t)); t->v = (float *)malloc(size * sizeof(float)); t->size = size; for (int i = 0; i < size; i++) { *(t->v + i) = val; } """)metadatashow_logsèdisabled®skip_as_script«code_folded$b8392f14-05d4-43e4-bd2a-3d4ba6ced65bcell_id$b8392f14-05d4-43e4-bd2a-3d4ba6ced65bcodeZmd"Laquelle de ces deux fonctions présente une façon correcte de retourner un tableau ?"metadatashow_logsèdisabled®skip_as_script«code_folded$1f190c17-4feb-41b2-a10a-60fb191d250ecell_id$1f190c17-4feb-41b2-a10a-60fb191d250ecodeMwrap_compile_and_run(c""" float A[2][2] = {{1, 0}, {2, 3}}; A[1][1] = 4; """)metadatashow_logsèdisabled®skip_as_script«code_folded$406d30a9-f477-4898-9caf-770fcc25b2a9cell_id$406d30a9-f477-4898-9caf-770fcc25b2a9codeFmd"Comment libérer la mémoire quand le vecteur est devenu inutile ?"metadatashow_logsèdisabled®skip_as_script«code_folded$accfaade-96ce-4869-83ce-9dd5489b65a2cell_id$accfaade-96ce-4869-83ce-9dd5489b65a2codetutor(c""" #include int *stack() { int v[] = {1, 2, 3}; return v; } int *heap() { int *v = (int *)malloc(3 * sizeof(int)); v[0] = 1; v[1] = 2; v[2] = 3; return v; } int main() { int *v1 = heap(); printf("%d %d %d\\n", v1[0], v1[1], v1[2]); free(v1); // don't forget! int *v2 = stack(); printf("%d %d %d\\n", v2[0], v2[1], v2[2]); return 0; } """)metadatashow_logsèdisabled®skip_as_script«code_folded$6531f0d6-cf62-46ca-8dd2-befda43806d7cell_id$6531f0d6-cf62-46ca-8dd2-befda43806d7codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3cell_id$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3codeahtml"

The End

"metadatashow_logsèdisabled®skip_as_script«code_folded$4e5e1340-c2e6-4b4a-bfb9-e1096d179040cell_id$4e5e1340-c2e6-4b4a-bfb9-e1096d179040codemd"# Retourner un tableau"metadatashow_logsèdisabled®skip_as_script«code_folded$facc8d63-d620-40ff-939a-78ff58fff04fcell_id$facc8d63-d620-40ff-939a-78ff58fff04fcodehc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""metadatashow_logsèdisabled®skip_as_script«code_folded$4b009812-191d-4969-bf32-5941ca707f37cell_id$4b009812-191d-4969-bf32-5941ca707f37code$md"## Récupération d'un élément"metadatashow_logsèdisabled®skip_as_script«code_folded$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4cell_id$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4codec""" int init(int size, float val, struct vector_t **v) { if ((size < 0) || v == NULL) return -1; *v = (struct vector_t *)malloc(sizeof(struct vector_t)); if (*v == NULL) { return -1; } (*v)->tab = (float *)malloc(size * sizeof(float)); if ((*v)->tab == NULL) { return -1; } (*v)->length = size; for (int i = 0; i < size; i++) { """metadatashow_logsèdisabled®skip_as_script«code_folded$c81abb3d-7192-499e-a47a-c0b960aa49cdcell_id$c81abb3d-7192-499e-a47a-c0b960aa49cdcode md"# Libération de la mémoire"metadatashow_logsèdisabled®skip_as_script«code_folded$2e1fc3ec-c1ca-43b8-893c-bda691635475cell_id$2e1fc3ec-c1ca-43b8-893c-bda691635475codemd"## Visualization de init"metadatashow_logsèdisabled®skip_as_script«code_folded$a13bf677-9c63-4f8e-b3dd-27b3aad7f956cell_id$a13bf677-9c63-4f8e-b3dd-27b3aad7f956codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$419f48c0-8377-4a67-a801-e87d2a61c17acell_id$419f48c0-8377-4a67-a801-e87d2a61c17acodeNqa(c"float get(struct vector_t *t, int i) {", c""" return *(t->v + i); }""")metadatashow_logsèdisabled®skip_as_script«code_folded$f386a8d4-35be-4612-91c7-31ff0f004e2dcell_id$f386a8d4-35be-4612-91c7-31ff0f004e2dcode$md"## Une autre implémentation …"metadatashow_logsèdisabled®skip_as_script«code_folded$336f53c9-5982-4694-8bd4-92c2a1d1b5cccell_id$336f53c9-5982-4694-8bd4-92c2a1d1b5cccode!md"# Initialisation d'une valeur"metadatashow_logsèdisabled®skip_as_script«code_folded$2d35189b-46aa-4922-ad4f-432533da2a80cell_id$2d35189b-46aa-4922-ad4f-432533da2a80codetutor(wrap_in_main(c""" float **matrice = (float **)malloc(2 * sizeof(float *)); matrice[0] = (float *)malloc(2 * sizeof(float)); matrice[1] = (float *)malloc(2 * sizeof(float)); free(matrice); free(matrice[0]); free(matrice[1]); """))metadatashow_logsèdisabled®skip_as_script«code_folded$8c115304-6a8e-4c2e-aeb2-9199c9d3b704cell_id$8c115304-6a8e-4c2e-aeb2-9199c9d3b704code٨three_columns(left, center, right) = hbox([ left, Div(html" ", style = Dict("flex-grow" => "1")), center, Div(html" ", style = Dict("flex-grow" => "1")), right, ])metadatashow_logsèdisabled®skip_as_script«code_folded$a07e8aea-790b-4307-9de1-e45c6a3f7cf4cell_id$a07e8aea-790b-4307-9de1-e45c6a3f7cf4codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$37f6e305-fb5c-4215-b8a1-564a7632a377cell_id$37f6e305-fb5c-4215-b8a1-564a7632a377code0md"## Comment initialiser la première valeur ?"metadatashow_logsèdisabled®skip_as_script«code_folded$b66272c8-02b0-4d22-84d6-7274efe11e2acell_id$b66272c8-02b0-4d22-84d6-7274efe11e2acode9c""" struct vector_t { int size; float *v; }; """metadatashow_logsèdisabled®skip_as_script«code_folded$848723a1-4a62-47b2-957c-167ce9be19f8cell_id$848723a1-4a62-47b2-957c-167ce9be19f8code3md"## Comment mettre une matrice 2x2 sur le heap ?"metadatashow_logsèdisabled®skip_as_script«code_folded$20d23ab4-ae24-4169-92be-ed9ec77c5518cell_id$20d23ab4-ae24-4169-92be-ed9ec77c5518codemaside(md"[Source](https://learn.adafruit.com/memories-of-an-arduino/measuring-free-memory)", v_offset = -200)metadatashow_logsèdisabled®skip_as_script«code_folded$fc027d24-619e-4f6f-95ed-3dd12f61b60ccell_id$fc027d24-619e-4f6f-95ed-3dd12f61b60ccodemd"## Visualisation"metadatashow_logsèdisabled®skip_as_script«code_folded$62198fa2-4e96-4950-a99e-a3808bbf811acell_id$62198fa2-4e96-4950-a99e-a3808bbf811acodegqa(md"Comment libérer la mémoire avec `free` ?", c""" free(ligne0); free(ligne1); free(matrice); """)metadatashow_logsèdisabled®skip_as_script«code_folded$e1b6f1d3-9d06-4ee4-854d-8ede288f369ccell_id$e1b6f1d3-9d06-4ee4-854d-8ede288f369ccodeZqa(c"int destroy(struct vector_t *v) {", c""" free(v->tab); free(v); return 0; }""")metadatashow_logsèdisabled®skip_as_script«code_folded$92428490-6d76-44a7-9d5b-a9e988f5ff25cell_id$92428490-6d76-44a7-9d5b-a9e988f5ff25code0md"## L'importance de l'ordre de désallocation"metadatashow_logsèdisabled®skip_as_script«code_folded$cfc54158-a170-4f1d-b1dd-ab8e0f1a172ecell_id$cfc54158-a170-4f1d-b1dd-ab8e0f1a172ecodewqa(c"void set(struct vector_t *t, int i, float val) {", c""" if ((i < t->size) && (i > 0)) *(t->v+i)=val; }""")metadatashow_logsèdisabled®skip_as_script«code_folded$324b41a3-4b01-4589-8ca5-28ec148cdeb1cell_id$324b41a3-4b01-4589-8ca5-28ec148cdeb1codetutor(wrap_in_main(c""" float **matrice2 = (float **)malloc(2 * sizeof(float *)); float *ligne0 = (float *)malloc(2 * sizeof(float)); float *ligne1 = (float *)malloc(2 * sizeof(float)); matrice2[0] = ligne0; matrice2[1] = ligne1; matrice2[1][1] = 4; """))metadatashow_logsèdisabled®skip_as_script«code_folded$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2cell_id$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2code'c""" float **matrice = (float **)malloc(2 * sizeof(float *)); float *ligne0 = (float *)malloc(2 * sizeof(float)); float *ligne1 = (float *)malloc(2 * sizeof(float)); matrice[0] = ligne0; matrice[1] = ligne1; *(*matrice + 1) = 0; // 1 *(matrice++) = 0; // 2 *(matrice[0] + 1) = 0; // 3 """metadatashow_logsèdisabled®skip_as_script«code_folded$5b8e5130-bf78-4529-b3be-02a0ba093f12cell_id$5b8e5130-bf78-4529-b3be-02a0ba093f12codec""" /* * @pre * @post retourne le ième élément du tableau dans val * -1 en cas d'erreur, 0 sinon */ int get(struct vector_t *v, int i, float val // 1 float **val // 2 float *val // 3 ) { """metadatashow_logsèdisabled®skip_as_script«code_folded$5bd30ea4-3193-4fb4-9bf8-369fcfa6547bcell_id$5bd30ea4-3193-4fb4-9bf8-369fcfa6547bcodeٿmd""" * `int argc` : Le nombre d'arguments (incluant le nom de l'exécutable) * `char **argv` : liste des arguments initialisée par le système d’exploitation au lancement du programme """metadatashow_logsèdisabled®skip_as_script«code_folded$7808e8d0-597c-422a-95eb-cc581fb65d87cell_id$7808e8d0-597c-422a-95eb-cc581fb65d87codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$3ddd22b2-7d1b-4b3a-8737-09552b51726dcell_id$3ddd22b2-7d1b-4b3a-8737-09552b51726dcode/md"# Variables, pointeurs et doubles pointeurs"metadatashow_logsèdisabled®skip_as_script«code_folded$ad6a791b-14f0-4a20-ad5b-ec1690253bd9cell_id$ad6a791b-14f0-4a20-ad5b-ec1690253bd9codefunction wooclap(link) logo = HTML("""Wooclap Logo""") url = "https://app.wooclap.com/$link" a = HTML("""$url""") qr = img("https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=$url", :height => 50, name = "$link.png") return three_columns(logo, a, qr) endmetadatashow_logsèdisabled®skip_as_script«code_folded$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2cell_id$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2codemd""" Si la matrice a été créée par ```c float **matrice = (float **)malloc(2 * sizeof(float *)); float *ligne0 = (float *)malloc(2 * sizeof(float)); float *ligne1 = (float *)malloc(2 * sizeof(float)); matrice[0] = ligne0; matrice[1] = ligne1; ``` """metadatashow_logsèdisabled®skip_as_script«code_folded$acfa3f43-215e-4c97-bf2a-0069e78f95b4cell_id$acfa3f43-215e-4c97-bf2a-0069e78f95b4codemd"## Matrices en C"metadatashow_logsèdisabled®skip_as_script«code_folded$319bc8b4-7139-43b0-a57b-66c6a9da7cb9cell_id$319bc8b4-7139-43b0-a57b-66c6a9da7cb9code,md"# Structure différente du stack et heap"metadatashow_logsèdisabled®skip_as_script«code_folded$47279972-433b-46be-b511-170698ff8753cell_id$47279972-433b-46be-b511-170698ff8753code*md""" Comment construire une matrice ? """metadatashow_logsèdisabled®skip_as_script«code_folded$0e0ddf7c-a34b-447a-8142-334d14f96ae1cell_id$0e0ddf7c-a34b-447a-8142-334d14f96ae1code md"## Allocation de la mémoire"metadatashow_logsèdisabled®skip_as_script«code_folded$38e67b29-707f-4718-b9cc-2a1a62f32143cell_id$38e67b29-707f-4718-b9cc-2a1a62f32143codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$0b41747b-fe00-49a0-9ed9-99f0b2046b2ecell_id$0b41747b-fe00-49a0-9ed9-99f0b2046b2ecodec""" float **matrice = (float **)malloc(2 * sizeof(float *)); float *ligne0 = (float *)malloc(2 * sizeof(float)); float *ligne1 = (float *)malloc(2 * sizeof(float)); matrice[0] = ligne0; matrice[1] = ligne1; matrice[0][0] = 1; // 1 *(matrice[0]) = 1; // 2 *(matrice) = 1; // 3 """metadatashow_logsèdisabled®skip_as_script«code_folded$67cf8ac0-5b91-4d19-aca4-4309f3109a0ccell_id$67cf8ac0-5b91-4d19-aca4-4309f3109a0ccode(md"## Comment faire matrice[1][0] = 2 ?"metadatashow_logsèdisabled®skip_as_script«code_folded$87877209-958b-4635-bdbc-97548acdfb3fcell_id$87877209-958b-4635-bdbc-97548acdfb3fcodexmd""" Toutes les fonctions doivent vérifier leurs arguments et retourner * -1 en cas d'erreur * 0 en cas de succès """metadatashow_logsèdisabled®skip_as_script«code_folded$9160427d-4db7-4a97-9dde-14d19d59b1efcell_id$9160427d-4db7-4a97-9dde-14d19d59b1efcode'c""" float **matrice = (float **)malloc(2 * sizeof(float *)); float *ligne0 = (float *)malloc(2 * sizeof(float)); float *ligne1 = (float *)malloc(2 * sizeof(float)); matrice[0] = ligne0; matrice[1] = ligne1; *(*(++matrice)) = 2; // 1 *(*(matrice + 1)) = 2; // 2 *(*matrice + 1) = 2; // 3 """metadatashow_logsèdisabled®skip_as_script«code_folded$14a56b43-789a-42f0-9228-0c6a660629c9cell_id$14a56b43-789a-42f0-9228-0c6a660629c9codeDmd"`mapreduce` donne un exemple de fonction d'ordre supérieur en C"metadatashow_logsèdisabled®skip_as_script«code_folded$90a4fe3c-02c7-46e6-b2fb-526e73508101cell_id$90a4fe3c-02c7-46e6-b2fb-526e73508101codeOusing PlutoUI, PlutoUI.ExperimentalLayout, PlutoTeachingTools, HypertextLiteralmetadatashow_logsèdisabled®skip_as_script«code_folded$49f0db66-da21-42b0-91d5-db04075e559acell_id$49f0db66-da21-42b0-91d5-db04075e559acode#section("Un vecteur \"Java\" en C")metadatashow_logsèdisabled®skip_as_script«code_folded$cb9c27b9-ce7d-4bdf-af7d-c88883a210bccell_id$cb9c27b9-ce7d-4bdf-af7d-c88883a210bccode_c""" /* * libère la mémoire utilisée pour le vecteur * -1 en cas d'erreur, 0 sinon */ """metadatashow_logsèdisabled®skip_as_script«code_folded$3b5e218f-c134-40a9-9bc3-1fbab8d64d62cell_id$3b5e218f-c134-40a9-9bc3-1fbab8d64d62codeLEPL1503/LSINC1503 - Cours 2

O. Bonaventure, B. Legat, M. Baerts

$(PlutoTeachingTools.ChooseDisplayMode()) $(PlutoUI.TableOfContents(depth=1)) """)metadatashow_logsèdisabled®skip_as_script«code_folded$b58ba8eb-0661-4eac-8ead-2daff4126d57cell_id$b58ba8eb-0661-4eac-8ead-2daff4126d57codec""" } return 0; } """metadatashow_logsèdisabled®skip_as_script«code_folded$c132bea8-1ffe-4015-aaa7-66a67a806f48cell_id$c132bea8-1ffe-4015-aaa7-66a67a806f48codebegin abstract type Code end struct CCode <: Code code::String end macro c_str(s) return :($CCode($(esc(s)))) end struct CppCode <: Code code::String end macro cpp_str(s) return :($CppCode($(esc(s)))) end struct CLCode <: Code code::String end macro cl_str(s) return :($CLCode($(esc(s)))) end struct JavaCode <: Code code::String end macro java_str(s) return :($JavaCode($(esc(s)))) end source_extension(::CCode) = "c" source_extension(::CppCode) = "cpp" source_extension(::CLCode) = "cl" source_extension(::JavaCode) = "java" compiler(::CCode, mpi::Bool) = mpi ? "mpicc" : "clang" function compiler(::CppCode, mpi::Bool) @assert !mpi return "clang++" end inline_code(code::AbstractString, ext::String) = HTML("""$code""") inline_code(code::Code) = inline_code(code.code, source_extension(code)) function md_code(code::AbstractString, ext::String) code = "```" * ext * '\n' * code if code[end] != '\n' code *= '\n' end return Markdown.parse(code * "```") end md_code(code::Code) = md_code(code.code, source_extension(code)) function Base.show(io::IO, m::MIME"text/html", code::Code) return show(io, m, md_code(code)) end function compile( code::Code; lib, emit_llvm = false, cflags = ["-O3"], mpi::Bool = false, use_system::Bool = mpi || "-fopenmp" in cflags, # `-fopenmp` will not work with pure Clang_jll, it needs openmp installed as well verbose = 0, ) path = mktempdir() main_file = joinpath(path, "main." * source_extension(code)) bin_file = joinpath(path, ifelse(emit_llvm, "main.llvm", ifelse(lib, "lib.so", "bin"))) write(main_file, code.code) args = String[] if !use_system && code isa CppCode # `clang++` is not part of `Clang_jll` push!(args, "-x") push!(args, "c++") end append!(args, cflags) if lib push!(args, "-fPIC") push!(args, "-shared") end if emit_llvm push!(args, "-S") push!(args, "-emit-llvm") end push!(args, main_file) push!(args, "-o") push!(args, bin_file) try if use_system cmd = Cmd([compiler(code, mpi); args]) if verbose >= 1 @info("Compiling : $cmd") end run(cmd) else Clang_jll.clang() do exe cmd = Cmd([exe; args]) if verbose >= 1 @info("Compiling : $cmd") end run(cmd) end end catch err if err isa ProcessFailedException return else rethrow(err) end end return bin_file end function emit_llvm(code; kws...) llvm = compile(code; lib = false, emit_llvm = true, kws...) InteractiveUtils.print_llvm(stdout, read(llvm, String)) return code end function compile_lib(code::Code; kws...) return codesnippet(code), compile(code; lib = true, kws...) end function compile_and_run(code::Code; verbose = 0, args = String[], valgrind::Bool = false, mpi::Bool = false, num_processes = nothing, show_run_command = !isempty(args) || verbose >= 1, kws...) bin_file = compile(code; lib = false, mpi, verbose, kws...) if !isnothing(bin_file) cmd_vec = [bin_file; args] if valgrind cmd_vec = ["valgrind"; cmd_vec] end if mpi if !isnothing(num_processes) cmd_vec = [["-n", string(num_processes)]; cmd_vec] end cmd_vec = ["mpiexec"; cmd_vec] end cmd = Cmd(cmd_vec) if show_run_command @info("Running : $cmd") # `2:end-1` to remove the backsticks end try run(cmd) catch err @warn(string(typeof(err))) end end return codesnippet(code) end function wrap_in_main(content) code = content.code if code[end] == '\n' code = code[1:end-1] end return typeof(content)(""" #include int main(int argc, char **argv) { $(MultilineStrings.indent(code, 2)) } """) end function wrap_compile_and_run(code; kws...) compile_and_run(wrap_in_main(code); kws...) return code end # TODO It would be nice if the user could select a dropdown or hover with the mouse and see the full code function codesnippet(code::Code) lines = readlines(IOBuffer(code.code)) i = findfirst(line -> contains(line, "codesnippet"), lines) if isnothing(i) return code end j = findlast(line -> contains(line, "codesnippet"), lines) return typeof(code)(join(lines[i+1:j-1], '\n')) end struct Example name::String end function code(example::Example) code = read(joinpath(dirname(dirname(dirname(@__DIR__))), "examples", example.name), String) ext = split(example.name, '.')[end] if ext == "c" return CCode(code) elseif ext == "cpp" || ext == "cc" return CppCode(code) elseif ext == "cl" return CLCode(code) else error("Unrecognized extension `$ext`.") end end function compile_and_run(example::Example; kws...) return compile_and_run(code(example); kws...) end function compile_lib(example::Example; kws...) return compile_lib(code(example); kws...) end endmetadatashow_logsèdisabled®skip_as_script«code_folded$6cc7a1d4-df02-494f-bf18-0652d49280e5cell_id$6cc7a1d4-df02-494f-bf18-0652d49280e5codemd"## Initialisation"metadatashow_logsèdisabled®skip_as_script«code_folded$c306afc9-f86e-4407-8757-272561980a72cell_id$c306afc9-f86e-4407-8757-272561980a72codec"""/* * @pre * @post place val comme ième élément * du tableau * -1 en cas d'erreur, 0 sinon */ int set(struct vector_t *v, int i, float val // 1 float **val // 2 float *val // 3 ) {"""metadatashow_logsèdisabled®skip_as_script«code_folded$132663c2-dfdd-4426-991a-bc9c95bbdad1cell_id$132663c2-dfdd-4426-991a-bc9c95bbdad1codeWhbox([ md""" * Stack : Pile de mémoire locale des functions, structure connue à la **compilation** * Heap : Alloué et désalloué avec des tailles connues à l'**exécution**. L'OS fait de son mieux pour organiser cette mémoire et réassigner les fragments formés suite aux désallocations """, img("heapstack", :width => "350px"), ])metadatashow_logsèdisabled®skip_as_script«code_folded$c73a9ebe-9597-4c49-8493-aec1d71a281acell_id$c73a9ebe-9597-4c49-8493-aec1d71a281acode(md"## Comment faire matrice[0][1] = 0 ?"metadatashow_logsèdisabled®skip_as_script«code_folded$b66c9e2f-17b3-44dc-83e4-cb3a9329039bcell_id$b66c9e2f-17b3-44dc-83e4-cb3a9329039bcodemd"Quels arguments ?"metadatashow_logsèdisabled®skip_as_script«code_folded$7838b43b-428d-4045-8cfe-17c9a824ac65cell_id$7838b43b-428d-4045-8cfe-17c9a824ac65code md"## Première implémentation"metadatashow_logsèdisabled®skip_as_script«code_folded$594773b5-7e89-41a1-a873-387a096ee3b5cell_id$594773b5-7e89-41a1-a873-387a096ee3b5codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$654184b1-4b5e-4c90-800e-b413a04eeea1cell_id$654184b1-4b5e-4c90-800e-b413a04eeea1codetutor(wrap_in_main(c""" float **matrice3 = (float **)malloc(2 * sizeof(float *)); float *valeurs = (float *)malloc(4 * sizeof(float)); matrice3[0] = valeurs; matrice3[1] = valeurs + 2; matrice3[1][1] = 4; """), width = 800)metadatashow_logsèdisabled®skip_as_script«code_folded$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2cell_id$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2codetutor(c""" #include #include int square(int a) { return a * a; } int plus(int a, int b) { return a + b; } int mapreduce(int (*f)(int), int (*op)(int, int), int *vec, int len, int init) { for (int i = 0; i < len; i++) { init = op(init, f(vec[i])); } return init; } int main() { int vec[] = {1, 2, 3, 4}; printf("%d\\n", mapreduce(square, plus, vec, 4, 0)); } """)metadatashow_logsèdisabled®skip_as_script«code_folded$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1cell_id$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1codehc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""metadatashow_logsèdisabled®skip_as_script«code_folded$1ca8b74a-ce74-44a3-9e74-1447eb5141a7cell_id$1ca8b74a-ce74-44a3-9e74-1447eb5141a7codehc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""metadatashow_logsèdisabled®skip_as_script«code_folded$e5e45ef0-32ac-403c-a05e-de267209fb8bcell_id$e5e45ef0-32ac-403c-a05e-de267209fb8bcodeٚqa(md"Comment assigner la valeur `val` au `i`ième élément ?", md""" ```c float *t = (*v)->tab; t[i] = val; ``` ou ```c *((*v)->tab + i) = val; ``` """)metadatashow_logsèdisabled®skip_as_script«code_folded$65ae6528-ef2c-48fd-94e9-56224e19863ecell_id$65ae6528-ef2c-48fd-94e9-56224e19863ecodesbegin struct Path path::String end function imgpath(path::Path) file = path.path if !('.' in file) file = file * ".png" end return joinpath(joinpath(@__DIR__, "images", file)) end function img(path::Path, args...; kws...) return PlutoUI.LocalResource(imgpath(path), args...) end struct URL url::String end function save_image(url::URL, html_attributes...; name = split(url.url, '/')[end], kws...) path = joinpath("cache", name) return PlutoTeachingTools.RobustLocalResource(url.url, path, html_attributes...), path end function img(url::URL, args...; kws...) r, _ = save_image(url, args...; kws...) return @htl("$r") end function img(file::String, args...; kws...) if startswith(file, "http") img(URL(file), args...; kws...) else img(Path(file), args...; kws...) end end endmetadatashow_logsèdisabled®skip_as_script«code_folded$c2928a50-8f63-477e-ada3-1352d5c72712cell_id$c2928a50-8f63-477e-ada3-1352d5c72712codec""" /* * @pre * alloue la mémoire pour un vecteur de size éléments * initialisés à la valeur val * @return -1 si erreur, 0 sinon */ int init(int size, float val, struct vector_t v, // 1 struct vector_t **v, // 2 struct vector_t *v, // 3 ) """metadatashow_logsèdisabled®skip_as_script«code_folded$986cdd2f-c22a-497b-8ce4-d6755a871c15cell_id$986cdd2f-c22a-497b-8ce4-d6755a871c15codewooclap("JAPRXX")metadatashow_logsèdisabled®skip_as_script«code_folded$85e1517c-f7d9-4df5-acde-00657cdf3dbecell_id$85e1517c-f7d9-4df5-acde-00657cdf3dbecodetutor(c""" #include struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels }; int init(int size, float val, struct vector_t **v) { if ((size < 0) || v == NULL) return -1; *v = (struct vector_t *)malloc(sizeof(struct vector_t)); if (*v == NULL) return -1; (*v)->tab = (float *)malloc(size * sizeof(float)); if ((*v)->tab == NULL) return -1; (*v)->length = size; for (int i = 0; i < size; i++) { float *t = (*v)->tab; t[i] = val; // ou *((*v)->tab + i) = val; } return 0; } int main() { struct vector_t *ptr = NULL; int err = init(4, 1.23, &ptr); } """)metadatashow_logsèdisabled®skip_as_script«code_folded$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40cell_id$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40codermd"Une telle matrice sera stockée sur le **stack** (variable locale) ou dans la zone données (variable globale)"metadatashow_logsèdisabled®skip_as_script«code_foldedënotebook_id$1e021d28-9184-11f1-a11f-2f43b3d7eb3abondscell_resultsa$4dad1e1b-2288-49b9-8190-f2f374ca353cqueued¤logsrunning¦outputbody
void destroy(struct vector_t *vect) {
  free(vect->v);
  free(vect);
}
persist_js_state¤mimetext/htmllast_run_timestampAڝE"has_pluto_hook_features¬rootassigneecell_id$4dad1e1b-2288-49b9-8190-f2f374ca353cdepends_on_disabled_cells§runtimeͭspublished_object_keysdepends_on_skipped_cells§errored$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4aqueued¤logsrunning¦outputbodyJ

Heap ou stack ?

persist_js_state¤mimetext/htmllast_run_timestampAڝSGhas_pluto_hook_features¬rootassigneecell_id$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4adepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$9cb862ff-275e-4f1d-8104-c1b8350725daqueued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ,ythas_pluto_hook_features¬rootassigneecell_id$9cb862ff-275e-4f1d-8104-c1b8350725dadepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$d107cd6f-c45c-4289-bd0f-5f329633fddaqueued¤logsrunning¦outputbody&tutor (generic function with 1 method)persist_js_state¤mimetext/plainlast_run_timestampAڝ2has_pluto_hook_features¬rootassigneecell_id$d107cd6f-c45c-4289-bd0f-5f329633fddadepends_on_disabled_cells§runtime/(published_object_keysdepends_on_skipped_cells§errored$378c90d9-e206-4858-b362-4015ca46bbb0queued¤logsrunning¦outputbody(section (generic function with 1 method)persist_js_state¤mimetext/plainlast_run_timestampAڝJ{has_pluto_hook_features¬rootassigneecell_id$378c90d9-e206-4858-b362-4015ca46bbb0depends_on_disabled_cells§runtime1_published_object_keysdepends_on_skipped_cells§errored$44c8617f-ba56-40fe-80b4-963cf6e6f4b5queued¤logsrunning¦outputbodyj

Modification d'un élément

persist_js_state¤mimetext/htmllast_run_timestampAڝRS*has_pluto_hook_features¬rootassigneecell_id$44c8617f-ba56-40fe-80b4-963cf6e6f4b5depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$d85db8cc-56b6-42e5-8175-3c53d345282equeued¤logsrunning¦outputbody
Comment implémenter set ?
  if (i < 0 || i >= v->length)
    return -1;
  *(v->tab + i) = val;
  return 0;
}
persist_js_state¤mimetext/htmllast_run_timestampAڝKtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ-has_pluto_hook_features¬rootassigneecell_id$a6ca2092-6435-4081-a407-c3d0286efb62depends_on_disabled_cells§runtimeTpublished_object_keysdepends_on_skipped_cells§errored$7f150e04-b56b-499f-ad50-4f586e76a0abqueued¤logsrunning¦outputbody
Comment implémenter get ?
  if (i < 0 || i >= v->length)
    return -1;
  *val = *(v->tab + i);
  return 0;
}
persist_js_state¤mimetext/htmllast_run_timestampAڝJhas_pluto_hook_features¬rootassigneecell_id$7f150e04-b56b-499f-ad50-4f586e76a0abdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$a8783da7-4e44-4012-be6e-88705697b0c5queued¤logsrunning¦outputbody;persist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$a8783da7-4e44-4012-be6e-88705697b0c5depends_on_disabled_cells§runtimeU

Libération de la mémoire

persist_js_state¤mimetext/htmllast_run_timestampAڝRxhas_pluto_hook_features¬rootassigneecell_id$03847d85-c675-4b4a-9331-fd7a32b26938depends_on_disabled_cells§runtime 6?published_object_keysdepends_on_skipped_cells§errored$27b6779a-5624-4e8e-ae32-8a8971923d01queued¤logsrunning¦outputbodyo
int *stack()
{
    int v[] = {1, 2, 3};
    return v;
}

int *heap()
{
    int *v = (int *)malloc(3 * sizeof(int));
    v[0] = 1;
    v[1] = 2;
    v[2] = 3;
    return v;
}
persist_js_state¤mimetext/htmllast_run_timestampAڝhhas_pluto_hook_features¬rootassigneecell_id$27b6779a-5624-4e8e-ae32-8a8971923d01depends_on_disabled_cells§runtimegpublished_object_keysdepends_on_skipped_cells§errored$a39d8ac8-70e6-47a5-b80d-e1443c19ae15queued¤logsrunning¦outputbodyz

Première approche, un malloc par ligne

persist_js_state¤mimetext/htmllast_run_timestampAڝPgӷhas_pluto_hook_features¬rootassigneecell_id$a39d8ac8-70e6-47a5-b80d-e1443c19ae15depends_on_disabled_cells§runtime+published_object_keysdepends_on_skipped_cells§errored$6d3d7f63-766b-4a1f-91c3-46b401c4c280queued¤logslinemsg'Running : `/tmp/jl_NnVxqT/bin ab cd ef`text/plaincell_id$6d3d7f63-766b-4a1f-91c3-46b401c4c280kwargsidMain_workspace#2_c2f2ac11file^/home/runner/work/LEPL1503/LEPL1503/Lectures/Cours2.jl#==#c132bea8-1ffe-4015-aaa7-66a67a806f48groupCours2levelInfolinemsg
#include <stdio.h>
int main(int argc, char **argv)
{
    for (int i = 0; i < argc; i++)
    {
        printf("arg[%d]: %s\n", i, argv[i]);
    }
}
persist_js_state¤mimetext/htmllast_run_timestampAڝ_has_pluto_hook_features¬rootassigneecell_id$6d3d7f63-766b-4a1f-91c3-46b401c4c280depends_on_disabled_cells§runtimeu+published_object_keysdepends_on_skipped_cells§errored$8f156e1d-5816-4c56-9aec-ad665d2bc782queued¤logslinemsg٢/tmp/jl_sgqhsY/main.c:5:14: error: subscripted value is not an array, pointer, or vector 5 | matrice1[1][1] = 4; | ~~~~~~~~~~~^~ 1 error generated. text/plaincell_id$8f156e1d-5816-4c56-9aec-ad665d2bc782kwargsidPlutoRunner_d1acb81efileP/home/runner/.julia/packages/Pluto/CBqeh/src/runner/PlutoRunner/src/io/stdout.jlgroupstdoutlevelLogLevel(-555)running¦outputbody
float *matrice1 = (float *)malloc(4 * sizeof(float));
matrice1[1][1] = 4;
persist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$8f156e1d-5816-4c56-9aec-ad665d2bc782depends_on_disabled_cells§runtimeɓpublished_object_keysdepends_on_skipped_cells§errored$ecc856dc-e6f2-4a91-8c37-0bb920531297queued¤logsrunning¦outputbodypersist_js_state¤mimetext/plainlast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$ecc856dc-e6f2-4a91-8c37-0bb920531297depends_on_disabled_cells§runtimegpublished_object_keysdepends_on_skipped_cells§errored$2140d0e6-cd51-465b-bfc5-bdbfe077bc58queued¤logsrunning¦outputbody$qa (generic function with 2 methods)persist_js_state¤mimetext/plainlast_run_timestampAڝ7Qhas_pluto_hook_features¬rootassigneecell_id$2140d0e6-cd51-465b-bfc5-bdbfe077bc58depends_on_disabled_cells§runtime0published_object_keysdepends_on_skipped_cells§errored$4072072d-c543-43bf-87ad-1f201bd21c59queued¤logsrunning¦outputbodyٷ
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
persist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$4072072d-c543-43bf-87ad-1f201bd21c59depends_on_disabled_cells§runtimeu"published_object_keysdepends_on_skipped_cells§errored$488d8bed-855f-470a-a2fa-68c13fd08739queued¤logsrunning¦outputbodyD
struct vector_t * init(int size, float val) {
// manque tests erreur malloc
struct vector_t *t = (struct vector_t *)malloc(sizeof(struct vector_t));
t->v = (float *)malloc(size * sizeof(float));
t->size = size;
for (int i = 0; i < size; i++)
{
    *(t->v + i) = val;
}
persist_js_state¤mimetext/htmllast_run_timestampAڝAhas_pluto_hook_features¬rootassigneecell_id$488d8bed-855f-470a-a2fa-68c13fd08739depends_on_disabled_cells§runtime.published_object_keysdepends_on_skipped_cells§errored$b8392f14-05d4-43e4-bd2a-3d4ba6ced65bqueued¤logsrunning¦outputbodyz

Laquelle de ces deux fonctions présente une façon correcte de retourner un tableau ?

persist_js_state¤mimetext/htmllast_run_timestampAڝSChas_pluto_hook_features¬rootassigneecell_id$b8392f14-05d4-43e4-bd2a-3d4ba6ced65bdepends_on_disabled_cells§runtimeHpublished_object_keysdepends_on_skipped_cells§errored$1f190c17-4feb-41b2-a10a-60fb191d250equeued¤logsrunning¦outputbodyټ
float A[2][2] = {{1, 0}, {2, 3}};
A[1][1] = 4;
persist_js_state¤mimetext/htmllast_run_timestampAڝihas_pluto_hook_features¬rootassigneecell_id$1f190c17-4feb-41b2-a10a-60fb191d250edepends_on_disabled_cells§runtime(published_object_keysdepends_on_skipped_cells§errored$406d30a9-f477-4898-9caf-770fcc25b2a9queued¤logsrunning¦outputbodyf

Comment libérer la mémoire quand le vecteur est devenu inutile ?

persist_js_state¤mimetext/htmllast_run_timestampAڝRlhas_pluto_hook_features¬rootassigneecell_id$406d30a9-f477-4898-9caf-770fcc25b2a9depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$accfaade-96ce-4869-83ce-9dd5489b65a2queued¤logsrunning¦outputbodypersist_js_state¤mimetext/htmllast_run_timestampAڝ ghas_pluto_hook_features¬rootassigneecell_id$accfaade-96ce-4869-83ce-9dd5489b65a2depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$6531f0d6-cf62-46ca-8dd2-befda43806d7queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ+`has_pluto_hook_features¬rootassigneecell_id$6531f0d6-cf62-46ca-8dd2-befda43806d7depends_on_disabled_cells§runtimeK published_object_keysdepends_on_skipped_cells§errored$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3queued¤logsrunning¦outputbodyY

The End

persist_js_state¤mimetext/htmllast_run_timestampAڝShhas_pluto_hook_features¬rootassigneecell_id$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3depends_on_disabled_cells§runtimeqpublished_object_keysdepends_on_skipped_cells§errored$4e5e1340-c2e6-4b4a-bfb9-e1096d179040queued¤logsrunning¦outputbodyT

Retourner un tableau

persist_js_state¤mimetext/htmllast_run_timestampAڝR尷has_pluto_hook_features¬rootassigneecell_id$4e5e1340-c2e6-4b4a-bfb9-e1096d179040depends_on_disabled_cells§runtime3published_object_keysdepends_on_skipped_cells§errored$facc8d63-d620-40ff-939a-78ff58fff04fqueued¤logsrunning¦outputbodyٷ
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
persist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$facc8d63-d620-40ff-939a-78ff58fff04fdepends_on_disabled_cells§runtimee>published_object_keysdepends_on_skipped_cells§errored$4b009812-191d-4969-bf32-5941ca707f37queued¤logsrunning¦outputbodyn

Récupération d'un élément

persist_js_state¤mimetext/htmllast_run_timestampAڝR8.has_pluto_hook_features¬rootassigneecell_id$4b009812-191d-4969-bf32-5941ca707f37depends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4queued¤logsrunning¦outputbody
int init(int size, float val, struct vector_t **v)
{
    if ((size < 0) || v == NULL)
        return -1;
    *v = (struct vector_t *)malloc(sizeof(struct vector_t));
    if (*v == NULL)
    {
        return -1;
    }
    (*v)->tab = (float *)malloc(size * sizeof(float));
    if ((*v)->tab == NULL)
    {
        return -1;
    }
    (*v)->length = size;
    for (int i = 0; i < size; i++)
    {
persist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4depends_on_disabled_cells§runtimeipublished_object_keysdepends_on_skipped_cells§errored$c81abb3d-7192-499e-a47a-c0b960aa49cdqueued¤logsrunning¦outputbody`

Libération de la mémoire

persist_js_state¤mimetext/htmllast_run_timestampAڝQhas_pluto_hook_features¬rootassigneecell_id$c81abb3d-7192-499e-a47a-c0b960aa49cddepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$2e1fc3ec-c1ca-43b8-893c-bda691635475queued¤logsrunning¦outputbodyV

Visualization de init

persist_js_state¤mimetext/htmllast_run_timestampAڝRhas_pluto_hook_features¬rootassigneecell_id$2e1fc3ec-c1ca-43b8-893c-bda691635475depends_on_disabled_cells§runtime9published_object_keysdepends_on_skipped_cells§errored$a13bf677-9c63-4f8e-b3dd-27b3aad7f956queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ/has_pluto_hook_features¬rootassigneecell_id$a13bf677-9c63-4f8e-b3dd-27b3aad7f956depends_on_disabled_cells§runtime%published_object_keysdepends_on_skipped_cells§errored$419f48c0-8377-4a67-a801-e87d2a61c17aqueued¤logsrunning¦outputbody
float get(struct vector_t *t, int i) {
  return *(t->v + i);
}
persist_js_state¤mimetext/htmllast_run_timestampAڝC>շhas_pluto_hook_features¬rootassigneecell_id$419f48c0-8377-4a67-a801-e87d2a61c17adepends_on_disabled_cells§runtimeͫtpublished_object_keysdepends_on_skipped_cells§errored$f386a8d4-35be-4612-91c7-31ff0f004e2dqueued¤logsrunning¦outputbodyf

Une autre implémentation …

persist_js_state¤mimetext/htmllast_run_timestampAڝQThas_pluto_hook_features¬rootassigneecell_id$f386a8d4-35be-4612-91c7-31ff0f004e2ddepends_on_disabled_cells§runtimeJFpublished_object_keysdepends_on_skipped_cells§errored$336f53c9-5982-4694-8bd4-92c2a1d1b5ccqueued¤logsrunning¦outputbodyj

Initialisation d'une valeur

persist_js_state¤mimetext/htmllast_run_timestampAڝPhas_pluto_hook_features¬rootassigneecell_id$336f53c9-5982-4694-8bd4-92c2a1d1b5ccdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$2d35189b-46aa-4922-ad4f-432533da2a80queued¤logsrunning¦outputbodyxpersist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$2d35189b-46aa-4922-ad4f-432533da2a80depends_on_disabled_cells§runtime8published_object_keysdepends_on_skipped_cells§errored$8c115304-6a8e-4c2e-aeb2-9199c9d3b704queued¤logsrunning¦outputbody.three_columns (generic function with 1 method)persist_js_state¤mimetext/plainlast_run_timestampAڝ2/has_pluto_hook_features¬rootassigneecell_id$8c115304-6a8e-4c2e-aeb2-9199c9d3b704depends_on_disabled_cells§runtime@6published_object_keysdepends_on_skipped_cells§errored$a07e8aea-790b-4307-9de1-e45c6a3f7cf4queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ*?ȷhas_pluto_hook_features¬rootassigneecell_id$a07e8aea-790b-4307-9de1-e45c6a3f7cf4depends_on_disabled_cells§runtime8published_object_keysdepends_on_skipped_cells§errored$37f6e305-fb5c-4215-b8a1-564a7632a377queued¤logsrunning¦outputbody~

Comment initialiser la première valeur ?

persist_js_state¤mimetext/htmllast_run_timestampAڝPchas_pluto_hook_features¬rootassigneecell_id$37f6e305-fb5c-4215-b8a1-564a7632a377depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$b66272c8-02b0-4d22-84d6-7274efe11e2aqueued¤logsrunning¦outputbodyق
struct vector_t
{
    int size;
    float *v;
};
persist_js_state¤mimetext/htmllast_run_timestampAڝXuhas_pluto_hook_features¬rootassigneecell_id$b66272c8-02b0-4d22-84d6-7274efe11e2adepends_on_disabled_cells§runtimegpublished_object_keysdepends_on_skipped_cells§errored$848723a1-4a62-47b2-957c-167ce9be19f8queued¤logsrunning¦outputbodyل

Comment mettre une matrice 2x2 sur le heap ?

persist_js_state¤mimetext/htmllast_run_timestampAڝPMhas_pluto_hook_features¬rootassigneecell_id$848723a1-4a62-47b2-957c-167ce9be19f8depends_on_disabled_cells§runtime钵published_object_keysdepends_on_skipped_cells§errored$20d23ab4-ae24-4169-92be-ed9ec77c5518queued¤logsrunning¦outputbody persist_js_state¤mimetext/htmllast_run_timestampAڝ4has_pluto_hook_features¬rootassigneecell_id$20d23ab4-ae24-4169-92be-ed9ec77c5518depends_on_disabled_cells§runtimeD'published_object_keysdepends_on_skipped_cells§errored$fc027d24-619e-4f6f-95ed-3dd12f61b60cqueued¤logsrunning¦outputbodyF

Visualisation

persist_js_state¤mimetext/htmllast_run_timestampAڝOvWhas_pluto_hook_features¬rootassigneecell_id$fc027d24-619e-4f6f-95ed-3dd12f61b60cdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$62198fa2-4e96-4950-a99e-a3808bbf811aqueued¤logsrunning¦outputbody
Comment libérer la mémoire avec free ?
free(ligne0);
free(ligne1);
free(matrice);
persist_js_state¤mimetext/htmllast_run_timestampAڝ?has_pluto_hook_features¬rootassigneecell_id$62198fa2-4e96-4950-a99e-a3808bbf811adepends_on_disabled_cells§runtimeqrpublished_object_keysdepends_on_skipped_cells§errored$e1b6f1d3-9d06-4ee4-854d-8ede288f369cqueued¤logsrunning¦outputbody$
int destroy(struct vector_t *v) {
  free(v->tab);
  free(v);
  return 0;
}
persist_js_state¤mimetext/htmllast_run_timestampAڝLhas_pluto_hook_features¬rootassigneecell_id$e1b6f1d3-9d06-4ee4-854d-8ede288f369cdepends_on_disabled_cells§runtimeͧpublished_object_keysdepends_on_skipped_cells§errored$92428490-6d76-44a7-9d5b-a9e988f5ff25queued¤logsrunning¦outputbodyَ

L'importance de l'ordre de désallocation

persist_js_state¤mimetext/htmllast_run_timestampAڝQ!has_pluto_hook_features¬rootassigneecell_id$92428490-6d76-44a7-9d5b-a9e988f5ff25depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$cfc54158-a170-4f1d-b1dd-ab8e0f1a172equeued¤logsrunning¦outputbodyj
void set(struct vector_t *t, int i, float val) {
  if ((i < t->size) && (i > 0))
      *(t->v+i)=val;
}
persist_js_state¤mimetext/htmllast_run_timestampAڝDʷhas_pluto_hook_features¬rootassigneecell_id$cfc54158-a170-4f1d-b1dd-ab8e0f1a172edepends_on_disabled_cells§runtimeͨpublished_object_keysdepends_on_skipped_cells§errored$324b41a3-4b01-4589-8ca5-28ec148cdeb1queued¤logsrunning¦outputbodypersist_js_state¤mimetext/htmllast_run_timestampAڝ²}has_pluto_hook_features¬rootassigneecell_id$324b41a3-4b01-4589-8ca5-28ec148cdeb1depends_on_disabled_cells§runtime@published_object_keysdepends_on_skipped_cells§errored$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2queued¤logsrunning¦outputbody
float **matrice = (float **)malloc(2 * sizeof(float *));
float *ligne0 = (float *)malloc(2 * sizeof(float));
float *ligne1 = (float *)malloc(2 * sizeof(float));
matrice[0] = ligne0;
matrice[1] = ligne1;
*(*matrice + 1) = 0;   // 1
*(matrice++) = 0;      // 2
*(matrice[0] + 1) = 0; // 3
persist_js_state¤mimetext/htmllast_run_timestampAڝ5Hhas_pluto_hook_features¬rootassigneecell_id$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2depends_on_disabled_cells§runtimeepublished_object_keysdepends_on_skipped_cells§errored$5b8e5130-bf78-4529-b3be-02a0ba093f12queued¤logsrunning¦outputbody8
/*
 * @pre
 * @post retourne le ième élément du tableau dans val
 *       -1 en cas d'erreur, 0 sinon
 */

int get(struct vector_t *v, int i,
        float val   // 1
        float **val // 2
        float *val  // 3
) {
persist_js_state¤mimetext/htmllast_run_timestampAڝ$has_pluto_hook_features¬rootassigneecell_id$5b8e5130-bf78-4529-b3be-02a0ba093f12depends_on_disabled_cells§runtimefWpublished_object_keysdepends_on_skipped_cells§errored$5bd30ea4-3193-4fb4-9bf8-369fcfa6547bqueued¤logsrunning¦outputbody!
  • int argc : Le nombre d'arguments (incluant le nom de l'exécutable)

  • char **argv : liste des arguments initialisée par le système d’exploitation au lancement du programme

persist_js_state¤mimetext/htmllast_run_timestampAڝOhas_pluto_hook_features¬rootassigneecell_id$5bd30ea4-3193-4fb4-9bf8-369fcfa6547bdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$7808e8d0-597c-422a-95eb-cc581fb65d87queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ.*has_pluto_hook_features¬rootassigneecell_id$7808e8d0-597c-422a-95eb-cc581fb65d87depends_on_disabled_cells§runtime.published_object_keysdepends_on_skipped_cells§errored$3ddd22b2-7d1b-4b3a-8737-09552b51726dqueued¤logsrunning¦outputbody~

Variables, pointeurs et doubles pointeurs

persist_js_state¤mimetext/htmllast_run_timestampAڝOYmhas_pluto_hook_features¬rootassigneecell_id$3ddd22b2-7d1b-4b3a-8737-09552b51726ddepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$ad6a791b-14f0-4a20-ad5b-ec1690253bd9queued¤logsrunning¦outputbody(wooclap (generic function with 1 method)persist_js_state¤mimetext/plainlast_run_timestampAڝηhas_pluto_hook_features¬rootassigneecell_id$ad6a791b-14f0-4a20-ad5b-ec1690253bd9depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2queued¤logsrunning¦outputbody

Si la matrice a été créée par

float **matrice = (float **)malloc(2 * sizeof(float *));
float *ligne0 = (float *)malloc(2 * sizeof(float));
float *ligne1 = (float *)malloc(2 * sizeof(float));
matrice[0] = ligne0;
matrice[1] = ligne1;
persist_js_state¤mimetext/htmllast_run_timestampAڝQ>hhas_pluto_hook_features¬rootassigneecell_id$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$acfa3f43-215e-4c97-bf2a-0069e78f95b4queued¤logsrunning¦outputbodyF

Matrices en C

persist_js_state¤mimetext/htmllast_run_timestampAڝOhas_pluto_hook_features¬rootassigneecell_id$acfa3f43-215e-4c97-bf2a-0069e78f95b4depends_on_disabled_cells§runtime\published_object_keysdepends_on_skipped_cells§errored$319bc8b4-7139-43b0-a57b-66c6a9da7cb9queued¤logsrunning¦outputbodyx

Structure différente du stack et heap

persist_js_state¤mimetext/htmllast_run_timestampAڝSQhas_pluto_hook_features¬rootassigneecell_id$319bc8b4-7139-43b0-a57b-66c6a9da7cb9depends_on_disabled_cells§runtimeꬵpublished_object_keysdepends_on_skipped_cells§errored$47279972-433b-46be-b511-170698ff8753queued¤logsrunning¦outputbodyD

Comment construire une matrice ?

persist_js_state¤mimetext/htmllast_run_timestampAڝO5has_pluto_hook_features¬rootassigneecell_id$47279972-433b-46be-b511-170698ff8753depends_on_disabled_cells§runtime8published_object_keysdepends_on_skipped_cells§errored$0e0ddf7c-a34b-447a-8142-334d14f96ae1queued¤logsrunning¦outputbody^

Allocation de la mémoire

persist_js_state¤mimetext/htmllast_run_timestampAڝRhas_pluto_hook_features¬rootassigneecell_id$0e0ddf7c-a34b-447a-8142-334d14f96ae1depends_on_disabled_cells§runtime&published_object_keysdepends_on_skipped_cells§errored$38e67b29-707f-4718-b9cc-2a1a62f32143queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ*зhas_pluto_hook_features¬rootassigneecell_id$38e67b29-707f-4718-b9cc-2a1a62f32143depends_on_disabled_cells§runtimerpublished_object_keysdepends_on_skipped_cells§errored$0b41747b-fe00-49a0-9ed9-99f0b2046b2equeued¤logsrunning¦outputbody
float **matrice = (float **)malloc(2 * sizeof(float *));
float *ligne0 = (float *)malloc(2 * sizeof(float));
float *ligne1 = (float *)malloc(2 * sizeof(float));
matrice[0] = ligne0;
matrice[1] = ligne1;
matrice[0][0] = 1; // 1
*(matrice[0]) = 1; // 2
*(matrice) = 1;    // 3
persist_js_state¤mimetext/htmllast_run_timestampAڝ8has_pluto_hook_features¬rootassigneecell_id$0b41747b-fe00-49a0-9ed9-99f0b2046b2edepends_on_disabled_cells§runtimejpublished_object_keysdepends_on_skipped_cells§errored$67cf8ac0-5b91-4d19-aca4-4309f3109a0cqueued¤logsrunning¦outputbodyٖ

Comment faire matrice[1][0] = 2 ?

persist_js_state¤mimetext/htmllast_run_timestampAڝP욷has_pluto_hook_features¬rootassigneecell_id$67cf8ac0-5b91-4d19-aca4-4309f3109a0cdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$87877209-958b-4635-bdbc-97548acdfb3fqueued¤logsrunning¦outputbodyٿ

Toutes les fonctions doivent vérifier leurs arguments et retourner

  • -1 en cas d'erreur

  • 0 en cas de succès

persist_js_state¤mimetext/htmllast_run_timestampAڝQhas_pluto_hook_features¬rootassigneecell_id$87877209-958b-4635-bdbc-97548acdfb3fdepends_on_disabled_cells§runtime=published_object_keysdepends_on_skipped_cells§errored$9160427d-4db7-4a97-9dde-14d19d59b1efqueued¤logsrunning¦outputbody
float **matrice = (float **)malloc(2 * sizeof(float *));
float *ligne0 = (float *)malloc(2 * sizeof(float));
float *ligne1 = (float *)malloc(2 * sizeof(float));
matrice[0] = ligne0;
matrice[1] = ligne1;
*(*(++matrice)) = 2;   // 1
*(*(matrice + 1)) = 2; // 2
*(*matrice + 1) = 2;   // 3
persist_js_state¤mimetext/htmllast_run_timestampAڝʰhas_pluto_hook_features¬rootassigneecell_id$9160427d-4db7-4a97-9dde-14d19d59b1efdepends_on_disabled_cells§runtimempublished_object_keysdepends_on_skipped_cells§errored$14a56b43-789a-42f0-9228-0c6a660629c9queued¤logsrunning¦outputbodys

mapreduce donne un exemple de fonction d'ordre supérieur en C

persist_js_state¤mimetext/htmllast_run_timestampAڝR.has_pluto_hook_features¬rootassigneecell_id$14a56b43-789a-42f0-9228-0c6a660629c9depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$90a4fe3c-02c7-46e6-b2fb-526e73508101queued¤logsrunning¦outputbodypersist_js_state¤mimetext/plainlast_run_timestampAڝp߷has_pluto_hook_features¬rootassigneecell_id$90a4fe3c-02c7-46e6-b2fb-526e73508101depends_on_disabled_cells§runtime \published_object_keysdepends_on_skipped_cells§errored$49f0db66-da21-42b0-91d5-db04075e559aqueued¤logsrunning¦outputbodyl

Un vecteur "Java" en C

persist_js_state¤mimetext/htmllast_run_timestampAڝMӷhas_pluto_hook_features¬rootassigneecell_id$49f0db66-da21-42b0-91d5-db04075e559adepends_on_disabled_cells§runtime0published_object_keysdepends_on_skipped_cells§errored$cb9c27b9-ce7d-4bdf-af7d-c88883a210bcqueued¤logsrunning¦outputbody٢
/*
 * libère la mémoire utilisée pour le vecteur
 * -1 en cas d'erreur, 0 sinon
 */
persist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$cb9c27b9-ce7d-4bdf-af7d-c88883a210bcdepends_on_disabled_cells§runtimeeppublished_object_keysdepends_on_skipped_cells§errored$3b5e218f-c134-40a9-9bc3-1fbab8d64d62queued¤logsrunning¦outputbodyٖ

Deuxième approche, un malloc pour toutes les valeurs

persist_js_state¤mimetext/htmllast_run_timestampAڝPIhas_pluto_hook_features¬rootassigneecell_id$3b5e218f-c134-40a9-9bc3-1fbab8d64d62depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$90532252-a756-40a1-8867-76041f5545a0queued¤logsrunning¦outputbodyل

Toujours free dans le sens inverse de malloc

persist_js_state¤mimetext/htmllast_run_timestampAڝQXhas_pluto_hook_features¬rootassigneecell_id$90532252-a756-40a1-8867-76041f5545a0depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$ec120913-bafb-4abb-8ebd-a0e3b72578f6queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ+has_pluto_hook_features¬rootassigneecell_id$ec120913-bafb-4abb-8ebd-a0e3b72578f6depends_on_disabled_cells§runtimeBpublished_object_keysdepends_on_skipped_cells§errored$4643cd02-67f4-40cd-aa7d-cfdb83fc62bequeued¤logsrunning¦outputbodyt

Retourner un tableau : visualization

persist_js_state¤mimetext/htmllast_run_timestampAڝS6Thas_pluto_hook_features¬rootassigneecell_id$4643cd02-67f4-40cd-aa7d-cfdb83fc62bedepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$6f257725-72c3-404c-bb35-079265058a43queued¤logsrunning¦outputbodyT

Pointeur de fonction

persist_js_state¤mimetext/htmllast_run_timestampAڝRGhas_pluto_hook_features¬rootassigneecell_id$6f257725-72c3-404c-bb35-079265058a43depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$dd918d12-bde4-4a1d-88c2-a9a643f39b2equeued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ-0has_pluto_hook_features¬rootassigneecell_id$dd918d12-bde4-4a1d-88c2-a9a643f39b2edepends_on_disabled_cells§runtimec;published_object_keysdepends_on_skipped_cells§errored$b588a04d-6a3f-424e-a83a-eec1dfafc9ddqueued¤logsrunning¦outputbodyT

Matrices sur le heap

persist_js_state¤mimetext/htmllast_run_timestampAڝP2jhas_pluto_hook_features¬rootassigneecell_id$b588a04d-6a3f-424e-a83a-eec1dfafc9dddepends_on_disabled_cells§runtimeM̵published_object_keysdepends_on_skipped_cells§errored$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7dqueued¤logsrunning¦outputbodyN

Arguments de main

persist_js_state¤mimetext/htmllast_run_timestampAڝO has_pluto_hook_features¬rootassigneecell_id$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7ddepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$3b6a95e0-96e9-4634-9207-42ace759e738queued¤logsrunning¦outputbody+frametitle (generic function with 1 method)persist_js_state¤mimetext/plainlast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$3b6a95e0-96e9-4634-9207-42ace759e738depends_on_disabled_cells§runtimeʵpublished_object_keysdepends_on_skipped_cells§errored$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411queued¤logsrunning¦outputbodyVF

LEPL1503/LSINC1503 - Cours 2

O. Bonaventure, B. Legat, M. Baerts

      persist_js_state¤mimetext/htmllast_run_timestampAڝxShas_pluto_hook_features¬rootassigneecell_id$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411depends_on_disabled_cells§runtime ȵpublished_object_keysdepends_on_skipped_cells§errored$b58ba8eb-0661-4eac-8ead-2daff4126d57queued¤logsrunning¦outputbodyc
  }
  return 0;
}
persist_js_state¤mimetext/htmllast_run_timestampAڝNjhas_pluto_hook_features¬rootassigneecell_id$b58ba8eb-0661-4eac-8ead-2daff4126d57depends_on_disabled_cells§runtimegpublished_object_keysdepends_on_skipped_cells§errored$c132bea8-1ffe-4015-aaa7-66a67a806f48queued¤logsrunning¦outputbody-compile_lib (generic function with 2 methods)persist_js_state¤mimetext/plainlast_run_timestampAڝ">has_pluto_hook_features¬rootassigneecell_id$c132bea8-1ffe-4015-aaa7-66a67a806f48depends_on_disabled_cells§runtimeupublished_object_keysdepends_on_skipped_cells§errored$6cc7a1d4-df02-494f-bf18-0652d49280e5queued¤logsrunning¦outputbodyH

Initialisation

persist_js_state¤mimetext/htmllast_run_timestampAڝQ͎has_pluto_hook_features¬rootassigneecell_id$6cc7a1d4-df02-494f-bf18-0652d49280e5depends_on_disabled_cells§runtimeypublished_object_keysdepends_on_skipped_cells§errored$c306afc9-f86e-4407-8757-272561980a72queued¤logsrunning¦outputbodyB
/*
 * @pre
 * @post place val comme ième élément
 *             du tableau
 *       -1 en cas d'erreur, 0 sinon
 */

int set(struct vector_t *v, int i,
        float val   // 1
        float **val // 2
        float *val  // 3
) {
persist_js_state¤mimetext/htmllast_run_timestampAڝ6zhas_pluto_hook_features¬rootassigneecell_id$c306afc9-f86e-4407-8757-272561980a72depends_on_disabled_cells§runtimef8published_object_keysdepends_on_skipped_cells§errored$132663c2-dfdd-4426-991a-bc9c95bbdad1queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;children
  • Stack : Pile de mémoire locale des functions, structure connue à la compilation

  • Heap : Alloué et désalloué avec des tailles connues à l'exécution. L'OS fait de son mieux pour organiser cette mémoire et réassigner les fragments formés suite aux désallocations

text/htmlڠtext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ`has_pluto_hook_features¬rootassigneecell_id$132663c2-dfdd-4426-991a-bc9c95bbdad1depends_on_disabled_cells§runtime!*cVpublished_object_keysdepends_on_skipped_cells§errored$c73a9ebe-9597-4c49-8493-aec1d71a281aqueued¤logsrunning¦outputbodyٖ

Comment faire matrice[0][1] = 0 ?

persist_js_state¤mimetext/htmllast_run_timestampAڝPҪhas_pluto_hook_features¬rootassigneecell_id$c73a9ebe-9597-4c49-8493-aec1d71a281adepends_on_disabled_cells§runtime퇵published_object_keysdepends_on_skipped_cells§errored$b66c9e2f-17b3-44dc-83e4-cb3a9329039bqueued¤logsrunning¦outputbody5

Quels arguments ?

persist_js_state¤mimetext/htmllast_run_timestampAڝQ获has_pluto_hook_features¬rootassigneecell_id$b66c9e2f-17b3-44dc-83e4-cb3a9329039bdepends_on_disabled_cells§runtimeFpublished_object_keysdepends_on_skipped_cells§errored$7838b43b-428d-4045-8cfe-17c9a824ac65queued¤logsrunning¦outputbody^

Première implémentation

persist_js_state¤mimetext/htmllast_run_timestampAڝQrŷhas_pluto_hook_features¬rootassigneecell_id$7838b43b-428d-4045-8cfe-17c9a824ac65depends_on_disabled_cells§runtime;published_object_keysdepends_on_skipped_cells§errored$594773b5-7e89-41a1-a873-387a096ee3b5queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ.has_pluto_hook_features¬rootassigneecell_id$594773b5-7e89-41a1-a873-387a096ee3b5depends_on_disabled_cells§runtime)published_object_keysdepends_on_skipped_cells§errored$654184b1-4b5e-4c90-800e-b413a04eeea1queued¤logsrunning¦outputbodyIpersist_js_state¤mimetext/htmllast_run_timestampAڝQvhas_pluto_hook_features¬rootassigneecell_id$654184b1-4b5e-4c90-800e-b413a04eeea1depends_on_disabled_cells§runtime?&published_object_keysdepends_on_skipped_cells§errored$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2queued¤logsrunning¦outputbodypersist_js_state¤mimetext/htmllast_run_timestampAڝShas_pluto_hook_features¬rootassigneecell_id$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1queued¤logsrunning¦outputbodyٷ
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
persist_js_state¤mimetext/htmllast_run_timestampAڝķhas_pluto_hook_features¬rootassigneecell_id$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1depends_on_disabled_cells§runtimezpublished_object_keysdepends_on_skipped_cells§errored$1ca8b74a-ce74-44a3-9e74-1447eb5141a7queued¤logsrunning¦outputbodyٷ
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
persist_js_state¤mimetext/htmllast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$1ca8b74a-ce74-44a3-9e74-1447eb5141a7depends_on_disabled_cells§runtimeuTpublished_object_keysdepends_on_skipped_cells§errored$e5e45ef0-32ac-403c-a05e-de267209fb8bqueued¤logsrunning¦outputbody`
Comment assigner la valeur val au iième élément ?
float *t = (*v)->tab;
t[i] = val;

ou

*((*v)->tab + i) = val;
persist_js_state¤mimetext/htmllast_run_timestampAڝH/has_pluto_hook_features¬rootassigneecell_id$e5e45ef0-32ac-403c-a05e-de267209fb8bdepends_on_disabled_cells§runtimenpublished_object_keysdepends_on_skipped_cells§errored$65ae6528-ef2c-48fd-94e9-56224e19863equeued¤logsrunning¦outputbody%img (generic function with 3 methods)persist_js_state¤mimetext/plainlast_run_timestampAڝhas_pluto_hook_features¬rootassigneecell_id$65ae6528-ef2c-48fd-94e9-56224e19863edepends_on_disabled_cells§runtimeCIpublished_object_keysdepends_on_skipped_cells§errored$c2928a50-8f63-477e-ada3-1352d5c72712queued¤logsrunning¦outputbodyc
/*
 * @pre
 * alloue la mémoire pour un vecteur de size éléments
 * initialisés à la valeur val
 * @return -1 si erreur, 0 sinon
 */

int init(int size, float val,
         struct vector_t v,   // 1
         struct vector_t **v, // 2
         struct vector_t *v,  // 3
)
persist_js_state¤mimetext/htmllast_run_timestampAڝRhas_pluto_hook_features¬rootassigneecell_id$c2928a50-8f63-477e-ada3-1352d5c72712depends_on_disabled_cells§runtimej,published_object_keysdepends_on_skipped_cells§errored$986cdd2f-c22a-497b-8ce4-d6755a871c15queued¤logsrunning¦outputbodyclassnamestyle#display: flex; flex-direction: row;childrenNWooclap Logotext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objectohttps://app.wooclap.com/JAPRXXtext/htmlclassnamestyleflex-grow: 1;children text/html'application/vnd.pluto.divelement+objecttext/htmlpersist_js_state¤mime'application/vnd.pluto.divelement+objectlast_run_timestampAڝ/Ghas_pluto_hook_features¬rootassigneecell_id$986cdd2f-c22a-497b-8ce4-d6755a871c15depends_on_disabled_cells§runtime9published_object_keysdepends_on_skipped_cells§errored$85e1517c-f7d9-4df5-acde-00657cdf3dbequeued¤logsrunning¦outputbodypersist_js_state¤mimetext/htmllast_run_timestampAڝź=has_pluto_hook_features¬rootassigneecell_id$85e1517c-f7d9-4df5-acde-00657cdf3dbedepends_on_disabled_cells§runtime3published_object_keysdepends_on_skipped_cells§errored$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40queued¤logsrunning¦outputbodyٯ

Une telle matrice sera stockée sur le stack (variable locale) ou dans la zone données (variable globale)

persist_js_state¤mimetext/htmllast_run_timestampAڝPhas_pluto_hook_features¬rootassigneecell_id$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40depends_on_disabled_cells§runtime⽵published_object_keysdepends_on_skipped_cells§errored©shortpathCours2.jllast_save_timeAڝCqin_temp_dir¨metadata