text:
.zbody { background-color: #171b1e; }
.zborder { border: 1px solid #000000; }
.zbox { border: 1px solid #292929; }
.zbox_body { background-color: #171b1e; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 12px; }
.zbox_head { background-color: #000000; color: #cccccc; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 13px; }
.zcolor { background-color: #171b1e; color: #ffffff; }
.zcolor_contrast { background-color: #14a2b0; color: #000000; }
.zcolor_dark { background-color: #000000; color: #ffffff; }
.zcolor_light { background-color: #303030; color: #ffffff; }
.zform_button { background:#14a2b0; border:1px solid #015f68; color:#ffffff; font-size:14px; font-family: "Helvetica Neue", helvetica, sans-serif; }
.zform_select { background:#bcbcbc; border:1px solid #4e4e4e; color:#666666; font-size:14px; font-family: "Helvetica Neue", helvetica, sans-serif; }
.zform_textarea { background:#bcbcbc; border:1px solid #4e4e4e; color:#666666; font-size:14px; font-family: "Helvetica Neue", helvetica, sans-serif; }
.zform_textbox { background:#bcbcbc; border:1px solid #4e4e4e; color:#666666; font-size:14px; font-family: "Helvetica Neue", helvetica, sans-serif; }
.zhint { color: #cccccc; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 10px; }
.zlink { color: #14a2b0; }
.zsmall { color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 10px; }
.ztab0 { background-color: #171b1e; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 11px; }
.ztab1 { background-color: #000000; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 11px; font-weight: bold;}
.ztabbody { background-color: #000000; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 11px; }
.ztable_head { background-color: #000000; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 13px; }
.ztable_row {color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 12px; }
.ztable_row0 { background-color: #171b1e; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 12px;}
.ztable_row1 { background-color: #000000; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 12px;}
.ztable_row_small { color: #cccccc; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 10px; }
.ztable_row_title { font-weight: bold; color: #ff7700; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 14px; }
.ztitle { font-weight: bold; color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 15px; }
.ztitle2 { font-weight: bold; color: #cccccc; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 14px; }
.ztxt { color: #ffffff; font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 12px; }
.zwarn { color: #FF0000; font-weight: bold; }

.zform_textbox	{	padding:0; text-indent:5px;
	height:24px;
	line-height:24px; /* ignored by FF, but used by IE */
	-moz-border-radius: 7px;
	border-radius: 7px;
	-webkit-border-radius: 7px;
	}

/* styles for shadow */

.spritebg	{background:url(shadow_sprites-111x68.png) no-repeat;}

body	{

	font-family: Helvetica, Arial, sans-serif;
	background: url(gradient_bg-1x211.png) repeat-x fixed bottom #171b1e; color:#ffffff;	margin:0;
	padding:0;
	font-size:12px;
	}

a	{color:#14a2b0;}
a:hover	{color:#ffffff;}

img	{border:0px}

/* removes bottom padding/margin from form in old browsers */
form	{display:inline;}

/* global styles for float and clear */
div.floatLeft	{float:left;}
div.floatRight	{float:right;}
div.clearAll	{clear:both;}

div.no_underline a	{text-decoration:none;} /* this should be left alone */

h1  {font-size:13px; color:#727272; margin:0px 0px 0px 0px; font-weight:bold; clear:both;} /* Used for the page title element */

/* used for the wiki header 1 & 2 */
h2	{font-size:12pt; color:#666666; margin:5px 0px 2px 0px; font-weight:bold;}
h3	{font-size:11pt; color:#666666; margin:2px 0px 1px 0px; font-weight:bold;}

.bold	{font-weight:bold;}

.pointer	{cursor:pointer;} /* use on any div with an onClick for document.location. */

.posRel	{position:relative;}

/* the width around the entire theme, including the margins and shadows */
.themeWidth	{
	width:990px;
	text-align:left;
	margin-left: auto ;
	margin-right: auto ;
	}

.center	{text-align:center; vertical-align:middle;}

/* ####################  Main Column - content area */

/* a class is used instead of an id, because on specific pages, an ID is output around this div to adjust the width for when the left column is not displayed */

#leftCol	{float:left; width:196px; z-index:54;}
.bodyContent	{float:right; width:780px; text-align:left; z-index:55; min-height:300px;}

/* overrides the bodyContent width for pages with no left column. div with id is only output when needed (outputskip) */
#noLeftCol .bodyContent	{width:990px;}

/* use this in page layouts where the width needs to be fixed and the overflow needs to be hidden. width should ALWAYS match bodyContent */
.bodyContentWidth	{width:780px; overflow:hidden;}

/* wiki styles */

div.wiki_section	{margin-bottom:15px; line-height:150%}

/* gradients */

.blueGradient	{
	background: #40adb7; /* Old browsers */
	/* IE9 SVG, needs conditional override of 'filter' to 'none' */
	background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzQwYWRiNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iIzJjYWJiOCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iIzE0YTJiMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxNGEyYjAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
	background: -moz-linear-gradient(top, #40adb7 0%, #2cabb8 50%, #14a2b0 51%, #14a2b0 100%); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#40adb7), color-stop(50%,#2cabb8), color-stop(51%,#14a2b0), color-stop(100%,#14a2b0)); /* Chrome,Safari4+ */
	background: -webkit-linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* Chrome10+,Safari5.1+ */
	background: -o-linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* Opera 11.10+ */
	background: -ms-linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* IE10+ */
	background: linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* W3C */
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#40adb7', endColorstr='#14a2b0',GradientType=0 ); /* IE6-8 */
	}

.blackGradient	{
background: #2b2b2b; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJiMmIyYiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iIzFhMWExYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iIzBhMGUwYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwYTA4MDkiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #2b2b2b 0%, #1a1a1a 50%, #0a0e0a 51%, #0a0809 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2b2b2b), color-stop(50%,#1a1a1a), color-stop(51%,#0a0e0a), color-stop(100%,#0a0809)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #2b2b2b 0%,#1a1a1a 50%,#0a0e0a 51%,#0a0809 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #2b2b2b 0%,#1a1a1a 50%,#0a0e0a 51%,#0a0809 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #2b2b2b 0%,#1a1a1a 50%,#0a0e0a 51%,#0a0809 100%); /* IE10+ */
background: linear-gradient(top, #2b2b2b 0%,#1a1a1a 50%,#0a0e0a 51%,#0a0809 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2b2b2b', endColorstr='#0a0809',GradientType=0 ); /* IE6-8 */

	}

/* margins between major sections */
#mastFooter, #bodyContent, #categoriesContainer	{margin-bottom:14px;}
#breadcrumb	{position:relative; top:-14px} /* compensate for category margin. necessary cuz breadcrumb not on every page */

/* master header */

#mastHead	{position:relative; height:100px;}
#mastHead a	{color:#ffffff; text-decoration:none;}

#mastHeadLogo	{position:absolute; left:0; width:400px; top:5px; height:90px;} /* logo element height is 90px */
#mastHeadDecal	{position:absolute; right:300px; width:240px; height:50px; top:5px;}
#mastHeadMenuAndPhone	{position:absolute; top:0px; right:0; text-align:right; line-height:20px; font-size:12px;}
#mastHeadMenuAndPhone a	{padding:0 5px;}

#mastHeadMenuAndPhone .contactInfo	{margin-top:5px;}
#mastHeadMenuAndPhone .phoneNumber	{font-size:14px; font-weight:bold;}
#mastHeadMenuAndPhone .storeHours	{font-size:11px; line-height:13px;}

#mastHeadSearch	{
	background:#000000;
	-moz-border-radius-topleft: 7px;
	-moz-border-radius-topright: 7px;
	-moz-border-radius-bottomright: 0;
	-moz-border-radius-bottomleft: 0;
	-webkit-border-radius: 7px 7px 0 0;
	border-radius: 7px 7px 0 0;
	width:540px;
	position:absolute;
	right:0;
	bottom:0;
	height:35px;
	}

#wrapperFrmContainer	{padding:6px;}
#wrapperFrmContainer .zform_textbox	{
	width:460px;
	position:absolute; top:5px; left:5px;
	z-index:50;
	}

#wrapperFrmContainer .zform_button, #mastFooterNewsletter .zform_button	{
	padding:0 10px; text-indent:5px;
	color:#ffffff;
	text-align:center;
	font-weight:bold;
	border:1px solid #015f68;
	height:26px;
	font-size:14px;
	-moz-border-radius: 7px;
	border-radius: 7px;
	-webkit-border-radius: 7px;
	z-index:52;
	}

#wrapperFrmContainer .zform_button	{
	position:absolute;
	right:5px;
	top:5px;
	}

#breadcrumb	{
	text-indent:7px;
	line-height:26px;
	background:#000000;
	color:#ffffff;
	text-align:left;
	height:28px;
	font-size:12px;
	border:1px solid #292929;
	border-top-width:0;
	-moz-border-radius-topleft: 0;
	-moz-border-radius-topright: 0;
	-moz-border-radius-bottomright: 7px;
	-moz-border-radius-bottomleft: 7px;
	-webkit-border-radius: 0 0 7px 7px;
	border-radius: 0 0 7px 7px;
	}

#mastFooter a	{color:#ffffff; text-decoration:none;}
#mastFooter	{
	background:#171b1e; color:#ffffff;
	-moz-border-radius: 7px;
	border-radius: 7px;
	-webkit-border-radius: 7px;
	padding: 7px;
	}

#mastFooter .cobrand	{float:right;}
#mastFooter .copyright	{float:left;}

#mastFooter .footSection	{float:left; width:305px; margin-right:30px;}
#mastFooter #mastFooterNewsletter	{margin-right:0;}
#mastFooter .footHead	{font-size:14px; font-weight:bold; margin-bottom:5px; font-family: Helvetica Narrow, Helvetica, Arial, sans-serif; letter-spacing:1px; word-spacing:5px;}

#mastFooterCustServ .footLinks a	{display:block; padding:0 2px;}
#mastFooterCustServ .footLinks	{float:left; margin-right:20px}

#mastFooterNewsletter	.zsmall	{margin-bottom:3px;}
#mastFooterNewsletter #mastFootEmailInput {width:305px; margin-bottom:3px;}
#mastFooterNewsletter #mastFootFullNameInput	{width:190px; margin-right:3px;}
#mastFooterNewsletter .zform_button	{float:right;}

#mastFooter	.bookmarklet	{display:block; float:left; width:120px; height:20px;}
/* for the bookmarklets in the upper right corner */
div.icon	{float:left; margin-right:3px; width:16px; height:16px; }

div.twittericon	{background-position: 0px 0px;}
div.facebookicon	{background-position: -19px 0px;}
div.youtubeicon	{background-position: -38px 0px;}
div.rssicon	{background-position: -57px 0px;}
div.blogicon	{background-position: -76px 0px;}
div.linkedinicon	{background-position: -95px 0px;}

div.homeIcon	{background-position: -20px -20px; height:16px; width:16px; margin:6px 0 0 7px;}

/* left column */

#tier2n3_dual_cats_displayed a		{color:#ffffff; display:block; text-decoration:none;}
#tier2n3_dual_cats_displayed {margin-bottom:14px;}
#tier2n3_dual_cats_displayed ul	{margin:0px; padding:0;}
#tier2n3_dual_cats_displayed ul li	{display:block; font-size:13px;}

#tier2n3_dual_cats_displayed a:hover	{color:#14a2b0}

#tier2n3_dual_cats_displayed ul.top_cats a	{padding:4px 0px;}

#tier2n3_dual_cats_displayed ul.sub_cats a	{padding:2px 0px 2px 14px;}
#tier2n3_dual_cats_displayed ul.sub_cats	{margin-bottom:7px}

#leftCol div.elementMargin	{margin-bottom:14px;}

#leftCol .boxContent	{clear:both;}
#leftCol .boxHeadText	{background:#000000; padding:7px; margin-bottom:7px;}

#recentlyViewedItems .ztable_row	{padding-bottom:7px;}
#recentlyViewedItems .ztable_row .prodListThumb	{margin-right:7px;}

/* tier 1 and 2 horizontal cats with dropdowns */

#categoriesContainer	{
	border-top:1px solid #000000;
	border-bottom:1px solid #292929;
	}

/*
found menu here:
http://www.webdesignerwall.com/demo/css3-dropdown-menu/
*/

#nav {
	margin: 0;
	padding: 0;
	}

#nav li {
	margin: 0px 10px 0 0px;
	padding: 0 0 0 0 ; /* removing this bottom padding seems to break the menu. */
	float: left;
	position: relative;
	list-style: none;
	z-index:1000;
	font-family: helvetica narrow, "Helvetica Neue", helvetica, sans-serif;
	font-size:14px;

	}

/* main level link */
#nav a {
	color: #ffffff;

	text-decoration: none;
	display: block;
	margin: 0;
	padding:13px 10px;

	}

/* main level link hover */
#nav .current a, #nav li:hover > a {
	color: #fff;

	background: #40adb7; /* Old browsers */
	/* IE9 SVG, needs conditional override of 'filter' to 'none' */
	background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzQwYWRiNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iIzJjYWJiOCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iIzE0YTJiMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxNGEyYjAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
	background: -moz-linear-gradient(top, #40adb7 0%, #2cabb8 50%, #14a2b0 51%, #14a2b0 100%); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#40adb7), color-stop(50%,#2cabb8), color-stop(51%,#14a2b0), color-stop(100%,#14a2b0)); /* Chrome,Safari4+ */
	background: -webkit-linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* Chrome10+,Safari5.1+ */
	background: -o-linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* Opera 11.10+ */
	background: -ms-linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* IE10+ */
	background: linear-gradient(top, #40adb7 0%,#2cabb8 50%,#14a2b0 51%,#14a2b0 100%); /* W3C */
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#40adb7', endColorstr='#14a2b0',GradientType=0 ); /* IE6-8 */

	}

#nav li ul li a	{padding:0 5px; line-height:22px; font-size:12px; font-family: "Helvetica Neue", helvetica, sans-serif;}

/* sub levels link */
#nav ul li:hover a {
	border: none;
	background:#14a2b0;
	}

#nav ul a:hover {
	color: #006 !important;

	}

/* dropdown */
#nav li:hover > ul {
	display: block;
	}

/* level 2 list */
#nav ul {
	display: none;
	background: #000000;
	margin: 0;
	padding: 0;
	width: 200px;
	position: absolute;
	top: 35px;
	left: -15px;
	border: solid 2px #14a2b0;
	-moz-border-radius: 7px;
	border-radius: 7px;
	-webkit-border-radius: 7px;
	}

#nav ul li {
	float: none;
	margin: 0px;
	padding: 0;
	}

#nav ul a {
	font-weight: normal;
	}

/* level 3+ list */
#nav ul ul {
	left: 181px;
	top: -3px;
	}

/* clearfix */
#nav:after {
	content: ".";
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
	}

#nav {	display: inline-block;}

html[xmlns] #nav {	display: block;}

* html #nav {height: 1%;}

/* class corrections for layouts */

#cart_shipping_blurb small	{font-size:11px;}

/* generic  layout styles */
.pageLayout .elementMargin	{margin-bottom:14px;}
.pageLayout section		{margin-bottom:14px;}
.pageLayout img	{display:inline-block; vertical-align:top;}
.pageLayout table {border-collapse:collapse; padding:0;}
.pageLayout table td	{vertical-align:top;}
.pageLayout #accessories div.ztable_head	{padding:5px; text-align:right;}
.pageLayout .retailPrice .value	{text-decoration:line-through;}
.pageLayout .savings .percentage:before	{content:" (";}
.pageLayout .savings .percentage:after	{content:")";}

/* generic product layout styles */
#prodPageFocusImages {margin-right:14px;}
#socialToolBar	{padding-bottom:7px;}
#socialToolBar .socialTool	{float:left; margin-right:7px;}
#prodQtyDiscount .zbox_head	{padding:3px;}
#prodAttributes	{margin-bottom:7px;}
.reviewRatingArticle	{padding-bottom:7px;}

/* layout specific styles */
#p20110912 .reviewSummaryTop	{float:right;}
#p20110912 #prodQtyDiscount {float:right;}
#p20110912 td.prodlistProdThumbContainer {width:100px}
#p20110912 td.prodlistProdContentContainer	{min-width:220px; padding-bottom:7px}
#p20110912 #reviews .zborder	{padding:4px; margin-bottom:5px;}
#p20110912 #reviews .zborder img	{vertical-align:text-bottom}
#p20110912 #relatedItemsProdlist	{margin-left:14px;}
#p20110912 #relatedItemsProdlist .ztable_row	{padding-top:7px;}
#p20110912 h4 {margin:0 0 4px 0;}
#p20110912 .reviewThumb {padding-right:7px;}
#p20110912 .reviewAddReviewLink	{float:right; font-weight:bold;}

/* category and results layout styles */

.prodlistSoloItem .prodlistLeftCol {position:relative; margin-right:14px;}

.prodlistSoloItem .prodlistLeftCol .buttons	{position:absolute; bottom:7px; left:7px;}

.prodlistSoloItem .prodPricing div	{float:left; margin-right:14px; line-height:20px;}

.prodlistSoloItem .prodlistRightCol .percentage:before	{content:"(";}
.prodlistSoloItem .prodlistRightCol .percentage:after	{content:")";}

.prodlistSoloItem .prodlistRightCol .prodDesc	{clear:both; padding-top:14px;}
.prodlistSoloItem .prodAttribs	{padding-top:14px;}

.prodlist4Columns td.ztable_row	{width:25%}
.prodlist4Columns .ztable_row .prodContainer	{margin-right:14px;}
.prodlist4Columns .ztable_col3 .prodContainer {margin-right:0px;}  /* no right side margin needed in right column */
.prodlist4Columns .prodContainer	{margin-bottom:14px;}

#c-20111020 .prodlistProdThumbContainer {padding-right:7px;}
#c-20111020 .prodAttribs {font-size:11px; padding-bottom:7px;}
#c-20111020 .prodDesc	{padding-bottom:7px;}
#c-20111020 .prodPricing	{ padding-bottom:7px;}
#c-20111020 .prodPricing div	{display:inline; margin-right:20px;}
#c-20111020 .prodPricing:after	{clear:both;}
#c-20111020 .quantityInput:before {content:"qty: ";}
#c-20111020 .quantityInput	{text-align:center;}

/*
.prodlist .salePrice, .prodlist .salePrice .ztable_row_title	{color:#cc0000;}
.prodlist .salePrice:before	{content:"sale price: "}
*/


text:
package com.alibaba.json.test.vans;

import com.alibaba.fastjson.annotation.JSONType;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by xiaolin_kxl on 17/1/5.
 */
@JSONType(orders = {"uuid","type","matrix","children"})
public class VansObject implements Serializable {
    public String uuid;
    public String type;
    public ArrayList<VansObjectChildren> children;
    public float[] matrix;
}

redpajama_set_name: RedPajamaGithub


text:
/* define the DLL export macro */
#if defined(_WIN32) && !defined(__CYGWIN32__)
#define DLLEXPORT(res)  __declspec(dllexport) res
#else
/* redef this default for your system */
#define DLLEXPORT(res)  extern res
#endif

#ifdef COM
#define COBJMACROS
#define CINTERFACE
#endif

#include <stdio.h>

#if defined(_WIN32) && !defined(__CYGWIN32__)
#include <windows.h>
#define WCHAR wchar_t
#else
 #ifdef __CYGWIN32__
  #include <windows.h>
 #endif
#include <stdlib.h>
#define WCHAR wchar_t
#endif

#include "WideStringSrc.h"

#ifdef COM
#include "comPrim.h"
#else
#define UNI2STR(regstr, unistr) wcstombs (regstr, unistr, wcslen (unistr)+1)
#endif

/* wcslen() substitute implementation for cygwin'ers. */
#if defined(__CYGWIN32__) || defined(__CYGWIN__)

/* Troublesome to use the one that comes with 20.1 of cygwin */
#ifdef MB_CUR_MAX
#undef MB_CUR_MAX
#endif
#define MB_CUR_MAX 2

static int wcslen(WCHAR* wstr)
{
  char str[MB_CUR_MAX];
  char msg[80];
  WCHAR* wptr;
  int nbytes, i = 0;

  wptr = wstr;

  if ( wptr == NULL )
     return 0;

  while ( *wptr != L'\0' ) {
     nbytes = wctomb ( str, *wptr );
     i += nbytes; (char*)wptr += nbytes;
  }
  return i;
}
#endif

/* Return the length of a wide string big enough
   to hold the multi-byte string.
*/
unsigned int wideStringLen (char* str)
{
#ifdef _WIN32
  return MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
#else
  /* Non Win32 specific version */
  WCHAR foo[300];  // Ho-ho, bulletproof!
  unsigned int len;

  if (!str) {
     return 0;
  } else {
     len = mbstowcs (foo, str, strlen(str));
     return ( (len < 0) ? 0 : len);
  }
#endif
}

/* ToDo: sort out source code deps. and make
   the return type HRESULT.
*/
int
wideToString ( WCHAR* wstr, char** pstr )
{
  int len;
  char* str;

  if (!pstr) {
#ifdef _WIN32
    return E_FAIL;
#else
    return -1;
#endif
  }

#if defined(_WIN32) && defined(COM)

  /* Compute how big a buffer we need to allocate for
     multi-byte string...
  */
  len = WideCharToMultiByte ( CP_ACP, 0, wstr, -1
                            , NULL, 0, NULL, NULL);
  if (len == 0) {
    return E_FAIL;
  }

  /*
    Ask COM task allocator for some memory.
   */
  str = CoTaskMemAlloc(len * sizeof(char));
  if (str == NULL) {
    return E_FAIL;
  }

  WideCharToMultiByte(CP_ACP, 0, wstr, -1, str, len, NULL, NULL);
  *pstr = str;
  return S_OK;

#else

  len = wcslen(wstr);
  str=(char*)malloc(len+1);
  UNI2STR(str,wstr);
  *pstr = str;
  return 0;

#endif
}

/* Converting (null-terminated) strings into wide/Unicode ones */
int primStringToWide( char* str, unsigned int len, WCHAR* wstr , unsigned int wlen )
{
#ifdef _WIN32
  return MultiByteToWideChar(CP_ACP, 0, str, len, wstr, wlen);
#else
  int l;

  if ( wstr ) {
    if ( !str ) {
       *wstr = 0;
       return 0;
    } else {
       l = mbstowcs (wstr, str, wlen+1);
       return l;
    }
 } else {
    return (-1);
 }
#endif
}

/* The proto might not be in scope, so you might
   just get a warning from the C compiler.

   Reluctant to define the proto, as experience has
   shown this to be troublesome (there appears to be no
   universal agreement as to what the return type of
   wcslen() is.)

extern int wcslen (const WCHAR* wstr);
extern size_t wcslen (const WCHAR* wstr);

*/

int
lenWideString (WCHAR* wstr )
{
  return wcslen(wstr);
}


text:
package com.vendingontime.backend.repositories;

import com.google.inject.Inject;
import com.vendingontime.backend.models.company.Company;
import com.vendingontime.backend.models.person.Person;
import com.vendingontime.backend.models.person.PersonCollisionException;

import javax.persistence.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;

import static com.vendingontime.backend.models.person.PersonCollisionException.Cause.*;
import static com.vendingontime.backend.models.person.PersonCollisionException.Cause;

public class JPAPersonRepository extends JPARepository<Person> implements PersonRepository {

    @Inject
    public JPAPersonRepository(EntityManager entityManager) {
        super(entityManager, Person.class);
    }

    @Override
    public Optional<Person> findByEmail(String email) {
        return findOneBy("findByEmail", "email", email);
    }

    @Override
    public Optional<Person> findByUsername(String username) {
        return findOneBy("findByUsername", "username", username);
    }

    @Override
    public Optional<Person> findByDni(String dni) {
        return findOneBy("findByDni", "dni", dni);
    }

    @Override
    public List<Person> findTechniciansByCompany(Company company) {
        if (company == null || company.getId() == null) return new LinkedList<>();
        return findManyBy("findTechniciansByCompany", "companyId", company.getId());
    }

    @Override
    protected void checkIfCollides(Person person) throws PersonCollisionException {
        boolean isNew = person.getId() == null;

        List<Cause> causes = new LinkedList<>();

        Optional<Person> byEmail = findByEmail(person.getEmail());
        if (byEmail.isPresent() && (isNew || !byEmail.get().getId().equals(person.getId()))) {
            causes.add(EMAIL);
        }
        Optional<Person> byUsername = findByUsername(person.getUsername());
        if (byUsername.isPresent() && (isNew || !byUsername.get().getId().equals(person.getId()))) {
            causes.add(USERNAME);
        }
        Optional<Person> byDni = findByDni(person.getDni());
        if (byDni.isPresent() && (isNew || !byDni.get().getId().equals(person.getId()))) {
            causes.add(DNI);
        }

        if (causes.size() > 0) throw new PersonCollisionException(causes.toArray(new Cause[causes.size()]));
    }
}


text:
/* rules */

/* stylelint-disable selector-no-universal */

/* import */

@import '../Vars.css';
@import '../../../../node_modules/sanitize.css/sanitize.css';

/* styles */

*:focus {
  outline: none;
}

html {
  overflow-y: hidden;
  overflow-x: hidden;
}

body {
  width: 100%;
  color: var(--black);
  background-color: var(--white);
  font-size: var(--basefont);
  line-height: var(--baseline);
  font-family: var(--open-sans-family);
  font-weight: 300;
}


text:
using System;
using AutoFixture;
using AutoFixture.AutoMoq;
using AutoFixture.Kernel;
using AutoFixture.NUnit3;
using Nybus.Utils;

namespace Tests
{
    public class CustomAutoMoqDataAttribute : AutoDataAttribute
    {
        public CustomAutoMoqDataAttribute() : base(CreateFixture)
        {

        }

        private static IFixture CreateFixture()
        {
            IFixture fixture = new Fixture();

            fixture.Customize(new AutoMoqCustomization
            {
                ConfigureMembers = true,
                GenerateDelegates = true
            });

            fixture.Freeze<IServiceProvider>();

            fixture.Customizations.Add(new TypeRelay(typeof(IMessageDescriptorStore), typeof(TestMessageDescriptorStore)));

            return fixture;
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Parmelia fissa Pers.

### Remarks
null


text:
using namespace std;
using namespace madness;

template <typename T>
class SimpleQ : public Spinlock {
    const int len;
    volatile int ninq;
    T* q;

    SimpleQ(const SimpleQ& other); // Verboten

public:
    SimpleQ(int len=128)
        : len(len)
        , ninq(0)
        , q(new T[len])
    {}

    ~SimpleQ() {
        delete[] q;
    }

    void push(const T& item) {
        lock();
        MADNESS_ASSERT(ninq <= len);
        q[ninq++] = item;
        unlock();
    }

    bool empty() const {
        return (ninq==0);
    }

    int size() const {
        return ninq;
    }

    int capacity() const {
        return len;
    }

    void clear() {
        ninq = 0;
    }

    const T& operator[](int i) const {
        return q[i];
    }

    // Atomically apply op() to all items in FIFO order and clear the queue
    template <typename opT>
    int process(const opT& op) {
        lock();
        int n = ninq;
        for (int i=0; i<ninq; ++i) op(q[i]);
        clear();
        unlock();
        return n;
    }
};

template <typename T>
class DQueue {
    int n __attribute__((aligned(64)));        ///< Number of elements in the buffer
    int len;                                    ///< Current capacity
    T* buf;                                    ///< Actual buffer
    int front;               ///< Index of element at front of buffer
    int back;                ///< Index of element at back of buffer

    void grow() {
        if (len != n) MADNESS_EXCEPTION("assertion failure in dqueue::grow", len);
        int oldlen = len;
        if (len < 32768)
            len = 65536;
        else if (len <= 1048576)
            len *= 2;
        else
            len += 1048576;

        T* nbuf = new T[len];
        int lo = len/2 - oldlen/2;
        for (int i=front; i<int(oldlen); ++i,++lo) {
            nbuf[lo] = buf[i];
        }
        if (front > 0) {
            for (int i=0; i<=back; ++i,++lo) {
                nbuf[lo] = buf[i];
            }
        }
        front = len/2 - oldlen/2;
        back = front + n - 1;

        delete buf;

        buf = nbuf;
    }

    void sanity_check() const {
        int num = back - front + 1;
        if (num < 0) num += len;
        if (num==len && n==0) num=0;
        if (num==0 && n==len) num=len;
        //if (n != num) print("size",len,"front",front,"back",back,"n",n,"num",num);
        MADNESS_ASSERT(n == num);
    }

    DQueue(const DQueue& other); // Verboten

public:
    DQueue(int hint=32768)
        : n(0)
        , len(hint>2 ? hint : 2)
        , buf(new T[len])
        , front(len/2)
        , back(front-1) {}

    virtual ~DQueue() {
        delete buf;
    }

    /// Insert value at front of queue
    void push_front(const T& value) {
        if (n == len) grow();
        ++n;

        front--;
        if (front < 0) front = len - 1;
        buf[front] = value;
    }

    /// Insert element at back of queue
    void push_back(const T& value) {
        if (n == len) grow();
        ++n;

        ++back;
        if (back >= len) back = 0;
        buf[back] = value;
    }

    /// Pop value off the front of queue
    std::pair<bool,T> pop_front() {
        if (n) {
            n--;
            T result = buf[front++];
            if (front >= len) front = 0;
            return std::make_pair(true,result);
        }
        else {
            return std::make_pair(false,T());
        }
    }

    int size() const {
        return n;
    }

    int capacity() const {
        return len;
    }

    bool empty() const {
        return n==0;
    }
};

pthread_key_t idkey; // Must be external

static thread_local int my_thread_id;

static int __num_hw_processors() {
#ifdef _SC_NPROCESSORS_CONF
    int ncpu = sysconf(_SC_NPROCESSORS_CONF);
    if (ncpu <= 0) MADNESS_EXCEPTION("ThreadBase: set_affinity_pattern: sysconf(_SC_NPROCESSORS_CONF)", ncpu);
#elif defined(HC_NCPU)
    int mib[2]={CTL_HW,HW_NCPU}, ncpu;
    size_t len = sizeof(ncpu);
    if (sysctl(mib, 2, &ncpu, &len, NULL, 0) != 0)
        MADNESS_EXCEPTION("ThreadBase: sysctl(CTL_HW,HW_NCPU) failed", 0);
    std::cout << "NCPU " << ncpu << std::endl;
#else
    int ncpu=1;
#endif
    return ncpu;
}

static void set_thread_affinity(int cpu) {
#ifndef ON_A_MAC
#define HAVE_SCHED_SETAFFINITY
#endif
#ifdef HAVE_SCHED_SETAFFINITY
    cpu_set_t mask;
    CPU_ZERO(&mask);
    cpu = cpu % __num_hw_processors();
    CPU_SET(cpu,&mask);
    if (sched_setaffinity(0, sizeof(mask), &mask) == -1) {
        perror("system error message");
        std::cout << "ThreadBase: set_affinity: Could not set cpu Affinity" << std::endl;
    }
#endif
}

static inline void set_thread_id(int id) {
    //pthread_setspecific(idkey, (void*)(id));
    my_thread_id = id;

    set_thread_affinity(id);
}

static inline int get_thread_id() {
    //long value = long(pthread_getspecific(idkey));
    //return int(value);
    return my_thread_id;
}

struct PoolTaskInterface {
    virtual void run() = 0;
    virtual ~PoolTaskInterface() { }
};

class ThreadPool {

    static const int MAXNTHREAD = 32;
    enum MsgType {STEAL, PUSH, TERMINATE};

    struct InterThreadMessage {
        MsgType msgtype;
        int n;
        PoolTaskInterface** buf;
        volatile int* count;

        InterThreadMessage() {}

        InterThreadMessage(MsgType msgtype, int n, PoolTaskInterface** buf, volatile int* count)
            : msgtype(msgtype), n(n), buf(buf), count(count)
        {}
    };

    struct ThreadPoolData {
        SimpleQ<InterThreadMessage> itmq;
        DQueue<PoolTaskInterface*> taskq;
        unsigned long ntask;
        unsigned char weights[MAXNTHREAD]; // Cumulative probability rescaled from [0,1] to [0,256]

        ThreadPoolData() : ntask(0) {}
    };

    static InterThreadMessage steal_msg(int n, PoolTaskInterface** buf, volatile int* count) {
        return InterThreadMessage(STEAL, n, buf, count);
    }

    static InterThreadMessage push_msg(PoolTaskInterface* task) {
        return InterThreadMessage(PUSH, 0, (PoolTaskInterface**)(task), 0);
    }

    static InterThreadMessage end_msg() {
        return InterThreadMessage(TERMINATE, 0, 0, 0);
    }

    typedef SimpleQ<InterThreadMessage> ITMQ;
    typedef DQueue<PoolTaskInterface*> TASKQ;

    static int nthread;
    static AtomicInt done;
    static ThreadPoolData* data[MAXNTHREAD];

    // Mapping of threads to hardware
    static int thread_to_hwthread[MAXNTHREAD];

    // Info about computer topology
    static int hwthread_to_core[MAXNTHREAD];
    static int hwcore_to_socket[MAXNTHREAD];

    static void process_messages(ThreadPoolData* t) {
        ITMQ& itmq = t->itmq;
        TASKQ& taskq = t->taskq;
        if (itmq.empty()) return;

        itmq.lock();            // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        bool terminate = false;
        for (int i=0; i<itmq.size(); ++i) {
            const InterThreadMessage& msg = itmq[i];
            if (msg.msgtype == STEAL) {
                int n = std::min(taskq.size()/2,msg.n);
                PoolTaskInterface** buf = msg.buf;
                for (int j=0; j<n; ++j) buf[j] = taskq.pop_front().second;
                __asm__ __volatile__ ("" : : : "memory");
                *msg.count = n;
            }
            else if (msg.msgtype == PUSH) {
                MADNESS_ASSERT(0);
            }
            else if (msg.msgtype == TERMINATE) {
                terminate = true;
            }
            else {
                MADNESS_EXCEPTION("unknown inter-thread message", int(msg.msgtype));
            }
        }
        itmq.clear();
        itmq.unlock();          // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

        if (terminate) {
            done--;
            while (done > 0) process_messages(t);
            pthread_exit(0);
        }
    }

    // Steal from target thread into taskq
    static void steal(int target, ThreadPoolData* t) {
        static const int n = 2048;
        PoolTaskInterface* buf[n];
        TASKQ& taskq = t->taskq;

        volatile int count = -1;
        __asm__ __volatile__ ("" : : : "memory");

        data[target]->itmq.push(steal_msg(n, buf, &count));
        while (count == -1) process_messages(t);

        int num = count;
        for (int i=0; i<num; ++i) taskq.push_back(buf[i]);

        //std::cout << get_thread_id() << " from " << target << " got " << count << " " << taskq.size() << " " << t->ntask << endl;
    }

    static bool forever() {return false;}

    static void* main(void* args) {
        int id = long(args);
        set_thread_id(id);

        data[id] = new ThreadPoolData;

        done++;

        // Need to wait for everyone to be ready
        while (done != nthread); // Need to relax here

        work(&forever);

        return 0;
    }

    static void start_thread(int id) {
        pthread_attr_t attr;
        // Want detached thread with kernel scheduling so can use multiple cpus
        pthread_attr_init(&attr);
        pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
#ifndef HAVE_IBMBGP
        pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
#endif
        pthread_t ptid;
        int result = pthread_create(&ptid, &attr, &ThreadPool::main, (void *)(id));
        if (result) MADNESS_EXCEPTION("failed creating thread", result);
        pthread_attr_destroy(&attr);
    }

    ThreadPool() {}; // Verboten;

    static int num_hw_processors() {
        return __num_hw_processors();
    }

    // Reads an array of integers from a character string
    static int parse_string(const char* c, int maxdata, int* data) {
        istringstream s(c);
        int n=0;
        while (!s.eof()) {
            MADNESS_ASSERT(n < maxdata);
            s >> data[n++];
        }
        return n;
    }

public:

    static void initialize(int numthread) {
        MADNESS_ASSERT(numthread <= MAXNTHREAD);
        nthread = numthread;

        // For detecting correct initialization
        for (int i=0; i<MAXNTHREAD; ++i) {
            thread_to_hwthread[i] = -99;
            hwthread_to_core[i] = -99;
            hwcore_to_socket[i] = -99;
        }

        int ncore, nhwthread;
        const char* map = getenv("MAD_THREAD_AFFINITY");
        const char* hwcore = getenv("MAD_HWTHREAD_TO_CORE");
        const char* hwsock = getenv("MAD_HWCORE_TO_SOCKET");

        if (hwsock) {
            ncore = parse_string(hwsock, MAXNTHREAD, hwcore_to_socket);
        }
        else {
            ncore = num_hw_processors();
            for (int i=0; i<nthread; ++i)
                hwcore_to_socket[i] = 0;
        }

        if (hwcore) {
            nhwthread = parse_string(hwcore, MAXNTHREAD, hwthread_to_core);
        }
        else {
            nhwthread = ncore;
            for (int i=0; i<nhwthread; ++i)
                hwthread_to_core[i] = i % ncore;
        }

        if (map) {
            int nthreadmap = parse_string(map, MAXNTHREAD, thread_to_hwthread);
            MADNESS_ASSERT(nthreadmap >= nthread);
        }
        else {
            for (int i=0; i<nthread; ++i)
                thread_to_hwthread[i] = i % nhwthread;
        }

        // Ensure each thread maps to a valid hwthread to a valid core to a valid socket
        for (int i=0; i<nthread; ++i) {
            int hwt = thread_to_hwthread[i];
            if (hwt < -1 || hwt >= nhwthread) {
                cout << "Fixing invalid thread_to_hwthread[" << i << "]=" << hwt << " -> -1" << endl;
                hwt = thread_to_hwthread[i] = -1;
            }
            if (hwt != -1) {
                int hwc = hwthread_to_core[hwt];
                if (hwc < 0 || hwc >= ncore) {
                    int newhwc = hwt % ncore;
                    cout << "Fixing invalid hwthread_to_core[" << hwt << "]=" << hwc << " -> " << newhwc << endl;
                    hwc = hwthread_to_core[hwt] = newhwc;
                }
                int hws = hwcore_to_socket[hwc];
                if (hws < 0 || hws >= MAXNTHREAD) {
                    cout << "Fixing invalid hwcore_to_socket[" << hwc << "]=" << hws << " -> 0" << endl;
                    hwt = thread_to_hwthread[i] = 0;
                }
            }
        }

        printf("Thread affinity and topology nthread=%d nhwthread=%d ncore=%d\n",
               nthread, nhwthread, ncore);
        printf("  thread   hwthread    core   socket\n");
        printf("  ------   --------    ----   ------\n");
        for (int i=0; i<nthread; ++i) {
            int hwt = thread_to_hwthread[i], hwc=-1, hws=-1;
            if (hwt >= 0) {
                hwc = hwthread_to_core[hwt];
                hws = hwcore_to_socket[hwc];
            }
            printf("  %4d     %4d       %4d    %4d\n", i, hwt, hwc, hws);
        }

        pthread_key_create(&idkey, NULL); // To store thread-specific id

        set_thread_id(0); // Main thread is zero
        data[0] = new ThreadPoolData;

        // Thread start up first binds thread to core, then allocates
        // queue structures to accomodate NUMA heap.  Done counts
        // threads that are ready
        done = 1;
        for (int i=1; i<nthread; ++i) start_thread(i);
        while (done != nthread);
    }

    template <typename opT>
    static void work(const opT& terminated) {
        const int id = get_thread_id();
        ThreadPoolData* t = data[id];
        TASKQ& taskq = t->taskq;
        unsigned long& ntask = t->ntask;

        int target = id;
        while (!terminated()) {
            process_messages(t);

            std::pair<bool,PoolTaskInterface*> p = taskq.pop_front();
            if (p.first) {
                p.second->run();
                delete p.second;
                ++ntask;
            }
            else if (nthread > 1) {
                do {
                    ++target;
                    if (target >= nthread) target = 0;
                } while (target == id);
                steal(target, t);
            }
        }
    }

    static void end() {
        done = nthread-1;
        for (int i=1; i<nthread; ++i) {
            data[i]->itmq.push(end_msg());
        }
        while (done != 0);
    }

    static void add(PoolTaskInterface* task) {
        int id = get_thread_id();
        data[id]->taskq.push_back(task);
        process_messages(data[id]);
    }

    static int size() {return nthread;}

    static unsigned long ntaskdone(int id) {return data[id]->ntask;}
};

int ThreadPool::nthread;
ThreadPool::ThreadPoolData* ThreadPool::data[ThreadPool::MAXNTHREAD];
AtomicInt ThreadPool::done;
int ThreadPool::thread_to_hwthread[ThreadPool::MAXNTHREAD];
int ThreadPool::hwthread_to_core[ThreadPool::MAXNTHREAD];
int ThreadPool::hwcore_to_socket[ThreadPool::MAXNTHREAD];

const int NGEN=100;
const int NTASK=100000;
AtomicInt cnt;

class Task : public PoolTaskInterface {
    const int gen;
    bool done;
public:
    Task(int gen) : gen(gen), done(false) {}

    void run() {
        MADNESS_ASSERT(!done);
        done = true;
        cnt++;
        if (gen > 1) ThreadPool::add(new Task(gen-1));
    }

    static bool finished() {return cnt==(NGEN*NTASK);}
};

int main() {
    SimpleQ<int> q;

    MADNESS_ASSERT(q.size() == 0 && q.empty());
    q.push(0); MADNESS_ASSERT(q.size() == 1 && !q.empty());
    q.push(1); MADNESS_ASSERT(q.size() == 2 && !q.empty());
    q.push(2); MADNESS_ASSERT(q.size() == 3 && !q.empty());

    q.lock();
    for (int i=0; i<q.size(); ++i) MADNESS_ASSERT(q[i] == i);
    q.clear(); MADNESS_ASSERT(q.size() == 0 && q.empty());
    q.unlock();

    DQueue<int> dq;

    MADNESS_ASSERT(dq.size() == 0 && dq.empty());
    dq.push_back(3); MADNESS_ASSERT(dq.size() == 1 && !dq.empty());
    dq.push_back(4); MADNESS_ASSERT(dq.size() == 2 && !dq.empty());
    dq.push_back(5); MADNESS_ASSERT(dq.size() == 3 && !dq.empty());
    dq.push_front(2); MADNESS_ASSERT(dq.size() == 4 && !dq.empty());
    dq.push_front(1); MADNESS_ASSERT(dq.size() == 5 && !dq.empty());
    dq.push_front(0); MADNESS_ASSERT(dq.size() == 6 && !dq.empty());

    int j=0;
    while(1) {
        std::pair<bool,int> item = dq.pop_front();
        if (item.first) {
            MADNESS_ASSERT(item.second == j++);
            MADNESS_ASSERT(dq.size() == 6-j);
        }
        else {
            MADNESS_ASSERT(dq.size()==0 && dq.empty());
            break;
        }
    }

    ThreadPool::initialize(30);

    cnt = 0;
    for (int i=0; i<NTASK; ++i)
        ThreadPool::add(new Task(NGEN));

    ThreadPool::work(Task::finished);

    for (int i=0; i<ThreadPool::size(); ++i) cout << i << " " << ThreadPool::ntaskdone(i) << endl;

    ThreadPool::end();

    return 0;
}


text:
import Ember from 'ember';

export default Ember.Component.extend({
  classNames: ['drag-box', 'flexberry-drag-box'],

  classNameBindings: ['additionalClassName'],

  additionalClassName: null,

  container: null,

  zIndex: 3000,

  top: null,

  bottom: null,

  left: null,

  right: null,

  visible: false,

  setVisibility: Ember.observer('visible', function () {
    this.$().css('display', this.get('visible') ? '' : 'none');

    if (!this.get('visible')) {
      this.$().css('inset', '');

      if (!Ember.isNone(this.get('top'))) {
        this.$().css('top', this.get('top'));
      } else if (!Ember.isNone(this.get('bottom'))) {
        this.$().css('bottom', this.get('bottom'));
      }

      if (!Ember.isNone(this.get('left'))) {
        this.$().css('left', this.get('left'));
      } else if (!Ember.isNone(this.get('right'))) {
        this.$().css('right', this.get('right'));
      }
    }
  }),

  setStyle: Ember.observer('zIndex', '_selectedLayer', function () {
    this.$().css('z-index', this.get('zIndex'));
  }),

  didInsertElement() {
    let container = this.get('container');
    if (!Ember.isNone(container)) {
      Ember.$(container).css('position', 'relative');
      this.$().appendTo(Ember.$(container));

      if (!Ember.isNone(this.get('zIndex'))) {
        this.$().css('z-index', this.get('zIndex'));
      }

      if (!Ember.isNone(this.get('top'))) {
        this.$().css('top', this.get('top'));
      } else if (!Ember.isNone(this.get('bottom'))) {
        this.$().css('bottom', this.get('bottom'));
      }

      if (!Ember.isNone(this.get('left'))) {
        this.$().css('left', this.get('left'));
      } else if (!Ember.isNone(this.get('right'))) {
        this.$().css('right', this.get('right'));
      }

      this.$().css('position', 'absolute');
      this.$().dragOrResize({ mode: 'drag', containment: container });

      this.setVisibility();
    }
  },

  willDestroyElement() {
    this._super(...arguments);
    this.$().dragOrResize('destroy');
  },
});


text:
@interface FFPhotoAndNameField : FFPhotoField

@property (strong, nonatomic) IBOutlet UIButton *photoButton;
@property (strong, nonatomic) IBOutlet UITextField *firstNameTextField;
@property (strong, nonatomic) IBOutlet UITextField *lastNameTextField;

@end


text:
import os
from nose.tools import assert_equals
from modules.json_browser import JSONAppBrowser

# Swtich into a testing environment
os.environ['WEBPY_ENV'] = 'test'

# Import app to test
from code import app

class TestApi():

    def setup(self):
        self.b = JSONAppBrowser(app)

    def teardown(self):
        self.b.reset()

    def test_list_todos(self):
        response = self.b.json_open('/api/todos')
        assert_equals(self.b.status, 200)
        assert_equals(response.headers['Content-Type'], 'application/json')
        todos = self.b.json_data
        assert_equals(isinstance(todos, list), True)

    def test_create_and_get_todo(self):
        # Create todo
        self.b.json_open(
            '/api/todos',
            data={'content': 'Test TODO'},
            method='POST'
        )
        todo = self.b.json_data
        assert_equals(todo['content'], 'Test TODO')
        self.b.json_open('/api/todos/%(id)d' % todo)
        todo2 = self.b.json_data
        assert_equals(todo2['content'], 'Test TODO')

    def test_validation_on_create(self):
         # Try to create todo
        self.b.json_open(
            '/api/todos',
            data={'content': 'Small'},
            method='POST'
        )
        assert_equals(self.b.status, 400)
        error = self.b.json_data[0]
        assert_equals(error['name'], 'content')
        assert_equals(error['note'], 'Content length must be greater than 7')

    def test_create_and_update_todo(self):
        # Create todo
        self.b.json_open(
            '/api/todos',
            data={'content': 'Test TODO'},
            method='POST'
        )
        todo = self.b.json_data
        assert_equals(todo['content'], 'Test TODO')
        assert_equals(todo['is_done'], False)
        # Update todo and ensure it was changed
        self.b.json_open(
            '/api/todos/%(id)d' % todo,
            data={'content': 'Test TODO 2', 'is_done': True},
            method='PUT'
        )
        todo2 = self.b.json_data
        assert_equals(todo2['content'], 'Test TODO 2')
        assert_equals(todo2['is_done'], True)

    def test_create_and_delete_todo(self):
        # Create todo to ensure db is not empty
        self.b.json_open(
            '/api/todos',
            data={'content': 'Test TODO'},
            method='POST'
        )
        # Select all todos
        self.b.json_open('/api/todos')
        # Delete first todo
        todo = self.b.json_data[0]
        self.b.json_open('/api/todos/%(id)d' % todo, method='DELETE')
        # Select todos again
        self.b.json_open('/api/todos')
        # Ensure deleted todo is not present in list
        todos = self.b.json_data
        assert_equals(any(t['id'] == todo['id'] for t in todos), False)

    def test_get_inexistent_todo(self):
        todo_id = 123456
        # Ensure it doesn't exist
        self.b.json_open('/api/todos/%d' % todo_id, method='DELETE')
        self.b.json_open('/api/todos/%d' % todo_id)
        assert_equals(self.b.status, 404)


text:
  <title>Nahum - La Bible</title>
  <meta name="Description" content="La Bible gratuite en texte intégral (HTML). Traduction L. Segond"/>
  <link rel=stylesheet type="text/css" href="style.css"/>
  <meta charset="utf-8">

Nahum

Nahum 1

Nahum 2

Nahum 3

Nahum 1

Oracle sur Ninive. Livre de la prophétie de Nahum, d'Elkosch.

L'Éternel est un Dieu jaloux, il se venge; L'Éternel se venge, il est plein de fureur; L'Éternel se venge de ses adversaires, Il garde rancune à ses ennemis.

L'Éternel est lent à la colère, il est grand par sa force; Il ne laisse pas impuni. L'Éternel marche dans la tempête, dans le tourbillon; Les nuées sont la poussière de ses pieds.

Il menace la mer et la dessèche, Il fait tarir tous les fleuves; Le Basan et le Carmel languissent, La fleur du Liban se flétrit.

Les montagnes s'ébranlent devant lui, Et les collines se fondent; La terre se soulève devant sa face, Le monde et tous ses habitants.

Qui résistera devant sa fureur? Qui tiendra contre son ardente colère? Sa fureur se répand comme le feu, Et les rochers se brisent devant lui.

L'Éternel est bon, Il est un refuge au jour de la détresse; Il connaît ceux qui se confient en lui.

Mais avec des flots qui déborderont Il détruira la ville, Et il poursuivra ses ennemis jusque dans les ténèbres.

Que méditez-vous contre l'Éternel? C'est lui qui détruit. La détresse ne paraîtra pas deux fois.

Car entrelacés comme des épines, Et comme ivres de leur vin, Ils seront consumés Comme la paille sèche, entièrement.

De toi est sorti Celui qui méditait le mal contre l'Éternel, Celui qui avait de méchants desseins.

Ainsi parle l'Éternel: Quoique intacts et nombreux, Ils seront moissonnés et disparaîtront. Je veux t'humilier, Pour ne plus avoir à t'humilier...

Je briserai maintenant son joug de dessus toi, Et je romprai tes liens...

Voici ce qu'a ordonné sur toi l'Éternel: Tu n'auras plus de descendants qui portent ton nom; J'enlèverai de la maison de ton dieu les images taillées ou en fonte; Je préparerai ton sépulcre, car tu es trop léger.

Voici sur les montagnes Les pieds du messager qui annonce la paix! Célèbre tes fêtes, Juda, accomplis tes voeux! Car le méchant ne passera plus au milieu de toi, Il est entièrement exterminé...

Nahum 2

Le destructeur marche contre toi. Garde la forteresse! Veille sur la route! affermis tes reins! Recueille toute ta force!...

Car l'Éternel rétablit la gloire de Jacob Et la gloire d'Israël, Parce que les pillards les ont pillés Et ont détruit leurs ceps....

Les boucliers de ses héros sont rouges, Les guerriers sont vêtus de pourpre; Avec le fer qui étincelle apparaissent les chars, Au jour qu'il a fixé pour la bataille, Et les lances sont agitées.

Les chars s'élancent dans la campagne, Se précipitent sur les places; A les voir, on dirait des flambeaux, Ils courent comme des éclairs...

Ils se souvient de ses vaillants hommes, Mais ils chancellent dans leur marche; On se hâte vers les murs, Et l'on se prépare à la défense....

Les portes des fleuves sont ouvertes, Et le palais s'écroule!...

C'en est fait: elle est mise à nu, elle est emmenée; Ses servantes gémissent comme des colombes, Et se frappent la poitrine.

Ninive était jadis comme un réservoir plein d'eau.... Les voilà qui fuient.... Arrêtez! arrêtez!... Mais nul ne se retourne....

Pillez l'argent! pillez l'or! Il y a des trésors sans fin, Des richesses en objets précieux de toutes espèce.

On pille, on dévaste, on ravage! Et les coeurs sont abattus, Les genoux chancellent, Tous les reins souffrent, Tous les visages pâlissent.

Qu'est devenu ce repaire de lions, Ce pâturage des lionceaux, Où se retiraient le lion, la lionne, le petit du lion, Sans qu'il y eût personne pour les troubler?

Le lion déchirait pour ses petits, Étranglait pour ses lionnes; Il remplissait de proie ses antres, De dépouilles ses repaires.

Voici, j'en veux à toi, dit l'Éternel des armées; Je réduirai tes chars en fumée, L'épée dévorera tes lionceaux, J'arracherai du pays ta proie, Et l'on n'entendra plus la voix de tes messagers.

Nahum 3

Malheur à la ville sanguinaire, Pleine de mensonge, pleine de violence, Et qui ne cesse de se livrer à la rapine!...

On entend le bruit du fouet, Le bruit des roues, Le galop des chevaux, Le roulement des chars.

Les cavaliers s'élancent, l'épée étincelle, la lance brille... Une multitude de blessés!... une foule de cadavres!... Des morts à l'infini!... On tombe sur les morts!...

C'est à cause des nombreuses prostitutions de la prostituée, Pleine d'attraits, habile enchanteresse, Qui vendait les nations par ses prostitutions Et les peuples par ses enchantements.

Voici, j'en veux à toi, dit l'Éternel des armées, Je relèverai tes pans jusque sur ton visage, Je montrerai ta nudité aux nations, Et ta honte aux royaumes.

Je jetterai sur toi des impuretés, je t'avilirai, Et je te donnerai en spectacle.

Tous ceux qui te verront fuiront loin de toi, Et l'on dira: Ninive est détruite! Qui la plaindra? Où te chercherai-je des consolateurs?

Es-tu meilleure que No Amon, Qui était assise au milieu des fleuves, Entourée par les eaux, Ayant la mer pour rempart, La mer pour murailles?

L'Éthiopie et les Égyptiens innombrables faisaient sa force, Puth et les Libyens étaient ses auxiliaires.

Et cependant elle est partie pour l'exil, elle s'en est allée captive; Ses enfants ont été écrasés au coin de toutes les rues; On a jeté le sort sur ses nobles, Et tous ses grands ont été chargés de chaînes.

Toi aussi, tu seras enivrée, tu te cacheras; Toi aussi, tu chercheras un refuge contre l'ennemi.

Toutes tes forteresses Sont des figuiers avec les primeurs; Quand on les secoue, Elles tombent dans la bouche de qui veut les manger.

Voici, ton peuple, ce sont des femmes au milieu de toi; Les portes de ton pays s'ouvrent à tes ennemis; Le feu consume tes verrous.

Puise de l'eau pour le siège! Répare tes forteresses! Entre dans la boue, foule l'argile! Rétablis le four à briques!

Là, le feu te dévorera, L'épée t'exterminera, Te dévorera comme des sauterelles. Entasse-toi comme les sauterelles! Entasse-toi comme les sauterelles!

Tes marchands, plus nombreux Que les étoiles du ciel, Sont comme la sauterelle qui ouvre les ailes et s'envole.

Tes princes sont comme les sauterelles, Tes chefs comme une multitude de sauterelles, Qui se posent sur les haies au temps de la froidure: Le soleil paraît, elles s'envolent, Et l'on ne connaît plus le lieu où elles étaient.

Tes bergers sommeillent, roi d'Assyrie, Tes vaillants hommes reposent; Ton peuple est dispersé sur les montagnes, Et nul ne le rassemble.

Il n'y a point de remède à ta blessure, Ta plaie est mortelle. Tous ceux qui entendront parler de toi Battront des mains sur toi; Car quel est celui que ta méchanceté n'a pas atteint?


text:
/* eslint-disable @typescript-eslint/no-empty-function */
import { expect } from "chai";
import * as nock from "nock";
import * as os from "os";
import * as sinon from "sinon";

import { validateOptions, serialExportUsers } from "../accountExporter";

describe("accountExporter", () => {
  describe("validateOptions", () => {
    it("should reject when no format provided", () => {
      expect(() => validateOptions({}, "output_file")).to.throw();
    });

    it("should reject when format is not csv or json", () => {
      expect(() => validateOptions({ format: "txt" }, "output_file")).to.throw();
    });

    it("should ignore format param when implicitly specified in file name", () => {
      const ret = validateOptions({ format: "JSON" }, "output_file.csv");
      expect(ret.format).to.eq("csv");
    });

    it("should use format param when not implicitly specified in file name", () => {
      const ret = validateOptions({ format: "JSON" }, "output_file");
      expect(ret.format).to.eq("json");
    });
  });

  describe("serialExportUsers", () => {
    let sandbox: sinon.SinonSandbox;
    let userList: {
      localId: string;
      email: string;
      displayName: string;
      disabled: boolean;
      customAttributes?: string;
    }[] = [];
    const writeStream = {
      write: () => {},
      end: () => {},
    };
    let spyWrite: sinon.SinonSpy;

    beforeEach(() => {
      sandbox = sinon.createSandbox();
      spyWrite = sandbox.spy(writeStream, "write");
      for (let i = 0; i < 7; i++) {
        userList.push({
          localId: i.toString(),
          email: "test" + i + "@test.org",
          displayName: "John Tester" + i,
          disabled: i % 2 === 0,
        });
      }
    });

    afterEach(() => {
      sandbox.restore();
      nock.cleanAll();
      userList = [];
    });

    it("should call api.request multiple times for JSON export", async () => {
      nock("https://www.googleapis.com")
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: userList.slice(0, 3),
          nextPageToken: "3",
        })
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          nextPageToken: "3",
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: userList.slice(3, 6),
          nextPageToken: "6",
        })
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          nextPageToken: "6",
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: userList.slice(6, 7),
          nextPageToken: "7",
        })
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          nextPageToken: "7",
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: [],
          nextPageToken: "7",
        });

      await serialExportUsers("test-project-id", {
        format: "JSON",
        batchSize: 3,
        writeStream: writeStream,
      });
      expect(spyWrite.callCount).to.eq(7);
      expect(spyWrite.getCall(0).args[0]).to.eq(JSON.stringify(userList[0], null, 2));
      for (let j = 1; j < 7; j++) {
        expect(spyWrite.getCall(j).args[0]).to.eq(
          "," + os.EOL + JSON.stringify(userList[j], null, 2)
        );
      }
      expect(nock.isDone()).to.be.true;
    });

    it("should call api.request multiple times for CSV export", async () => {
      mockAllUsersRequests();

      await serialExportUsers("test-project-id", {
        format: "csv",
        batchSize: 3,
        writeStream: writeStream,
      });
      expect(spyWrite.callCount).to.eq(userList.length);
      for (let j = 0; j < userList.length; j++) {
        const expectedEntry =
          userList[j].localId +
          "," +
          userList[j].email +
          ",false,,," +
          userList[j].displayName +
          Array(22).join(",") + // A lot of empty fields...
          userList[j].disabled;
        expect(spyWrite.getCall(j).args[0]).to.eq(expectedEntry + ",," + os.EOL);
      }
      expect(nock.isDone()).to.be.true;
    });

    it("should encapsulate displayNames with commas for csv formats", async () => {
      // Initialize user with comma in display name.
      const singleUser = {
        localId: "1",
        email: "test1@test.org",
        displayName: "John Tester1, CFA",
        disabled: false,
      };
      nock("https://www.googleapis.com")
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 1,
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: [singleUser],
          nextPageToken: "1",
        })
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 1,
          nextPageToken: "1",
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: [],
          nextPageToken: "1",
        });

      await serialExportUsers("test-project-id", {
        format: "csv",
        batchSize: 1,
        writeStream: writeStream,
      });
      expect(spyWrite.callCount).to.eq(1);
      const expectedEntry =
        singleUser.localId +
        "," +
        singleUser.email +
        ",false,,," +
        '"' +
        singleUser.displayName +
        '"' +
        Array(22).join(",") + // A lot of empty fields.
        singleUser.disabled;
      expect(spyWrite.getCall(0).args[0]).to.eq(expectedEntry + ",," + os.EOL);
      expect(nock.isDone()).to.be.true;
    });

    it("should not emit redundant comma in JSON on consecutive calls", async () => {
      mockAllUsersRequests();

      const correctString =
        '{\n  "localId": "0",\n  "email": "test0@test.org",\n  "displayName": "John Tester0",\n  "disabled": true\n}';

      const firstWriteSpy = sinon.spy();
      await serialExportUsers("test-project-id", {
        format: "JSON",
        batchSize: 3,
        writeStream: { write: firstWriteSpy, end: () => {} },
      });
      expect(firstWriteSpy.args[0][0]).to.be.eq(
        correctString,
        "The first call did not emit the correct string"
      );

      mockAllUsersRequests();

      const secondWriteSpy = sinon.spy();
      await serialExportUsers("test-project-id", {
        format: "JSON",
        batchSize: 3,
        writeStream: { write: secondWriteSpy, end: () => {} },
      });
      expect(secondWriteSpy.args[0][0]).to.be.eq(
        correctString,
        "The second call did not emit the correct string"
      );
      expect(nock.isDone()).to.be.true;
    });

    it("should export a user's custom attributes", async () => {
      userList[0].customAttributes =
        '{ "customBoolean": true, "customString": "test", "customInt": 99 }';
      userList[1].customAttributes =
        '{ "customBoolean": true, "customString2": "test2", "customInt": 99 }';
      nock("https://www.googleapis.com")
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: userList.slice(0, 3),
        });
      await serialExportUsers("test-project-id", {
        format: "JSON",
        batchSize: 3,
        writeStream: writeStream,
      });
      expect(spyWrite.getCall(0).args[0]).to.eq(JSON.stringify(userList[0], null, 2));
      expect(spyWrite.getCall(1).args[0]).to.eq(
        "," + os.EOL + JSON.stringify(userList[1], null, 2)
      );
      expect(spyWrite.getCall(2).args[0]).to.eq(
        "," + os.EOL + JSON.stringify(userList[2], null, 2)
      );
      expect(nock.isDone()).to.be.true;
    });

    function mockAllUsersRequests(): void {
      nock("https://www.googleapis.com")
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: userList.slice(0, 3),
          nextPageToken: "3",
        })
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          nextPageToken: "3",
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: userList.slice(3, 6),
          nextPageToken: "6",
        })
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          nextPageToken: "6",
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: userList.slice(6, 7),
          nextPageToken: "7",
        })
        .post("/identitytoolkit/v3/relyingparty/downloadAccount", {
          maxResults: 3,
          nextPageToken: "7",
          targetProjectId: "test-project-id",
        })
        .reply(200, {
          users: [],
          nextPageToken: "7",
        });
    }
  });
});


