Þ±cell_dependenciesÞaÙ$4dad1e1b-2288-49b9-8190-f2f374ca353c„´precedence_heuristic §cell_idÙ$4dad1e1b-2288-49b9-8190-f2f374ca353c´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4a„´precedence_heuristic §cell_idÙ$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4a´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$9cb862ff-275e-4f1d-8104-c1b8350725da„´precedence_heuristic §cell_idÙ$9cb862ff-275e-4f1d-8104-c1b8350725da´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$d107cd6f-c45c-4289-bd0f-5f329633fdda„´precedence_heuristic §cell_idÙ$d107cd6f-c45c-4289-bd0f-5f329633fdda´downstream_cells_map�¥tutor—Ù$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²upstream_cells_map‹¨IOBuffer�¦isless�¤Code‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48®HTTP.escapeuri�°source_extension‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¤HTTP‘Ù$ecc856dc-e6f2-4a91-8c37-0bb920531297£min�¤HTML�ªcountlines�¡+�¡*�Ù$378c90d9-e206-4858-b362-4015ca46bbb0„´precedence_heuristic §cell_idÙ$378c90d9-e206-4858-b362-4015ca46bbb0´downstream_cells_map�§section‘Ù$49f0db66-da21-42b0-91d5-db04075e559a²upstream_cells_map‚§@md_str�¨getindex�Ù$44c8617f-ba56-40fe-80b4-963cf6e6f4b5„´precedence_heuristic §cell_idÙ$44c8617f-ba56-40fe-80b4-963cf6e6f4b5´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$d85db8cc-56b6-42e5-8175-3c53d345282e„´precedence_heuristic §cell_idÙ$d85db8cc-56b6-42e5-8175-3c53d345282e´downstream_cells_map€²upstream_cells_map…§@md_str�­Base.getindex�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¤Base�¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$a6ca2092-6435-4081-a407-c3d0286efb62„´precedence_heuristic §cell_idÙ$a6ca2092-6435-4081-a407-c3d0286efb62´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$7f150e04-b56b-499f-ad50-4f586e76a0ab„´precedence_heuristic §cell_idÙ$7f150e04-b56b-499f-ad50-4f586e76a0ab´downstream_cells_map€²upstream_cells_map…§@md_str�­Base.getindex�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¤Base�¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$a8783da7-4e44-4012-be6e-88705697b0c5„´precedence_heuristic §cell_idÙ$a8783da7-4e44-4012-be6e-88705697b0c5´downstream_cells_map€²upstream_cells_mapƒ¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¬wrap_in_main‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¥tutor‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fddaÙ$03847d85-c675-4b4a-9331-fd7a32b26938„´precedence_heuristic §cell_idÙ$03847d85-c675-4b4a-9331-fd7a32b26938´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$27b6779a-5624-4e8e-ae32-8a8971923d01„´precedence_heuristic §cell_idÙ$27b6779a-5624-4e8e-ae32-8a8971923d01´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$a39d8ac8-70e6-47a5-b80d-e1443c19ae15„´precedence_heuristic §cell_idÙ$a39d8ac8-70e6-47a5-b80d-e1443c19ae15´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$6d3d7f63-766b-4a1f-91c3-46b401c4c280„´precedence_heuristic §cell_idÙ$6d3d7f63-766b-4a1f-91c3-46b401c4c280´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¯compile_and_run‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$8f156e1d-5816-4c56-9aec-ad665d2bc782„´precedence_heuristic §cell_idÙ$8f156e1d-5816-4c56-9aec-ad665d2bc782´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48´wrap_compile_and_run‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$ecc856dc-e6f2-4a91-8c37-0bb920531297„´precedence_heuristic §cell_idÙ$ecc856dc-e6f2-4a91-8c37-0bb920531297´downstream_cells_mapƒ°MultilineStrings‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¤HTTP‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fdda©Clang_jll‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48²upstream_cells_map€Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58„´precedence_heuristic §cell_idÙ$2140d0e6-cd51-465b-bfc5-bdbfe077bc58´downstream_cells_map‚¢qa™Ù$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_html�²upstream_cells_mapˆ¤HTML�¦sprint�·HypertextLiteral.Result�°HypertextLiteral‘Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101·HypertextLiteral.Bypass�¸HypertextLiteral.content�¨Markdown�¤@htl�Ù$4072072d-c543-43bf-87ad-1f201bd21c59„´precedence_heuristic §cell_idÙ$4072072d-c543-43bf-87ad-1f201bd21c59´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$488d8bed-855f-470a-a2fa-68c13fd08739„´precedence_heuristic §cell_idÙ$488d8bed-855f-470a-a2fa-68c13fd08739´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$b8392f14-05d4-43e4-bd2a-3d4ba6ced65b„´precedence_heuristic §cell_idÙ$b8392f14-05d4-43e4-bd2a-3d4ba6ced65b´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$1f190c17-4feb-41b2-a10a-60fb191d250e„´precedence_heuristic §cell_idÙ$1f190c17-4feb-41b2-a10a-60fb191d250e´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48´wrap_compile_and_run‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$406d30a9-f477-4898-9caf-770fcc25b2a9„´precedence_heuristic §cell_idÙ$406d30a9-f477-4898-9caf-770fcc25b2a9´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$accfaade-96ce-4869-83ce-9dd5489b65a2„´precedence_heuristic §cell_idÙ$accfaade-96ce-4869-83ce-9dd5489b65a2´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¥tutor‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fddaÙ$6531f0d6-cf62-46ca-8dd2-befda43806d7„´precedence_heuristic §cell_idÙ$6531f0d6-cf62-46ca-8dd2-befda43806d7´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3„´precedence_heuristic §cell_idÙ$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3´downstream_cells_map€²upstream_cells_mapƒ¤Base�®Base.Docs.HTML�©@html_str�Ù$4e5e1340-c2e6-4b4a-bfb9-e1096d179040„´precedence_heuristic §cell_idÙ$4e5e1340-c2e6-4b4a-bfb9-e1096d179040´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$facc8d63-d620-40ff-939a-78ff58fff04f„´precedence_heuristic §cell_idÙ$facc8d63-d620-40ff-939a-78ff58fff04f´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$4b009812-191d-4969-bf32-5941ca707f37„´precedence_heuristic §cell_idÙ$4b009812-191d-4969-bf32-5941ca707f37´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4„´precedence_heuristic §cell_idÙ$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$c81abb3d-7192-499e-a47a-c0b960aa49cd„´precedence_heuristic §cell_idÙ$c81abb3d-7192-499e-a47a-c0b960aa49cd´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$2e1fc3ec-c1ca-43b8-893c-bda691635475„´precedence_heuristic §cell_idÙ$2e1fc3ec-c1ca-43b8-893c-bda691635475´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$a13bf677-9c63-4f8e-b3dd-27b3aad7f956„´precedence_heuristic §cell_idÙ$a13bf677-9c63-4f8e-b3dd-27b3aad7f956´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$419f48c0-8377-4a67-a801-e87d2a61c17a„´precedence_heuristic §cell_idÙ$419f48c0-8377-4a67-a801-e87d2a61c17a´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$f386a8d4-35be-4612-91c7-31ff0f004e2d„´precedence_heuristic §cell_idÙ$f386a8d4-35be-4612-91c7-31ff0f004e2d´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$336f53c9-5982-4694-8bd4-92c2a1d1b5cc„´precedence_heuristic §cell_idÙ$336f53c9-5982-4694-8bd4-92c2a1d1b5cc´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$2d35189b-46aa-4922-ad4f-432533da2a80„´precedence_heuristic §cell_idÙ$2d35189b-46aa-4922-ad4f-432533da2a80´downstream_cells_map€²upstream_cells_mapƒ¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¬wrap_in_main‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¥tutor‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fddaÙ$8c115304-6a8e-4c2e-aeb2-9199c9d3b704„´precedence_heuristic §cell_idÙ$8c115304-6a8e-4c2e-aeb2-9199c9d3b704´downstream_cells_map�­three_columns‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9²upstream_cells_map‡¤Dict�¤hbox�¤Base�®Base.Docs.HTML�©@html_str�£Div�¢=>�Ù$a07e8aea-790b-4307-9de1-e45c6a3f7cf4„´precedence_heuristic §cell_idÙ$a07e8aea-790b-4307-9de1-e45c6a3f7cf4´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$37f6e305-fb5c-4215-b8a1-564a7632a377„´precedence_heuristic §cell_idÙ$37f6e305-fb5c-4215-b8a1-564a7632a377´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$b66272c8-02b0-4d22-84d6-7274efe11e2a„´precedence_heuristic §cell_idÙ$b66272c8-02b0-4d22-84d6-7274efe11e2a´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$848723a1-4a62-47b2-957c-167ce9be19f8„´precedence_heuristic §cell_idÙ$848723a1-4a62-47b2-957c-167ce9be19f8´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$20d23ab4-ae24-4169-92be-ed9ec77c5518„´precedence_heuristic §cell_idÙ$20d23ab4-ae24-4169-92be-ed9ec77c5518´downstream_cells_map€²upstream_cells_mapƒ§@md_str�¥aside�¨getindex�Ù$fc027d24-619e-4f6f-95ed-3dd12f61b60c„´precedence_heuristic §cell_idÙ$fc027d24-619e-4f6f-95ed-3dd12f61b60c´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$62198fa2-4e96-4950-a99e-a3808bbf811a„´precedence_heuristic §cell_idÙ$62198fa2-4e96-4950-a99e-a3808bbf811a´downstream_cells_map€²upstream_cells_map…§@md_str�­Base.getindex�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¤Base�¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$e1b6f1d3-9d06-4ee4-854d-8ede288f369c„´precedence_heuristic §cell_idÙ$e1b6f1d3-9d06-4ee4-854d-8ede288f369c´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$92428490-6d76-44a7-9d5b-a9e988f5ff25„´precedence_heuristic §cell_idÙ$92428490-6d76-44a7-9d5b-a9e988f5ff25´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e„´precedence_heuristic §cell_idÙ$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Ù$324b41a3-4b01-4589-8ca5-28ec148cdeb1„´precedence_heuristic §cell_idÙ$324b41a3-4b01-4589-8ca5-28ec148cdeb1´downstream_cells_map€²upstream_cells_mapƒ¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¬wrap_in_main‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¥tutor‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fddaÙ$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2„´precedence_heuristic §cell_idÙ$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$5b8e5130-bf78-4529-b3be-02a0ba093f12„´precedence_heuristic §cell_idÙ$5b8e5130-bf78-4529-b3be-02a0ba093f12´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$5bd30ea4-3193-4fb4-9bf8-369fcfa6547b„´precedence_heuristic §cell_idÙ$5bd30ea4-3193-4fb4-9bf8-369fcfa6547b´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$7808e8d0-597c-422a-95eb-cc581fb65d87„´precedence_heuristic §cell_idÙ$7808e8d0-597c-422a-95eb-cc581fb65d87´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$3ddd22b2-7d1b-4b3a-8737-09552b51726d„´precedence_heuristic §cell_idÙ$3ddd22b2-7d1b-4b3a-8737-09552b51726d´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9„´precedence_heuristic §cell_idÙ$ad6a791b-14f0-4a20-ad5b-ec1690253bd9´downstream_cells_map�§wooclap›Ù$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²upstream_cells_map„­three_columns‘Ù$8c115304-6a8e-4c2e-aeb2-9199c9d3b704¤HTML�¢=>�£img‘Ù$65ae6528-ef2c-48fd-94e9-56224e19863eÙ$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2„´precedence_heuristic §cell_idÙ$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$acfa3f43-215e-4c97-bf2a-0069e78f95b4„´precedence_heuristic §cell_idÙ$acfa3f43-215e-4c97-bf2a-0069e78f95b4´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$319bc8b4-7139-43b0-a57b-66c6a9da7cb9„´precedence_heuristic §cell_idÙ$319bc8b4-7139-43b0-a57b-66c6a9da7cb9´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$47279972-433b-46be-b511-170698ff8753„´precedence_heuristic §cell_idÙ$47279972-433b-46be-b511-170698ff8753´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$0e0ddf7c-a34b-447a-8142-334d14f96ae1„´precedence_heuristic §cell_idÙ$0e0ddf7c-a34b-447a-8142-334d14f96ae1´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$38e67b29-707f-4718-b9cc-2a1a62f32143„´precedence_heuristic §cell_idÙ$38e67b29-707f-4718-b9cc-2a1a62f32143´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$0b41747b-fe00-49a0-9ed9-99f0b2046b2e„´precedence_heuristic §cell_idÙ$0b41747b-fe00-49a0-9ed9-99f0b2046b2e´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$67cf8ac0-5b91-4d19-aca4-4309f3109a0c„´precedence_heuristic §cell_idÙ$67cf8ac0-5b91-4d19-aca4-4309f3109a0c´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$87877209-958b-4635-bdbc-97548acdfb3f„´precedence_heuristic §cell_idÙ$87877209-958b-4635-bdbc-97548acdfb3f´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$9160427d-4db7-4a97-9dde-14d19d59b1ef„´precedence_heuristic §cell_idÙ$9160427d-4db7-4a97-9dde-14d19d59b1ef´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$14a56b43-789a-42f0-9228-0c6a660629c9„´precedence_heuristic §cell_idÙ$14a56b43-789a-42f0-9228-0c6a660629c9´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101„´precedence_heuristic§cell_idÙ$90a4fe3c-02c7-46e6-b2fb-526e73508101´downstream_cells_map„§PlutoUI’Ù$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411Ù$65ae6528-ef2c-48fd-94e9-56224e19863e°HypertextLiteral“Ù$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411Ù$65ae6528-ef2c-48fd-94e9-56224e19863eÙ$2140d0e6-cd51-465b-bfc5-bdbfe077bc58²ExperimentalLayout�²PlutoTeachingTools’Ù$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411Ù$65ae6528-ef2c-48fd-94e9-56224e19863e²upstream_cells_map€Ù$49f0db66-da21-42b0-91d5-db04075e559a„´precedence_heuristic §cell_idÙ$49f0db66-da21-42b0-91d5-db04075e559a´downstream_cells_map€²upstream_cells_map�§section‘Ù$378c90d9-e206-4858-b362-4015ca46bbb0Ù$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc„´precedence_heuristic §cell_idÙ$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$3b5e218f-c134-40a9-9bc3-1fbab8d64d62„´precedence_heuristic §cell_idÙ$3b5e218f-c134-40a9-9bc3-1fbab8d64d62´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$90532252-a756-40a1-8867-76041f5545a0„´precedence_heuristic §cell_idÙ$90532252-a756-40a1-8867-76041f5545a0´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$ec120913-bafb-4abb-8ebd-a0e3b72578f6„´precedence_heuristic §cell_idÙ$ec120913-bafb-4abb-8ebd-a0e3b72578f6´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$4643cd02-67f4-40cd-aa7d-cfdb83fc62be„´precedence_heuristic §cell_idÙ$4643cd02-67f4-40cd-aa7d-cfdb83fc62be´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$6f257725-72c3-404c-bb35-079265058a43„´precedence_heuristic §cell_idÙ$6f257725-72c3-404c-bb35-079265058a43´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$dd918d12-bde4-4a1d-88c2-a9a643f39b2e„´precedence_heuristic §cell_idÙ$dd918d12-bde4-4a1d-88c2-a9a643f39b2e´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$b588a04d-6a3f-424e-a83a-eec1dfafc9dd„´precedence_heuristic §cell_idÙ$b588a04d-6a3f-424e-a83a-eec1dfafc9dd´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7d„´precedence_heuristic §cell_idÙ$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7d´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$3b6a95e0-96e9-4634-9207-42ace759e738„´precedence_heuristic §cell_idÙ$3b6a95e0-96e9-4634-9207-42ace759e738´downstream_cells_map�ªframetitle�²upstream_cells_map‚§@md_str�¨getindex�Ù$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411„´precedence_heuristic §cell_idÙ$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411´downstream_cells_map€²upstream_cells_map‰·PlutoUI.TableOfContents�·HypertextLiteral.Bypass�·HypertextLiteral.Result�°HypertextLiteral‘Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101§PlutoUI‘Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101¸HypertextLiteral.content�Ù$PlutoTeachingTools.ChooseDisplayMode�²PlutoTeachingTools‘Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101¤@htl�Ù$b58ba8eb-0661-4eac-8ead-2daff4126d57„´precedence_heuristic §cell_idÙ$b58ba8eb-0661-4eac-8ead-2daff4126d57´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48„´precedence_heuristic §cell_idÙ$c132bea8-1ffe-4015-aaa7-66a67a806f48´downstream_cells_mapÞ¥CCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48©@java_str�§md_code�§compile�©emit_llvm�¨JavaCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48«codesnippet‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¤code�¤Code’Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$d107cd6f-c45c-4289-bd0f-5f329633fdda°source_extension‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fdda©Base.show�¨@cpp_str�§@cl_str�§CppCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¦CLCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48«inline_code�§Example‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¯compile_and_run‘Ù$6d3d7f63-766b-4a1f-91c3-46b401c4c280«compile_lib�¬wrap_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-9dd5489b65a2¨compiler�´wrap_compile_and_run’Ù$1f190c17-4feb-41b2-a10a-60fb191d250eÙ$8f156e1d-5816-4c56-9aec-ad665d2bc782²upstream_cells_mapÞE¡!�»InteractiveUtils.print_llvm�¨JavaCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48°MultilineStrings‘Ù$ecc856dc-e6f2-4a91-8c37-0bb920531297©Clang_jll‘Ù$ecc856dc-e6f2-4a91-8c37-0bb920531297¥split�ªBase.throw�º#___this_pluto_module_name�¤Base�¨contains�¡-�¥write�¡+�¡*�¨Markdown�¤Core�¦ifelse�¢IO�¥CCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¨joinpath�¤Code‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48©mktempdir�¥@info�¢!=�¢==�§CppCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¢in�©findfirst�¡:�¦typeof�¤Bool�©@MIME_str�¦stdout�¤join�£run�ªCore._expr�§append!�§@assert�®AbstractString�¥@warn�§nothing�£Cmd�§isempty�¦CLCode‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¯Clang_jll.clang�³Base.AssertionError�¥error�§dirname�£isa�®Markdown.parse�¥push!�¶ProcessFailedException�¨@__DIR__�¦string�¨IOBuffer�£esc�·MultilineStrings.indent�«codesnippet‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¦String�§rethrow�©isnothing�©readlines�§Example‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48£end�°InteractiveUtils�¨findlast�¤HTML�¢>=�¤read�Ù$6cc7a1d4-df02-494f-bf18-0652d49280e5„´precedence_heuristic §cell_idÙ$6cc7a1d4-df02-494f-bf18-0652d49280e5´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$c306afc9-f86e-4407-8757-272561980a72„´precedence_heuristic §cell_idÙ$c306afc9-f86e-4407-8757-272561980a72´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$132663c2-dfdd-4426-991a-bc9c95bbdad1„´precedence_heuristic §cell_idÙ$132663c2-dfdd-4426-991a-bc9c95bbdad1´downstream_cells_map€²upstream_cells_map…§@md_str�¤hbox�¢=>�£img‘Ù$65ae6528-ef2c-48fd-94e9-56224e19863e¨getindex�Ù$c73a9ebe-9597-4c49-8493-aec1d71a281a„´precedence_heuristic §cell_idÙ$c73a9ebe-9597-4c49-8493-aec1d71a281a´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$b66c9e2f-17b3-44dc-83e4-cb3a9329039b„´precedence_heuristic §cell_idÙ$b66c9e2f-17b3-44dc-83e4-cb3a9329039b´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$7838b43b-428d-4045-8cfe-17c9a824ac65„´precedence_heuristic §cell_idÙ$7838b43b-428d-4045-8cfe-17c9a824ac65´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�Ù$594773b5-7e89-41a1-a873-387a096ee3b5„´precedence_heuristic §cell_idÙ$594773b5-7e89-41a1-a873-387a096ee3b5´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$654184b1-4b5e-4c90-800e-b413a04eeea1„´precedence_heuristic §cell_idÙ$654184b1-4b5e-4c90-800e-b413a04eeea1´downstream_cells_map€²upstream_cells_mapƒ¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¬wrap_in_main‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¥tutor‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fddaÙ$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2„´precedence_heuristic §cell_idÙ$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¥tutor‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fddaÙ$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1„´precedence_heuristic §cell_idÙ$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$1ca8b74a-ce74-44a3-9e74-1447eb5141a7„´precedence_heuristic §cell_idÙ$1ca8b74a-ce74-44a3-9e74-1447eb5141a7´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$e5e45ef0-32ac-403c-a05e-de267209fb8b„´precedence_heuristic §cell_idÙ$e5e45ef0-32ac-403c-a05e-de267209fb8b´downstream_cells_map€²upstream_cells_mapƒ§@md_str�¢qa‘Ù$2140d0e6-cd51-465b-bfc5-bdbfe077bc58¨getindex�Ù$65ae6528-ef2c-48fd-94e9-56224e19863e„´precedence_heuristic §cell_idÙ$65ae6528-ef2c-48fd-94e9-56224e19863e´downstream_cells_map…ªsave_image�¤Path‘Ù$65ae6528-ef2c-48fd-94e9-56224e19863e§imgpath�£URL‘Ù$65ae6528-ef2c-48fd-94e9-56224e19863e£img’Ù$132663c2-dfdd-4426-991a-bc9c95bbdad1Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9²upstream_cells_mapÞ¡!�§PlutoUI‘Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101¨joinpath�¦String�ªstartswith�¤@htl�²PlutoTeachingTools‘Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101·HypertextLiteral.Result�¢in�¥split�·HypertextLiteral.Bypass�µPlutoUI.LocalResource�¸HypertextLiteral.content�£end�¿HypertextLiteral.attribute_pair�Ù&PlutoTeachingTools.RobustLocalResource�¤Path‘Ù$65ae6528-ef2c-48fd-94e9-56224e19863e£URL‘Ù$65ae6528-ef2c-48fd-94e9-56224e19863e°HypertextLiteral‘Ù$90a4fe3c-02c7-46e6-b2fb-526e73508101¡*�¨@__DIR__�Ù$c2928a50-8f63-477e-ada3-1352d5c72712„´precedence_heuristic §cell_idÙ$c2928a50-8f63-477e-ada3-1352d5c72712´downstream_cells_map€²upstream_cells_map�¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48Ù$986cdd2f-c22a-497b-8ce4-d6755a871c15„´precedence_heuristic §cell_idÙ$986cdd2f-c22a-497b-8ce4-d6755a871c15´downstream_cells_map€²upstream_cells_map�§wooclap‘Ù$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Ù$85e1517c-f7d9-4df5-acde-00657cdf3dbe„´precedence_heuristic §cell_idÙ$85e1517c-f7d9-4df5-acde-00657cdf3dbe´downstream_cells_map€²upstream_cells_map‚¦@c_str‘Ù$c132bea8-1ffe-4015-aaa7-66a67a806f48¥tutor‘Ù$d107cd6f-c45c-4289-bd0f-5f329633fddaÙ$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40„´precedence_heuristic §cell_idÙ$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40´downstream_cells_map€²upstream_cells_map‚§@md_str�¨getindex�´cell_execution_orderÜaÙ$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-8ede288f369c´last_hot_reload_timeË®process_status¥ready¤pathÙ6/home/runner/work/LEPL1503/LEPL1503/Lectures/Cours2.jl­pluto_version¨v0.20.21ªcell_orderÜaÙ$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-bdbfe077bc58±published_objects€¥nbpkgжwaiting_for_permissionÂÙ,waiting_for_permission_but_probably_disabled²installed_versions†°MultilineStrings¥0.1.1¤HTTP§1.10.19§PlutoUI¦0.7.79©Clang_jll¨18.1.7+4°HypertextLiteral¥0.9.5²PlutoTeachingTools¥0.4.7°terminal_outputs‡°MultilineStringsÚp 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...¤HTTPÚp 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_syncÚp 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...§PlutoUIÚp 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...°HypertextLiteralÚp 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_jllÚp 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...²PlutoTeachingToolsÚp 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_msgÀ´restart_required_msgÀ¯install_time_nsÏ"®J—­busy_packages�«cell_inputsÞaÙ$4dad1e1b-2288-49b9-8190-f2f374ca353c„§cell_idÙ$4dad1e1b-2288-49b9-8190-f2f374ca353c¤codeÙVqa(c"void destroy(struct vector_t *vect) {", c""" free(vect->v); free(vect); }""")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4a„§cell_idÙ$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4a¤code¶md"## Heap ou stack ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$9cb862ff-275e-4f1d-8104-c1b8350725da„§cell_idÙ$9cb862ff-275e-4f1d-8104-c1b8350725da¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$d107cd6f-c45c-4289-bd0f-5f329633fdda„§cell_idÙ$d107cd6f-c45c-4289-bd0f-5f329633fdda¤codeÚ # 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("""""") end¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$378c90d9-e206-4858-b362-4015ca46bbb0„§cell_idÙ$378c90d9-e206-4858-b362-4015ca46bbb0¤codeµsection(s) = md"# $s"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$44c8617f-ba56-40fe-80b4-963cf6e6f4b5„§cell_idÙ$44c8617f-ba56-40fe-80b4-963cf6e6f4b5¤codeÙ"md"## Modification d'un élément"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$d85db8cc-56b6-42e5-8175-3c53d345282e„§cell_idÙ$d85db8cc-56b6-42e5-8175-3c53d345282e¤codeÙ�qa(md"Comment implémenter `set` ?", c""" if (i < 0 || i >= v->length) return -1; *(v->tab + i) = val; return 0; } """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$a6ca2092-6435-4081-a407-c3d0286efb62„§cell_idÙ$a6ca2092-6435-4081-a407-c3d0286efb62¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$7f150e04-b56b-499f-ad50-4f586e76a0ab„§cell_idÙ$7f150e04-b56b-499f-ad50-4f586e76a0ab¤codeÙ‚qa(md"Comment implémenter `get` ?", c""" if (i < 0 || i >= v->length) return -1; *val = *(v->tab + i); return 0; } """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$a8783da7-4e44-4012-be6e-88705697b0c5„§cell_idÙ$a8783da7-4e44-4012-be6e-88705697b0c5¤codeÙ²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; """))¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$03847d85-c675-4b4a-9331-fd7a32b26938„§cell_idÙ$03847d85-c675-4b4a-9331-fd7a32b26938¤codeÙ!md"## Libération de la mémoire"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$27b6779a-5624-4e8e-ae32-8a8971923d01„§cell_idÙ$27b6779a-5624-4e8e-ae32-8a8971923d01¤codeÙµ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; }"""¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$a39d8ac8-70e6-47a5-b80d-e1443c19ae15„§cell_idÙ$a39d8ac8-70e6-47a5-b80d-e1443c19ae15¤codeÙ.md"## Première approche, un malloc par ligne"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$6d3d7f63-766b-4a1f-91c3-46b401c4c280„§cell_idÙ$6d3d7f63-766b-4a1f-91c3-46b401c4c280¤codeÙÇcompile_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"])¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$8f156e1d-5816-4c56-9aec-ad665d2bc782„§cell_idÙ$8f156e1d-5816-4c56-9aec-ad665d2bc782¤codeÙhwrap_compile_and_run(c""" float *matrice1 = (float *)malloc(4 * sizeof(float)); matrice1[1][1] = 4; """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$ecc856dc-e6f2-4a91-8c37-0bb920531297„§cell_idÙ$ecc856dc-e6f2-4a91-8c37-0bb920531297¤codeÙ(import HTTP, Clang_jll, MultilineStrings¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$2140d0e6-cd51-465b-bfc5-bdbfe077bc58„§cell_idÙ$2140d0e6-cd51-465b-bfc5-bdbfe077bc58¤codeÚñbegin 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 end¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$4072072d-c543-43bf-87ad-1f201bd21c59„§cell_idÙ$4072072d-c543-43bf-87ad-1f201bd21c59¤codeÙhc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$488d8bed-855f-470a-a2fa-68c13fd08739„§cell_idÙ$488d8bed-855f-470a-a2fa-68c13fd08739¤codeÚqa(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; } """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$b8392f14-05d4-43e4-bd2a-3d4ba6ced65b„§cell_idÙ$b8392f14-05d4-43e4-bd2a-3d4ba6ced65b¤codeÙZmd"Laquelle de ces deux fonctions présente une façon correcte de retourner un tableau ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$1f190c17-4feb-41b2-a10a-60fb191d250e„§cell_idÙ$1f190c17-4feb-41b2-a10a-60fb191d250e¤codeÙMwrap_compile_and_run(c""" float A[2][2] = {{1, 0}, {2, 3}}; A[1][1] = 4; """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$406d30a9-f477-4898-9caf-770fcc25b2a9„§cell_idÙ$406d30a9-f477-4898-9caf-770fcc25b2a9¤codeÙFmd"Comment libérer la mémoire quand le vecteur est devenu inutile ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$accfaade-96ce-4869-83ce-9dd5489b65a2„§cell_idÙ$accfaade-96ce-4869-83ce-9dd5489b65a2¤codeÚœtutor(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; } """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$6531f0d6-cf62-46ca-8dd2-befda43806d7„§cell_idÙ$6531f0d6-cf62-46ca-8dd2-befda43806d7¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3„§cell_idÙ$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3¤codeÙahtml"

