text:
Q: Put "..." at the end of a scrollable container, but only when the scroll is at the top I'm looking for a way to have a container with vertical scroll that puts "..." at the end of the text if there are more text than the visible area. I found a JS plugin that does that, but not for a scrolling container. I tried to modify it, but the "..." stays when scrolling down. Also it seems like the plugin cuts of the text completely in at least FF. I want the "..." to only be visible when you're at the top of the container.
I've looked for a css solution for the whole clamping, but it seems like it (text-overflow: ellipsis) doesn't work on multiple lines and without white-space: nowrap?

/*!
* Clamp.js 0.5.1
*
* Copyright 2011-2013, Joseph Schmitt http://joe.sh
* Released under the WTFPL license
* http://sam.zoy.org/wtfpl/
*/

(function(){
    /**
     * Clamps a text node.
     * @param {HTMLElement} element. Element containing the text node to clamp.
     * @param {Object} options. Options to pass to the clamper.
     */
    function clamp(element, options) {
        options = options || {};

        var self = this,
            win = window,
            opt = {
                clamp:              options.clamp || 2,
                useNativeClamp:     typeof(options.useNativeClamp) != 'undefined' ? options.useNativeClamp : true,
                splitOnChars:       options.splitOnChars || ['.', '-', '–', '—', ' '], //Split on sentences (periods), hypens, en-dashes, em-dashes, and words (spaces).
                animate:            options.animate || false,
                truncationChar:     options.truncationChar || '…',
                truncationHTML:     options.truncationHTML
            },

            sty = element.style,
            originalText = element.innerHTML,

            supportsNativeClamp = typeof(element.style.webkitLineClamp) != 'undefined',
            clampValue = opt.clamp,
            isCSSValue = clampValue.indexOf && (clampValue.indexOf('px') > -1 || clampValue.indexOf('em') > -1),
            truncationHTMLContainer;

        if (opt.truncationHTML) {
            truncationHTMLContainer = document.createElement('span');
            truncationHTMLContainer.innerHTML = opt.truncationHTML;
        }

// UTILITY FUNCTIONS __________________________________________________________

        /**
         * Return the current style for an element.
         * @param {HTMLElement} elem The element to compute.
         * @param {string} prop The style property.
         * @returns {number}
         */
        function computeStyle(elem, prop) {
            if (!win.getComputedStyle) {
                win.getComputedStyle = function(el, pseudo) {
                    this.el = el;
                    this.getPropertyValue = function(prop) {
                        var re = /(\-([a-z]){1})/g;
                        if (prop == 'float') prop = 'styleFloat';
                        if (re.test(prop)) {
                            prop = prop.replace(re, function () {
                                return arguments[2].toUpperCase();
                            });
                        }
                        return el.currentStyle && el.currentStyle[prop] ? el.currentStyle[prop] : null;
                    }
                    return this;
                }
            }

            return win.getComputedStyle(elem, null).getPropertyValue(prop);
        }

        /**
         * Returns the maximum number of lines of text that should be rendered based
         * on the current height of the element and the line-height of the text.
         */
        function getMaxLines(height) {
            var availHeight = height || element.clientHeight,
                lineHeight = getLineHeight(element);

            return Math.max(Math.floor(availHeight/lineHeight), 0);
        }

        /**
         * Returns the maximum height a given element should have based on the line-
         * height of the text and the given clamp value.
         */
        function getMaxHeight(clmp) {
            var lineHeight = getLineHeight(element);
            return lineHeight * clmp;
        }

        /**
         * Returns the line-height of an element as an integer.
         */
        function getLineHeight(elem) {
            var lh = computeStyle(elem, 'line-height');
            if (lh == 'normal') {
                // Normal line heights vary from browser to browser. The spec recommends
                // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.
                lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;
            }
            return parseInt(lh);
        }

// MEAT AND POTATOES (MMMM, POTATOES...) ______________________________________
        var splitOnChars = opt.splitOnChars.slice(0),
            splitChar = splitOnChars[0],
            chunks,
            lastChunk;

        /**
         * Gets an element's last child. That may be another node or a node's contents.
         */
        function getLastChild(elem) {
            //Current element has children, need to go deeper and get last child as a text node
            if (elem.lastChild.children && elem.lastChild.children.length > 0) {
                return getLastChild(Array.prototype.slice.call(elem.children).pop());
            }
            //This is the absolute last child, a text node, but something's wrong with it. Remove it and keep trying
            else if (!elem.lastChild || !elem.lastChild.nodeValue || elem.lastChild.nodeValue == '' || elem.lastChild.nodeValue == opt.truncationChar) {
                elem.lastChild.parentNode.removeChild(elem.lastChild);
                return getLastChild(element);
            }
            //This is the last child we want, return it
            else {
                return elem.lastChild;
            }
        }

        /**
         * Removes one character at a time from the text until its width or
         * height is beneath the passed-in max param.
         */
        function truncate(target, maxHeight) {
            if (!maxHeight) {return;}

            /**
             * Resets global variables.
             */
            function reset() {
                splitOnChars = opt.splitOnChars.slice(0);
                splitChar = splitOnChars[0];
                chunks = null;
                lastChunk = null;
            }

            var nodeValue = target.nodeValue.replace(opt.truncationChar, '');

            //Grab the next chunks
            if (!chunks) {
                //If there are more characters to try, grab the next one
                if (splitOnChars.length > 0) {
                    splitChar = splitOnChars.shift();
                }
                //No characters to chunk by. Go character-by-character
                else {
                    splitChar = '';
                }

                chunks = nodeValue.split(splitChar);
            }

            //If there are chunks left to remove, remove the last one and see if
            // the nodeValue fits.
            if (chunks.length > 1) {
                // console.log('chunks', chunks);
                lastChunk = chunks.pop();
                // console.log('lastChunk', lastChunk);
                applyEllipsis(target, chunks.join(splitChar));
            }
            //No more chunks can be removed using this character
            else {
                chunks = null;
            }

            //Insert the custom HTML before the truncation character
            if (truncationHTMLContainer) {
                target.nodeValue = target.nodeValue.replace(opt.truncationChar, '');
                element.innerHTML = target.nodeValue + ' ' + truncationHTMLContainer.innerHTML + opt.truncationChar;
            }

            //Search produced valid chunks
            if (chunks) {
                //It fits
                if (element.clientHeight <= maxHeight) {
                    //There's still more characters to try splitting on, not quite done yet
                    if (splitOnChars.length >= 0 && splitChar != '') {
                        applyEllipsis(target, chunks.join(splitChar) + splitChar + lastChunk);
                        chunks = null;
                    }
                    //Finished!
                    else {
                        return element.innerHTML;
                    }
                }
            }
            //No valid chunks produced
            else {
                //No valid chunks even when splitting by letter, time to move
                //on to the next node
                if (splitChar == '') {
                    applyEllipsis(target, '');
                    target = getLastChild(element);

                    reset();
                }
            }

            //If you get here it means still too big, let's keep truncating
            if (opt.animate) {
                setTimeout(function() {
                    truncate(target, maxHeight);
                }, opt.animate === true ? 10 : opt.animate);
            }
            else {
                return truncate(target, maxHeight);
            }
        }

        function applyEllipsis(elem, str) {
            elem.nodeValue = str + opt.truncationChar;
        }

// CONSTRUCTOR ________________________________________________________________

        if (clampValue == 'auto') {
            clampValue = getMaxLines();
        }
        else if (isCSSValue) {
            clampValue = getMaxLines(parseInt(clampValue));
        }

        var clampedText;
        if (supportsNativeClamp && opt.useNativeClamp) {
            sty.overflow = 'hidden';
            sty.textOverflow = 'ellipsis';
            sty.webkitBoxOrient = 'vertical';
            sty.display = '-webkit-box';
            sty.webkitLineClamp = clampValue;

            if (isCSSValue) {
                sty.height = opt.clamp + 'px';
            }
        }
        else {
            var height = getMaxHeight(clampValue);
            if (height <= element.clientHeight) {
                clampedText = truncate(getLastChild(element), height);
            }
        }

        return {
            'original': originalText,
            'clamped': clampedText
        }
    }

    window.$clamp = clamp;
})();