text:
<?php
use Mockery as m;
use Sparta\Exceptions\InvalidValidatorException;
use Sparta\Exceptions\MissingParameterException;
use Sparta\Validation;

/**
 * Class ValidationTest.php
 *
 * @package Sparta
 * @author  Mohammed Ashour <ashoms0a@gmail.com>
 * @link    http://www.coderavine.com/
 */
class ValidationTest extends PHPUnit_Framework_TestCase
{

    /**
     * Ensure that validation object works as intended
     *
     * @dataProvider getDataProvider
     *
     * @param $data
     * @param $rules
     * @param $expected
     *
     * @throws \Sparta\Exceptions\MissingParameterException
     */
    public function testBasicBehavior($data, $rules, $expected)
    {
        $translator = m::mock('Sparta\\Translator');
        $translator->shouldReceive('load');
        $translator->shouldReceive('get')->atLeast(1);
        $validation = new Validation($data, $rules, $translator);

        $this->assertEquals($expected, $validation->isValid(),
            'failed value: ' . implode(',', $data));
    }

    /**
     * @throws \Sparta\Exceptions\MissingParameterException
     */
    public function testRunningValidationWithoutRuleOrDataMustReturnException()
    {
        $this->expectException(MissingParameterException::class);
        $validation = new Validation();
        $validation->isValid();
    }

