text:
package zipkin2.storage.cassandra;

import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.AsyncResultSet;
import com.datastax.oss.driver.api.core.cql.PreparedStatement;
import com.datastax.oss.driver.api.core.cql.Row;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletionStage;
import java.util.function.BiConsumer;
import java.util.function.Supplier;
import zipkin2.Annotation;
import zipkin2.Call;
import zipkin2.Endpoint;
import zipkin2.Span;
import zipkin2.internal.FilterTraces;
import zipkin2.internal.Nullable;
import zipkin2.storage.GroupByTraceId;
import zipkin2.storage.QueryRequest;
import zipkin2.storage.StrictTraceId;
import zipkin2.storage.cassandra.internal.call.AccumulateAllResults;
import zipkin2.storage.cassandra.internal.call.ResultSetFutureCall;

import static zipkin2.storage.cassandra.Schema.TABLE_SPAN;

final class SelectFromSpan extends ResultSetFutureCall<AsyncResultSet> {
  static final class Factory {
    final CqlSession session;
    final PreparedStatement preparedStatement;
    final Call.Mapper<List<Span>, List<List<Span>>> groupByTraceId;
    final boolean strictTraceId;
    final int maxTraceCols;

    Factory(CqlSession session, boolean strictTraceId, int maxTraceCols) {
      this.session = session;
      this.preparedStatement = session.prepare(
        "SELECT trace_id_high,trace_id,parent_id,id,kind,span,ts,duration,l_ep,r_ep,annotations,tags,debug,shared"
          + " FROM " + TABLE_SPAN
          + " WHERE trace_id IN ?"
          + " LIMIT ?");
      this.strictTraceId = strictTraceId;
      this.maxTraceCols = maxTraceCols;
      this.groupByTraceId = GroupByTraceId.create(strictTraceId);
    }

    Call<List<Span>> newCall(String hexTraceId) {
      // Unless we are strict, truncate the trace ID to 64bit (encoded as 16 characters)
      Set<String> traceIds;
      if (!strictTraceId && hexTraceId.length() == 32) {
        traceIds = new LinkedHashSet<>();
        traceIds.add(hexTraceId);
        traceIds.add(hexTraceId.substring(16));
      } else {
        traceIds = Collections.singleton(hexTraceId);
      }

      Call<List<Span>> result =
        new SelectFromSpan(this, traceIds, maxTraceCols).flatMap(READ_SPANS);
      return strictTraceId ? result.map(StrictTraceId.filterSpans(hexTraceId)) : result;
    }

    Call<List<List<Span>>> newCall(Iterable<String> traceIds) {
      Set<String> normalizedTraceIds = new LinkedHashSet<>();
      for (String traceId : traceIds) {
        // make sure we have a 16 or 32 character trace ID
        traceId = Span.normalizeTraceId(traceId);
        // Unless we are strict, truncate the trace ID to 64bit (encoded as 16 characters)
        if (!strictTraceId && traceId.length() == 32) traceId = traceId.substring(16);
        normalizedTraceIds.add(traceId);
      }

      if (normalizedTraceIds.isEmpty()) return Call.emptyList();
      Call<List<List<Span>>> result = new SelectFromSpan(this, normalizedTraceIds, maxTraceCols)
        .flatMap(READ_SPANS)
        .map(groupByTraceId);
      return strictTraceId ? result.map(StrictTraceId.filterTraces(normalizedTraceIds)) : result;
    }

    FlatMapper<Set<String>, List<List<Span>>> newFlatMapper(QueryRequest request) {
      return new SelectSpansByTraceIds(this, request);
    }
  }

  final Factory factory;
  final Set<String> trace_id;
  final int limit_;

  /** @param limit_ amount of spans per trace is almost always larger than trace IDs */
  SelectFromSpan(Factory factory, Set<String> trace_id, int limit_) {
    this.factory = factory;
    this.trace_id = trace_id;
    this.limit_ = limit_;
  }

  @Override protected CompletionStage<AsyncResultSet> newCompletionStage() {
    return factory.session.executeAsync(factory.preparedStatement.boundStatementBuilder()
      // Switched Set to List which is higher overhead, as have to copy into it, but avoids this:
      // com.datastax.oss.driver.api.core.type.codec.CodecNotFoundException: Codec not found for requested operation: [List(TEXT, not frozen) <-> java.util.Set<java.lang.String>]
      .setList(0, new ArrayList<>(trace_id), String.class)
      .setInt(1, limit_).build());
  }

  @Override public AsyncResultSet map(AsyncResultSet input) {
    return input;
  }

  @Override public String toString() {
    return "SelectFromSpan{trace_id=" + trace_id + ", limit_=" + limit_ + "}";
  }

  @Override public SelectFromSpan clone() {
    return new SelectFromSpan(factory, trace_id, limit_);
  }

  static final class SelectSpansByTraceIds implements FlatMapper<Set<String>, List<List<Span>>> {
    final Factory factory;
    final int limit;
    @Nullable final Call.Mapper<List<List<Span>>, List<List<Span>>> filter;

    SelectSpansByTraceIds(Factory factory, QueryRequest request) {
      this.factory = factory;
      this.limit = request.limit();
      // Cassandra always looks up traces by 64-bit trace ID, so we have to unconditionally filter
      // when strict trace ID is enabled.
      this.filter = factory.strictTraceId ? FilterTraces.create(request) : null;
    }

    @Override public Call<List<List<Span>>> map(Set<String> input) {
      if (input.isEmpty()) return Call.emptyList();
      Set<String> traceIds;
      if (input.size() > limit) {
        traceIds = new LinkedHashSet<>();
        Iterator<String> iterator = input.iterator();
        for (int i = 0; i < limit; i++) {
          traceIds.add(iterator.next());
        }
      } else {
        traceIds = input;
      }
      Call<List<List<Span>>> result = new SelectFromSpan(factory, traceIds, factory.maxTraceCols)
        .flatMap(READ_SPANS)
        .map(factory.groupByTraceId);
      return filter != null ? result.map(filter) : result;
    }

    @Override public String toString() {
      return "SelectSpansByTraceIds{limit=" + limit + "}";
    }
  }

  static final AccumulateAllResults<List<Span>> READ_SPANS = new ReadSpans();

  static final class ReadSpans extends AccumulateAllResults<List<Span>> {

    @Override protected Supplier<List<Span>> supplier() {
      return ArrayList::new;
    }

    @Override protected BiConsumer<Row, List<Span>> accumulator() {
      return (row, result) -> {
        String traceId = row.getString("trace_id");
        String traceIdHigh = row.getString("trace_id_high");
        if (traceIdHigh != null) traceId = traceIdHigh + traceId;
        Span.Builder builder = Span.newBuilder()
          .traceId(traceId)
          .parentId(row.getString("parent_id"))
          .id(row.getString("id"))
          .name(row.getString("span"));

        if (!row.isNull("ts")) builder.timestamp(row.getLong("ts"));
        if (!row.isNull("duration")) builder.duration(row.getLong("duration"));

        if (!row.isNull("kind")) {
          try {
            builder.kind(Span.Kind.valueOf(row.getString("kind")));
          } catch (IllegalArgumentException ignored) {
            // EmptyCatch ignored
          }
        }

        if (!row.isNull("l_ep")) builder.localEndpoint(row.get("l_ep", Endpoint.class));
        if (!row.isNull("r_ep")) builder.remoteEndpoint(row.get("r_ep", Endpoint.class));

        if (!row.isNull("debug")) builder.debug(row.getBoolean("debug"));
        if (!row.isNull("shared")) builder.shared(row.getBoolean("shared"));

        for (Annotation annotation : row.getList("annotations", Annotation.class)) {
          builder.addAnnotation(annotation.timestamp(), annotation.value());
        }
        for (Map.Entry<String, String> tag :
          row.getMap("tags", String.class, String.class).entrySet()) {
          builder.putTag(tag.getKey(), tag.getValue());
        }
        result.add(builder.build());
      };
    }

    @Override public String toString() {
      return "ReadSpans{}";
    }
  }
}


text:
module.exports.mock = function(src) {
	return src;
};

redpajama_set_name: RedPajamaGithub


text:
exports.getWidget = function(feather, cb) {
  cb(null, {
    name: "api_tester.tableTest",
    path: "widgets/tableTest/",

    prototype: {

      onRender: function(render) {

        debugger;
        render();
      }
    }
  });
};


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var pages_1 = require("./pages");
var footer_1 = require("./footer");
/**
 * New WBox instance
 *
 * @export
 * @class WBox
 */
