text:
Music Production using Artificial Intelligence (AI)
Client Patrick Hutchings
Real-Time Music Generation
Music production and composition
Assistance with research and development
Music Composers: Jon Forest / Van Nguyen
Patrick Hutchings is a composer and AI researcher, often working in the cross-section of the two areas of study. His research focus is in creative applications of AI where he looks at new ways expanding AI-related practices.
One sunny Summer evening, Patrick gave us a call to see if we'd be interested in assisting with his PhD study. Given the questions that already guide our daily practice at SOUND PITCH, it seemed like a beautiful and natural next step.
Our task was to provide Patrick with musical compositions that were based on actions. Why? So they could be easily translated into the realm of AI and generated music production. Producing these units or 'musical building blocks' using midi, we had the ability to develop new melodies and harmonies that could be triggered by the player's actions in real-time.
Most computer games are using some form of adaptive audio these days. What is it? Adaptive audio describes an approach to a situation in which the gamer finds themselves as a result of their previous interactive choices. In effect, nothing in the game - not the visuals, audio, sound design, or music - is ever pre-determined in an adaptive environment. Rather, the experience of the gamer is a result of layered 'building blocks' or units of sounds and visuals that combine according to the gamer's decisions.
Patrick was able to take our work and share with us the myriad ways in which it could contribute to the enhancement of an adaptive gaming environment. Awesome.
Patricks work showcases just a few ways in which AI-based tools can adapt any form of music and sound for unique experiences that synthesise beautifully with player interaction. Unlike Fmod and Wwise, which is technology that usually features non-linear music stems and loops made by composers and then assigned to various different game parameters, Patrick's system works by playing into the unique characteristics of humans' individualised decision making, and using this to enhance and personalise gaming experiences.
Want to learn more? Here's one of Patrick's studies.
You can also get in touch with us to discuss the ways in which we can help with your next research and development project.
Hey Master
Botanical Water Foundation


text:
Geminiani, Francesco : 6 Concertos Op. 7 (H. 115-120)
6 Concertos Op. 7 (H. 115-120)
Critical Edition [Opera Omnia - Vol. 6]
Editor: Richard Maunder
Contents and Description
Geminiani's third and last set of original concertos was published on 4 February 1748. The parts were handsomely produced, with an engraved frontispiece and a quotation from Horace. The concertos are dedicated to the Academy of Ancient Music. This was one of the leading London musical societies, founded on 1 March 1726 as the Academy of Vocal Music by a group of professional musicians – including Geminiani – and aristocratic amateurs: the society mounted regular concerts at the Crown and Anchor in the Strand. Geminiani's statement that "in the composing of [the Opus 7 concertos] great Study and Application hath been used, to make them acceptable to the Public, and in particular to your Academy" is reminiscent of Gottlieb Muffat's preface to his Componimenti Musicali per il Cembalo (Augsburg, c1738-1739), which says that the composition was "laborious" and cost "much effort". Mozart's dedication of his "Haydn" quartets, likewise, speaks of them as "the fruit of long and laborious effort".
Opus 7 had something of a mixed reception. The most virulent criticism of Opus 7 came from Francesco Maria Veracini (1690-1768), who devoted over twenty pages of his unpublished treatise Il Trionfo della pratica Musicale, probably written in about 1760, to a very detailed analysis of what he calls a "Fuga Mostruosa" by one Sgranfione Miniacci, a not-quite-exact anagram of Francesco Geminiani. The fugue in question is the second movement of No. I, which the composer – perhaps unwisely – entitled "L'Arte della Fuga".
In more recent times critical opinion has on the whole remained hostile. One of the few modern writers to praise Opus 7 unstintingly is Arthur Hutchings, who considered the set Geminiani's "finest achievement", and lamented that "one frequently hears some of the Op. 3 concertos, especially a rather dull one in D minor [No. IV], but none of the very good ones in Op. 7". Whether Opus 7 is superior to the composer's other works may be open to debate, but there can be no doubting the high level of originality and invention throughout all six concertos. The music is certainly quirky – even eccentric – at times, but it is unfailingly interesting, and there are many movements of outstanding refinement and beauty.
It is to be hoped that the present volume will allow Geminiani's Opus 7 concertos to be judged afresh, free from the prejudices engendered by the rather ill-considered opinions of Hawkins and Burney.
6 Concertos Op. 7 (H. 115-120) [Study Score]
PEG 7 - € 31.95
Geminiani, Francesco The Enchanted Forest (H. 151-154)

redpajama_set_name: RedPajamaCommonCrawl


text:
Marcus Joshua Carr (born June 6, 1999) is a Canadian college basketball player for the Texas Longhorns of the Big 12 Conference. He previously played for the Pittsburgh Panthers and the Minnesota Golden Gophers.

High school career
In his first two years of high school, Carr played for St. Michael's College School in Toronto. As a freshman, he led his team to the quarterfinals of the Ontario Federation of School Athletic Associations (OFSAA) tournament. Carr scored as many as 49 points in a single game. In 2015, he won the Ontario All-Catholic Classic and was named most valuable player (MVP) after scoring 16 points in the final. As a sophomore, Carr averaged 16 points, four rebounds and five assists per game. He lost only one game in the season, to Roman Catholic High School, and won the OFSAA title.

Before his junior year, Carr transferred to Montverde Academy, a school in Montverde, Florida with a renowned basketball program. He was drawn to Montverde because his grandmother lived in Orlando, Florida. However, Carr missed his entire junior season with a torn ACL. As a senior, he averaged 9.1 points, 3.5 rebounds and 3.7 assists per game, playing on the same team as the top recruit in the 2018 class, RJ Barrett. His team, which was ranked among the best in the country, achieved a 26–5 record and a runners-up finish at High School Nationals. At the end of the season, he played in the BioSteel All-Canadian Game. Carr was a three-star recruit and chose to play for Pittsburgh over offers from Cincinnati, Houston and Virginia Tech, among others. He was considered a three-star recruit and was ranked the 146th best prospect in his class.

College career

Carr began his collegiate career at the University of Pittsburgh. As a true freshman, he played in all 32 of Pitt's games with 27 starts and averaged 10.0 points, 4.0 assists and 2.8 rebounds per game. Carr announced that he would be leaving the program after head coach Kevin Stallings was fired at the end of the season in which the Panthers finished a disappointing 8–24. Carr committed to transfer to the University of Minnesota.

Carr sat out one year due to NCAA transfer rules after his request for a waiver that would allow him to play immediately was denied. During the year off, he impersonated opposing guards like Carsen Edwards on the scout team. Carr scored 35 points on December 15, 2019 in a 84–71 win over third-ranked Ohio State. On January 15, 2020, Carr scored 27 points in a 75–69 win against Penn State. At the close of the regular season, Carr was named to the Third Team All-Big Ten by the  media and was Honorable Mention All-Conference according to the coaches. He averaged 15.4 points, 5.3 rebounds and 6.5 assists per game, setting a school single-season record with 207 assists. After the season, Carr declared for the 2020 NBA draft but did not sign with an agent. On August 1, he announced that he would withdraw from the draft and return to Minnesota for his junior season.

In his junior season debut on November 25, 2020, Carr recorded 35 points, seven rebounds and four assists in a 99–69 win over Green Bay. On February 27, 2021, he scored 41 points in a 78–74 loss to Nebraska. Carr earned Third Team All-Big Ten honors as a junior after averaging 19.4 points, 4.0 rebounds and 4.9 assists per game. Following the season, he transferred to Texas. Carr was named to the Third Team All-Big 12 as a senior. He returned for his final season of eligibility and surpassed the 2,000 point mark early in the season.

National team career
Carr played for Canada at the 2015 FIBA Americas Under-16 Championship in Bahía Blanca, Argentina. In four games, he averaged 6.2 points and 2.8 rebounds per game, helping his team to a silver medal finish. After recovering from a major knee injury, Carr was not invited to training camp for the 2016 FIBA Under-17 World Championship.

Career statistics

College

|-
| style="text-align:left;"| 2017–18
| style="text-align:left;"| Pittsburgh
| 32 || 27 || 28.6 || .396 || .333 || .818 || 2.8 || 4.0 || .6 || .1 || 10.0
|-
| style="text-align:left;"| 2018–19
| style="text-align:left;"| Minnesota
| style="text-align:center;" colspan="11"|  Redshirt
|-
| style="text-align:left;"| 2019–20
| style="text-align:left;"| Minnesota
| 31 || 31 || 36.8 || .393 || .361 || .700 || 5.3 || 6.5 || .9 || .1 || 15.4
|-
| style="text-align:left;"| 2020–21
| style="text-align:left;"| Minnesota
| 29 || 29 || 35.8 || .385 || .317 || .799 || 4.0 || 4.9 || 1.3 || .1 || 19.4
|-
| style="text-align:left;"| 2021–22
| style="text-align:left;"| Texas
| 34 || 32 || 30.9 || .394 || .338 || .769 || 1.9 || 3.4 || 0.9 || .1 || 11.4
|-
|- class="sortbottom"
| style="text-align:center;" colspan="2"| Career
| 126 || 119 || 32.9 || .391 || .336 || .767 || 3.5 || 4.7 || .9 || .1 || 13.9

Personal life
Carr's older brother, Duane Notice, played college basketball for South Carolina and helped the Gamecocks reach the final four round of the 2017 NCAA tournament and previously played for the Raptors 905 in the NBA G-League and the Hamilton Honeybadgers (now Brampton) in the CEBL.

References

External links
Texas Longhorns bio
Minnesota Golden Gophers bio
Pittsburgh Panthers bio

1999 births
Living people
Basketball players from Toronto
Black Canadian basketball players
Canadian expatriate basketball people in the United States
Canadian men's basketball players
Minnesota Golden Gophers men's basketball players
Montverde Academy alumni
Pittsburgh Panthers men's basketball players
Point guards
Texas Longhorns men's basketball players

redpajama_set_name: RedPajamaWikipedia


