Convenience Methods
559470
public static <C0, C1> R2<C0,C1> of(C0 p0, C1 p1) {
        return new R2<C0,C1>(p0,p1);
    }
158729
public void help() {
        p("");
        p("Command                Description");
        p("=======                ===========");
        p("help()                 Display usage and help messages. ");
        p("defineClass(className) Define an extension using the Java class");
        p("                       named with the string argument. ");
        p("                       Uses ScriptableObject.defineClass(). ");
        p("load(['foo.js', ...])  Load JavaScript source files named by ");
        p("                       string arguments. ");
        p("loadClass(className)   Load a class named by a string argument.");
        p("                       The class must be a script compiled to a");
        p("                       class file. ");
        p("print([expr ...])      Evaluate and print expressions. ");
        p("quit()                 Quit the shell. ");
        p("version([number])      Get or set the JavaScript version number.");
        p("");
    }
1298982
def context_methods
      @context.instance_methods.inject({}) do |methods, name|
        methods.merge(name.to_sym => @context.instance_method(name))
      end
    end
1179120
public void perform() {
		log.info(toString());

		WebElement element = finder.find();

		switch (stepMode) {
			case CHECK_VALUE:
				String checkValue = retrieveValue();
				if (checkTrafo != null) {
					checkValue = checkTrafo.trafo(checkValue);
				}
				checkValue(element, checkValue);
				break;

			case CHECK_DEFAULT:
				checkState(defaultsProvider != null, "No DefaultsProvider set when StepMode is CHECK_DEFAULT.");
				checkValue(element, defaultsProvider.get(element, dataSet, dataKey, dataIndex));
				break;

			case SET_VALUE:
				String setValue = retrieveValue();
				if (setTrafo != null) {
					setValue = setTrafo.trafo(setValue);
				}

				if (element.getTagName().equalsIgnoreCase(WebConstants.SELECT)) {

					Select select = new Select(element);
					// First check if a matching value can be found
					List<WebElement> options = select.getOptions();
					boolean found = false;
					for (WebElement option : options) {
						String optionValue = option.getAttribute(WebConstants.VALUE);
						if (StringUtils.equals(optionValue, setValue)) {
							/*
							 * WebElement with matching value could be found --> we are finished
							 */
							found = true;
							select.selectByValue(setValue);
							break;
						}
					}

					if (!found) {
						/*
						 * Fallback: look for a WebElement with a matching visible text
						 */
						for (WebElement option : options) {
							String visibleText = option.getText();
							if (StringUtils.equals(visibleText, setValue)) {
								/*
								 * WebElement with matching value could be found --> we are finished
								 */
								found = true;
								select.selectByVisibleText(setValue);
								break;
							}
						}
					}

					if (!found) {
						throw new JFunkException("Could not find a matching option element in " + element + " , By: "
								+ finder.getBy());
					}

				} else if (WebConstants.INPUT.equalsIgnoreCase(element.getTagName())
						&& WebConstants.RADIO.equals(element.getAttribute(WebConstants.TYPE))) {

					List<WebElement> elements = finder.findAll();
					for (WebElement webElement : elements) {
						String elVal = webElement.getAttribute(WebConstants.VALUE);
						if (elVal.equals(setValue) && !webElement.isSelected()) {
							webElement.click();
						}
					}

				} else if (WebConstants.CHECKBOX.equals(element.getAttribute(WebConstants.TYPE))) {

					if (Boolean.valueOf(setValue) && !element.isSelected() || !Boolean.valueOf(setValue) && element.isSelected()) {
						element.click();
					}

				} else {

					if (element.getAttribute("readonly") == null || element.getAttribute("readonly").equals("false")) {
						element.clear();
						element.sendKeys(setValue);
					} else {
						log.warn("Element is invisible or disabled, value cannot be set");
					}

				}
				break;

			case NONE:
				// do nothing
				break;

			default:
				throw new IllegalArgumentException("Unhandled StepMode=" + stepMode);
		}
	}
987031
function (methods) {
                methods = [].concat(methods);
                var i = methods.length - 1;

                for (i; i >= 0; i -= 1) {
                    this[methods[i]] = proxy(this[methods[i]], this);
                }

                return this;
            }
13387
public void method2() {
        Engine engine = null;
        String configurationFile = "/ObstacleAvoidance.fll";
        URL url = SimpleDimmer.class.getResource(configurationFile);
        try {
            engine = new FllImporter().fromFile(new File(url.toURI()));
        } catch (Exception ex) {
            FuzzyLite.logger().log(Level.SEVERE, ex.toString(), ex);
        }

        FuzzyLite.logger().info(new FldExporter().toString(engine));
    }