var WBox = (function () {
    function WBox(element, config) {
        /**
         * Properties scanner RegEx
         *
         * @type {RegExp}
         * @memberof WBox
         */
        this.elPropertiesRegex = /w-([a-z\-]*)/i;
        // Status/States
        /**
         * Is the WBox currently in a visible state
         *
         * @type {boolean}
         * @memberof WBox
         */
        this.debug = false;
        this.isShown = false;
        this.isShowing = false;
        this.isHiding = false;
        /**
         * Defaults WBox properties - Merged later
         *
         * @type {Properties}
         * @memberof WBox
         */
        this.config = {
            type: 'WBox',
            closeButton: true,
            overlay: { show: true }
        };
        /**
         * style properties before overwrite if same props passed
         *
         * @type {StyleProperties}
         * @memberof WBox
         */
        this.styleProperties = {
            width: '300px',
            height: '250px'
        };
        this.showTimeout = 50;
        this.hideTimeout = 375;
        // Detect if nothing was passed, warn user
        if (arguments.length === 0) {
            console.error('WBox::Error - At least an element must be passed');
            return null;
        }
        // Detect if automated call (i.e. IBox) where no element is created
        if (element === 'wbox-temp') {
            this.el = this.createTemporaryWBox(config);
        }
        // [Arg:0] Determine what type was passed
        this.selectorType = this.detectSelectorType(element);
        // [Arg:0] Determine if element or string
        // if (typeof element === 'string') this.el = <HTMLElement>document.getElementById(element)
        // if (typeof element === 'object') this.el = <HTMLElement>element
        this.el = this.selectElement(element);
        // Check that something was captured, if not error
        if (this.el === null) {
            console.error('WBox::Error - At least an element must be passed');
            return null;
        }
        // Read and parse any css attributes starting with w- on the .wbox element
        this.parseElAttrs();
        // Determine if config was passed - alternative is to assign and override element attributes
        this.parseConfig(config);
        // Apply property styles
        this.applyStyle();
        // Initialize Overlay
        this.Overlay = new Overlay(this.el, this.overlayProperties);
        // Detect pages (if any are set)
        this.Pages = new pages_1.Pages(this);
        this.Footer = new footer_1.Footer(this);
    }
    WBox.prototype.isVisable = function (toCheck) {
        return toCheck.style.display === 'none';
    };
    WBox.prototype.detectSelectorType = function (passed) {
        if (typeof passed === 'object') {
            return 'element';
        }
        if (/^\.[a-z0-9\-\_]*/i.test(passed) === true) {
            return 'class';
        }
        if (/^\#[a-z0-9\-\_]*/i.test(passed) === true) {
            return 'id#';
        }
        if (/^\.|\#[a-z0-9\s-_\s]*(\.|\#|\>)/i.test(passed) === true) {
            return 'selector';
        }
        // Fallback when user passes in old format as `new WBox('elementID')`
        return 'id';
    };
    WBox.prototype.selectElement = function (elArg) {
        switch (this.selectorType) {
            case 'element':
                return elArg;
            case 'class':
                return document.querySelector(elArg);
            case 'id':
                return document.getElementById(elArg);
            case 'id#':
                return document.querySelector(elArg);
            case 'selector':
                return document.querySelector(elArg);
        }
    };
    /**
     * Parse user's config (if passed) overwriting any defaults
     *
     * @private
     * @param {Properties} config
     * @memberof WBox
     */
    WBox.prototype.parseConfig = function (config) {
        config = (config !== undefined) ? config : this.config;
        // merge config
        config = this.mergeProps(this.config, config);
        // if config is not undefined start properties parser
        this.parseProps(config);
    };
    /**
     * Generate a tempoary WBox element for some internal extends
     *
     * @private
     * @param {Properties} config
     * @returns {HTMLElement}
     * @memberof WBox
     */
    WBox.prototype.createTemporaryWBox = function (config) {
        var el = document.createElement('div');
        el.classList.add('wbox', 'wbox-theme-default');
        el.id = 'wbox-temp';
        if (config.body !== undefined) {
            el.innerHTML = config.body;
        }
        // Add to page
        document.querySelector('body').appendChild(el);
        return el;
    };
    /**
     * Merge properties from obj2 into obj1
     *
     * @private
     * @template T
     * @param {T} obj1
     * @param {T} obj2
     * @returns {T}
     * @memberof WBox
     */
    WBox.prototype.mergeProps = function (obj1, obj2) {
        var ret = obj1;
        for (var key in obj2) {
            if (obj2.hasOwnProperty(key)) {
                ret[key] = obj2[key];
            }
        }
        return ret;
    };
    /**
     * Parse properties that are objects
     *
     * @private
     * @param {Properties} config
     * @memberof WBox
     */
    WBox.prototype.parseProps = function (config) {
        this.footerProperties = config.footer;
        this.overlayProperties = config.overlay;
        // Passed undefined check, parse style properties
        if (config.style !== undefined) {
            for (var key in config.style) {
                if (config.style.hasOwnProperty(key)) {
                    // When present, update Defaults
                    this.styleProperties[key] = config.style[key];
                    if (this.debug) {
                        console.log('passedProp:%s : %s', key, config.style[key]);
                    }
                }
            }
        }
        // Add a close button (Unless config.closeButton = false)
        if (config.closeButton === true || config.closeButton === undefined) {
            this.addCloseButton();
        }
    };
    WBox.prototype.parseElAttrs = function () {
        var _this = this;
        // Set WBox element defined paramaters
        // These are defined on the HTML element such as
        //

        var elAttrs = Array.from(this.el.attributes);
        // Filter down to just w-{props}
        elAttrs.forEach(function (attr) {
            if (_this.debug) {
                console.log(attr.name, attr.value);
            }
            var match = _this.elPropertiesRegex.exec(attr.name);
            if (match) {
                _this.styleProperties[match[1]] = attr.value;
            }
        });
    };
    WBox.prototype.addCloseButton = function () {
        var _this = this;
        // First check if button already exists
        // Don't add multiple to one instance on each .show()
        if (this.el.querySelectorAll('.wbox-close-btn').length > 0)
            return null;
        // Add close btn
        // Prepare btn element
        this.closeButton = document.createElement('div');
        this.closeButton.className = 'wbox-close-btn';
        this.closeButton.innerHTML = '';
        // Append btn to .wbox
        this.el.appendChild(this.closeButton);
        // Register watch for wbox-close-btn
        this.closeButton.addEventListener('click', function () {
            _this.closeMethod = _this.close(_this.closeButton);
        }, false);
    };
    WBox.prototype.applyStyle = function (override) {
        var props = (override !== undefined) ? override : this.styleProperties;
        // Set WBox CSS Values
        // These are defined on the HTML element such as
        //

        for (var key in props) {
            var _key = key;
            if (props.hasOwnProperty(_key) && typeof props[_key] === 'string') {
                // var Val = this.el.css[_key]
                if (this.debug) {
                    console.log(_key, this.el.style[_key]);
                }
                // Set wbox css style
                this.el.style.setProperty(_key, props[_key]);
            }
        }
    };
    WBox.prototype.propigateOverrides = function () {
        // Update Overlay properties
        this.Overlay.updateProperties(this.overlayProperties);
        // Call show, if was true and now false the latter will hide
        this.Overlay.show();
    };
    WBox.prototype.setStates = function (isHiding, isShowing, isShown) {
        this.isHiding = isHiding;
        this.isShowing = isShowing;
        this.isShown = isShown;
    };
    WBox.prototype.limitSize = function (actual, limit) {
        var _limit = (limit <= 800) ? (limit + 100) : limit;
        if (actual >= _limit) {
            if (this.debug) {
                console.log(actual + " >= " + _limit);
            }
            return _limit - 100;
        }
        if (this.debug) {
            console.log(actual + " <= " + _limit);
        }
        return actual;
    };
    WBox.prototype.findImageSize = function (index) {
        var _this = this;
        // If IBox need to set timeout and wait for image's client height to show
        var retry = 24;
        // Get image size
        var findSize = window.setInterval(function () {
            if (_this.debug) {
                console.log('find height');
            }
            var image = _this.el.querySelector(".ibox-image[image-index=\"" + index + "\"] > img");
            // End retries if image fails to load
            if (retry < 0) {
                if (_this.debug) {
                    console.log('findImageSize=>stopping check');
                    clearInterval(findSize);
                }
            }
            var width = _this.limitSize((image.naturalWidth), window.innerWidth);
            var height = _this.limitSize((image.naturalHeight * (width / image.naturalWidth)), window.innerHeight);
            // Retry
            if (image.clientHeight === 0) {
                retry -= 1;
                if (_this.debug) {
                    console.log('findImageSize->trying again..');
                }
                ;
                return false;
            }
            _this.parseProps({
                style: {
                    height: height + "px",
                    width: width + "px"
                }
            });
            if (_this.debug) {
                console.log('updating wbox size for ibox image', {
                    height: height + "px",
                    width: width + "px"
                });
            }
            _this.applyStyle();
            if (_this.debug) {
                console.log('findImageSize->found=>stopping check');
                clearInterval(findSize);
            }
        }, 100);
    };
    /**
     * Show the WBox
     *
     * @param {Properties} [override]
     * @memberof WBox
     */
    WBox.prototype.show = function (override) {
        var _this = this;
        if (this.debug) {
            console.log('show override:', override);
        }
        this.setStates(false, true, false);
        this.Overlay.show();
        // override = (override === undefined)
        //   ? { style: { height: `${height.clientHeight.toString()}px` } }
        //   : override
        // Unset css { display: none }
        this.el.style.display = 'block';
        // If override is set
        if (override) {
            // Make sure override properties actually set before trying to apply style
            if (override.style || override.overlay) {
                this.parseConfig(override);
                this.propigateOverrides();
                this.applyStyle();
            }
        }
        // If IBox
        if (this.config.type === 'IBox') {
            this.findImageSize(0);
            this.showTimeout = 250;
        }
        // Add slight timeout to allow for proper animation
        window.setTimeout(function () {
            _this.el.classList.add('wbox-show');
            _this.setStates(false, false, true);
        }, this.showTimeout);
    };
    /**
     * Close the WBox
     *
     * @param {Element} [closeButton]
     * @returns {(void | any)}
     * @memberof WBox
     */
    WBox.prototype.close = function (closeButton) {
        var _this = this;
        this.setStates(true, false, true);
        // Check if current visable
        if (this.isVisable(this.el))
            return null;
        // Add class to animate out
        this.el.classList.add('wbox-close');
        // Hide to prevent overlap (But after the animation time)
        window.setTimeout(function () {
            // Remove show & close classes (Prep for showing in future)
            _this.el.classList.remove('wbox-close');
            _this.el.classList.remove('wbox-show');
            // Set { display: none }
            _this.el.style.display = 'none';
            _this.setStates(false, false, false);
            if (_this.debug) {
                console.log('should close');
            }
            _this.Overlay.hide();
        }, this.hideTimeout);
    };
    /**
     * Resize WBox frame
     *
     * @param {ResizeProperties} resizeTo
     * @memberof WBox
     */
    WBox.prototype.resize = function (resizeTo) {
        this.applyStyle(resizeTo);
    };
    /**
     * Set wbox- defined class theme
     *
     * @param {string} themeName
     * @memberof WBox
     */
    WBox.prototype.setTheme = function (themeName) {
        // Remove current theme classes
        this.el.classList.remove('wbox-theme-default', 'wbox-theme-material', 'wbox-theme-simple', 'wbox-theme-flat', 'wbox-theme-x');
        // Add requested theme classes
        this.el.classList.add('wbox-theme-' + themeName);
    };
    WBox.prototype.hidePages = function () {
    };
    /**
     * Go to page #
     *
     * @param {number} number Page number to display
     * @memberof WBox
     */
    WBox.prototype.page = function (number) {
        this.Pages.show(number);
    };
    /**
     * Set footer button elements
     *
     * @param {FooterProperties} properties
     * @returns {void}
     * @memberof WBox
     */
    WBox.prototype.setFooter = function (properties) {
        if (properties === undefined) {
            console.warn('Footer Properties must be passed with .setFooter({ props })');
            return null;
        }
        // Update wbox footer properties
        this.footerProperties = properties;
        // Regenerate footer
        this.Footer = new footer_1.Footer(this);
    };
    return WBox;
}());
exports.WBox = WBox;
var Overlay = (function () {
    function Overlay(wboxElId, properties) {
        this.elementExists = false;
        this.showTimeout = 50;
        this.hideTimeout = 375;
        this.debug = false;
        this.wboxElement = wboxElId;
        this.elementID = "wbox-overlay-" + this.wboxElement;
        this.updateProperties(properties);
    }
    Overlay.prototype.doesOverlayExist = function () {
        if (document.getElementById(this.elementID) === null) {
            return this.elementExists = false;
        }
        else {
            return this.elementExists = true;
        }
    };
    // Add overlay element (if does not exist)
    // Added to same element level as parent
    Overlay.prototype.createOverlayElement = function () {
        var overlay;
        if (!this.doesOverlayExist()) {
            overlay = document.createElement('div');
            overlay.id = this.elementID;
            overlay.classList.add('wbox-overlay');
            this.wboxElement.parentElement.appendChild(overlay);
            this.elementExists = true;
        }
        // Update color if set
        if (this.properties.backgroundColor) {
            this.setOverlayColor(this.properties.backgroundColor);
        }
    };
    Overlay.prototype.setOverlayColor = function (color) {
        document.getElementById(this.elementID).style.backgroundColor = color;
    };
    Overlay.prototype.destroyOverlayElement = function () {
        var overlay = document.getElementById(this.elementID);
        if (overlay) {
            overlay.remove();
        }
        this.elementExists = false;
    };
    Overlay.prototype.show = function () {
        // Block if OverlayProperties.show = false
        if (this.properties.show === false) {
            return;
        }
        if (this.debug) {
            console.log('Overlay->showing..');
        }
        var overlay = document.getElementById(this.elementID);
        overlay.style.display = 'block';
        window.setTimeout(function () {
            overlay.style.opacity = '1';
        }, this.showTimeout);
    };
    Overlay.prototype.hide = function () {
        // Block if OverlayProperties.show = false
        if (this.properties.show === false) {
            return;
        }
        if (this.debug) {
            console.log('Overlay->hiding..');
        }
        var overlay = document.getElementById(this.elementID);
        overlay.style.opacity = '0';
        window.setTimeout(function () {
            overlay.style.display = 'none';
        }, this.hideTimeout);
    };
    Overlay.prototype.updateProperties = function (properties) {
        this.properties = properties;
        // Create element if OverlayProperties.show is set = true
        if (this.properties.show) {
            this.createOverlayElement();
        }
        else {
            this.destroyOverlayElement();
        }
    };
    return Overlay;
}());
exports.Overlay = Overlay;


