{"id":1678,"date":"2024-11-04T17:34:58","date_gmt":"2024-11-04T09:34:58","guid":{"rendered":"https:\/\/www.tonghin.com.my\/blog\/?p=1678"},"modified":"2024-11-04T17:34:59","modified_gmt":"2024-11-04T09:34:59","slug":"streamlining-the-seed-data-generator","status":"publish","type":"post","link":"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/","title":{"rendered":"Streamlining the Seed Data Generator"},"content":{"rendered":"\n<p>Monday, October 28, 2024 \u2013 Last week, Mr. Peter assigned me the task of refining and to push the seed data generator that was previously created to automate sample data generation. Initially, the code was tailored for use only in my local environment, hence it required significant cleaning before it could be shared. Since I had been testing it extensively in a trial-and-error setup, there was quite a bit of redundant code to sift through.<\/p>\n\n\n\n<p>To start, I revamped the UI page, removing unused buttons and giving it a more streamlined appearance. Then, I focused on optimizing the view model for better functionality.<\/p>\n\n\n\n<p>The seed data generator was designed to handle multiple entities with a single button click, which led to long stretches of code that required careful verification to ensure smooth data generation. Although most of the functions leveraged existing code, a few necessitated extra queries. This meant creating new functions in a separate project, which hadn\u2019t been pushed previously.<\/p>\n\n\n\n<p>In my initial implementation, I used a parallel foreach loop to expedite data generation by processing multiple records simultaneously. However, this approach occasionally caused errors when handling more than two processes concurrently. Switching back to a standard foreach loop resolved these errors but slowed down the data generation, making the process less efficient.<\/p>\n\n\n\n<p>Apart from needing Mr. Peter&#8217;s approval for certain functions, as I was limited to using DLL-based functions. Towards the end of the week, the generator worked well in my environment and everything was successfully operational, although further testing might be necessary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Monday, October 28, 2024 \u2013 Last week, Mr. Peter assigned me the task of refining and to push the seed data generator that was previously created to automate sample data generation. Initially, the code was tailored for use only in my local environment, hence it required significant cleaning before it could be shared. Since I &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Streamlining the Seed Data Generator&#8221;<\/span><\/a><\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Streamlining the Seed Data Generator | Tong Hin&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Streamlining the Seed Data Generator | Tong Hin&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"Monday, October 28, 2024 \u2013 Last week, Mr. Peter assigned me the task of refining and to push the seed data generator that was previously created to automate sample data generation. Initially, the code was tailored for use only in my local environment, hence it required significant cleaning before it could be shared. Since I &hellip; Continue reading &quot;Streamlining the Seed Data Generator&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/\" \/>\n<meta property=\"og:site_name\" content=\"Tong Hin&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-04T09:34:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-04T09:34:59+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\",\"name\":\"TONG HIN MACHINERY\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"sameAs\":[\"https:\/\/www.youtube.com\/channel\/UC60EoxJMNbu8mV0LuEGfrBg\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/wp-content\/uploads\/2020\/10\/web_logo_180_180.jpg\",\"width\":180,\"height\":180,\"caption\":\"TONG HIN MACHINERY\"},\"image\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Tong Hin&#039;s Blog\",\"description\":\"Sharing About Technology\",\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.tonghin.com.my\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/#webpage\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/\",\"name\":\"Streamlining the Seed Data Generator | Tong Hin&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#website\"},\"datePublished\":\"2024-11-04T09:34:58+00:00\",\"dateModified\":\"2024-11-04T09:34:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/\",\"url\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/\",\"name\":\"Streamlining the Seed Data Generator\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/81e2366362d8d14b15519395755cee6f\"},\"headline\":\"Streamlining the Seed Data Generator\",\"datePublished\":\"2024-11-04T09:34:58+00:00\",\"dateModified\":\"2024-11-04T09:34:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/2024\/11\/04\/streamlining-the-seed-data-generator\/#webpage\"},\"publisher\":{\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#organization\"},\"articleSection\":\"Experiential\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#\/schema\/person\/81e2366362d8d14b15519395755cee6f\",\"name\":\"nurlailiyuzi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tonghin.com.my\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5c0d4cc6f7fc881bd56d95bdbb0c4c14?s=96&d=mm&r=g\",\"caption\":\"nurlailiyuzi\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/1678"}],"collection":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/comments?post=1678"}],"version-history":[{"count":1,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/1678\/revisions"}],"predecessor-version":[{"id":1679,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/posts\/1678\/revisions\/1679"}],"wp:attachment":[{"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/media?parent=1678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/categories?post=1678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tonghin.com.my\/blog\/wp-json\/wp\/v2\/tags?post=1678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}