728319
public void prepend(Object... aChunk) {
        for (int i = aChunk.length - 1; i >= 0; i--) {
            if (aChunk[i] instanceof String) {
                this.prepend((String) aChunk[i]);
            } else if (aChunk[i] instanceof SourceNode) {
                this.prepend((SourceNode) aChunk[i]);
            } else {
                throw new IllegalArgumentException();
            }
        }
    }
521155
function(){
			var plugin = $(this.element).data("ui-" + this.options.pluginName) || $(this.element).data(this.options.pluginName),
				opts = this.options,
				actualOpts = plugin.options,
				availOptList = opts.optionList,
				lines = [],
				header = opts.header || '$("#selector").' + opts.pluginName + "({",
				footer = "});",
				i;
			// Make a filtered copy of the option list (so we get the last ',' right)
			if(this.options.hideDefaults){
				availOptList = [];
				for(i=0; i<this.options.optionList.length; i++){
					var o = this.options.optionList[i],
						n = o.name,
						defVal = o.value;
					if($.isArray(defVal)){
						defVal = $.map(defVal, function(e){ return e.selected ? e.value : null;})[0];
					}
					if( actualOpts[n] !== defVal /*&& actualOpts[n] !== undefined*/){
						availOptList.push(o);
					}
				}
			}
			//
			lines.push(header);
			for(i=0; i<availOptList.length; i++){
				var o = availOptList[i],
					actualVal = actualOpts[o.name],
					line = "    " + o.name + ": ";
				if(typeof actualVal === "string"){
					line += '"' + actualVal + '"';
				}else if($.isPlainObject(actualVal)){
					line += JSON.stringify(actualVal);
				}else{
					line += "" + actualVal;
				}
				if( i < (availOptList.length - 1) ){
					line += ",";
				}
				if( opts.showComments ){
					line += " // " + o.hint;
				}
				lines.push(line);
			}
			lines.push(footer);
			$(opts.sourceTarget).addClass("ui-configurator-source").text(lines.join("\n"));
			this._trigger("render");
		}
774241
def method_missing(m, *args, &block)
      if m.to_s =~ /^with_(.+)$/
        with($1.to_sym => args.first)
        self
      else
        super
      end
    end
268994
function() {
                // Force anything that is inlined onto the stack so we don't have duplication
                // when we examine local
                this.flushInline();
                var local = this.popStack();
                this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }');
                if (this.environment.isSimple) {
                    this.pushSource("else { " + this.appendToBuffer("''") + " }");
                }
            }
1081592
def method_missing(sym, *args, &block)
      if (data && data[sym])
        data[sym]
      else
        super(sym, *args, &block)
      end
    end
353468
def method_missing(name, *args, &block)
      if args.empty? && !block_given? && @arg_names.include?(name)
        @args[name]
      else
        super
      end
    end
1232820
def method_missing(name, *args, &block)
      return attributes[name.to_sym] if attributes.include?(name.to_sym)
      return super
    end
12708
def method_missing(name, *args, &block)
      helpers.key?(name) ? helpers.fetch(name).call : super
    end
467027
private void appendHourFormat(MethodSpec.Builder method, List<Node> fmt) {
    for (Node n : fmt) {
      if (n instanceof Text) {
        String t = ((Text)n).text();
        boolean minute = t.equals(":") || t.equals(".");
        if (minute) {
          method.beginControlFlow("if (emitMins)");
        }
        method.addStatement("b.append($S)", t);
        if (minute) {
          method.endControlFlow();
        }
      } else {
        Field f = (Field)n;
        if (f.ch() == 'H') {
          if (f.width() == 1) {
            method.addStatement("zeroPad2(b, hours, 1)");
          } else {
            method.addStatement("zeroPad2(b, hours, _short ? 1 : $L)", f.width());
          }
        } else {
          method.beginControlFlow("if (emitMins)");
          method.addStatement("zeroPad2(b, mins, $L)", f.width());
          method.endControlFlow();
        }
      }
    }
  }
1204381
function(methods) {
        var api;
        for (var name in methods) {
            if (methods.hasOwnProperty(name)) {
                api = this._addMethod(name, methods[name]);
            }
        }
        return api;
    }
420081
def method_missing(name, *args, &block)
      string_name = name.to_s

      if string_name =~ /can_(.+)\?/
        self.can?(name, *args)
      else
        super(name, *args, &block)
      end
    end