text:
/* add click event for navbar-toggle item */
$(function() {
  $('#btn-toggle-nav').click(function() {
    var item = $('nav.navbar-collapse');
    item.slideToggle(500, function() {
      item[0].style.removeProperty('display');
      item.toggleClass('in');
    });
  });
});

// headroom
var myElement = document.querySelector("header");
var headroom  = new Headroom(myElement);
headroom.init();


text:
using namespace llvm;

namespace {
  class UnpackMachineBundles : public MachineFunctionPass {
  public:
    static char ID; // Pass identification
    UnpackMachineBundles(
        std::function<bool(const MachineFunction &)> Ftor = nullptr)
        : MachineFunctionPass(ID), PredicateFtor(std::move(Ftor)) {
      initializeUnpackMachineBundlesPass(*PassRegistry::getPassRegistry());
    }

    bool runOnMachineFunction(MachineFunction &MF) override;

  private:
    std::function<bool(const MachineFunction &)> PredicateFtor;
  };
} // end anonymous namespace

char UnpackMachineBundles::ID = 0;
char &llvm::UnpackMachineBundlesID = UnpackMachineBundles::ID;
INITIALIZE_PASS(UnpackMachineBundles, "unpack-mi-bundles",
                "Unpack machine instruction bundles", false, false)

bool UnpackMachineBundles::runOnMachineFunction(MachineFunction &MF) {
  if (PredicateFtor && !PredicateFtor(MF))
    return false;

  bool Changed = false;
  for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
    MachineBasicBlock *MBB = &*I;

    for (MachineBasicBlock::instr_iterator MII = MBB->instr_begin(),
           MIE = MBB->instr_end(); MII != MIE; ) {
      MachineInstr *MI = &*MII;

      // Remove BUNDLE instruction and the InsideBundle flags from bundled
      // instructions.
      if (MI->isBundle()) {
        while (++MII != MIE && MII->isBundledWithPred()) {
          MII->unbundleFromPred();
          for (unsigned i = 0, e = MII->getNumOperands(); i != e; ++i) {
            MachineOperand &MO = MII->getOperand(i);
            if (MO.isReg() && MO.isInternalRead())
              MO.setIsInternalRead(false);
          }
        }
        MI->eraseFromParent();

        Changed = true;
        continue;
      }

      ++MII;
    }
  }

  return Changed;
}

