<![CDATA[janmr.com]]>http://janmr.com/metalsmith-feedMon, 01 Jan 2018 10:47:43 GMT<![CDATA[Wrapping HTML inside MathML]]>MathML is a mathematical markup language that can be used to integrate math into web pages. Unfortunately, browser support is far from great. What people do instead is use libraries such as MathJax which can replace the math container with the appropriate HTML, either server-side or client-side. However, putting math markup in a structured way inside math elements has many advantages, such as accessibility and search engines. So let's put the HTML inside the `math` element, alongside the MathML.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/ZjFvp5vONrc" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/ZjFvp5vONrc/wrapping-html-inside-mathmlhttp://janmr.com/blog/2017/02/wrapping-html-inside-mathmlThu, 23 Feb 2017 00:00:00 GMThttp://janmr.com/blog/2017/02/wrapping-html-inside-mathml<![CDATA[Tiling with L-Trominos]]>An L-tromino is a figure in the plane made of three equal-sized squares connected in an L-shape. Consider now the following question: Given a 2^n x 2^n square grid with exactly one cell occupied, is it possible to tile the remaining area using L-trominos?<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/ZUeUWkAedcU" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/ZUeUWkAedcU/tiling-with-l-trominoshttp://janmr.com/blog/2016/01/tiling-with-l-trominosSun, 24 Jan 2016 00:00:00 GMThttp://janmr.com/blog/2016/01/tiling-with-l-trominos<![CDATA[Time Budgets for the Web]]>I was recently introduced to the so-called RAIL principle in the Udacity MOOC Browser Rendering Optimization. It is an acronym for **R**esponsive, **A**nimation, **I**dle and **L**oad and introduces some time budgets to follow when creating a smooth and responsive web experience. It seems to have been a concept coined by the Google Chrome team and is also mentioned in a recent talk by Google's Paul Irish. [...]<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/oiU_9OifJ30" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/oiU_9OifJ30/time-budgets-for-the-webhttp://janmr.com/blog/2015/04/time-budgets-for-the-webSun, 26 Apr 2015 00:00:00 GMThttp://janmr.com/blog/2015/04/time-budgets-for-the-web<![CDATA[MathJax 2.4 vs 2.5]]>MathJax version 2.5 was released around a month ago. One of that version's features were speed improvements and that's always a good thing. Seen in the light of my recent experiments with MathJax and KaTeX, it was straightforward to set up an experiment that compared MathJax versions 2.4 and 2.5 with respect to rendering speed. [...]<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/0koZufLVPqQ" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/0koZufLVPqQ/mathjax-2.4-vs-2.5http://janmr.com/blog/2015/03/mathjax-2.4-vs-2.5Sun, 08 Mar 2015 00:00:00 GMThttp://janmr.com/blog/2015/03/mathjax-2.4-vs-2.5<![CDATA[Grouping Typesets With MathJax]]>When MathJax typesets the equations on a web page, it does a good job of grouping the work into chunks, so that a chunk of equations (see the EqnChunk option) will be typeset before they are displayed and the next chunk is processed. Typesetting and displaying one equation at a time leads to a lot of screen flickering and it also takes longer before the page is completed because of the increased work for the browser.
Sometimes you want to typeset and display a lot of equations dynamically [...]<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/BFBUXEYz7O4" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/BFBUXEYz7O4/grouping-typesets-with-mathjaxhttp://janmr.com/blog/2015/03/grouping-typesets-with-mathjaxTue, 03 Mar 2015 00:00:00 GMThttp://janmr.com/blog/2015/03/grouping-typesets-with-mathjax<![CDATA[Typesetting Math Using HTML and CSS — Fractions]]>Currently, there is no best way of showing math on the web. An HTML5 standard exists, MathML, but unfortunately it doesn't have broad browser support. Instead, many alternatives exist, all with varying quality and speed.
I would like to explore how far you can get by using just HTML and CSS (including web fonts). My findings should be considered experimental.
This post will deal with one way of typesetting fractions, inspired by the approach taken by Kahn Academy's KaTeX project.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/c6wJzh3s60c" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/c6wJzh3s60c/typesetting-math-with-html-and-css-fractionshttp://janmr.com/blog/2015/01/typesetting-math-with-html-and-css-fractionsSat, 24 Jan 2015 00:00:00 GMThttp://janmr.com/blog/2015/01/typesetting-math-with-html-and-css-fractions<![CDATA[MathJax, KaTeX and a lot of Math]]>Prior to the current post, this blog contained 45 posts with a total of 2307 math items, where a math item is anything from single-letter variable identifiers to large, multi-line equations. That's an avarage of 51 math items per post, ranging from a few posts containing no math at all to one containing 267 items. From the beginning I have used MathJax to display the math [...]<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/r3lm3GLAWb4" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/r3lm3GLAWb4/mathjax-katex-and-a-lot-of-mathhttp://janmr.com/blog/2015/01/mathjax-katex-and-a-lot-of-mathSun, 11 Jan 2015 00:00:00 GMThttp://janmr.com/blog/2015/01/mathjax-katex-and-a-lot-of-math<![CDATA[Entering the World of Web Components]]>I am very excited about Web Components. It is going to fundamentally change the way we do web development. This post is going to contain miscellaneous information and links related to Web Components. The specification is still being developed, but the overall parts have been decided upon. To quote Introduction to Web Components, Web Components consists of five main parts...<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/dl8Hl5sn760" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/dl8Hl5sn760/entering-the-world-of-web-componentshttp://janmr.com/blog/2014/07/entering-the-world-of-web-componentsWed, 02 Jul 2014 00:00:00 GMThttp://janmr.com/blog/2014/07/entering-the-world-of-web-components<![CDATA[Deriving the Closed Form for Square Pyramidal Numbers]]>The sum of the first n squares is s_n = 1/6 n (n+1) (2n+1). The numbers s_0, s_1, s_2, ... are called the square pyramidal numbers. Many different proofs exist. Seven different proofs can be found in Concrete Mathematics and even a visual proof has been published. One of the simplest proofs uses induction on n. This approach assumes that you know (or guess) the correct formula beforehand, though. This post will show a derivation which is a formalization of the derivation shown on wikipedia.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/WBaUcDqU3mU" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/WBaUcDqU3mU/deriving-closed-form-for-square-pyramidal-numbershttp://janmr.com/blog/2014/06/deriving-closed-form-for-square-pyramidal-numbersSat, 14 Jun 2014 00:00:00 GMThttp://janmr.com/blog/2014/06/deriving-closed-form-for-square-pyramidal-numbers<![CDATA[Structure of a Multiple-Precision Library in C++]]>This post will present an overview of the implementation of Kanooth Numbers, a portable multiple-precision library in C++.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/RPE_R_9brOw" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/RPE_R_9brOw/structure-of-a-multiple-precision-library-in-cpphttp://janmr.com/blog/2014/06/structure-of-a-multiple-precision-library-in-cppTue, 03 Jun 2014 00:00:00 GMThttp://janmr.com/blog/2014/06/structure-of-a-multiple-precision-library-in-cpp<![CDATA[Comparing Rational Numbers Without Overflow]]>Say you want to know if the inequality n_1/d_1 < n_2/d_2 is true (n_1, n_2, d_1, d_2 are all assumed to be positive integers). Of course, one could just multiply both sides with d_1 d_2, obtaining the equivalent n_1 d_2 < n_2 d_1, and we were done. But if our number representation allowed only numbers up to a certain size, say 32 bit unsigned integers, the multiplication could overflow. Of course, double-precision could be used to do the multiplication anyway, but this post will present a different method. The method effectively computes the continued fraction representation of each fraction simultaneously, but stops as soon as they differ. It is also the algorithm used for comparisons in the Boost C++ library Rational.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/TDy_eaEzzv8" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/TDy_eaEzzv8/comparing-rational-numbers-without-overflowhttp://janmr.com/blog/2014/05/comparing-rational-numbers-without-overflowSun, 18 May 2014 00:00:00 GMThttp://janmr.com/blog/2014/05/comparing-rational-numbers-without-overflow<![CDATA[Bresenham's Line Algorithm]]>In 1965 Jack Elton Bresenham published the paper Algorithm for computer control of a digital plotter in the IBM Systems Journal, volume 4, number 1. It explained how a line could be approximated on an integer grid. The algorithm is still used today as a rasterization technique for rendering lines on video displays or printers. As Bresenham's paper suggests, however, it was originally devised for a plotter, capable of moving from one grid point to one of the adjacent eight grid points. We consider drawing a line...<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/KqhdGCb7Bn0" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/KqhdGCb7Bn0/bresenhams-line-algorithmhttp://janmr.com/blog/2014/04/bresenhams-line-algorithmThu, 24 Apr 2014 00:00:00 GMThttp://janmr.com/blog/2014/04/bresenhams-line-algorithm<![CDATA[Basic Multiple-Precision Long Division]]>We consider the task of dividing a positive integer u by another positive integer v, thus obtaining a quotient q=u/v and a remainder r such that u = q v + r with 0 <= r < v. The method presented here is based on The Classical Algorithms, Section 4.3.1, of The Art of Computer Programming, Volume 2, by Donald E. Knuth. The material is quite theory-heavy and if you are just looking for the main algorithm, you can skip to the bottom and Algorithm L.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/6Zc7lSbvpyc" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/6Zc7lSbvpyc/basic-multiple-precision-long-divisionhttp://janmr.com/blog/2014/04/basic-multiple-precision-long-divisionMon, 14 Apr 2014 00:00:00 GMThttp://janmr.com/blog/2014/04/basic-multiple-precision-long-division<![CDATA[Six Circles Theorem Illustrated]]>Given a triangle, start with a circle tangent to two sides. Then draw a new circle tangent to this first circle and a different pair of sides. Continue this process in the same direction. The sixth circle will be tangent to both the fifth and the first circle, thus producing a cyclic chain of touching circles.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/LkjfRUDtIzU" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/LkjfRUDtIzU/six-circles-theorem-illustratedhttp://janmr.com/blog/2014/04/six-circles-theorem-illustratedSun, 06 Apr 2014 00:00:00 GMThttp://janmr.com/blog/2014/04/six-circles-theorem-illustrated<![CDATA[Archimedes' Twin Circles Illustrated]]>The green circles will always be of equal size<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/Zw0ulAbfTUg" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/Zw0ulAbfTUg/archimedes-twin-circles-illustratedhttp://janmr.com/blog/2014/04/archimedes-twin-circles-illustratedThu, 03 Apr 2014 00:00:00 GMThttp://janmr.com/blog/2014/04/archimedes-twin-circles-illustrated<![CDATA[Thales' Theorem Illustrated]]>Thales' Theorem: If A, B and C are points on a circle with the segment AC as a diameter, then the angle at B is a right angle.<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/PgWXWza0Na4" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/PgWXWza0Na4/thales-theorem-illustratedhttp://janmr.com/blog/2014/04/thales-theorem-illustratedWed, 02 Apr 2014 00:00:00 GMThttp://janmr.com/blog/2014/04/thales-theorem-illustrated<![CDATA[An Infinite Series Involving a Sideways Sum]]>I found a recent question on Mathematics Stack Exchange quite interesting. It simply asked: How does one easily calculate ...<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/o4wwvp1WYHE" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/o4wwvp1WYHE/infinite-series-involving-sideways-sumhttp://janmr.com/blog/2013/07/infinite-series-involving-sideways-sumWed, 03 Jul 2013 00:00:00 GMThttp://janmr.com/blog/2013/07/infinite-series-involving-sideways-sum<![CDATA[Good Rational Bounds]]>Say we have a k-bit integer and we want to allocate a character array to hold the decimal digits of this number. How large must the array be? Well, the exact formula is [...]<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/qM-pUfANVyc" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/qM-pUfANVyc/good-rational-boundshttp://janmr.com/blog/2013/01/good-rational-boundsMon, 07 Jan 2013 00:00:00 GMThttp://janmr.com/blog/2013/01/good-rational-bounds<![CDATA[Basic Multiple-Precision Short Division]]>Let us consider short division, by which we mean a multiple-digit number u divided by a single digit v [...]<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/tB2YBRqF3hE" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/tB2YBRqF3hE/basic-multiple-precision-short-divisionhttp://janmr.com/blog/2012/11/basic-multiple-precision-short-divisionWed, 28 Nov 2012 00:00:00 GMThttp://janmr.com/blog/2012/11/basic-multiple-precision-short-division<![CDATA[Basic Multiple-Precision Multiplication]]>After addressing multiple-precision addition and subtraction, we now turn to multiplication of two multiple-precision numbers. Once again, we use the number representation and notation introduced earlier. Several algorithms exist for doing multiple-precision multiplication. This post will present the basic, pencil-and-paper-like method. Basically, it consists of two parts: Multiplying a number by a single digit and adding together the sub-results, aligned appropriately. [...]<img src="http://feeds.feedburner.com/~r/janmr-blog/~4/_xdn4MYGtpM" height="1" width="1" alt=""/>http://feedproxy.google.com/~r/janmr-blog/~3/_xdn4MYGtpM/basic-multiple-precision-multiplicationhttp://janmr.com/blog/2011/11/basic-multiple-precision-multiplicationWed, 09 Nov 2011 00:00:00 GMThttp://janmr.com/blog/2011/11/basic-multiple-precision-multiplication