{"id":192,"date":"2012-03-31T22:41:49","date_gmt":"2012-03-31T14:41:49","guid":{"rendered":"https:\/\/www.techcoil.com\/blog\/?p=192"},"modified":"2018-09-03T21:42:26","modified_gmt":"2018-09-03T13:42:26","slug":"code-generator-for-list-of-countries","status":"publish","type":"post","link":"https:\/\/www.techcoil.com\/blog\/code-generator-for-list-of-countries\/","title":{"rendered":"Code generator for list of countries"},"content":{"rendered":"<p>There was a second need for me to display a list of countries for my users to select. While the first required insertion of names of the countries into the database, the second required the list of countries to be populated as an array of data objects via Java. I need to include boiler plate coding to convert a text list of countries into usable forms for the two different programming requirements.<\/p>\n<p>Since the list is more than a 100 items long, it will be more efficient to get the computer to generate the list of countries with the necessary boiler plate coding.<\/p>\n<h3>The code generator<\/h3>\n<p>In this post, I present a code generator that I had written to help me convert a text list of countries to other code forms.<\/p>\n<div class=\"callToAction\"><a href=\"http:\/\/www.techcoil.com\/tools\/code-generator-for-list-of-countries\" title=\"Use Code generator for list of countries\" class=\"readMoreLink\">Use it<\/a><\/div>\n<h3>Some posts that you may want to read<\/h3>\n<ul>\n<li><a href=\"http:\/\/www.techcoil.com\/blog\/quick-references\/generate-php-codes-with-php\/\" title=\"Generate PHP codes with PHP\" target=\"_blank\">Generate PHP codes with PHP<\/a><\/li>\n<li><a href=\"http:\/\/www.techcoil.com\/blog\/life-bits\/7-quotes-that-helped-make-my-programming-life-easier\/\" title=\"7 quotes that helped make my programming life easier\" target=\"_blank\">7 quotes that helped make my programming life easier<\/a><\/li>\n<\/ul>\n\n      <ul id=\"social-sharing-buttons-list\">\n        <li class=\"facebook\">\n          <a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwp.me%2Fp245TQ-36\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n            <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Facebook.png\" alt=\"Facebook icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"twitter\">\n          <a href=\"https:\/\/twitter.com\/intent\/tweet?text=&url=https%3A%2F%2Fwp.me%2Fp245TQ-36&via=Techcoil_com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Twitter.png\" alt=\"Twitter icon\"> Tweet\n          <\/a>\n        <\/li>\n        <li class=\"linkedin\">\n          <a href=\"https:\/\/www.linkedin.com\/shareArticle?mini=1&title=&url=https%3A%2F%2Fwp.me%2Fp245TQ-36&source=https:\/\/www.techcoil.com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/linkedin.png\" alt=\"Linkedin icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"pinterest\">\n          <a href=\"https:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Fwww.techcoil.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F192&description=\" class=\"pin-it-button\" target=\"_blank\" role=\"button\" rel=\"nofollow\" count-layout=\"horizontal\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Pinterest.png\" alt=\"Pinterest icon\"> Save\n          <\/a>\n        <\/li>\n      <\/ul>\n    ","protected":false},"excerpt":{"rendered":"<p>There was a second need for me to display a list of countries for my users to select. While the first required insertion of names of the countries into the database, the second required the list of countries to be populated as an array of data objects via Java. <\/p>\n<p>Although the <a href=\"http:\/\/pedroposada.com\/blog\/text-list-all-countries.html\" title=\"Link to Pedro Posada's text list of all countries\" target=\"_blank\">text list of countries<\/a> from <a href=\"http:\/\/pedroposada.com\" title=\"Link to Pedro Posada's homepage\" target=\"_blank\">Pedro Posada<\/a> is useful in both instances, it only fulfills part of what I need. In addition to the names, I need to include additional boiler plate coding to convert the text list of countries into usable forms for the two different programming requirements.<\/p>\n<p>And since the list is more than a 100 items long, it will be more efficient to get the computer to generate the list of countries with the necessary boiler plate coding.<\/p>\n","protected":false},"author":1,"featured_media":1210,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":""},"categories":[105],"tags":[36,16,6,9],"jetpack_featured_media_url":"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Screenshot-of-code-generator-to-generate-list-of-countries.gif","jetpack_shortlink":"https:\/\/wp.me\/p245TQ-36","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/192"}],"collection":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":0,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media\/1210"}],"wp:attachment":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}