FunctionPass *
llvm::createUnpackMachineBundles(
    std::function<bool(const MachineFunction &)> Ftor) {
  return new UnpackMachineBundles(std::move(Ftor));
}

namespace {
  class FinalizeMachineBundles : public MachineFunctionPass {
  public:
    static char ID; // Pass identification
    FinalizeMachineBundles() : MachineFunctionPass(ID) {
      initializeFinalizeMachineBundlesPass(*PassRegistry::getPassRegistry());
    }

    bool runOnMachineFunction(MachineFunction &MF) override;
  };
} // end anonymous namespace

char FinalizeMachineBundles::ID = 0;
char &llvm::FinalizeMachineBundlesID = FinalizeMachineBundles::ID;
INITIALIZE_PASS(FinalizeMachineBundles, "finalize-mi-bundles",
                "Finalize machine instruction bundles", false, false)

bool FinalizeMachineBundles::runOnMachineFunction(MachineFunction &MF) {
  return llvm::finalizeBundles(MF);
}

/// finalizeBundle - Finalize a machine instruction bundle which includes
/// a sequence of instructions starting from FirstMI to LastMI (exclusive).
/// This routine adds a BUNDLE instruction to represent the bundle, it adds
/// IsInternalRead markers to MachineOperands which are defined inside the
/// bundle, and it copies externally visible defs and uses to the BUNDLE
/// instruction.
void llvm::finalizeBundle(MachineBasicBlock &MBB,
                          MachineBasicBlock::instr_iterator FirstMI,
                          MachineBasicBlock::instr_iterator LastMI) {
  assert(FirstMI != LastMI && "Empty bundle?");
  MIBundleBuilder Bundle(MBB, FirstMI, LastMI);

  MachineFunction &MF = *MBB.getParent();
  const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo();
  const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();

  MachineInstrBuilder MIB =
      BuildMI(MF, FirstMI->getDebugLoc(), TII->get(TargetOpcode::BUNDLE));
  Bundle.prepend(MIB);

  SmallVector<unsigned, 32> LocalDefs;
  SmallSet<unsigned, 32> LocalDefSet;
  SmallSet<unsigned, 8> DeadDefSet;
  SmallSet<unsigned, 16> KilledDefSet;
  SmallVector<unsigned, 8> ExternUses;
  SmallSet<unsigned, 8> ExternUseSet;
  SmallSet<unsigned, 8> KilledUseSet;
  SmallSet<unsigned, 8> UndefUseSet;
  SmallVector<MachineOperand*, 4> Defs;
  for (; FirstMI != LastMI; ++FirstMI) {
    for (unsigned i = 0, e = FirstMI->getNumOperands(); i != e; ++i) {
      MachineOperand &MO = FirstMI->getOperand(i);
      if (!MO.isReg())
        continue;
      if (MO.isDef()) {
        Defs.push_back(&MO);
        continue;
      }

      unsigned Reg = MO.getReg();
      if (!Reg)
        continue;
      assert(TargetRegisterInfo::isPhysicalRegister(Reg));
      if (LocalDefSet.count(Reg)) {
        MO.setIsInternalRead();
        if (MO.isKill())
          // Internal def is now killed.
          KilledDefSet.insert(Reg);
      } else {
        if (ExternUseSet.insert(Reg).second) {
          ExternUses.push_back(Reg);
          if (MO.isUndef())
            UndefUseSet.insert(Reg);
        }
        if (MO.isKill())
          // External def is now killed.
          KilledUseSet.insert(Reg);
      }
    }

    for (unsigned i = 0, e = Defs.size(); i != e; ++i) {
      MachineOperand &MO = *Defs[i];
      unsigned Reg = MO.getReg();
      if (!Reg)
        continue;

      if (LocalDefSet.insert(Reg).second) {
        LocalDefs.push_back(Reg);
        if (MO.isDead()) {
          DeadDefSet.insert(Reg);
        }
      } else {
        // Re-defined inside the bundle, it's no longer killed.
        KilledDefSet.erase(Reg);
        if (!MO.isDead())
          // Previously defined but dead.
          DeadDefSet.erase(Reg);
      }

      if (!MO.isDead()) {
        for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) {
          unsigned SubReg = *SubRegs;
          if (LocalDefSet.insert(SubReg).second)
            LocalDefs.push_back(SubReg);
        }
      }
    }

    Defs.clear();
  }

  SmallSet<unsigned, 32> Added;
  for (unsigned i = 0, e = LocalDefs.size(); i != e; ++i) {
    unsigned Reg = LocalDefs[i];
    if (Added.insert(Reg).second) {
      // If it's not live beyond end of the bundle, mark it dead.
      bool isDead = DeadDefSet.count(Reg) || KilledDefSet.count(Reg);
      MIB.addReg(Reg, getDefRegState(true) | getDeadRegState(isDead) |
                 getImplRegState(true));
    }
  }

  for (unsigned i = 0, e = ExternUses.size(); i != e; ++i) {
    unsigned Reg = ExternUses[i];
    bool isKill = KilledUseSet.count(Reg);
    bool isUndef = UndefUseSet.count(Reg);
    MIB.addReg(Reg, getKillRegState(isKill) | getUndefRegState(isUndef) |
               getImplRegState(true));
  }
}

/// finalizeBundle - Same functionality as the previous finalizeBundle except
/// the last instruction in the bundle is not provided as an input. This is
/// used in cases where bundles are pre-determined by marking instructions
/// with 'InsideBundle' marker. It returns the MBB instruction iterator that
/// points to the end of the bundle.
MachineBasicBlock::instr_iterator
llvm::finalizeBundle(MachineBasicBlock &MBB,
                     MachineBasicBlock::instr_iterator FirstMI) {
  MachineBasicBlock::instr_iterator E = MBB.instr_end();
  MachineBasicBlock::instr_iterator LastMI = std::next(FirstMI);
  while (LastMI != E && LastMI->isInsideBundle())
    ++LastMI;
  finalizeBundle(MBB, FirstMI, LastMI);
  return LastMI;
}

/// finalizeBundles - Finalize instruction bundles in the specified
/// MachineFunction. Return true if any bundles are finalized.
bool llvm::finalizeBundles(MachineFunction &MF) {
  bool Changed = false;
  for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
    MachineBasicBlock &MBB = *I;
    MachineBasicBlock::instr_iterator MII = MBB.instr_begin();
    MachineBasicBlock::instr_iterator MIE = MBB.instr_end();
    if (MII == MIE)
      continue;
    assert(!MII->isInsideBundle() &&
           "First instr cannot be inside bundle before finalization!");

    for (++MII; MII != MIE; ) {
      if (!MII->isInsideBundle())
        ++MII;
      else {
        MII = finalizeBundle(MBB, std::prev(MII));
        Changed = true;
      }
    }
  }

  return Changed;
}

//===----------------------------------------------------------------------===//
// MachineOperand iterator
//===----------------------------------------------------------------------===//

MachineOperandIteratorBase::VirtRegInfo
MachineOperandIteratorBase::analyzeVirtReg(unsigned Reg,
                    SmallVectorImpl<std::pair<MachineInstr*, unsigned> > *Ops) {
  VirtRegInfo RI = { false, false, false };
  for(; isValid(); ++*this) {
    MachineOperand &MO = deref();
    if (!MO.isReg() || MO.getReg() != Reg)
      continue;

    // Remember each (MI, OpNo) that refers to Reg.
    if (Ops)
      Ops->push_back(std::make_pair(MO.getParent(), getOperandNo()));

    // Both defs and uses can read virtual registers.
    if (MO.readsReg()) {
      RI.Reads = true;
      if (MO.isDef())
        RI.Tied = true;
    }

    // Only defs can write.
    if (MO.isDef())
      RI.Writes = true;
    else if (!RI.Tied && MO.getParent()->isRegTiedToDefOperand(getOperandNo()))
      RI.Tied = true;
  }
  return RI;
}