    public function testRunningValidationWithNonExistedValidatorClassReturnException()
    {
        $this->expectException(InvalidValidatorException::class);
        $validation = new Validation(['name' => 'coderavine'], ['name' => 'nonexistedvalidator']);
        $validation->isValid();
    }

    public function testRunningValidationWithInvaliddValidatorClassReturnException()
    {
        $this->expectException(InvalidValidatorException::class);
        $validation = new Validation(['name' => 'coderavine'], ['name' => 'test_invalid_validator_class']);
        $validation->isValid();
    }

    /**
     * @throws \Sparta\Exceptions\MissingParameterException
     */
    public function testRunningValidationWithoutAttributeRulesReturnTrue()
    {
        $data = ['name' => 'coderavine', 'attribute_with_no_rule_should_return_true' => 'no_rules'];
        $rule = ['name' => 'alpha'];
        $validation = new Validation($data, $rule);
        $this->assertTrue($validation->isValid());
    }

    /**
     * Ensure that we can set validations rule using setter method
     */
    public function testSetRulesAfterValidationObjectCreatedViaSetterMethod()
    {
        $translator = m::mock('Sparta\\Translator');
        $translator->shouldReceive('load');
        $validation = new Validation([], null, $translator);
        $validation->setRules(['name' => 'alpha']);
        $this->assertEquals(['name' => 'alpha'], $validation->getRules());
    }

