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 , , , , , , , , , | 336 Comments

Bluetooth File Transfer Between macOS and Windows 10 Primer Tutorial

Bluetooth File Transfer Between macOS and Windows 10 Primer Tutorial

Bluetooth File Transfer Between macOS and Windows 10 Primer Tutorial

We’re always on the lookout for “common denominators” when it comes to working amongst hardware that fall into different “camps”. Camp Microsoft and Camp Apple are the hardware contenders today with, respectively …

  • Microsoft Windows 10 desktop computer … and …
  • Apple macOS (Mac OS X) MacBook Pro laptop

… and the “common denominator” is …

  • Bluetooth … both Setup … and
  • Bluetooth File Transfer

… as a means by which you might share file data between these two platforms.

In amongst the modern computer device network terminology two settings that are “giants” are …

  • Wi-Fi

    Wi-Fi (/ˈwaɪfaɪ/)[1] is technology for radio wireless local area networking of devices based on the IEEE 802.11 standards. Wi‑Fi is a trademark of the Wi-Fi Alliance, which restricts the use of the term Wi-Fi Certified to products that successfully complete, then after many years of testing the 802.11 committee interoperability certification testing.

  • Bluetooth

    Bluetooth is a wireless technology standard for exchanging data between fixed and mobile devices over short distances using short-wavelength UHF radio waves in the industrial, scientific and medical radio bands, from 2.400 to 2.485 GHz, and building personal area networks (PANs). It was originally conceived as a wireless alternative to RS-232 data cables.

… the latter a functionality built into a lot of modern computer devices. Perhaps you are more familiar with Bluetooth (usage and technology) regarding playing music on computer devices via Bluetooth speaker devices?

Bluetooth works as a software and networking tool that you setup on both sending and receiving devices and which you “Pair” those two devices. Once you do that, you can use a Bluetooth File Transfer application on the Sender to prompt the Receiver for any Bluetooth Connection Pairing Request event, and if accepted, open the necessary communication channels to allow for the transfer of files.

We did this today, sending a file from the MacBook Pro to the Windows 10 Desktop Computer and you can get the gist of us doing this with today’s video presentation as per …

You can also see this play out at WordPress 4.1.1′s Bluetooth File Transfer Between macOS and Windows 10 Primer Tutorial.

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

Posted in Hardware, Networking, Operating System, Software, Tutorials, eLearning | Tagged , , , , , , , , , , , , , , , , | Comments Off

C++ X11 Analogue Clock Timezone Tutorial

C++ X11 Analogue Clock Timezone Tutorial

C++ X11 Analogue Clock Timezone Tutorial

Onto yesterday’s C++ X11 Analogue Clock Animation Tutorial we wanted to optionally …

  • involve, for us, what is the meeting place of “where” and “when”, that being timezones … and because we are familiar with timezone concepts with it, we …
  • involve PHP as an optional “helperer outerer” of …
  • the changed x1.cc C++ supervisor … which nows funnels functionality via taking notice of …
  • command line arguments … additional ones defining “Europe/Berlin” style timezone names

We slunk the word “optionally” in, as it is file existence in C++ …


bool doesFileExist(const std::string& name) { // thanks to https://stackoverflow.com/questions/46292764/check-for-file-existence-in-c-without-creating-file
if (FILE *file = fopen(name.c_str(), "r")) {
fclose(file);
return true;
} else {
return false;
}
}

… and PHP’s file_exists that directs traffic for some of this.

Also in PHP it is the “getting back to the operating system” exec and passthru functions (and C++’s std::system) that help out because on any one command line invocation you can go …


TZ=Europe/Berlin date

… on Linux or macOS (or Mac OS X), at least, to get the command line output you the current date and time in (the timezone place) Berlin (and so PHP passthru comes into its own).

This helping get_tz.php‘s live run code caters for two modes of use, out of the three we sometimes talk about, those being …

  • command line usage … eg. “php get_tz.php” … helping out the C++ X11 command line … as well as (and differentiated in code via “if (isset($argc)) { } else { }” test) …
  • surfing the net … allowing us to have that link above functional

… and we just did not consider a use for “Curl” mode of use, though it may work for this too, we are not sure.

You can also see this play out at WordPress 4.1.1′s C++ X11 Analogue Clock Timezone Tutorial.


Previous relevant C++ X11 Analogue Clock Animation Tutorial is shown below.

C++ X11 Analogue Clock Animation Tutorial

C++ X11 Analogue Clock Animation Tutorial

If ever there was a benefit some additional animation functionality could make, it would be to yesterday’s C++ X11 Analogue Clock Primer Tutorial of an analogue clock (only) at a snapshot of time. Many of us need the clock for more than a snapshot.

X11 animation strategies are not necessarily straightforward, and reviewing the Internet discussion about this, there are many and varied ways to approach this. We decided to turn the C++’s main function into redraw function called by the new main function of the changed x1.cc


int main() {
int jj=0;
std::string suff (" ... Click to refresh as required\0");
while(1) {
if (dsp) {
XDestroyWindow( dsp, win );
XCloseDisplay( dsp );
}
redraw(suff.substr (jj), jj);
jj = ((jj + 1) % suff.length());
}
return 0;
}

… for that revamped redraw function now adding a second hand (to the minute and hour hands of yesterday’s incarnation), now that we have animation. What was the crucial difference to allow for automated animation (or with the old “click” method, as well), at the end of this C++ function …


eventMask = ResizeRedirectMask|StructureNotifyMask|ButtonPressMask|ButtonReleaseMask;
XSelectInput(dsp,win,eventMask); // override prev


int i=0;


do {
i++;
XNextEvent( dsp, &evt ); // calls XFlush()
usleep(200);
time_ptr2 = time(NULL);
tm_local2 = localtime(&time_ptr2);
seconds = difftime(time(NULL), time_ptr);

XResizeWindow(dsp, win, 200 + (i % 11), 200 + (i % 11));
} while( evt.type != ButtonRelease && seconds < 1.0 );


XDestroyWindow( dsp, win );
XCloseDisplay( dsp );
dsp = NULL;


}
catch (int ez) { printf("%i\n", ez); }


return 0;

Thanks go to …

… for today’s work.


Previous relevant C++ X11 Analogue Clock Primer Tutorial is shown below.

C++ X11 Analogue Clock Primer Tutorial

C++ X11 Analogue Clock Primer Tutorial

Continuing on with the X11 ideas of the recent Inkscape Vector Image Editor Watermark Tutorial blog posting thread, today we turn our attention to you creating the software …

  • for a single snapshot analogue clock … in an …
  • X11 (for us, MacBook Pro Terminal) window … via …
  • C++ … compiled via GCC, the GNU compiler, as per …

  • g++ -I /usr/X11/include -L /usr/X11/lib -o x1 x1.cc -lX11
  • execute via …

    ./x1

… as you can see in action with today’s tutorial picture.

Of huge help as a resource for the basis of C++ code, thanks, was …


Previous relevant Inkscape Vector Image Editor Watermark Tutorial is shown below.

Inkscape Vector Image Editor Watermark Tutorial

Inkscape Vector Image Editor Watermark Tutorial

It’s probably a dual edge sword an uploader’s attitude to watermarks. For some it may be annoying that an image is not freeware when pretty non-specific and uncontroversial. For others they may like watermarks for a couple of reasons …

  • They, too, find they want to protect their content in some way … and, as is often the case with me …
  • They like the aesthetics of watermarks

And this is where we rejoin the recent Inkscape (desktop application vector image editor) discussions of recent times you can read about at Inkscape Vector Image Editor Logo Tutorial and start considering Inkscape’s talents with layers, a similar talent to that of Gimp.

To research this we came upon this excellent “Add a Watermark in Inkscape” link, thanks. It got us using Inkscape’s …

  • Layer -> AddLayer…
  • Object -> Fill and Stroke…

… as we present ideas helped by “Add a Watermark in Inkscape” to help with this creation of …

(Export to) PNG result (two layers get exported to one)
(Export to) SVG result (retains the two layers)
  1. Be in Inkscape (via XQuartz)
  2. File -> Import (the Banner PNG)
  3. Select Layer > Add Layer. Placing the watermark on a separate layer makes it easier for you to move or alter later.

  4. Select Add to create the new layer.

  5. Add some text that you have prepared ahead of time (that being website, email, phone number etcetera) via Text -> Text and Font… window for Font Family and 8px size
  6. Select that text
  7. Go to Object > Fill and Stroke.

  8. Select the Fill tab (if it isn’t already selected), then drag the Opacity slider to the left to make the text semi-transparent.

  9. Once satisfied, you can save the file and export the image in various formats including PNG.

    … and we would add, to retain layers save as “Inkscape SVG”


