{"id":23,"date":"2024-06-10T15:58:19","date_gmt":"2024-06-10T15:58:19","guid":{"rendered":"https:\/\/blogs.scummvm.org\/chico\/?p=23"},"modified":"2024-06-11T08:49:57","modified_gmt":"2024-06-11T08:49:57","slug":"week2-getting-better","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/chico\/2024\/06\/10\/week2-getting-better\/","title":{"rendered":"Week2 &#8211; Getting better"},"content":{"rendered":"<p>This week, my main tasks were parsing the .dat files and fixing errors in the original database functions. After closely examining some .dat files, I found their format very similar to JSON, which I am quite familiar with. Thus, I only needed to perform some bracket-matching operations.<\/p>\n<p>However, when I tried to port the PHP code to Python, I encountered numerous errors. The issues were due to Python\u2019s need for additional boundary checks on strings and differences in database operations between Pymysql and PHP. Additionally, the original code contains some unnecessary transaction operations. It should only require\u00a0<code>cursor.execute()<\/code>\u00a0instead of using\u00a0<code>conn.commit()<\/code> . After making the necessary fixes, I successfully resolved these issues.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-26\" src=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1-300x147.png\" alt=\"\" width=\"895\" height=\"438\" srcset=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1-300x147.png 300w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1-1024x501.png 1024w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1-768x376.png 768w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1-1536x752.png 1536w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1-1200x587.png 1200w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1-1980x969.png 1980w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image1.png 1992w\" sizes=\"auto, (max-width: 895px) 100vw, 895px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-25\" src=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image-300x212.png\" alt=\"\" width=\"835\" height=\"590\" srcset=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image-300x212.png 300w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image-768x543.png 768w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/06\/image.png 808w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Currently, I have replicated most of the main functionalities of the original code. Only a few minor details related to appearance and database exception handling remain, which I plan to address next week.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week, my main tasks were parsing the .dat files and fixing errors in the original database functions. After closely examining some .dat files, I found their format very similar to JSON, which I am quite familiar with. Thus, I only needed to perform some bracket-matching operations. However, when I tried to port the PHP [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-website"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":3,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":28,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts\/23\/revisions\/28"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}