    public function testGettingFieldValueFromValidationData()
    {
        $validation = new Validation(['name' => 'coderavine'], ['name' => 'alpha']);
        $this->assertEquals('coderavine', $validation->field('name'));
        $this->assertEquals(null, $validation->field('invalid-key', null));

        $validation2 = new Validation([], ['name' => 'alpha']);
        $this->assertEquals(null, $validation2->field('name', null));
    }

    /**
     * @throws \Sparta\Exceptions\MissingParameterException
     */
    public function testGetErrorsMessagesAfterValidationFailureUsingGetterMethod()
    {
        $translator = m::mock('Sparta\\Translator');
        $translator->shouldReceive('load');
        $translator->shouldReceive('get')->atLeast(1)->with('Email')->andReturn(
            ['INVALID_EMAIL' => '%s is not a valid email.']
        );
        $validation = new Validation(['email' => 'invalid email'], ['email' => 'email'], $translator);
        $validation->isValid();
        $this->assertArrayHasKey('email', $validation->getErrors());
        $this->assertCount(1, $validation->getErrors());
    }

    public function testGetAttributeErrorsWhenValidatorReturnNoErrors()
    {
        $validation = new Validation(['name' => 'coderavine'], ['name' => 'return_no_errors']);
        $this->assertEquals(false, $validation->isValid());
    }