The End

"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$4e5e1340-c2e6-4b4a-bfb9-e1096d179040„§cell_idÙ$4e5e1340-c2e6-4b4a-bfb9-e1096d179040¤codeºmd"# Retourner un tableau"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$facc8d63-d620-40ff-939a-78ff58fff04f„§cell_idÙ$facc8d63-d620-40ff-939a-78ff58fff04f¤codeÙhc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$4b009812-191d-4969-bf32-5941ca707f37„§cell_idÙ$4b009812-191d-4969-bf32-5941ca707f37¤codeÙ$md"## Récupération d'un élément"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4„§cell_idÙ$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4¤codeÚ”c""" 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++) { """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$c81abb3d-7192-499e-a47a-c0b960aa49cd„§cell_idÙ$c81abb3d-7192-499e-a47a-c0b960aa49cd¤codeÙ md"# Libération de la mémoire"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$2e1fc3ec-c1ca-43b8-893c-bda691635475„§cell_idÙ$2e1fc3ec-c1ca-43b8-893c-bda691635475¤code¼md"## Visualization de init"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$a13bf677-9c63-4f8e-b3dd-27b3aad7f956„§cell_idÙ$a13bf677-9c63-4f8e-b3dd-27b3aad7f956¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$419f48c0-8377-4a67-a801-e87d2a61c17a„§cell_idÙ$419f48c0-8377-4a67-a801-e87d2a61c17a¤codeÙNqa(c"float get(struct vector_t *t, int i) {", c""" return *(t->v + i); }""")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$f386a8d4-35be-4612-91c7-31ff0f004e2d„§cell_idÙ$f386a8d4-35be-4612-91c7-31ff0f004e2d¤codeÙ$md"## Une autre implémentation …"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$336f53c9-5982-4694-8bd4-92c2a1d1b5cc„§cell_idÙ$336f53c9-5982-4694-8bd4-92c2a1d1b5cc¤codeÙ!md"# Initialisation d'une valeur"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$2d35189b-46aa-4922-ad4f-432533da2a80„§cell_idÙ$2d35189b-46aa-4922-ad4f-432533da2a80¤codeÙëtutor(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]); """))¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$8c115304-6a8e-4c2e-aeb2-9199c9d3b704„§cell_idÙ$8c115304-6a8e-4c2e-aeb2-9199c9d3b704¤codeÙ¨three_columns(left, center, right) = hbox([ left, Div(html" ", style = Dict("flex-grow" => "1")), center, Div(html" ", style = Dict("flex-grow" => "1")), right, ])¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$a07e8aea-790b-4307-9de1-e45c6a3f7cf4„§cell_idÙ$a07e8aea-790b-4307-9de1-e45c6a3f7cf4¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$37f6e305-fb5c-4215-b8a1-564a7632a377„§cell_idÙ$37f6e305-fb5c-4215-b8a1-564a7632a377¤codeÙ0md"## Comment initialiser la première valeur ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$b66272c8-02b0-4d22-84d6-7274efe11e2a„§cell_idÙ$b66272c8-02b0-4d22-84d6-7274efe11e2a¤codeÙ9c""" struct vector_t { int size; float *v; }; """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$848723a1-4a62-47b2-957c-167ce9be19f8„§cell_idÙ$848723a1-4a62-47b2-957c-167ce9be19f8¤codeÙ3md"## Comment mettre une matrice 2x2 sur le heap ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$20d23ab4-ae24-4169-92be-ed9ec77c5518„§cell_idÙ$20d23ab4-ae24-4169-92be-ed9ec77c5518¤codeÙmaside(md"[Source](https://learn.adafruit.com/memories-of-an-arduino/measuring-free-memory)", v_offset = -200)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$fc027d24-619e-4f6f-95ed-3dd12f61b60c„§cell_idÙ$fc027d24-619e-4f6f-95ed-3dd12f61b60c¤code´md"## Visualisation"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$62198fa2-4e96-4950-a99e-a3808bbf811a„§cell_idÙ$62198fa2-4e96-4950-a99e-a3808bbf811a¤codeÙgqa(md"Comment libérer la mémoire avec `free` ?", c""" free(ligne0); free(ligne1); free(matrice); """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$e1b6f1d3-9d06-4ee4-854d-8ede288f369c„§cell_idÙ$e1b6f1d3-9d06-4ee4-854d-8ede288f369c¤codeÙZqa(c"int destroy(struct vector_t *v) {", c""" free(v->tab); free(v); return 0; }""")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$92428490-6d76-44a7-9d5b-a9e988f5ff25„§cell_idÙ$92428490-6d76-44a7-9d5b-a9e988f5ff25¤codeÙ0md"## L'importance de l'ordre de désallocation"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e„§cell_idÙ$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e¤codeÙwqa(c"void set(struct vector_t *t, int i, float val) {", c""" if ((i < t->size) && (i > 0)) *(t->v+i)=val; }""")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$324b41a3-4b01-4589-8ca5-28ec148cdeb1„§cell_idÙ$324b41a3-4b01-4589-8ca5-28ec148cdeb1¤codeÙÿtutor(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; """))¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2„§cell_idÙ$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2¤codeÚ'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 """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$5b8e5130-bf78-4529-b3be-02a0ba093f12„§cell_idÙ$5b8e5130-bf78-4529-b3be-02a0ba093f12¤codeÙèc""" /* * @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 ) { """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$5bd30ea4-3193-4fb4-9bf8-369fcfa6547b„§cell_idÙ$5bd30ea4-3193-4fb4-9bf8-369fcfa6547b¤codeÙ¿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 """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$7808e8d0-597c-422a-95eb-cc581fb65d87„§cell_idÙ$7808e8d0-597c-422a-95eb-cc581fb65d87¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$3ddd22b2-7d1b-4b3a-8737-09552b51726d„§cell_idÙ$3ddd22b2-7d1b-4b3a-8737-09552b51726d¤codeÙ/md"# Variables, pointeurs et doubles pointeurs"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$ad6a791b-14f0-4a20-ad5b-ec1690253bd9„§cell_idÙ$ad6a791b-14f0-4a20-ad5b-ec1690253bd9¤codeÚ function 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) end¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2„§cell_idÙ$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2¤codeÙÿmd""" 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; ``` """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$acfa3f43-215e-4c97-bf2a-0069e78f95b4„§cell_idÙ$acfa3f43-215e-4c97-bf2a-0069e78f95b4¤code´md"## Matrices en C"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$319bc8b4-7139-43b0-a57b-66c6a9da7cb9„§cell_idÙ$319bc8b4-7139-43b0-a57b-66c6a9da7cb9¤codeÙ,md"# Structure différente du stack et heap"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$47279972-433b-46be-b511-170698ff8753„§cell_idÙ$47279972-433b-46be-b511-170698ff8753¤codeÙ*md""" Comment construire une matrice ? """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$0e0ddf7c-a34b-447a-8142-334d14f96ae1„§cell_idÙ$0e0ddf7c-a34b-447a-8142-334d14f96ae1¤codeÙ md"## Allocation de la mémoire"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$38e67b29-707f-4718-b9cc-2a1a62f32143„§cell_idÙ$38e67b29-707f-4718-b9cc-2a1a62f32143¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$0b41747b-fe00-49a0-9ed9-99f0b2046b2e„§cell_idÙ$0b41747b-fe00-49a0-9ed9-99f0b2046b2e¤codeÚ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[0][0] = 1; // 1 *(matrice[0]) = 1; // 2 *(matrice) = 1; // 3 """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$67cf8ac0-5b91-4d19-aca4-4309f3109a0c„§cell_idÙ$67cf8ac0-5b91-4d19-aca4-4309f3109a0c¤codeÙ(md"## Comment faire matrice[1][0] = 2 ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$87877209-958b-4635-bdbc-97548acdfb3f„§cell_idÙ$87877209-958b-4635-bdbc-97548acdfb3f¤codeÙxmd""" Toutes les fonctions doivent vérifier leurs arguments et retourner * -1 en cas d'erreur * 0 en cas de succès """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$9160427d-4db7-4a97-9dde-14d19d59b1ef„§cell_idÙ$9160427d-4db7-4a97-9dde-14d19d59b1ef¤codeÚ'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 """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$14a56b43-789a-42f0-9228-0c6a660629c9„§cell_idÙ$14a56b43-789a-42f0-9228-0c6a660629c9¤codeÙDmd"`mapreduce` donne un exemple de fonction d'ordre supérieur en C"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$90a4fe3c-02c7-46e6-b2fb-526e73508101„§cell_idÙ$90a4fe3c-02c7-46e6-b2fb-526e73508101¤codeÙOusing PlutoUI, PlutoUI.ExperimentalLayout, PlutoTeachingTools, HypertextLiteral¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$49f0db66-da21-42b0-91d5-db04075e559a„§cell_idÙ$49f0db66-da21-42b0-91d5-db04075e559a¤codeÙ#section("Un vecteur \"Java\" en C")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc„§cell_idÙ$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc¤codeÙ_c""" /* * libère la mémoire utilisée pour le vecteur * -1 en cas d'erreur, 0 sinon */ """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$3b5e218f-c134-40a9-9bc3-1fbab8d64d62„§cell_idÙ$3b5e218f-c134-40a9-9bc3-1fbab8d64d62¤codeÙLEPL1503/LSINC1503 - Cours 2

