Insert the iframes for benchmarking.
Depending on the parameter share, we will generate one iframe
for each benchmark or we will share the same one.
433232
private void initIFrames() {
    String i = "<iframe class=ibench id=%ID%bench src=html/%ID%bench.html></iframe>";
    if (! shareIframes ) {
      $(i.replaceAll("%ID%", "gwt")).appendTo(document).hide();
      for (Benchmark b : benchmarks) {
        if (b instanceof IframeBenchmark) {
          $(i.replaceAll("%ID%", b.getId())).appendTo(document).hide();
        }
      }
    } else {
      $(i.replaceAll("%ID%", "iframe")).appendTo(document).hide();
    }
  }
1215818
def sample(self, frame):
        """"""
        frames = self.frame_stack(frame)
        if frames:
            frames.pop()
        parent_stats = self.stats
        for f in frames:
            parent_stats = parent_stats.ensure_child(f.f_code, void)
        stats = parent_stats.ensure_child(frame.f_code, RecordingStatistics)
        stats.own_hits += 1
1187966
def add_children(self, frames, after=None):
        '''
        
        '''
        if after is not None:
            # if there's an 'after' parameter, add the frames in reverse so the order is
            # preserved.
            for frame in reversed(frames):
                self.add_child(frame, after=after)
        else:
            for frame in frames:
                self.add_child(frame)
1235501
protected function _buildIframe() {
		$source = $this->_stub['iframe-player'];
		$count = count($this->_match);

		for ($i = 1; $i <= $count; $i++) {
			$source = str_ireplace('$' . $i, $this->_match[$i - 1], $source);
		}

		//add custom params
		if ($this->_iframeParams) {
			$c = '?';
			if (strpos($source, '?') !== false) {
				$c = '&amp;';
			}
			$source .= $c . http_build_query($this->_iframeParams, '', '&amp;');
		}
		$attributes = '';
		//add custom attributes

		foreach ($this->_iframeAttributes as $key => $val) {
			//if === true, is an attribute without value
			//if === false, remove the attribute
			if ($val !== false) {
				$attributes .= ' ' . $key . ($val !== true ? '="' . $this->_esc($val) . '"' : '');
			}
		}

		// Transparent hack (http://groups.google.com/group/autoembed/browse_thread/thread/0ecdd9b898e12183)
		return sprintf('<iframe src="%s"%s></iframe>', $source, $attributes);
	}
866580
def benchmark_setup(self):
        
        def f():
            self._setup()
            self.mod_ext.synchronize(**self.ext_kwargs)
        f()  # Ignore first
        self.setup_stat = self._calc_benchmark_stat(f)
762274
function(url) {
		var dfd = $.Deferred(),
			ifm;
		try {
			ifm = $('<iframe width="1" height="1" scrolling="no" frameborder="no" style="position:absolute; top:-1px; left:-1px" crossorigin="use-credentials">')
				.attr('src', url)
				.one('load', function() {
					var ifm = $(this);
					try {
						this.contentDocument.location.reload(true);
						ifm.one('load', function() {
							ifm.remove();
							dfd.resolve();
						});
					} catch(e) {
						ifm.attr('src', '').attr('src', url).one('load', function() {
							ifm.remove();
							dfd.resolve();
						});
					}
				})
				.appendTo('body');
		} catch(e) {
			ifm && ifm.remove();
			dfd.reject();
		}
		return dfd;
	}
197744
def encode(frame)
      frames = if frame[:type] == :headers || frame[:type] == :push_promise
        encode_headers(frame) # HEADERS and PUSH_PROMISE may create more than one frame
      else
        [frame]               # otherwise one frame
      end

      frames.map { |f| @framer.generate(f) }
    end
839376
final void doScoring(Frame _train, Frame _trainOrig, Frame _valid, Frame _validOrig) {
    ModelMetrics mm = makeMetrics(_train, _trainOrig, true, "Metrics reported on training frame");
    _output._training_metrics = mm;
    _output._scored_train[_output._ntrees].fillFrom(mm);
    addModelMetrics(mm);
    // Optional validation part
    if (_valid!=null) {
      mm = makeMetrics(_valid, _validOrig, false, "Metrics reported on validation frame");
      _output._validation_metrics = mm;
      _output._scored_valid[_output._ntrees].fillFrom(mm);
      addModelMetrics(mm);
    }
  }
798428
public void setCurrentFrame(RemoteWebElement iframe, RemoteWebElement document,
                              RemoteWebElement window) {
    this.iframe = iframe;
    this.document = document;
    this.window = window;

    if (iframe != null) {
      isOnMainFrame = false;
    } else {
      isOnMainFrame = true;
    }

    // switchToDefaultContent. revert to main document if it was set.
    if (iframe == null && document == null) {
      this.document = mainDocument;
      this.window = mainWindow;
    }

    // setting the main document for the first time
    if (iframe == null && document != null) {
      mainDocument = document;
      mainWindow = window;
    }
    isReady = true;

  }