    /**
     * Prepare some .php_cs data for basic behavior .php_cs case
     *
     * @return array
     *
     * @codeCoverageIgnore
     */
    public function getDataProvider()
    {
        return [
            [
                'data' => ['email_address' => 'coderavine@gmail.com'],
                'rules' => ['email_address' => 'email'],
                'expected' => true,
            ],
            [
                'data' => ['username' => 'coderavine12 eewwewewewe'],
                'rules' => ['username' => 'alpha|length_max:is=10'],
                'expected' => false,
            ],
            [
                'data' => ['birthday' => 'not a valid date'],
                'rules' => ['birsthday' => 'date'],
                'expected' => true,
            ],
            [
                'data' => ['temperature' => -20],
                'rules' => ['temperature' => 'positive'],
                'expected' => false,
            ],
            [
                'data' => ['accepted' => true],
                'rules' => ['accepted' => 'boolean'],
                'expected' => true,
            ],
            [
                'data' => ['string_with_no_whitespace' => 'this is string with whitespace which should fail'],
                'rules' => ['string_with_no_whitespace' => 'alpha'],
                'expected' => false,
            ],
            [
                'data' => ['even_number' => 2],
                'rules' => ['even_number' => 'even'],
                'expected' => true,
            ],
            [
                'data' => ['ip_address' => '12.10.10.100'],
                'rules' => ['ip_address' => 'ip'],
                'expected' => true,
            ]
        ];
    }
}