Previous relevant Inkscape Vector Image Editor Logo Tutorial is shown below.

Inkscape Vector Image Editor Logo Tutorial

Inkscape Vector Image Editor Logo Tutorial

A lot of users like consistency with business related matters, such as your company’s banner, letterhead, email signature and today’s logo ideas we’re adding onto the recent Inkscape Vector Image Editor Business Card Tutorial.

The sad bit of the logo changeover from old …

Old New
Old logo Old logo
Old logo Old logo

… to new is to lose the “quirky” aspects to the “spider” and “web” connection, but a relief that now we have a much more easily recreateable logo based on shapes and linework and calligraphy that the Inkscape desktop application is so good at.

Again, to aid with consistency, we base the logo on the previously created “banner”, much like we worked it with the “business card”, as per …

  1. Be in Inkscape (via XQuartz)
  2. File -> New from Template…
    Business Card A8 (74mm x 52mm) Generic canvas… set Custom Width: 102px, Custom Height: 77px … click “Create from Template” button
  3. File -> Import (the Banner PNG)
  4. Fit into a Business Card Canvas size
  5. Add some text that you have
    prepared ahead of time (as above) …
    and we hope to get result
    like or better than at left
    “Draw Bezier curves and straight lines” work being the four black lines of an “m” that breaks the yellow ribbon calligraphy into (an imagined) “r” and “j” for the letters RJM within the company name “RJM Programming”, and use the “Rectangle” functionality to overlay a white rectangle on top of the text (we had for the “Banner”)
  6. Save As… PNG to MAMP document root
  7. Show Safari web browser sanity
    check
  8. Back at Inkscape (via XQuartz)
    use File -> Print to
    additionally sanity check

… and in turn, that created logo can “fit into” that second row logo, with the white background, above, in a similar fashion.

Along the way, implementing this to the domain landing pages and blog, we noted, again, as we did at the recent Wikipedia Flipcard Quiz Emoji Tutorial

  • Sometimes when you involve HTML iframe elements and you have an issue with scroll bars that you do not want the CSS styling (with the iframe HTML) of …

    <style>
    * { overflow: hidden !important; }
    </style>

    … can resolve issues … and …
  • Did you know?

    When implementing many HTML img element change type of modifications, you make a change and nothing appears to happen, you (barring idiocy) may have run into an issue where the web browser you are on prefers to keep showing that image (img element) from the cache. So might other users (who have visited your website in the past) out there. But to force the cache to rethink itself both the …

    1. HTML iframe src= URL … and …
    2. HTML img src= (image) URL within that iframe’s HTML

    … could benefit, and most likely not be in any way adversely affected, by modifying the ? and/or & arguments of the URL (yes, even for image URLs)

… as we show you with today’s tutorial picture.


Previous relevant Inkscape Vector Image Editor Business Card Tutorial is shown below.

Inkscape Vector Image Editor Business Card Tutorial

Inkscape Vector Image Editor Business Card Tutorial

Yesterday’s Inkscape Vector Image Editor Banner Tutorial set us to thinking that we’d like to base an A8 business card … spoiler alert …

Inkscape Vector Image Editor Business Card Tutorial
… on the vector graphics and even that text of the banner …
Inkscape Vector Image Editor Banner Tutorial

… created via the steps shown in the YouTube video below …

And below is that YouTube video’s transcript (plus the Save As (step) we forgot (on the actual video’s transcript)) …

Website: https://www.rjmprogramming.com.au
Email: rmetcalfe@rjmprogramming.com.au
Telephone: 61 2 95163479
ABN: 83 204 975 606

Dear Viewer,

Welcome to macOS Inkscape (via XQuartz)
Business Card (via Banner 300x350px)
creation tutorial. We will:

  1. Be in Inkscape (via XQuartz)
  2. File -> New from Template…
    Business Card A8 (74mm x 52mm)
  3. File -> Import (the Banner PNG)
  4. Fit into a Business Card size
  5. Add some text that you have
    prepared ahead of time (as above) …
    and we hope to get result
    like or better than at left
  6. Save As… PNG to MAMP document root
  7. Show Safari web browser sanity
    check
  8. Back at Inkscape (via XQuartz)
    use File -> Print to
    additionally sanity check


Thanks for watching.

RJM Programming


Previous relevant Inkscape Vector Image Editor Banner Tutorial is shown below.

Inkscape Vector Image Editor Banner Tutorial

Inkscape Vector Image Editor Banner Tutorial

We got a job recently to create a banner for RJM Programming. No worries, for our MacBook Pro runnning macOS Mojave 10.14.5. Think Pages or Gimp just for starters (or read this useful link). But our specification involved a requirement for 300×350 pixels, which is not a popular banner size. Of course, you can “work” desktop graphical editors to output data in a variety of formats and sizes, but we think it might be best to decide on a method that comes from a “300×350 banner” online search. And examining the resultant links got us to revisit the “vector graphics champion” freeware (and open source) Inkscape desktop application (added to our The Best Things In Life Are Free … list) we last talked about at Inkscape Vector Image Editor Primer Tutorial.

And so, with the great Inkscape, how did we create our 300×350 pixel banner below?

In broad brush terms …

  1. Click the Inkscape icon (which, after install, we arranged to reside in the Dock down the bottom of the screen)
  2. File -> New … for blank vector graphics document … but we direct your attention to the “New from Template…” which could be really useful for you to avoid having to do the step below …
  3. File -> Document Properties … Custom Size: Units – pixels, Width – 300, Height – 350 … Viewbox: Width – 300, Height – 350 … Close the Document Properties window via red close icon at top left
  4. Did the vector graphics artwork, involving, for us, Create 3d boxes, Create and edit text objects, Draw calligraphic or brush strokes
  5. File -> Save As… this is where we learn that Inkscape may be a vector graphics editor, but that doesn’t mean you can’t Save As another image type, and so with the Type dropdown, we choose Cairo PNG (*.png) (from the default Inkscape SVG (*.svg) format) and after arranging a good path to save to, we entered Name: drawing.png … and clicked Save button
  6. Separately, to check the 300×350 pixel requirement, we open our MAMP directory /Applications/MAMP/htdocs/drawing.png as HTTP://localhost:8888/drawing.png (in a Safari web browser window), open Develop -> Show Web Inspector and click the Inspect button to highlight our Inkscape created PNG image to confirm its size as 300×350 pixels

… and rest assured it is possible via Inkscape’s File -> Open… to open this (non-vector) PNG image that gets Imported back into the vector graphics that is Inkscape’s thangthing.

Did you know?

We’re runnning macOS Mojave 10.14.5 here on this MacBook Pro in August, 2019. Inkscape needs an X11 terminal application to interface to, that being (called) XQuartz in this day and age. But installing the 2.7.11 most recent XQuartz version, at the time of writing, caused issues with the Inkscape 0.92.2 installation. You’d click the Inkscape icon and in the dock it would jump up and down then effectively die. Even in Finder, Ctrl clicking to reveal Package Contents and get to the Unix executable in the Contents and then macOS folders, to click, same problem. But, thanks to the advice at this great link, we found that going back through the XQuartz version releases to its 2.7.9 version cleared up all these issues.


Previous relevant Inkscape Vector Image Editor Primer Tutorial is shown below.

Inkscape Vector Image Editor Primer Tutorial

Inkscape Vector Image Editor Primer Tutorial

As far as image editing goes at RJM Programming, we turn to …

  • PaintBrush (the Mac OS X one) for more than 90% of the simpler work … and then use …
  • Preview (Mac OS X) occasionally to do with resizing tasks … but, more often, for the rest of the work we use …
  • Gimp (Mac OS X desk application as XQuartz or X11) for jobs requiring special effects or filters or opacity or colourization or hue control

But what if you want to “Export As…” SVG? None of the applications above, “out of the box” “Export As…” SVG. First off, let’s get a reason for this from this very useful link, thanks …

GIMP is a raster graphics editor application. SVG is a form of vector graphics. If you want to edit SVG files, you should install the inkscape package and use Inkscape instead.

Yes, the SVG image format is a vector graphics image format, and that is the difference. So we went along with the advice and used, for our Mac OS X system the DMG method of (free, open source) install at the Inkscape website to get things rolling along.

Today’s PDF slideshow takes it up from that point, showing us Creating a 3D Box and dragging our way to creating a 3D Box shape that we “Save As…” (because now we are well and truly in the “vector” woooorrrrrrlllllld) /Applications/MAMP/htdocs/drawing.svg … why? Well, it’s our way to remind you, as we so often do, that the MAMP local Apache/PHP/MySql web server document root, by default, points at /Applications/MAMP/htdocs/ and in a web browser, with MAMP activated, points at (the URL prefix) HTTP://localhost:8888/ and so us lobbing onto …