O. Bonaventure, B. Legat, M. Baerts

$(PlutoTeachingTools.ChooseDisplayMode()) $(PlutoUI.TableOfContents(depth=1)) """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$b58ba8eb-0661-4eac-8ead-2daff4126d57„§cell_idÙ$b58ba8eb-0661-4eac-8ead-2daff4126d57¤codeºc""" } return 0; } """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$c132bea8-1ffe-4015-aaa7-66a67a806f48„§cell_idÙ$c132bea8-1ffe-4015-aaa7-66a67a806f48¤codeÚÆbegin 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 end¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$6cc7a1d4-df02-494f-bf18-0652d49280e5„§cell_idÙ$6cc7a1d4-df02-494f-bf18-0652d49280e5¤codeµmd"## Initialisation"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$c306afc9-f86e-4407-8757-272561980a72„§cell_idÙ$c306afc9-f86e-4407-8757-272561980a72¤codeÙðc"""/* * @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 ) {"""¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$132663c2-dfdd-4426-991a-bc9c95bbdad1„§cell_idÙ$132663c2-dfdd-4426-991a-bc9c95bbdad1¤codeÚWhbox([ 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"), ])¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$c73a9ebe-9597-4c49-8493-aec1d71a281a„§cell_idÙ$c73a9ebe-9597-4c49-8493-aec1d71a281a¤codeÙ(md"## Comment faire matrice[0][1] = 0 ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$b66c9e2f-17b3-44dc-83e4-cb3a9329039b„§cell_idÙ$b66c9e2f-17b3-44dc-83e4-cb3a9329039b¤codeµmd"Quels arguments ?"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$7838b43b-428d-4045-8cfe-17c9a824ac65„§cell_idÙ$7838b43b-428d-4045-8cfe-17c9a824ac65¤codeÙ md"## Première implémentation"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$594773b5-7e89-41a1-a873-387a096ee3b5„§cell_idÙ$594773b5-7e89-41a1-a873-387a096ee3b5¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$654184b1-4b5e-4c90-800e-b413a04eeea1„§cell_idÙ$654184b1-4b5e-4c90-800e-b413a04eeea1¤codeÙßtutor(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)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2„§cell_idÙ$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2¤codeÚªtutor(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)); } """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1„§cell_idÙ$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1¤codeÙhc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$1ca8b74a-ce74-44a3-9e74-1447eb5141a7„§cell_idÙ$1ca8b74a-ce74-44a3-9e74-1447eb5141a7¤codeÙhc"""struct vector_t { int length; // nombre d'élements float *tab; // tableau avec les réels };"""¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$e5e45ef0-32ac-403c-a05e-de267209fb8b„§cell_idÙ$e5e45ef0-32ac-403c-a05e-de267209fb8b¤codeÙš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; ``` """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$65ae6528-ef2c-48fd-94e9-56224e19863e„§cell_idÙ$65ae6528-ef2c-48fd-94e9-56224e19863e¤codeÚsbegin 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 end¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÂÙ$c2928a50-8f63-477e-ada3-1352d5c72712„§cell_idÙ$c2928a50-8f63-477e-ada3-1352d5c72712¤codeÚc""" /* * @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 ) """¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$986cdd2f-c22a-497b-8ce4-d6755a871c15„§cell_idÙ$986cdd2f-c22a-497b-8ce4-d6755a871c15¤code±wooclap("JAPRXX")¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$85e1517c-f7d9-4df5-acde-00657cdf3dbe„§cell_idÙ$85e1517c-f7d9-4df5-acde-00657cdf3dbe¤codeÚÀtutor(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); } """)¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedÃÙ$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40„§cell_idÙ$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40¤codeÙrmd"Une telle matrice sera stockée sur le **stack** (variable locale) ou dans la zone données (variable globale)"¨metadataƒ©show_logsèdisabled®skip_as_script«code_foldedënotebook_idÙ$1e021d28-9184-11f1-a11f-2f43b3d7eb3a¥bonds€¬cell_resultsÞaÙ$4dad1e1b-2288-49b9-8190-f2f374ca353cЦqueued¤logs�§running¦output†¤bodyÚ
void destroy(struct vector_t *vect) {
  free(vect->v);
  free(vect);
}
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�ŠEþ"·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$4dad1e1b-2288-49b9-8190-f2f374ca353c¹depends_on_disabled_cells§runtimeÍ­sµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4aЦqueued¤logs�§running¦output†¤bodyÙJ

Heap ou stack ?

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…SG·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$8283cc88-a3c8-4bb2-af31-0b72f2eb2c4a¹depends_on_disabled_cells§runtimeÎââµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$9cb862ff-275e-4f1d-8104-c1b8350725daЦqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š,yt·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$9cb862ff-275e-4f1d-8104-c1b8350725da¹depends_on_disabled_cells§runtimeγîµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$d107cd6f-c45c-4289-bd0f-5f329633fddaЦqueued¤logs�§running¦output†¤bodyÙ&tutor (generic function with 1 method)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�‰²2±·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$d107cd6f-c45c-4289-bd0f-5f329633fdda¹depends_on_disabled_cells§runtimeÎ/Ó(µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$378c90d9-e206-4858-b362-4015ca46bbb0Цqueued¤logs�§running¦output†¤bodyÙ(section (generic function with 1 method)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�ˆ—J{·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$378c90d9-e206-4858-b362-4015ca46bbb0¹depends_on_disabled_cells§runtimeÎ1_µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$44c8617f-ba56-40fe-80b4-963cf6e6f4b5Цqueued¤logs�§running¦output†¤bodyÙj

Modification d'un élément

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…RS*·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$44c8617f-ba56-40fe-80b4-963cf6e6f4b5¹depends_on_disabled_cells§runtimeζµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$d85db8cc-56b6-42e5-8175-3c53d345282eЦqueued¤logs�§running¦output†¤bodyÚ
Comment implémenter set ?
  if (i < 0 || i >= v->length)
    return -1;
  *(v->tab + i) = val;
  return 0;
}
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�ŠK<—·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$d85db8cc-56b6-42e5-8175-3c53d345282e¹depends_on_disabled_cells§runtimeÎ Mµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$a6ca2092-6435-4081-a407-c3d0286efb62Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š-ê·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$a6ca2092-6435-4081-a407-c3d0286efb62¹depends_on_disabled_cells§runtimeÎTÁµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$7f150e04-b56b-499f-ad50-4f586e76a0abЦqueued¤logs�§running¦output†¤bodyÚ
Comment implémenter get ?
  if (i < 0 || i >= v->length)
    return -1;
  *val = *(v->tab + i);
  return 0;
}
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�ŠJ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$7f150e04-b56b-499f-ad50-4f586e76a0ab¹depends_on_disabled_cells§runtime΃¾µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$a8783da7-4e44-4012-be6e-88705697b0c5Цqueued¤logs�§running¦output†¤bodyÚ;°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰Áñ‘·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$a8783da7-4e44-4012-be6e-88705697b0c5¹depends_on_disabled_cells§runtimeÎU<µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$03847d85-c675-4b4a-9331-fd7a32b26938Цqueued¤logs�§running¦output†¤bodyÙ`

Libération de la mémoire

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Rxû·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$03847d85-c675-4b4a-9331-fd7a32b26938¹depends_on_disabled_cells§runtimeÎ 6?µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$27b6779a-5624-4e8e-ae32-8a8971923d01Цqueued¤logs�§running¦output†¤bodyÚo
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¤mime©text/html²last_run_timestampËAÚ�‰¨hº·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$27b6779a-5624-4e8e-ae32-8a8971923d01¹depends_on_disabled_cells§runtimeÍg޵published_object_keys�¸depends_on_skipped_cells§erroredÂÙ$a39d8ac8-70e6-47a5-b80d-e1443c19ae15Цqueued¤logs�§running¦output†¤bodyÙz

Première approche, un malloc par ligne

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…PgÓ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$a39d8ac8-70e6-47a5-b80d-e1443c19ae15¹depends_on_disabled_cells§runtimeÎñ+µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$6d3d7f63-766b-4a1f-91c3-46b401c4c280Цqueued¤logs’ˆ¤lineÿ£msg’Ù'Running : `/tmp/jl_NnVxqT/bin ab cd ef`ªtext/plain§cell_idÙ$6d3d7f63-766b-4a1f-91c3-46b401c4c280¦kwargs�¢id¹Main_workspace#2_c2f2ac11¤fileÙ^/home/runner/work/LEPL1503/LEPL1503/Lectures/Cours2.jl#==#c132bea8-1ffe-4015-aaa7-66a67a806f48¥group¦Cours2¥level¤Infoˆ¤lineÿ£msg’Ù
#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¤mime©text/html²last_run_timestampËAÚ�‰‘_·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$6d3d7f63-766b-4a1f-91c3-46b401c4c280¹depends_on_disabled_cells§runtimeÎðu+µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$8f156e1d-5816-4c56-9aec-ad665d2bc782Цqueued¤logs‘ˆ¤lineÿ£msg’Ù¢/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/plain§cell_idÙ$8f156e1d-5816-4c56-9aec-ad665d2bc782¦kwargs�¢id´PlutoRunner_d1acb81e¤fileÙP/home/runner/.julia/packages/Pluto/CBqeh/src/runner/PlutoRunner/src/io/stdout.jl¥group¦stdout¥level®LogLevel(-555)§running¦output†¤bodyÙÁ
float *matrice1 = (float *)malloc(4 * sizeof(float));
matrice1[1][1] = 4;
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰žþ¨·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$8f156e1d-5816-4c56-9aec-ad665d2bc782¹depends_on_disabled_cells§runtimeÎÆÉ“µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$ecc856dc-e6f2-4a91-8c37-0bb920531297Цqueued¤logs�§running¦output†¤body °persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�ˆÓî•·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$ecc856dc-e6f2-4a91-8c37-0bb920531297¹depends_on_disabled_cells§runtimeÎþg¤µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$2140d0e6-cd51-465b-bfc5-bdbfe077bc58Цqueued¤logs�§running¦output†¤bodyÙ$qa (generic function with 2 methods)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�Š7Q“·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$2140d0e6-cd51-465b-bfc5-bdbfe077bc58¹depends_on_disabled_cells§runtimeÎ0üµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$4072072d-c543-43bf-87ad-1f201bd21c59Цqueued¤logs�§running¦output†¤bodyÙ·
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰¥ôõ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$4072072d-c543-43bf-87ad-1f201bd21c59¹depends_on_disabled_cells§runtimeÍu"µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$488d8bed-855f-470a-a2fa-68c13fd08739Цqueued¤logs�§running¦output†¤bodyÚD
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¤mime©text/html²last_run_timestampËAÚ�ŠAß·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$488d8bed-855f-470a-a2fa-68c13fd08739¹depends_on_disabled_cells§runtimeÍÈ.µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$b8392f14-05d4-43e4-bd2a-3d4ba6ced65bЦqueued¤logs�§running¦output†¤bodyÙz

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

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…SC·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$b8392f14-05d4-43e4-bd2a-3d4ba6ced65b¹depends_on_disabled_cells§runtimeÎHéµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$1f190c17-4feb-41b2-a10a-60fb191d250eЦqueued¤logs�§running¦output†¤bodyÙ¼
float A[2][2] = {{1, 0}, {2, 3}};
A[1][1] = 4;
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰›åi·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$1f190c17-4feb-41b2-a10a-60fb191d250e¹depends_on_disabled_cells§runtimeÎÉÕ(µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$406d30a9-f477-4898-9caf-770fcc25b2a9Цqueued¤logs�§running¦output†¤bodyÙf

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

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…R”l·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$406d30a9-f477-4898-9caf-770fcc25b2a9¹depends_on_disabled_cells§runtimeÎÆµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$accfaade-96ce-4869-83ce-9dd5489b65a2Цqueued¤logs�§running¦output†¤bodyÚä°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰Ç g·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$accfaade-96ce-4869-83ce-9dd5489b65a2¹depends_on_disabled_cells§runtimeΔ¾µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$6531f0d6-cf62-46ca-8dd2-befda43806d7Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š+`·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$6531f0d6-cf62-46ca-8dd2-befda43806d7¹depends_on_disabled_cells§runtimeÎK µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3Цqueued¤logs�§running¦output†¤bodyÙY

The End

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Sh”·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$e0bfde10-5b3d-48b2-aa03-a1e6b0fc97e3¹depends_on_disabled_cells§runtimeÎq©µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$4e5e1340-c2e6-4b4a-bfb9-e1096d179040Цqueued¤logs�§running¦output†¤bodyÙT

Retourner un tableau

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Rå°·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$4e5e1340-c2e6-4b4a-bfb9-e1096d179040¹depends_on_disabled_cells§runtimeÎ3µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$facc8d63-d620-40ff-939a-78ff58fff04fЦqueued¤logs�§running¦output†¤bodyÙ·
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰¢�·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$facc8d63-d620-40ff-939a-78ff58fff04f¹depends_on_disabled_cells§runtimeÍe>µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$4b009812-191d-4969-bf32-5941ca707f37Цqueued¤logs�§running¦output†¤bodyÙn

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

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…R8.·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$4b009812-191d-4969-bf32-5941ca707f37¹depends_on_disabled_cells§runtimeÎã µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4Цqueued¤logs�§running¦output†¤bodyÚ¨
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¤mime©text/html²last_run_timestampËAÚ�‰¤¡·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$dd7f51b5-ca6a-4eb4-802d-9514861ae6a4¹depends_on_disabled_cells§runtimeÍiñµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$c81abb3d-7192-499e-a47a-c0b960aa49cdЦqueued¤logs�§running¦output†¤bodyÙ`

Libération de la mémoire

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Q‰·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$c81abb3d-7192-499e-a47a-c0b960aa49cd¹depends_on_disabled_cells§runtimeÎçäµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$2e1fc3ec-c1ca-43b8-893c-bda691635475Цqueued¤logs�§running¦output†¤bodyÙV

Visualization de init

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…R·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$2e1fc3ec-c1ca-43b8-893c-bda691635475¹depends_on_disabled_cells§runtimeÎç9µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$a13bf677-9c63-4f8e-b3dd-27b3aad7f956Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š/Ò·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$a13bf677-9c63-4f8e-b3dd-27b3aad7f956¹depends_on_disabled_cells§runtimeÎ%޵published_object_keys�¸depends_on_skipped_cells§erroredÂÙ$419f48c0-8377-4a67-a801-e87d2a61c17aЦqueued¤logs�§running¦output†¤bodyÚ
float get(struct vector_t *t, int i) {
  return *(t->v + i);
}
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�ŠC>Õ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$419f48c0-8377-4a67-a801-e87d2a61c17a¹depends_on_disabled_cells§runtimeÍ«tµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$f386a8d4-35be-4612-91c7-31ff0f004e2dЦqueued¤logs�§running¦output†¤bodyÙf

Une autre implémentation …

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Q�T·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$f386a8d4-35be-4612-91c7-31ff0f004e2d¹depends_on_disabled_cells§runtimeÎJFµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$336f53c9-5982-4694-8bd4-92c2a1d1b5ccЦqueued¤logs�§running¦output†¤bodyÙj

Initialisation d'une valeur

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…P�„·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$336f53c9-5982-4694-8bd4-92c2a1d1b5cc¹depends_on_disabled_cells§runtimeÎðµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$2d35189b-46aa-4922-ad4f-432533da2a80Цqueued¤logs�§running¦output†¤bodyÚx°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰Å€·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$2d35189b-46aa-4922-ad4f-432533da2a80¹depends_on_disabled_cells§runtimeÎ8ãµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$8c115304-6a8e-4c2e-aeb2-9199c9d3b704Цqueued¤logs�§running¦output†¤bodyÙ.three_columns (generic function with 1 method)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�Š2/·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$8c115304-6a8e-4c2e-aeb2-9199c9d3b704¹depends_on_disabled_cells§runtimeÎ@6µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$a07e8aea-790b-4307-9de1-e45c6a3f7cf4Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š*?È·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$a07e8aea-790b-4307-9de1-e45c6a3f7cf4¹depends_on_disabled_cells§runtimeΦ8µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$37f6e305-fb5c-4215-b8a1-564a7632a377Цqueued¤logs�§running¦output†¤bodyÙ~

Comment initialiser la première valeur ?

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…P¸c·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$37f6e305-fb5c-4215-b8a1-564a7632a377¹depends_on_disabled_cells§runtimeΚ‚µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$b66272c8-02b0-4d22-84d6-7274efe11e2aЦqueued¤logs�§running¦output†¤bodyÙ‚
struct vector_t
{
    int size;
    float *v;
};
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰¡Xu·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$b66272c8-02b0-4d22-84d6-7274efe11e2a¹depends_on_disabled_cells§runtimeÍg�µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$848723a1-4a62-47b2-957c-167ce9be19f8Цqueued¤logs�§running¦output†¤bodyÙ„

Comment mettre une matrice 2x2 sur le heap ?

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…PM·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$848723a1-4a62-47b2-957c-167ce9be19f8¹depends_on_disabled_cells§runtimeÎé’µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$20d23ab4-ae24-4169-92be-ed9ec77c5518Цqueued¤logs�§running¦output†¤bodyÚã °persist_js_state¤mime©text/html²last_run_timestampËAÚ�ˆ‹Ö4·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$20d23ab4-ae24-4169-92be-ed9ec77c5518¹depends_on_disabled_cells§runtimeÎDŽ'µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$fc027d24-619e-4f6f-95ed-3dd12f61b60cЦqueued¤logs�§running¦output†¤bodyÙF

Visualisation

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…OvW·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$fc027d24-619e-4f6f-95ed-3dd12f61b60c¹depends_on_disabled_cells§runtimeÎpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$62198fa2-4e96-4950-a99e-a3808bbf811aЦqueued¤logs�§running¦output†¤bodyÙå
Comment libérer la mémoire avec free ?
free(ligne0);
free(ligne1);
free(matrice);
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�Š?‹‹·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$62198fa2-4e96-4950-a99e-a3808bbf811a¹depends_on_disabled_cells§runtimeÎîqrµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$e1b6f1d3-9d06-4ee4-854d-8ede288f369cЦqueued¤logs�§running¦output†¤bodyÚ$
int destroy(struct vector_t *v) {
  free(v->tab);
  free(v);
  return 0;
}
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�ŠL˜ò·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$e1b6f1d3-9d06-4ee4-854d-8ede288f369c¹depends_on_disabled_cells§runtimeͧðµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$92428490-6d76-44a7-9d5b-a9e988f5ff25Цqueued¤logs�§running¦output†¤bodyÙŽ

L'importance de l'ordre de désallocation

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Q!¸·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$92428490-6d76-44a7-9d5b-a9e988f5ff25¹depends_on_disabled_cells§runtimeÎݵpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$cfc54158-a170-4f1d-b1dd-ab8e0f1a172eЦqueued¤logs�§running¦output†¤bodyÚj
void set(struct vector_t *t, int i, float val) {
  if ((i < t->size) && (i > 0))
      *(t->v+i)=val;
}
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�ŠD£Ê·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$cfc54158-a170-4f1d-b1dd-ab8e0f1a172e¹depends_on_disabled_cells§runtimeͨ¶µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$324b41a3-4b01-4589-8ca5-28ec148cdeb1Цqueued¤logs�§running¦output†¤bodyÚš°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰Â²}·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$324b41a3-4b01-4589-8ca5-28ec148cdeb1¹depends_on_disabled_cells§runtimeÎ@ýµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2Цqueued¤logs�§running¦output†¤bodyÚ
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¤mime©text/html²last_run_timestampËAÚ�‰ 5H·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$b5388c3e-bcaf-43b6-b9d9-c9979f2afce2¹depends_on_disabled_cells§runtimeÍe„µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$5b8e5130-bf78-4529-b3be-02a0ba093f12Цqueued¤logs�§running¦output†¤bodyÚ8
/*
 * @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¤mime©text/html²last_run_timestampËAÚ�‰¦™$·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$5b8e5130-bf78-4529-b3be-02a0ba093f12¹depends_on_disabled_cells§runtimeÍfWµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$5bd30ea4-3193-4fb4-9bf8-369fcfa6547bЦqueued¤logs�§running¦output†¤bodyÚ!
  • 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¤mime©text/html²last_run_timestampËAÚ�…O·„·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$5bd30ea4-3193-4fb4-9bf8-369fcfa6547b¹depends_on_disabled_cells§runtimeÎ÷€µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$7808e8d0-597c-422a-95eb-cc581fb65d87Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š.*··has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$7808e8d0-597c-422a-95eb-cc581fb65d87¹depends_on_disabled_cells§runtimeÎ.èµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$3ddd22b2-7d1b-4b3a-8737-09552b51726dЦqueued¤logs�§running¦output†¤bodyÙ~

Variables, pointeurs et doubles pointeurs

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…OYm·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$3ddd22b2-7d1b-4b3a-8737-09552b51726d¹depends_on_disabled_cells§runtimeΠµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$ad6a791b-14f0-4a20-ad5b-ec1690253bd9Цqueued¤logs�§running¦output†¤bodyÙ(wooclap (generic function with 1 method)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�ŠÇηhas_pluto_hook_features¬rootassigneeÀ§cell_idÙ$ad6a791b-14f0-4a20-ad5b-ec1690253bd9¹depends_on_disabled_cells§runtimeÎèµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2Цqueued¤logs�§running¦output†¤bodyÚ§

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¤mime©text/html²last_run_timestampËAÚ�…Q>h·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$1a82ab2b-dd7c-4b48-b263-e71b13ba0fb2¹depends_on_disabled_cells§runtimeΧµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$acfa3f43-215e-4c97-bf2a-0069e78f95b4Цqueued¤logs�§running¦output†¤bodyÙF

Matrices en C

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…OÒú·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$acfa3f43-215e-4c97-bf2a-0069e78f95b4¹depends_on_disabled_cells§runtimeÎ\üµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$319bc8b4-7139-43b0-a57b-66c6a9da7cb9Цqueued¤logs�§running¦output†¤bodyÙx

Structure différente du stack et heap

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…SQ‹·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$319bc8b4-7139-43b0-a57b-66c6a9da7cb9¹depends_on_disabled_cells§runtimeÎꬵpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$47279972-433b-46be-b511-170698ff8753Цqueued¤logs�§running¦output†¤bodyÙD

Comment construire une matrice ?

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Oð5·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$47279972-433b-46be-b511-170698ff8753¹depends_on_disabled_cells§runtimeÎ8´µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$0e0ddf7c-a34b-447a-8142-334d14f96ae1Цqueued¤logs�§running¦output†¤bodyÙ^

Allocation de la mémoire

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…R·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$0e0ddf7c-a34b-447a-8142-334d14f96ae1¹depends_on_disabled_cells§runtimeÎð&µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$38e67b29-707f-4718-b9cc-2a1a62f32143Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š*Óзhas_pluto_hook_features¬rootassigneeÀ§cell_idÙ$38e67b29-707f-4718-b9cc-2a1a62f32143¹depends_on_disabled_cells§runtimeÎröµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$0b41747b-fe00-49a0-9ed9-99f0b2046b2eЦqueued¤logs�§running¦output†¤bodyÚú
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¤mime©text/html²last_run_timestampËAÚ�‰Ÿ¡8·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$0b41747b-fe00-49a0-9ed9-99f0b2046b2e¹depends_on_disabled_cells§runtimeÍj†µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$67cf8ac0-5b91-4d19-aca4-4309f3109a0cЦqueued¤logs�§running¦output†¤bodyÙ–

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

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Pìš·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$67cf8ac0-5b91-4d19-aca4-4309f3109a0c¹depends_on_disabled_cells§runtimeÎÿ¯µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$87877209-958b-4635-bdbc-97548acdfb3fЦqueued¤logs�§running¦output†¤bodyÙ¿

Toutes les fonctions doivent vérifier leurs arguments et retourner

  • -1 en cas d'erreur

  • 0 en cas de succès

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Q²’·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$87877209-958b-4635-bdbc-97548acdfb3f¹depends_on_disabled_cells§runtimeÎ=¢µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$9160427d-4db7-4a97-9dde-14d19d59b1efЦqueued¤logs�§running¦output†¤bodyÚ
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¤mime©text/html²last_run_timestampËAÚ�‰ Ê°·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$9160427d-4db7-4a97-9dde-14d19d59b1ef¹depends_on_disabled_cells§runtimeÍmïµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$14a56b43-789a-42f0-9228-0c6a660629c9Цqueued¤logs�§running¦output†¤bodyÙs

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

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…RË.·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$14a56b43-789a-42f0-9228-0c6a660629c9¹depends_on_disabled_cells§runtime΂„µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$90a4fe3c-02c7-46e6-b2fb-526e73508101Цqueued¤logs�§running¦output†¤body °persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�‡Üpß·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$90a4fe3c-02c7-46e6-b2fb-526e73508101¹depends_on_disabled_cells§runtimeÎ \µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$49f0db66-da21-42b0-91d5-db04075e559aЦqueued¤logs�§running¦output†¤bodyÙl

Un vecteur "Java" en C

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�ˆÂMÓ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$49f0db66-da21-42b0-91d5-db04075e559a¹depends_on_disabled_cells§runtimeÍ0‡µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$cb9c27b9-ce7d-4bdf-af7d-c88883a210bcЦqueued¤logs�§running¦output†¤bodyÙ¢
/*
 * libère la mémoire utilisée pour le vecteur
 * -1 en cas d'erreur, 0 sinon
 */
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰§Ðú·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$cb9c27b9-ce7d-4bdf-af7d-c88883a210bc¹depends_on_disabled_cells§runtimeÍepµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$3b5e218f-c134-40a9-9bc3-1fbab8d64d62Цqueued¤logs�§running¦output†¤bodyÙ–