var module = document.querySelector(".box p");
$clamp(module, {clamp: 3});
body {
  align-items: center;
  background:
    radial-gradient(
      farthest-side at bottom left,
      rgba(255, 0, 255, 0.5),
      #246756
    ),
    radial-gradient(
      farthest-corner at bottom right,
      rgba(255, 50, 50, 0.5),
      #246756 400px
    );
  display: flex;
  height: 100vh;
  justify-content: center;
  line-height: 1.5;
}

.box {
  background-color: #fff;
  box-shadow: 2px 2px 10px #246756;
  padding: 2em;
  width: 200px;
}
.box p {
  overflow: scroll !important;
  max-height: 100px;
}

Hey, don't cut me off like that. I want to speak my mind and don't appreciate being put into a box. More text coming here and here and here and here and here.

A: I think you should go this way. Just se the height you want.
You can improve this with a call to action : see more/see less

var textEllipsisMultiline = function (element) {
    var wordArray = element.innerText.split(' ');
    while (element.scrollHeight > element.offsetHeight) {
        wordArray.pop(); // Remove last item
        element.innerText = wordArray.join(' ') + '...';
    }
};

textEllipsisMultiline(document.querySelector('#paragraph'));
<!DOCTYPE html>

  <title>Text Ellipsis Multiline</title>

  "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad mSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"inima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"