HTTP://localhost:8888/drawing.svg

… has you seeing what we saw on MAMP (and then we uploaded this to the RJM Programming website place you are accessing with the link above). What you need to do this is a (s)ftp desktop application like FileZilla. Web server maintenance 101.

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 Operating System, Tutorials, eLearning | Tagged , , , , , , , , , , , , , , , , | Leave a comment

C++ X11 Analogue Clock Animation Tutorial

C++ X11 Analogue Clock Animation Tutorial

C++ X11 Analogue Clock Animation Tutorial

If ever there was a benefit some additional animation functionality could make, it would be to yesterday’s C++ X11 Analogue Clock Primer Tutorial of an analogue clock (only) at a snapshot of time. Many of us need the clock for more than a snapshot.

X11 animation strategies are not necessarily straightforward, and reviewing the Internet discussion about this, there are many and varied ways to approach this. We decided to turn the C++’s main function into redraw function called by the new main function of the changed x1.cc


int main() {
int jj=0;
std::string suff (" ... Click to refresh as required\0");
while(1) {
if (dsp) {
XDestroyWindow( dsp, win );
XCloseDisplay( dsp );
}
redraw(suff.substr (jj), jj);
jj = ((jj + 1) % suff.length());
}
return 0;
}

… for that revamped redraw function now adding a second hand (to the minute and hour hands of yesterday’s incarnation), now that we have animation. What was the crucial difference to allow for automated animation (or with the old “click” method, as well), at the end of this C++ function …


eventMask = ResizeRedirectMask|StructureNotifyMask|ButtonPressMask|ButtonReleaseMask;
XSelectInput(dsp,win,eventMask); // override prev


int i=0;


do {
i++;
XNextEvent( dsp, &evt ); // calls XFlush()
usleep(200);
time_ptr2 = time(NULL);
tm_local2 = localtime(&time_ptr2);
seconds = difftime(time(NULL), time_ptr);

XResizeWindow(dsp, win, 200 + (i % 11), 200 + (i % 11));
} while( evt.type != ButtonRelease && seconds < 1.0 );


XDestroyWindow( dsp, win );
XCloseDisplay( dsp );
dsp = NULL;


}
catch (int ez) { printf("%i\n", ez); }


return 0;

Thanks go to …

… for today’s work.

You can also see this play out at WordPress 4.1.1′s C++ X11 Analogue Clock Animation Tutorial.


Previous relevant C++ X11 Analogue Clock Primer Tutorial is shown below.

C++ X11 Analogue Clock Primer Tutorial

C++ X11 Analogue Clock Primer Tutorial

Continuing on with the X11 ideas of the recent Inkscape Vector Image Editor Watermark Tutorial blog posting thread, today we turn our attention to you creating the software …

  • for a single snapshot analogue clock … in an …
  • X11 (for us, MacBook Pro Terminal) window … via …
  • C++ … compiled via GCC, the GNU compiler, as per …

  • g++ -I /usr/X11/include -L /usr/X11/lib -o x1 x1.cc -lX11
  • execute via …

    ./x1

… as you can see in action with today’s tutorial picture.

Of huge help as a resource for the basis of C++ code, thanks, was …


Previous relevant Inkscape Vector Image Editor Watermark Tutorial is shown below.

Inkscape Vector Image Editor Watermark Tutorial

Inkscape Vector Image Editor Watermark Tutorial

It’s probably a dual edge sword an uploader’s attitude to watermarks. For some it may be annoying that an image is not freeware when pretty non-specific and uncontroversial. For others they may like watermarks for a couple of reasons …

  • They, too, find they want to protect their content in some way … and, as is often the case with me …
  • They like the aesthetics of watermarks

And this is where we rejoin the recent Inkscape (desktop application vector image editor) discussions of recent times you can read about at Inkscape Vector Image Editor Logo Tutorial and start considering Inkscape’s talents with layers, a similar talent to that of Gimp.

To research this we came upon this excellent “Add a Watermark in Inkscape” link, thanks. It got us using Inkscape’s …

  • Layer -> AddLayer…
  • Object -> Fill and Stroke…

… as we present ideas helped by “Add a Watermark in Inkscape” to help with this creation of …

(Export to) PNG result (two layers get exported to one)
(Export to) SVG result (retains the two layers)
  1. Be in Inkscape (via XQuartz)
  2. File -> Import (the Banner PNG)
  3. Select Layer > Add Layer. Placing the watermark on a separate layer makes it easier for you to move or alter later.

  4. Select Add to create the new layer.

  5. Add some text that you have prepared ahead of time (that being website, email, phone number etcetera) via Text -> Text and Font… window for Font Family and 8px size
  6. Select that text
  7. Go to Object > Fill and Stroke.

  8. Select the Fill tab (if it isn’t already selected), then drag the Opacity slider to the left to make the text semi-transparent.

  9. Once satisfied, you can save the file and export the image in various formats including PNG.

    … and we would add, to retain layers save as “Inkscape SVG”


Previous relevant Inkscape Vector Image Editor Logo Tutorial is shown below.

Inkscape Vector Image Editor Logo Tutorial

Inkscape Vector Image Editor Logo Tutorial

A lot of users like consistency with business related matters, such as your company’s banner, letterhead, email signature and today’s logo ideas we’re adding onto the recent Inkscape Vector Image Editor Business Card Tutorial.

The sad bit of the logo changeover from old …

Old New
Old logo Old logo
Old logo Old logo

… to new is to lose the “quirky” aspects to the “spider” and “web” connection, but a relief that now we have a much more easily recreateable logo based on shapes and linework and calligraphy that the Inkscape desktop application is so good at.

Again, to aid with consistency, we base the logo on the previously created “banner”, much like we worked it with the “business card”, as per …

  1. Be in Inkscape (via XQuartz)
  2. File -> New from Template…
    Business Card A8 (74mm x 52mm) Generic canvas… set Custom Width: 102px, Custom Height: 77px … click “Create from Template” button
  3. File -> Import (the Banner PNG)
  4. Fit into a Business Card Canvas size
  5. Add some text that you have
    prepared ahead of time (as above) …
    and we hope to get result
    like or better than at left
    “Draw Bezier curves and straight lines” work being the four black lines of an “m” that breaks the yellow ribbon calligraphy into (an imagined) “r” and “j” for the letters RJM within the company name “RJM Programming”, and use the “Rectangle” functionality to overlay a white rectangle on top of the text (we had for the “Banner”)
  6. Save As… PNG to MAMP document root
  7. Show Safari web browser sanity
    check
  8. Back at Inkscape (via XQuartz)
    use File -> Print to
    additionally sanity check

… and in turn, that created logo can “fit into” that second row logo, with the white background, above, in a similar fashion.

Along the way, implementing this to the domain landing pages and blog, we noted, again, as we did at the recent Wikipedia Flipcard Quiz Emoji Tutorial

  • Sometimes when you involve HTML iframe elements and you have an issue with scroll bars that you do not want the CSS styling (with the iframe HTML) of …

    <style>
    * { overflow: hidden !important; }
    </style>

    … can resolve issues … and …
  • Did you know?

    When implementing many HTML img element change type of modifications, you make a change and nothing appears to happen, you (barring idiocy) may have run into an issue where the web browser you are on prefers to keep showing that image (img element) from the cache. So might other users (who have visited your website in the past) out there. But to force the cache to rethink itself both the …

    1. HTML iframe src= URL … and …
    2. HTML img src= (image) URL within that iframe’s HTML

    … could benefit, and most likely not be in any way adversely affected, by modifying the ? and/or & arguments of the URL (yes, even for image URLs)

… as we show you with today’s tutorial picture.


Previous relevant Inkscape Vector Image Editor Business Card Tutorial is shown below.

Inkscape Vector Image Editor Business Card Tutorial

Inkscape Vector Image Editor Business Card Tutorial

Yesterday’s Inkscape Vector Image Editor Banner Tutorial set us to thinking that we’d like to base an A8 business card … spoiler alert …

Inkscape Vector Image Editor Business Card Tutorial
… on the vector graphics and even that text of the banner …
Inkscape Vector Image Editor Banner Tutorial

… created via the steps shown in the YouTube video below …

And below is that YouTube video’s transcript (plus the Save As (step) we forgot (on the actual video’s transcript)) …

Website: https://www.rjmprogramming.com.au
Email: rmetcalfe@rjmprogramming.com.au
Telephone: 61 2 95163479
ABN: 83 204 975 606