Cavanaugh Penny Loafer is rated 4.2 out of 5 by 5.
Rated 4 out of 5 by joe79 from Love the shoe, but size is narrow My normal size is 9.5 D. In this show, the D width was too narrow. I got the E. I have three pairs, one in each color. When the leather sole wore done on on pair, I had the shoes recrafted with rubber soles. They turned out well. I regret that Allen Edmonds is discontinuing this shoe.
Rated 5 out of 5 by Anonymous from As usual, A-E shoes fit well from the first wearing. I do miss the Weldon which is no longer available and would have gotten that style instead but the quality of the Cavanaugh is still great.
Rated 3 out of 5 by Anonymous from Newer isn't always better Miss the older Edmonds pennies. This is just not as nice of a finish. Coffee? Seriously?


text:
Bob Marley ADD
News Photos Videos Releases Music Dates
12/29/2019 Interview with Cleveland 'Clevie' Browne - Memories of Steely
11/24/2019 Bitter Sweet GRAMMY Nomination for Julian Marley Who Mourns Daughter's Passing
10/10/2019 Bob Marley, Peter Tosh & Bunny Wailer - Wailers Receive Blue Plaque in London 2019
Videos Music
04/24/2019 Bob Marley & The Wailers - Satisfy My Soul
02/20/2019 Bob Marley - Easy Skanking
12/09/2018 One Love - Unity in the Middle East (Bob Marley Anthem)
08/31/2018 Bob Marley & The Wailers - Is This Love (Kaya 40 Mix) [Lyric Video]
10/29/2019 Bob Marley - Actions Figure Anime
10/21/2019 Soan - Redemption Song (Bob Marley Cover) @ The Voice Kids France 2019
10/01/2019 Bob Marley Awarded English Heritage Blue Plaque @ ITV News
02/13/2019 Rafael Cardoso - Babylon Feel Dis One
07/27/2018 Bob Marley & The Wailers - She's Gone (Kaya 40 Mix)
07/27/2018 Bob Marley & The Wailers - She's Gone (Kaya40 Mix)
07/04/2018 Bob Marley & The Wailers - Is This Love (Kaya 40 Mix)
01/05/2018 Sheku - No Woman No Cry
05/18/2017 Bob Marley & The Wailers - Jamming (Exodus 40)
05/05/2017 Bob Marley & The Wailers - Turn Your Lights Down Low (Exodus 40 Mix)
show all audios
11/22/2019 Bob Marley & The Wailers - Survival (40th Anniversary Limited Edition)
06/14/2019 Bob Marley - Legend (35th Anniversary Edition)
08/24/2018 Bob Marley & The Wailers - Kaya 40
September 2017 Bob Marley and the Wailers: The Ultimate Illustrated History
08/15/2017 Marley Coffee Cookbook: One Love, Many Coffees, and 100 Recipes
07/11/2017 So Much Things to Say: The Oral History of Bob Marley
02/06/2019 Bob Marley 74th Birthday Celebration
Bob Marley Birthday Celebration 2019
09/28/2018 Sister Minnie - Funeral Service
Kingston, Jamaica @ University Chapel
02/06/2018 Bob Marley's Birthday Celebration - Soul Rebel 73 in Kingston, Jamaica
02/06/2018 Reggae Jam Session - Bob Marley's Birthday Celebration in Kingston, Jamaica
02/06/2017 Vibes @ Bob Marley's 72nd Birthday Celebration in Kingston, Jamaica
Kingston, Jamaica @ Bob Marley Museum
02/06/2017 The Life of Bob Marley: Roger Steffens' Multimedia Presentation
Los Angeles, CA, United States @ Wanderlust
09/23/1980 Pittsburgh, PA, United States @ Stanley Theater
06/27/1980 Milano, Italy @ San Siro Stadium


text:
Daniel Caspary (ur. 4 kwietnia 1976 w Karlsruhe) – niemiecki polityk i ekonomista, poseł do Parlamentu Europejskiego VI, VII, VIII i IX kadencji.

Życiorys
W latach 1995–1997 służył w Bundeswehrze (dochodząc do stopnia porucznika). Ukończył w 2002 studia z zakresu ekonomii technicznej na Uniwersytecie w Karlsruhe. Przez dwa lata pracował w firmie energetycznej.

Wstąpił do Unii Chrześcijańsko-Demokratycznej, w 2002 został przewodniczącym tej partii w Stutensee. Trzy lata wcześniej został radnym tej miejscowości. Od 1999 obejmował kierownicze funkcje w organizacji młodzieżowej CDU/CSU Junge Union w Badenii-Wirtembergii.

W 2004 z listy CDU uzyskał mandat deputowanego do Parlamentu Europejskiego. Pracował m.in. w Komisji Handlu Zagranicznego i Komisji Petycji, należał do grupy EPP-ED. W wyborach w 2009, 2014 i 2019 skutecznie ubiegał się o reelekcję.

Przypisy

Bibliografia

Niemieccy posłowie do Parlamentu Europejskiego
Niemieccy samorządowcy
Politycy CDU
Ludzie urodzeni w Karlsruhe
Urodzeni w 1976


text:
Parliament Square, London
#342 of 3,736 in Things to do in London
Trip Planner: Europe / UK / England / London / Parliament Square
Landmark Tourist Spot
Parliament Square is a square at the northwest end of the Palace of Westminster in central London. It features a large open green area in the centre with trees to its west, and it contains eleven statues of statesmen and other notable individuals.
As well as being one of London's main tourist attractions, it is also the place where many demonstrations and protests have been held. The square is overlooked by various official buildings: legislature to the east (in the Houses of Parliament), executive offices to the north (on Whitehall), the judiciary to the west (the Supreme Court), and the church to the south (with Westminster Abbey).
Buildings looking upon the square include the churches Westminster Abbey and St Margaret's, Westminster, the Middlesex Guildhall which is the seat of the Supreme Court of the United Kingdom, Government Offices Great George Street serving HM Treasury and HM Revenue and Customs, and Portcullis House.
Roads that branch off the Parliament Square are St Margaret Street (towards Millbank), Broad Sanctuary (towards Victoria Street), Great George Street (towards Birdcage Walk), Parliament Street (leading into Whitehall), and Bridge Street (leading onto Westminster Bridge).
Plan to see Parliament Square and other attractions that appeal to you using our London tour itinerary planning app .
44 Parliament St,
Create an itinerary including Parliament Square
Parliament Square Reviews
By GeysirGal
This is a very busy and bustling part of town at the very heart of Westminster - one of London's oldest and most exclusive areas. with always something going on - both night and day, and full of histo... more »
By Mark42139
This is an area definitely worth visiting to see where the Houses of Parliament are. I especially enjoy the status of Winston Churchill outside. more »
Plans to Parliament Square by other users
24 days in Europe BY A USER FROM BRAZIL September, teens, slow & easy, popular sights PREFERENCES: September, teens ATTRACTION STYLE: Popular sights PACE: Slow & easy 11 days in Europe BY A USER FROM UNITED STATES June, culture, romantic, beaches, historic sites, museums, popular sights PREFERENCES: June, culture, romantic, beaches, historic sites, museums ATTRACTION STYLE: Popular sights PACE: Medium 24 days in England, Holland & Germany BY A USER FROM BRAZIL February, popular sights PREFERENCES: February ATTRACTION STYLE: Popular sights PACE: Medium 22 days in Europe BY A USER FROM MALAYSIA June, culture, relaxing, romantic, historic sites, museums, shopping, popular sights PREFERENCES: June, culture, relaxing, romantic, historic sites, museums, shopping ATTRACTION STYLE: Popular sights PACE: Medium 25 days in United Kingdom BY A USER FROM KUWAIT December, culture, outdoors, historic sites, fast-paced, popular sights PREFERENCES: December, culture, outdoors, historic sites ATTRACTION STYLE: Popular sights PACE: Fast-paced 60 days in London BY A USER FROM AUSTRALIA November, popular sights PREFERENCES: November ATTRACTION STYLE: Popular sights PACE: Medium


Preface. I. Introduction and Overview. Introduction: progress in understanding continental rifts (K.H. Olsen, P. Morgan). Mechanisms of rifting: geodynamic modeling of continental rift systems (M.H.P. Bott). II. Methods of Investigation: Multi-disciplinary Perspectives. Petrology,geochemistry, isotopes (R.F. Wendlandt et al.). Seismic techniques (L.W. Braile et al.). Potential field methods (M.H.P. Bott, W.J. Hinze). Heat flow in rifts (P. Morgan). Practical magnetotellurics in a continental rift environment (G.R. Jiracek, V. Haak, K.H. Olsen). III. Modern Rifts. The European Cenozoic rift system (C. Prodehl, St. Mueller, V. Haak). The East African rift system (L.W. Braile et al.). The Rio Grande rift (W.S. Baldridge et al.). The Basin and Range province (T. Parsons). The Baikal rift system (G.R. Keller et al.). IV. Paleorifts. The Oslo rift (E.-R. Neumann, K.H. Olsen, W.S. Baldridge). The Midcontinent Rift System, U.S.A.: a major Proterozoic continental rift (D.J. Allen et al.). Rifted passive margins (M.H.P. Bott). The Southern Oklahoma Aulacogen (G.R. Keller, W.S. Baldridge). West and Central African rift system (G.R. Keller, R.F. Wendlandt, M.H.P. Bott). V. Epilogue. Continental rifting: a final perspective (W.S. Baldridge, G.R. Keller, L.W. Braile). Subject index.
This multi-author book has been prepared by an international group of geoscientists that have been active in rift research since the late 1960s. In 1984, an informal, grass-roots study group was initiated to compare individual research results and to explore in greater depth the apparent differences and similarities in the interpretations from various rift systems. The group became known as the CREST working group, an acronym of Continental Rifts: Evolution, Structure and Tectonics, which not surprisingly became the title of this book.
Continental Rifts: Evolution, Structure, Tectonics presents an overview of the present state of understanding and knowledge of the processes of continental rifting from a multidisciplinary, lithospheric scale perspective. The chapters have been structured on each rift system in approximately the same synoptic sequence, so as to facilitate comparisons of rifts by the reader. The book complements its predecessors by presenting a more unified picture. It succeeds in presenting the status of a representative majority of the continental rift systems that have been at the forefront of recent research. For students and experienced researchers alike, this book will be of significant value in assessing the current state of knowledge and in serving as a framework for future research.