text:
namespace llvm {

class MachineFunction;
class MachineInstr;
class MDNode;
class TargetRegisterInfo;

// For each user variable, keep a list of instruction ranges where this variable
// is accessible. The variables are listed in order of appearance.
class DbgValueHistoryMap {
  // Each instruction range starts with a DBG_VALUE instruction, specifying the
  // location of a variable, which is assumed to be valid until the end of the
  // range. If end is not specified, location is valid until the start
  // instruction of the next instruction range, or until the end of the
  // function.
  typedef std::pair<const MachineInstr *, const MachineInstr *> InstrRange;
  typedef SmallVector<InstrRange, 4> InstrRanges;
  typedef MapVector<const MDNode *, InstrRanges> InstrRangesMap;
  InstrRangesMap VarInstrRanges;

public:
  void startInstrRange(const MDNode *Var, const MachineInstr &MI);
  void endInstrRange(const MDNode *Var, const MachineInstr &MI);
  // Returns register currently describing @Var. If @Var is currently
  // unaccessible or is not described by a register, returns 0.
  unsigned getRegisterForVar(const MDNode *Var) const;

  bool empty() const { return VarInstrRanges.empty(); }
  void clear() { VarInstrRanges.clear(); }
  InstrRangesMap::const_iterator begin() const { return VarInstrRanges.begin(); }
  InstrRangesMap::const_iterator end() const { return VarInstrRanges.end(); }
};

void calculateDbgValueHistory(const MachineFunction *MF,
                              const TargetRegisterInfo *TRI,
                              DbgValueHistoryMap &Result);
}