Dear Viewer,

Welcome to macOS Inkscape (via XQuartz)
Business Card (via Banner 300x350px)
creation tutorial. We will:

  1. Be in Inkscape (via XQuartz)
  2. File -> New from Template…
    Business Card A8 (74mm x 52mm)
  3. File -> Import (the Banner PNG)
  4. Fit into a Business Card size
  5. Add some text that you have
    prepared ahead of time (as above) …
    and we hope to get result
    like or better than at left
  6. Save As… PNG to MAMP document root
  7. Show Safari web browser sanity
    check
  8. Back at Inkscape (via XQuartz)
    use File -> Print to
    additionally sanity check


Thanks for watching.

RJM Programming


Previous relevant Inkscape Vector Image Editor Banner Tutorial is shown below.

Inkscape Vector Image Editor Banner Tutorial

Inkscape Vector Image Editor Banner Tutorial

We got a job recently to create a banner for RJM Programming. No worries, for our MacBook Pro runnning macOS Mojave 10.14.5. Think Pages or Gimp just for starters (or read this useful link). But our specification involved a requirement for 300×350 pixels, which is not a popular banner size. Of course, you can “work” desktop graphical editors to output data in a variety of formats and sizes, but we think it might be best to decide on a method that comes from a “300×350 banner” online search. And examining the resultant links got us to revisit the “vector graphics champion” freeware (and open source) Inkscape desktop application (added to our The Best Things In Life Are Free … list) we last talked about at Inkscape Vector Image Editor Primer Tutorial.

And so, with the great Inkscape, how did we create our 300×350 pixel banner below?

In broad brush terms …

  1. Click the Inkscape icon (which, after install, we arranged to reside in the Dock down the bottom of the screen)
  2. File -> New … for blank vector graphics document … but we direct your attention to the “New from Template…” which could be really useful for you to avoid having to do the step below …
  3. File -> Document Properties … Custom Size: Units – pixels, Width – 300, Height – 350 … Viewbox: Width – 300, Height – 350 … Close the Document Properties window via red close icon at top left
  4. Did the vector graphics artwork, involving, for us, Create 3d boxes, Create and edit text objects, Draw calligraphic or brush strokes
  5. File -> Save As… this is where we learn that Inkscape may be a vector graphics editor, but that doesn’t mean you can’t Save As another image type, and so with the Type dropdown, we choose Cairo PNG (*.png) (from the default Inkscape SVG (*.svg) format) and after arranging a good path to save to, we entered Name: drawing.png … and clicked Save button
  6. Separately, to check the 300×350 pixel requirement, we open our MAMP directory /Applications/MAMP/htdocs/drawing.png as HTTP://localhost:8888/drawing.png (in a Safari web browser window), open Develop -> Show Web Inspector and click the Inspect button to highlight our Inkscape created PNG image to confirm its size as 300×350 pixels

… and rest assured it is possible via Inkscape’s File -> Open… to open this (non-vector) PNG image that gets Imported back into the vector graphics that is Inkscape’s thangthing.

Did you know?

We’re runnning macOS Mojave 10.14.5 here on this MacBook Pro in August, 2019. Inkscape needs an X11 terminal application to interface to, that being (called) XQuartz in this day and age. But installing the 2.7.11 most recent XQuartz version, at the time of writing, caused issues with the Inkscape 0.92.2 installation. You’d click the Inkscape icon and in the dock it would jump up and down then effectively die. Even in Finder, Ctrl clicking to reveal Package Contents and get to the Unix executable in the Contents and then macOS folders, to click, same problem. But, thanks to the advice at this great link, we found that going back through the XQuartz version releases to its 2.7.9 version cleared up all these issues.


Previous relevant Inkscape Vector Image Editor Primer Tutorial is shown below.

Inkscape Vector Image Editor Primer Tutorial

Inkscape Vector Image Editor Primer Tutorial

As far as image editing goes at RJM Programming, we turn to …

  • PaintBrush (the Mac OS X one) for more than 90% of the simpler work … and then use …
  • Preview (Mac OS X) occasionally to do with resizing tasks … but, more often, for the rest of the work we use …
  • Gimp (Mac OS X desk application as XQuartz or X11) for jobs requiring special effects or filters or opacity or colourization or hue control

But what if you want to “Export As…” SVG? None of the applications above, “out of the box” “Export As…” SVG. First off, let’s get a reason for this from this very useful link, thanks …

GIMP is a raster graphics editor application. SVG is a form of vector graphics. If you want to edit SVG files, you should install the inkscape package and use Inkscape instead.

Yes, the SVG image format is a vector graphics image format, and that is the difference. So we went along with the advice and used, for our Mac OS X system the DMG method of (free, open source) install at the Inkscape website to get things rolling along.

Today’s PDF slideshow takes it up from that point, showing us Creating a 3D Box and dragging our way to creating a 3D Box shape that we “Save As…” (because now we are well and truly in the “vector” woooorrrrrrlllllld) /Applications/MAMP/htdocs/drawing.svg … why? Well, it’s our way to remind you, as we so often do, that the MAMP local Apache/PHP/MySql web server document root, by default, points at /Applications/MAMP/htdocs/ and in a web browser, with MAMP activated, points at (the URL prefix) HTTP://localhost:8888/ and so us lobbing onto …


HTTP://localhost:8888/drawing.svg

… has you seeing what we saw on MAMP (and then we uploaded this to the RJM Programming website place you are accessing with the link above). What you need to do this is a (s)ftp desktop application like FileZilla. Web server maintenance 101.

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 Animation, Operating System, Tutorials, eLearning | Tagged , , , , , , , , , , , , , , , | Leave a comment

C++ X11 Analogue Clock Primer Tutorial

C++ X11 Analogue Clock Primer Tutorial

C++ X11 Analogue Clock Primer Tutorial

Continuing on with the X11 ideas of the recent Inkscape Vector Image Editor Watermark Tutorial blog posting thread, today we turn our attention to you creating the software …

  • for a single snapshot analogue clock … in an …
  • X11 (for us, MacBook Pro Terminal) window … via …
  • C++ … compiled via GCC, the GNU compiler, as per …

  • g++ -I /usr/X11/include -L /usr/X11/lib -o x1 x1.cc -lX11
  • execute via …

    ./x1

… as you can see in action with today’s tutorial picture.

Of huge help as a resource for the basis of C++ code, thanks, was …

You can also see this play out at WordPress 4.1.1′s C++ X11 Analogue Clock Primer Tutorial.


Previous relevant Inkscape Vector Image Editor Watermark Tutorial is shown below.

Inkscape Vector Image Editor Watermark Tutorial

Inkscape Vector Image Editor Watermark Tutorial

It’s probably a dual edge sword an uploader’s attitude to watermarks. For some it may be annoying that an image is not freeware when pretty non-specific and uncontroversial. For others they may like watermarks for a couple of reasons …

  • They, too, find they want to protect their content in some way … and, as is often the case with me …
  • They like the aesthetics of watermarks

And this is where we rejoin the recent Inkscape (desktop application vector image editor) discussions of recent times you can read about at Inkscape Vector Image Editor Logo Tutorial and start considering Inkscape’s talents with layers, a similar talent to that of Gimp.

To research this we came upon this excellent “Add a Watermark in Inkscape” link, thanks. It got us using Inkscape’s …

  • Layer -> AddLayer…
  • Object -> Fill and Stroke…

… as we present ideas helped by “Add a Watermark in Inkscape” to help with this creation of …

(Export to) PNG result (two layers get exported to one)
(Export to) SVG result (retains the two layers)
  1. Be in Inkscape (via XQuartz)
  2. File -> Import (the Banner PNG)
  3. Select Layer > Add Layer. Placing the watermark on a separate layer makes it easier for you to move or alter later.

  4. Select Add to create the new layer.

  5. Add some text that you have prepared ahead of time (that being website, email, phone number etcetera) via Text -> Text and Font… window for Font Family and 8px size
  6. Select that text
  7. Go to Object > Fill and Stroke.

  8. Select the Fill tab (if it isn’t already selected), then drag the Opacity slider to the left to make the text semi-transparent.

  9. Once satisfied, you can save the file and export the image in various formats including PNG.

    … and we would add, to retain layers save as “Inkscape SVG”


Previous relevant Inkscape Vector Image Editor Logo Tutorial is shown below.

Inkscape Vector Image Editor Logo Tutorial

Inkscape Vector Image Editor Logo Tutorial

A lot of users like consistency with business related matters, such as your company’s banner, letterhead, email signature and today’s logo ideas we’re adding onto the recent Inkscape Vector Image Editor Business Card Tutorial.