A: Make it clamp on an unreasonably large number of lines (more than you'll ever have) if you aren't scrolled to the top
$(".box p").scroll(function(e) {
  if($(this).scrollTop() === 0)
    $clamp(module, {clamp: 3});
  else
    $clamp(module, {clamp: 9999999});
});

/*!
* Clamp.js 0.5.1
*
* Copyright 2011-2013, Joseph Schmitt http://joe.sh
* Released under the WTFPL license
* http://sam.zoy.org/wtfpl/
*/

(function(){
    /**
     * Clamps a text node.
     * @param {HTMLElement} element. Element containing the text node to clamp.
     * @param {Object} options. Options to pass to the clamper.
     */
    function clamp(element, options) {
        options = options || {};

        var self = this,
            win = window,
            opt = {
                clamp:              options.clamp || 2,
                useNativeClamp:     typeof(options.useNativeClamp) != 'undefined' ? options.useNativeClamp : true,
                splitOnChars:       options.splitOnChars || ['.', '-', '–', '—', ' '], //Split on sentences (periods), hypens, en-dashes, em-dashes, and words (spaces).
                animate:            options.animate || false,
                truncationChar:     options.truncationChar || '…',
                truncationHTML:     options.truncationHTML
            },

            sty = element.style,
            originalText = element.innerHTML,

            supportsNativeClamp = typeof(element.style.webkitLineClamp) != 'undefined',
            clampValue = opt.clamp,
            isCSSValue = clampValue.indexOf && (clampValue.indexOf('px') > -1 || clampValue.indexOf('em') > -1),
            truncationHTMLContainer;

        if (opt.truncationHTML) {
            truncationHTMLContainer = document.createElement('span');
            truncationHTMLContainer.innerHTML = opt.truncationHTML;
        }

// UTILITY FUNCTIONS __________________________________________________________

        /**
         * Return the current style for an element.
         * @param {HTMLElement} elem The element to compute.
         * @param {string} prop The style property.
         * @returns {number}
         */
        function computeStyle(elem, prop) {
            if (!win.getComputedStyle) {
                win.getComputedStyle = function(el, pseudo) {
                    this.el = el;
                    this.getPropertyValue = function(prop) {
                        var re = /(\-([a-z]){1})/g;
                        if (prop == 'float') prop = 'styleFloat';
                        if (re.test(prop)) {
                            prop = prop.replace(re, function () {
                                return arguments[2].toUpperCase();
                            });
                        }
                        return el.currentStyle && el.currentStyle[prop] ? el.currentStyle[prop] : null;
                    }
                    return this;
                }
            }

            return win.getComputedStyle(elem, null).getPropertyValue(prop);
        }

        /**
         * Returns the maximum number of lines of text that should be rendered based
         * on the current height of the element and the line-height of the text.
         */
        function getMaxLines(height) {
            var availHeight = height || element.clientHeight,
                lineHeight = getLineHeight(element);

            return Math.max(Math.floor(availHeight/lineHeight), 0);
        }

        /**
         * Returns the maximum height a given element should have based on the line-
         * height of the text and the given clamp value.
         */
        function getMaxHeight(clmp) {
            var lineHeight = getLineHeight(element);
            return lineHeight * clmp;
        }

        /**
         * Returns the line-height of an element as an integer.
         */
        function getLineHeight(elem) {
            var lh = computeStyle(elem, 'line-height');
            if (lh == 'normal') {
                // Normal line heights vary from browser to browser. The spec recommends
                // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.
                lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;
            }
            return parseInt(lh);
        }

// MEAT AND POTATOES (MMMM, POTATOES...) ______________________________________
        var splitOnChars = opt.splitOnChars.slice(0),
            splitChar = splitOnChars[0],
            chunks,
            lastChunk;

        /**
         * Gets an element's last child. That may be another node or a node's contents.
         */
        function getLastChild(elem) {
            //Current element has children, need to go deeper and get last child as a text node
            if (elem.lastChild.children && elem.lastChild.children.length > 0) {
                return getLastChild(Array.prototype.slice.call(elem.children).pop());
            }
            //This is the absolute last child, a text node, but something's wrong with it. Remove it and keep trying
            else if (!elem.lastChild || !elem.lastChild.nodeValue || elem.lastChild.nodeValue == '' || elem.lastChild.nodeValue == opt.truncationChar) {
                elem.lastChild.parentNode.removeChild(elem.lastChild);
                return getLastChild(element);
            }
            //This is the last child we want, return it
            else {
                return elem.lastChild;
            }
        }

        /**
         * Removes one character at a time from the text until its width or
         * height is beneath the passed-in max param.
         */
        function truncate(target, maxHeight) {
            if (!maxHeight) {return;}

            /**
             * Resets global variables.
             */
            function reset() {
                splitOnChars = opt.splitOnChars.slice(0);
                splitChar = splitOnChars[0];
                chunks = null;
                lastChunk = null;
            }

            var nodeValue = target.nodeValue.replace(opt.truncationChar, '');

            //Grab the next chunks
            if (!chunks) {
                //If there are more characters to try, grab the next one
                if (splitOnChars.length > 0) {
                    splitChar = splitOnChars.shift();
                }
                //No characters to chunk by. Go character-by-character
                else {
                    splitChar = '';
                }

                chunks = nodeValue.split(splitChar);
            }

            //If there are chunks left to remove, remove the last one and see if
            // the nodeValue fits.
            if (chunks.length > 1) {
                // console.log('chunks', chunks);
                lastChunk = chunks.pop();
                // console.log('lastChunk', lastChunk);
                applyEllipsis(target, chunks.join(splitChar));
            }
            //No more chunks can be removed using this character
            else {
                chunks = null;
            }

            //Insert the custom HTML before the truncation character
            if (truncationHTMLContainer) {
                target.nodeValue = target.nodeValue.replace(opt.truncationChar, '');
                element.innerHTML = target.nodeValue + ' ' + truncationHTMLContainer.innerHTML + opt.truncationChar;
            }

            //Search produced valid chunks
            if (chunks) {
                //It fits
                if (element.clientHeight <= maxHeight) {
                    //There's still more characters to try splitting on, not quite done yet
                    if (splitOnChars.length >= 0 && splitChar != '') {
                        applyEllipsis(target, chunks.join(splitChar) + splitChar + lastChunk);
                        chunks = null;
                    }
                    //Finished!
                    else {
                        return element.innerHTML;
                    }
                }
            }
            //No valid chunks produced
            else {
                //No valid chunks even when splitting by letter, time to move
                //on to the next node
                if (splitChar == '') {
                    applyEllipsis(target, '');
                    target = getLastChild(element);

                    reset();
                }
            }

            //If you get here it means still too big, let's keep truncating
            if (opt.animate) {
                setTimeout(function() {
                    truncate(target, maxHeight);
                }, opt.animate === true ? 10 : opt.animate);
            }
            else {
                return truncate(target, maxHeight);
            }
        }

        function applyEllipsis(elem, str) {
            elem.nodeValue = str + opt.truncationChar;
        }

// CONSTRUCTOR ________________________________________________________________

        if (clampValue == 'auto') {
            clampValue = getMaxLines();
        }
        else if (isCSSValue) {
            clampValue = getMaxLines(parseInt(clampValue));
        }

        var clampedText;
        if (supportsNativeClamp && opt.useNativeClamp) {
            sty.overflow = 'hidden';
            sty.textOverflow = 'ellipsis';
            sty.webkitBoxOrient = 'vertical';
            sty.display = '-webkit-box';
            sty.webkitLineClamp = clampValue;

            if (isCSSValue) {
                sty.height = opt.clamp + 'px';
            }
        }
        else {
            var height = getMaxHeight(clampValue);
            if (height <= element.clientHeight) {
                clampedText = truncate(getLastChild(element), height);
            }
        }

        return {
            'original': originalText,
            'clamped': clampedText
        }
    }

    window.$clamp = clamp;
})();

var module = document.querySelector(".box p");
var _text = $(".box p").text();
$(".box p").scroll(function(e) {
  if($(this).scrollTop() === 0)
    $clamp(module, {clamp: 3});
  else
    $clamp(module, {clamp: 9999999});
});
$clamp(module, {clamp: 3});
body {
  align-items: center;
  background:
    radial-gradient(
      farthest-side at bottom left,
      rgba(255, 0, 255, 0.5),
      #246756
    ),
    radial-gradient(
      farthest-corner at bottom right,
      rgba(255, 50, 50, 0.5),
      #246756 400px
    );
  display: flex;
  height: 100vh;
  justify-content: center;
  line-height: 1.5;
}

.box {
  background-color: #fff;
  box-shadow: 2px 2px 10px #246756;
  padding: 2em;
  width: 200px;
}
.box p {
  overflow: scroll !important;
  max-height: 100px;
}

Hey, don't cut me off like that. I want to speak my mind and don't appreciate being put into a box. More text coming here and here and here and here and here.

A: I found this little pure-css workaround. It doesn't allow scrolling unfortunately, but it turned out to be even better without scrolling in my case. Two drawbacks are that you need to set a background-color to cover up the dots and that the dots go outside of the area, but it worked in my case. I have hundreds of divs so css only is a far better option than js for me.

/* styles for '...' */
.block-with-text {
  /* hide text if it more than N lines  */
  overflow: hidden;
  /* for set '...' in absolute position */
  position: relative;
  /* use this value to count block height */
  line-height: 1.2em;
  /* max-height = line-height (1.2) * lines max number (3) */
  max-height: 3.6em;
  /* fix problem when last visible word doesn't adjoin right side  */
  text-align: justify;
  /* place for '...' */
  margin-right: -1em;
  padding-right: 1em;
  width: 300px;
}
/* create the ... */
.block-with-text:before {
  /* points in the end */
  content: '...';
  /* absolute position */
  position: absolute;
  /* set position to right bottom corner of block */
  right: 0;
  bottom: 0;
}
/* hide ... if we have text, which is less than or equal to max lines */
.block-with-text:after {
  /* points in the end */
  content: '';
  /* absolute position */
  position: absolute;
  /* set position to right bottom corner of text */
  right: 0;
  /* set width and height */
  width: 1em;
  height: 1em;
  margin-top: 0.2em;
  /* bg color = bg color under block */
  background: white;
}

Long text on multiple rows. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare enim et egestas posuere. Curabitur mollis sapien a nunc interdum, pretium imperdiet lorem viverra. Praesent lacus neque, tempor a nibh eget, tincidunt consectetur urna. Ut ornare pellentesque tortor in consequat. Sed id faucibus nibh, ut molestie mauris. Maecenas auctor lorem felis, luctus dictum eros varius sit amet. Vestibulum volutpat commodo nisl nec mollis. Proin varius at turpis eget feugiat. Suspendisse maximus sit amet nulla nec rutrum. Integer non nibh a lorem blandit ullamcorper. Nam commodo neque tellus, id volutpat neque iaculis ut.

Vivamus aucto

Small text on one row. Without dots.

2.5 lines example:  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare enim.


text:
Q: Getting a proper reference number with \ref while using custom counter and environment I am trying to make a reference-able environment with its own counter, that I later refer to in text. I want the counter of my environment to have the style Chapter.Number . I have been able to make it work within a new environment and a new counter with this code (MWE in the end of the question):
\newcounter{code}[chapter]

\definecolor{bg}{rgb}{0.975,0.95,1.0}

\newenvironment{code}[3][hbp]
{\VerbatimEnvironment \refstepcounter{code}
  \begin{listing}[#1]
  \label{#3}
  \textbf{Code~\arabic{chapter}.\arabic{code}} #2
  \centering
  \begin{minted}[bgcolor =bg, frame=lines,framesep=2mm,linenos]{julia}}
{\end{minted}\end{listing}}

(notice the maybe incorrect use of \label)
In my document I use the environment like so:
It is possible to compute this histogram with a naive approach.
This is shown in Code~\ref{code1}.
A much smarter approach is instead presented in Code~\ref{code2}.

\begin{code}{Naive calculation}{code1}
function naivehist(data, ε)
   Δ += sin(ε) # lalala
   m = rand(1000,1000)
end
\end{code}

Everything seems to work nicely, except when referencing the code blocks:

I suspect that my usage of \label inside my custom environment is probably incorrect. What is the way to do this, so that when using \ref{...} I would correctly get the number 2.1 instead of 1?
MWE
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{minted} % for making code snippets
\usepackage{amsmath}

\begin{document}
\chapter{Title of chapter.}

\newcounter{code}[chapter]

\definecolor{bg}{rgb}{0.975,0.95,1.0}

\newenvironment{code}[3][hbp]
{\VerbatimEnvironment \refstepcounter{code}
  \begin{listing}[#1]
  \label{#3}
  \textbf{Code~\arabic{chapter}.\arabic{code}} #2
  \centering
  \begin{minted}[bgcolor =bg, frame=lines,framesep=2mm,linenos]{julia}}
{\end{minted}\end{listing}}

the histogram equation:
\begin{equation}
    \label{eq1}
     p = \sum p_i + \int_0^1 \omega d\epsilon
\end{equation}
It is possible to compute this histogram with a naive approach. This is shown in Code~\ref{code1}.

\begin{code}{Naive, memory-inefficient calculation of eq.~\eqref{eq1}.}{code1}
function naivehist(data, a)
   x += sin(a) # lalala
   m = rand(1000,1000)
end
\end{code}

\end{document}

A: Redefine \thecode to give the correct output:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{minted} % for making code snippets
\usepackage{amsmath}

\begin{document}
\chapter{Title of chapter.}

\newcounter{code}[chapter]
\renewcommand\thecode{\thechapter.\arabic{code}}
\definecolor{bg}{rgb}{0.975,0.95,1.0}

\newenvironment{code}[3][hbp]
{\VerbatimEnvironment \refstepcounter{code}\label{#3}%
  \begin{listing}[#1]
  \textbf{Code~\thecode} #2
  \centering
  \begin{minted}[bgcolor =bg, frame=lines,framesep=2mm,linenos]{julia}}
{\end{minted}\end{listing}}

the histogram equation:
\begin{equation}
    \label{eq1}
     p = \sum p_i + \int_0^1 \omega d\epsilon
\end{equation}
It is possible to compute this histogram with a naive approach. This is shown in Code~\ref{code1}.

\begin{code}{Naive, memory-inefficient calculation of eq.~\eqref{eq1}.}{code1}
function naivehist(data, a)
   x += sin(a) # lalala
   m = rand(1000,1000)
end
\end{code}

\end{document}

redpajama_set_name: RedPajamaStackExchange


We may not notice it, but both artificial intelligence and the Internet of Things are driving massive innovation in consumer and business environments. The smartphones in our pockets, for instance, are equipped with some 9 to 13 sensors and have been running machine learning and deep learning via on-device firmware and in the cloud for years. But to ascertain the broader impacts of these trends on consumers, businesses, and ecosystems, we must consider how they converge and the implications therein. What follows are three examples.
Although connected devices and even robots have been around for years, they have struggled to transcend the typing, clicking, touching interface of the mobile and laptop world. Their utility has remained largely tethered to another device or power source. They have struggled to achieve mainstream adoption. While an estimated 15 billion IoT devices are forecast to be in consumers' hands by 2020, manufacturers have been scratching their heads about how to inspire such a significant growth trajectory.
Thanks to advancements in machine and deep learning, as well as natural language processing and understanding, reliable voice recognition is redefining how we interact with machines. The ability to simply talk to an IoT device or environment means the human-machine interface starts to look a lot more like a human-human interface. From a technological adoption standpoint, this doesn't just improve the interface — speaking over typing or tapping; heads-up, not down — it unlocks entirely new markets. Consider how this enables elderly folks to use home care apps, helps disabled folks to enjoy internet services, or welcomes less tech-savvy users.
Not only are humans innately wired to learn and produce language with relatively little effort, voice conveys umpteen unseen elements of communication — emotion, tone, cultural nuance, etc. — we use to gauge interactions. This is the inherent personalization we employ in social interaction, alongside our long-held tendency to imbue objects with human characteristics. We trust and identify with things when we anthropomorphize them. Add to these interactions adjacent advancements in processing speed and devices can respond dynamically, incorporating context from diverse data sets, customer preferences, and real-time contextual signals.
This unlocks a new era of personalization wherein our devices become trusted partners, concierges, media curators — maybe even friends?
Customer service and support: There's a lot of buzz about chatbots, but when virtual assistants span devices, it allows companies to scale support. Agents are best for simple common queries and can triage to human agents for more complex or sensitive support issues. They can also create continuity across channels (read: not having to repeat the same information). Brands can deliver service experiences to the most appropriate interface, using services like DialogFlow to easily integrate natural language understanding into their products. Imagine, for instance, if you could simply ask your router to configure Wi-Fi or run a security diagnostic, or ask your connected car to schedule your next oil change.
Sales: Equipping salespeople with mobile devices and wearables in order to acquire and log information in the field has become commonplace. But advancements in computer vision and deep learning plus IoT are equipping sales with new capabilities. Virtual and augmented reality are growing in adoption as both a B2B/technical sales and consumer sales tool. In industrial capacities, VR offers the ability to view intricacies of machinery, parts, or tooling before a purchase order is signed. In consumer, companies like Uniqlo are experimenting with virtual dressing rooms, allowing customers to "try on" clothing without ever disrobing.
To "intelligent" — characterized by the ability for devices to learn from their interactions with users, service providers, and other devices, as well as from the interactions with all devices in the network, product line, or fleet.
One notable example of a company leveraging IoT and AI for "ecosystem intelligence" is Tesla, whose fleet of self-driving vehicles learn from each other. The experience of one Tesla is transmitted to and "learned" by all other cars in the network.
Ecosystem-level learning across organizations has also become possible. For instance, Tesla also shares data with the U.S. Transportation Department and rival automakers. Open data, open development frameworks, and shared standards are all critical for the interoperability and scale of AI and IoT — and the societal benefit of both.
Jessica Groopman is an industry analyst and founding partner at Kaleido Insights, a company that advises corporate leaders on how to transform the kaleidoscope of technological disruption into clear, actionable strategies.


The 90% tungsten G.T.® soft tip dart line follows in the footsteps of the world record holding G.T.® Hammer Head® dart line. The G.T.® II and the G.T.® III feature a Thrust Cut™ barrel, which gives the G.T.® dart an extra gripping surface. Both the G.T.® and the G.T.® II and III are available in silver and in the Black Steal™ tungsten oxide finish.


Pokitdok: $48.7M raised. Healthcare API platform. Run Dokchain and FullMetalHealth sites as well.
Gem: Venice, CA. $12.5M Raised. Blockchain platform for Health, Auto and Supply Chain. Partnering with Philips for health use cases (undisclosed).
Healthcoin: $200K seed. Rewards platform for prevention and lifestyle changes based on biomarkers.
Hashed Health: $1.8M seed. Membership organization for standards, education and services around Blockchain in Healthcare.
Simply Vital Health: Pre-seed. Care Coordination platform. Small mention of blockchain based security. CTO was blockchain developer.
PointNurse: Unknown funding (Pre-seed). Telemedicine marketplace that connects nursing providers with potential telemedicine (care management) requests. In addition to payment for the care service, employees earn "care credits" that are based on blockchain.
BlockChain Health: Focused on blockchain-based security in medical research. SF. Unknown funding.
MedRec: Non-commercial. MIT project for medical record keeping using blockchain.
Healthcombix: Minimal info. Probably blockchain-based community care coordination program for ACOs etc.
Burst IQ: $5.4M. 500 Startups. Cybersecurity angle.
Health Linkages: data governance and analytics using blockchain. Unknown funding.
Nebula Genomics: Allowing users to sell their genomic data through crypto. Boston. Founded 2016.
Healthwizz: Blockchain, FHIR-enabled EHR aggregator. Enabling patients to monetize their data. Unknown funding.
This page was last modified on 25 August 2018, at 10:14.


text:
Amazing Success Stories: HUGE Congratulations to Anguilla Tennis Academy!
The Anguilla Tennis Academy and its founder, Mr. Mitchelle Lake have profoundly changed the lives of many since the Anguilla Tennis Academy opened its doors in 1996.
Not only has Mr. Mitchelle Lake provided a wonderful outlet for children to engage in sports, the school also has a tremendous scholarship program.
The stories of achievement earned by these hard working students in 2018 are nothing short of incredible.
Join me in saying a big congratulations to Mr. Mitchelle Lake and his students, Nzingha Banks, Tamisha Richardson and Sabrina Connor on all of their success!
Nzingha Banks graduates with a Masters of Accounting in Advisory and Consulting from University of Kansas
One year after completing her Bachelor of Arts (BA) in Accounting & Finance at Washburn University, we again celebrate with Nzingha Banks as she graduates with her Masters of Accounting in Advisory & Consulting from the University of Kansas.
During her Masters of Accounting program at the University of Kansas, Nzingha was inducted into the Golden Key Honor Society while securing a 3.89 grade point average (GPA). She also worked as a business consultant for JayHawk Consulting. Additionally, she completed a Business and Culture in Latin America study abroad program at the Universidad de Costa Rica.
Nzingha completed her Masters of Accounting program in March, but she is not done! Currently, she is on track to become CPA qualified over the next few months. Nzingha is currently working on internships and gaining additional work experience.
Founder and President of the ATA, Mr. Mitchelle Lake stated, "I am proud of Nzingha and her outstanding accomplishments. She has been an exceptional leader and ambassador for the Anguilla Tennis Academy from her studies at Washburn University and now at the University of Kansas. I remain confident in her abilities and know that she will make a positive contribution in her Accounting career."
We take this opportunity to congratulate Nzingha Banks and her proud parents Dr. Phyllis Fleming-Banks and Mr. Ken Banks.
Tamisha Richardson Graduates with Honors, Summa Cum Laude
Tamisha enrolled at Virginia State University (VSU) on a tennis athletic scholarship January, 2015 and graduated with honors, summa cum laude on May 13th 2018 with a 3.9 cumulative grade point average (gpa). She now holds a Bachelors Degree in Health and Physical Education Recreation and Dance with a minor in Health Science.
Tamisha was Team Captain of the VSU Lady Trojans and completed her final tennis season with a win/loss record of 11-6 in singles and 14-3 in doubles. The VSU Lady Trojans also completed their tennis season with a record of 12-5 becoming the Central Intercollegiate Athletic Association (CIAA) Northern Division 2018 champions. Tamisha Richardson and three other tennis athletes were named to the 2018 All-CIAA Women's tennis team. In addition, Tamisha along with 21 other student-athletes that were selected for the Arthur Ashe Jr. Scholar Awards.
Tamisha Richardson is a proud member of the National Society of Leadership and Success Society, Golden Key International Society, and the VSU Honors Program. Her future plan is to complete a Masters degree in Health while pursuing her career goal in Physical Therapy.
Tamisha stated, " I could not have reached this far in life without God, my family, friends, colleagues, professors, coaches, and supporters. The Anguilla Tennis Academy (ATA) prepared me mentally and physically to endure my college years of being a student athlete. This was a rewarding experience as I was not only awarded a tennis scholarship to play college tennis, but I was able to show my talents and mature as a more confident individual. Thank you Coach Mitch, for seeing my talents at a young age and recognizing the potential I had to play tennis at the collegiate level. Many thanks to all the coaches that trained with me, advised me, and instructed me throughout my college tennis career. Thanks to my family, friends, colleagues, professors, teammates, supporters, and everyone for being there for me along my educational journey."
Founder and President of the ATA, Mr. Mitchelle Lake stated, " I am proud of Tamisha and all her academic and athletic achievements at Virginia State University. She has demonstrated over the past four years that success can be achieved through hard work, determination and commitment. I wish her continued success in her educational journey."
Filed Under: Anguilla Sports

redpajama_set_name: RedPajamaCommonCrawl