390213
public void benchmarkItem() throws Exception {

        // To make an asynchronous procedure call, you need a callback object
        // BenchmarkCallback is a generic callback that keeps track of the transaction results
        // for any given procedure name, which should match the procedure called below.
        ProcedureCallback callback = new BenchmarkCallback("insert_session");

        // generate some random parameter values
        int appid = rand.nextInt(50);
        int deviceid = rand.nextInt(1000000);

        // call the procedure asynchronously, passing in the callback and the procedure name,
        // followed by the input parameters
        client.callProcedure(callback,
                             "insert_session",
                             appid,
                             deviceid
                             );

    }
534048
function() {
		switch( this.cycles ) {
		case 3728:
		case 7457:
		case 11186:
		case 14915:
			this.doQuarterFrame();
			break;
		}

		switch( this.cycles ) {
		case 7457:
		case 14915:
			this.doHalfFrame();
			break;
		}

		if ( this.cycles >= 14915 ) {
			this.cycles = 0;

			if( this.frameCounterInterrupt ) {
				this.system.cpu.requestIRQ();
			}
		}
	}
434775
private void putFrame() {
    final int nLocal = currentFrame[1];
    final int nStack = currentFrame[2];
    if (symbolTable.getMajorVersion() < Opcodes.V1_6) {
      // Generate a StackMap attribute entry, which are always uncompressed.
      stackMapTableEntries.putShort(currentFrame[0]).putShort(nLocal);
      putAbstractTypes(3, 3 + nLocal);
      stackMapTableEntries.putShort(nStack);
      putAbstractTypes(3 + nLocal, 3 + nLocal + nStack);
      return;
    }
    final int offsetDelta =
        stackMapTableNumberOfEntries == 0
            ? currentFrame[0]
            : currentFrame[0] - previousFrame[0] - 1;
    final int previousNlocal = previousFrame[1];
    final int nLocalDelta = nLocal - previousNlocal;
    int type = Frame.FULL_FRAME;
    if (nStack == 0) {
      switch (nLocalDelta) {
        case -3:
        case -2:
        case -1:
          type = Frame.CHOP_FRAME;
          break;
        case 0:
          type = offsetDelta < 64 ? Frame.SAME_FRAME : Frame.SAME_FRAME_EXTENDED;
          break;
        case 1:
        case 2:
        case 3:
          type = Frame.APPEND_FRAME;
          break;
        default:
          // Keep the FULL_FRAME type.
          break;
      }
    } else if (nLocalDelta == 0 && nStack == 1) {
      type =
          offsetDelta < 63
              ? Frame.SAME_LOCALS_1_STACK_ITEM_FRAME
              : Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
    }
    if (type != Frame.FULL_FRAME) {
      // Verify if locals are the same as in the previous frame.
      int frameIndex = 3;
      for (int i = 0; i < previousNlocal && i < nLocal; i++) {
        if (currentFrame[frameIndex] != previousFrame[frameIndex]) {
          type = Frame.FULL_FRAME;
          break;
        }
        frameIndex++;
      }
    }
    switch (type) {
      case Frame.SAME_FRAME:
        stackMapTableEntries.putByte(offsetDelta);
        break;
      case Frame.SAME_LOCALS_1_STACK_ITEM_FRAME:
        stackMapTableEntries.putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME + offsetDelta);
        putAbstractTypes(3 + nLocal, 4 + nLocal);
        break;
      case Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
        stackMapTableEntries
            .putByte(Frame.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
            .putShort(offsetDelta);
        putAbstractTypes(3 + nLocal, 4 + nLocal);
        break;
      case Frame.SAME_FRAME_EXTENDED:
        stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED).putShort(offsetDelta);
        break;
      case Frame.CHOP_FRAME:
        stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED + nLocalDelta).putShort(offsetDelta);
        break;
      case Frame.APPEND_FRAME:
        stackMapTableEntries.putByte(Frame.SAME_FRAME_EXTENDED + nLocalDelta).putShort(offsetDelta);
        putAbstractTypes(3 + previousNlocal, 3 + nLocal);
        break;
      case Frame.FULL_FRAME:
      default:
        stackMapTableEntries.putByte(Frame.FULL_FRAME).putShort(offsetDelta).putShort(nLocal);
        putAbstractTypes(3, 3 + nLocal);
        stackMapTableEntries.putShort(nStack);
        putAbstractTypes(3 + nLocal, 3 + nLocal + nStack);
    }
  }