Deuxième approche, un malloc pour toutes les valeurs

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…PƒI·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$3b5e218f-c134-40a9-9bc3-1fbab8d64d62¹depends_on_disabled_cells§runtimeÎïéµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$90532252-a756-40a1-8867-76041f5545a0Цqueued¤logs�§running¦output†¤bodyÙ„

Toujours free dans le sens inverse de malloc

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…QXÿ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$90532252-a756-40a1-8867-76041f5545a0¹depends_on_disabled_cells§runtimeÎéµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$ec120913-bafb-4abb-8ebd-a0e3b72578f6Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š+íå·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$ec120913-bafb-4abb-8ebd-a0e3b72578f6¹depends_on_disabled_cells§runtimeÎB„µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$4643cd02-67f4-40cd-aa7d-cfdb83fc62beЦqueued¤logs�§running¦output†¤bodyÙt

Retourner un tableau : visualization

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…S6T·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$4643cd02-67f4-40cd-aa7d-cfdb83fc62be¹depends_on_disabled_cells§runtimeÎè µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$6f257725-72c3-404c-bb35-079265058a43Цqueued¤logs�§running¦output†¤bodyÙT

Pointeur de fonction

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…R¯G·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$6f257725-72c3-404c-bb35-079265058a43¹depends_on_disabled_cells§runtimeÎóµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$dd918d12-bde4-4a1d-88c2-a9a643f39b2eЦqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š-œ0·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$dd918d12-bde4-4a1d-88c2-a9a643f39b2e¹depends_on_disabled_cells§runtimeÎc;µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$b588a04d-6a3f-424e-a83a-eec1dfafc9ddЦqueued¤logs�§running¦output†¤bodyÙT