text:
package com.pearson.statsagg.webui;

import com.pearson.statsagg.database_objects.DatabaseObjectCommon;
import java.io.PrintWriter;
import java.math.BigDecimal;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.pearson.statsagg.database_objects.alerts.Alert;
import com.pearson.statsagg.database_objects.alerts.AlertsDao;
import com.pearson.statsagg.database_objects.metric_group.MetricGroup;
import com.pearson.statsagg.database_objects.metric_group.MetricGroupsDao;
import com.pearson.statsagg.database_objects.notifications.NotificationGroup;
import com.pearson.statsagg.database_objects.notifications.NotificationGroupsDao;
import com.pearson.statsagg.globals.GlobalVariables;
import com.pearson.statsagg.utilities.StackTrace;
import java.util.ArrayList;
import java.util.List;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.owasp.encoder.Encode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Jeffrey Schmidt
 */
@WebServlet(name = "CreateAlert", urlPatterns = {"/CreateAlert"})
public class CreateAlert extends HttpServlet {

    private static final Logger logger = LoggerFactory.getLogger(CreateAlert.class.getName());

    public static final String PAGE_NAME = "Create Alert";

    /**
     * Handles the HTTP GET method.
     *
     * @param request servlet request
     * @param response servlet response
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        processGetRequest(request, response);
    }

    /**
     * Handles the HTTP POST method.
     *
     * @param request servlet request
     * @param response servlet response
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
        processPostRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return PAGE_NAME;
    }

    protected void processGetRequest(HttpServletRequest request, HttpServletResponse response) {

        if ((request == null) || (response == null)) {
            return;
        }

        response.setContentType("text/html");
        PrintWriter out = null;

        try {
            StringBuilder htmlBuilder = new StringBuilder();

            StatsAggHtmlFramework statsAggHtmlFramework = new StatsAggHtmlFramework();
            String htmlHeader = statsAggHtmlFramework.createHtmlHeader("StatsAgg - " + PAGE_NAME, "");

            Alert alert = null;
            String name = request.getParameter("Name");
            if (name != null) {
                AlertsDao alertsDao = new AlertsDao();
                alert = alertsDao.getAlertByName(name.trim());
            }

            String htmlBodyContents = buildCreateAlertHtml(alert);
            List<String> additionalJavascript = new ArrayList<>();
            additionalJavascript.add("js/statsagg_create_alert.js");
            String htmlBody = statsAggHtmlFramework.createHtmlBody(htmlBodyContents, additionalJavascript);
            htmlBuilder.append("<!DOCTYPE html>\n\n").append(htmlHeader).append(htmlBody).append("");

            Document htmlDocument = Jsoup.parse(htmlBuilder.toString());
            String htmlFormatted  = htmlDocument.toString();
            out = response.getWriter();
            out.println(htmlFormatted);
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
        }
        finally {
            if (out != null) {
                out.close();
            }
        }

    }

    protected void processPostRequest(HttpServletRequest request, HttpServletResponse response) {

        if ((request == null) || (response == null)) {
            return;
        }

        PrintWriter out = null;

        try {
            String result = parseAndAlterAlert(request);

            response.setContentType("text/html");

            StringBuilder htmlBuilder = new StringBuilder();
            StatsAggHtmlFramework statsAggHtmlFramework = new StatsAggHtmlFramework();
            String htmlHeader = statsAggHtmlFramework.createHtmlHeader("StatsAgg - " + PAGE_NAME, "");
            String htmlBodyContent = statsAggHtmlFramework.buildHtmlBodyForPostResult(PAGE_NAME, StatsAggHtmlFramework.htmlEncode(result), "Alerts", Alerts.PAGE_NAME);
            String htmlBody = statsAggHtmlFramework.createHtmlBody(htmlBodyContent);
            htmlBuilder.append("<!DOCTYPE html>\n\n").append(htmlHeader).append(htmlBody).append("");

            Document htmlDocument = Jsoup.parse(htmlBuilder.toString());
            String htmlFormatted  = htmlDocument.toString();
            out = response.getWriter();
            out.println(htmlFormatted);
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
        }
        finally {
            if (out != null) {
                out.close();
            }
        }
    }

    private String buildCreateAlertHtml(Alert alert) {

        StringBuilder htmlBody = new StringBuilder();

        htmlBody.append(
            "
\n" +
            "  \n" +
            "
\n" +
            "
 \n" +
            "

 " + PAGE_NAME + "

\n" +
            "
\n " +
            "  <form action=\"CreateAlert\" method=\"POST\">\n" +
            "
\n");

        if ((alert != null) && (alert.getName() != null) && !alert.getName().isEmpty()) {
            htmlBody.append("<input type=\"hidden\" name=\"Old_Name\" value=\"").append(Encode.forHtmlAttribute(alert.getName())).append("\">");
        }

        // start column 1
        htmlBody.append(
            "
\n" +
            "
\n" +
            "
Core Alert Criteria
\n" +
            "
");

        // name
        htmlBody.append(
            "
\n" +
            "  Name\n" +
            "  <button type=\"button\" id=\"Name_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"A unique name for this alert.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"form-control-statsagg\" name=\"Name\" id=\"Name\" ");

        if ((alert != null) && (alert.getName() != null)) {
            htmlBody.append(" value=\"").append(Encode.forHtmlAttribute(alert.getName())).append("\"");
        }

        htmlBody.append(">\n
\n");

        // description
        htmlBody.append(
            "
\n" +
            "  Description\n" +
            "  <textarea class=\"form-control-statsagg\" rows=\"3\" name=\"Description\" id=\"Description\">");

        if ((alert != null) && (alert.getDescription() != null)) {
            htmlBody.append(Encode.forHtmlAttribute(alert.getDescription()));
        }

        htmlBody.append("</textarea>\n");
        htmlBody.append("
\n");

        // metric group name
        htmlBody.append(
            "
\n" +
            "  Metric group name\n" +
            "  <button type=\"button\" id=\"MetricGroupName_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The exact name of the metric group to associate with this alert.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"typeahead form-control-statsagg\" autocomplete=\"off\" name=\"MetricGroupName\" id=\"MetricGroupName\" ");

        if ((alert != null) && (alert.getMetricGroupId() != null)) {
            MetricGroupsDao metricGroupsDao = new MetricGroupsDao();
            MetricGroup metricGroup = metricGroupsDao.getMetricGroup(alert.getMetricGroupId());

            if ((metricGroup != null) && (metricGroup.getName() != null)) {
                htmlBody.append(" value=\"").append(Encode.forHtmlAttribute(metricGroup.getName())).append("\"");
            }
        }

        htmlBody.append(">\n
\n");

        // alert type
        htmlBody.append("
\n");

        htmlBody.append("Alert type:  \n");

        htmlBody.append("<input type=\"radio\" id=\"Type_Availability\" name=\"Type\" value=\"Availability\" ");
        if ((alert != null) && (alert.getAlertType() != null) && (alert.getAlertType() == Alert.TYPE_AVAILABILITY)) htmlBody.append(" checked=\"checked\"");
        htmlBody.append("> Availability    \n");

        htmlBody.append("<input type=\"radio\" id=\"Type_Threshold\" name=\"Type\" value=\"Threshold\" ");
        if ((alert != null) && (alert.getAlertType() != null) && (alert.getAlertType() == Alert.TYPE_THRESHOLD)) htmlBody.append(" checked=\"checked\"");
        htmlBody.append("> Threshold\n");

        htmlBody.append("
");

        // is enabled?
        htmlBody.append(
            "
\n" +
            "  Is alert enabled?  \n" +
            "  <input name=\"Enabled\" id=\"Enabled\" type=\"checkbox\" ");

        if (((alert != null) && (alert.isEnabled() != null) && alert.isEnabled()) ||
                (alert == null) || (alert.isEnabled() == null)) {
            htmlBody.append(" checked=\"checked\"");
        }

        htmlBody.append(">\n
\n");

        // is caution alerting enabled?
        htmlBody.append(
            "
\n" +
            "  Is caution alerting enabled?  \n" +
            "  <input name=\"CautionEnabled\" id=\"CautionEnabled\" type=\"checkbox\" ");

        if (((alert != null) && (alert.isCautionEnabled() != null) && alert.isCautionEnabled()) ||
                (alert == null) || (alert.isCautionEnabled() == null)) {
            htmlBody.append(" checked=\"checked\"");
        }

        htmlBody.append(">\n
\n");

        // is danger alerting enabled?
        htmlBody.append(
            "
\n" +
            "  Is danger alerting enabled?  \n" +
            "  <input name=\"DangerEnabled\" id=\"DangerEnabled\" type=\"checkbox\" ");

        if (((alert != null) && (alert.isDangerEnabled() != null) && alert.isDangerEnabled()) ||
                (alert == null) || (alert.isDangerEnabled() == null)) {
            htmlBody.append(" checked=\"checked\"");
        }

        htmlBody.append(">\n
\n");

        // alert on positive?
        htmlBody.append(
            "
\n" +
            "  Alert on positive?  \n" +
            "  <input name=\"AlertOnPositive\" id=\"AlertOnPositive\" type=\"checkbox\" ");

        if (((alert != null) && (alert.isAlertOnPositive() != null) && alert.isAlertOnPositive()) ||
                (alert == null) || (alert.isAlertOnPositive() == null)) {
            htmlBody.append(" checked=\"checked\"");
        }

        htmlBody.append(">\n
\n");

        // allow resend alert?
        htmlBody.append(
            "
\n" +
            "  Resend alert?  \n" +
            "  <input name=\"AllowResendAlert\" id=\"AllowResendAlert\" type=\"checkbox\" ");

        if ((alert != null) && (alert.isAllowResendAlert()!= null) && alert.isAllowResendAlert()) {
            htmlBody.append(" checked=\"checked\"");
        }

        htmlBody.append(">\n
\n");

        // resend alert every...
        htmlBody.append("Resend alert every...\n");
        htmlBody.append("<button type=\"button\" id=\"ResendAlertEvery_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"Specifies how long to wait before resending a notification for a triggered alert.\" style=\"margin-bottom: 1.5px;\">?</button> ");
        htmlBody.append("
\n");

        htmlBody.append(
            "
\n" +
            "  <input class=\"form-control-statsagg\" placeholder=\"If 'resend alert' is enabled, how often should the alert be resent?\" name=\"ResendAlertEvery\" id=\"ResendAlertEvery\" ");

        if ((alert != null) && (alert.getResendAlertEvery() != null)) {
            BigDecimal sendAlertEvery = DatabaseObjectCommon.getValueForTimeFromMilliseconds(alert.getResendAlertEvery(), alert.getResendAlertEveryTimeUnit());
            htmlBody.append(" value=\"").append(sendAlertEvery.stripTrailingZeros().toPlainString()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // resend alert every... time unit
        htmlBody.append(
            "
\n" +
            "  <select class=\"form-control-statsagg\" name=\"ResendAlertEveryTimeUnit\" id=\"ResendAlertEveryTimeUnit\">\n");

        if ((alert != null) && (DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getResendAlertEveryTimeUnit(), true) != null)) {
            String timeUnitString = DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getResendAlertEveryTimeUnit(), true);

            if (timeUnitString.equalsIgnoreCase("Seconds")) htmlBody.append("<option selected=\"selected\">Seconds</option>\n");
            else htmlBody.append("<option>Seconds</option>\n");

            if (timeUnitString.equalsIgnoreCase("Minutes")) htmlBody.append("<option selected=\"selected\">Minutes</option>\n");
            else htmlBody.append("<option>Minutes</option>\n");

            if (timeUnitString.equalsIgnoreCase("Hours")) htmlBody.append("<option selected=\"selected\">Hours</option>\n");
            else htmlBody.append("<option>Hours</option>\n");

            if (timeUnitString.equalsIgnoreCase("Days")) htmlBody.append("<option selected=\"selected\">Days</option>\n");
            else htmlBody.append("<option>Days</option>\n");
        }
        else {
            htmlBody.append(
                "<option>Seconds</option>\n" +
                "<option>Minutes</option>\n" +
                "<option>Hours</option>\n" +
                "<option>Days</option>\n"
            );
        }

        htmlBody.append("</select>\n");
        htmlBody.append("
\n");
        htmlBody.append("
\n");

        // end column 1
        htmlBody.append(
            "
\n" +
            "
\n" +
            "
\n");

        // start column 2
        htmlBody.append(
            "
\n" +
            "
\n" +
            "
Caution Criteria " +
            "    Preview" +
            "
" +
            "
");

        // warning for when no alert-type is selected
        htmlBody.append("Please select an alert type\n");

        // caution notification group name
        htmlBody.append(
            "
\n" +
            "
\n" +
            "    Notification group name\n" +
            "    <button type=\"button\" id=\"CautionNotificationGroupName_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The exact name of the notification group to send alerts to.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "    <input class=\"typeahead form-control-statsagg\" autocomplete=\"off\" name=\"CautionNotificationGroupName\" id=\"CautionNotificationGroupName\" ");

        if ((alert != null) && (alert.getCautionNotificationGroupId() != null)) {
            NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
            NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroup(alert.getCautionNotificationGroupId());

            if ((notificationGroup != null) && (notificationGroup.getName() != null)) {
                htmlBody.append(" value=\"").append(Encode.forHtmlAttribute(notificationGroup.getName())).append("\"");
            }
        }

        htmlBody.append(">\n

\n");

        // caution positive notification group name
        htmlBody.append(
            "
\n" +
            "
\n" +
            "    Positive notification group name\n" +
            "    <button type=\"button\" id=\"CautionPositiveNotificationGroupName_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The exact name of the notification group to send positive alerts to.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "    <input class=\"typeahead form-control-statsagg\" autocomplete=\"off\" name=\"CautionPositiveNotificationGroupName\" id=\"CautionPositiveNotificationGroupName\" ");

        if ((alert != null) && (alert.getCautionPositiveNotificationGroupId() != null)) {
            NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
            NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroup(alert.getCautionPositiveNotificationGroupId());

            if ((notificationGroup != null) && (notificationGroup.getName() != null)) {
                htmlBody.append(" value=\"").append(Encode.forHtmlAttribute(notificationGroup.getName())).append("\"");
            }
        }

        htmlBody.append(">\n

\n");

        // caution window duration
        htmlBody.append("
\n");
        htmlBody.append("  Window duration\n");
        htmlBody.append("  <button type=\"button\" id=\"CautionWindowDuration_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"A rolling time window between 'now' and 'X' time units ago. Values that fall in this window are used in alert evaluation.\" style=\"margin-bottom: 1.5px;\">?</button> ");
        htmlBody.append("
\n");

        htmlBody.append(
            "
\n" +
            "  <input class=\"form-control-statsagg\" name=\"CautionWindowDuration\" id=\"CautionWindowDuration\" ");

        if ((alert != null) && (alert.getCautionWindowDuration() != null)) {
            BigDecimal cautionWindowDuration = DatabaseObjectCommon.getValueForTimeFromMilliseconds(alert.getCautionWindowDuration(), alert.getCautionWindowDurationTimeUnit());
            htmlBody.append(" value=\"").append(cautionWindowDuration.stripTrailingZeros().toPlainString()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // caution window duration time unit
        htmlBody.append(
            "
\n" +
            "  <select class=\"form-control-statsagg\" name=\"CautionWindowDurationTimeUnit\" id=\"CautionWindowDurationTimeUnit\">\n");

        if ((alert != null) && (DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getCautionWindowDurationTimeUnit(), true) != null)) {
            String timeUnitString = DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getCautionWindowDurationTimeUnit(), true);

            if (timeUnitString.equalsIgnoreCase("Seconds")) htmlBody.append("<option selected=\"selected\">Seconds</option>\n");
            else htmlBody.append("<option>Seconds</option>\n");

            if (timeUnitString.equalsIgnoreCase("Minutes")) htmlBody.append("<option selected=\"selected\">Minutes</option>\n");
            else htmlBody.append("<option>Minutes</option>\n");

            if (timeUnitString.equalsIgnoreCase("Hours")) htmlBody.append("<option selected=\"selected\">Hours</option>\n");
            else htmlBody.append("<option>Hours</option>\n");

            if (timeUnitString.equalsIgnoreCase("Days")) htmlBody.append("<option selected=\"selected\">Days</option>\n");
            else htmlBody.append("<option>Days</option>\n");
        }
        else {
            htmlBody.append(
                "<option>Seconds</option>\n" +
                "<option>Minutes</option>\n" +
                "<option>Hours</option>\n" +
                "<option>Days</option>\n"
            );
        }

        htmlBody.append("</select>\n");
        htmlBody.append("

\n");

        // caution stop tracking after
        htmlBody.append("
\n");
        htmlBody.append("  Stop tracking after...\n");
        htmlBody.append("  <button type=\"button\" id=\"CautionStopTrackingAfter_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"After a metric has not been seen for X time-units, stop alerting on it.\" style=\"margin-bottom: 1.5px;\">?</button> ");
        htmlBody.append("
\n");

        htmlBody.append(
            "
\n" +
            "  <input class=\"form-control-statsagg\" name=\"CautionStopTrackingAfter\" id=\"CautionStopTrackingAfter\"");

        if ((alert != null) && (alert.getCautionStopTrackingAfter() != null)) {
            BigDecimal cautionStopTrackingAfter = DatabaseObjectCommon.getValueForTimeFromMilliseconds(alert.getCautionStopTrackingAfter(), alert.getCautionStopTrackingAfterTimeUnit());
            htmlBody.append(" value=\"").append(cautionStopTrackingAfter.stripTrailingZeros().toPlainString()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // caution 'stop tracking after' time unit
        htmlBody.append(
            "
\n" +
            "  <select class=\"form-control-statsagg\" name=\"CautionStopTrackingAfterTimeUnit\" id=\"CautionStopTrackingAfterTimeUnit\">\n");

        if ((alert != null) && (DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getCautionStopTrackingAfterTimeUnit(), true) != null)) {
            String timeUnitString = DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getCautionStopTrackingAfterTimeUnit(), true);

            if (timeUnitString.equalsIgnoreCase("Seconds")) htmlBody.append("<option selected=\"selected\">Seconds</option>\n");
            else htmlBody.append("<option>Seconds</option>\n");

            if (timeUnitString.equalsIgnoreCase("Minutes")) htmlBody.append("<option selected=\"selected\">Minutes</option>\n");
            else htmlBody.append("<option>Minutes</option>\n");

            if (timeUnitString.equalsIgnoreCase("Hours")) htmlBody.append("<option selected=\"selected\">Hours</option>\n");
            else htmlBody.append("<option>Hours</option>\n");

            if (timeUnitString.equalsIgnoreCase("Days")) htmlBody.append("<option selected=\"selected\">Days</option>\n");
            else htmlBody.append("<option>Days</option>\n");
        }
        else {
            htmlBody.append(
                "<option>Seconds</option>\n" +
                "<option>Minutes</option>\n" +
                "<option>Hours</option>\n" +
                "<option>Days</option>\n"
            );
        }

        htmlBody.append("</select>\n");
        htmlBody.append("

\n");

        // caution minimum sample count
        htmlBody.append(
            "
\n" +
            "  Minimum sample count\n" +
            "  <button type=\"button\" id=\"CautionMinimumSampleCount_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"An alert can only be triggered if there are at least 'X' samples within specified the 'alert window duration'.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"form-control-statsagg\" name=\"CautionMinimumSampleCount\" id=\"CautionMinimumSampleCount\"");

        if ((alert != null) && (alert.getCautionMinimumSampleCount() != null)) {
            htmlBody.append(" value=\"").append(alert.getCautionMinimumSampleCount()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // caution operator
        htmlBody.append(
            "
\n" +
            "  Operator\n" +
            "  <button type=\"button\" id=\"CautionOperator_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The values of a metric-key are considered for threshold-based alerting when they are above/below/equal-to a certain threshold. This value controls the above/below/equal-to aspect of the alert.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <select class=\"form-control-statsagg\" name=\"CautionOperator\" id=\"CautionOperator\">\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.CAUTION, true, false) != null) && alert.getOperatorString(Alert.CAUTION, true, false).equalsIgnoreCase(">")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append(">  (greater than)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.CAUTION, true, false) != null) && alert.getOperatorString(Alert.CAUTION, true, false).equalsIgnoreCase(">=")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append(">=  (greater than or equal to)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.CAUTION, true, false) != null) && alert.getOperatorString(Alert.CAUTION, true, false).equalsIgnoreCase("<")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append("<  (less than)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.CAUTION, true, false) != null) && alert.getOperatorString(Alert.CAUTION, true, false).equalsIgnoreCase("<=")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append("<=  (less than or equal to)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.CAUTION, true, false) != null) && alert.getOperatorString(Alert.CAUTION, true, false).equalsIgnoreCase("=")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append("=  (equal to)</option>\n");

        htmlBody.append("</select>\n");
        htmlBody.append("
\n");

        // caution combination
        htmlBody.append(
            "
\n" +
            "  Combination\n" +
            "  <button type=\"button\" id=\"CautionCombination_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"For any metric values that fall within the 'alert window duration', what condition will cause the alert to be triggered? Is the average of the metric values above or below the threshold? Are all metrics values above or below the threshold? Is any metric value above or below the threshold? Are 'at least' or 'at most' X metric values above or below the threshold?\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <select class=\"form-control-statsagg\" name=\"CautionCombination\" id=\"CautionCombination\">\n");

        if ((alert != null) && (alert.getCombinationString(Alert.CAUTION) != null)) {
            if (alert.getCombinationString(Alert.CAUTION).equalsIgnoreCase("Any")) htmlBody.append("<option selected=\"selected\">Any</option>\n");
            else htmlBody.append("<option>Any</option>\n");

            if (alert.getCombinationString(Alert.CAUTION).equalsIgnoreCase("All")) htmlBody.append("<option selected=\"selected\">All</option>\n");
            else htmlBody.append("<option>All</option>\n");

            if (alert.getCombinationString(Alert.CAUTION).equalsIgnoreCase("Average")) htmlBody.append("<option selected=\"selected\">Average</option>\n");
            else htmlBody.append("<option>Average</option>\n");

            if (alert.getCombinationString(Alert.CAUTION).equalsIgnoreCase("At most")) htmlBody.append("<option selected=\"selected\">At most</option>\n");
            else htmlBody.append("<option>At most</option>\n");

            if (alert.getCombinationString(Alert.CAUTION).equalsIgnoreCase("At least")) htmlBody.append("<option selected=\"selected\">At least</option>\n");
            else htmlBody.append("<option>At least</option>\n");
        }
        else {
            htmlBody.append(
                "<option>Any</option>\n" +
                "<option>All</option>\n" +
                "<option>Average</option>\n" +
                "<option>At most</option>\n" +
                "<option>At least</option>\n"
            );
        }

        htmlBody.append("</select>\n");
        htmlBody.append("
\n");

        // caution combination count
        htmlBody.append(
            "
\n" +
            "  Combination count\n" +
            "  <button type=\"button\" id=\"CautionCombination_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"If using a combination of 'at most' or 'at least', then you must specify a count. This refers to the number of independent metric values for a single metric-key that fall within the 'alert window duration'.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"form-control-statsagg\" name=\"CautionCombinationCount\" id=\"CautionCombinationCount\" ");

        if ((alert != null) && (alert.getCautionCombinationCount() != null)) {
            htmlBody.append(" value=\"").append(alert.getCautionCombinationCount()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // caution threshold
        htmlBody.append(
            "
\n" +
            "  Threshold\n" +
            "  <button type=\"button\" id=\"CautionThreshold_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The numeric threshold that, if crossed, will trigger the alert.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"form-control-statsagg\" name=\"CautionThreshold\" id=\"CautionThreshold\" ");

        if ((alert != null) && (alert.getCautionThreshold() != null)) {
            htmlBody.append(" value=\"").append(alert.getCautionThreshold().stripTrailingZeros().toPlainString()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // end column 2
        htmlBody.append("
\n
\n
\n");

        // start column 3
        htmlBody.append(
            "
\n" +
            "
\n" +
            "
Danger Criteria " +
            "    Preview" +
            "
" +
            "
");

        // warning for when no alert-type is selected
        htmlBody.append("Please select an alert type\n");

        // danger notification group name
        htmlBody.append(
            "
\n" +
            "
\n" +
            "    Notification group name\n" +
            "    <button type=\"button\" id=\"DangerNotificationGroupName_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The exact name of the notification group to send alerts to.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "    <input class=\"typeahead form-control-statsagg\" autocomplete=\"off\" name=\"DangerNotificationGroupName\" id=\"DangerNotificationGroupName\" ");

        if ((alert != null) && (alert.getDangerNotificationGroupId() != null)) {
            NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
            NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroup(alert.getDangerNotificationGroupId());

            if ((notificationGroup != null) && (notificationGroup.getName() != null)) {
                htmlBody.append(" value=\"").append(Encode.forHtmlAttribute(notificationGroup.getName())).append("\"");
            }
        }

        htmlBody.append(">\n

\n");

        // danger positive notification group name
        htmlBody.append(
            "
\n" +
            "
\n" +
            "    Positive notification group name\n" +
            "    <button type=\"button\" id=\"DangerPositiveNotificationGroupName_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The exact name of the notification group to send positive alerts to.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "    <input class=\"typeahead form-control-statsagg\" autocomplete=\"off\" name=\"DangerPositiveNotificationGroupName\" id=\"DangerPositiveNotificationGroupName\" ");

        if ((alert != null) && (alert.getDangerPositiveNotificationGroupId() != null)) {
            NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
            NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroup(alert.getDangerPositiveNotificationGroupId());

            if ((notificationGroup != null) && (notificationGroup.getName() != null)) {
                htmlBody.append(" value=\"").append(Encode.forHtmlAttribute(notificationGroup.getName())).append("\"");
            }
        }

        htmlBody.append(">\n

\n");

        // danger window duration
        htmlBody.append("
\n");
        htmlBody.append("  Window duration\n");
        htmlBody.append("  <button type=\"button\" id=\"DangerWindowDuration_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"A rolling time window between 'now' and 'X' time units ago. Values that fall in this window are used in alert evaluation.\" style=\"margin-bottom: 1.5px;\">?</button> ");
        htmlBody.append("
\n");

        htmlBody.append(
            "
\n" +
            "  <input class=\"form-control-statsagg\" name=\"DangerWindowDuration\" id=\"DangerWindowDuration\" ");

        if ((alert != null) && (alert.getDangerWindowDuration() != null)) {
            BigDecimal dangerWindowDuration = DatabaseObjectCommon.getValueForTimeFromMilliseconds(alert.getDangerWindowDuration(), alert.getDangerWindowDurationTimeUnit());
            htmlBody.append(" value=\"").append(dangerWindowDuration.stripTrailingZeros().toPlainString()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // danger window duration time unit
        htmlBody.append(
            "
\n" +
            "  <select class=\"form-control-statsagg\" name=\"DangerWindowDurationTimeUnit\" id=\"DangerWindowDurationTimeUnit\">\n");

        if ((alert != null) && (DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getDangerWindowDurationTimeUnit(), true) != null)) {
            String timeUnitString = DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getDangerWindowDurationTimeUnit(), true);

            if (timeUnitString.equalsIgnoreCase("Seconds")) htmlBody.append("<option selected=\"selected\">Seconds</option>\n");
            else htmlBody.append("<option>Seconds</option>\n");

            if (timeUnitString.equalsIgnoreCase("Minutes")) htmlBody.append("<option selected=\"selected\">Minutes</option>\n");
            else htmlBody.append("<option>Minutes</option>\n");

            if (timeUnitString.equalsIgnoreCase("Hours")) htmlBody.append("<option selected=\"selected\">Hours</option>\n");
            else htmlBody.append("<option>Hours</option>\n");

            if (timeUnitString.equalsIgnoreCase("Days")) htmlBody.append("<option selected=\"selected\">Days</option>\n");
            else htmlBody.append("<option>Days</option>\n");
        }
        else {
            htmlBody.append(
                "<option>Seconds</option>\n" +
                "<option>Minutes</option>\n" +
                "<option>Hours</option>\n" +
                "<option>Days</option>\n"
            );
        }

        htmlBody.append("</select>\n");
        htmlBody.append("

\n");

        // danger stop tracking after
        htmlBody.append("
\n");
        htmlBody.append("  Stop tracking after...\n");
        htmlBody.append("  <button type=\"button\" id=\"DangerStopTrackingAfter_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"After a metric has not been seen for X time-units, stop alerting on it.\" style=\"margin-bottom: 1.5px;\">?</button> ");
        htmlBody.append("
\n");

        htmlBody.append(
            "
\n" +
            "  <input class=\"form-control-statsagg\" name=\"DangerStopTrackingAfter\" id=\"DangerStopTrackingAfter\"");

        if ((alert != null) && (alert.getDangerStopTrackingAfter() != null)) {
            BigDecimal dangerStopTrackingAfter = DatabaseObjectCommon.getValueForTimeFromMilliseconds(alert.getDangerStopTrackingAfter(), alert.getDangerStopTrackingAfterTimeUnit());
            htmlBody.append(" value=\"").append(dangerStopTrackingAfter.stripTrailingZeros().toPlainString()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // danger 'stop tracking after' time unit
        htmlBody.append(
            "
\n" +
            "  <select class=\"form-control-statsagg\" name=\"DangerStopTrackingAfterTimeUnit\" id=\"DangerStopTrackingAfterTimeUnit\">\n");

        if ((alert != null) && (DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getDangerStopTrackingAfterTimeUnit(), true) != null)) {
            String timeUnitString = DatabaseObjectCommon.getTimeUnitStringFromCode(alert.getDangerStopTrackingAfterTimeUnit(), true);

            if (timeUnitString.equalsIgnoreCase("Seconds")) htmlBody.append("<option selected=\"selected\">Seconds</option>\n");
            else htmlBody.append("<option>Seconds</option>\n");

            if (timeUnitString.equalsIgnoreCase("Minutes")) htmlBody.append("<option selected=\"selected\">Minutes</option>\n");
            else htmlBody.append("<option>Minutes</option>\n");

            if (timeUnitString.equalsIgnoreCase("Hours")) htmlBody.append("<option selected=\"selected\">Hours</option>\n");
            else htmlBody.append("<option>Hours</option>\n");

            if (timeUnitString.equalsIgnoreCase("Days")) htmlBody.append("<option selected=\"selected\">Days</option>\n");
            else htmlBody.append("<option>Days</option>\n");
        }
        else {
            htmlBody.append(
                "<option>Seconds</option>\n" +
                "<option>Minutes</option>\n" +
                "<option>Hours</option>\n" +
                "<option>Days</option>\n"
            );
        }

        htmlBody.append("</select>\n");
        htmlBody.append("

\n");

        // danger minimum sample count
        htmlBody.append(
            "
\n" +
            "  Minimum sample count\n" +
            "  <button type=\"button\" id=\"DangerMinimumSampleCount_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"An alert can only be triggered if there are at least 'X' samples within specified the 'alert window duration'.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"form-control-statsagg\" name=\"DangerMinimumSampleCount\" id=\"DangerMinimumSampleCount\"");

        if ((alert != null) && (alert.getDangerMinimumSampleCount() != null)) {
            htmlBody.append(" value=\"").append(alert.getDangerMinimumSampleCount()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // danger operator
        htmlBody.append(
            "
\n" +
            "  Operator\n" +
            "  <button type=\"button\" id=\"DangerOperator_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The values of a metric-key are considered for threshold-based alerting when they are above/below/equal-to a certain threshold. This value controls the above/below/equal-to aspect of the alert.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <select class=\"form-control-statsagg\" name=\"DangerOperator\" id=\"DangerOperator\">\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.DANGER, true, false) != null) && alert.getOperatorString(Alert.DANGER, true, false).equalsIgnoreCase(">")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append(">  (greater than)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.DANGER, true, false) != null) && alert.getOperatorString(Alert.DANGER, true, false).equalsIgnoreCase(">=")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append(">=  (greater than or equal to)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.DANGER, true, false) != null) && alert.getOperatorString(Alert.DANGER, true, false).equalsIgnoreCase("<")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append("<  (less than)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.DANGER, true, false) != null) && alert.getOperatorString(Alert.DANGER, true, false).equalsIgnoreCase("<=")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append("<=  (less than or equal to)</option>\n");

        htmlBody.append("<option");
        if ((alert != null) && (alert.getOperatorString(Alert.DANGER, true, false) != null) && alert.getOperatorString(Alert.DANGER, true, false).equalsIgnoreCase("=")) htmlBody.append(" selected=\"selected\">");
        else htmlBody.append(">");
        htmlBody.append("=  (equal to)</option>\n");

        htmlBody.append("</select>\n");
        htmlBody.append("
\n");

        // danger combination
        htmlBody.append(
            "
\n" +
            "  Combination\n" +
            "  <button type=\"button\" id=\"DangerCombination_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"For any metric values that fall within the 'alert window duration', what condition will cause the alert to be triggered? Is the average of the metric values above or below the threshold? Are all metrics values above or below the threshold? Is any metric value above or below the threshold? Are 'at least' or 'at most' X metric values above or below the threshold?\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <select class=\"form-control-statsagg\" name=\"DangerCombination\" id=\"DangerCombination\">\n");

        if ((alert != null) && (alert.getCombinationString(Alert.DANGER) != null)) {
            if (alert.getCombinationString(Alert.DANGER).equalsIgnoreCase("Any")) htmlBody.append("<option selected=\"selected\">Any</option>\n");
            else htmlBody.append("<option>Any</option>\n");

            if (alert.getCombinationString(Alert.DANGER).equalsIgnoreCase("All")) htmlBody.append("<option selected=\"selected\">All</option>\n");
            else htmlBody.append("<option>All</option>\n");

            if (alert.getCombinationString(Alert.DANGER).equalsIgnoreCase("Average")) htmlBody.append("<option selected=\"selected\">Average</option>\n");
            else htmlBody.append("<option>Average</option>\n");

            if (alert.getCombinationString(Alert.DANGER).equalsIgnoreCase("At most")) htmlBody.append("<option selected=\"selected\">At most</option>\n");
            else htmlBody.append("<option>At most</option>\n");

            if (alert.getCombinationString(Alert.DANGER).equalsIgnoreCase("At least")) htmlBody.append("<option selected=\"selected\">At least</option>\n");
            else htmlBody.append("<option>At least</option>\n");
        }
        else {
            htmlBody.append(
                "<option>Any</option>\n" +
                "<option>All</option>\n" +
                "<option>Average</option>\n" +
                "<option>At most</option>\n" +
                "<option>At least</option>\n"
            );
        }

        htmlBody.append("</select>\n");
        htmlBody.append("
\n");

        // danger combination count
        htmlBody.append(
            "
\n" +
            "  Combination count\n" +
            "  <button type=\"button\" id=\"DangerCombination_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"If using a combination of 'at most' or 'at least', then you must specify a count. This refers to the number of independent metric values for a single metric-key that fall within the 'alert window duration'.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"form-control-statsagg\" name=\"DangerCombinationCount\" id=\"DangerCombinationCount\" ");

        if ((alert != null) && (alert.getDangerCombinationCount() != null)) {
            htmlBody.append(" value=\"").append(alert.getDangerCombinationCount()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // danger threshold
        htmlBody.append(
            "
\n" +
            "  Threshold\n" +
            "  <button type=\"button\" id=\"DangerThreshold_Help\" class=\"btn btn-xs btn-circle btn-info pull-right\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"The numeric threshold that, if crossed, will trigger the alert.\" style=\"margin-bottom: 1.5px;\">?</button> " +
            "  <input class=\"form-control-statsagg\" name=\"DangerThreshold\" id=\"DangerThreshold\" ");

        if ((alert != null) && (alert.getDangerThreshold() != null)) {
            htmlBody.append(" value=\"").append(alert.getDangerThreshold().stripTrailingZeros().toPlainString()).append("\"");
        }

        htmlBody.append(">\n
\n");

        // end column 3 & form
        htmlBody.append(
            "
\n" +
            "
\n" +
            "
\n" +
            "
\n" +
            "<button type=\"submit\" class=\"btn btn-default btn-primary statsagg_button_no_shadow statsagg_page_content_font\">Submit</button>" +
            "   " +
            "Cancel" +
            "</form>\n" +
            "
\n" +
            "
\n"
            );

        return htmlBody.toString();
    }

    public String parseAndAlterAlert(Object request) {

        if (request == null) {
            return null;
        }

        String returnString;

        Alert alert = getAlertFromAlertParameters(request);
        String oldName = Common.getObjectParameter(request, "Old_Name");

        // insert/update/delete records in the database
        if ((alert != null) && (alert.getName() != null)) {
            AlertsLogic alertsLogic = new AlertsLogic();
            returnString = alertsLogic.alterRecordInDatabase(alert, oldName, false);

            if ((GlobalVariables.alertInvokerThread != null) && (AlertsLogic.STATUS_CODE_SUCCESS == alertsLogic.getLastAlterRecordStatus())) {
                GlobalVariables.alertInvokerThread.runAlertThread(false, true);
            }
        }
        else {
            returnString = "Failed to add alert. Reason=\"Field validation failed.\"";
            logger.warn(returnString);
        }

        return returnString;
    }

    public static Alert getAlertFromAlertParameters(Object request) {

        if (request == null) {
            return null;
        }

        boolean didEncounterError = false;

        Alert alert = new Alert();

        try {
            String parameter;

            parameter = Common.getObjectParameter(request, "Name");
            String trimmedName = parameter.trim();
            alert.setName(trimmedName);
            alert.setUppercaseName(trimmedName.toUpperCase());
            if ((alert.getName() == null) || alert.getName().isEmpty()) didEncounterError = true;

            parameter = Common.getObjectParameter(request, "Description");
            if (parameter != null) {
                String trimmedParameter = parameter.trim();
                String description;
                if (trimmedParameter.length() > 100000) description = trimmedParameter.substring(0, 99999);
                else description = trimmedParameter;
                alert.setDescription(description);
            }
            else alert.setDescription("");

            parameter = Common.getObjectParameter(request, "MetricGroupName");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    MetricGroupsDao metricGroupsDao = new MetricGroupsDao();
                    MetricGroup metricGroup = metricGroupsDao.getMetricGroupByName(parameterTrimmed);
                    if (metricGroup != null) alert.setMetricGroupId(metricGroup.getId());
                }
            }

            parameter = Common.getObjectParameter(request, "Enabled");
            if ((parameter != null) && parameter.contains("on")) alert.setIsEnabled(true);
            else alert.setIsEnabled(false);

            parameter = Common.getObjectParameter(request, "CautionEnabled");
            if ((parameter != null) && parameter.contains("on")) alert.setIsCautionEnabled(true);
            else alert.setIsCautionEnabled(false);

            parameter = Common.getObjectParameter(request, "DangerEnabled");
            if ((parameter != null) && parameter.contains("on")) alert.setIsDangerEnabled(true);
            else alert.setIsDangerEnabled(false);

            parameter = Common.getObjectParameter(request, "Type");
            if ((parameter != null) && parameter.contains("Availability")) alert.setAlertType(Alert.TYPE_AVAILABILITY);
            else if ((parameter != null) && parameter.contains("Threshold")) alert.setAlertType(Alert.TYPE_THRESHOLD);

            parameter = Common.getObjectParameter(request, "AlertOnPositive");
            if ((parameter != null) && parameter.contains("on")) alert.setAlertOnPositive(true);
            else alert.setAlertOnPositive(false);

            parameter = Common.getObjectParameter(request, "AllowResendAlert");
            if ((parameter != null) && parameter.contains("on")) alert.setAllowResendAlert(true);
            else alert.setAllowResendAlert(false);

            parameter = Common.getObjectParameter(request, "ResendAlertEveryTimeUnit");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = DatabaseObjectCommon.getTimeUnitCodeFromString(parameterTrimmed);
                    alert.setResendAlertEveryTimeUnit(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "ResendAlertEvery");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    BigDecimal time = new BigDecimal(parameterTrimmed, DatabaseObjectCommon.TIME_UNIT_MATH_CONTEXT);
                    BigDecimal timeInMs = DatabaseObjectCommon.getMillisecondValueForTime(time, alert.getResendAlertEveryTimeUnit());
                    if (timeInMs != null) alert.setResendAlertEvery(timeInMs.longValue());
                }
            }

            parameter = Common.getObjectParameter(request, "CautionNotificationGroupName");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
                    NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroupByName(parameterTrimmed);
                    if ((notificationGroup != null) && (notificationGroup.getId() != null)) alert.setCautionNotificationGroupId(notificationGroup.getId());
                }
            }

            parameter = Common.getObjectParameter(request, "CautionPositiveNotificationGroupName");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
                    NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroupByName(parameterTrimmed);
                    if ((notificationGroup != null) && (notificationGroup.getId() != null)) alert.setCautionPositiveNotificationGroupId(notificationGroup.getId());
                }
            }

            parameter = Common.getObjectParameter(request, "CautionWindowDurationTimeUnit");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = DatabaseObjectCommon.getTimeUnitCodeFromString(parameterTrimmed);
                    alert.setCautionWindowDurationTimeUnit(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "CautionWindowDuration");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    BigDecimal time = new BigDecimal(parameterTrimmed, DatabaseObjectCommon.TIME_UNIT_MATH_CONTEXT);
                    BigDecimal timeInMs = DatabaseObjectCommon.getMillisecondValueForTime(time, alert.getCautionWindowDurationTimeUnit());
                    if (timeInMs != null) alert.setCautionWindowDuration(timeInMs.longValue());
                }
            }

            parameter = Common.getObjectParameter(request, "CautionStopTrackingAfterTimeUnit");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = DatabaseObjectCommon.getTimeUnitCodeFromString(parameterTrimmed);
                    alert.setCautionStopTrackingAfterTimeUnit(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "CautionStopTrackingAfter");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    BigDecimal time = new BigDecimal(parameterTrimmed, DatabaseObjectCommon.TIME_UNIT_MATH_CONTEXT);
                    BigDecimal timeInMs = DatabaseObjectCommon.getMillisecondValueForTime(time, alert.getCautionStopTrackingAfterTimeUnit());
                    if (timeInMs != null) alert.setCautionStopTrackingAfter(timeInMs.longValue());
                }
            }

            parameter = Common.getObjectParameter(request, "CautionMinimumSampleCount");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Integer.parseInt(parameterTrimmed);
                    alert.setCautionMinimumSampleCount(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "CautionOperator");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Alert.getOperatorCodeFromOperatorString(parameterTrimmed);
                    alert.setCautionOperator(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "CautionCombination");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Alert.getCombinationCodeFromString(parameterTrimmed);
                    alert.setCautionCombination(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "CautionCombinationCount");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Integer.parseInt(parameterTrimmed);
                    alert.setCautionCombinationCount(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "CautionThreshold");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    BigDecimal bigDecimalValue = new BigDecimal(parameterTrimmed);
                    alert.setCautionThreshold(bigDecimalValue);
                }
            }

            parameter = Common.getObjectParameter(request, "DangerNotificationGroupName");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
                    NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroupByName(parameterTrimmed);
                    if ((notificationGroup != null) && (notificationGroup.getId() != null)) alert.setDangerNotificationGroupId(notificationGroup.getId());
                }
            }

            parameter = Common.getObjectParameter(request, "DangerPositiveNotificationGroupName");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    NotificationGroupsDao notificationGroupsDao = new NotificationGroupsDao();
                    NotificationGroup notificationGroup = notificationGroupsDao.getNotificationGroupByName(parameterTrimmed);
                    if ((notificationGroup != null) && (notificationGroup.getId() != null)) alert.setDangerPositiveNotificationGroupId(notificationGroup.getId());
                }
            }

            parameter = Common.getObjectParameter(request, "DangerWindowDurationTimeUnit");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = DatabaseObjectCommon.getTimeUnitCodeFromString(parameterTrimmed);
                    alert.setDangerWindowDurationTimeUnit(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "DangerWindowDuration");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    BigDecimal time = new BigDecimal(parameterTrimmed, DatabaseObjectCommon.TIME_UNIT_MATH_CONTEXT);
                    BigDecimal timeInMs = DatabaseObjectCommon.getMillisecondValueForTime(time, alert.getDangerWindowDurationTimeUnit());
                    if (timeInMs != null) alert.setDangerWindowDuration(timeInMs.longValue());
                }
            }

            parameter = Common.getObjectParameter(request, "DangerStopTrackingAfterTimeUnit");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = DatabaseObjectCommon.getTimeUnitCodeFromString(parameterTrimmed);
                    alert.setDangerStopTrackingAfterTimeUnit(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "DangerStopTrackingAfter");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    BigDecimal time = new BigDecimal(parameterTrimmed, DatabaseObjectCommon.TIME_UNIT_MATH_CONTEXT);
                    BigDecimal timeInMs = DatabaseObjectCommon.getMillisecondValueForTime(time, alert.getDangerStopTrackingAfterTimeUnit());
                    if (timeInMs != null) alert.setDangerStopTrackingAfter(timeInMs.longValue());
                }
            }

            parameter = Common.getObjectParameter(request, "DangerMinimumSampleCount");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Integer.parseInt(parameterTrimmed);
                    alert.setDangerMinimumSampleCount(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "DangerOperator");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Alert.getOperatorCodeFromOperatorString(parameterTrimmed);
                    alert.setDangerOperator(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "DangerCombination");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Alert.getCombinationCodeFromString(parameterTrimmed);
                    alert.setDangerCombination(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "DangerCombinationCount");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    Integer intValue = Integer.parseInt(parameterTrimmed);
                    alert.setDangerCombinationCount(intValue);
                }
            }

            parameter = Common.getObjectParameter(request, "DangerThreshold");
            if (parameter != null) {
                String parameterTrimmed = parameter.trim();

                if (!parameterTrimmed.isEmpty()) {
                    BigDecimal bigDecimalValue = new BigDecimal(parameterTrimmed);
                    alert.setDangerThreshold(bigDecimalValue);
                }
            }
        }
        catch (Exception e) {
            didEncounterError = true;
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
        }

        if (!didEncounterError) {
            alert.setIsCautionAlertActive(false);
            alert.setCautionFirstActiveAt(null);
            alert.setIsCautionAcknowledged(null);
            alert.setCautionAlertLastSentTimestamp(null);
            alert.setCautionActiveAlertsSet(null);
            alert.setIsDangerAlertActive(false);
            alert.setDangerFirstActiveAt(null);
            alert.setIsDangerAcknowledged(null);
            alert.setDangerAlertLastSentTimestamp(null);
            alert.setDangerActiveAlertsSet(null);
        }
        else {
            alert = null;
        }

        return alert;
    }

}

redpajama_set_name: RedPajamaGithub


Promotional value expires 90 days after purchase. Amount paid never expires. Limit 3 per person, may buy 2 additional as gifts. Limit 1 per order. Valid online only. Valid only for option purchased. Shipping not included. Shipping Not Included; shipping $8.95 for single and $13.90 for set of 2. Does not ship to AK/HI/Canada/Puerto Rico. Most orders ship within 5-7 business days from the redemption date. Does not ship to PO boxes. No returns. Voucher is non-transferable. Most orders ship within 12 business days from the redemption date. Merchant is solely responsible to purchasers for the care and quality of the advertised goods and services.


The films feature neuroscientist Dr Andrew Jackson, who uses macaques to study how brain signals control movement. He aims to help paralysed people control external devices, such as robotic arms or wheelchairs, with their thoughts.
Laboratory macaques: when to wean?


Sonata X comes from Weiss's middle 'productive' period, thought to have taken place between 1719 and 1725. The original tablature manuscript is in the British Library (London Ms. Add. 30387). The Sonata has six movements: Allemande, Courante, Paisane, Sarabande, Menuet, and it ends with a Gigue. There is a another copy of this Sonata in the Warszawa Biblioteka Uniwersytecka Poland (in its entirety), and a copy in the Sächsisches Landesbibliothek in Dresden (Suite XXVI), which contains three concordant movements: Allemande, Courante, and the Gigue. The Dresden manuscript displays some differences from the London manuscript. This Edition has taken those differences into account in certain details.


Attorney Stephanie Charles can help you navigate through your case to reach a successful outcome – one that's best for you or you and your family. With roots in child advocacy and experience in high-asset cases, Stephanie is completely committed to providing you with honest, straightforward answers that help you make smart decisions during this difficult time. While Stephanie believes in reasonable negotiations she never shies away from a challenge nor bows to intimidation tactics; she's the right person to have in your corner during divorce.
With significant experience representing doctors, lawyers, business owners, executives, tradespeople, financial professionals, stay-at-home spouses and a wide range of others, Stephanie Charles can help you, too.
Stephanie Charles is a skilled negotiator and tenacious trial lawyer. She equally prides herself in being creative during negotiations and persuasive during trial.
Stephanie is here to protect what matters most to you. Most importantly, she is here to help you move forward with your case. Call today for your consultation.


Nothing could be more festive on the holiday table than a tray of these, buttery, confectioners' sugar-dusted, jam-packed cookies, created by blogger Alexandra Stafford at Alexandra's Kitchen. The hint of lemon in the dough nicely complements any number of fillings, from raspberry jam to lemon curd.
To make the dough: Beat the butter, sugar, and zest until light and fluffy, scraping the bowl as needed, about 3 minutes. Add the yolk and vanilla and beat until combined.
Meanwhile, whisk together the flour, almond flour, and salt. Add the flour mixture to the egg mixture and mix until just combined. Don't over-beat.
To assemble: On a lightly floured surface, roll one disc of dough out about 1/4"-thick. Using a 2 1/2" round cookie cutter, cut out cookies. Transfer rounds to a parchment-lined baking sheet. Gather the scrap dough, roll, and repeat. Place the cut cookies (you should have 12 cookies) in the refrigerator for 30 minutes.
To bake: Bake all of the cookies for 8 to 10 minutes, or until the edges are just beginning to turn brown. Let them cool for 5 minutes on the pan, then transfer to a rack to cool completely.
I won my office's Battle of the Cookies with this recipe. I used key lime curd for the filling (it was a St. Patrick's Day theme). They were an unexpected sweet/tart/salty taste and they were a true hit! I've been asked to share the recipe a number of times since yesterday's contest. Key: make sure to use the parchment... it makes all the difference in the world. For me this was a 3 day process. I made the dough one evening. I cut and baked the next evening. I filled and served the next day. Every single cookie in the 2 batches came out perfectly. Now I wish I had made more... no leftovers here.
I was a little apprehensive about making these after reading other people's feedback but was pleasantly surprised - these cookies were no more work than you'd expect a double decker cookie to be. And well worth the extra effort. I replaced the almond flour with an equal amount of rye flour. The dough seemed dry but after letting it warm up, it was easy to work with with a little rye flour on the counter. I will definitely be making these again.
Delicious! I'm not an expert baking cookies but I had no issues, used parchment paper to roll the dough as others suggested. I made them into hearts for Valentine's Day. Can't wait to make them again!
After reading the reviews, I was almost afraid to try rolling these! However, I remembered a trick from baking tiny gingerbread pieces for some mug houses I made last year: I rolled out the dough on a very well floured piece of parchment paper, and took care to generously flour the dough as well. I cut out my circles, then removed the excess dough around them and transferred them to a cookie sheet. This helped quite a bit.
I was a bit worried about how crumbly the dough seemed before refrigeration and after leaving in the fridge for 2 days instead of 1 hour I was even more so. Luckily I worried without need. After letting the dough come back to room temperature (a very cold room), I quickly kneaded it and rolled it out. It cut without a problem and the cookies turned out beautiful and delicious. With my 2 1/4 inch linzer cookie cutter I ended up with 36 cookies after doubling the recipe. I didn't have any lemons so I zested an orange instead and love the flavor it adds. I will definitely be baking this recipe again and again.
I have been on a baking binge and made these for a cookie platter to take to work. These were the most popular item on the platter. I didn't have any trouble rolling out or cutting. They are in my list of cookies to do again.
So these made excellent thumbprint cookies because the dough isn't a cut-out friendly one. I had to add an extra cup of flour while trying to roll it and also put in 1/4 corn starch to try to stabilize it while still in the mixer. Tastes great but too much butter in the recipe to work with the amount of flour in it.
Dough is way too sticky to work with. I put in the freezer and still couldn't get the first batch peeled off the parchment paper (with flour) to transfer to the cookie sheet. I have made cookies like this in the past and they were not that difficult.
Absolutely delicious, and such a pretty and festive cookie for the holidays. The lemon compliments the taste without overpowering. Take the extra minutes in making these to refrigerate the dough (and cookie cutter) after rolling it out till firm, and at any point the dough softens, it makes for an easier cut and keeps its shape. This recipe is a keeper, and is now on my baking holiday cookie list!
I substituted 1/4 c of cornstarch for 1/4 c of the flour, it's been my experience in baking cutout cookies that this helps stabilize the dough and helps the cookies hold their shape well without compromising flavor, since it's a small amount. I had no trouble rolling out the dough after it was chilled, it rolled easily with very little additional flour. Wonderful recipe, nothing but complements on the cookies. Will definitely make again.


Those crazy people at Tim Hortons HQ have gone bonkers! After getting "liked" on Facebook 2 million times they've given back by performing an in-store lunch time flash mob. The song of choice – "Thank you for being a friend." Good idea, kinda takes me back a few years and overall I grade it a B. It's no Glee Club.


My name is Dr. Rowena Briones Winkler, and I am an innately curious human being who wanted to create this space on the interwebs to share my creations, interests, and professional work. I am delighted you decided to poke around my site, and I look forward to sharing my journey with you.
P.S. I am open to guest lectures, expert interviews, and other speaking engagements in the areas of content marketing, communication strategy, evidence-based research methods, the performing arts, and/or personal health and wellness. I am also open to freelance writing opportunities in these areas as well. Feel free to reach out using the icons at the bottom of this page, or take a look at what I've accomplished in the relevant sections above. Thanks!
Rowena Winkler as the Witch is possibly the most impressive female in the show. She has the comedy and emotion down for this multifaceted character. Winkler carries herself and the character as though they had just stepped out of the pages of your favorite fairytale.
I truly appreciate having Dr. Briones Winkler as a mentor guiding me through my final semesters. She is fully engaged on campus and in the community, supporting not just myself but all of her students. Dr. Briones Winkler is the most influential professor I have encountered in my college career and I will forever be grateful for her help and guidance.


Three typescript pages of a letter addressed to Glenway from Robert Penn Warren, December 10, 1959. The letter discusses censorship, freedom, and obscenity. "Censorship" is written in pencil at the top of the first page.


The new financial year promises to be just as challenging as the last few, but one in which we shall see some planned investment come to fruition and we will continue the strategic approach to aligning service to demand.
The first new recruits will hit the beat in the next few months with additional PCSOs to follow soon after. Our prudence in saving for the years ahead and advance budgeting has allowed us to plan for the new recruits to meet officer numbers.
In addition earmarked reserves are funding new IT infrastructure and replacing our aging fleet. Work will start on a brand new HQ for West Division to replace the costly Bonny Street station saving around £180k in revenue costs in future years. We begin this year fresh from the latest round of inspections by Her Majesty's Inspectorate of Constabulary (HMIC) when we were praised for a financial management and prudence.
Lancashire was once again named as one of the best forces in the country and the way we engage with the communities we serve and work in partnership on Early Action schemes singled out for praise.
So as we enter 2016/17 we have identified £75m of savings that will take us to the end of the year with an extra £16.6m still to find by 2019/20.
I have taken the decision to increase the council tax precept this year by 1.99% after more than 85 per cent of residents told me they were willing to pay more for the police through this local payment. The increase is equivalent to just 6p per week – or £3.16 a year – for the average band D property in Lancashire, but it will raise an extra £1.3m to help offset some – but by no means all – of the cuts we will face this year. We still face a further reduction in our staffing numbers which by the end of this year will be down by 1,600 since austerity began.
The reduction in officer numbers means it is vital we invest in technology that allows them to maintain the high level of service and visibility in our local communities. New equipment and IT systems enable our officers to work more efficiently and, crucially, spend more time out on the beat – not behind a desk. By continuing this investment, we can make the most of the resources we have available and make sure officers are visible and accessible whenever you need them.
Plans have been submitted for a West Division HQ in Blackpool that will replace the out-of-date and costly building on Bonny Street. By investing some of the money we have saved so far in a new, energy efficient headquarters we can give our officers a modern station, fit for 21st century policing, that will save us around £180,000 a year in running costs – money we can reinvest in our police force.
This year we will continue to provide services to people who have suffered from crime. I set up Lancashire Victim Services to provide help in person, over the phone or online to anyone who has been a victim of, or witnessed, crime in the county. This is a free and confidential service for anyone who needs it.
It doesn't matter what the crime was, or when it was committed. You can access information, advice or simply someone to listen and talk to about and worries you may have. Lancashire Victim Services is here with support when you need it, when you're ready for it.


This is Just to Say/I have eaten/the beauty standards/that were in/the icebox/and which you were probably/clinging to/for profit/Forgive me/They were ridiculous/so binding/and so cold.
–Meet the internet's goth body-positive princess!
–Top 10 weirdo-babe plus size shops.
-These 50 Lindy Bop dresses are gorgeous. I especially love #s 1, 5, and 7.
–#DropThePlus campaign by Stefania Ferrario and Ajay Rochester ignites social media–but is it invalidating to actual plus size women?
–11 Lakme Fashion Week looks that will inspire your spring wardrobe.
–6 bloggers wearing gorgeous floral dresses from Igigi.
-My new favorite shop: Asunder, which makes gothy, witchy, Victorian-inspired jewelry.
–Which '90s jewelry trends are primed for a comeback?
–How "obesity" became a disease.
–The trouble with before-and-after pictures.
–Are there fat Asians? Yes, I'm one of them.
-I'm looking forward to Susan Greenhalgh's upcoming book Fat Talk Nation: The Human Costs of America's War on Fat.
-If you can, help out Rob, a man who is suffering a health crisis because his doctors spend years blaming his symptoms on his size rather than treating them.
Saw this pinkish-purple SUV on my trip to the Cape last week. If I ever get a car, it will be this color.


Home/Who is affected the most?
Who is affected the most?
Children under the age of 6 years are at greater risk of elevated blood lead levels because of normal hand to mouth activity in areas or with items potentially contaminated with lead.
Additionally, because certain parts of their nervous system are in the early stages of development, they are more susceptible to the toxic effects of lead.


text:
Year later, no leads in severed-head case
ECONOMY, Pa. - Authorities are still looking for answers nearly a year after a woman's embalmed head was found in a wooded area in western Pennsylvania.
ECONOMY, Pa.
- Authorities are still looking for answers nearly a year after a woman's embalmed head was found in a wooded area in western Pennsylvania.
The head was found on Dec. 12, 2014, in Economy, about 16 miles northwest of Pittsburgh. Authorities do not know the woman's identity or how she died. They also don't know where the rest of her body is or how her head ended up in the woods.
The woman's eyes were removed and replaced with red rubber balls. Beaver County Assistant Chief Detective Andrew Gall told the Beaver County Times on Sunday that the balls were toys manufactured in China. He said he bought a similar set from a toy machine.
Police Chief Michael O'Brien said that authorities do not believe she is from the area.
"She's on my mind 24 hours a day, just the fact that I'm not able to identify her. That's my priority, to find out who she is," he said. "There's nobody that deserves to be found that way. And she needs to be identified so she can have her name put to her face."
Authorities are testing to see if they can determine where she lived. Certain elements in hair and tooth enamel give information about what region people are from.
Beaver County Coroner Teri Tatalovich-Rossi said plans are in the works to bury her in a local cemetery. She said she expects there to be a graveside service and that everyone who has worked on the case would be invited.
"All of us have been tirelessly working to identify her," Tatalovich-Rossi said. "We felt it was proper to bury her in a dignified manner."