PageRenderTime 378ms queryFilters 0ms Sphinxql 296ms app.CodeModel.GetByIds 14ms findMatchingLines 23ms GetByIds 37ms meta 0ms repositoryFilters 7ms languageFilters 4ms sourceFilters 4ms

4,916,907 results for 'foreach' (378 ms)

Source

Language

Repository

CombinerOptimizer.java https://github.com/zjffdu/pig.git | Java | 1,011 lines
166        if (successor instanceof POForEach) {
167            POForEach foreach = (POForEach)successor;
168            List<PhysicalPlan> feInners = foreach.getInputPlans();
204                //create new map foreach
205                POForEach mfe = createForEachWithGrpProj(foreach, rearrange.getKeyType());                
206                Map<PhysicalOperator, Integer> op2newpos = 
230                //create new combine foreach
231                POForEach cfe = createForEachWithGrpProj(foreach, rearrange.getKeyType());
232                //add algebraic functions with appropriate projection
483     */
484    private POForEach createForEachWithGrpProj(POForEach foreach, byte keyType) {
485        String scope = foreach.getOperatorKey().scope;
866        @Override
867        public void visitPOForEach(POForEach fe) throws VisitorException {
868            // we need to allow foreach as input for distinct
miner.php https://github.com/bkkcoins/cgminer-klondike.git | PHP | 2,751 lines
228 $css = '';
229 foreach ($colourtable as $cssdata => $value)
230 {
455	$objs = explode('|', $line);
456	foreach ($objs as $obj)
457	{
481			$counter = 0;
482			foreach ($items as $item)
483			{
996
997 foreach ($values as $name => $value)
998 {
1004 if ($justnames === false && $cmd == 'pools' && $readonly === false)
1005	foreach ($poolcmd as $name => $pcmd)
1006		echo "<td valign=bottom class=h>$name</td>";
index.php https://github.com/michael-cannon/typo3-extensions.git | PHP | 1,247 lines
371		$tab = 0;
372		foreach ($similar as $main => $main_ar)	{
373			foreach ($main_ar as $sub => $similar_ar)	{
377				$HTML .= '<div class="bgColor4">'.chr(10);
378				foreach ($similar_ar as $cnt => $data)	{
379					$JS .= 'selectVals['.$selectId.'] = Array();'.chr(10);
382					$HTML .= '<ul>'.chr(10);
383					foreach ($data['PAGES'] as $uid => $row)	{
384						$HTML .= '<li>'.t3lib_BEfunc::getRecordTitle('pages', $row).' ('.$uid.')</li>'.chr(10);
388					$HTML .= '<table cellspacing="8" cellpadding="0" border="0">'.chr(10);
389					foreach ($data['T3_COLUMNS'] as $t3Col)	{
390						$getLabel = $this->getItemLabel($GLOBALS['TCA']['tt_content']['columns']['colPos']['config']['items'], $t3Col);
397				<option value="">'.$LANG->getLL('no_target_column').'</option>'.chr(10);
398						foreach ($data['TV_COLUMNS'] as $field => $fieldAr) {
399							$HTML .= '<option value="'.$field.'">'.$fieldAr['tx_templavoila']['title'].'</option>'.chr(10);
Tags.pm https://github.com/stormerider/dw-free.git | Perl | 1,633 lines
47    # prepopulate our structures
48    foreach my $u (@uobjs) {
49        # don't load if we've previously gotten this one
62    my $memc = LJ::MemCache::get_multi(@memkeys) || {};
63    foreach my $key (keys %$memc) {
64        if ($key =~ /^tags:(\d+)$/) {
82    my $ts = $gc->new_task_set();
83    foreach my $u (values %need) {
84        $ts->add_task(Gearman::Task->new("load_usertags", \"$u->{userid}",
117    # prepopulate our structures
118    foreach my $u (@uobjs) {
119        # we will have to load these
127    my $memc = LJ::MemCache::get_multi(@memkeys) || {};
128    foreach my $key (keys %$memc) {
129        if ($key =~ /^kws:(\d+)$/) {
jscfa.js https://github.com/smh/doctorjs.git | JavaScript | 4,375 lines
74
75if (!Array.prototype.forEach) 
76  Array.prototype.forEach = function(fun) {
242    if (nt === INDEX) {
243      ch.forEach(fixe);
244      if (ch[1].type === NUMBER) {
274    }
275    ch.forEach(fixe);
276  }
281    if (nt === ARRAY_INIT) {
282      ch.forEach(function(kid, i, ch) {
283        if (kid === null) ch[i] = idNode(n.tokenizer, "undefined");
285    }
286    ch.forEach(fixe);
287  }
importer.php https://github.com/myconcretelab/concrete5.git | PHP | 762 lines
79		if (isset($sx->stacks)) {
80			foreach($sx->stacks->stack as $p) {
81				if (isset($p['type'])) {
92		if (isset($sx->stacks)) {
93			foreach($sx->stacks->stack as $p) {
94				$stack = Stack::getByName($p['name']);
103		if (isset($sx->singlepages)) {
104			foreach($sx->singlepages->page as $p) {
105				$pkg = ContentImporter::getPackageObject($p['package']);
120		if (isset($sx->singlepages)) {
121			foreach($sx->singlepages->page as $px) {
122				$page = Page::getByPath($px['path'], 'RECENT');
126				if (isset($px->attributes)) {
127					foreach($px->attributes->children() as $attr) {
128						$ak = CollectionAttributeKey::getByHandle($attr['handle']);
index.html https://github.com/yishenggudou/bearcart.git | HTML | 6,143 lines
6	<script type="text/javascript">
7    var Rickshaw={namespace:function(e,t){var n=e.split("."),r=Rickshaw;for(var i=1,s=n.length;i<s;i++){var o=n[i];r[o]=r[o]||{},r=r[o]}return r},keys:function(e){var t=[];for(var n in e)t.push(n);return t},extend:function(e,t){for(var n in t)e[n]=t[n];return e},clone:function(e){return JSON.parse(JSON.stringify(e))}};if(typeof module!="undefined"&&module.exports){var d3=require("d3");module.exports=Rickshaw}(function(e){function f(e){return t.call(e)===a}function l(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function c(e){if(h(e)!==u)throw new TypeError;var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function h(e){switch(e){case null:return n;case void 0:return r}var t=typeof e;switch(t){case"boolean":return i;case"number":return s;case"string":return o}return u}function p(e){return typeof e=="undefined"}function v(e){var t=e.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return t.length==1&&!t[0]?[]:t}function m(e,t){var n=e;return function(){var e=g([b(n,this)],arguments);return t.apply(this,e)}}function g(e,t){var n=e.length,r=t.length;while(r--)e[n+r]=t[r];return e}function y(e,t){return e=d.call(e,0),g(e,t)}function b(e,t){if(arguments.length<2&&p(arguments[0]))return this;var n=e,r=d.call(arguments,2);return function(){var e=y(r,arguments);return n.apply(t,e)}}var t=Object.prototype.toString,n="Null",r="Undefined",i="Boolean",s="Number",o="String",u="Object",a="[object Function]",d=Array.prototype.slice,w=function(){},E=function(){function t(){}function n(){function r(){this.initialize.apply(this,arguments)}var e=null,n=[].slice.apply(arguments);f(n[0])&&(e=n.shift()),l(r,E.Methods),r.superclass=e,r.subclasses=[];if(e){t.prototype=e.prototype,r.prototype=new t;try{e.subclasses.push(r)}catch(i){}}for(var s=0,o=n.length;s<o;s++)r.addMethods(n[s]);return r.prototype.initialize||(r.prototype.initialize=w),r.prototype.constructor=r,r}function r(t){var n=this.superclass&&this.superclass.prototype,r=c(t);e&&(t.toString!=Object.prototype.toString&&r.push("toString"),t.valueOf!=Object.prototype.valueOf&&r.push("valueOf"));for(var i=0,s=r.length;i<s;i++){var o=r[i],u=t[o];if(n&&f(u)&&v(u)[0]=="$super"){var a=u;u=m(function(e){return function(){return n[e].apply(this,arguments)}}(o),a),u.valueOf=b(a.valueOf,a),u.toString=b(a.toString,a)}this.prototype[o]=u}return this}var e=function(){for(var e in{toString:1})if(e==="toString")return!1;return!0}();return{create:n,Methods:{addMethods:r}}}();e.exports?e.exports.Class=E:e.Class=E})(Rickshaw),Rickshaw.namespace("Rickshaw.Compat.ClassList"),Rickshaw.Compat.ClassList=function(){typeof document!="undefined"&&!("classList"in document.createElement("a"))&&function(e){"use strict";var t="classList",n="prototype",r=(e.HTMLElement||e.Element)[n],i=Object,s=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[n].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(t in this&&this[t]===e)return t;return-1},u=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},a=function(e,t){if(t==="")throw new u("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new u("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(e,t)},f=function(e){var t=s.call(e.className),n=t?t.split(/\s+/):[],r=0,i=n.length;for(;r<i;r++)this.push(n[r]);this._updateClassName=function(){e.className=this.toString()}},l=f[n]=[],c=function(){return new f(this)};u[n]=Error[n],l.item=function(e){return this[e]||null},l.contains=function(e){return e+="",a(this,e)!==-1},l.add=function(e){e+="",a(this,e)===-1&&(this.push(e),this._updateClassName())},l.remove=function(e){e+="";var t=a(this,e);t!==-1&&(this.splice(t,1),this._updateClassName())},l.toggle=function(e){e+="",a(this,e)===-1?this.add(e):this.remove(e)},l.toString=function(){return this.join(" ")};if(i.defineProperty){var h={get:c,enumerable:!0,configurable:!0};try{i.defineProperty(r,t,h)}catch(p){p.number===-2146823252&&(h.enumerable=!1,i.defineProperty(r,t,h))}}else i[n].__defineGetter__&&r.__defineGetter__(t,c)}(window)},(typeof RICKSHAW_NO_COMPAT!="undefined"&&!RICKSHAW_NO_COMPAT||typeof RICKSHAW_NO_COMPAT=="undefined")&&new Rickshaw.Compat.ClassList,Rickshaw.namespace("Rickshaw.Graph"),Rickshaw.Graph=function(e){if(!e.element)throw"Rickshaw.Graph needs a reference to an element";this.element=e.element,this.series=e.series,this.defaults={interpolation:"cardinal",offset:"zero",min:undefined,max:undefined,preserve:!1},Rickshaw.keys(this.defaults).forEach(function(t){this[t]=e[t]||this.defaults[t]},this),this.window={},this.updateCallbacks=[];var t=this;this.initialize=function(e){this.validateSeries(e.series),this.series.active=function(){return t.series.filter(function(e){return!e.disabled})},this.setSize({width:e.width,height:e.height}),this.element.classList.add("rickshaw_graph"),this.vis=d3.select(this.element).append("svg:svg").attr("width",this.width).attr("height",this.height);var n=[Rickshaw.Graph.Renderer.Stack,Rickshaw.Graph.Renderer.Line,Rickshaw.Graph.Renderer.Bar,Rickshaw.Graph.Renderer.Area,Rickshaw.Graph.Renderer.ScatterPlot];n.forEach(function(e){if(!e)return;t.registerRenderer(new e({graph:t}))}),this.setRenderer(e.renderer||"stack",e),this.discoverRange()},this.validateSeries=function(e){if(!(e instanceof Array||e instanceof Rickshaw.Series)){var t=Object.prototype.toString.apply(e);throw"series is not an array: "+t}var n;e.forEach(function(e){if(!(e instanceof Object))throw"series element is not an object: "+e;if(!e.data)throw"series has no data: "+JSON.stringify(e);if(!(e.data instanceof Array))throw"series data is not an array: "+JSON.stringify(e.data);var t=e.data[0].x,n=e.data[0].y;if(typeof t!="number"||typeof n!="number"&&n!==null)throw"x and y properties of points should be numbers instead of "+typeof t+" and "+typeof n},this)},this.dataDomain=function(){var e=this.series[0].data;return[e[0].x,e.slice(-1).shift().x]},this.discoverRange=function(){var e=this.renderer.domain();this.x=d3.scale.linear().domain(e.x).range([0,this.width]),this.y=d3.scale.linear().domain(e.y).range([this.height,0]),this.y.magnitude=d3.scale.linear().domain([e.y[0]-e.y[0],e.y[1]-e.y[0]]).range([0,this.height])},this.render=function(){var e=this.stackData();this.discoverRange(),this.renderer.render(),this.updateCallbacks.forEach(function(e){e()})},this.update=this.render,this.stackData=function(){var e=this.series.active().map(function(e){return e.data}).map(function(e){return e.filter(function(e){return this._slice(e)},this)},this);e=this.preserve?Rickshaw.clone(e):e,this.stackData.hooks.data.forEach(function(n){e=n.f.apply(t,[e])});var n;if(!this.renderer.unstack){this._validateStackable();var r=d3.layout.stack();r.offset(t.offset),n=r(e)}n=n||e,this.stackData.hooks.after.forEach(function(r){n=r.f.apply(t,[e])});var i=0;return this.series.forEach(function(e){if(e.disabled)return;e.stack=n[i++]}),this.stackedData=n,n},this._validateStackable=function(){var e=this.series,t;e.forEach(function(e){t=t||e.data.length;if(t&&e.data.length!=t)throw"stacked series cannot have differing numbers of points: "+t+" vs "+e.data.length+"; see Rickshaw.Series.fill()"},this)},this.stackData.hooks={data:[],after:[]},this._slice=function(e){if(this.window.xMin||this.window.xMax){var t=!0;return this.window.xMin&&e.x<this.window.xMin&&(t=!1),this.window.xMax&&e.x>this.window.xMax&&(t=!1),t}return!0},this.onUpdate=function(e){this.updateCallbacks.push(e)},this.registerRenderer=function(e){this._renderers=this._renderers||{},this._renderers[e.name]=e},this.configure=function(e){(e.width||e.height)&&this.setSize(e),Rickshaw.keys(this.defaults).forEach(function(t){this[t]=t in e?e[t]:t in this?this[t]:this.defaults[t]},this),this.setRenderer(e.renderer||this.renderer.name,e)},this.setRenderer=function(e,t){if(!this._renderers[e])throw"couldn't find renderer "+e;this.renderer=this._renderers[e],typeof t=="object"&&this.renderer.configure(t)},this.setSize=function(e){e=e||{};if(typeof window!==undefined)var t=window.getComputedStyle(this.element,null),n=parseInt(t.getPropertyValue("width"),10),r=parseInt(t.getPropertyValue("height"),10);this.width=e.width||n||400,this.height=e.height||r||250,this.vis&&this.vis.attr("width",this.width).attr("height",this.height)},this.initialize(e)},Rickshaw.namespace("Rickshaw.Fixtures.Color"),Rickshaw.Fixtures.Color=function(){this.schemes={},this.schemes.spectrum14=["#ecb796","#dc8f70","#b2a470","#92875a","#716c49","#d2ed82","#bbe468","#a1d05d","#e7cbe6","#d8aad6","#a888c2","#9dc2d3","#649eb9","#387aa3"].reverse(),this.schemes.spectrum2000=["#57306f","#514c76","#646583","#738394","#6b9c7d","#84b665","#a7ca50","#bfe746","#e2f528","#fff726","#ecdd00","#d4b11d","#de8800","#de4800","#c91515","#9a0000","#7b0429","#580839","#31082b"],this.schemes.spectrum2001=["#2f243f","#3c2c55","#4a3768","#565270","#6b6b7c","#72957f","#86ad6e","#a1bc5e","#b8d954","#d3e04e","#ccad2a","#cc8412","#c1521d","#ad3821","#8a1010","#681717","#531e1e","#3d1818","#320a1b"],this.schemes.classic9=["#423d4f","#4a6860","#848f39","#a2b73c","#ddcb53","#c5a32f","#7d5836","#963b20","#7c2626","#491d37","#2f254a"].reverse(),this.schemes.httpStatus={503:"#ea5029",502:"#d23f14",500:"#bf3613",410:"#efacea",409:"#e291dc",403:"#f457e8",408:"#e121d2",401:"#b92dae",405:"#f47ceb",404:"#a82a9f",400:"#b263c6",301:"#6fa024",302:"#87c32b",307:"#a0d84c",304:"#28b55c",200:"#1a4f74",206:"#27839f",201:"#52adc9",202:"#7c979f",203:"#a5b8bd",204:"#c1cdd1"},this.schemes.colorwheel=["#b5b6a9","#858772","#785f43","#96557e","#4682b4","#65b9ac","#73c03a","#cb513a"].reverse(),this.schemes.cool=["#5e9d2f","#73c03a","#4682b4","#7bc3b8","#a9884e","#c1b266","#a47493","#c09fb5"],this.schemes.munin=["#00cc00","#0066b3","#ff8000","#ffcc00","#330099","#990099","#ccff00","#ff0000","#808080","#008f00","#00487d","#b35a00","#b38f00","#6b006b","#8fb300","#b30000","#bebebe","#80ff80","#80c9ff","#ffc080","#ffe680","#aa80ff","#ee00cc","#ff8080","#666600","#ffbfff","#00ffcc","#cc6699","#999900"]},Rickshaw.namespace("Rickshaw.Fixtures.RandomData"),Rickshaw.Fixtures.RandomData=function(e){var t;e=e||1;var n=200,r=Math.floor((new Date).getTime()/1e3);this.addData=function(t){var i=Math.random()*100+15+n,s=t[0].length,o=1;t.forEach(function(t){var n=Math.random()*20,u=i/25+o++ +(Math.cos(s*o*11/960)+2)*15+(Math.cos(s/7)+2)*7+(Math.cos(s/17)+2)*1;t.push({x:s*e+r,y:u+n})}),n=i*.85}},Rickshaw.namespace("Rickshaw.Fixtures.Time"),Rickshaw.Fixtures.Time=function(){var e=(new Date).getTimezoneOffset()*60,t=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.units=[{name:"decade",seconds:315576e3,formatter:function(e){return parseInt(e.getUTCFullYear()/10,10)*10}},{name:"year",seconds:31557600,formatter:function(e){return e.getUTCFullYear()}},{name:"month",seconds:2635200,formatter:function(e){return t.months[e.getUTCMonth()]}},{name:"week",seconds:604800,formatter:function(e){return t.formatDate(e)}},{name:"day",seconds:86400,formatter:function(e){return e.getUTCDate()}},{name:"6 hour",seconds:21600,formatter:function(e){return t.formatTime(e)}},{name:"hour",seconds:3600,formatter:function(e){return t.formatTime(e)}},{name:"15 minute",seconds:900,formatter:function(e){return t.formatTime(e)}},{name:"minute",seconds:60,formatter:function(e){return e.getUTCMinutes()}},{name:"15 second",seconds:15,formatter:function(e){return e.getUTCSeconds()+"s"}},{name:"second",seconds:1,formatter:function(e){return e.getUTCSeconds()+"s"}}],this.unit=function(e){return this.units.filter(function(t){return e==t.name}).shift()},this.formatDate=function(e){return e.toUTCString().match(/, (\w+ \w+ \w+)/)[1]},this.formatTime=function(e){return e.toUTCString().match(/(\d+:\d+):/)[1]},this.ceil=function(e,t){var n,r;return t.name=="month"?(n=new Date((e+t.seconds-1)*1e3),r=new Date(0),r.setUTCFullYear(n.getUTCFullYear()),r.setUTCMonth(n.getUTCMonth()),r.setUTCDate(1),r.setUTCHours(0),r.setUTCMinutes(0),r.setUTCSeconds(0),r.setUTCMilliseconds(0),r.getTime()/1e3):t.name=="year"?(n=new Date((e+t.seconds-1)*1e3),r=new Date(0),r.setUTCFullYear(n.getUTCFullYear()),r.setUTCMonth(0),r.setUTCDate(1),r.setUTCHours(0),r.setUTCMinutes(0),r.setUTCSeconds(0),r.setUTCMilliseconds(0),r.getTime()/1e3):Math.ceil(e/t.seconds)*t.seconds}},Rickshaw.namespace("Rickshaw.Fixtures.Number"),Rickshaw.Fixtures.Number.formatKMBT=function(e){return abs_y=Math.abs(e),abs_y>=1e12?e/1e12+"T":abs_y>=1e9?e/1e9+"B":abs_y>=1e6?e/1e6+"M":abs_y>=1e3?e/1e3+"K":abs_y<1&&e>0?e.toFixed(2):abs_y===0?"":e},Rickshaw.Fixtures.Number.formatBase1024KMGTP=function(e){return abs_y=Math.abs(e),abs_y>=0x4000000000000?e/0x4000000000000+"P":abs_y>=1099511627776?e/1099511627776+"T":abs_y>=1073741824?e/1073741824+"G":abs_y>=1048576?e/1048576+"M":abs_y>=1024?e/1024+"K":abs_y<1&&e>0?e.toFixed(2):abs_y===0?"":e},Rickshaw.namespace("Rickshaw.Color.Palette"),Rickshaw.Color.Palette=function(e){var t=new Rickshaw.Fixtures.Color;e=e||{},this.schemes={},this.scheme=t.schemes[e.scheme]||e.scheme||t.schemes.colorwheel,this.runningIndex=0,this.generatorIndex=0;if(e.interpolatedStopCount){var n=this.scheme.length-1,r,i,s=[];for(r=0;r<n;r++){s.push(this.scheme[r]);var o=d3.interpolateHsl(this.scheme[r],this.scheme[r+1]);for(i=1;i<e.interpolatedStopCount;i++)s.push(o(1/e.interpolatedStopCount*i))}s.push(this.scheme[this.scheme.length-1]),this.scheme=s}this.rotateCount=this.scheme.length,this.color=function(e){return this.scheme[e]||this.scheme[this.runningIndex++]||this.interpolateColor()||"#808080"},this.interpolateColor=function(){if(!Array.isArray(this.scheme))return;var e;return this.generatorIndex==this.rotateCount*2-1?(e=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[0])(.5),this.generatorIndex=0,this.rotateCount*=2):(e=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[this.generatorIndex+1])(.5),this.generatorIndex++),this.scheme.push(e),e}},Rickshaw.namespace("Rickshaw.Graph.Ajax"),Rickshaw.Graph.Ajax=Rickshaw.Class.create({initialize:function(e){this.dataURL=e.dataURL,this.onData=e.onData||function(e){return e},this.onComplete=e.onComplete||function(){},this.onError=e.onError||function(){},this.args=e,this.request()},request:function(){$.ajax({url:this.dataURL,dataType:"json",success:this.success.bind(this),error:this.error.bind(this)})},error:function(){console.log("error loading dataURL: "+this.dataURL),this.onError(this)},success:function(e,t){e=this.onData(e),this.args.series=this._splice({data:e,series:this.args.series}),this.graph=this.graph||new Rickshaw.Graph(this.args),this.graph.render(),this.onComplete(this)},_splice:function(e){var t=e.data,n=e.series;return e.series?(n.forEach(function(e){var n=e.key||e.name;if(!n)throw"series needs a key or a name";t.forEach(function(t){var r=t.key||t.name;if(!r)throw"data needs a key or a name";if(n==r){var i=["color","name","data"];i.forEach(function(n){t[n]&&(e[n]=t[n])})}})}),n):t}}),Rickshaw.namespace("Rickshaw.Graph.Annotate"),Rickshaw.Graph.Annotate=function(e){var t=this.graph=e.graph;this.elements={timeline:e.element};var n=this;this.data={},this.elements.timeline.classList.add("rickshaw_annotation_timeline"),this.add=function(e,t,r){n.data[e]=n.data[e]||{boxes:[]},n.data[e].boxes.push({content:t,end:r})},this.update=function(){Rickshaw.keys(n.data).forEach(function(e){var t=n.data[e],r=n.graph.x(e);if(r<0||r>n.graph.x.range()[1]){t.element&&(t.line.classList.add("offscreen"),t.element.style.display="none"),t.boxes.forEach(function(e){e.rangeElement&&e.rangeElement.classList.add("offscreen")});return}if(!t.element){var i=t.element=document.createElement("div");i.classList.add("annotation"),this.elements.timeline.appendChild(i),i.addEventListener("click",function(e){i.classList.toggle("active"),t.line.classList.toggle("active"),t.boxes.forEach(function(e){e.rangeElement&&e.rangeElement.classList.toggle("active")})},!1)}t.element.style.left=r+"px",t.element.style.display="block",t.boxes.forEach(function(e){var i=e.element;i||(i=e.element=document.createElement("div"),i.classList.add("content"),i.innerHTML=e.content,t.element.appendChild(i),t.line=document.createElement("div"),t.line.classList.add("annotation_line"),n.graph.element.appendChild(t.line),e.end&&(e.rangeElement=document.createElement("div"),e.rangeElement.classList.add("annotation_range"),n.graph.element.appendChild(e.rangeElement)));if(e.end){var s=r,o=Math.min(n.graph.x(e.end),n.graph.x.range()[1]);s>o&&(o=r,s=Math.max(n.graph.x(e.end),n.graph.x.range()[0]));var u=o-s;e.rangeElement.style.left=s+"px",e.rangeElement.style.width=u+"px",e.rangeElement.classList.remove("offscreen")}t.line.classList.remove("offscreen"),t.line.style.left=r+"px"})},this)},this.graph.onUpdate(function(){n.update()})},Rickshaw.namespace("Rickshaw.Graph.Axis.Time"),Rickshaw.Graph.Axis.Time=function(e){var t=this;this.graph=e.graph,this.elements=[],this.ticksTreatment=e.ticksTreatment||"plain",this.fixedTimeUnit=e.timeUnit;var n=new Rickshaw.Fixtures.Time;this.appropriateTimeUnit=function(){var e,t=n.units,r=this.graph.x.domain(),i=r[1]-r[0];return t.forEach(function(t){Math.floor(i/t.seconds)>=2&&(e=e||t)}),e||n.units[n.units.length-1]},this.tickOffsets=function(){var e=this.graph.x.domain(),t=this.fixedTimeUnit||this.appropriateTimeUnit(),r=Math.ceil((e[1]-e[0])/t.seconds),i=e[0],s=[];for(var o=0;o<r;o++){var u=n.ceil(i,t);i=u+t.seconds/2,s.push({value:u,unit:t})}return s},this.render=function(){this.elements.forEach(function(e){e.parentNode.removeChild(e)}),this.elements=[];var e=this.tickOffsets();e.forEach(function(e){if(t.graph.x(e.value)>t.graph.x.range()[1])return;var n=document.createElement("div");n.style.left=t.graph.x(e.value)+"px",n.classList.add("x_tick"),n.classList.add(t.ticksTreatment);var r=document.createElement("div");r.classList.add("title"),r.innerHTML=e.unit.formatter(new Date(e.value*1e3)),n.appendChild(r),t.graph.element.appendChild(n),t.elements.push(n)})},this.graph.onUpdate(function(){t.render()})},Rickshaw.namespace("Rickshaw.Graph.Axis.X"),Rickshaw.Graph.Axis.X=function(e){var t=this,n=.1;this.initialize=function(e){this.graph=e.graph,this.orientation=e.orientation||"top";var n=e.pixelsPerTick||75;this.ticks=e.ticks||Math.floor(this.graph.width/n),this.tickSize=e.tickSize||4,this.ticksTreatment=e.ticksTreatment||"plain",e.element?(this.element=e.element,this._discoverSize(e.element,e),this.vis=d3.select(e.element).append("svg:svg").attr("height",this.height).attr("width",this.width).attr("class","rickshaw_graph x_axis_d3"),this.element=this.vis[0][0],this.element.style.position="relative",this.setSize({width:e.width,height:e.height})):this.vis=this.graph.vis,this.graph.onUpdate(function(){t.render()})},this.setSize=function(e){e=e||{};if(!this.element)return;this._discoverSize(this.element.parentNode,e),this.vis.attr("height",this.height).attr("width",this.width*(1+n));var t=Math.floor(this.width*n/2);this.element.style.left=-1*t+"px"},this.render=function(){this.graph.width!==this._renderWidth&&this.setSize({auto:!0});var t=d3.svg.axis().scale(this.graph.x).orient(this.orientation);t.tickFormat(e.tickFormat||function(e){return e});var r=Math.floor(this.width*n/2)||0,i;if(this.orientation=="top"){var s=this.height||this.graph.height;i="translate("+r+","+s+")"}else i="translate("+r+", 0)";this.element&&this.vis.selectAll("*").remove(),this.vis.append("svg:g").attr("class",["x_ticks_d3",this.ticksTreatment].join(" ")).attr("transform",i).call(t.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var o=(this.orientation=="bottom"?1:-1)*this.graph.height;this.graph.vis.append("svg:g").attr("class","x_grid_d3").call(t.ticks(this.ticks).tickSubdivide(0).tickSize(o)),this._renderHeight=this.graph.height},this._discoverSize=function(e,t){if(typeof window!="undefined"){var r=window.getComputedStyle(e,null),i=parseInt(r.getPropertyValue("height"),10);if(!t.auto)var s=parseInt(r.getPropertyValue("width"),10)}this.width=(t.width||s||this.graph.width)*(1+n),this.height=t.height||i||40},this.initialize(e)},Rickshaw.namespace("Rickshaw.Graph.Axis.Y"),Rickshaw.Graph.Axis.Y=function(e){var t=this,n=.1;this.initialize=function(e){this.graph=e.graph,this.orientation=e.orientation||"right";var n=e.pixelsPerTick||75;this.ticks=e.ticks||Math.floor(this.graph.height/n),this.tickSize=e.tickSize||4,this.ticksTreatment=e.ticksTreatment||"plain",e.element?(this.element=e.element,this.vis=d3.select(e.element).append("svg:svg").attr("class","rickshaw_graph y_axis"),this.element=this.vis[0][0],this.element.style.position="relative",this.setSize({width:e.width,height:e.height})):this.vis=this.graph.vis,this.graph.onUpdate(function(){t.render()})},this.setSize=function(e){e=e||{};if(!this.element)return;if(typeof window!="undefined"){var t=window.getComputedStyle(this.element.parentNode,null),r=parseInt(t.getPropertyValue("width"),10);if(!e.auto)var i=parseInt(t.getPropertyValue("height"),10)}this.width=e.width||r||this.graph.width*n,this.height=e.height||i||this.graph.height,this.vis.attr("width",this.width).attr("height",this.height*(1+n));var s=this.height*n;this.element.style.top=-1*s+"px"},this.render=function(){this.graph.height!==this._renderHeight&&this.setSize({auto:!0});var t=d3.svg.axis().scale(this.graph.y).orient(this.orientation);t.tickFormat(e.tickFormat||function(e){return e});if(this.orientation=="left")var r=this.height*n,i="translate("+this.width+", "+r+")";this.element&&this.vis.selectAll("*").remove(),this.vis.append("svg:g").attr("class",["y_ticks",this.ticksTreatment].join(" ")).attr("transform",i).call(t.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var s=(this.orientation=="right"?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(t.ticks(this.ticks).tickSubdivide(0).tickSize(s)),this._renderHeight=this.graph.height},this.initialize(e)},Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Highlight"),Rickshaw.Graph.Behavior.Series.Highlight=function(e){this.graph=e.graph,this.legend=e.legend;var t=this,n={},r=null;this.addHighlightEvents=function(e){e.element.addEventListener("mouseover",function(i){if(r)return;r=e,t.legend.lines.forEach(function(r,i){if(e===r){if(i>0&&t.graph.renderer.unstack){var s=t.graph.series.length-i-1;r.originalIndex=s;var o=t.graph.series.splice(s,1)[0];t.graph.series.push(o)}return}n[r.series.name]=n[r.series.name]||r.series.color,r.series.color=d3.interpolateRgb(r.series.color,d3.rgb("#d8d8d8"))(.8).toString()}),t.graph.update()},!1),e.element.addEventListener("mouseout",function(i){if(!r)return;r=null,t.legend.lines.forEach(function(r){if(e===r&&r.hasOwnProperty("originalIndex")){var i=t.graph.series.pop();t.graph.series.splice(r.originalIndex,0,i),delete r.originalIndex}n[r.series.name]&&(r.series.color=n[r.series.name])}),t.graph.update()},!1)},this.legend&&this.legend.lines.forEach(function(e){t.addHighlightEvents(e)})},Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Order"),Rickshaw.Graph.Behavior.Series.Order=function(e){this.graph=e.graph,this.legend=e.legend;var t=this;if(typeof window.$=="undefined")throw"couldn't find jQuery at window.$";if(typeof window.$.ui=="undefined")throw"couldn't find jQuery UI at window.$.ui";$(function(){$(t.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(e,n){var r=[];$(t.legend.list).find("li").each(function(e,t){if(!t.series)return;r.push(t.series)});for(var i=t.graph.series.length-1;i>=0;i--)t.graph.series[i]=r.shift();t.graph.update()}}),$(t.legend.list).disableSelection()}),this.graph.onUpdate(function(){var e=window.getComputedStyle(t.legend.element).height;t.legend.element.style.height=e})},Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Toggle"),Rickshaw.Graph.Behavior.Series.Toggle=function(e){this.graph=e.graph,this.legend=e.legend;var t=this;this.addAnchor=function(e){var n=document.createElement("a");n.innerHTML="&#10004;",n.classList.add("action"),e.element.insertBefore(n,e.element.firstChild),n.onclick=function(t){e.series.disabled?(e.series.enable(),e.element.classList.remove("disabled")):(e.series.disable(),e.element.classList.add("disabled"))};var r=e.element.getElementsByTagName("span")[0];r.onclick=function(n){var r=e.series.disabled;if(!r)for(var i=0;i<t.legend.lines.length;i++){var s=t.legend.lines[i];if(e.series!==s.series&&!s.series.disabled){r=!0;break}}r?(e.series.enable(),e.element.classList.remove("disabled"),t.legend.lines.forEach(function(t){e.series!==t.series&&(t.series.disable(),t.element.classList.add("disabled"))})):t.legend.lines.forEach(function(e){e.series.enable(),e.element.classList.remove("disabled")})}},this.legend&&(typeof $!="undefined"&&$(this.legend.list).sortable&&$(this.legend.list).sortable({start:function(e,t){t.item.bind("no.onclick",function(e){e.preventDefault()})},stop:function(e,t){setTimeout(function(){t.item.unbind("no.onclick")},250)}}),this.legend.lines.forEach(function(e){t.addAnchor(e)})),this._addBehavior=function(){this.graph.series.forEach(function(e){e.disable=function(){if(t.graph.series.length<=1)throw"only one series left";e.disabled=!0,t.graph.update()},e.enable=function(){e.disabled=!1,t.graph.update()}})},this._addBehavior(),this.updateBehaviour=function(){this._addBehavior()}},Rickshaw.namespace("Rickshaw.Graph.HoverDetail"),Rickshaw.Graph.HoverDetail=Rickshaw.Class.create({initialize:function(e){var t=this.graph=e.graph;this.xFormatter=e.xFormatter||function(e){return(new Date(e*1e3)).toUTCString()},this.yFormatter=e.yFormatter||function(e){return e===null?e:e.toFixed(2)};var n=this.element=document.createElement("div");n.className="detail",this.visible=!0,t.element.appendChild(n),this.lastEvent=null,this._addListeners(),this.onShow=e.onShow,this.onHide=e.onHide,this.onRender=e.onRender,this.formatter=e.formatter||this.formatter},formatter:function(e,t,n,r,i,s){return e.name+":&nbsp;"+i},update:function(e){e=e||this.lastEvent;if(!e)return;this.lastEvent=e;if(!e.target.nodeName.match(/^(path|svg|rect)$/))return;var t=this.graph,n=e.offsetX||e.layerX,r=e.offsetY||e.layerY,i=0,s=[],o;this.graph.series.active().forEach(function(e){var u=this.graph.stackedData[i++],a=t.x.invert(n),f=d3.scale.linear().domain([u[0].x,u.slice(-1)[0].x]).range([0,u.length-1]),l=Math.round(f(a)),c=Math.min(l||0,u.length-1);for(var h=l;h<u.length-1;){if(!u[h]||!u[h+1])break;if(u[h].x<=a&&u[h+1].x>a){c=h;break}u[h+1].x<=a?h++:h--}c<0&&(c=0);var p=u[c],d=Math.sqrt(Math.pow(Math.abs(t.x(p.x)-n),2)+Math.pow(Math.abs(t.y(p.y+p.y0)-r),2)),v=e.xFormatter||this.xFormatter,m=e.yFormatter||this.yFormatter,g={formattedXValue:v(p.x),formattedYValue:m(p.y),series:e,value:p,distance:d,order:i,name:e.name};if(!o||d<o.distance)o=g;s.push(g)},this),o.active=!0;var u=o.value.x,a=o.formattedXValue;this.element.innerHTML="",this.element.style.left=t.x(u)+"px",this.visible&&this.render({points:s,detail:s,mouseX:n,mouseY:r,formattedXValue:a,domainX:u})},hide:function(){this.visible=!1,this.element.classList.add("inactive"),typeof this.onHide=="function"&&this.onHide()},show:function(){this.visible=!0,this.element.classList.remove("inactive"),typeof this.onShow=="function"&&this.onShow()},render:function(e){var t=this.graph,n=e.points,r=n.filter(function(e){return e.active}).shift();if(r.value.y===null)return;var i=this.xFormatter(r.value.x),s=this.yFormatter(r.value.y);this.element.innerHTML="",this.element.style.left=t.x(r.value.x)+"px";var o=document.createElement("div");o.className="x_label",o.innerHTML=i,this.element.appendChild(o);var u=document.createElement("div");u.className="item",u.innerHTML=this.formatter(r.series,r.value.x,r.value.y,i,s,r),u.style.top=this.graph.y(r.value.y0+r.value.y)+"px",this.element.appendChild(u);var a=document.createElement("div");a.className="dot",a.style.top=u.style.top,a.style.borderColor=r.series.color,this.element.appendChild(a),r.active&&(u.className="item active",a.className="dot active"),this.show(),typeof this.onRender=="function"&&this.onRender(e)},_addListeners:function(){this.graph.element.addEventListener("mousemove",function(e){this.visible=!0,this.update(e)}.bind(this),!1),this.graph.onUpdate(function(){this.update()}.bind(this)),this.graph.element.addEventListener("mouseout",function(e){e.relatedTarget&&!(e.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS)&&this.hide()}.bind(this),!1)}}),Rickshaw.namespace("Rickshaw.Graph.JSONP"),Rickshaw.Graph.JSONP=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){$.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}}),Rickshaw.namespace("Rickshaw.Graph.Legend"),Rickshaw.Graph.Legend=function(e){var t=this.element=e.element,n=this.graph=e.graph,r=this;t.classList.add("rickshaw_legend");var i=this.list=document.createElement("ul");t.appendChild(i);var s=n.series.map(function(e){return e});e.naturalOrder||(s=s.reverse()),this.lines=[],this.addLine=function(e){var t=document.createElement("li");t.className="line",e.disabled&&(t.className+=" disabled");var n=document.createElement("div");n.className="swatch",n.style.backgroundColor=e.color,t.appendChild(n);var s=document.createElement("span");s.className="label",s.innerHTML=e.name,t.appendChild(s),i.appendChild(t),t.series=e,e.noLegend&&(t.style.display="none");var o={element:t,series:e};r.shelving&&(r.shelving.addAnchor(o),r.shelving.updateBehaviour()),r.highlighter&&r.highlighter.addHighlightEvents(o),r.lines.push(o)},s.forEach(function(e){r.addLine(e)}),n.onUpdate(function(){})},Rickshaw.namespace("Rickshaw.Graph.RangeSlider"),Rickshaw.Graph.RangeSlider=Rickshaw.Class.create({initialize:function(e){var t=this.element=e.element,n=this.graph=e.graph;this.build(),n.onUpdate(function(){this.update()}.bind(this))},build:function(){var e=this.element,t=this.graph;$(function(){$(e).slider({range:!0,min:t.dataDomain()[0],max:t.dataDomain()[1],values:[t.dataDomain()[0],t.dataDomain()[1]],slide:function(e,n){t.window.xMin=n.values[0],t.window.xMax=n.values[1],t.update(),t.dataDomain()[0]==n.values[0]&&(t.window.xMin=undefined),t.dataDomain()[1]==n.values[1]&&(t.window.xMax=undefined)}})}),e[0].style.width=t.width+"px"},update:function(){var e=this.element,t=this.graph,n=$(e).slider("option","values");$(e).slider("option","min",t.dataDomain()[0]),$(e).slider("option","max",t.dataDomain()[1]),t.window.xMin==null&&(n[0]=t.dataDomain()[0]),t.window.xMax==null&&(n[1]=t.dataDomain()[1]),$(e).slider("option","values",n)}}),Rickshaw.namespace("Rickshaw.Graph.Renderer"),Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(e){this.graph=e.graph,this.tension=e.tension||this.tension,this.graph.unstacker=this.graph.unstacker||new Rickshaw.Graph.Unstacker({graph:this.graph}),this.configure(e)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:!0,padding:{top:.01,right:0,bottom:.01,left:0},stroke:!1,fill:!1}},domain:function(){var e={xMin:[],xMax:[],y:[]},t=this.graph.stackedData||this.graph.stackData(),n=t[0][0],r=n.x,i=n.x,s=n.y+n.y0,o=n.y+n.y0;t.forEach(function(e){e.forEach(function(e){if(e.y==null)return;var t=e.y+e.y0;t<s&&(s=t),t>o&&(o=t)}),e[0].x<r&&(r=e[0].x),e[e.length-1].x>i&&(i=e[e.length-1].x)}),r-=(i-r)*this.padding.left,i+=(i-r)*this.padding.right,s=this.graph.min==="auto"?s:this.graph.min||0,o=this.graph.max===undefined?o:this.graph.max;if(this.graph.min==="auto"||s<0)s-=(o-s)*this.padding.bottom;return this.graph.max===undefined&&(o+=(o-s)*this.padding.top),{x:[r,i],y:[s,o]}},render:function(){var e=this.graph;e.vis.selectAll("*").remove();var t=e.vis.selectAll("path").data(this.graph.stackedData).enter().append("svg:path").attr("d",this.seriesPathFactory()),n=0;e.series.forEach(function(e){if(e.disabled)return;e.path=t[0][n++],this._styleSeries(e)},this)},_styleSeries:function(e){var t=this.fill?e.color:"none",n=this.stroke?e.color:"none";e.path.setAttribute("fill",t),e.path.setAttribute("stroke",n),e.path.setAttribute("stroke-width",this.strokeWidth),e.path.setAttribute("class",e.className)},configure:function(e){e=e||{},Rickshaw.keys(this.defaults()).forEach(function(t){if(!e.hasOwnProperty(t)){this[t]=this[t]||this.graph[t]||this.defaults()[t];return}typeof this.defaults()[t]=="object"?Rickshaw.keys(this.defaults()[t]).forEach(function(n){this[t][n]=e[t][n]!==undefined?e[t][n]:this[t][n]!==undefined?this[t][n]:this.defaults()[t][n]},this):this[t]=e[t]!==undefined?e[t]:this[t]!==undefined?this[t]:this.graph[t]!==undefined?this.graph[t]:this.defaults()[t]},this)},setStrokeWidth:function(e){e!==undefined&&(this.strokeWidth=e)},setTension:function(e){e!==undefined&&(this.tension=e)}}),Rickshaw.namespace("Rickshaw.Graph.Renderer.Line"),Rickshaw.Graph.Renderer.Line=Rickshaw
8.Class.create(Rickshaw.Graph.Renderer,{name:"line",defaults:function($super){return Rickshaw.extend($super(),{unstack:!0,fill:!1,stroke:!0})},seriesPathFactory:function(){var e=this.graph,t=d3.svg.line().x(function(t){return e.x(t.x)}).y(function(t){return e.y(t.y)}).interpolate(this.graph.interpolation).tension(this.tension);return t.defined&&t.defined(function(e){return e.y!==null}),t}}),Rickshaw.namespace("Rickshaw.Graph.Renderer.Stack"),Rickshaw.Graph.Renderer.Stack=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"stack",defaults:function($super){return Rickshaw.extend($super(),{fill:!0,stroke:!1,unstack:!1})},seriesPathFactory:function(){var e=this.graph,t=d3.svg.area().x(function(t){return e.x(t.x)}).y0(function(t){return e.y(t.y0)}).y1(function(t){return e.y(t.y+t.y0)}).interpolate(this.graph.interpolation).tension(this.tension);return t.defined&&t.defined(function(e){return e.y!==null}),t}}),Rickshaw.namespace("Rickshaw.Graph.Renderer.Bar"),Rickshaw.Graph.Renderer.Bar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"bar",defaults:function($super){var e=Rickshaw.extend($super(),{gapSize:.05,unstack:!1});return delete e.tension,e},initialize:function($super,e){e=e||{},this.gapSize=e.gapSize||this.gapSize,$super(e)},domain:function($super){var e=$super(),t=this._frequentInterval();return e.x[1]+=parseInt(t.magnitude,10),e},barWidth:function(){var e=this.graph.stackedData||this.graph.stackData(),t=e.slice(-1).shift(),n=this._frequentInterval(),r=this.graph.x(t[0].x+n.magnitude*(1-this.gapSize));return r},render:function(){var e=this.graph;e.vis.selectAll("*").remove();var t=this.barWidth(),n=0,r=e.series.filter(function(e){return!e.disabled}).length,i=this.unstack?t/r:t,s=function(t){var n=[1,0,0,t.y<0?-1:1,0,t.y<0?e.y.magnitude(Math.abs(t.y))*2:0];return"matrix("+n.join(",")+")"};e.series.forEach(function(t){if(t.disabled)return;var r=e.vis.selectAll("path").data(t.stack.filter(function(e){return e.y!==null})).enter().append("svg:rect").attr("x",function(t){return e.x(t.x)+n}).attr("y",function(t){return e.y(t.y0+Math.abs(t.y))*(t.y<0?-1:1)}).attr("width",i).attr("height",function(t){return e.y.magnitude(Math.abs(t.y))}).attr("transform",s);Array.prototype.forEach.call(r[0],function(e){e.setAttribute("fill",t.color)}),this.unstack&&(n+=i)},this)},_frequentInterval:function(){var e=this.graph.stackedData||this.graph.stackData(),t=e.slice(-1).shift(),n={};for(var r=0;r<t.length-1;r++){var i=t[r+1].x-t[r].x;n[i]=n[i]||0,n[i]++}var s={count:0};return Rickshaw.keys(n).forEach(function(e){s.count<n[e]&&(s={count:n[e],magnitude:e})}),this._frequentInterval=function(){return s},s}}),Rickshaw.namespace("Rickshaw.Graph.Renderer.Area"),Rickshaw.Graph.Renderer.Area=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"area",defaults:function($super){return Rickshaw.extend($super(),{unstack:!1,fill:!1,stroke:!1})},seriesPathFactory:function(){var e=this.graph,t=d3.svg.area().x(function(t){return e.x(t.x)}).y0(function(t){return e.y(t.y0)}).y1(function(t){return e.y(t.y+t.y0)}).interpolate(e.interpolation).tension(this.tension);return t.defined&&t.defined(function(e){return e.y!==null}),t},seriesStrokeFactory:function(){var e=this.graph,t=d3.svg.line().x(function(t){return e.x(t.x)}).y(function(t){return e.y(t.y+t.y0)}).interpolate(e.interpolation).tension(this.tension);return t.defined&&t.defined(function(e){return e.y!==null}),t},render:function(){var e=this.graph;e.vis.selectAll("*").remove();var t=this.unstack?"append":"insert",n=e.vis.selectAll("path").data(this.graph.stackedData).enter()[t]("svg:g","g");n.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area"),this.stroke&&n.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line");var r=0;e.series.forEach(function(e){if(e.disabled)return;e.path=n[0][r++],this._styleSeries(e)},this)},_styleSeries:function(e){if(!e.path)return;d3.select(e.path).select(".area").attr("fill",e.color),this.stroke&&d3.select(e.path).select(".line").attr("fill","none").attr("stroke",e.stroke||d3.interpolateRgb(e.color,"black")(.125)).attr("stroke-width",this.strokeWidth),e.className&&e.path.setAttribute("class",e.className)}}),Rickshaw.namespace("Rickshaw.Graph.Renderer.ScatterPlot"),Rickshaw.Graph.Renderer.ScatterPlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"scatterplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:!0,fill:!0,stroke:!1,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,e){$super(e)},render:function(){var e=this.graph;e.vis.selectAll("*").remove(),e.series.forEach(function(t){if(t.disabled)return;var n=e.vis.selectAll("path").data(t.stack.filter(function(e){return e.y!==null})).enter().append("svg:circle").attr("cx",function(t){return e.x(t.x)}).attr("cy",function(t){return e.y(t.y)}).attr("r",function(t){return"r"in t?t.r:e.renderer.dotSize});Array.prototype.forEach.call(n[0],function(e){e.setAttribute("fill",t.color)})},this)}}),Rickshaw.namespace("Rickshaw.Graph.Smoother"),Rickshaw.Graph.Smoother=Rickshaw.Class.create({initialize:function(e){this.graph=e.graph,this.element=e.element,this.aggregationScale=1,this.build(),this.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:this.transformer.bind(this)})},build:function(){var e=this;this.element&&$(function(){$(e.element).slider({min:1,max:100,slide:function(t,n){e.setScale(n.value),e.graph.update()}})})},setScale:function(e){if(e<1)throw"scale out of range: "+e;this.aggregationScale=e,this.graph.update()},transformer:function(e){if(this.aggregationScale==1)return e;var t=[];return e.forEach(function(e){var n=[];while(e.length){var r=0,i=0,s=e.splice(0,this.aggregationScale);s.forEach(function(e){r+=e.x/s.length,i+=e.y/s.length}),n.push({x:r,y:i})}t.push(n)}.bind(this)),t}}),Rickshaw.namespace("Rickshaw.Graph.Unstacker"),Rickshaw.Graph.Unstacker=function(e){this.graph=e.graph;var t=this;this.graph.stackData.hooks.after.push({name:"unstacker",f:function(e){return t.graph.renderer.unstack?(e.forEach(function(e){e.forEach(function(e){e.y0=0})}),e):e}})},Rickshaw.namespace("Rickshaw.Series"),Rickshaw.Series=Rickshaw.Class.create(Array,{initialize:function(e,t,n){n=n||{},this.palette=new Rickshaw.Color.Palette(t),this.timeBase=typeof n.timeBase=="undefined"?Math.floor((new Date).getTime()/1e3):n.timeBase;var r=typeof n.timeInterval=="undefined"?1e3:n.timeInterval;this.setTimeInterval(r),e&&typeof e=="object"&&e instanceof Array&&e.forEach(function(e){this.addItem(e)},this)},addItem:function(e){if(typeof e.name=="undefined")throw"addItem() needs a name";e.color=e.color||this.palette.color(e.name),e.data=e.data||[],e.data.length===0&&this.length&&this.getIndex()>0?this[0].data.forEach(function(t){e.data.push({x:t.x,y:0})}):e.data.length===0&&e.data.push({x:this.timeBase-(this.timeInterval||0),y:0}),this.push(e),this.legend&&this.legend.addLine(this.itemByName(e.name))},addData:function(e){var t=this.getIndex();Rickshaw.keys(e).forEach(function(e){this.itemByName(e)||this.addItem({name:e})},this),this.forEach(function(n){n.data.push({x:(t*this.timeInterval||1)+this.timeBase,y:e[n.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(e){for(var t=0;t<this.length;t++)if(this[t].name==e)return this[t]},setTimeInterval:function(e){this.timeInterval=e/1e3},setTimeBase:function(e){this.timeBase=e},dump:function(){var e={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};return this.forEach(function(t){var n={color:t.color,name:t.name,data:[]};t.data.forEach(function(e){n.data.push({x:e.x,y:e.y})}),e.items.push(n)}),e},load:function(e){e.timeInterval&&(this.timeInterval=e.timeInterval),e.timeBase&&(this.timeBase=e.timeBase),e.items&&e.items.forEach(function(e){this.push(e),this.legend&&this.legend.addLine(this.itemByName(e.name))},this)}}),Rickshaw.Series.zeroFill=function(e){Rickshaw.Series.fill(e,0)},Rickshaw.Series.fill=function(e,t){var n,r=0,i=e.map(function(e){return e.data});while(r<Math.max.apply(null,i.map(function(e){return e.length})))n=Math.min.apply(null,i.filter(function(e){return e[r]}).map(function(e){return e[r].x})),i.forEach(function(e){(!e[r]||e[r].x!=n)&&e.splice(r,0,{x:n,y:t})}),r++},Rickshaw.namespace("Rickshaw.Series.FixedDuration"),Rickshaw.Series.FixedDuration=Rickshaw.Class.create(Rickshaw.Series,{initialize:function(e,t,n){n=n||{};if(typeof n.timeInterval=="undefined")throw new Error("FixedDuration series requires timeInterval");if(typeof n.maxDataPoints=="undefined")throw new Error("FixedDuration series requires maxDataPoints");this.palette=new Rickshaw.Color.Palette(t),this.timeBase=typeof n.timeBase=="undefined"?Math.floor((new Date).getTime()/1e3):n.timeBase,this.setTimeInterval(n.timeInterval),this[0]&&this[0].data&&this[0].data.length?(this.currentSize=this[0].data.length,this.currentIndex=this[0].data.length):(this.currentSize=0,this.currentIndex=0),this.maxDataPoints=n.maxDataPoints,e&&typeof e=="object"&&e instanceof Array&&(e.forEach(function(e){this.addItem(e)},this),this.currentSize+=1,this.currentIndex+=1),this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval;if(typeof this.maxDataPoints!="undefined"&&this.currentSize<this.maxDataPoints)for(var r=this.maxDataPoints-this.currentSize-1;r>0;r--)this.currentSize+=1,this.currentIndex+=1,this.forEach(function(e){e.data.unshift({x:((r-1)*this.timeInterval||1)+this.timeBase,y:0,i:r})},this)},addData:function($super,e){$super(e),this.currentSize+=1,this.currentIndex+=1;if(this.maxDataPoints!==undefined)while(this.currentSize>this.maxDataPoints)this.dropData()},dropData:function(){this.forEach(function(e){e.data.splice(0,1)}),this.currentSize-=1},getIndex:function(){return this.currentIndex}});
Indexing.scala https://github.com/pmanvi/scalastic.git | Scala | 439 lines
94    request.setParent(parent)
95    consistencyLevel foreach { request.setConsistencyLevel(_) }
96    contentType foreach { request.setContentType(_) }
96    contentType foreach { request.setContentType(_) }
97    create foreach { request.setCreate(_) }
98    listenerThreaded foreach { request.setListenerThreaded(_) }
98    listenerThreaded foreach { request.setListenerThreaded(_) }
99    operationThreaded foreach { request.setOperationThreaded(_) }
100    opType foreach { request.setOpType(_) }
100    opType foreach { request.setOpType(_) }
101    percolate foreach { request.setPercolate(_) }
102    refresh foreach { request.setRefresh(_) }
102    refresh foreach { request.setRefresh(_) }
103    replicationType foreach { request.setReplicationType(_) }
104    routing foreach { request.setRouting(_) }
IndexCrud.scala https://github.com/pmanvi/scalastic.git | Scala | 522 lines
56    if (!settings.isEmpty) request.setSettings(settingsBuilder.put(settings).build())
57    mappings foreach { case (kind, mapping) => request.addMapping(kind, mapping) }
58    cause foreach { request.setCause(_) }
58    cause foreach { request.setCause(_) }
59    timeout foreach { request.setTimeout(_) }
60    request
69    val request = client.admin.indices.prepareDelete(indices.toArray: _*)
70    timeout foreach { request.setTimeout(_) }
71    request
126    val request = client.admin.indices.prepareAliases
127    actions foreach { request.addAliasAction(_) }
128    indices foreach {
133    }
134    timeout foreach { each => request.setTimeout(parseTimeValue(each, null)) }
135    request
Searching.scala https://github.com/pmanvi/scalastic.git | Scala | 442 lines
43      val builder = fieldSort(field)
44      ignoreUnmapped.foreach { builder.ignoreUnmapped(_) }
45      missing.foreach { builder.missing(_) }
54      val builder = scriptSort(script, `type`)
55      lang foreach { builder.lang(_) }
56      parameters foreach { case (key, value) => builder.param(key, value) }
62      val builder = geoDistanceSort(field)
63      geoDistance foreach { builder.geoDistance(_) }
64      geohash foreach { builder.geohash(_) }
64      geohash foreach { builder.geohash(_) }
65      geoPoint foreach { each => builder.point(each.lat, each.lon) }
66      unit foreach { builder.unit(_) }
88    def setIn(request: SearchRequestBuilder) {
89      fields foreach { f =>
90        f match {
Flow.php https://github.com/polokk/tudu-web-1.git | PHP | 1,988 lines
106
107        foreach ($users as $key => $item) {
108            $user = $addressBook->searchUser($orgId, $item['email']);
148        $count = 0;
149        foreach ($users as $item) {
150            $processIndex = isset($item['processindex'])
250        $removes = array();
251        foreach ($currentUsers as $item) {
252            list($email, $trueName) = explode(' ', $item['userinfo'], 2);
275
276        foreach ($users as $k => $item) {
277            $users[$k]['processindex'] = $users[$k]['processindex'] + $processIndex;
347
348        foreach ($users as $item) {
349            list($email, $trueName) = explode(' ', $item['userinfo'], 2);
GraphGenerators.pm https://github.com/mkosola/sp-endurance.git | Perl | 2,783 lines
63    my $plot = shift;
64    foreach ($plot->done_plotting) {
65        push @plots, $_;
131    );
132    foreach my $key (qw/SwapCached MemFree Cached Active(file)
133                Inactive(file) Active(anon) Inactive(anon) Shmem/) {
160
161    foreach my $key (qw/Dirty Buffers Mlocked PageTables KernelStack
162                SReclaimable SUnreclaim/) {
175            if (exists $_->{'/usr/bin/xmeminfo'}) {
176                foreach my $xmem_entry (@{$_->{'/usr/bin/xmeminfo'}}) {
177                    $sum += $xmem_entry->{Pixmap_mem}
203
204    foreach my $slab (@slabs) {
205        $plot->push(
product.php https://github.com/fxiao/shopilex.git | PHP | 796 lines
12
13		foreach ($data['product_description'] as $language_id => $value) {
14			if($this->config->get('config_language_id')==$language_id)
19		if (isset($data['product_store'])) {
20			foreach ($data['product_store'] as $store_id) {
21				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_store SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "'");
25		if (isset($data['product_attribute'])) {
26			foreach ($data['product_attribute'] as $product_attribute) {
27				if ($product_attribute['attribute_id']) {
29
30					foreach ($product_attribute['product_attribute_description'] as $language_id => $product_attribute_description) {
31						$this->db->query("INSERT INTO " . DB_PREFIX . "product_attribute SET product_id = '" . (int)$product_id . "', attribute_id = '" . (int)$product_attribute['attribute_id'] . "', language_id = '" . (int)$language_id . "', text = '" .  $this->db->escape($product_attribute_description['text']) . "'");
37		if (isset($data['product_option'])) {
38			foreach ($data['product_option'] as $product_option) {
39				if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox') {
kernel-doc https://github.com/badwtg1111/mylinuxkernel.git | Perl | 2,112 lines
359my $dohighlight = "";
360foreach my $pattern (keys %highlights) {
361#   print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n";
450
451    foreach $line (split "\n", $contents) {
452	if ($line eq ""){
470
471    foreach $section (@{$args{'sectionlist'}}) {
472	print "<h3>$section</h3>\n";
487    $count = 0;
488    foreach $parameter (@{$args{'parameterlist'}}) {
489	print " <b>".$parameter."</b>";
499    print "<dl>\n";
500    foreach $parameter (@{$args{'parameterlist'}}) {
501	print "<dt><b>".$parameter."</b>\n";
ServerManager.pm https://github.com/luismottacampos/mha4mysql-manager.git | Perl | 1,439 lines
165  $self->{unmanaged_slaves} = [];
166  foreach my $server (@servers) {
167
230  );
231  foreach my $target (@servers) {
232    unless ( $target->{logger} ) {
266
267  foreach my $target (@servers) {
268    next if ( $target->{dead} );
280  my $oldest_version;
281  foreach my $server (@servers) {
282    if ( $server->{oldest_major_version} ) {
295  my $min_major_version;
296  foreach (@servers) {
297    my $dbhelper = $_->{dbhelper};
tests.mk https://github.com/dardevelin/rust.git | Unknown | 929 lines
121
122$(foreach target,$(CFG_TARGET), \
123  $(eval $(call DEF_TARGET_COMMANDS,$(target))))
130
131$(foreach target,$(CFG_TARGET), \
132  $(if $(findstring $(target),"arm-linux-androideabi"), \
154 $(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
155 $(foreach crate,$(TARGET_CRATES),\
156    $(shell $(CFG_ADB) push $(TLIB2_T_arm-linux-androideabi_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_arm-linux-androideabi,$(crate)) \
173check-lite: cleantestlibs cleantmptestlogs \
174	$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate)) \
175	check-stage2-rpass \
303check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
304	$$(foreach crate,$$(TEST_CRATES), \
305           check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
dagre.js https://github.com/marthlab/iseqtools-portal.git | JavaScript | 4,048 lines
53
54    graph.edges(u).forEach(function(e) { graph.delEdge(e); });
55
185    var g = dagre.graph();
186    us.forEach(function(u) {
187      g.addNode(u, graph.node(u));
188    });
189    values(edges).forEach(function(e) {
190      if (g.hasNode(e.source) && g.hasNode(e.target)) {
199    str += "    Nodes:\n";
200    keys(nodes).forEach(function(u) {
201      str += "        " + u + ": " + JSON.stringify(nodes[u].value) + "\n";
203    str += "    Edges:\n";
204    keys(edges).forEach(function(e) {
205      var edge = edges[e];
iso8601.js https://github.com/craigbeck/chronos.git | JavaScript | 1,066 lines
246      var tz = ['Z'];
247      (['+', '-']).forEach(function(sign) {
248        _.range(0, 10).forEach(function(i) {
293
294          calendarYears.standard.forEach(function(y, i) {
295            expect(y.str).to.be.parseableAs('YYYY').
302
303          calendarYears.extended.forEach(function(y, i) {
304            expect(y.str).to.be.parseableAs('YYYY').
313
314          calendarMonths.all.forEach(function(m, i) {
315            var parseResult = expect(m.str).to.be.parseableAs('MM');
323
324          calendarDaysOfMonth.all.forEach(function(d, i) {
325            var parseResult = expect(d.str).to.be.parseableAs('DD');
FrmProStatisticsController.php https://github.com/rafapires/festival-de-ideias.git | PHP | 1,312 lines
44        $colors = array('#EF8C08', '#21759B', '#1C9E05');
45        foreach ($fields as $field){  
46            $data[$field->id] = $this->get_graph($field, array('colors' => $colors, 'bg_color' => '#FFFFFF', 'odd' => $odd));
114            
115            foreach ($values as $val_key => $val){
116                if($val)
156            
157            foreach($ids as $f_id){
158                $new_max = abs(max($f_values[$f_id])*1.2);
165            $bars = array();
166            foreach($f_values as $f_id => $f_vals){
167                if($type == 'line')
200        if(isset($bars) and !empty($bars)){
201            foreach($bars as $f_bar)
202                $chart->add_element( $f_bar );
Extension.php https://github.com/lucciano/CodeGen_PECL.git | PHP | 2,630 lines
596        if (isset($this->packageFiles['copy'])) {
597            foreach ($this->packageFiles['copy'] as $targetpath => $sourcepath) {
598                $targetpath = $this->dirpath."/".$targetpath;
627
628        foreach ($this->logos as $logo) {
629            $fp = new CodeGen_Tools_FileReplacer("{$this->dirpath}/".$logo->getName()."_logos.h");
805        } else {
806            foreach ($this->resources as $resource) {
807                $fp->puts($resource->docEntry($idName));
849            $const_groups = array();
850            foreach ($this->constants as $constant) {
851                $const_groups[$constant->getGroup()][] = $constant;
852            }
853            foreach ($const_groups as $group => $constants) {
854                if ($group == "default") {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21