214081
function(iframe, params){
        // We can't use the following code in IE6
        // var form = document.createElement('form');
        // form.setAttribute('method', 'post');
        // form.setAttribute('enctype', 'multipart/form-data');
        // Because in this case file won't be attached to request
        var form = qq.toElement('<form method="post" enctype="multipart/form-data"></form>');

        var queryString = qq.obj2url(params, this._options.action);

        form.setAttribute('action', queryString);
        form.setAttribute('target', iframe.name);
        form.style.display = 'none';
        document.body.appendChild(form);

        return form;
    }
932815
function init(){
      // Most browsers don't need special methods here..
      set_history = get_history = function(val){ return val; };
      
      // But IE6/7 do!
      if ( is_old_ie ) {
        
        // Create hidden Iframe after the end of the body to prevent initial
        // page load from scrolling unnecessarily.
        iframe = $('<iframe src="javascript:0"/>').hide().insertAfter( 'body' )[0].contentWindow;
        
        // Get history by looking at the hidden Iframe's location.hash.
        get_history = function() {
          return get_fragment( iframe.document[ str_location ][ str_href ] );
        };
        
        // Set a new history item by opening and then closing the Iframe
        // document, *then* setting its location.hash.
        set_history = function( hash, history_hash ) {
          if ( hash !== history_hash ) {
            var doc = iframe.document;
            doc.open().close();
            doc[ str_location ].hash = '#' + hash;
          }
        };
        
        // Set initial history.
        set_history( get_fragment() );
      }
    }
114659
function(type, args, obj) {
        var useIframe = args[0];
    
        if (!this.parent) {
            if (Dom.inDocument(this.oDomContainer)) {
                if (useIframe) {
                    var pos = Dom.getStyle(this.oDomContainer, "position");
                    
                    if (pos == "absolute" || pos == "relative") {
                        
                        if (!Dom.inDocument(this.iframe)) {
                            this.iframe = document.createElement("iframe");
                            this.iframe.src = "javascript:false;";
    
                            Dom.setStyle(this.iframe, "opacity", "0");
    
                            if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
                                Dom.addClass(this.iframe, this.Style.CSS_FIXED_SIZE);
                            }
    
                            this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
                        }
                    }
                } else {
                    if (this.iframe) {
                        if (this.iframe.parentNode) {
                            this.iframe.parentNode.removeChild(this.iframe);
                        }
                        this.iframe = null;
                    }
                }
            }
        }
    }
611653
private void registerSamples() {
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new WmsLayerPanel();
			}

			public String getTitle() {
				return MESSAGES.wmsLayerTitle();
			}

			public String getShortDescription() {
				return MESSAGES.wmsLayerShort();
			}

			public String getDescription() {
				return MESSAGES.wmsLayerDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "basicwmslayer";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new CapabilitiesPanel();
			}

			public String getTitle() {
				return MESSAGES.capabilitiesTitle();
			}

			public String getShortDescription() {
				return MESSAGES.capabilitiesShort();
			}

			public String getDescription() {
				return MESSAGES.capabilitiesDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "wmsgetcapabilities";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new WmsFeatureInfoPanel();
			}

			public String getTitle() {
				return MESSAGES.wmsGetFeatureInfoTitle();
			}

			public String getShortDescription() {
				return MESSAGES.wmsGetFeatureInfoShort();
			}

			public String getDescription() {
				return MESSAGES.wmsGetFeatureInfoDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "wmsgetfeatureinfo";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new SelectStylePanel();
			}

			public String getTitle() {
				return MESSAGES.selectStyleTitle();
			}

			public String getShortDescription() {
				return MESSAGES.selectStyleShort();
			}

			public String getDescription() {
				return MESSAGES.selectStyleDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "selectstyle";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new WmsLayerLegendPanel();
			}

			public String getTitle() {
				return MESSAGES.wmsLayerLegendTitle();
			}

			public String getShortDescription() {
				return MESSAGES.wmsLayerLegendShort();
			}

			public String getDescription() {
				return MESSAGES.wmsLayerLegendDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "wmslayerlegend";
			}
		});
	}
737766
private void addThemeLinks(PageParameters parameters){
        if (parameters.getAllNamed().size() < 2) {
            add(new UpdateThemeLink("defaultTheme", "chart"));
            add(new UpdateThemeLink("grid", "chart"));
            add(new UpdateThemeLink("skies", "chart"));
            add(new UpdateThemeLink("gray", "chart"));
            add(new UpdateThemeLink("darkblue", "chart"));
        } else {
            String chartString = parameters.getAllNamed().get(1).getValue();
            add(new UpdateThemeLink("defaultTheme", chartString));
            add(new UpdateThemeLink("grid", chartString));
            add(new UpdateThemeLink("skies", chartString));
            add(new UpdateThemeLink("gray", chartString));
            add(new UpdateThemeLink("darkblue", chartString));
        }
    }