{"id":14143,"date":"2015-04-13T05:06:52","date_gmt":"2015-04-12T19:06:52","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=14143"},"modified":"2015-04-13T05:06:52","modified_gmt":"2015-04-12T19:06:52","slug":"acronyms-lookup-follow-up-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/acronyms-lookup-follow-up-tutorial\/","title":{"rendered":"Acronyms Lookup Follow Up Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Acronyms Lookup Follow Up Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronym.png\" title=\"Acronyms Lookup Follow Up Tutorial\" id='ialfut' onmouseover=\" this.src=this.src.replace('.gif','.xpng').replace('.png','.xjpg').replace('.jpg','.xgif').replace('.x','.');    \" \/><\/a><p class=\"wp-caption-text\">Acronyms Lookup Follow Up Tutorial<\/p><\/div>\n<p>Wanted, today, to follow up on yesterday&#8217;s <a target=_blank title='Acronyms Lookup Primer Tutorial' href='#alpt'>Acronyms Lookup Primer Tutorial<\/a> as shown below, with some improvements, we think would be good, regarding &#8230;<\/p>\n<ul>\n<li>making its aesthetics more impactive &#8230; via <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronym.jpg\" title='getacronym.jpg'>background image<\/a> up the top, created by a combination of (Mac) Paintbrush and good ol&#8217; Gimp (you may want to refer to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=9389' title='Gimp Transparency Primer Tutorial'>Gimp Transparency Primer Tutorial<\/a> here) &#8230; the inspiration for which came from <a target=_blank href='http:\/\/abbreviations.yourdictionary.com\/articles\/common-accronyms.html' title='Common acronyms'>this link<\/a> and which set in play, for consistency&#8217;s sake, that if some of the more modern background image acronyms are used we should get a result, even if that acronym is not on the NaCTeM database, but not say they have a <i>&#8220;frequency&#8221;<\/i> nor <i>&#8220;since&#8221;<\/i> value (to differentiate them) &#8230; affecting &#8230;<\/li>\n<li>add to the functionality by allowing sorts on columns in the header fields &#8230; do you remember <a target=_blank title='jQuery Sortable Table Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=9094'>jQuery Sortable Table Primer Tutorial<\/a>? &#8230; we include this functionality &#8230; which meant that &#8230;<\/li>\n<li>all JSON parsing will now be handled by PHP (whether uppercase or lowercase), in this amended parent HTML you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html-GETME\" title='getacronymdata.htm'>getacronymdata.htm<\/a> calling  <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.php-GETME\" title='getacronymdata.php'>getacronymdata.php<\/a> (and the differences to yesterday&#8217;s can be found at <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html-GETME\" title='getacronymdata.htm'>getacronymdata.htm<\/a> and  <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.php-GETME\" title='getacronymdata.php'>getacronymdata.php<\/a>)\n<\/ul>\n<p>You may notice with the amended HTML that we made use of JavaScript <a target=_blank title='Window.open information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp'>&#8220;var w = window.open();&#8221;<\/a> (exactly) and JavaScript <a target=_blank title='Document.write information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_doc_write.asp'>&#8220;w.document.write([newHTMLviaPHP]);&#8221;<\/a> to have the jQuery Sortable Table logic happen at the web page&#8217;s onload event, where so much needs to go on, when you get into HTML and JavaScript usage, and where the interface of traditional JavaScript and jQuery means that you should not assume both &#8220;onload&#8221; logics will get a look in without testing this out for yourself.<\/p>\n<p>We&#8217;ve tagged this posting with <a target=_blank title='ESL' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=esl'>&#8220;ESL&#8221;<\/a> (because we leave it open to a teacher of English whether such a web application could become a resource for a good lesson about acronymns).  We think the increasing everyday use of acronyms in all walks of life maybe make it a necessary &#8220;getting by&#8221; lesson for English learners, but maybe not very early English learners.<\/p>\n<p>Hope you like the new web application that results at this <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/\" title='Click picture'>live run<\/a>.<\/p>\n<hr>\n<p id='alpt'>Previous relevant <a target=_blank title='Acronyms Lookup Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=14122'>Acronyms Lookup Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Acronyms Lookup Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.jpg\" title=\"Acronyms Lookup Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">Acronyms Lookup Primer Tutorial<\/p><\/div>\n<p>It&#8217;s good every now and then to see what is new in the world of data feeds on the internet, so that is how, via this <a target=_blank title='Great link for latest public feeds of interest' href='http:\/\/gearside.com\/public-json-feeds\/'>great link<\/a>, we got onto the wonderful Acronym lookup resource at <a target=_blank title='' href='http:\/\/www.nactem.ac.uk\/'>NaCTeM<\/a> (The National Centre for Text Mining) &#8230; thanks &#8230; <\/p>\n<blockquote><p>\nAcromine: Okazaki, N., Ananiadou, S. (2006) Building an abbreviation dictionary using a term recognition approach. Bioinformatics, Volume 22, Number 24, pp. 3089-3095, Oxford University Press\n<\/p><\/blockquote>\n<p>So this tutorial uses the data emanating from NaCTeM&#8217;s feed of Acronym data.  You fill in an Acronym of interest into an input text box and known results are sent back in JSON format.<\/p>\n<p>The two big PHP functions of use for JSON parsing are (normally):<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a><\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='getacronymdata.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html_GETME\">getacronymdata.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='getacronymdata.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.php_GETME\">getacronymdata.php<\/a><\/p>\n<p>Here are a few things you may find interesting about the code &#8230;<\/p>\n<ul>\n<li>the HTML calls the PHP via <a target=_blank title='jQuery Ajax' href='http:\/\/api.jquery.com\/jquery.ajax\/'>jQuery Ajax<\/a> (and avoids cross-domain issues by using local PHP)<\/li>\n<li>the HTML will parse the JSON callback data if it is a totally capitalised entry (using <a target=_blank title='JSON.parse() and general JSON information from w3schools' href='http:\/\/www.w3schools.com\/json\/json_eval.asp'>JSON.parse()<\/a>), else the PHP will do the JSON parsing<\/li>\n<li>we found the raw callback data needed the outer [] stripped to be JSON parsable<\/li>\n<\/ul>\n<p>So maybe you will find something interesting with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html\" title='Click picture'>live run<\/a>, and hope to see you tomorrow with improvements.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d14122' onclick='var dv=document.getElementById(\"d14122\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=JSON\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14122' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d14143' onclick='var dv=document.getElementById(\"d14143\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=ESL\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14143' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Wanted, today, to follow up on yesterday&#8217;s Acronyms Lookup Primer Tutorial as shown below, with some improvements, we think would be good, regarding &#8230; making its aesthetics more impactive &#8230; via background image up the top, created by a combination &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/acronyms-lookup-follow-up-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,12,13,14,16,37],"tags":[56,69,127,277,294,396,400,412,429,491,576,590,652,663,664,666,870,876,896,932,997,1174,1238,1302,1319,1357],"class_list":["post-14143","post","type-post","status-publish","format-standard","hentry","category-ajax","category-elearning","category-esl","category-event-driven-programming","category-gimp","category-tutorials","tag-acronym","tag-ajax","tag-background-image","tag-cross-domain","tag-data-mining","tag-esl","tag-event","tag-feed","tag-file_get_contents","tag-gimp","tag-html","tag-image","tag-javascript","tag-jquery","tag-json","tag-json_decode","tag-onload","tag-opacity","tag-paintbrush","tag-php","tag-programming","tag-sortable","tag-table","tag-transparency","tag-tutorial","tag-validate"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14143"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=14143"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14143\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=14143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=14143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=14143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}