The sad bit of the logo changeover from old …

Old New
Old logo Old logo
Old logo Old logo

… to new is to lose the “quirky” aspects to the “spider” and “web” connection, but a relief that now we have a much more easily recreateable logo based on shapes and linework and calligraphy that the Inkscape desktop application is so good at.

Again, to aid with consistency, we base the logo on the previously created “banner”, much like we worked it with the “business card”, as per …

  1. Be in Inkscape (via XQuartz)
  2. File -> New from Template…
    Business Card A8 (74mm x 52mm) Generic canvas… set Custom Width: 102px, Custom Height: 77px … click “Create from Template” button
  3. File -> Import (the Banner PNG)
  4. Fit into a Business Card Canvas size
  5. Add some text that you have
    prepared ahead of time (as above) …
    and we hope to get result
    like or better than at left
    “Draw Bezier curves and straight lines” work being the four black lines of an “m” that breaks the yellow ribbon calligraphy into (an imagined) “r” and “j” for the letters RJM within the company name “RJM Programming”, and use the “Rectangle” functionality to overlay a white rectangle on top of the text (we had for the “Banner”)
  6. Save As… PNG to MAMP document root
  7. Show Safari web browser sanity
    check
  8. Back at Inkscape (via XQuartz)
    use File -> Print to
    additionally sanity check

… and in turn, that created logo can “fit into” that second row logo, with the white background, above, in a similar fashion.

Along the way, implementing this to the domain landing pages and blog, we noted, again, as we did at the recent Wikipedia Flipcard Quiz Emoji Tutorial

  • Sometimes when you involve HTML iframe elements and you have an issue with scroll bars that you do not want the CSS styling (with the iframe HTML) of …

    <style>
    * { overflow: hidden !important; }
    </style>

    … can resolve issues … and …
  • Did you know?

    When implementing many HTML img element change type of modifications, you make a change and nothing appears to happen, you (barring idiocy) may have run into an issue where the web browser you are on prefers to keep showing that image (img element) from the cache. So might other users (who have visited your website in the past) out there. But to force the cache to rethink itself both the …

    1. HTML iframe src= URL … and …
    2. HTML img src= (image) URL within that iframe’s HTML

    … could benefit, and most likely not be in any way adversely affected, by modifying the ? and/or & arguments of the URL (yes, even for image URLs)

… as we show you with today’s tutorial picture.


Previous relevant Inkscape Vector Image Editor Business Card Tutorial is shown below.

Inkscape Vector Image Editor Business Card Tutorial

Inkscape Vector Image Editor Business Card Tutorial

Yesterday’s Inkscape Vector Image Editor Banner Tutorial set us to thinking that we’d like to base an A8 business card … spoiler alert …

Inkscape Vector Image Editor Business Card Tutorial
… on the vector graphics and even that text of the banner …
Inkscape Vector Image Editor Banner Tutorial

… created via the steps shown in the YouTube video below …

And below is that YouTube video’s transcript (plus the Save As (step) we forgot (on the actual video’s transcript)) …

Website: https://www.rjmprogramming.com.au
Email: rmetcalfe@rjmprogramming.com.au
Telephone: 61 2 95163479
ABN: 83 204 975 606

Dear Viewer,

Welcome to macOS Inkscape (via XQuartz)
Business Card (via Banner 300x350px)
creation tutorial. We will:

  1. Be in Inkscape (via XQuartz)
  2. File -> New from Template…
    Business Card A8 (74mm x 52mm)
  3. File -> Import (the Banner PNG)
  4. Fit into a Business Card size
  5. Add some text that you have
    prepared ahead of time (as above) …
    and we hope to get result
    like or better than at left
  6. Save As… PNG to MAMP document root
  7. Show Safari web browser sanity
    check
  8. Back at Inkscape (via XQuartz)
    use File -> Print to
    additionally sanity check


Thanks for watching.

RJM Programming


Previous relevant Inkscape Vector Image Editor Banner Tutorial is shown below.

Inkscape Vector Image Editor Banner Tutorial

Inkscape Vector Image Editor Banner Tutorial

We got a job recently to create a banner for RJM Programming. No worries, for our MacBook Pro runnning macOS Mojave 10.14.5. Think Pages or Gimp just for starters (or read this useful link). But our specification involved a requirement for 300×350 pixels, which is not a popular banner size. Of course, you can “work” desktop graphical editors to output data in a variety of formats and sizes, but we think it might be best to decide on a method that comes from a “300×350 banner” online search. And examining the resultant links got us to revisit the “vector graphics champion” freeware (and open source) Inkscape desktop application (added to our The Best Things In Life Are Free … list) we last talked about at Inkscape Vector Image Editor Primer Tutorial.

And so, with the great Inkscape, how did we create our 300×350 pixel banner below?

In broad brush terms …

  1. Click the Inkscape icon (which, after install, we arranged to reside in the Dock down the bottom of the screen)
  2. File -> New … for blank vector graphics document … but we direct your attention to the “New from Template…” which could be really useful for you to avoid having to do the step below …
  3. File -> Document Properties … Custom Size: Units – pixels, Width – 300, Height – 350 … Viewbox: Width – 300, Height – 350 … Close the Document Properties window via red close icon at top left
  4. Did the vector graphics artwork, involving, for us, Create 3d boxes, Create and edit text objects, Draw calligraphic or brush strokes
  5. File -> Save As… this is where we learn that Inkscape may be a vector graphics editor, but that doesn’t mean you can’t Save As another image type, and so with the Type dropdown, we choose Cairo PNG (*.png) (from the default Inkscape SVG (*.svg) format) and after arranging a good path to save to, we entered Name: drawing.png … and clicked Save button
  6. Separately, to check the 300×350 pixel requirement, we open our MAMP directory /Applications/MAMP/htdocs/drawing.png as HTTP://localhost:8888/drawing.png (in a Safari web browser window), open Develop -> Show Web Inspector and click the Inspect button to highlight our Inkscape created PNG image to confirm its size as 300×350 pixels

… and rest assured it is possible via Inkscape’s File -> Open… to open this (non-vector) PNG image that gets Imported back into the vector graphics that is Inkscape’s thangthing.

Did you know?

We’re runnning macOS Mojave 10.14.5 here on this MacBook Pro in August, 2019. Inkscape needs an X11 terminal application to interface to, that being (called) XQuartz in this day and age. But installing the 2.7.11 most recent XQuartz version, at the time of writing, caused issues with the Inkscape 0.92.2 installation. You’d click the Inkscape icon and in the dock it would jump up and down then effectively die. Even in Finder, Ctrl clicking to reveal Package Contents and get to the Unix executable in the Contents and then macOS folders, to click, same problem. But, thanks to the advice at this great link, we found that going back through the XQuartz version releases to its 2.7.9 version cleared up all these issues.


Previous relevant Inkscape Vector Image Editor Primer Tutorial is shown below.

Inkscape Vector Image Editor Primer Tutorial

Inkscape Vector Image Editor Primer Tutorial

As far as image editing goes at RJM Programming, we turn to …

  • PaintBrush (the Mac OS X one) for more than 90% of the simpler work … and then use …
  • Preview (Mac OS X) occasionally to do with resizing tasks … but, more often, for the rest of the work we use …
  • Gimp (Mac OS X desk application as XQuartz or X11) for jobs requiring special effects or filters or opacity or colourization or hue control

But what if you want to “Export As…” SVG? None of the applications above, “out of the box” “Export As…” SVG. First off, let’s get a reason for this from this very useful link, thanks …

GIMP is a raster graphics editor application. SVG is a form of vector graphics. If you want to edit SVG files, you should install the inkscape package and use Inkscape instead.

Yes, the SVG image format is a vector graphics image format, and that is the difference. So we went along with the advice and used, for our Mac OS X system the DMG method of (free, open source) install at the Inkscape website to get things rolling along.

Today’s PDF slideshow takes it up from that point, showing us Creating a 3D Box and dragging our way to creating a 3D Box shape that we “Save As…” (because now we are well and truly in the “vector” woooorrrrrrlllllld) /Applications/MAMP/htdocs/drawing.svg … why? Well, it’s our way to remind you, as we so often do, that the MAMP local Apache/PHP/MySql web server document root, by default, points at /Applications/MAMP/htdocs/ and in a web browser, with MAMP activated, points at (the URL prefix) HTTP://localhost:8888/ and so us lobbing onto …


HTTP://localhost:8888/drawing.svg