MachineOperandIteratorBase::PhysRegInfo
MachineOperandIteratorBase::analyzePhysReg(unsigned Reg,
                                           const TargetRegisterInfo *TRI) {
  bool AllDefsDead = true;
  PhysRegInfo PRI = {false, false, false, false, false, false, false, false};

  assert(TargetRegisterInfo::isPhysicalRegister(Reg) &&
         "analyzePhysReg not given a physical register!");
  for (; isValid(); ++*this) {
    MachineOperand &MO = deref();

    if (MO.isRegMask() && MO.clobbersPhysReg(Reg)) {
      PRI.Clobbered = true;
      continue;
    }

    if (!MO.isReg())
      continue;

    unsigned MOReg = MO.getReg();
    if (!MOReg || !TargetRegisterInfo::isPhysicalRegister(MOReg))
      continue;

    if (!TRI->regsOverlap(MOReg, Reg))
      continue;

    bool Covered = TRI->isSuperRegisterEq(Reg, MOReg);
    if (MO.readsReg()) {
      PRI.Read = true;
      if (Covered) {
        PRI.FullyRead = true;
        if (MO.isKill())
          PRI.Killed = true;
      }
    } else if (MO.isDef()) {
      PRI.Defined = true;
      if (Covered)
        PRI.FullyDefined = true;
      if (!MO.isDead())
        AllDefsDead = false;
    }
  }

  if (AllDefsDead) {
    if (PRI.FullyDefined || PRI.Clobbered)
      PRI.DeadDef = true;
    else if (PRI.Defined)
      PRI.PartialDeadDef = true;
  }

  return PRI;
}


text:
const nav = document.querySelector('#main');
const navTop = nav.offsetTop;

function fixNav() {
  (window.scrollY >= navTop) ? fix() : unfix() ;
}

function fix() {
  document.body.style.paddingTop = nav.offsetHeight + 'px';
  document.body.classList.add('fixed-nav');
}

function unfix() {
  document.body.style.paddingTop = 0;
  document.body.classList.remove('fixed-nav');
}

window.addEventListener('scroll', fixNav);


text:
{% extends "page.html" %}
{% block title %}{{ event.title}} | {{ super() }}{% endblock %}
{% import "macros.html" as macros %}

{% set should_include_hero = False%}

{% block css %}
{{ super() }}
{% assets "scss_single_event" %}
<link rel="stylesheet" type="text/css" href="{{ ASSET_URL }}">
{% endassets %}
{% endblock %}

{% block heroclass %}hidden{% endblock %}
{% block hero %}
{% endblock %}

{% block mainclass %}no-hero{% endblock %}
{% block main %}

{{ event.title }}

Details

            {% if event.is_multiday() %}

                {{ event.human_readable_datetime() }}

            {% else %}

                {{ event.human_readable_date() }}

                {{ event.human_readable_time() }}

            {% endif %}

                {{ event.location }}

            {% if event.facebook_url %}

                    RSVP on Facebook

            {% endif %}

            {{ event.long_description | safe }}

Upcoming Events

            {% for event in upcoming_events %}
                {{ macros.small_event(event) }}
            {% endfor %}

{% endblock main %}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#include "pal_types.h"
#include "opensslshim.h"

/*
Cleans up and deletes an BIGNUM instance.

Implemented by:
1) Calling BN_clear_free

No-op if a is null.
The given BIGNUM pointer is invalid after this call.
Always succeeds.
*/
extern "C" void CryptoNative_BigNumDestroy(BIGNUM* a);

/*
Shims the BN_bin2bn method.
*/
extern "C" BIGNUM* CryptoNative_BigNumFromBinary(const uint8_t* s, int32_t len);

/*
Shims the BN_bn2bin method.
*/
extern "C" int32_t CryptoNative_BigNumToBinary(const BIGNUM* a, uint8_t* to);

/*
Returns the number of bytes needed to export a BIGNUM.
*/
extern "C" int32_t CryptoNative_GetBigNumBytes(const BIGNUM* a);


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-dataflow-parent</artifactId>
		<version>2.10.0-SNAPSHOT</version>
	</parent>
	<artifactId>spring-cloud-dataflow-single-step-batch-job</artifactId>
	<packaging>jar</packaging>
	<properties>
		<plexus.utils.version>3.3.0</plexus.utils.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-autoconfigure</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-batch</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-task-batch</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-single-step-batch-job</artifactId>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mariadb.jdbc</groupId>
			<artifactId>mariadb-java-client</artifactId>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.batch</groupId>
			<artifactId>spring-batch-test</artifactId>
		</dependency>
		<dependency>
			<groupId>org.codehaus.jettison</groupId>
			<artifactId>jettison</artifactId>
			<version>1.5.1</version>
		</dependency>
		<dependency>
			<groupId>com.microsoft.sqlserver</groupId>
			<artifactId>mssql-jdbc</artifactId>
			<scope>runtime</scope>
			<exclusions>
				<exclusion>
					<groupId>com.microsoft.azure</groupId>
					<artifactId>azure-keyvault</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.junit.vintage</groupId>
					<artifactId>junit-vintage-engine</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>io.micrometer.prometheus</groupId>
			<artifactId>prometheus-rsocket-spring</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dataflow-apps-metadata-plugin</artifactId>
				<configuration>
					<storeFilteredMetadata>true</storeFilteredMetadata>
					<metadataFilter>
						<names>
						</names>
						<sourceTypes>
							<filter>org.springframework.cloud.task.batch.autoconfigure.SingleStepJobProperties</filter>
							<filter>org.springframework.boot.autoconfigure.batch.BatchProperties$Job</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.flatfile.FlatFileItemReaderProperties</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.flatfile.FlatFileItemWriterProperties</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.jdbc.JdbcBatchItemWriterProperties</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.jdbc.JdbcCursorItemReaderProperties</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.kafka.KafkaItemReaderProperties</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.kafka.KafkaItemWriterProperties</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.rabbit.AmqpItemReaderProperties</filter>
							<filter>org.springframework.cloud.task.batch.autoconfigure.rabbit.AmqpItemWriterProperties</filter>
							<filter>org.springframework.boot.autoconfigure.amqp.RabbitProperties</filter>
							<filter>org.springframework.boot.autoconfigure.amqp.RabbitProperties$Template</filter>
							<filter>org.springframework.boot.autoconfigure.amqp.RabbitProperties$Retry</filter>
							<filter>org.springframework.boot.autoconfigure.amqp.RabbitProperties$ListenerRetry</filter>
							<filter>org.springframework.cloud.task.configuration.TaskProperties</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Consumer</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Producer</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Template</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Listener</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Ssl</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Jaas</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Security</filter>
							<filter>org.springframework.boot.autoconfigure.kafka.KafkaProperties$Cleanup</filter>
							<filter>org.springframework.boot.autoconfigure.jdbc.DataSourceProperties</filter>
							<filter>org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$Xa</filter>
						</sourceTypes>
					</metadataFilter>
				</configuration>
				<executions>
					<execution>
						<id>aggregate-metadata</id>
						<phase>compile</phase>
						<goals>
							<goal>aggregate-metadata</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
package org.syzygist.split

object StreamFunctions {
  def splitStream[A](xs: Stream[A])(p: A => Boolean): Stream[Vector[A]] =
    xs.span(x => !p(x)) match {
      case (current, _ #:: rest) => current.toVector #:: splitStream(rest)(p)
      case (current, _) => current.toVector #:: Stream.empty
    }
}


text:
@implementation NSDate (CWDatePicker)

static const unsigned componentFlags = (NSYearCalendarUnit| NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekCalendarUnit |  NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSWeekdayCalendarUnit | NSWeekdayOrdinalCalendarUnit);

+ (NSCalendar *) currentCalendar
{
    static dispatch_once_t pred;
    static __strong NSCalendar *sharedCalendar = nil;

    dispatch_once(&pred, ^{
        sharedCalendar = [NSCalendar autoupdatingCurrentCalendar];
    });

    return sharedCalendar;
}

+ (NSString*)localizedMonthAbbreviationForMonth:(NSUInteger)month {
    NSCalendar *cal = [NSCalendar currentCalendar];
    NSDateComponents *comps = [[NSDateComponents alloc] init];
    [comps setMonth:month];
    NSDate *date = [cal dateFromComponents:comps];

    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"MMM"];
    return [dateFormatter stringFromDate:date];
}

+ (NSDate *)dateFromDay:(NSInteger)day month:(NSInteger)month year:(NSInteger)year
{
    NSCalendar *calendar = [NSCalendar currentCalendar];
    NSDateComponents *components = [[NSDateComponents alloc] init];
    [calendar setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];

    [components setDay:day];

    if (month <= 0) {
        [components setMonth:12-month];
        [components setYear:year-1];
    } else if (month >= 13) {
        [components setMonth:month-12];
        [components setYear:year+1];
    } else {
        [components setMonth:month];
        [components setYear:year];
    }

    return [NSDate dateWithNoTime:[calendar dateFromComponents:components] middleDay:NO];
}