#endif


text:
. ./tools.sh

#
# Easy run frisby.js tests script.
#

function install_node_modules () {
  echo_blue "Installing modules for running frisby.js"
  npm_module_install jasmine-node
  npm_module_install frisby
  npm_module_install sleep
}

function create_test_user () {
  echo_blue "Creating test user"
  php cli/run_cli.php --cli=Caco\\Slim\\Auth\\UserManagement -a create -u TEST_USER -p TEST_PASSWORD
}

function delete_test_user () {
  echo_blue "Delete test user"
  php cli/run_cli.php --cli=Caco\\Slim\\Auth\\UserManagement -a delete -u TEST_USER
}

function start_php_build_in_http_server () {
  echo_blue "Starting PHP build in webserver"
  php -S 127.0.0.1:8000 -t public &
  PHP_SERVER_PID="$!"
}

function stop_php_build_in_http_server () {
  echo_blue "Stopping PHP build in webserver"
  kill "$PHP_SERVER_PID"
}

function run_tests () {
  echo_blue "Running the tests now..."
  node_modules/jasmine-node/bin/jasmine-node --junitreport spec/api/
}

install_node_modules
create_test_user
start_php_build_in_http_server
run_tests
stop_php_build_in_http_server
delete_test_user


text:
package org.zalando.logbook;

import org.apiguardian.api.API;

import javax.annotation.Nullable;
import java.util.function.Predicate;

import static java.util.ServiceLoader.load;
import static org.apiguardian.api.API.Status.STABLE;

@API(status = STABLE)
interface LogbookFactory {

    LogbookFactory INSTANCE = load(LogbookFactory.class).iterator().next();

    Logbook create(
            @Nullable final Predicate<HttpRequest> condition,
            @Nullable final CorrelationId correlationId,
            @Nullable final QueryFilter queryFilter,
            @Nullable final PathFilter pathFilter,
            @Nullable final HeaderFilter headerFilter,
            @Nullable final BodyFilter bodyFilter,
            @Nullable final RequestFilter requestFilter,
            @Nullable final ResponseFilter responseFilter,
            @Nullable final Strategy strategy,
            @Nullable final Sink sink);

}


text:
<?php

namespace Kirby\Blueprint;

use Closure;
use Kirby\Cms\App;
use Kirby\Data\Yaml;
use Kirby\Exception\NotFoundException;
use Kirby\Filesystem\F;

class Config
{
	public string $file;
	public string $id;
	public string|array|Closure|null $plugin;
	public string $root;

	public function __construct(
		public string $path
	) {
		$kirby = App::instance();

		$this->id     = basename($this->path);
		$this->root   = $kirby->root('blueprints');
		$this->file   = $this->root . '/' . $this->path . '.yml';
		$this->plugin = $kirby->extension('blueprints', $this->path);
	}

	public function read(): array
	{
		if (F::exists($this->file, $this->root) === true) {
			return $this->unpack($this->file);
		}

		return $this->unpack($this->plugin);
	}

	public function write(array $props): bool
	{
		return Yaml::write($this->file, $props);
	}

	public function unpack(string|array|Closure|null $extension): array
	{
		return match (true) {
			// extension does not exist
			is_null($extension)
				=> throw new NotFoundException('"' . $this->path . '" could not be found'),

			// extension is stored as a file path
			is_string($extension)
				=> Yaml::read($extension),

			// extension is a callback to be resolved
			is_callable($extension)
				=> $extension(App::instance()),

			// extension is already defined as array
			default
			=> $extension
		};
	}
}


text:
package com.google.cloud.bqsh

import com.google.cloud.RetryOption
import com.google.cloud.bigquery.{JobId, QueryJobConfiguration}
import com.google.cloud.bqsh.cmd.Export
import com.google.cloud.imf.gzos.{Ebcdic, Linux}
import com.google.cloud.imf.util.Services
import org.scalatest.BeforeAndAfterAll
import org.scalatest.flatspec.AnyFlatSpec
import org.threeten.bp.Duration

import java.nio.ByteBuffer
import java.nio.file.{Files, Paths}

class ExportLocalITSpec extends AnyFlatSpec with BeforeAndAfterAll {

  /**
    * Provide env variables to execute this test
    * PROJECT_ID
    * COPYBOOK=absolute path to exportCopybook.txt
    * OUTFILE=path_to_output_file
    * OUTFILE_LRECL=length
    * OUTFILE_BLKSIZE=blkSIze
    */
  val projectId = sys.env("PROJECT_ID")
  val location = sys.env.getOrElse("LOCATION", "US")

  val zos = Linux

  val sql =
    s"""select *
       |from $projectId.dataset.tbl1
       |limit 200
       |""".stripMargin

  override protected def beforeAll(): Unit = {

    val bq = Services.bigQuery(projectId, location,
      Services.bigqueryCredentials())

    // create a table with one column of each type
    val sql1 =
      s"""
         |create or replace table $projectId.dataset.tbl1 as
         |SELECT
         | 1 as a,
         | 'a' as b,
         | NUMERIC '-3.14' as c
         |""".stripMargin
    val id1 = JobId.newBuilder().setProject(sys.env("PROJECT_ID"))
      .setLocation(sys.env.getOrElse("LOCATION", "US")).setRandomJob().build()
    bq.query(QueryJobConfiguration.newBuilder(sql1)
      .setUseLegacySql(false).build(), id1)
    val job1 = bq.getJob(id1)
    job1.waitFor(RetryOption.totalTimeout(Duration.ofMinutes(2)))
  }

  "Export pipe-delimited file" should "export data to pipe-delimited file" in {
    val cfg = ExportConfig(
      sql = sql,
      projectId = projectId,
      location = location,
      vartext = true)
    Export.run(cfg, zos, Map.empty)

    val values = readStringFromFile().split("\\|")
    assert(values.length == 3)
    assert(values(0) == "1")
    assert(values(1) == "a")
    assert(values(2).trim == "-3.14")
  }

  "Export binary file" should "export data to binary file" in {
    val cfg = ExportConfig(
      sql = sql,
      projectId = projectId,
      location = location)
    val res = Export.run(cfg, zos, Map.empty)

    assert(res.exitCode == 0)
    assert(res.activityCount == 1)
  }

  private def readStringFromFile(): String = {
    val ddPath = Paths.get(System.getenv("OUTFILE"))
    val bytes = Files.readAllBytes(ddPath)
    val decoder = Ebcdic.charset.newDecoder()
    decoder.decode(ByteBuffer.wrap(bytes)).toString
  }
}


text:
package org.springframework.social.twitter.api.impl;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

/**
 * Mixin class for adding Jackson annotations to SavedSearch.
 * @author Craig Walls
 */
@JsonIgnoreProperties(ignoreUnknown=true)
public abstract class SavedSearchMixin extends TwitterObjectMixin {
	@JsonCreator
	SavedSearchMixin(
			@JsonProperty("id") long id,
			@JsonProperty("name") String name,
			@JsonProperty("query") String query,
			@JsonProperty("position") int position,
			@JsonProperty("created_at") @JsonDeserialize(using=TimelineDateDeserializer.class) Date createdAt) {}
}


text:
/**
 * @testTag {markdown} *Will* be parsed as `markdown`.
 * @multipleLines {markdown}
 * ### Header
 * paragraph
 */


text:
<?= t('Move task to another position on the board') ?>

<form>

<?= $this->app->component('task-move-position', array(
    'saveUrl' => $this->url->href('TaskMovePositionController', 'save', array('task_id' => $task['id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken())),
    'board' => $board,
    'task' => $task,
    'swimlaneLabel' => t('Swimlane'),
    'columnLabel' => t('Column'),
    'positionLabel' => t('Position'),
    'beforeLabel' => t('Insert before this task'),
    'afterLabel' => t('Insert after this task'),
)) ?>

<?= $this->modal->submitButtons() ?>

</form>


text:
<menu-cmp></menu-cmp>
<p-tabView>
    <p-tabPanel header="Tipos De Productos">
       <tiposProductosList-cmp></tiposProductosList-cmp>
    </p-tabPanel>
</p-tabView>


text:
.letscheck .newValue .example{
    content: 'works';
}


text:
from django.core.urlresolvers import reverse_lazy
import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG

PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
    }
}

AUTHENTICATION_BACKENDS = (
    'federated_login.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'tests.urls'

TEMPLATE_DIRS = (
    os.path.join(PROJECT_PATH, 'templates'),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.admin',
    'federated_login',
    'tests',
)

LOGIN_URL = reverse_lazy('fl_login')
LOGIN_REDIRECT_URL = '/'

FL_APPS_DOMAIN = 'webatoom.nl'
FL_PATCH_ADMIN = False

SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'


text:
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
-----------------------------------------------------------------------------
-- |
-- Module : KD8ZRC.Mapview.Types
-- Copyright : (C) 2015 Ricky Elrod
-- License : MIT (see LICENSE file)
-- Maintainer : Ricky Elrod <ricky@elrod.me>
-- Stability : experimental
-- Portability : ghc (lens)
--
-- Provides fundamental types intrinsic to the rest of the mapview library.
-- This shouldn't contain types specific to any particular use of the library
-- (suggested types can be found in the KD8ZRC.Mapview.Utility.* set of
-- modules).
----------------------------------------------------------------------------
module KD8ZRC.Mapview.Types where

import Control.Lens
import Control.Monad.Trans.Reader
import qualified Data.ByteString.Char8 as BS
import qualified Data.Text as T
import Text.PrettyPrint.ANSI.Leijen
import qualified Text.Trifecta as Tr

-- | The 'MV' type is a monad transformer which carries around our
-- 'MapviewConfig', making it accessible to all callback hooks.
type MV t a = ReaderT (MapviewConfig t) IO a

-- | The type for callbacks which occur immediately after a packet is received,
-- before even parsing occurs.
newtype TelemetryReceivedCallback s t =
  TelemetryReceivedCallback {
    getTelemetryReceivedCallback :: s -> MV t ()
  }

-- | The type for callbacks which occur immediately after a packet is parsed.
data ParsedPacketCallback t =
    ParseSuccessCallback { getParseSuccessCallback :: t -> MV t () }
  | ParseFailureCallback { getParseFailureCallback :: Doc -> MV t () }

data ModemStdoutConfiguration t = ModemStdoutConfiguration {
    _command :: T.Text
    -- ^ The modem command to run (e.g. @minimodem@ or @fldigi-shell@)
  , _args :: [T.Text]
    -- ^ Flags/arguments to pass to the modem command
  , _parsedCallbacks :: [ParsedPacketCallback t]
    -- ^  Callbacks to run after a parsing attempt
  , _parser :: forall m. (Tr.DeltaParsing m, Tr.Errable m) => m t
    -- ^ How to parse
  , _onRaw :: [TelemetryReceivedCallback BS.ByteString t]
    -- ^ What to do on as /soon/ as we get a telemetry line (before parsing)
  }

-- | The configuration for this instance of Mapview. The @t@ parameter is the
-- type that the telemetry parser parses into, if it is successfully able to
-- parse the data.
data MapviewConfig t =
  MapviewConfig { _telemetry :: MV t ()
                  -- ^ Determines how to listen for packets/telemetry. Called as
                  -- soon as MapView is launched, and should be long-running.
                }

makeLenses ''MapviewConfig
makeLenses ''ModemStdoutConfiguration


text:
var fs = require('fs')
var path = require('path')
var util = require('util')

function Y18N (opts) {
  // configurable options.
  opts = opts || {}
  this.directory = opts.directory || './locales'
  this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true
  this.locale = opts.locale || 'en'
  this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true

  // internal stuff.
  this.cache = {}
  this.writeQueue = []
}

Y18N.prototype.__ = function () {
  var args = Array.prototype.slice.call(arguments)
  var str = args.shift()
  var cb = function () {} // start with noop.

  if (typeof args[args.length - 1] === 'function') cb = args.pop()
  cb = cb || function () {} // noop.

  if (!this.cache[this.locale]) this._readLocaleFile()

  // we've observed a new string, update the language file.
  if (!this.cache[this.locale][str] && this.updateFiles) {
    this.cache[this.locale][str] = str

    // include the current directory and locale,
    // since these values could change before the
    // write is performed.
    this._enqueueWrite([this.directory, this.locale, cb])
  } else {
    cb()
  }

  return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args))
}