Matrices sur le heap

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…P2j·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$b588a04d-6a3f-424e-a83a-eec1dfafc9dd¹depends_on_disabled_cells§runtimeÎM̵published_object_keys�¸depends_on_skipped_cells§erroredÂÙ$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7dЦqueued¤logs�§running¦output†¤bodyÙN

Arguments de main

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…O“ ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$cd3cce7d-b149-4ee1-8b6e-ff213a48ce7d¹depends_on_disabled_cells§runtimeÎ��µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$3b6a95e0-96e9-4634-9207-42ace759e738Цqueued¤logs�§running¦output†¤bodyÙ+frametitle (generic function with 1 method)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�ˆÊ¶·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$3b6a95e0-96e9-4634-9207-42ace759e738¹depends_on_disabled_cells§runtimeάʵpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411Цqueued¤logs�§running¦output†¤bodyÚVF

LEPL1503/LSINC1503 - Cours 2

O. Bonaventure, B. Legat, M. Baerts

      °persist_js_state¤mime©text/html²last_run_timestampËAÚ�ˆx‘S·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$68b3f601-8cc3-45b2-93f6-8fdbc9cd3411¹depends_on_disabled_cells§runtimeÎРȵpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$b58ba8eb-0661-4eac-8ead-2daff4126d57Цqueued¤logs�§running¦output†¤bodyÙc
  }
  return 0;
}
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰¥Nj·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$b58ba8eb-0661-4eac-8ead-2daff4126d57¹depends_on_disabled_cells§runtimeÍg¶µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$c132bea8-1ffe-4015-aaa7-66a67a806f48Цqueued¤logs�§running¦output†¤bodyÙ-compile_lib (generic function with 2 methods)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�ˆö">·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$c132bea8-1ffe-4015-aaa7-66a67a806f48¹depends_on_disabled_cells§runtimeÎu·µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$6cc7a1d4-df02-494f-bf18-0652d49280e5Цqueued¤logs�§running¦output†¤bodyÙH