- (NSString *) stringWithDateStyle: (NSDateFormatterStyle) dateStyle timeStyle: (NSDateFormatterStyle) timeStyle
{
    NSDateFormatter *formatter = [NSDateFormatter new];
    formatter.dateStyle = dateStyle;
    formatter.timeStyle = timeStyle;
    formatter.locale = [NSLocale currentLocale];
    return [formatter stringFromDate:self];
}

- (NSString *) mediumDateString
{
    return [self stringWithDateStyle:NSDateFormatterMediumStyle  timeStyle:NSDateFormatterNoStyle];
}

+ (NSDate *)dateWithNoTime:(NSDate *)dateTime middleDay:(BOOL)middle
{
    if( dateTime == nil ) {
        dateTime = [NSDate date];
    }

    NSCalendar       *calendar   = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    [calendar setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
    NSDateComponents *components = [[NSDateComponents alloc] init];
    components = [calendar components:NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit
                             fromDate:dateTime];

    NSDate *dateOnly = [calendar dateFromComponents:components];

    if (middle)
        dateOnly = [dateOnly dateByAddingTimeInterval:(60.0 * 60.0 * 12.0)];           // Push to Middle of day.

    return dateOnly;
}

+ (NSUInteger)daysInMonth:(NSUInteger)month year:(NSUInteger)year {
    NSCalendar* cal = [NSCalendar currentCalendar];
    NSDateComponents* comps = [[NSDateComponents alloc] init];

    [comps setMonth:month];
    [comps setYear:year];

    NSRange range = [cal rangeOfUnit:NSDayCalendarUnit
                              inUnit:NSMonthCalendarUnit
                             forDate:[cal dateFromComponents:comps]];
    return range.length;
}

- (NSInteger) day
{
	NSDateComponents *components = [[NSDate currentCalendar] components:componentFlags fromDate:self];
	return components.day;
}

- (NSInteger) month
{
	NSDateComponents *components = [[NSDate currentCalendar] components:componentFlags fromDate:self];
	return components.month;
}

- (NSInteger) year
{
	NSDateComponents *components = [[NSDate currentCalendar] components:componentFlags fromDate:self];
	return components.year;
}

@end


text:
package examples.fmsynthesis;

import net.beadsproject.beads.data.Buffer;
import net.beadsproject.beads.ugens.Function;
import net.beadsproject.beads.ugens.Gain;
import net.beadsproject.beads.ugens.Glide;
import net.beadsproject.beads.ugens.WavePlayer;
import net.happybrackets.core.HBAction;
import net.happybrackets.core.instruments.WaveModule;
import net.happybrackets.device.HB;

import java.lang.invoke.MethodHandles;

/**
 * basic FM wave generating a 1KHz carrier with a depth of 500Hz
 * Modulating at a rate of 1Hz
 * We will be using a function to calculate the frequency the carrier wavePlayer needs to be at
 */
public class BasicFM implements HBAction {
    @Override
    public void action(HB hb) {

        // remove this code if you do not want other compositions to run at the same time as this one
        hb.reset();
        hb.setStatus(this.getClass().getSimpleName() + " Loaded");

        final float INITIAL_VOLUME = 0.1f; // define how loud we want the sound
        Glide audioVolume = new Glide(INITIAL_VOLUME);

        final float CARRIER_FREQUENCY = 1000; //This is the centre frequency
        final float MODULATOR_DEPTH_FREQUENCY = 500;    // THis is how much we will change the centre frequency
        final float MODULATOR_RATE_FREQUENCY = 1;  // This is the rate at which we will change the frequency

        // We need to create UGen objects so we can use them inside a function
        //these are the parameters that will be used to calculate the frequency at any point in time
        Glide modulatorFrequency = new Glide(MODULATOR_RATE_FREQUENCY);
        Glide modulatorDepthFrequency = new Glide(MODULATOR_DEPTH_FREQUENCY);
        Glide carrierFrequency = new Glide(CARRIER_FREQUENCY);

        // We need to create a sine wave that will change the modulatorDepth
        WavePlayer FM_modulator = new WavePlayer(modulatorFrequency, Buffer.SINE);

        // We need to create a function to define what the frequency of the carrier wavePlayer will be
        // As the value of the FM_modulator changes from -1, through 0, and then to 1 and then back
        // The output of this function will give a value ranging from 500 to 1500
        Function modFunction = new Function(FM_modulator, modulatorDepthFrequency, carrierFrequency) {
            @Override
            public float calculate() {
                return
                        // this is first argument of the function, the FM_modulator.
                        x[0] // This is swinging from -1 to + 1
                        * x[1] // this is the second argument, which is our depth x[0] * x[1] gives a value of -500 to +500
                        + x[2]; // this is our third argument, carrierFrequency. Adding x[0] * x[1] to this value will give 500 to 1500
            }
        };

        // Now make our player using the modFunction as the frequency
        WaveModule player = new WaveModule(modFunction, INITIAL_VOLUME, Buffer.SINE);
        player.connectTo(HB.getAudioOutput());

    }

    //<editor-fold defaultstate="collapsed" desc="Debug Start">
    /**
     * This function is used when running sketch in IntelliJ IDE for debugging or testing
     *
     * @param args standard args required
     */
    public static void main(String[] args) {

        try {
            HB.runDebug(MethodHandles.lookup().lookupClass());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    //</editor-fold>
}


text:
package org.xwalk.app.template;

import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import org.xwalk.app.XWalkRuntimeActivityBase;

public class AppTemplateActivity extends XWalkRuntimeActivityBase {
    @Override
    protected void didTryLoadRuntimeView(View runtimeView) {
        if (runtimeView != null) {
            setContentView(runtimeView);
            getRuntimeView().loadAppFromUrl("file:///android_asset/index.html");
        } else {
            TextView msgText = new TextView(this);
            msgText.setText(R.string.download_dialog_msg);
            msgText.setTextSize(36);
            msgText.setTextColor(Color.BLACK);
            setContentView(msgText);
        }
    }
}


text:
const slack = require("../Shared/slack.js");

module.exports = function (context, myQueueItem) {
    context.log('Node.js queue trigger function processed work item', myQueueItem);
    return slack.push(process.env.SLACK_WEBHOOK_URL, myQueueItem);
};


text:
using System;
using NetOffice;
using NetOffice.Attributes;
namespace NetOffice.WordApi.Enums
{
	 /// <summary>
	 /// SupportByVersion Word 12, 14, 15, 16
	 /// </summary>
	 ///<remarks> MSDN Online Documentation: <see href="https://docs.microsoft.com/en-us/office/vba/api/Word.WdOMathVertAlignType"/> </remarks>
	[SupportByVersion("Word", 12,14,15,16)]
	[EntityType(EntityType.IsEnum)]
	public enum WdOMathVertAlignType
	{
		 /// <summary>
		 /// SupportByVersion Word 12, 14, 15, 16
		 /// </summary>
		 /// <remarks>0</remarks>
		 [SupportByVersion("Word", 12,14,15,16)]
		 wdOMathVertAlignCenter = 0,

		 /// <summary>
		 /// SupportByVersion Word 12, 14, 15, 16
		 /// </summary>
		 /// <remarks>1</remarks>
		 [SupportByVersion("Word", 12,14,15,16)]
		 wdOMathVertAlignTop = 1,

		 /// <summary>
		 /// SupportByVersion Word 12, 14, 15, 16
		 /// </summary>
		 /// <remarks>2</remarks>
		 [SupportByVersion("Word", 12,14,15,16)]
		 wdOMathVertAlignBottom = 2
	}
}


text:
package io.advantageous.qbit.spring.properties;

import io.advantageous.qbit.GlobalConstants;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Configuration holder for qbit request queue properties.
 *
 * @author geoffc@gmail.com (Geoff Chandler)
 */
@ConfigurationProperties("qbit.queue.request")
public class RequestQueueProperties {
    private int batchSize = GlobalConstants.BATCH_SIZE;
    private int batchCount = GlobalConstants.NUM_BATCHES;
    private int pollWait = GlobalConstants.POLL_WAIT;

    public int getBatchSize() {
        return batchSize;
    }

    public void setBatchSize(int batchSize) {
        this.batchSize = batchSize;
    }

    public int getBatchCount() {
        return batchCount;
    }

    public void setBatchCount(int batchCount) {
        this.batchCount = batchCount;
    }

    public int getPollWait() {
        return pollWait;
    }

    public void setPollWait(int pollWait) {
        this.pollWait = pollWait;
    }
}


text:
namespace DotNetGroup.Services.Web
{
    using System;
    using System.Linq;

    using HtmlAgilityPack;

    public interface IContentFormatter
    {
        string Format(string content);
    }

    public class ContentFormatter : IContentFormatter
    {
        public ContentFormatter(int maxUrlTextLength = 50)
        {
            this.MaxUrlTextLength = maxUrlTextLength;
        }

        public int MaxUrlTextLength { get; private set; }

        public string Format(string content)
        {
            var html = new HtmlDocument();
            html.LoadHtml(content);

            var hrefs = html.DocumentNode.SelectNodes("//a");
            if (hrefs != null)
            {
                foreach (var href in hrefs)
                {
                    Uri uri;
                    if (Uri.TryCreate(href.InnerText, UriKind.Absolute, out uri))
                    {
                        href.SetAttributeValue("title", href.InnerText);
                        href.InnerHtml = href.InnerText.Length > this.MaxUrlTextLength
                                             ? string.Format("{0}/../{1}", uri.Host, uri.Segments.Last())
                                             : uri.Host + uri.PathAndQuery;
                    }
                }
            }

            return html.DocumentNode.InnerHtml;
        }
    }
}


text:
using System.Collections.Generic;
using Tab.Slack.Common.Model.Events.Messages;

namespace Tab.Slack.Common.Model
{
    /// <summary>
    /// Contains information about a Slack group.
    /// More information can be found at https://api.slack.com/types/group.
    /// </summary>
    public class Group : FlexibleJsonModel
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public bool IsGroup { get; set; }
        public long Created { get; set; }
        public string Creator { get; set; }
        public bool IsArchived { get; set; }
        public List<string> Members { get; set; }
        public Topic Topic { get; set; }
        public Purpose Purpose { get; set; }

        public bool IsOpen { get; set; }
        public string LastRead { get; set; }
        public int UnreadCount { get; set; }
        public MessageBase Latest { get; set; }
    }
}


text:
import mongoose = require("mongoose");

export var documentSchema = new mongoose.Schema({
    title: String,
    text: String,
    idtest: String
});

export interface IDocument extends mongoose.Document {
    title: String;
    text: String;
    idtest: String;
}

export var repository = mongoose.model<IDocument>("document", documentSchema);


text:
package com.azure.resourcemanager.devcenter.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devcenter.fluent.models.HealthCheckStatusDetailsInner;
import org.junit.jupiter.api.Test;

public final class HealthCheckStatusDetailsInnerTests {
    @Test
    public void testDeserialize() {
        HealthCheckStatusDetailsInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"startDateTime\":\"2021-01-15T20:49Z\",\"endDateTime\":\"2021-04-16T00:49:55Z\",\"healthChecks\":[{\"status\":\"Passed\",\"displayName\":\"ujitcjedftww\",\"startDateTime\":\"2021-04-17T00:18:26Z\",\"endDateTime\":\"2021-01-22T13:54:08Z\",\"errorType\":\"v\",\"recommendedAction\":\"pzfoqoui\",\"additionalDetails\":\"bxarzgszufoxci\"},{\"status\":\"Passed\",\"displayName\":\"doamciodhkha\",\"startDateTime\":\"2021-06-05T04:56:19Z\",\"endDateTime\":\"2021-11-22T06:47:21Z\",\"errorType\":\"bon\",\"recommendedAction\":\"ntoe\",\"additionalDetails\":\"kdwbwhkszz\"}]},\"id\":\"rvexztvb\",\"name\":\"qgsfraoyzkoow\",\"type\":\"lmnguxaw\"}")
                .toObject(HealthCheckStatusDetailsInner.class);
    }

    @Test
    public void testSerialize() {
        HealthCheckStatusDetailsInner model = new HealthCheckStatusDetailsInner();
        model = BinaryData.fromObject(model).toObject(HealthCheckStatusDetailsInner.class);
    }
}


text:
<Record>
<Term>Mivazerol</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<ParentTerm>Alpha-Adrenergic Agonist</ParentTerm>
<ClassificationPath>Chemicals_and_Drugs_Kind/Drug, Food, Chemical or Biomedical Material/Pharmacologic Substance/Adjuvant/Adrenergic Agent/Alpha-Adrenergic Agonist/Mivazerol</ClassificationPath>
<BroaderTerm>Mivazerol</BroaderTerm>
<BroaderTerm>Chemicals_and_Drugs_Kind</BroaderTerm>
<BroaderTerm>Pharmacologic Substance</BroaderTerm>
<BroaderTerm>Adjuvant</BroaderTerm>
<BroaderTerm>Adrenergic Agent</BroaderTerm>
<BroaderTerm>Drug, Food, Chemical or Biomedical Material</BroaderTerm>
<BroaderTerm>Alpha-Adrenergic Agonist</BroaderTerm>
<Synonym>MIVAZEROL</Synonym>
<Synonym>Mivazerol</Synonym>
<Source>NCI Thesaurus</Source>
</Record>


text:
require "google_currency_exchange/version"
require 'net/http'
require 'base'

class GoogleCurrencyExchange
  # Your code goes here...
  include Base
  attr_accessor :amount, :from, :to

  def initialize(amount, from, to)
    @amount = amount
    @from = from
    @to = to
  end

  def process
    call_google_finance(@amount, @from, @to)
  end
end


text:
package bigproject.types;

public class Nil extends Type {

	public int size() {
		return -1;
	}

}


text:
package sk.lazyman.gizmo.component;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupStream;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.parser.XmlTag;
import org.apache.wicket.model.IModel;

/**
 * @author lazyman
 */
public class BookmarkableLabeledLink<T> extends BookmarkablePageLink<T> {

    private IModel<String> model;

    public BookmarkableLabeledLink(String id, IModel<String> model, Class pageClass) {
        super(id, pageClass);
        this.model = model;
    }

    @Override
    public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
        String text = model.getObject();
        if (StringUtils.isNotEmpty(text)) {
            replaceComponentTagBody(markupStream, openTag, text);
            return;
        }

        super.onComponentTagBody(markupStream, openTag);
    }

    @Override
    protected void onComponentTag(ComponentTag tag) {
        super.onComponentTag(tag);

        if (tag.isOpenClose()) {
            tag.setType(XmlTag.TagType.OPEN);
        }
    }
}