Y18N.prototype._enqueueWrite = function (work) {
  this.writeQueue.push(work)
  if (this.writeQueue.length === 1) this._processWriteQueue()
}

Y18N.prototype._processWriteQueue = function () {
  var _this = this
  var work = this.writeQueue[0]

  // destructure the enqueued work.
  var directory = work[0]
  var locale = work[1]
  var cb = work[2]

  var languageFile = this._resolveLocaleFile(directory, locale)
  var serializedLocale = JSON.stringify(this.cache[locale], null, 2)

  fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
    _this.writeQueue.shift()
    if (_this.writeQueue.length > 0) _this._processWriteQueue()
    cb(err)
  })
}

Y18N.prototype._readLocaleFile = function () {
  var localeLookup = {}
  var languageFile = this._resolveLocaleFile(this.directory, this.locale)

  try {
    localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8'))
  } catch (err) {
    if (err instanceof SyntaxError) {
      err.message = 'syntax error in ' + languageFile
    }

    if (err.code === 'ENOENT') localeLookup = {}
    else throw err
  }

  this.cache[this.locale] = localeLookup
}

Y18N.prototype._resolveLocaleFile = function (directory, locale) {
  var file = path.resolve(directory, './', locale + '.json')
  if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
    // attempt fallback to language only
    var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json')
    if (this._fileExistsSync(languageFile)) file = languageFile
  }
  return file
}

// this only exists because fs.existsSync() "will be deprecated"
// see https://nodejs.org/api/fs.html#fs_fs_existssync_path
Y18N.prototype._fileExistsSync = function (file) {
  try {
    return fs.statSync(file).isFile()
  } catch (err) {
    return false
  }
}

Y18N.prototype.__n = function () {
  var args = Array.prototype.slice.call(arguments)
  var singular = args.shift()
  var plural = args.shift()
  var quantity = args.shift()

  var cb = function () {} // start with noop.
  if (typeof args[args.length - 1] === 'function') cb = args.pop()

  if (!this.cache[this.locale]) this._readLocaleFile()

  var str = quantity === 1 ? singular : plural
  if (this.cache[this.locale][singular]) {
    str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other']
  }

  // we've observed a new string, update the language file.
  if (!this.cache[this.locale][singular] && this.updateFiles) {
    this.cache[this.locale][singular] = {
      one: singular,
      other: plural
    }

    // include the current directory and locale,
    // since these values could change before the
    // write is performed.
    this._enqueueWrite([this.directory, this.locale, cb])
  } else {
    cb()
  }

  // if a %d placeholder is provided, add quantity
  // to the arguments expanded by util.format.
  var values = [str]
  if (~str.indexOf('%d')) values.push(quantity)

  return util.format.apply(util, values.concat(args))
}

Y18N.prototype.setLocale = function (locale) {
  this.locale = locale
}

Y18N.prototype.getLocale = function () {
  return this.locale
}

Y18N.prototype.updateLocale = function (obj) {
  if (!this.cache[this.locale]) this._readLocaleFile()

  for (var key in obj) {
    this.cache[this.locale][key] = obj[key]
  }
}

module.exports = function (opts) {
  var y18n = new Y18N(opts)

  // bind all functions to y18n, so that
  // they can be used in isolation.
  for (var key in y18n) {
    if (typeof y18n[key] === 'function') {
      y18n[key] = y18n[key].bind(y18n)
    }
  }

  return y18n
}


text:
/*
 * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
 * at the root of this project for more details.
 */
package io.github.nucleuspowered.nucleus.modules.environment.config;

import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;

@ConfigSerializable
public class EnvironmentConfig {

    @Setting(value = "maximum-weather-timespan", comment = "config.environment.maxweathertime")
    private long maximumWeatherTimespan = -1;

    public long getMaximumWeatherTimespan() {
        return this.maximumWeatherTimespan;
    }
}


text:
/**
 * @file incomplete_incremental_termination.hpp
 * @author Sumedh Ghaisas
 *
 * Termination policy used in AMF (Alternating Matrix Factorization).
 */
#ifndef _MLPACK_METHODS_AMF_INCOMPLETE_INCREMENTAL_TERMINATION_HPP
#define _MLPACK_METHODS_AMF_INCOMPLETE_INCREMENTAL_TERMINATION_HPP

#include <mlpack/core.hpp>

namespace mlpack {
namespace amf {

/**
 * This class acts as a wrapper for basic termination policies to be used by
 * SVDIncompleteIncrementalLearning. This class calls the wrapped class functions
 * after every n calls to main class functions where n is the number of rows.
 *
 * @see AMF, SVDIncompleteIncrementalLearning
 */
template <class TerminationPolicy>
class IncompleteIncrementalTermination
{
 public:
  /**
   * Empty constructor
   *
   * @param tPolicy object of wrapped class.
   */
  IncompleteIncrementalTermination(
      TerminationPolicy tPolicy = TerminationPolicy()) :
      tPolicy(tPolicy) { }

  /**
   * Initializes the termination policy before stating the factorization.
   *
   * @param V Input matrix to be factorized.
   */
  template<class MatType>
  void Initialize(const MatType& V)
  {
    tPolicy.Initialize(V);

    // Initialize incremental index to number of rows.
    incrementalIndex = V.n_rows;
    iteration = 0;
  }

  /**
   * Check if termination criterio is met.
   *
   * @param W Basis matrix of output.
   * @param H Encoding matrix of output.
   */
  bool IsConverged(arma::mat& W, arma::mat& H)
  {
    // increment iteration count
    iteration++;

    // If the iteration count is a multiple of incremental index, return the
    // wrapped termination policy result.
    if (iteration % incrementalIndex == 0)
      return tPolicy.IsConverged(W, H);
    else
      return false;
  }

  //! Get current value of residue.
  const double& Index() const { return tPolicy.Index(); }

  //! Get current iteration count.
  const size_t& Iteration() const { return iteration; }

  //! Access maximum number of iterations.
  size_t MaxIterations() const { return tPolicy.MaxIterations(); }
  //! Modify maximum number of iterations.
  size_t& MaxIterations() { return tPolicy.MaxIterations(); }

  //! Access the wrapped termination policy.
  const TerminationPolicy& TPolicy() const { return tPolicy; }
  //! Modify the wrapped termination policy.
  TerminationPolicy& TPolicy() { return tPolicy; }

 private:
  //! Wrapped termination policy.
  TerminationPolicy tPolicy;

  //! Number of iterations after which wrapped class object will be called.
  size_t incrementalIndex;
  //! Current iteration count.
  size_t iteration;
}; // class IncompleteIncrementalTermination

} // namespace amf
} // namespace mlpack

#endif


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Security.Models.Alerts
{
    public class PSSecurityAlert
    {
        public string Id { get; set; }

        public string Name { get; set; }

        public string ActionTaken { get; set; }

        public string AlertDisplayName { get; set; }

        public string AlertName { get; set; }

        public string AssociatedResource { get; set; }

        public bool? CanBeInvestigated { get; set; }

        public string CompromisedEntity { get; set; }

        public List<PSSecurityAlertConfidenceReason> ConfidenceReasons { get; set; }

        public double? ConfidenceScore { get; set; }

        public string Description { get; set; }

        public DateTime? DetectedTimeUtc { get; set; }

        public List<PSSecurityAlertEntity> Entities { get; set; }

        public IDictionary<string,object> ExtendedProperties { get; set; }

        public string InstanceId { get; set; }

        public string RemediationSteps { get; set; }

        public string ReportedSeverity { get; set; }

        public DateTime? ReportedTimeUtc { get; set; }

        public string State { get; set; }

        public string SubscriptionId { get; set; }

        public string SystemSource { get; set; }

        public string VendorName { get; set; }

        public string WorkspaceArmId { get; set; }
    }
}


text:
import React from 'react'
import ReactDOM from 'react-dom'
import 'scss_mixin/reset.scss' //reset 样式
import App from './App'

const rootElement = document.getElementById('root');

ReactDOM.render(

	<App />,

    rootElement

)


text:
package com.github.pidygb.typography.text.method;

import android.content.Context;
import android.graphics.Rect;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.method.TransformationMethod;
import android.text.style.ScaleXSpan;
import android.view.View;

import java.util.Locale;

/**
 * Transforms source text into an ALL CAPS string, locale-aware.
 */
public class TextViewTransformationMethod implements TransformationMethod {

    private final Locale mLocale;
    private final float mScaleLetterSpacing;
    private final boolean mAllCaps;

    public TextViewTransformationMethod(Context context, boolean allCaps,
                                        float scaleLetterSpacing) {
        mLocale = context.getResources().getConfiguration().locale;
        mAllCaps = allCaps;
        mScaleLetterSpacing = scaleLetterSpacing;
    }

    @Override
    public CharSequence getTransformation(CharSequence source, View view) {
        if (source == null)
            return null;
        CharSequence transformedText = source;
        if (mAllCaps)
            transformedText = source.toString().toUpperCase(mLocale);

        if (mScaleLetterSpacing == 0) {
            return transformedText;
        }
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < transformedText.length(); i++) {
            builder.append(transformedText.charAt(i));
            if (i + 1 < transformedText.length()) {
                builder.append("\u00A0");
            }
        }
        SpannableString finalText = new SpannableString(builder.toString());
        if (builder.toString().length() > 1) {
            for (int i = 1; i < builder.toString().length(); i += 2) {
                finalText.setSpan(new ScaleXSpan(mScaleLetterSpacing), i,
                        i + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
            }
        }
        return finalText;

    }

    @Override
    public void onFocusChanged(View view, CharSequence sourceText,
                               boolean focused, int direction, Rect previouslyFocusedRect) {
    }

}


text:
import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import classnames from 'classnames'
import Divider from '../divider/divider'
const prefixCls = Divider.prefixCls

import Menu from '../menu/Menu'

class Collapse extends Component {

    getChildren() {
        const { children, defaultOpenKeys } = this.props;
        if (children) {
            return React.Children.map(children, (item, index) => {
                return React.cloneElement(item, {
                    className: `${prefixCls}-Collapse-header`,
                    key: item.key
                })
            })
        }
    }

    render() {
        const { className, span, offset, children, ...others, } = this.props;
        let getClass = classnames(`${prefixCls}-Collapse`, className, {
            [`${prefixCls}-collapse-${span}`]: span
        })
        return (
            <Menu className={getClass} {...others}>
                {this.getChildren()}
            </Menu>
        )
    }

}

Collapse.SubMenu = Menu.SubMenu
Collapse.Item = Menu.Item

export default Collapse