Walking Trip …

Walking Trip

Walking Trip

Offenbach's Suite ... Warts 'n All

Offenbach's Suite ... Warts 'n All

If this was interesting you may be interested in this too.

Posted in Photography, Trips | Tagged , , | 34 Comments

Meeting Agenda Primer Tutorial

Meeting Agenda Primer Tutorial

Meeting Agenda Primer Tutorial

We’re returning to the concept of Meeting Agendas, like with Agenda Speech to Text to Speech LibreOffice Wizard Tutorial, but pared down this time.

We see agenda items needing an HTML table with columns …

  • Item Number (or #) … programmatically generated …
  • Description … user entered …
  • Moderator … user entered

… and we start with, regarding sharing (or collaboration) …

  • print …
  • email …
  • PDF

… for a first draft agenda_items.html live run we’d love for you to try yourself.


Previous relevant Agenda Speech to Text to Speech LibreOffice Wizard Tutorial is shown below.

Agenda Speech to Text to Speech LibreOffice Wizard Tutorial

Agenda Speech to Text to Speech LibreOffice Wizard Tutorial

We’re happy here, finally, to move onto a new concept with the “Speech to Text to Speech” web application blog posting thread, building on yesterday’s Curriculum Vitae Speech to Text to Speech Audio Prompting Tutorial using the recent …

  • Curriculum Vitae (concept) logic … as the basis for a new …
  • Agenda (concept) … an HTML “template” of which is derived from a LibreOffice Wizard Template

In case we can genericize for a user “owned” additional concept (at a later date), we take careful note of what we have to do to achieve this “by hand”. We’ll see.

Along the way we changed a couple of things …

  • on a rudimentary call of the web application, on non-mobile platforms, our top (HTML select) dropdown is made to have the size of the number of option “subelements”, so that that non-mobile user can see all the functionality available as they enter the web application
  • for Surveys and Business Letter template and Curriculum Vitae and now Agenda templates we were annoyed by how when there are lots of questions for the user to answer, it went below the fold of the screen eventually, an annoyance self created by the coding of <br> linefeeds after input type=text elements that are removed now, but put back in front of the span elements when they are all reshown again at the end of the form “asking” … the [element].style.display=’none’ DOM statements were good though, rather than [element].style.visibility=’hidden’ DOM statements applied to form elements just answered, as the latter leaves whitespace while the former collapses that whitespace

Let’s talk about this Agenda template created via a Wizard at LibreOffice, thanks again. As you can see from the …

sequence of dialog boxes that lead the user through a series of well-defined steps

… the LibreOffice Wizard alone will suit a lot of people’s purposes for this Agenda meeting concept via a desktop application. The difference with our web application, though, is that it is “web” transportable with how (and where) you could use this functionality.

The agenda concept hosting changed PHP code of speech_supervisor.php can, again, be tried out at this generic live run link, or this Agenda live run.


Previous relevant Curriculum Vitae Speech to Text to Speech Audio Prompting Tutorial is shown below.

Curriculum Vitae Speech to Text to Speech Audio Prompting Tutorial

Curriculum Vitae Speech to Text to Speech Audio Prompting Tutorial

Do you remember with yesterday’s Curriculum Vitae Speech to Text to Speech Uploaded Prompting Tutorial how we presented a YouTube video means of catering for some automated audio prompting with our Curriculum Vitae web application following our “subdream” of …

  • not having the user to have to lift their head but just dictating all their answers … or …
  • not having the user to have to lift their head but just typing in all their answers

… and that the other choice in these “uploaded” inhouse content ideas is today’s interfacing “subproject” … and we present this posting courtesy of our “yellow submarine” room … tee, hee

  1. audio (or video) content, for us, uploaded to the rjmprogramming.com.au website … and …
  2. YouTube video with an audio track uploaded to YouTube which we access via the excellent YouTube embedded iframe API

For audio (or video) content we can use an (s)ftp file transfer desktop application like FileZilla to perform the uploading of the media files, which we create on Mac OS X’s very useful QuickTime Player desktop application. We are forever using its great Screen Capture functionality, and with this work we combine that with separate Audio Capture sessions that become audio clips added onto the Screen Capture via QuickTime Player’s …


Edit -> Add Clip

… option. But those audio clips can also sit alone as an *.m4a file (we called cvtalk.m4a) sitting on the rjmprogramming.com.au web server, and though we could use that media in an audio HTML element, as below …

Audio Prompting for Curriculum Vitae

… we prefer to have “less baggage” around today to try to limit “focus clashes” and so make use of the Javascript “Audio” object to work these audio promptings for our Curriculum Vitae web application. As for yesterday, we use caption subtitles files to determine when (and where) to start and stop the audio, where, if these are called [start] and [end] (values in seconds), the broad brush approach to playing the audio prompt is …


var mediao = new Audio('cvtalk.m4a'); // initialize Audio object in global variable

function medias() {
if (mediao) {
mediao.pause();
}
}

// When called on to play a particular audio prompting, and have plucked out from the global array the relevant [start] and [end] values
mediao.currentTime = [start];
mediao.play();
setTimeout(medias, Math.floor(eval(eval([end] - [start]) * 1000)));

We now have three types of automated audio prompting choices, in priority usage …

  • Mac OS X say Speech to Text (via MAMP local Apache/PHP/MySql web server)
  • Audio (or Video) on rjmprogramming.com.au website
  • YouTube Video on YouTube

… and so, now, we need to have a mechanism to offer the user the offer to refuse this service, and if they do, it could be that they wanted to use a different “mode of service”, and so we now offer a new HTML select element (dropdown) to allow for that possibility.

And, again, we have today’s uploaded prompting (audio and video) media content ideas, augmenting a default preferred (but rare) Mac OS X MAMP say idea, hosting changed PHP code of speech_supervisor.php can, yet again, be tried out at this generic live run link, or this Curriculum Vitae live run.


Previous relevant Curriculum Vitae Speech to Text to Speech Uploaded Prompting Tutorial is shown below.

Curriculum Vitae Speech to Text to Speech Uploaded Prompting Tutorial

Curriculum Vitae Speech to Text to Speech Uploaded Prompting Tutorial

Yesterday’s Curriculum Vitae Speech to Text to Speech Prompting Tutorial was about a generic automated prompting solution, but was suited to a relatively small audience, alas. The other choice here is to make your own audio content that you upload, two options for which we can think of being …

  1. audio (or video) content, for us, uploaded to the rjmprogramming.com.au website (which we’ll talk more about soon) … and …
  2. YouTube video with an audio track uploaded to YouTube which we access via the excellent YouTube embedded iframe API

But how do we tell the interface we have where to start and stop the video? We construct one of those caption subtitles files, the same one you can see in play below with this YouTube video that we constructed, uploaded, and use for users constructing a Curriculum Vitae and saying they would not mind some prompting …

There are two approaches here with piecing together the media …

    • create an audio track (and we use Mac OS X QuickTime Player for all this) and take a note of its length … then (like we did for the YouTube video above) …
    • create a screen capture video of that same length
    • Add the Clip of the audio to the end of the video and upload to YouTube

    • create a screen capture video of the actions to create a Curriculum Vitae
    • create an audio track (and we use Mac OS X QuickTime Player for all this) while playing that screen capture video back to yourself … then …
    • Add the Clip of the audio to the end of the video and upload to YouTube … as per …

    Adding to yesterday’s Curriculum Vitae Speech to Text to Speech Internationalization Tutorial we have today’s uploaded prompting media content ideas hosting changed PHP code of speech_supervisor.php can, yet again, be tried out at this generic live run link, or this Curriculum Vitae live run.


    Previous relevant Curriculum Vitae Speech to Text to Speech Prompting Tutorial is shown below.

    Curriculum Vitae Speech to Text to Speech Prompting Tutorial

    Curriculum Vitae Speech to Text to Speech Prompting Tutorial

    Regulars to this current blog posting thread on the theme of “Speech to Text to Speech” will know …

    We still have a “dream” in this line of thinking to develop a user friendly enough form filling (web application) aid.

    … but may not know that we also have a “subdream” of (attempting to) getting it so that one or other of …

    • not having the user to have to lift their head but just dictating all their answers … or …
    • not having the user to have to lift their head but just typing in all their answers

    … except perhaps for button presses … can be achieved. We’re not sure here whether this can be achieved, but we do know of a thing we need to do for sure to even get an inkling of a notion on the way to attempting to achieve this “subdream”, that being …


    "we need to be able to use an automated Text to Speech mechanism to have the web application say the words of the prompts to Curriculum Vitae or Survey questions"

    … because only then can we not lift our heads either from looking straight ahead (for Speech to Text dictations) or looking down at a textbox on the screen (for no Speech to Text dictations) during the “prompting phase” of these web applications. Why bother? As much as for “it might make the web application very beneficial”, we would say also that you learn a lot trying.

    Can tell you even before starting on the missing piece to the “jigsaw” that the biggest problem, as often is the case with web applications made up of many components, you run out of timing places to have the “focus” of the webpage being at the correct spot, at any given time. It is the “Speech to Text” bit that is most sensitive here, as well as the fact that a curious thing we know of already, to our amusement, is that the “Speech to Text” can pick up with the microphone words other than the ones the user uttered, like from a radio or television, but not Nala’s woof?! And now we are introducing a new idea where the speakers of the device or computer are bound to be picked up by that same device or computer’s microphone, surely. Well, first off … please don’t call me Shirley … and we’ll see what we end up with here, rather than worrying about every detail now, though think earphones (or headphones) may be one thought.

    Our first idea of a few, today, regarding “not lifting heads” is for those …

    • Mac OS X
    • MAMP (local Apache/PHP/MySql)

    … afficianados out there. Yes, we are intrigued by that internet/intranet type of feeling of combining a “public domain/MAMP local web server” “parent/popup child” scenario that we got into a bit with the blog posting thread headed by Zipfiles in PHP Media Gallery Synchronize Tutorial, and which we are “channelling” today, to the extent that its web application is called as an HTML “iframe child” of our parent web application today, to detect the existence of the two conditions above as to whether to “attempt” the automated “Text to Speech Prompting” we are after. Why “attempted” in double quotes? Well, on the internet, it is rude not to give forewarning of the computer speakers being brought into play without the user’s consent … it’s just a good thing to allow the user to refuse this functionality, if that’s their wish.

    In that aforesaidmentioned blog posting thread you will hear mentioned the wonderful Mac OS X command line say command … say no more… chortle,chortle.

    So, continuing on from yesterday’s Curriculum Vitae Speech to Text to Speech Internationalization Tutorial we have today’s Mac OS X/MAMP “say” Text to Speech ideas hosting changed PHP code of speech_supervisor.php can, yet again, be tried out at this generic live run link, or this Curriculum Vitae live run. You may recall the say.php which has a “popup child” relationship here.


    Previous relevant Curriculum Vitae Speech to Text to Speech Internationalization Tutorial is shown below.

    Curriculum Vitae Speech to Text to Speech Internationalization Tutorial

    Curriculum Vitae Speech to Text to Speech Internationalization Tutorial

    The modifications of yesterday’s Curriculum Vitae Speech to Text to Speech LibreOffice Tutorial all had a good generic feel to them, but something was definitely missing. Is it too late to ask you to close your eyes and not read the blog posting title? It’s “internationalization” issues, regarding language.

    Language “internationalization” is pretty important, especially for a Curriculum Vitae application. What’s the point of writing a Curriculum Vitae in a language not suited to the people who are meant to read it. Up to now, though, our inhouse addons to the Google

    … already cater for this language “internationalization” very well already, and we feel that we should try our hardest to continue on that sentiment with the “inhouse” work.

    Working from the end result objectives back and through we need to …

    • organize webpage structure via good advice of this link, thanks …

      <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      ...

      … except that the “en” is English and we want to allow for other two letter language codes the user can choose from the lower middle cell language dropdown (but please allow for translations by doing this before changing any upper middle cell language dropdown)
    • on body element define a dir=”auto” to try to cater for languages whose text is designed to run right to left
    • we use the same codebase for many “layers” of navigation, and throughout that in all ($_GET[]) web browser address bar URLs and ($_POST[]) method=POST forms, we need to be passing any language code information selected by the user along to any webpages which follow all the way through to the end report, such as a Curriculum Vitae report (or document)
    • hardest of all for today, we need to, for the …

      new mechanism to allow a template prompt be a form field default value (that we make happen for the Curriculum Vitae header sectional texts) when a space character preceeds the final &gt; end delimiter

      intervene at the point with PHP code where we define a default textbox field value …

      function ourstr_replace($froms, $tos, $tstr) {
      global $qqhval;
      $lc="";
      $prevlc="";
      if ($tstr == "") return $tstr;
      $rs=str_replace($froms, $tos, $tstr);
      $xrs=substr($rs,0,1);
      $lc=$xrs;
      for ($ir=1; $ir<strlen($rs); $ir++) {
      if (substr(($rs . " "),$ir,2) == "of") {
      if (substr($rs,(-1 + $ir),1) >= '0' && substr($rs,(-1 + $ir),1) <= '9') $xrs.=" ";
      } else if (substr($rs,$ir,1) >= '0' && substr($rs,$ir,1) <= '9') {
      if (substr($rs,(-1 + $ir),1) == 'f') $xrs.=" ";
      } else if (substr($rs,$ir,1) >= 'A' && substr($rs,$ir,1) <= 'Z') {
      if (substr($rs,(-1 + $ir),1) != ' ') $xrs.=" ";
      }
      $prevlc=$lc;
      $lc=substr($rs,$ir,1);
      $xrs.=substr($rs,$ir,1);
      }
      if ($lc == " ") {
      if ($prevlc == " ") {
      $qqhval=$qqhval; // more to do
      }
      $qqhval=lookup(str_replace("Translation for English word ","",str_replace("Translation for English words ","",$xrs))); //substr($xrs,0,(strlen($xrs) - 1));
      }
      return $xrs;
      }

      … and then bring into play the incredible MyMemory API translations (returning JSON data, by default), thanks, via …



      function lookup($ptoobig) {
      global $langcode;
      $mymc="";
      if (str_replace("en","",$langcode) != '' && strlen(trim($ptoobig)) > 0) {
      $pokay=trim($ptoobig);
      $purl="HTTP://api.mymemory.translated.net/get?q=" . str_replace("+","%20",urlencode($pokay)) . "&langpair=en|" . $langcode;
      // HTTP://api.mymemory.translated.net/get?q=Hello%20World!&langpair=en|it#Ciao Mondo!
      // {"responseData":{"translatedText":"Ciao Mondo!","match":1},"quotaFinished":false,"responseDetails":"","responseStatus":200,"responderId":"242","exception_code":null,"matches":[{"id":"562784765","segment":"Hello World!","translation":"Ciao Mondo!","quality":"74","reference":null,"usage-count":97,"subject":"All","created-by":"MateCat","last-updated-by":"MateCat","create-date":"2018-05-24 22:32:33","last-update-date":"2018-05-24 22:32:33","match":1}]}
      if (file_exists("mym.txt")) $mymc=file_get_contents("mym.txt");
      $findings=explode($purl, $mymc);
      if (sizeof($findings) > 1) {
      if (strlen(explode("\n", $findings[1])[0]) <= 1) {
      return $ptoobig;
      } else {
      return html_entity_decode(str_replace('\u','&#x',substr(explode("\n", $findings[1])[0],1)), ENT_QUOTES, "UTF-8") . " ";
      }
      } else {
      $thisf=str_replace(" "," ",file_get_contents($purl));
      if (strpos($thisf, "responseData") !== false) {
      $fndis=false;
      if (strpos(strtolower($thisf), '"segment":"' . strtolower(trim($ptoobig)) . '","translation":"' . strtolower(trim($ptoobig)) . '"') !== false) {
      if (strpos($thisf, '"segment":"' . strtoupper(trim($ptoobig)) . '","translation":"' . strtoupper(trim($ptoobig)) . '"') !== false) {
      $fndis=false;
      } else {
      $fndis=true;
      file_put_contents("mym.txt", $mymc . $purl . "#" . trim($ptoobig) . "\n");
      return $ptoobig;
      }
      }
      if (!$fndis) {
      if (strpos($thisf, '{"translatedText":"') !== false) {
      file_put_contents("mym.txt", $mymc . $purl . "#" . explode('"', explode('{"translatedText":"', $thisf)[1])[0] . "\n");
      return html_entity_decode(str_replace('\u','&#x',explode('"', explode('{"translatedText":"', $thisf)[1])[0]), ENT_QUOTES, "UTF-8") . " ";
      } else if (strpos(strtolower($thisf), '"segment":"' . strtolower(trim($ptoobig)) . '","translation":"') !== false) {
      $fndat=strrpos(strtolower($thisf), '"segment":"' . strtolower(trim($ptoobig)) . '","translation":"') + strlen('"segment":"' . strtolower(trim($ptoobig)) . '","translation":"');
      file_put_contents("mym.txt", $mymc . $purl . "#" . explode('"', substr($thisf, $fndat))[0] . "\n");
      return html_entity_decode(str_replace('\u','&#x',explode('"', substr($thisf, $fndat))[0]), ENT_QUOTES, "UTF-8") . " ";
      } else {
      file_put_contents("mym.txt", $mymc . $purl . "\n");
      return $ptoobig;
      }
      }
      } else {
      return $ptoobig;
      }
      }
      }
      return $ptoobig;
      }

    On a whole other level the Google Chrome web browser has an inbuilt translation ability, which users may prefer.

    Today’s language “internationalization” improved functionality hosting changed PHP code of speech_supervisor.php can, yet again, be tried out at this generic live run link, or this Curriculum Vitae live run to pick the new Curriculum Vitae dropdown option, perhaps after first picking a language code from the language code dropdown below it, allowing for those potential translations to be automated into the form default textbox field values.


    Previous relevant Curriculum Vitae Speech to Text to Speech LibreOffice Tutorial is shown below.

    Curriculum Vitae Speech to Text to Speech LibreOffice Tutorial

    Curriculum Vitae Speech to Text to Speech LibreOffice Tutorial

    We started on a Curriculum Vitae (via LibreOffice template) yesterday with Curriculum Vitae Speech to Text LibreOffice Tutorial and today’s work is “consolidation” before adding any new functionality as such, because we saw improvements galore that could improve what we had as of yesterday.

    Today, as you can see a lot of on today’s tutorial picture, we …

    • when in the Survey and Curriculum Vitae options we used to lose the chance to select other options from the main HTML select element dropdown, and that is fixed today
    • the prompts no longer show underscores
    • so user can get help with, or hear via Text to Speech, the user can now select a language of choice from the language dropdown, and do any of …
      1. onhover (ie. onmouseover)
      2. onclick
      3. have separate window open on arrival of new prompt (as designated by user) … of …

      Google Translate window that often has Text to Speech capabilities

    • better focus to prompt textboxes of forms both as an alternative in Google Chrome, and/or “as the main game” for other web browser types
    • add onblur logic on prompt textboxes of forms enforce at least space and/or some change to a default value, to allow this prompt textbox keyboard entry be accepted as a final value for this Curriculum Vitae or Survey form field value
    • new mechanism to allow a template prompt be a form field default value (that we make happen for the Curriculum Vitae header sectional texts) when a space character preceeds the final &gt; end delimiter
    • flag to user the way they can enter <br> within prompt textboxes for multiline data entries, via the prompt textboxes onhover (ie. onmouseover) induced title property
    • allow for two types of email ideas …
      1. email the link to a Curriculum Vitae form to fill out to an emailee via the local email client program via an a mailto: email link
      2. email the resultant Curriculum Vitae report (or document) via PHP mail methodology using an HTML email attachment

    No doubt you can think of some improvements too?!

    Today’s “LibreOffice Template” Curriculum Vitae (and Survey) improved functionality hosting changed PHP code of speech_supervisor.php can, again, be tried out at this generic live run link, or this Curriculum Vitae live run to pick the new Curriculum Vitae dropdown option.


    Previous relevant Curriculum Vitae Speech to Text LibreOffice Tutorial is shown below.

    Curriculum Vitae Speech to Text LibreOffice Tutorial

    Curriculum Vitae Speech to Text LibreOffice Tutorial

    With the recent Speech to Text LibreOffice Template Tutorial we opined …

    We still have a “dream” in this line of thinking to develop a user friendly enough form filling (web application) aid.

    Are we there yet? We’re getting there.

    Today’s work on a simple Curriculum Vitae takes a …

    • LibreOffice template Curriculum Vitae (thanks) …
    • Save As… HTML Document (Writer) (.html) … and new to today’s Curriculum Vitae template …
    • Amend that HTML to add in our own &lt;Parameter Label&gt; … and new today …
    • Add more &lt;Parameter Label&gt; entries allowing for CSS overrides, using for the first time, an HTML textarea (form) element (for a multi-line text entry), entered by the user, optionally changing the default LibreOffice Curriculum Vitae template styling … but as per a lot of the other additions of functionality …
    • We add an HTML select (dropdown) element option to go directly to the user defined &lt;Parameter Label&gt; value definitions … ready for the coalescing at the usual …
    • A report button click/touch shows a webpage Curriculum Vitae resultant report (a fair bit like a form, today)

    And so today’s “LibreOffice Template” functionality hosting changed PHP code of speech_supervisor.php can be tried out at this generic live run link, or this Curriculum Vitae live run to pick the new Curriculum Vitae dropdown option. On the Google Chrome web browser you could be dictating your Curriculum Vitae in no time!


    Previous relevant Speech to Text LibreOffice Template Tutorial is shown below.

    Speech to Text LibreOffice Template Tutorial

    Speech to Text LibreOffice Template Tutorial

    If you like interpretive computer languages, or “substitutional” type thinking, you would gravitate towards templates. Templates in Word Processing circles, in LibreOffice circles to be precise, which are the circles apt to today’s work, are designed to contain a lot of the donkey work associated with a “thematic document”, like today’s “Business Letter” featured in today’s tutorial picture. Those templates then form the basis for final documents that “plug in” real data where the template has sought to parameterize its data, the LibreOffice (New->Template Save As… HTML Document (Writer) (.html)) via …


    &lt;Parameter Label&gt;

    Yesterday’s Speech to Text Hangman Game Tutorial was good preparation for today, but the real synergies lie with the previous Speech to Text Survey Tutorial as this “LibreOffice Template” side to the story is that “Survey” side to the story but …

    • with the “Label=Value” paradigm we can deduce the “Label” bits from the LibreOffice template rather than having to ask an administrator user to define … and then when executing the …
    • report uses the LibreOffice template (that has parameter substitutions run over it) as its basis rather than a generated HTML table that is populated

    … and so the user can add a URL to a LibreOffice Template “HTML Document (Writer) (.html)” to flag this difference in functionality after selecting the newly named …


    Survey or LibreOffice Template

    … HTML select element option. We hope you can see how time saving this template usage could be for you. We still have a “dream” in this line of thinking to develop a user friendly enough form filling (web application) aid.

    Today’s “LibreOffice Template” functionality hosting changed PHP code of speech_supervisor.php can be tried out at this live run link.


    Previous relevant Speech to Text Hangman Game Tutorial is shown below.

    Speech to Text Hangman Game Tutorial

    Speech to Text Hangman Game Tutorial

    ESL students can also benefit from forms of learning that are games, and yesterday’s Speech to Text Vocabulary Phrases Tutorial‘s new option to our Google Speech to Text API series of web application functionalities lends itself to an extension of that with a “spelling” component in the form of the popular “Hangman” game many families and school students are likely to know quite well.

    With “Hangman” we want to involve two players, one taking on the web application’s choice of English phrase to solve, and deciding whether to pass on a hint, or not to the other player trying to solve the English phrase letter by letter. Scoring-wise that second player’s score improves if the player solves it before the “noose” comes into play, else the score is reduced by the length of the English phrase involved.

    So what was involved?

    • map tag creation, thanks to the great mobilefish
    • the area tag to div overlay position:absolute ideas as also presented with Very Versus Too Game Primer Tutorial help with initial masking of image parts, before later making that mask have a transparent colour, as a player picks a letter that does not appear in the English phrase attempting to be solved …

      function areatodiv() {
      var areas=document.getElementsByTagName('area'), coordsare=[];
      for (var i=0; i<areas.length; i++) {
      if (('' + areas[i].coords).indexOf(',') != -1) {
      coordsare=areas[i].coords.split(',');
      document.body.innerHTML += "<div onclick=\" document.getElementById(this.id.replace('div','i')).style.zIndex='11'; this.style.zIndex='-9'; this.style.display='transparent';\" id='div" + eval(i + 1) + "' style='border:0px solid red;overflow:hidden;display:block;z-index:3;position:absolute;left:" + eval(-2 + eval(coordsare[0])) + ";top:" + eval(-2 + eval(coordsare[1])) + ";width:" + eval(12 + eval(coordsare[2]) - eval(coordsare[0])) + ";height:" + eval(12 + eval(coordsare[3]) - eval(coordsare[1])) + ";background-color:white;'></div>";
      }
      }
      if (document.URL.indexOf('tosolve=') != -1) {
      ts = location.search.split('tosolve=')[1] ? decodeURIComponent(location.search.split('tosolve=')[1].split('&')[0]) : '';
      cp = location.search.split('curplayer=')[1] ? decodeURIComponent(location.search.split('curplayer=')[1].split('&')[0]) : '1';
      var cl = location.search.split('clue=')[1] ? decodeURIComponent(location.search.split('clue=')[1].split('&')[0]) : '';
      if (ts == '' || !parent.document.getElementById('score') || !parent.document.getElementById('shangman')) {
      doclick();
      } else {
      hscores[0]=eval(parent.document.getElementById('score').innerHTML.replace('Score:','').replace('/',',').replace(' ','').split(',')[0]);
      hscores[1]=eval(parent.document.getElementById('score').innerHTML.replace('Score:','').replace('/',',').replace(' ','').split(',')[1]);
      if (cl != '') {
      document.getElementById('clues').innerHTML='Hint: ' + cl;
      } else {
      document.getElementById('clues').innerHTML=cl;
      }
      document.getElementById('divs').setAttribute('data-title', ts);
      for (var ii=0; ii<ts.length; ii++) {
      thisc=ts.substring(ii,eval(1 + ii));
      if (thisc.toLowerCase() >= 'a' && thisc.toLowerCase() <= 'z') {
      thisc='_';
      }
      document.getElementById('divs').innerHTML+=thisc;
      }
      document.getElementById('divs').style.display='block';
      document.getElementById('clues').style.display='block';
      document.getElementById('sels').style.display='block';
      ihsels=document.getElementById('sels').innerHTML;
      }
      } else {
      doclick();
      }
      }

      … as called at the document.body onload event
    • the player letter selection is via an HTML select element size=27 (on non-mobile, so that the player sees all the choices at once)
    • duplicate choices, as we so often do, are quietly rejected via a comparison of the player choice against a global variable we often call “sofar” which is appended by new letter selections
    • additional “final slide” (far too gory to go into) presented when things go wrong

    Today’s “Hangman” game hosting changed PHP code of speech_supervisor.php can be tried out at this Hangman Game mode live run link (or you can use the default live run link), which we hope you or someone you know will try out. The new child HTML iframe code is hangman_bg.html for your perusal.


    Previous relevant Speech to Text Vocabulary Phrases Tutorial is shown below.

    Speech to Text Vocabulary Phrases Tutorial

    Speech to Text Vocabulary Phrases Tutorial

    ESL students can struggle with English Phrases and Idioms, and with that in mind we channel the ideas of the previous English Phrase Guessing Game Primer Tutorial on top of the previous build up from Speech to Text to Speech Tutorial to add a new option called “Vocabulary Phrases” to our Dropdown List of functionality making use of the great Google Speech to Text API.

    But it’s not just pronunciation of the “Vocabulary Phrases” that is of interest here, which the Google Chrome web browser microphone based Google Speech to Text API can be helpful for. Learners of English can be baffled by the completely different meaning of a phrase that can sometimes only have a tenuous connection with the meanings of the individual words making it up. In order to help here we add …

    • “pick another phrase” button … can mean “give up” and/or “life is too short”
    • “look for more information about the phrase” link to … you guessed it … the Google search engine result set … thanks
    • ways for the user to control …
      1. Minimum phrase length
      2. Maximum phrase length
      3. Maximum length of any one word of the phrase

    Today’s “Vocabulary Phrases” changed PHP code of speech_supervisor.php can be tried out at this Vocabulary Phrases mode live run link (or you can use the default live run link), which we hope you or someone you know will find useful.


    Previous relevant Speech to Text to Speech Tutorial is shown below.

    Speech to Text to Speech Tutorial

    Speech to Text to Speech Tutorial

    It’s ESL thoughts back at the top of our thinking today building on yesterday’s Speech to Text Hierarchy Tutorial. We’re going the full circle today, improving on what we have already as far as an ESL learner might be concerned (or perhaps other users too) allowing the user the ability to …


    hear it back

    … via the brilliant Google Translate and its “Text to Speech” capabilities. Hence, “Speech to Text to Speech” in today’s blog posting title.

    We see a twofold advantage here, in that …

    • if a user doesn’t have the foggiest what is going on, they can select a language, and have the middle table cell question (or answer) be translated from English, for themselves … and …
    • in the Google Chrome web browser incarnation, they may answer something and see the transcription happen, and then “hear that (transcription) back”

    … that latter functionality could highlight pronunciation weaknesses, perhaps. Not that we are saying this replaces talking to an active speaker of the language you want to learn, but sometimes there’s just no one about that speaks that language. I’ve tried talking to Nala, but she’s far too dogmatic … boom, boom … though think she might be practising Dalmation out the back of an evening.

    What’s the new mechanism to make this happen? A new HTML select element dropdown of languages is show in the middle table cell, augmenting the Google Speech to Text API language dropdowns, that if populated with a “language of interest” value then looks to either/both …

    • middle table cell question (or answer) … and/or …
    • contents of left (or perhaps right) table cells

    … as the wording to be submitted to Google Translate for translation, in a new window. As you may have seen before if you’ve used Google Translate, once there doing a translation, oftentimes you will be offered a loudspeaker icon on either side of the translation to hear a voice say the words in that language, with the accent of a native speaker (though computerlike).

    Today’s “hearing it back” changed PHP code of speech_supervisor.php can be tried out at this live run link, which we hope you find useful.


    Previous relevant Speech to Text Hierarchy Tutorial is shown below.

    Speech to Text Hierarchy Tutorial

    Speech to Text Hierarchy Tutorial

    Are you amazed like me at how computer software can eventually be boiled down to the difference between …

    • 1
    • 0

    … call it what you will … yes versus notrue versus false (boolean values) … on versus offthe “binary” design?

    If you have the patience, you can break really complex decision making (that you might model with a flow chart) via “yes” versus “no” binary decisions, based on the right questions to ask. And that is what we are doing today, recalling that earlier presented HTML/Javascript Animal Categorization Tutorial to Categorize Animals based on questions.

    As you answer these questions, all effectively “yes” versus “no” ones, you are breaking into the animal kingdom categorization hierarchy to identify an animal of interest you are interested in categorizing. As computers do, no imagination here, but they break the problems they are presented with into “binary” decisions, to get down to the fundamentals of it all.

    And the “yes” and “no” of various languages are just about the most important words for artificial intelligence systems to recognize, so with this in mind, we thought it a good fit to use the right hand cell to open that previous Animal Categorization web application in its own HTML “child” iframe to supply the “parent” with the questions that flow through it and on up to the “parent” where, if using Google Chrome web browser, a “yes” versus “no” spoken answer may return to the “child” for further “hierarchical tunnelling”.

    The changes needed for the “child” iframe web application HTML and Javascript logic revolved around its usage of the “perfect fit” …


    confirm(questionPrompt); // returns true for OK button press and false for Cancel button press

    … “true” and “false” function. But today, because Javascript does not have a sleep function, we needed to add a third return value that we decide to be blank (ie. string “”). Trouble with this is that “” equates to false by Javascript, so in our modified …


    function ourconfirm(prom) {
    var wo=null;
    if (parent.document) {
    if (parent.document.getElementById('divac')) {
    if (parent.document.getElementById('divac').innerHTML == '') {
    parent.document.getElementById('divac').innerHTML=prom.replace('(OK is yes, Cancel is no)','');
    if (parent.document.getElementById('sq')) {
    parent.document.getElementById('sq').innerHTML='<b>' + parent.document.getElementById('divac').innerHTML + '</b><br><br>';
    }
    return "";
    } else if (parent.document.getElementById('divac').innerHTML.toLowerCase() == 'yes') {
    parent.document.getElementById('divac').innerHTML = '';
    return 'true';
    } else if (parent.document.getElementById('divac').innerHTML.toLowerCase() == 'no') {
    parent.document.getElementById('divac').innerHTML = '';
    return 'false';
    } else {
    return "";
    }
    } else {
    var cr = confirm(prom);
    if (cr == true) return 'true';
    return 'false';
    }
    } else {
    var crr = confirm(prom);
    if (crr == true) return 'true';
    return 'false';
    }
    }

    … the true and false boolean values become string returns … called, as per our example code snippet, in this changed way


    if (flat_bodied == "") var flat_bodied = ourconfirm(stuff_outside_caret(document.getElementById('flat_bodied').innerHTML));
    if (flat_bodied == "") { setTimeout(animal_categorize,5000); return; } else if (flat_bodied == 'true') {
    type_animal = stuff_outside_caret(document.getElementById("flatworm").innerHTML);
    } else {
    type_animal = stuff_outside_caret(document.getElementById("worm_leech").innerHTML);
    }

    … converting many local variables into global variables, as per this declaration above now (declared) up near the top of the Javascript …


    var flat_bodied = ""; // ourconfirm(stuff_outside_caret(document.getElementById('flat_bodied').innerHTML));

    … in today’s changed HTML and Javascript code of animal_categorization.html.

    Adding a new “Animal Categorization” HTML select element (dropdown) option onto yesterday’s Speech to Text Survey Tutorial for today’s changed PHP code of speech_supervisor.php, you can be trying this out at this live run link.


    Previous relevant Speech to Text Survey Tutorial is shown below.

    Speech to Text Survey Tutorial

    Speech to Text Survey Tutorial

    On top of yesterday’s Speech to Text ESL Tutorial we add, for the first time, a “Survey” functionality not needing a two player setup. This leaves the right hand table cell to be able to contain an HTML form element, used to “survey” the user on the survey questions you set up when selecting a new “Survey” HTML select element (dropdown) option.

    And so this is where our language of design, PHP, comes to the fore, as a useful language to process the potential for huge amounts of data related to the survey you design.

    We design the web application “Survey” component, so as to be able to email off either/both …

    • survey form as an HTML email attachment via the PHP mail method
    • survey form results as an HTML email link via an a mailto: link to the default email client application of the user

    PHP has it over HTML …

    • creating email as per the first option above … and …
    • being able to post process method=POST data from an HTML form element, where much more data can be handled

    This new functionality can be accessed via an option of the dropdown of this live run link, or a “cut to the chase” survey link for today’s changed PHP code of speech_supervisor.php.


    Previous relevant Speech to Text ESL Tutorial is shown below.

    Speech to Text ESL Tutorial

    Speech to Text ESL Tutorial

    When you involve audio input into a web application it is likely that that web application can become useful with learning a language, such as with ESL (English as a second or foreign language) usage, especially as such learning has …

    • spoken
    • reading
    • writing

    … components to it. As you would appreciate, once the learner is speaking and then that (spoken content) is written out (as a transcript), and the learner is then reading that content, the web application can be a “double whammy” effective learning tool.

    We extend the web application’s functionality from yesterday’s Speech to Text Primer Tutorial using a technique we often use, that being changing the original (guinea pig usage) word “Quiz” into it plus other options presented in a …

    • HTML select (dropdown) element … as per HTML “onload” event …

      <body onload="document.getElementById('preq').innerHTML=dds('Quiz'); document.getElementById('kb').focus(); pickq();">

      … call of the Javascript …

      function dds(qwhat) {
      var selbit="<select id=selbit onchange=' location.href=document.URL.split(\"#\")[0].split(\"?\")[0] + \"?mode=\" + this.value; '><option value=0>" + modes[0] + "</option></select>";
      for (var iselbit=1; iselbit<modes.length; iselbit++) {
      if (mode == iselbit) {
      selbit=selbit.replace("</select>", "<option value=" + iselbit + " selected>" + modes[iselbit] + "</option></select>");
      } else {
      selbit=selbit.replace("</select>", "<option value=" + iselbit + ">" + modes[iselbit] + "</option></select>");
      }
      }
      return qwhat.replace('Quiz',selbit);
      }


      … that sets off onchange event logic to …

    • reload the webpage with a URL ?mode= argument flagging this that is …
    • detected via

      var mode=location.search.split('mode=')[1] ? eval(decodeURIComponent(location.search.split('mode=')[1].split('&')[0])) : 0;
      var modes=["Quiz","Tongue Twisters","Haiku"];
      var arraynames=["questions","tongue_twisters","haiku"];
      var delims=["?","~","`"];
      var bcols=["yellow","lightgreen","lightblue"];

      … enabling, as necessary the …
    • “mapping” of other usage arrays (we are responsible for garnering) onto the original (guinea pig) array “questions” (within “dds” function above) via

      if (mode != 0) {
      eval(arraynames[0] + "=" + arraynames[mode]);

      document.getElementById('tdm').style.backgroundColor=bcols[mode];
      }

    That leaves, apart from the extra content duties, a new scoring mechanism, one new one of which analyzes question words against answer words and scores positive word length score components for answer words found in question words and negative word length score components for question words not found in answer words.

    Again, feel free to have a look at today’s changed PHP code of speech_supervisor.php‘s “Speaking Quiz plus ESL Others”.


    Previous relevant Speech to Text Primer Tutorial is shown below.

    Speech to Text Primer Tutorial

    Speech to Text Primer Tutorial

    There was some great advice that had us dipping our toes into “Speech to Text” web application thoughts. You probably know yourself about the brilliant Google Translate and its “Text to Speech’ capabilities (or read some of our postings here such as Italian French Spanish Verb Conjugation Text to Speech Tutorial)? Well, it’s Google again supplying the brilliance for the obverse ideas used today in our “Speaking Quiz” web application idea.

    “Speaking”, that is, if you are using a recent enough version of the Google Chrome web browser, some HTML aspects of which are eloquently explained by this very useful link utilizing the wonderful Google Speech to Text API.

    If you are interested in “Speech to Text” you should also check out the very interesting Diagflow … Speech to Text.

    Thanks everyone, for these artificial intelligence “dipping our toes” encouragement. Feel free to have a look at today’s PHP code of speech_supervisor.php‘s “Speaking Quiz”.


    Previous relevant Italian French Spanish Verb Conjugation Text to Speech Tutorial is shown below.

    Italian French Spanish Verb Conjugation Text to Speech Tutorial

    Italian French Spanish Verb Conjugation Text to Speech Tutorial

    In following up on Italian and French and Spanish Verb Conjugation Event Tutorial as shown below we’ve increased functionality of English translations by adding Google Translate Text to Speech capabilities to …

    • Italian
    • French
    • Spanish

    … via a new “loudspeaker” icon.

    Some of the talking points with today’s changes involve …

    • a “reveal” idea whereby the showing of an HTML element is controlled by its Javascript DOM [element].style.width CSS property, whereby the element is effectively invisible at width:1px and in our case today becomes visible, at width:20px, and, thus, clickable, for Google Translate popup window translation and text to speech capabilities via the control of …
    • binary decision making GUI ease of using HTML input tag type=checkbox and the associated Javascript DOM document.getElementById([element]).checked … because …
    • UX-wise it is good to forewarn users with an option when it comes to functionality involving sound
    • use of Javascript DOM document.getElementsByTagName(‘img’) as a means by which to manipulate HTML elements that are not necessarily provided with an ID global property

    As per the other tutorials in this thread, even with new Google Translate Text to Speech and Translation capabilities, nothing changes today about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish tense contextual verb conjugations in this way, with this live run link.


    Previous relevant Italian and French and Spanish Verb Conjugation Event Tutorial is shown below.

    Italian and French and Spanish Verb Conjugation Event Tutorial

    Italian and French and Spanish Verb Conjugation Event Tutorial

    In following up on Italian and French and Spanish Verb Conjugation Tense Tutorial as shown below we’ve increased functionality of English transaltions to …

    • Italian
    • French
    • Spanish

    … and the conjugations from WordReference.com by offering onmouseover (ie. hover) or onclick (or mobile touch) event logic for conjugations offered by using the wonderful MyMemory resource to translate these verb conjugations back into English, and present them in an additional column with a different background colour.

    You may recall us using MyMemory once before when we presented HTML/Javascript Hearing and Listening Primer Tutorial earlier on.

    As per the other tutorials in this thread, but even more so with gleaning information from the MyMemory API via a get method, nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish tense contextual verb conjugations in this way, with this live run link.

    Hope you try out this new functionality.


    Previous relevant Italian and French and Spanish Verb Conjugation Tense Tutorial is shown below.

    Italian and French and Spanish Verb Conjugation Tense Tutorial

    Italian and French and Spanish Verb Conjugation Tense Tutorial

    We’ve followed up on Italian Verb Conjugation and Tense Tutorial as shown below with “tense” context to some of the conjugations of …

    • Italian
    • French
    • Spanish

    Say “some of the” because …

    Even amongst the conjugating language “triplets” above, noticed that when it comes to the “tense” involved, there can be variations, but don’t need to tell a lot of you this old news. Did set me to thinking a bit about the The Tower of Babel story from the Bible, though. What would the world be like if we all spoke the one language? Esperanto, everyone?

    There’s a link between “language” and “life”. That’s why a language without “verbs” is not a language. And the Earth back in those dark days before any life, had no conduits for “language”. And it’s hard to see how “life” sort of started up? But I guess chemistry experts might be able to tell us how this might have come about.

    “Language” is all about patterns, and mirrors human progress with its “pattern” and “organization” and “flexibility” as a huge part of why we as “humans” got to be such agents of change on Earth. Just wish there had really been a more successful Doctor Dolittle in human history that could have got the “inside goss” (so to speak) on what we could have done better to protect the world’s environments.

    As per the other tutorials in this thread, nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish tense contextual verb conjugations in this way, with this live run link.

    Hope you try it out, and even contemplate sending us some feedback.


    Previous relevant Italian Verb Conjugation and Tense Tutorial is shown below.

    Italian Verb Conjugation and Tense Tutorial

    Italian Verb Conjugation and Tense Tutorial

    Again, we saw that we could extend the functionality of the recent Italian and French and Spanish Verb Conjugation Tutorial as shown below, by, for Italian, to start with, trying to help the native English speaker out for where to look on the “conjugation” table presented for the English verb of interest, regarding conjugation information that might match their (verb) tense of interest.

    As you probably well know, every language on Earth has its peculiarities regarding how we express ourselves with regard to time, and a lot of that is associated with the verbs, or action words we use, and in the case of …

    • Italian
    • French
    • Spanish

    … that expression of the context of time in the grammatical usage, especially for people speaking the language, is reflected by conjugations made to the verb. Conversely, as I, a native English speaker, got to think about as this web application proceeded, English has words like “am” and “have” and “having” and “been” and “will” and “shall” and “is” and “are” and “was” and “were” and “would” and “should” and “has” and “had” and “to” and ‘”be” and “being” preceeding verbs, which can have, basically, two suffixes “-ing” and “-ed” (expressing present participles and past participles respectively) to try to do what conjugation does for Italian (we program for today) and French and Spanish languages.

    But there’s more to “tense” than Past, Present and Future as you well can imagine should you learn a language other than your native tongue, which you tend to “go along with the flow” perhaps unaware that “tense” exists, for some learners. There are concepts as layers on top about the context of the time the person is speaking relative to the time they are or were talking about … it gets complex … so you get concepts like “Present Perfect Progressive” (which we did a tutorial about at HTML/Javascript Present Perfect Progressive Primer Tutorial) if you get right into the ins and outs of all this grammar … which you might need to do to master that second language.

    Yet again, nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in Italian “tense” thoughts in this way, with this live run link.

    Again, we hope you try some Italian, with specified “tense” prefix words and suffix endings, to see how the new functionality helps you out with Italian verb conjugations.


    Previous relevant Italian and French and Spanish Verb Conjugation Tutorial is shown below.

    Italian and French and Spanish Verb Conjugation Tutorial

    Italian and French and Spanish Verb Conjugation Tutorial

    We saw that we could extend the functionality of yesterday’s Italian Verb Conjugation Primer Tutorial as shown below, by accessing other resources from the great WordReference.com, adding French and Spanish verb conjugation to yesterday’s Italian verb conjugation.

    As a rule we tend to find that replacing text with HTML select “dropdown” menus can help out this adaption pretty effectively. The other feature of today’s Javascript coding is the use of eval to team with the language code to direct user traffic to the correct parts of the WordReference.com website.

    Along the way we added some background “flag” imagery we found at Science Kids … thanks, heaps.

    Down the little brick road we also added a couple of hashtag navigators, HTML a links that just navigate within the page, allowing the user to move from the conjugation yellow zone to the translation zone (if you translated from English), as much as anything because the conjugation may need to be prompted by picking the “verb” amongst the list of “translated” possibilities, which you can then feed into the rightmost HTML input type=text textbox to, more than likely, get the (verb) conjugation you may have missed with the first pass.

    Nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish in this way, with this live run link.

    Hope you try it out.


    Previous relevant Italian Verb Conjugation Primer Tutorial is shown below.

    Italian Verb Conjugation Primer Tutorial

    Italian Verb Conjugation Primer Tutorial

    Learning Italian as a native English speaker is best done when you are young, and beginning recently on this quest, I learnt a bit of this.

    To me, what stuck out, was how easy we get it in English with regard to (the lack of) conjugating verbs, or articles, or adjectives, in our grammar.

    Is it that, in English, we can say something in a hurry and, sort of, wait to fix it up later, because we don’t conjugate verbs in our mind, or is this not how it works in other languages? Actually, am pretty sure no, because conjugation is done so fast in the minds of Italian speakers that it is no issue … hard to imagine, though, from where I’m standing … well, actually, sitting. Am not here to say, but know it is this, that teachers of Italian to English native speakers, concentrate on in early lessons.

    With this in mind, we don’t for one second pretend we are not using the wonderful resources at WordReference.com with today’s web application, but we thank them for their brilliance, and just rearrange things that you could glean perfectly well from here but need to take a few more steps to reach the conjugation (today it’s just verbs) web page bits, whereas we throw the conjugation bits straight at you. And yes, we do try to cater for the irregular verbs, and where they are regular you should see the word “regular” mentioned in the yellow zone conjugation areas … because we all know … well, you know what we mean?!

    The techniques used today do away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html with this live run link.

    So we hope you enjoy this break from our usual (other way around) ESL game (if it’s a game) to some “Conjugate, Italian Style” play.

    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , | Leave a comment

Troubleshooting CentOS Web Server Disk Zencart Issue Tutorial

Troubleshooting CentOS Web Server Disk Zencart Issue Tutorial

Troubleshooting CentOS Web Server Disk Zencart Issue Tutorial

Out of the previous CentOS Exim Advanced Configuration Primer Tutorial‘s analysis phases …

  • hard disk space
  • hard disk inode count (for Linux and unix web servers)

… that latter one raised its-not-so-good-looking head for two days last Sunday (in the middle of the Sydney, Australia day) and Monday (up until resolving around 11am Sydney time). Not that I immediately knew that. Our symptoms of “something wrong” consisted of …

  • all parts of Apache web server (for RJM Programming) websites working, including MySql ones
  • cPanel hung
  • FileZilla sftp got connection resets

… which is tempting to ignore, and hide the old noggin in the stuff that falls through the hourglass.

Luckily, though, my torpor was disturbed by needing to sftp an image over to the web server to complete yesterday’s tutorial.

Now, it’s inconvenient that the title gives “the general game away” about the source of the issue, but it would be an imaginative operator indeed who could jump to this “even general conclusion” from these symptoms, without getting access to this web server. And on reflection, had we used Power Management to see whether that would have had a chance of fixing the issue, it would have been a waste of time.

So what did we do first on Sunday? Well, we could still log in via ssh and on the RJM Programming web server, went …


# service sshd restart
Stopping sshd: [ OK ]
touch: cannot touch `/var/lock/subsys/sshd': No space left on device

  • df -k /
  • df -i /

… as per …


# df-k /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 133526580 112886392 13860736 90% /
root@vs-rmetcalfe [~]# df -k /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/usr/tmpDSK 544256 328968 187640 64% /tmp
root@vs-rmetcalfe [~]# df -k /var
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 133526580 112886456 13860672 90% /
root@vs-rmetcalfe [~]# df -i /
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 8478720 8478720 0 100% /

… to arrive at “there is an inodes quota running out issue with the RJM Programming web server hard disk”.

So what did we do later on Sunday? We still could, believe it or not, from an already open FileZilla session, delete a goodly number of web server files, which we (recursively) did to get some thousands of inodes to become available again. That left the RJM Programming web server fully functional as we went to “shut eye places”. We gave the web server one task (via our Linux Disk Usage cPanel Heads Up Tutorial) to do for these sleeping hours

# du -a / 2> /dev/null | sort -n -r | head -15

… but it petered out, alas. It is a very intensive “ask”, after all. So this takes us to Monday, where we woke up to …

  • hard disk space
  • hard disk inode count (for Linux and unix web servers)

… back to the original issue, again.

So what did we do on Monday? Well, amongst the research we lobbed onto this useful link, thanks, that got us to go …

find / -ctime -1 -print

… to get a list of files created over the last day. And that was the breakthrough, really, for us, as it lead us to seeing in that list thousands of entries for the filespec …


/home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log

… and we noticed, after another round of file deletions to be okay, temporarily, again, when going through a few cycles of …


# ls -clt /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log
# ls -clt /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log
# ls -clt /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log

… each list would get considerably longer over the length of time it took to list the previous! Runaway train had us gobsmacked! Eventually, though, we tweaked to “the short term solution” …


# ksh -c 'for i in `find /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/ -name "myDEBUG-*.log"`; do rm -f $i; done'
# df -i /
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 8478720 8428558 50162 100% /
# df -i /
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 8478720 8429300 49420 100% /

… yayyyyy!!! (with a caveat of “just relief for now but must find the ultimate reason”) … but there were some back again on the next … a growing list again … plus the RJM Programming ZenCart eCommerce website came up with error message “WARNING: An Error occurred, please refresh the page and try again.” … mesmerized, we repeated the listings, watching the list grow, until it occurred to us, encouraged by that previous link talking about the error could be related to the MySql ZenCart database, to …


# cat /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-1575848271-674789.log
[09-Dec-2019 07:37:51 Australia/Perth] PHP Fatal error: 145:Table './rjmprogr_zencart/sessions' is marked as crashed and should be repaired :: select value
from sessions
where sesskey = '42f9199e81e8c1eeb411921161c67ab9'
and expiry > '1575848271' in /home/rjmprogr/public_html/zencart/includes/classes/db/mysql/query_factory.php on line 101

… giving us the long term remedy …

  1. get into cPanel
  2. search for phpMyAdmin option, and click it
  3. access the rjmprogr_zencart database (and see that sessions table is indeed marked as crashed)
  4. within SQL tab textarea type …

    REPAIR TABLE sessions

    … click the GO button … successful

… sanity checked in that “the list” no longer grows!!! And as for the inodes quota issue …


# df -i /
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 8478720 8425232 53488 100% /

… a lot better, especially as this time it only appears to be getting better (ie. IFree stays roughly the same or gets bigger (with our other crontab remedies we have implemented)). And ZenCart works again. What a relief!


Previous relevant CentOS Exim Advanced Configuration Primer Tutorial is shown below.

CentOS Exim Advanced Configuration Primer Tutorial

CentOS Exim Advanced Configuration Primer Tutorial

There are two file resource aspects to watch out for regarding a web server hard disk storage …

  • hard disk space
  • hard disk inode count (for Linux and unix web servers)

… which can, respectively, be monitored by Linux commands …

  • df -k /
  • df -i /

On our CentOS rjmprogramming.com.au web server recently we had occasion to do a check of this, and wanted to improve the web server hard disk situation for both measures, picking the /var folder of our web server. So we executed, respectively …

  • find /var -xdev -type f -size +100M
  • find /var -mtime -1 -ls

… the latter one being a list of files on /var modified in the last day being our idea to try to see what daily log filing might be contributing big time to hard disk inode usage. And that’s where we found out this way that our Exim Mail Server logs extensively, and that we could do without those in folders off …


/var/spool/exim/msglog/

We tried the latter of two deletion ideas we show below …

  • all at once via …

    cd /var/spool/exim
    find msglog -type f -exec rm -rf {} \;
  • broken up … via a series of deletions of the ilk …

    cd /var/spool/exim/msglog
    rm -f A/*
    rm -f a/*

Then the next job was to stop Exim remaking these logs and wish to thank this useful link for great advice here, that led to this advice we give …

  1. log in to WHM cPanel
  2. in search bar type “Exim”
  3. click the “Exim Configuration Manager”
  4. click “Advanced Editor” tab (up the top)
  5. click the blue “Add additional configuration setting” button well down the webpage
  6. click “message_logs” in left hand drop down
  7. set value of this setting to “false”
  8. click blue “Save” button down the bottom of webpage to complete the steps here

You may find this is a web server configuration of interest to you too.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , | Leave a comment

HTML Multiple Form Multiple Submit or Image Buttons Tutorial

HTML Multiple Form Multiple Submit or Image Buttons Primer Tutorial

HTML Multiple Form Multiple Submit or Image Buttons Tutorial

The previous HTML Multiple Form Multiple Submit Buttons Primer Tutorial‘s web application used as its HTML form navigation conduit …

  • the clicking of input type=submit buttons … but did you know that there is an alternative HTML form navigation button methodology …
  • the clicking of input type=image buttons … with two major differences, those being …
    1. src property can point to an underlying image URL to show as the button background (and foreground)
    2. as we say in today’s tutorial picture
      Difference with input type=image
      to type=submit is that click position
      relative to element top left is
      additionally passed

… which we code for today with the changed multiple_form_multiple_submit_buttons.html for your perusal. The use of that type=image input form navigation adds more possibilities to trace back to what happens in a (window.parent) parent window. Interesting, huh?


Previous relevant HTML Multiple Form Multiple Submit Buttons Primer Tutorial is shown below.

HTML Multiple Form Multiple Submit Buttons Primer Tutorial

HTML Multiple Form Multiple Submit Buttons Primer Tutorial

Anality is a funny thing. Tend to want to follow through in an anal way to show you our multiple form with multiple submit buttons tutorial even though it would be obvious to most recent readers of our blog, that there would be no issues with this very small extension of function creep over the tutorials headed by HTML Multiple Form Submit Buttons Primer Tutorial as shown below. Nevertheless, HTML work can often surprise with unusual cross-browser issues, and you can really get stung when you have no anal molecules in your programming brain. Personally, though, think anality often doesn’t come into play much in life with matters that are of little personal interest.

Today we want to discuss a very old HTML concept called the form tag which allows for the processing of interactive input from the user in the form of textboxes and checkboxes and radio buttons and buttons to transfer information from one webpage to another, somewhere.

For clarity, today, we only use buttons spread over multiple forms, and you may ask, “What good are buttons on their own for imparting information?” … and will ignore the obvious answer that a button press anywhere, depending on the event logic, can mean so much … after all, we all envisaged the disaster of a nuclear holocaust envisaging the press of one button … no, we want to talk about the idea that you can have more than one form tag with one input type=’submit’ button each … and this was not always the case, because in the early days of HTML there was the one submit button allowed on one HTML form … as you see today, now, you can have more than one form, which has more than one submit nutton, per webpage.

Anyway, you might still ask, anyway, “Ignoring the huge event logic possibilities of a button press (because you are not trying to trick me here), what good are buttons on their own for imparting information?” … well, it means on the callback … and today we just callback the same HTML code (via the form‘s action= designation of itself, today) … as we often like to do at this blog, by the way … we can compartmentalize via the GET (in our form’s method case … for starters, with POST we’d need Ajax or a server language, and remember we are trying to keep things more basic here) parameters in the callback URL (stored in “Javascript DOM land” as document.URL) according to the value of that submit button whose name becomes that GET parameter’s name … so that for an HTML form‘s submit button like …


<input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submitiframe' value='Validate and Iframe'></input>

… its contributing part of the callback URL, in our code, is …


... ?submitiframe=Validate+and+Iframe ...

… and so we can, in Javascript, at the onload event‘s code … have an else if statement like …


} else if (document.URL.indexOf('iframe=') != -1) {
// do something here
}

… to have a good compartmentalizing of “action” segments of code that is quite readable and understandable.

If the case is not clear … please tee up a live run with the HTML programming source code multiple_form_multiple_submit_buttons.html (changed from two days ago, when we had multiple submit buttons with one form, as per multiple_form_multiple_submit_buttons.html) … or else please try some HTML code yourself … the hardest concept here today is the embedding of an iframe in a hierarchical way (note the Javascript DOM manipulation of the form‘s target= designation, as you examine the downloadable code above), and so for clarity we preface any iframe by a current client (ie. Javascript) timestamp, so you know who inherits who etcetera etcetera etcetera.

Now even after all this, you may want to say, “So what … an HTML a tag link can do all this. … to which we say … that’s true … good to know there is more than one way to “skin a cat” … meowwwwwwww! … “no animals were harmed in the making of this tutorial”.

In fact you could go on and on and on with possibilities for the equivalent means by which to achieve the ends we have here with our HTML, such as using an input type=”button” or in HTML5, a button tag, and all these and more and more and more and more are worth exploring, and trying, yourself, or by researching the subject. One day, in a real bind, with cross-browser issues, you may need that extra method, to make things work for all the platforms?!

Think that HTML forms can be a very useful business logic tool, and we haven’t even delved into the non-button GUI elements yet.


Previous relevant HTML Multiple Form Submit Buttons Primer Tutorial is shown below.

HTML Multiple Form Submit Buttons Primer Tutorial

HTML Multiple Form Submit Buttons Primer Tutorial

Today, following up on yesterday’s PHP Rhopalic Letter Sentence Game Primer Tutorial and the day before’s HTML Form Multiple Submit Buttons Primer Tutorial as shown below, we want to discuss a very old HTML concept called the form tag which allows for the processing of interactive input from the user in the form of textboxes and checkboxes and radio buttons and buttons to transfer information from one webpage to another, somewhere.

For clarity, today, we only use buttons spread over several forms, and you may ask, “What good are buttons on their own for imparting information?” … and will ignore the obvious answer that a button press anywhere, depending on the event logic, can mean so much … after all, we all envisaged the disaster of a nuclear holocaust envisaging the press of one button … no, we want to talk about the idea that you can have more than one form tag with one input type=’submit’ button each … and this was not always the case, because in the early days of HTML there was the one submit button allowed on one HTML form … as you see today, now, you can have more than one form per webpage.

Anyway, you might still ask, anyway, “Ignoring the huge event logic possibilities of a button press (because you are not trying to trick me here), what good are buttons on their own for imparting information?” … well, it means on the callback … and today we just callback the same HTML code (via the form‘s action= designation of itself, today) … as we often like to do at this blog, by the way … we can compartmentalize via the GET (in our form’s method case … for starters, with POST we’d need Ajax or a server language, and remember we are trying to keep things more basic here) parameters in the callback URL (stored in “Javascript DOM land” as document.URL) according to the value of that submit button whose name becomes that GET parameter’s name … so that for an HTML form‘s submit button like …


<input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submitiframe' value='Validate and Iframe'></input>

… its contributing part of the callback URL, in our code, is …


... ?submitiframe=Validate+and+Iframe ...

… and so we can, in Javascript, at the onload event‘s code … have an else if statement like …


} else if (document.URL.indexOf('iframe=') != -1) {
// do something here
}

… to have a good compartmentalizing of “action” segments of code that is quite readable and understandable.

If the case is not clear … please tee up a live run with the HTML programming source code multiple_form_submit_buttons.htm (changed from two days ago, when we had multiple submit buttons with one form, as per multiple_form_submit_buttons.htm) … or else please try some HTML code yourself … the hardest concept here today is the embedding of an iframe in a hierarchical way (note the Javascript DOM manipulation of the form‘s target= designation, as you examine the downloadable code above), and so for clarity we preface any iframe by a current client (ie. Javascript) timestamp, so you know who inherits who etcetera etcetera etcetera.

Now even after all this, you may want to say, “So what … an HTML a tag link can do all this. … to which we say … that’s true … good to know there is more than one way to “skin a cat” … meowwwwwwww! … “no animals were harmed in the making of this tutorial”.

In fact you could go on and on and on with possibilities for the equivalent means by which to achieve the ends we have here with our HTML, such as using an input type=”button” or in HTML5, a button tag, and all these and more and more and more and more are worth exploring, and trying, yourself, or by researching the subject. One day, in a real bind, with cross-browser issues, you may need that extra method, to make things work for all the platforms?!

We’ve come across multiple forms being used here at this blog in the reasonably recent past in the sequence of tutorials “headed” by PHP/HTML Google Chart Wordtree Chart Local File Tutorial‘s mention of a supervisory live run (that link points here) … it, too, was all about compartmentalized pieces of functionality that each form got involved with … though some generic forms, shared their functionality for various purposes, as well.

Hope you get something out of today’s thoughts above.


Previous relevant PHP Rhopalic Letter Sentence Game Primer Tutorial is shown below.

PHP Rhopalic Letter Sentence Game Primer Tutorial

PHP Rhopalic Letter Sentence Game Primer Tutorial

Today we put the implications of HTML Form Multiple Submit Buttons Primer Tutorial as shown below, to use, for a callback scenario in two parts, the most complex part of which we want to differentiate about the instigation of sharing (or challenging) functionality to allow for the sending of an email regarding a snapshot look about the game’s state of play.

So what does “rhopalic” mean? Maybe you dream of a week consisting of “rhopalic” lunch breaks? Or year by year having “rhopalic” feeling holiday periods? Yes, a “rhopalic” sentence consists of words that keep getting longer by one letter, or one syllable … we do the one letter concept, today, with our English word game … “English” because we rely on an English dictionary lookup where we call on our web server here at www.rjmprogramming.com.au to look up its inbuilt Linux English based dictionary files … for the fastest, and homegrown, effect … perhaps you’d like to consult Linux dictionary files for more information here.

This game has an ESL feel to it, but am not sure you should expose an early English learner to its trivialisation of the language. A “rhopalic” sentence outside the hands of a great English wordsmith is a sad sight indeed …. just play the game and see the “lame” sentence presented as the default (ie. no English wordsmiths were involved), and you see what I mean … but am sure there are great wordsmiths out there? … and that they may know each other’s email addresses?! … and are up for a challenge?!?

Here is some downloadable PHP programming source code you could call rhopalic_letter_sentence.php or try a live run or simulate the return of an emailee’s interaction here.

Hope you enjoy the game and get further thought bubbles regarding HTML form multiple submit button usage possibilities.

If you are wondering where the “rhopalic” idea came from? Answering (wrongly, as it happens) a Sydney Morning Herald (the mobile app edition of the paper) quiz question a few days back.


Previous relevant HTML Form Multiple Submit Buttons Primer Tutorial is shown below.

HTML Form Multiple Submit Buttons Primer Tutorial

HTML Form Multiple Submit Buttons Primer Tutorial

Today we want to discuss a very old HTML concept called the form tag which allows for the processing of interactive input from the user in the form of textboxes and checkboxes and radio buttons and buttons to transfer information from one webpage to another, somewhere.

For clarity, today, we only use buttons, and you may ask, “What good are buttons on their own for imparting information?” … and will ignore the obvious answer that a button press anywhere, depending on the event logic, can mean so much … after all, we all envisaged the disaster of a nuclear holocaust envisaging the press of one button … no, we want to talk about the idea that you can have more than one input tag with type=’submit’ … and this was not always the case, because in the early days of HTML there was the one submit button allowed on one HTML form … now you can even have more than one form … but this is for another day.

Anyway, you might still ask, anyway, “Ignoring the huge event logic possibilities of a button press (because you are not trying to trick me here), what good are buttons on their own for imparting information?” … well, it means on the callback … and today we just callback the same HTML code (via the form‘s action= designation of itself, today) … as we often like to do at this blog, by the way … we can compartmentalize via the GET (in our form’s method case … for starters, with POST we’d need Ajax or a server language, and remember we are trying to keep things more basic here) parameters in the callback URL (stored in “Javascript DOM land” as document.URL) according to the value of that submit button whose name becomes that GET parameter’s name … so that for an HTML form‘s submit button like …


<input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submitiframe' value='Validate and Iframe'></input>

… its contributing part of the callback URL, in our code, is …


... ?submitiframe=Validate+and+Iframe ...

… and so we can, in Javascript, at the onload event‘s code … have an else if statement like …


} else if (document.URL.indexOf('iframe=') != -1) {
// do something here
}

… to have a good compartmentalizing of “action” segments of code that is quite readable and understandable.

If the case is not clear … please tee up a live run with the HTML programming source code multiple_form_submit_buttons.html … or else please try some HTML code yourself … the hardest concept here today is the embedding of an iframe in a hierarchical way (note the Javascript DOM manipulation of the form‘s target= designation, as you examine the downloadable code above), and so for clarity we preface any iframe by a current client (ie. Javascript) timestamp, so you know who inherits who etcetera etcetera etcetera.

Now even after all this, you may want to say, “So what … an HTML a tag link can do all this. … to which we say … that’s true … good to know there is more than one way to “skin a cat” … meowwwwwwww! … “no animals were harmed in the making of this tutorial”.

In fact you could go on and on and on with possibilities for the equivalent means by which to achieve the ends we have here with our HTML, such as using an input type=”button” or in HTML5, a button tag, and all these and more and more and more and more are worth exploring, and trying, yourself, or by researching the subject. One day, in a real bind, with cross-browser issues, you may need that extra method, to make things work for all the platforms?!

Did you know?

With an HTML input type=”submit” (submit button), there is nothing stopping you storing more than just the “front look” of the button in its value= parameter. If you want to do this, but there is no way you want to show that “data” as the “front look” of the button, perhaps it really should be an input type=”hidden” piece of data, or you should hide it … via style=”display:none;” … Javascript DOM store data to it via document.getElementById([itsID]).value=[myData]; … and, conditionally perhaps, click it via Javascript, via document.getElementById([itsID]).click(); method.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , | Leave a comment

Troubleshooting Landing Page Crontab Curl Tutorial

Troubleshooting Landing Page Crontab Curl Tutorial

Troubleshooting Landing Page Crontab Curl Tutorial

Back earlier in December (2019) the crontab/curl work of Landing Page Mobile Phone Crontab Curl Tutorial must have been disrupted.

Why think that?

The RJM Programming Landing Page dropdown of blog tutorial links was missing something … anyone, anyone? … yes, Sunil Gavaskar … its blog posting links. And how are they created each day … anyone, anyone? … yes, Laika, look down to Landing Page Mobile Phone Crontab Curl Tutorial to read all about it.

Do you think it would be good to try, via ssh access what crontab/curl automates on the RJM Programming web server, but on the command line?

Excellent suggestion!


$ curl HTTP://www.rjmprogramming.com.au/PHP/tutorial_options.php
<b>Error 3: Error writing file '/tmp/MYpxajPE' (Errcode: 28)</b><option selected='selected' value=' '>Tutorials (show blog, toggle sort order) ...</option>

Ah! Do you think a diskspace examination of the /tmp disk on this Linux web server would reveal anything useful?

You’re on a roll!


$ df -k /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/usr/tmpDSK 544256 513316 3292 100% /tmp

Wow, that’s bad! Do you think a file listing examination of the /tmp disk on this Linux web server would reveal anything useful?

Have you been reading the script to all this?


$ ls -l /tmp
total 490508
drwxrwxrwt 114 owner group 294912 Dec 2 03:54 ./
dr-xr-xr-x. 25 owner group 4096 Dec 1 04:49 ../
-rw-r--r-- 1 owner group 32 Aug 9 2014 adminer.key
-rw-r--r-- 1 owner group 27 Aug 26 2014 aexception.is
drwx------ 2 owner group 4096 Jun 16 2018 ansible_Hinjci/
-rw-r--r-- 1 owner group 225887 Dec 2 02:04 basegetmelist.is
-rw-r--r-- 1 owner group 225887 Dec 2 02:01 basegetmelist.wis
-rw-r--r-- 1 owner group 43615 Jan 18 2015 basegetmelist.wisold
-rw-r--r-- 1 owner group 17099 Apr 8 2014 BatsAndBall.tcl
-rw-r--r-- 1 owner group 130989 Apr 23 2018 CDB-simple_after_LibreOffice.htm
-rw-r--r-- 1 owner group 20624 Jun 4 2015 check-mk-agent.rpm
drwx------ 2 owner group 4096 May 11 2019 clamav-030407a30e41469e50714e18d06cfef6/
drwx------ 2 owner group 4096 Nov 10 2018 clamav-05c7969f7c92127c0a67d1e1e030ff7a/
drwx------ 2 owner group 4096 Jun 16 2018 clamav-0c9c5d08dd88487d2db8ab0d89844a98/
# more follows ...
-rw------- 1 owner group 20041728 Dec 1 02:32 magick-299501ChMis2EYamN
-rw------- 1 owner group 31457280 Dec 1 02:32 magick-29950E5FvDZxbZUTb
-rw------- 1 owner group 31457280 Dec 1 02:33 magick-30009gmKHkoN2pnsz
-rw------- 1 owner group 31457280 Dec 1 02:32 magick-30011B1tagrDAr7pR
-rw------- 1 owner group 31457280 Dec 1 02:33 magick-30011VUw-Xwaqo2lT
-rw------- 1 owner group 31457280 Dec 1 02:33 magick-30043kgDfzEiS4YhO
-rw------- 1 owner group 31457280 Dec 1 02:34 magick-30089dJLmu7BUm4Cw
-rw------- 1 owner group 31457280 Dec 1 02:33 magick-30133nUvTOGPaB5XG
-rw------- 1 owner group 31457280 Dec 1 02:33 magick-30133qaJFxqr0Kbgr
-rw------- 1 owner group 7234560 Dec 1 02:45 magick-33938vgJrHboBpWeI
-rw------- 1 owner group 31457280 Dec 1 02:59 magick-36847TC-kxmkRqR4V
-rw------- 1 owner group 31457280 Dec 1 03:00 magick-36847YUdME4k4jgwh
-rw------- 1 owner group 31457280 Dec 1 02:59 magick-368918jQfT0gouz5z
-rw------- 1 owner group 31457280 Dec 1 03:00 magick-36891NSRHciA7uHb8
-rw------- 1 owner group 31457280 Dec 1 03:00 magick-3707285W0V0oGoH97
-rw------- 1 owner group 31457280 Dec 1 02:59 magick-37072lAYUvoSex9wk
-rw------- 1 owner group 31457280 Dec 1 03:00 magick-37073XLevidVmQCPl
# more follows ...
-rw-rw-rw- 1 owner group 87155 Mar 26 2019 minify_0dca26f4ae4988d406871896dc562350
-rw-rw-rw- 1 owner group 15260 Mar 26 2019 minify_0dca26f4ae4988d406871896dc562350.gz
-rw-rw-rw- 1 owner group 85916 Mar 26 2019 minify_2972bf58405bbbc339884b94935eb6bf
-rw-rw-rw- 1 owner group 17938 Mar 26 2019 minify_2972bf58405bbbc339884b94935eb6bf.gz
-rw-rw-rw- 1 owner group 12447 Mar 26 2019 minify_67325ffb44e64f839c31db871aa8f6de
-rw-rw-rw- 1 owner group 2824 Mar 26 2019 minify_67325ffb44e64f839c31db871aa8f6de.gz
-rw-rw-rw- 1 owner group 185518 Mar 26 2019 minify_f8189fe934d7fecd140658eef38fcf74
-rw-rw-rw- 1 owner group 34816 Mar 26 2019 minify_f8189fe934d7fecd140658eef38fcf74.gz
-rw------- 1 nobody root 2227 Apr 25 2014 mNQtmxm4OS
-rw-r--r-- 1 owner group 0 Apr 28 2015 msans.ans
-rwxr-xr-x 1 owner group 741 Apr 28 2015 msans.ksh*
-rw------- 1 mysql mysql 0 Jun 19 2018 MYchYpJx
-rw-r--r-- 1 owner group 0 Sep 12 2017 mysocket1337.tmp
-rw-r--r-- 1 owner group 386 Oct 21 2014 no.worries
drwxr-xr-x 2 owner group 4096 Oct 21 2014 okold/
-rw------- 1 owner group 0 Jan 11 2017 pdfFafOZA

Those magick-* files seem problematic! Do you think a look around the net would reveal anything useful?

Astounding! Look at what are ‘/tmp/magick-*’ files? – ImageMagick

When IM can’t do its work in main memory, it uses disk. If the process completes normally, the temporary disk files are deleted. If the process fails, these files are often not deleted.

If you have no IM processes running, you can safely delete these files.

Knowing that, and seeing the dates of those problematic /tmp/magick-* files, am I right in thinking you’ll tabulate a short term and long term strategy remedy to the problem?

And do fish swim?!

Short term strategy Long term strategy
Within ksh shell script that crontab runs each minute, add (allowing 40 minutes before saying the ImageMagick must have failed) …

$ rm -f /tmp/magick-*
$ df -k /tmp # Sanity check gives "/usr/tmpDSK 544256 24428 492180 5% /tmp" ... much better
$ curl HTTP://www.rjmprogramming.com.au/PHP/tutorial_options.php

ksh -c 'for i in `find /tmp -name "magick-*" -atime +40m`; do rm -f $i; done'

Feel free to see a PDF stream of consciousness presentation of us dealing with this issue.


Previous relevant Landing Page Mobile Phone Crontab Curl Tutorial is shown below.

Landing Page Mobile Phone Crontab Curl Tutorial

Landing Page Mobile Phone Crontab Curl Tutorial

That work with the RJM Programming Landing Page we were last looking at a couple of days ago (with Landing Page Mobile Phone Tutorial) was all fine and good, but the introduction of a new HTML indexmobile.html for mobile phone usage, specifically, needs melding into existant web server arrangements.

For the most part “web server arrangements” has little to do with HTML and Javascript, which is usually client side work, unless, perhaps you involve Ajax.

But even ignoring Ajax, and ignoring server side languages like PHP (or ASP.Net) … remember …

As we continue in this series of tutorials we don’t pretend to be experts on aesthetics but we will show you some HTML and Javascript (no PHP, deliberately (read Linux sudo nohup Watchdog Primer Tutorial to get this in context, for us)) functionality ideas that could supplement some great graphical design ideas you have to start something yourself, perhaps.

… from Landing Page Primer Tutorial … how can HTML (with its associated Javascript) make use of “web server” anything much other than being a place it gets stored?

Well, that web server is a server … a computer … with its own processes … ours is a Linux web server “computer” … with batch processing capabilities … easiest to access via crontab, and we first talked about how the RJM Programming Landing Page could be supplied with an HTML select element filled with RJM Programming blog tutorials with the most recent ones up the top, via the “crontab” running of a PHP web application that reads the WordPress MySql database to derive the contents of this HTML select element plonked into the Landing Page when we presented More on Linux Crontab Curl Tutorial as shown below.

So here we have a before and after scenario … that doesn’t involve hair nor weight loss … so here is the crontab before (which we’ll keep but add another similar process onto) combining its talents with PHP and curlthe “CC dynamic duo”


59 23 * * * curl //www.rjmprogramming.com.au/PHP/tutorial_options.php 2> /home/rjmprogr/public_html/PHP/tutorial_options.bad

… but we need to tell you a great thing about curl … you can access, easily, a single $_GET[] PHP parameter, because Linux doesn’t think “?” is very special (but it does have a “background process meaning” for “&” making it hard to use curl with more than one $_GET[] PHP parameter involved) … leading us to our new bold crontab record below to cater for “indexmobile.html” updating …


59 23 * * * curl //www.rjmprogramming.com.au/PHP/tutorial_options.php 2> /home/rjmprogr/public_html/PHP/tutorial_options.bad
57 23 * * * curl //www.rjmprogramming.com.au/PHP/tutorial_options.php?mobile=mobile 2> /home/rjmprogr/public_html/PHP/tutorial_options.bad

… and what needed doing with the PHP?

Here is the downloadable PHP programming source code you could call tutorial_options.php changed for the purposes of being capable of updating “indexmobile.html” as per this link.

The effect on mobile phone usage of the RJM Programming Landing Page tutorial dropdown (HTML select element) list of RJM Programming blog tutorials (updated daily) is seen with today’s tutorial picture.


Previous relevant More on Linux Crontab Curl Tutorial is shown below.

More on Linux Crontab Curl Tutorial

More on Linux Crontab Curl Tutorial

Sometimes for a website you only want to do a web server task once or a few times a day, and you, ideally, wouldn’t want to run into the remote possibility that two people could perform the task at precisely the same time. This scenario happens often when using server-side languages like ASP.Net and PHP. If it didn’t matter that two people might do the same thing at once then you could do the job within your web-based PHP, and you may consider using a date and time test in your web-based PHP to do your “once or a few times” task in your PHP. This latter idea has the advantage that file ownership issues will probably not crop up because the web user will be manipulating any media or HTML files you may be dealing with, rather than the administrator user that will probably be overseeing your “once or a few times” cron job that we show you here today.

So the task today is to keep the rjmprogramming.com.au’s landing page “Tutorials” dropdown up to date with the latest blog postings, rather than having to manually attend to this with interactive (HTML code) edits and (s)ftp uploads. You may be wondering why not just write the landing page in PHP, and this is a fair point, but the strategy here at this domain is that the landing page and its “fellow” webpages should be independent of MySql, which, under big loads, can go down, and here we use a watchdog to fix that, should it happen. Previously we had a very similar task you can read about with the Linux Crontab Curl Primer Tutorial below. It is so similar, let’s use curl, PHP and crontab to do this task like with that previous task. So this is command line, and this is batch work, but that worry in other types of batch work where you need to worry about where you are as you do any file management, is handled quite well by the wrapping of the job in curl, which takes as its argument a URL, so, implicitly, the place to work with file management, is handled by curl and the PHP we write (specifically where the code uses dirname(__FILE__)).

Here is the downloadable PHP programming source code you could call tutorial_options.php and you will see, if you examine the code that it is very specific to conditions here at this rjmprogramming.com.au domain, so please be aware of that, but maybe its concepts can help you out with something else you are tackling. A list of the specifics you would want to address (should you adapt it for your own purposes) include:

  • the PHP explode methodology (in the code above) assumes there are two select dropdowns (spelt in lowercase) in the underlying HTML code (for rjmprogramming.com.au’s landing page) we are rewriting, and that it is the second one we update with information gleaned (via SQL query) from the WordPress MySql database the PHP reads (where we piece together a $retval string of the HTML option tags belonging to the tutorials HTML select tag)
  • the MySql database access hostname, username, password, database name, database table name
  • the Linux web server file owner used during the (commented out) chown command you may need to consider to allow the crontab’s user be able to leave the files owned by the website user

PHP commands of interest in today’s tutorial include:

Maybe it is just me, but liking “Onion of the 4th dimension” the kind of thinking I gravitate towards is:

  • supervisory command line arrangements
  • all “replace” type functionality … to get the problem into a shape suitable for the bits down deeper into the “core” of your “onion” … Linux-speak would say “kernel” of your “onion”
  • parameters and arguments … continuing on that theme of slotting something (the user is specifically interested in, data-wise) in dynamically for something that “represents” it in the code … sort of, like an “interpretive” approach (often people like to say “scripting”)

Programmers can think in entirely different ways, and if other methods work then that is great (woh!) but if they do not work for any platform (sometimes you don’t intend to cater for every platform known to humans and mangoes … damn … was doing so well … persongoes), and these ideas may really irk many programmers, but you need to consider styles of work that suit your way of thinking best.

So, to do this task we wrote new PHP code and cloned the crontab code used in the tutorial below but change the minute of the hour the task is run, and what is run, in crontab on the Linux web server for the domain at rjmprogramming.com.au … happy studies!


Previous relevant Linux Crontab Curl Primer Tutorial is shown below.

Linux Crontab Curl Primer Tutorial

Linux Crontab Curl Primer Tutorial

Linux (or Unix) is a command line environment that supports interactive and non-interactive task management. Often non-interactive tasks are known as batch processes, often intended not to rely on any user intervention, unless there is a problem.

Today, in this tutorial (which builds on Linux Background Primer Tutorial), we see the power of combining Curl under the auspices of crontab to run a webpage piece of functionality once a day at a specified time.

Some CMS systems like Drupal use crontab to perform actions on the database at regular intervals.

For Windows systems you might want to look at Windows Task Schedular for similar functionality.

Linux has several approaches to activating a task, some (not mentioning all the ways one process can fork or launch another process) of them being:

  • interactively (from the command line)
  • kick off a process from command line, and place in in the background, without supervision, necessarily, via the suffix &
  • kick off a process without supervision, necessarily, via crontab
  • kick off a process in the background (without supervision, necessarily) via nohup
  • kick off a process from command line, and place it in the background, without supervision, necessarily (and optionally change its state via fg and bg)

The previous Linux Background Primer Tutorial is well worth reading below.

Linux Background Primer Tutorial

Linux Background Primer Tutorial

Linux (or Unix) is a command line environment that supports interactive and non-interactive task management. Often non-interactive tasks are known as batch processes, often intended not to rely on any user intervention, unless there is a problem.

In the pre-GUI days batch processes were very prominent, but they still are today, as far as actually getting things done. It is just that the more glamorous activities pass our notice more, but there are servers out there churning away with batch processes, dreaming of the day when they’ll work out how they can make that cup of coffee for you in the morning. And do we ever offer them even a cup’o’tea … it’s a disgrace, so it is.

Linux has several approaches to activating a task, some (not mentioning all the ways one process can fork or launch another process) of them being:

  • interactively (from the command line)
  • kick off a process from command line, and place in in the background, without supervision, necessarily, via the suffix &
  • kick off a process without supervision, necessarily, via crontab
  • kick off a process in the background (without supervision, necessarily) via nohup
  • kick off a process from command line, and place it in the background, without supervision, necessarily (and optionally change its state via fg and bg)

The last four above are often best performed on a shell script, whether that be a Bash, Korn, Bourne or Cshell script. There are some good general tips for batch process scripts:

  • never assume where you are, rather specify the directory to be in, via “cd”
  • never assume that the environment variables will be exactly the same as for an interactive session
  • be more thorough to log errors and log activity to files to see, later, what happened
  • it is not good to proceed on errors (unless you have set up independent means of checking) because there will be no human to interactively decide that the problem should not stop the job proceeding
  • pretty obviously, don’t expect anybody to answer an interactive entry requirement (but you can simulate lots of interactive input via redirected standard input eg. < [filename])

Take a look at some example Linux background processing at this tutorial. In it you will see some crontab work where the parameters are (as explained here … thanks):

MIN = Minute 0-60

HOUR = Hour [24-hour clock] 0-23

MDAY = Day of Month 1-31

MON = Month 1-12 OR jan,feb,mar,apr …

DOW = Day of Week 0-6 OR sun,mon,tue,wed,thu,fri,sat

COMMAND = Command to be run Any valid command-line

The */6 * * * * /Applications/MAMP/htdocs/pdftoimage.sh of our usage runs /Applications/MAMP/htdocs/pdftoimage.sh every six minutes.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Operating System, Tutorials | Tagged , , , , , , , , , , | Leave a comment