… has you seeing what we saw on MAMP (and then we uploaded this to the RJM Programming website place you are accessing with the link above). What you need to do this is a (s)ftp desktop application like FileZilla. Web server maintenance 101.

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 Operating System, Tutorials, eLearning | Tagged , , , , , , , , , , , , , , | Leave a comment

Mobile Onmouseover Event Alternative Tutorial

Mobile Onmouseover Event Alternative Tutorial

Mobile Onmouseover Event Alternative Tutorial

Yesterday’s Smooth Spinner Game Tutorial

Yes, non-mobile players will score better than mobile device players, because of the existence of an onmouseover (ie. hover) event. This same lament for mobile devices is a similar lament regarding a lot of Ajax functionality thoughts, which were very suited to making use of the onmouseover event.

… is a statement with contestable parts. For example, the CSS (ie. styling look) of a “hover” effect on mobile devices can be achieved, am sure. But what we were saying yesterday was that the onmouseover event does not exist in the mobile Javascript event “woooooorrrrrrlllld”, simple as that. Simulation is not out of the question though, we have no doubt. In really simple cases, the “ontouchstart” event alone, may suffice. Not with today’s “make our latest project more onmouseover feeling for mobile platforms quest”. Perhaps you should read the article “How do I simulate a hover with a touch in touch enabled browsers?” We did, and tried some ideas from it, and settled on an ontouchmove based “simulation” (we are not pretending it is the same for the user, but if you act like you’re sweeping on each number button with a touch move gesture, we are supporting this with today’s work).

Still think though, speed-wise the non-mobiles will win with the “Smooth Spinner Game” of yesterday. So, what ontouch event goings on helped here …

  • ontouchmove is the mobile event that “takes over” the non-mobile onmouseover in the event code snippet …

    cell.addEventListener('touchmove', handler);

    … calling on the global variable arrangements …

    var prevc=null;
    var overevent='mouseover';
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    overevent='touchmove';
    }

    used in the function handler (event) code snippet below …

    if (event.type == overevent) {
    event.target.style.background = 'pink'
    if (huhc != lasthuhc) { document.getElementById('sofar').innerHTML+=huhc; if (huhc != '') { lasthuhc=huhc; if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (document.getElementById('myq').innerHTML.indexOf('=') == -1) { document.getElementById('myq').innerHTML+='<br>=' + huhc; } else { document.getElementById('myq').innerHTML+='' + huhc; } setTimeout(antihuhc, 400); } else { setTimeout(antihuhc, 200); } } }
    if (modeofgame == "Smooth Spinner Game") {
    if (prevcell == '') {
    inarow=1;
    timeend=null;
    timestart=new Date();
    prevc=event.target;
    prevcell=str(event.target);
    prevcid=thiscid;
    } else if (thiscid == prevcid) {
    inarow=inarow;
    } else if (eval(10 + thiscid) == eval(one + prevcid) || eval(10 + thiscid) == eval(otherone + prevcid) || eval(-10 + thiscid) == eval(one + prevcid) || eval(-10 + thiscid) == eval(otherone + prevcid) || eval(0 + thiscid) == eval(one + prevcid) || eval(0 + thiscid) == eval(otherone + prevcid)) {
    if (inarow == 1) {
    if (eval(10 + thiscid) == eval(one + prevcid) || eval(-10 + thiscid) == eval(one + prevcid) || eval(0 + thiscid) == eval(one + prevcid)) {
    otherone=one;
    } else {
    one=otherone;
    }
    }
    inarow++;
    if (prevc) {
    prevc.style.background = '';
    }

    prevc=event.target;
    prevcell=str(event.target);
    prevcid=thiscid;
    } else {
    timeend=new Date();
    document.getElementById('score').style.display='block';
    document.getElementById('score').innerHTML='Not smooth enough ... though you were smooth enough for ' + inarow + ' in a row at speed value of ' + eval(1000 * inarow / (timeend - timestart));
    alert(document.getElementById('score').innerHTML);
    if (prevc) {
    prevc.style.background = '';
    }

    prevcell='';
    prevc=null;
    inarow=0;
    one=1;
    otherone-1;
    }
    }
    }

    … and some more global variable arrangements …

    var prec=null;

    helping out the …

    function str(el) {
    huhc='';
    if (!el) return "null"
    if (('' + el.className).indexOf('cell') != -1) { thiscid=eval(('' + el.className).split('cell')[1]); huhc=el.innerHTML; }
    if (prec && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    prec.style.background='';
    prec=el;
    } else if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    prec=el;
    }

    return el.id || el.className || el.tagName;
    }
  • ontouchstart is suppressed to aid with suppression of scrolling gestures …

    cell.addEventListener("touchstart", function(e){ e.preventDefault(); }, true);
  • ontouchend …

    if (event.type == 'touchend') {
    event.target.style.background = '';
    }

… and because we are a bit shy of scrolling on mobile here three things can help …

  1. the head meta viewport tag …

    <meta name="viewport" content="width=device-width, initial-scale=1" />
  2. when transforming table cell (td and th) elements to “overlay” style HTML div elements on mobile you can have it fall on the mobile screen to the left of screen until we introduced another global variable arrangement …

    var woff=0;

    helping out the left/width Javascript function …

    function percentw(inws) {
    if (('' + inws).indexOf('-') != -1 && woff == 0) { woff=Math.abs(eval(('' + inws))); }
    return eval(woff + eval('' + inws.split('px')[0])) + 'px';
    document.getElementById('divs').style.width='' + deviceWidth + 'px'; // obsolete idea to use percentages
    return '' + eval(eval(eval(inws.split('px')[0]) * 100) / deviceWidth) + '%'; // obsolete idea to use percentages
    }
  3. we add code to add more intelligence into the middle of screen table th elements for mobile platforms, so that the top of screen is not so vital to functionality, as per the keyboard event changes

    function precheckans(keyUpEvent) {
    var isnumber=false;
    if (!keyUpEvent.ctrlKey && !keyUpEvent.metaKey) {
    if (((keyUpEvent.which || keyUpEvent.keyCode) >= 48 && (keyUpEvent.which || keyUpEvent.keyCode) <= 57) && !keyUpEvent.shiftKey) {
    huhc='' + eval(-48 + (keyUpEvent.which || keyUpEvent.keyCode));
    isnumber=true;
    }
    if (isnumber) {
    document.getElementById('sofar').innerHTML+=huhc; if (huhc != '') { lasthuhc=huhc; if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (document.getElementById('myq').innerHTML.indexOf('=') == -1) { document.getElementById('myq').innerHTML+='<br>=' + huhc; } else { document.getElementById('myq').innerHTML+='' + huhc; } setTimeout(antihuhc, 400); } else { setTimeout(antihuhc, 200); } }
    } else {
    checkans();
    }
    }
    }

    and in the onclick event logic snippet …

    if (event.type == 'click') {
    if (huhc != lasthuhc) {
    document.getElementById('sofar').innerHTML+=huhc;
    if (huhc != '') {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    if (document.getElementById('myq').innerHTML.indexOf('=') == -1) { document.getElementById('myq').innerHTML+='<br>=' + huhc; } else { document.getElementById('myq').innerHTML+='' + huhc; }
    }

    lasthuhc=huhc;
    setTimeout(antihuhc, 200);
    }
    }
    /* more logic below */
    }

    … so that the user answer and their score are now more likely to sit within the “fold view” of the user as they are positioned on the mobile screen

Take a look at the changed mo_me_rt_t.htm ternary purpose live run link, today.

You can also see this play out at WordPress 4.1.1′s Mobile Onmouseover Event Alternative Tutorial.


Previous relevant Smooth Spinner Game Tutorial is shown below.

Smooth Spinner Game Tutorial

Smooth Spinner Game Tutorial

Adding onto the recent Onmouseover and Onmouseout Event Monitoring Tutorial

  • Simple Maths Timer Game
  • Onmouseover and Onmouseout Monitor … we add, today, a new …
  • Smooth Spinner Game

… test of a user’s control, nerve and patience, where they need to hover (or click, for mobile devices) in consecutive order to maximise their score, that is also made up of a speed component to put dawdlers in their place … ie. not nirvana.

Yes, non-mobile players will score better than mobile device players, because of the existence of an onmouseover (ie. hover) event. This same lament for mobile devices is a similar lament regarding a lot of Ajax functionality thoughts, which were very suited to making use of the onmouseover event.

With this game we can work in either …

  • Simple Maths Timer Game’s table cell mode … or …
  • Onmouseover and Onmouseout Monitor’s div element mode

… and so it is really only the new scoring arrangements, and the changing of “binary” H1 click toggling to “ternary” (or more) select element selection, involved in the changed mo_me_rt_t.htm dualternary purpose live run link, today.

