Monday, 30 January 2017

Displaying Mathematical Expressions

If looking at this post on an android device, the equations will not display properly.
\[\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}\]It was with some difficulty that I've finally figured out how to display mathematical expressions properly in Blogger. The approach that I've adopted is to paste the following script just above the closing head tag in the blog's template:


The MathJax javascript will then render any LaTeX mathematical expressions, such as "\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}" (this is the one behind the expression at the top of this post). This site explains how to use the $ sign:


The double $ signs work fine but the single $ signs, that are supposed to give the inline expression, didn't work at first with the script as above. However, after pasting a modified script (see HMTL template), all was well, with both single dollar signs  and backward slash ( ...  backward slash ) being accepted.

Back on January 27th 2016, I made a post about the ASCIIMathML and the associated javascript program ASCIIMathML.js associated with it. Here is the text of that post:
The ASCIIMathML is a markup language that claims to be close to standard mathematical notation, easy to read and easy to type. In combination with a javascript program ASCIIMathML.js it will faithfully render mathematical expressions within HTML pages. I came across it when using a new online content management service called versal. Using the mathematical gadget provided by versal, I found the markup language very easy to use and was quickly able to create relatively complex formulae. This is my public URL on versal. The free version allows for the creation of unlimited public courses whereas the PRO version (at US$50 per year) allows for the creation of private courses, the tracking of student progress and other benefits.
Apparently ASCIIMathML.js has now been incorporated into the latest version of MathJax.js and the latter is:
a cross-browser JavaScript library that displays mathematical notation in web browsers, using MathML, LaTeX and ASCIIMathML markup. MathJax is released as open-source software under the Apache License and, importantly MathJax can display mathematical notation written in LaTeX or MathML markup. Because MathJax is meant only for math display, whereas LaTeX is a document layout language, MathJax only supports the subset of LaTeX used to describe mathematical notation."   Source.
ASCIIMathML is simpler and less verbose that LaTeX but in Blogger at least, the former seems temperamental and doesn't work consistently. The following equation when entered in ASCIIMathML as "x=(-b +- sqrt(b^2 – 4ac))/(2a)" fails to display the formatted equation. However, when entered in LaTeX as "x=\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}", it displays properly:
$$x=\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ A comprehensive list of LaTeX mathematical commands can be found here.

MacWizz

Over the past few days, I'd noticed these intrusive adds popping on web pages when using the Chrome browser. All were clearly identifiable via the word "MacWizz" appearing on the title bar of each advertisement's windows. I was prompted to investigate further and finally chanced upon the following:


Following the link, I found a good description of what MacWizz was:
MacWizz is advertised as an application that displays coupons for sites you are visiting and competitive prices when you are viewing product pages at sites like Amazon. Though this may sound like a useful service, the MacWizz app can be intrusive and will display advertisements whether you want them to or not.
When installed, the MacWizz browser extension will display advertising banners, pop-up advertisements and in-text ads, stating that they are brought to you by “MacWizz”. The MacWizz Ads will have different text under the pop-up: “Powered by MacWizz”, “Brought to you by MacWizz”, “You’ve received a premium offer from MacWizz” or “Ads by MacWizz”.
There were also a series of steps outlining how to remove it. Following these however, did not remove the infestation and so I was led to the final step:


The link provided led to https://www.malwarebytes.com/mac/ and after downloading and installing the program, I ran a scan. It didn't take long to complete and some offending items were identified and removed. Since then I've had no problems and it seems to have worked. There is a paid app on the App Store that costs about A$22 that purports to do the same thing but Malwarebytes is free (unless you want to buy the business version). Here is the interface that will confront you after installation.

Wednesday, 18 January 2017

WebM Video Format

After using Screencastify, screencasting software working a plugin to the Chrome browser, the resultant video output was in WebM format. I tried uploading to my astrology blog on Blogger using the video upload tool but the rendered video was of poor quality and wouldn't display properly in fullscreen. However, YouTube did an excellent job of rendering the video and providing the embed code that I'm using here:


I was prompted to investigate this format further and to that end, this video on the WebM website was helpful.


As Wikipedia explains:
WebM is a video file format. It is primarily intended to offer a royalty-free alternative to use in the HTML5 video tag. It has a sister project WebP for images. The development of the format is sponsored by Google, and the corresponding software is distributed under a BSD license. 
The BSD license is described by Wikipedia thus:
BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the redistribution of covered software. This is in contrast to copyleft licenses, which have reciprocity share-alike requirements. The original BSD license was used for its namesake, the Berkeley Software Distribution (BSD), a Unix-like operating system. 
The associated WebP format for images is described on this site as follows:
WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster. 
WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index. 
Lossless WebP supports transparency (also known as alpha channel) at a cost of just 22% additional bytes. For cases when lossy RGB compression is acceptable, lossy WebP also supports transparency, typically providing 3× smaller file sizes compared to PNG. 

Thursday, 5 January 2017

Computable Document Format


I've recently become aware of Wolfram's Computable Document Format or CDF as it's referred to. It adds interactivity to documents in a manner similar to Apple's iBooks Author, that allows anyone to create interactive textbooks for reading in iBooks. You need to download the CDF player, which I've done, but it's a hefty 2.2 GB in size. With the player installed you can then open CDF files. The format is clearly proprietary and it remains to be seen how much traction it will get in the marketplace.

Here is what Wikipedia has to say about CDF:
Features 
Computable document format supports GUI elements such as sliders, menus and buttons. Content is updated using embedded computation in response to GUI interaction. Contents can include formatted text, tables, images, sounds and animations. CDF supports Mathematica typesetting and technical notation. Paginated layout, structured drill down layout and slide-show mode are supported. Styles can be controlled using a cascading style sheet. 
Reading 
CDF files can be read using a proprietary CDF Player with a restrictive license, which can be downloaded free of charge from Wolfram Research. 
Authoring 
CDF Files can be created using Mathematica. Online authoring tools are planned. 
Uses 
Computable Document Format has been used in electronic books by Pearson Education, to provide the content for the Wolfram Demonstrations Project, and to add client-side interactivity to Wolfram Alpha.
Now that I'm aware of the product I can monitor its fortunes.