text:
require 'test_helper'

class SearchControllerTest < ActionController::TestCase
  def setup
    @db = Catalog::Test::MetadataDatabase.new
    @gateway = flexmock(:reinit => nil)
    @controller = SearchController.new(@gateway)
  end

  test 'clean page cleans session and shows search page' do
    get :clean_page
    assert_nil session[:geo]
    assert_redirected_to :controller => 'search', :action => 'index'
  end

  test 'saves geo to session' do
    post :save_geo, :x1=>'1', :y1=>'1', :x2 => '2', :y2 => '1',
        :x3=>'1', :y3=>'2', :x4 => '2', :y4 => '2'
    assert_equal Polygon.parse('1 1 2 1 1 2 2 2'), session[:geo]
  end

  test 'saving geo with invalid values prints error message and cleans session' do
    post :save_geo, :x1=>'BOO', :y1=>'1', :x2 => '2', :y2 => '2'
    assert_not_nil assigns(:error_message)
    assert_nil session[:extent]
  end

  test 'if query is not specified result is empty' do
    post :index
    assert_equal assigns(:metadatas), []
  end

  test 'set empty list to metadatas if cant find any metadata' do
    filter = Catalog::Core::Filter.new(PropertyIsLike.new('AnyText', query = 'broom bram'))
    @gateway.should_receive(:find_all_by).with(filter).once.and_return([])
    post :index, :query => query
    assert_equal assigns(:metadatas), []
  end

  test 'test returns metadatas by full text' do
    md = @db.create_metadata_with(:title => 'my title')
    filter = Catalog::Core::Filter.new(PropertyIsLike.new('AnyText', query = 'my'))
    @gateway.should_receive(:find_all_by).with(filter).once.and_return([md])
    post :index, :query => query
    assert_equal assigns(:metadatas), [md]
  end

  test 'like filter for query and extent filter for extent' do
    p = Polygon.parse('1 1 2 1 1 2 2 2')
    full_text = PropertyIsLike.new('AnyText', query = 'AAA')
    bbox = BBOX.new('BoundingBox', p.envelope)
    filter = Catalog::Core::Filter.new(And.new(full_text, bbox))

    @gateway.should_receive(:find_all_by).with(filter).once.and_return([])
    session[:geo] = p
    post :index, :query => query
  end