Before we leave this posting a coding approach we’d never used up until now got involved in the use of the new select (dropdown) element introduced. We gave “ID” properties to all option sub-members to the select element. We also wanted to keep the traditional size=1 way of select elements (and always on mobile platforms), aware of not overusing height up the top of the webpage. The select element can serve a dual purpose here …

  • always show, in words, the other two modes of functionality, to help the user … and this can be contained in that first option element’s innerHTML property … and…
  • the other two option elements can be rearranged value-wise and innerHTML-wise (they are always the same, for these two) for uniquifying option values, and at the end of the onchange logic …

    function stoggle(osel) {
    var three=3, wasv='', newoi=' versus ', cs=['Simple Maths Timer Game','Onmouseover and Onmouseout Monitor','Smooth Spinner Game'], nv=osel.value;
    if (osel.value != modeofgame) {
    wasv=document.getElementById('myh1').innerHTML.split('&')[0].split('<')[0];
    document.getElementById('soption').value=nv;
    for (var ics=0; ics<cs.length; ics++) {
    if (cs[ics] != nv) { if (newoi == ' versus ') { newoi+=cs[ics]; document.getElementById('o2').value=cs[ics]; document.getElementById('o2').innerHTML=cs[ics]; } else { newoi+=' or ' + cs[ics]; document.getElementById('o' + three).value=cs[ics]; document.getElementById('o' + three).innerHTML=cs[ics]; three++; } }
    }
    document.getElementById('soption').innerHTML=newoi;
    document.getElementById('myh1').innerHTML=nv;
    document.getElementById('stoggle').value=nv;
    modeofgame=nv;
    if (modeofgame == "Simple Maths Timer Game" && wasv != "Simple Maths Timer Game") { //"Onmouseover and Onmouseout Monitor") {
    location.href=document.URL;
    } else if (modeofgame == "Onmouseover and Onmouseout Monitor") {
    divonl();
    } else if (modeofgame == "Smooth Spinner Game") {
    document.getElementById('score').innerHTML='';
    document.getElementById('sofar').style.display='none';
    document.getElementById('bclear').style.display='none';
    document.getElementById('prebonus').style.display='none';
    document.getElementById('bonus').style.display='none';
    if (wasv == "Simple Maths Timer Game") {
    document.getElementById('myq').style.fontSize='10px';
    document.getElementById('mya').style.fontSize='10px';
    document.getElementById('myq').innerHTML='Hover or Click<br> clockwise or anticlockwise';
    document.getElementById('mya').innerHTML=' ... as fast<br> as you can ...';
    }
    }
    }
    }

    … always setting the select (dropdown) value equal to the first option value, and so always showing, in words, the full picture, for the user … yoo hoo, you can wake up now!

Previous relevant Onmouseover and Onmouseout Event Monitoring Tutorial is shown below.

Onmouseover and Onmouseout Event Monitoring Tutorial

Onmouseover and Onmouseout Event Monitoring Tutorial

Perhaps you were reading yesterday’s Maths Ouija Board Quiz Primer Tutorial and wondering “what gives with the ‘mo_me_rt_t.htm’ name of the web application”? Well, the original inspiration at “Moving the mouse: mouseover/out, mouseenter/leave”, thanks, was for an Onmouseover and Onmouseout Event Monitor web application, and today we go back and add to …

  • Maths Ouija Board Quiz … based on table cells … to …
  • Onmouseover and Onmouseout Event Monitoring … based on div elements …

… because nested hierarchical element arrangements like with HTML tables (with their cells) muddy the waters quite a bit trying to show the user a log also involving …

These events are special, because they have property relatedTarget. This property complements target. When a mouse leaves one element for another, one of them becomes target, and the other one – relatedTarget.

For mouseover:

event.target – is the element where the mouse came over.
event.relatedTarget – is the element from which the mouse came (relatedTarget → target).
For mouseout the reverse:

event.target – is the element that the mouse left.
event.relatedTarget – is the new under-the-pointer element, that mouse left for (target → relatedTarget).

… and we want to mull over this, starting by logging event behaviour. We allow for an HTML h1 click/touch toggling of functionality, and we initially have the table cells show, but a toggling, maps over these table cells, position and all, with …

  • HTML divs …
  • CSS styled like table cells (ie. td) … and using …
  • HTML table cell (ie. td) outerHTML property … added with …
  • “overlay” favourites …
    1. position:absolute property
    2. [HTML element].getBoundingClientRect() method to arrive with properties top, left, width, height (as we did with HTML map area subelements mapped to div when we presented Very Versus Too Game Primer Tutorial)

    … and “underlay” [HTML element].style.display=’none’ or [HTML element].style.visibility=’hidden’

See the changed mo_me_rt_t.htm dual purpose live run link.


Previous relevant Maths Ouija Board Quiz Primer Tutorial is shown below.

Maths Ouija Board Quiz Primer Tutorial

Maths Ouija Board Quiz Primer Tutorial

We’re not really using a ouija board with today’s Maths Quiz web application, but if you use the mouse or trackpad means by which to answer the Maths arithmetic, it can feel like an ouija board in play.

We’ve arranged answers that just involve numbers so can have it that …

  • keyboard numbers can be interpreted as part of a user’s answer …
  • keyboard non-numbers can be interpreted as go check the answer …
  • onmouseover or onclick of number buttons are interpreted as part of a user’s answer …
  • onmouseover or onclick of “Check Answer” buttons go check the answer

The third of those above you may wonder about double ups. We left a setTimeout period of no doubling up between onmouseover and onclick event logics to help here.

Today’s quiz scoring allows for bonus points for those quick to answer. The countdown of bonus points, as above, is achieved via a setTimeout timer.

Do you want to give today’s HTML/Javascript/CSS mo_me_rt_t.htm a go? We hope you do!

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 Event-Driven Programming, Tutorials, eLearning | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Smooth Spinner Game Tutorial

Smooth Spinner Game Tutorial

Smooth Spinner Game Tutorial

Adding onto the recent Onmouseover and Onmouseout Event Monitoring Tutorial

  • Simple Maths Timer Game
  • Onmouseover and Onmouseout Monitor … we add, today, a new …
  • Smooth Spinner Game

… test of a user’s control, nerve and patience, where they need to hover (or click, for mobile devices) in consecutive order to maximise their score, that is also made up of a speed component to put dawdlers in their place … ie. not nirvana.

Yes, non-mobile players will score better than mobile device players, because of the existence of an onmouseover (ie. hover) event. This same lament for mobile devices is a similar lament regarding a lot of Ajax functionality thoughts, which were very suited to making use of the onmouseover event.

With this game we can work in either …

  • Simple Maths Timer Game’s table cell mode … or …
  • Onmouseover and Onmouseout Monitor’s div element mode

… and so it is really only the new scoring arrangements, and the changing of “binary” H1 click toggling to “ternary” (or more) select element selection, involved in the changed mo_me_rt_t.htm dualternary purpose live run link, today.

Before we leave this posting a coding approach we’d never used up until now got involved in the use of the new select (dropdown) element introduced. We gave “ID” properties to all option sub-members to the select element. We also wanted to keep the traditional size=1 way of select elements (and always on mobile platforms), aware of not overusing height up the top of the webpage. The select element can serve a dual purpose here …

  • always show, in words, the other two modes of functionality, to help the user … and this can be contained in that first option element’s innerHTML property … and…
  • the other two option elements can be rearranged value-wise and innerHTML-wise (they are always the same, for these two) for uniquifying option values, and at the end of the onchange logic …

    function stoggle(osel) {
    var three=3, wasv='', newoi=' versus ', cs=['Simple Maths Timer Game','Onmouseover and Onmouseout Monitor','Smooth Spinner Game'], nv=osel.value;
    if (osel.value != modeofgame) {
    wasv=document.getElementById('myh1').innerHTML.split('&')[0].split('<')[0];
    document.getElementById('soption').value=nv;
    for (var ics=0; ics<cs.length; ics++) {
    if (cs[ics] != nv) { if (newoi == ' versus ') { newoi+=cs[ics]; document.getElementById('o2').value=cs[ics]; document.getElementById('o2').innerHTML=cs[ics]; } else { newoi+=' or ' + cs[ics]; document.getElementById('o' + three).value=cs[ics]; document.getElementById('o' + three).innerHTML=cs[ics]; three++; } }
    }
    document.getElementById('soption').innerHTML=newoi;
    document.getElementById('myh1').innerHTML=nv;
    document.getElementById('stoggle').value=nv;
    modeofgame=nv;
    if (modeofgame == "Simple Maths Timer Game" && wasv != "Simple Maths Timer Game") { //"Onmouseover and Onmouseout Monitor") {
    location.href=document.URL;
    } else if (modeofgame == "Onmouseover and Onmouseout Monitor") {
    divonl();
    } else if (modeofgame == "Smooth Spinner Game") {
    document.getElementById('score').innerHTML='';
    document.getElementById('sofar').style.display='none';
    document.getElementById('bclear').style.display='none';
    document.getElementById('prebonus').style.display='none';
    document.getElementById('bonus').style.display='none';
    if (wasv == "Simple Maths Timer Game") {
    document.getElementById('myq').style.fontSize='10px';
    document.getElementById('mya').style.fontSize='10px';
    document.getElementById('myq').innerHTML='Hover or Click<br> clockwise or anticlockwise';
    document.getElementById('mya').innerHTML=' ... as fast<br> as you can ...';
    }
    }
    }
    }

    … always setting the select (dropdown) value equal to the first option value, and so always showing, in words, the full picture, for the user … yoo hoo, you can wake up now!