Initialisation

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…QÍŽ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$6cc7a1d4-df02-494f-bf18-0652d49280e5¹depends_on_disabled_cells§runtimeÎßyµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$c306afc9-f86e-4407-8757-272561980a72Цqueued¤logs�§running¦output†¤bodyÚB
/*
 * @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¤mime©text/html²last_run_timestampËAÚ�‰§6z·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$c306afc9-f86e-4407-8757-272561980a72¹depends_on_disabled_cells§runtimeÍf8µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$132663c2-dfdd-4426-991a-bc9c95bbdad1Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#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/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š‘`·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$132663c2-dfdd-4426-991a-bc9c95bbdad1¹depends_on_disabled_cells§runtimeÎ!*cVµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$c73a9ebe-9597-4c49-8493-aec1d71a281aЦqueued¤logs�§running¦output†¤bodyÙ–

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

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…PÒª·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$c73a9ebe-9597-4c49-8493-aec1d71a281a¹depends_on_disabled_cells§runtimeÎ퇵published_object_keys�¸depends_on_skipped_cells§erroredÂÙ$b66c9e2f-17b3-44dc-83e4-cb3a9329039bЦqueued¤logs�§running¦output†¤bodyÙ5

Quels arguments ?

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…Q获has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$b66c9e2f-17b3-44dc-83e4-cb3a9329039b¹depends_on_disabled_cells§runtimeÎFµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$7838b43b-428d-4045-8cfe-17c9a824ac65Цqueued¤logs�§running¦output†¤bodyÙ^

Première implémentation

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…QrÅ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$7838b43b-428d-4045-8cfe-17c9a824ac65¹depends_on_disabled_cells§runtimeÎÑ;µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$594773b5-7e89-41a1-a873-387a096ee3b5Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š.µ�·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$594773b5-7e89-41a1-a873-387a096ee3b5¹depends_on_disabled_cells§runtimeÎ)‚µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$654184b1-4b5e-4c90-800e-b413a04eeea1Цqueued¤logs�§running¦output†¤bodyÚI°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰ÄQv·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$654184b1-4b5e-4c90-800e-b413a04eeea1¹depends_on_disabled_cells§runtimeÎ?&µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2Цqueued¤logs�§running¦output†¤bodyÚÀ°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰ÆS—·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$3cc18d67-b0d7-4b4b-afb6-5b48eddd89d2¹depends_on_disabled_cells§runtimeλìµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1Цqueued¤logs�§running¦output†¤bodyÙ·
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰¡èÄ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$f3dd8bf7-03c4-4069-8d1c-ece484de5ef1¹depends_on_disabled_cells§runtimeÍzˆµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$1ca8b74a-ce74-44a3-9e74-1447eb5141a7Цqueued¤logs�§running¦output†¤bodyÙ·
struct vector_t {
  int length; // nombre d'élements
  float *tab; // tableau avec les réels
};
°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰£ù¥·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$1ca8b74a-ce74-44a3-9e74-1447eb5141a7¹depends_on_disabled_cells§runtimeÍuTµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$e5e45ef0-32ac-403c-a05e-de267209fb8bЦqueued¤logs�§running¦output†¤bodyÚ`
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¤mime©text/html²last_run_timestampËAÚ�ŠHû/·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$e5e45ef0-32ac-403c-a05e-de267209fb8b¹depends_on_disabled_cells§runtimeÎnµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$65ae6528-ef2c-48fd-94e9-56224e19863eЦqueued¤logs�§running¦output†¤bodyÙ%img (generic function with 3 methods)°persist_js_state¤mimeªtext/plain²last_run_timestampËAÚ�‰Ïñ„·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$65ae6528-ef2c-48fd-94e9-56224e19863e¹depends_on_disabled_cells§runtimeΡCIµpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$c2928a50-8f63-477e-ada3-1352d5c72712Цqueued¤logs�§running¦output†¤bodyÚc
/*
 * @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¤mime©text/html²last_run_timestampËAÚ�‰£Rœ·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$c2928a50-8f63-477e-ada3-1352d5c72712¹depends_on_disabled_cells§runtimeÍj,µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$986cdd2f-c22a-497b-8ce4-d6755a871c15Цqueued¤logs�§running¦output†¤bodyƒ©classnameÀ¥styleÙ#display: flex; flex-direction: row;¨children•’ÙNWooclap Logo©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ùohttps://app.wooclap.com/JAPRXX©text/html’ƒ©classnameÀ¥style­flex-grow: 1;¨children‘’¡ ©text/htmlÙ'application/vnd.pluto.divelement+object’Ú¼©text/html°persist_js_state¤mimeÙ'application/vnd.pluto.divelement+object²last_run_timestampËAÚ�Š/G·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$986cdd2f-c22a-497b-8ce4-d6755a871c15¹depends_on_disabled_cells§runtimeÎ9µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$85e1517c-f7d9-4df5-acde-00657cdf3dbeЦqueued¤logs�§running¦output†¤bodyÚî°persist_js_state¤mime©text/html²last_run_timestampËAÚ�‰Åº=·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$85e1517c-f7d9-4df5-acde-00657cdf3dbe¹depends_on_disabled_cells§runtimeÎ3µpublished_object_keys�¸depends_on_skipped_cells§erroredÂÙ$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40Цqueued¤logs�§running¦output†¤bodyÙ¯

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

°persist_js_state¤mime©text/html²last_run_timestampËAÚ�…P”·has_pluto_hook_features¬rootassigneeÀ§cell_idÙ$42e6ffd9-27b6-49bc-8518-2d7d4b7ffc40¹depends_on_disabled_cells§runtimeÎâ½µpublished_object_keys�¸depends_on_skipped_cells§errored©shortpath©Cours2.jl®last_save_timeËAÚ�…Cq«in_temp_dir¨metadata€