end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the specification of a single field</title>

px_delete

px_get_info

Paradox Functions

PHP Manual

px_get_field

(PECL paradox >= 1.0.0)

px_get_field — Returns the specification of a single field

Description

   array px_get_field
    ( resource $pxdoc
   , int $fieldno
   )

Parameters

pxdoc

       Resource identifier of the paradox database
       as returned by px_new().

fieldno

       Number of the field. The first field has number 0. Specifying a field
       number less than 0 and greater or equal the number of fields will
       trigger an error.

Return Values

   Returns the specification of the fieldno
'th database
   field as an associated array. The array contains three fields named
   name, type, and
   size.

px_delete

px_get_info

Paradox Functions

PHP Manual


text:
using Glimpse.Core.Extensibility;
using Glimpse.Core.Extensions;
using LightNode.Server;
using System.Collections.Generic;
using System.Linq;

namespace Glimpse.LightNode
{
    public class LightNodeTab : TabBase, ITabSetup, ILayoutControl
    {
        class LightNodeTabResult
        {
            public string Path { get; set; }
            public Dictionary<string, object> Parameters { get; set; }
            public object Result { get; set; }
            public List<Execution> Execution { get; set; }
            public Response Response { get; set; }
            public Options Options { get; set; }
        }

        class Execution
        {
            public int? Order { get; set; }
            public string Phase { get; set; }
            public string Name { get; set; }
            public string FromRequestStart { get; set; }
            public string Elapsed { get; set; }
        }

        class Response
        {
            public string OutputContentFormatter { get; set; }
            public int? StatusCode { get; set; }
            public string ReasonPhrase { get; set; }
            public IDictionary<string, string[]> ResponseHeaders { get; set; }
        }

        class Options
        {
            public string DefaultAcceptVerb { get; set; }
            public string DefaultFormatter { get; set; }
            public string SpecifiedFormatters { get; set; }
            public string GlobalFilters { get; set; }
            public bool UseOtherMiddleware { get; set; }
            public bool ParameterStringImplicitNullAsDefault { get; set; }
            public bool ParameterEnumAllowsFieldNameParse { get; set; }
            public string OperationCoordinatorFactory { get; set; }
            public string StreamWriteOption { get; set; }
            public string ErrorHandlingPolicy { get; set; }
            public string OperationMissingHandlingPolicy { get; set; }
        }

        public override string Name
        {
            get { return "LightNode"; }
        }

        public bool KeysHeadings { get { return true; } }

        public void Setup(ITabSetupContext context)
        {
            context.PersistMessages<ProcessStartMessage>();
            context.PersistMessages<InterruptMessage>();
            context.PersistMessages<OperationContext>();
            context.PersistMessages<LightNodeFilterResultMessage>();
            context.PersistMessages<LightNodeExecuteResultMessage>();
        }

        public override object GetData(ITabContext context)
        {
            var processStart = context.GetMessages<ProcessStartMessage>().FirstOrDefault();
            var interrupt = context.GetMessages<InterruptMessage>().FirstOrDefault();
            var operationContext = context.GetMessages<OperationContext>().FirstOrDefault();
            var filterResult = context.GetMessages<LightNodeFilterResultMessage>();
            var executeResult = context.GetMessages<LightNodeExecuteResultMessage>().FirstOrDefault();

            if (processStart == null) return null;
            var environment = processStart.Environment;

            var response = new Response
            {
                OutputContentFormatter = (executeResult != null) ? executeResult.UsedContentFormatter.GetType().Name : null,
                StatusCode = environment.AsResponseStatusCode(),
                ReasonPhrase = environment.AsResponseReasonPhrase(),
                ResponseHeaders = environment.AsResponseHeaders()
            };

            var execution = new List<Execution>();
            foreach (var item in filterResult.Where(x => x.Phase == OperationPhase.Before))
            {
                execution.Add(new Execution { Order = item.Order, Name = item.FilterName, Phase = item.Phase.ToString(), Elapsed = item.Duration.TotalMilliseconds + " ms", FromRequestStart = "T+ " + item.FromRequestStart.TotalMilliseconds + " ms" });
            };
            if (executeResult != null)
            {
                execution.Add(new Execution { Name = operationContext.ToString(), Elapsed = executeResult.Duration.TotalMilliseconds + " ms", FromRequestStart = "T+ " + executeResult.FromRequestStart.TotalMilliseconds + " ms", Phase = executeResult.Phase.ToString() });
            }
            foreach (var item in filterResult.Where(x => x.Phase == OperationPhase.After || x.Phase == OperationPhase.Exception || x.Phase == OperationPhase.ReturnStatusCode))
            {
                execution.Add(new Execution { Order = item.Order, Name = item.FilterName, Phase = item.Phase.ToString(), Elapsed = item.Duration.TotalMilliseconds + " ms", FromRequestStart = "T+ " + item.FromRequestStart.TotalMilliseconds + " ms" });
            }

            var option = (executeResult != null) ? executeResult.Options : processStart.Options;
            var globalFilter = string.Join(", ", option.Filters.Select(x => x.GetType().Name));
            var specifiedFormatters = string.Join(", ", option.SpecifiedFormatters.Select(x => x.GetType().Name));
            return new LightNodeTabResult
            {
                Path = (operationContext != null) ? operationContext.ToString() : environment.AsRequestPath(),
                Parameters = (operationContext != null) ? operationContext.ParameterNames.Zip(operationContext.Parameters, (x, y) => new { x, y }).ToDictionary(x => x.x, x => x.y) : null,
                Result = (executeResult != null) ? executeResult.Result
                       : (interrupt != null) ? interrupt.Reason + System.Environment.NewLine + interrupt.Detail
                       : null,
                Execution = execution,
                Response = response,
                Options = new Options
                {
                    DefaultAcceptVerb = option.DefaultAcceptVerb.ToString(),
                    ErrorHandlingPolicy = option.ErrorHandlingPolicy.ToString(),
                    DefaultFormatter = option.DefaultFormatter.GetType().Name,
                    GlobalFilters = string.IsNullOrWhiteSpace(globalFilter) ? null : globalFilter,
                    SpecifiedFormatters = string.IsNullOrWhiteSpace(specifiedFormatters) ? null : specifiedFormatters,
                    OperationCoordinatorFactory = option.OperationCoordinatorFactory.GetType().Name,
                    OperationMissingHandlingPolicy = option.OperationMissingHandlingPolicy.ToString(),
                    ParameterEnumAllowsFieldNameParse = option.ParameterEnumAllowsFieldNameParse,
                    ParameterStringImplicitNullAsDefault = option.ParameterStringImplicitNullAsDefault,
                    StreamWriteOption = option.StreamWriteOption.ToString(),
                    UseOtherMiddleware = option.UseOtherMiddleware
                }
            };
        }
    }
}


text:
<?php if ($is_admin): ?>

<button type="button" class="btn btn-default" data-toggle="modal" data-target=".bs-example-modal-sm">

		</button>

<?php endif ?>

			Codigo
			Descripcion
			<?php if ($is_admin): ?>
				Acciones
			<?php endif ?>

<?php	foreach ($adscripciones as $adscripcion): ?>

				<?php
					$atributo_boton_modificar = array('data-toggle' => 'modal', 'data-target' => '.bs-example-modal-sm', 'class' => 'btn btn-success glyphicon glyphicon-pencil');
					$atributo_boton_eliminar = array('class' => 'btn btn-danger glyphicon glyphicon-remove', 'onclick' => "javascript:return confirm('Seguro que desea eliminar este dato?')");
				 ?>
				<?php echo $adscripcion->adscripcion;?>
				<?php echo $adscripcion->descripcion;?>
			<?php if ($is_admin): ?>

					<?php echo anchor('adscripciones/edit/'.$adscripcion->id,' ',$atributo_boton_modificar);?>
					<?php echo anchor('adscripciones/delete/'.$adscripcion->id,' ',$atributo_boton_eliminar);?>

			<?php endif ?>

	<?php 	endforeach;?>

 <?php echo $this->pagination->create_links(); ?>

      <?php $this->load->view('adscripciones/form'); ?>


text:
module Autocomplete
  class BoatsController < ApplicationController

    expose(:boats) do
      boats = Boat.alphabetical
      boats = boats.search(params[:q]) if params[:q].present?
      boats.limit(10)
    end

    expose(:boat)

  end
end