You can also see this play out at WordPress 4.1.1′s Smooth Spinner Game Tutorial.


Previous relevant Onmouseover and Onmouseout Event Monitoring Tutorial is shown below.

Onmouseover and Onmouseout Event Monitoring Tutorial

Onmouseover and Onmouseout Event Monitoring Tutorial

Perhaps you were reading yesterday’s Maths Ouija Board Quiz Primer Tutorial and wondering “what gives with the ‘mo_me_rt_t.htm’ name of the web application”? Well, the original inspiration at “Moving the mouse: mouseover/out, mouseenter/leave”, thanks, was for an Onmouseover and Onmouseout Event Monitor web application, and today we go back and add to …

  • Maths Ouija Board Quiz … based on table cells … to …
  • Onmouseover and Onmouseout Event Monitoring … based on div elements …

… because nested hierarchical element arrangements like with HTML tables (with their cells) muddy the waters quite a bit trying to show the user a log also involving …

These events are special, because they have property relatedTarget. This property complements target. When a mouse leaves one element for another, one of them becomes target, and the other one – relatedTarget.

For mouseover:

event.target – is the element where the mouse came over.
event.relatedTarget – is the element from which the mouse came (relatedTarget → target).
For mouseout the reverse:

event.target – is the element that the mouse left.
event.relatedTarget – is the new under-the-pointer element, that mouse left for (target → relatedTarget).

… and we want to mull over this, starting by logging event behaviour. We allow for an HTML h1 click/touch toggling of functionality, and we initially have the table cells show, but a toggling, maps over these table cells, position and all, with …

  • HTML divs …
  • CSS styled like table cells (ie. td) … and using …
  • HTML table cell (ie. td) outerHTML property … added with …
  • “overlay” favourites …
    1. position:absolute property
    2. [HTML element].getBoundingClientRect() method to arrive with properties top, left, width, height (as we did with HTML map area subelements mapped to div when we presented Very Versus Too Game Primer Tutorial)

    … and “underlay” [HTML element].style.display=’none’ or [HTML element].style.visibility=’hidden’

See the changed mo_me_rt_t.htm dual purpose live run link.


Previous relevant Maths Ouija Board Quiz Primer Tutorial is shown below.

Maths Ouija Board Quiz Primer Tutorial

Maths Ouija Board Quiz Primer Tutorial

We’re not really using a ouija board with today’s Maths Quiz web application, but if you use the mouse or trackpad means by which to answer the Maths arithmetic, it can feel like an ouija board in play.

We’ve arranged answers that just involve numbers so can have it that …

  • keyboard numbers can be interpreted as part of a user’s answer …
  • keyboard non-numbers can be interpreted as go check the answer …
  • onmouseover or onclick of number buttons are interpreted as part of a user’s answer …
  • onmouseover or onclick of “Check Answer” buttons go check the answer

The third of those above you may wonder about double ups. We left a setTimeout period of no doubling up between onmouseover and onclick event logics to help here.

Today’s quiz scoring allows for bonus points for those quick to answer. The countdown of bonus points, as above, is achieved via a setTimeout timer.

Do you want to give today’s HTML/Javascript/CSS mo_me_rt_t.htm a go? We hope you do!

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 Event-Driven Programming, Tutorials, eLearning | Tagged , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Onmouseover and Onmouseout Event Monitoring Tutorial

Onmouseover and Onmouseout Event Monitoring Tutorial

Onmouseover and Onmouseout Event Monitoring Tutorial

Perhaps you were reading yesterday’s Maths Ouija Board Quiz Primer Tutorial and wondering “what gives with the ‘mo_me_rt_t.htm’ name of the web application”? Well, the original inspiration at “Moving the mouse: mouseover/out, mouseenter/leave”, thanks, was for an Onmouseover and Onmouseout Event Monitor web application, and today we go back and add to …

  • Maths Ouija Board Quiz … based on table cells … to …
  • Onmouseover and Onmouseout Event Monitoring … based on div elements …

… because nested hierarchical element arrangements like with HTML tables (with their cells) muddy the waters quite a bit trying to show the user a log also involving …

These events are special, because they have property relatedTarget. This property complements target. When a mouse leaves one element for another, one of them becomes target, and the other one – relatedTarget.

For mouseover:

event.target – is the element where the mouse came over.
event.relatedTarget – is the element from which the mouse came (relatedTarget → target).
For mouseout the reverse:

event.target – is the element that the mouse left.
event.relatedTarget – is the new under-the-pointer element, that mouse left for (target → relatedTarget).

… and we want to mull over this, starting by logging event behaviour. We allow for an HTML h1 click/touch toggling of functionality, and we initially have the table cells show, but a toggling, maps over these table cells, position and all, with …

  • HTML divs …
  • CSS styled like table cells (ie. td) … and using …
  • HTML table cell (ie. td) outerHTML property … added with …
  • “overlay” favourites …
    1. position:absolute property
    2. [HTML element].getBoundingClientRect() method to arrive with properties top, left, width, height (as we did with HTML map area subelements mapped to div when we presented Very Versus Too Game Primer Tutorial)

    … and “underlay” [HTML element].style.display=’none’ or [HTML element].style.visibility=’hidden’

See the changed mo_me_rt_t.htm dual purpose live run link.

You can also see this play out at WordPress 4.1.1′s Onmouseover and Onmouseout Event Monitoring Tutorial.


Previous relevant Maths Ouija Board Quiz Primer Tutorial is shown below.

Maths Ouija Board Quiz Primer Tutorial

Maths Ouija Board Quiz Primer Tutorial

We’re not really using a ouija board with today’s Maths Quiz web application, but if you use the mouse or trackpad means by which to answer the Maths arithmetic, it can feel like an ouija board in play.

We’ve arranged answers that just involve numbers so can have it that …

  • keyboard numbers can be interpreted as part of a user’s answer …
  • keyboard non-numbers can be interpreted as go check the answer …
  • onmouseover or onclick of number buttons are interpreted as part of a user’s answer …
  • onmouseover or onclick of “Check Answer” buttons go check the answer

The third of those above you may wonder about double ups. We left a setTimeout period of no doubling up between onmouseover and onclick event logics to help here.

Today’s quiz scoring allows for bonus points for those quick to answer. The countdown of bonus points, as above, is achieved via a setTimeout timer.

Do you want to give today’s HTML/Javascript/CSS mo_me_rt_t.htm a go? We hope you do!

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


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

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

Maths Ouija Board Quiz Primer Tutorial

Maths Ouija Board Quiz Primer Tutorial

Maths Ouija Board Quiz Primer Tutorial

We’re not really using a ouija board with today’s Maths Quiz web application, but if you use the mouse or trackpad means by which to answer the Maths arithmetic, it can feel like an ouija board in play.

We’ve arranged answers that just involve numbers so can have it that …

  • keyboard numbers can be interpreted as part of a user’s answer …
  • keyboard non-numbers can be interpreted as go check the answer …
  • onmouseover or onclick of number buttons are interpreted as part of a user’s answer …
  • onmouseover or onclick of “Check Answer” buttons go check the answer

The third of those above you may wonder about double ups. We left a setTimeout period of no doubling upo between onmouseover and onclick event logics to help here.

Today’s quiz scoring allows for bonus points for those quick to answer. The countdown of bonus points, as above, is achieved via a setTimeout timer.

Do you want to give today’s HTML/Javascript/CSS mo_me_rt_t.htm a go? We hope you do!

You can also see this play out at WordPress 4.1.1′s Maths Ouija Board Quiz Primer Tutorial.

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

Posted in Games, Tutorials, eLearning | Tagged , , , , , , , , , , , , , , | Leave a comment