text:
/* MOBILE GLOBAL STYLE */
.display-table { display: table !important;width: 100%; }
.display-table .display-cell { display: table-cell !important;float: none !important;vertical-align: top; }
.display-table.top .display-cell { vertical-align: top; }
.display-table.middle .display-cell { vertical-align: middle; }
.display-table.bottom .display-cell { vertical-align: bottom; }

/* MOBILE HEADER */
#site-header { position: fixed;top: 0;left: 0;background: red;z-index: 999; }
	#site-header .lang-wrapper { text-align: left;padding-left: 15px; }
	#site-header .lang-wrapper a,
	#site-header .lang-wrapper a:focus,
	#site-header .lang-wrapper a:visited,
	#site-header .lang-wrapper span { font-family:'FuturaStd-Bold';font-size: 36px;font-size: 3.5vw;font-size: 3.5vmin;font-weight: normal;color: #333;line-height: normal; }
	#site-header .lang-wrapper a.active { color: #FFF; }

	#site-header .header-logo { text-align: center;padding: 10px 0; }
	#site-header .header-logo img { max-width: 70%; }

	#site-header .header-menu { text-align: right;padding-right: 15px; }
	#site-header .header-menu span.glyphicon { font-size: 36px;font-size: 8vw;font-size: 8vmin;font-weight: normal;color: #FFF;line-height: normal; }

/* MMENU CUSTOM STYLE */
#mm-blocker { -webkit-transition: background 1s ease;-moz-transition: background 1s ease;transition: background 1s ease; }
	html.mm-opening .mm-menu.mm-front { background: #444343 !important;width: 100% !important;min-width: 0 !important;max-width: 100% !important; }
	.mm-panel { padding: 0 !important; }
	.mm-panel:before,
	.mm-panel:after { content: none !important;display: none !important; }

#menu .mm-navbar.mm-hasbtns { border-top: 1px solid; }
#menu .mm-navbar.mm-hasbtns .mm-title { font-family:'ooredoo-Bold';font-size: 20px;color: #FFF; }
#menu .mm-prev:before,
#menu .mm-next:after,
#menu .mm-arrow:after { width: 15px;height: 15px;border-color: #FFF; }
#menu .mm-next:after,
#menu .mm-arrow:after { right: 35px; }
#menu.mm-hasnavbar-top-1 .mm-panels { top: 100px; }
#menu .mm-panels > .mm-panel > .mm-listview:first-child,
#menu .mm-panels > .mm-panel > .mm-navbar + .mm-listview { margin-top: 0; }
#menu .mm-listview li.parent img { display: none; }
#menu .mm-panels > .mm-panel { padding: 0 20px; }
#menu .mm-listview > li > a,
#menu .mm-listview > li > span { padding: 15px 40px;font-family:'ooredoo-Bold';font-size: 20px;color: #FFF; }

.mmenu-tab  { position: absolute;top: 0;left: 0;right: 0; }
.mmenu-tab ul { padding: 0;margin: 0;list-style: none;font-size: 0px;text-align: center; }
.mmenu-tab ul li { color: #FFF;position: relative;display: inline-block;width: 21%;max-width: 150px;margin: 0 2%;padding: 10px;box-sizing: border-box;font-size: 18px;text-align: center;vertical-align: top; }
.mmenu-tab ul li .wrap-img { display: inline-block;width: 80%;padding: 5px;border-radius: 15%;overflow: hidden; }
.mmenu-tab ul li img { display: block;width: 100%; }
.mmenu-tab ul li.active .wrap-img { background: #ed1c24; }
.mmenu-tab ul li a,
.mmenu-tab ul li a:focus,
.mmenu-tab ul li a:visited { display: block;width: 100%;height: 100%;position: absolute;top: 0;left: 0;z-index: 9; }
.mmenu-tab ul li a:after { display: none; }

/* FOOTER */
.footer-socmed a { /*width: 20%; max-width: 90px;*/ padding: 9px 10px; border: 0 !important; }
.footer-socmed a img { width: 100%; }


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Myrica pilulifera Rendle

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
import './checkbox.less'
import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component'
import { Group } from './group'
import { Checkbox } from './checkbox'

export type { CheckboxValue, CheckboxProps, CheckboxRef } from './checkbox'
export type { CheckboxGroupProps } from './group'

export default attachPropertiesToComponent(Checkbox, {
  Group,
})


text:
goog.provide('olgm.herald.ImageWMSSource');

/** @suppress {extraRequire} */
goog.require('ol.has');
goog.require('olgm.gm.ImageOverlay');
goog.require('olgm.herald.Source');

/**
 * Listen to a Image WMS layer
 * @param {!ol.Map} ol3map openlayers map
 * @param {!google.maps.Map} gmap google maps map
 * @constructor
 * @extends {olgm.herald.Source}
 */
olgm.herald.ImageWMSSource = function(ol3map, gmap) {
  /**
  * @type {Array.<olgm.herald.ImageWMSSource.LayerCache>}
  * @private
  */
  this.cache_ = [];

  /**
  * @type {Array.<ol.layer.Image>}
  * @private
  */
  this.layers_ = [];

  olgm.herald.Source.call(this, ol3map, gmap);
};
ol.inherits(olgm.herald.ImageWMSSource, olgm.herald.Source);

/**
 * @param {ol.layer.Base} layer layer to watch
 * @override
 */
olgm.herald.ImageWMSSource.prototype.watchLayer = function(layer) {
  var imageLayer = /** {@type ol.layer.Image} */ (layer);
  goog.asserts.assertInstanceof(imageLayer, ol.layer.Image);

  var source = imageLayer.getSource();
  if (!source) {
    return;
  }

  this.layers_.push(imageLayer);

  // opacity
  var opacity = layer.getOpacity();

  var cacheItem = /** {@type olgm.herald.ImageWMSSource.LayerCache} */ ({
    imageOverlay: null,
    lastUrl: null,
    layer: imageLayer,
    listenerKeys: [],
    opacity: opacity,
    zIndex: 0
  });

  // Hide the google layer when the ol3 layer is invisible
  cacheItem.listenerKeys.push(layer.on('change:visible',
      this.handleVisibleChange_.bind(this, cacheItem), this));

  cacheItem.listenerKeys.push(this.ol3map.on('moveend',
      this.handleMoveEnd_.bind(this, cacheItem), this));

  cacheItem.listenerKeys.push(this.ol3map.getView().on('change:resolution',
      this.handleMoveEnd_.bind(this, cacheItem), this));

  // Make sure that any change to the layer source itself also updates the
  // google maps layer
  cacheItem.listenerKeys.push(imageLayer.getSource().on('change',
      this.handleMoveEnd_.bind(this, cacheItem), this));

  // Activate the cache item
  this.activateCacheItem_(cacheItem);
  this.cache_.push(cacheItem);
};

/**
 * Unwatch the WMS Image layer
 * @param {ol.layer.Base} layer layer to unwatch
 * @override
 */
olgm.herald.ImageWMSSource.prototype.unwatchLayer = function(layer) {
  goog.asserts.assertInstanceof(layer, ol.layer.Image);
  var index = this.layers_.indexOf(layer);
  if (index !== -1) {
    this.layers_.splice(index, 1);

    var cacheItem = this.cache_[index];
    olgm.unlistenAllByKey(cacheItem.listenerKeys);

    // Clean previous overlay
    this.resetImageOverlay_(cacheItem);

    // opacity
    layer.setOpacity(cacheItem.opacity);

    this.cache_.splice(index, 1);
  }
};

/**
 * Activate all cache items
 * @override
 */
olgm.herald.ImageWMSSource.prototype.activate = function() {
  olgm.herald.Source.prototype.activate.call(this);
  this.cache_.forEach(this.activateCacheItem_, this);
};

/**
 * Activates an image WMS layer cache item.
 * @param {olgm.herald.ImageWMSSource.LayerCache} cacheItem cacheItem to
 * activate
 * @private
 */
olgm.herald.ImageWMSSource.prototype.activateCacheItem_ = function(
    cacheItem) {
  var layer = cacheItem.layer;
  var visible = layer.getVisible();
  if (visible && this.googleMapsIsActive) {
    cacheItem.lastUrl = null;
    cacheItem.layer.setOpacity(0);
    this.updateImageOverlay_(cacheItem);
  }
};

/**
 * Deactivate all cache items
 * @override
 */
olgm.herald.ImageWMSSource.prototype.deactivate = function() {
  olgm.herald.Source.prototype.deactivate.call(this);
  this.cache_.forEach(this.deactivateCacheItem_, this);
};

/**
 * Deactivates an Image WMS layer cache item.
 * @param {olgm.herald.ImageWMSSource.LayerCache} cacheItem cacheItem to
 * deactivate
 * @private
 */
olgm.herald.ImageWMSSource.prototype.deactivateCacheItem_ = function(
    cacheItem) {
  if (cacheItem.imageOverlay) {
    cacheItem.imageOverlay.setMap(null);
    cacheItem.imageOverlay = null;
  }
  cacheItem.layer.setOpacity(cacheItem.opacity);
};

/**
 * Generate a wms request url for a single image
 * @param {ol.layer.Image} layer layer to query
 * @return {string} url to the requested tile
 * @private
 */
olgm.herald.ImageWMSSource.prototype.generateImageWMSFunction_ = function(
    layer) {
  var key;
  var source = layer.getSource();
  goog.asserts.assertInstanceof(source, ol.source.ImageWMS);

  var params = source.getParams();
  var ol3map = this.ol3map;

  //base WMS URL
  var url = source.getUrl();
  var size = ol3map.getSize();

  goog.asserts.assert(size !== undefined);

  var view = ol3map.getView();
  var bbox = view.calculateExtent(size);

  // Separate original WMS params and custom ones
  var wmsParamsList = [
    'CRS',
    'BBOX',
    'FORMAT',
    'HEIGHT',
    'LAYERS',
    'REQUEST',
    'SERVICE',
    'SRS',
    'STYLES',
    'TILED',
    'TRANSPARENT',
    'VERSION',
    'WIDTH'
  ];
  var customParams = {};
  var wmsParams = {};
  for (key in params) {
    var upperCaseKey = key.toUpperCase();
    if (wmsParamsList.indexOf(upperCaseKey) === -1) {
      if (params[key] !== undefined && params[key] !== null) {
        customParams[key] = params[key];
      }
    } else {
      wmsParams[upperCaseKey] = params[key];
    }
  }

  // Set WMS params
  var version = wmsParams['VERSION'] ? wmsParams['VERSION'] : '1.3.0';
  var layers = wmsParams['LAYERS'] ? wmsParams['LAYERS'] : '';
  var styles = wmsParams['STYLES'] ? wmsParams['STYLES'] : '';
  var format = wmsParams['FORMAT'] ? wmsParams['FORMAT'] : 'image/png';
  var transparent = wmsParams['TRANSPARENT'] ?
      wmsParams['TRANSPARENT'] : 'TRUE';
  var tiled = wmsParams['TILED'] ? wmsParams['TILED'] : 'FALSE';

  // Check whether or not we're using WMS 1.3.0
  var versionNumbers = version.split('.');
  var wms13 = (
      parseInt(versionNumbers[0], 10) >= 1 &&
      parseInt(versionNumbers[1], 10) >= 3);
  var referenceSystem = wms13 ? 'CRS' : 'SRS';

  url += '?SERVICE=WMS';
  url += '&VERSION=' + version;
  url += '&REQUEST=GetMap';
  url += '&LAYERS=' + layers;
  url += '&STYLES=' + styles;
  url += '&FORMAT=' + format;
  url += '&TRANSPARENT=' + transparent;
  url += '&' + referenceSystem + '=EPSG:3857';
  url += '&BBOX=' + bbox;
  url += '&WIDTH=' + size[0];
  url += '&HEIGHT=' + size[1];
  url += '&TILED=' + tiled;

  // Set Custom params
  for (key in customParams) {
    url += '&' + key + '=' + customParams[key];
  }

  return url;
};

/**
 * Clean-up the image overlay
 * @param {olgm.herald.ImageWMSSource.LayerCache} cacheItem cacheItem
 * @private
 */
olgm.herald.ImageWMSSource.prototype.resetImageOverlay_ = function(cacheItem) {
  // Clean previous overlay
  if (cacheItem.imageOverlay) {
    // Remove the overlay from the map
    cacheItem.imageOverlay.setMap(null);

    // Destroy the overlay
    cacheItem.imageOverlay = null;
  }
};

/**
 * Refresh the custom image overlay on google maps
 * @param {olgm.herald.ImageWMSSource.LayerCache} cacheItem cacheItem for the
 * layer to update
 * @param {boolean=} opt_force whether we should refresh even if the
 * url for the request hasn't changed. Defaults to false.
 * @private
 */
olgm.herald.ImageWMSSource.prototype.updateImageOverlay_ = function(
    cacheItem, opt_force) {
  var layer = cacheItem.layer;

  if (!layer.getVisible()) {
    return;
  }

  var url = this.generateImageWMSFunction_(layer);
  var forceRefresh = opt_force == true;

  // Force a refresh by setting a new url
  if (forceRefresh) {
    url += '&timestamp=' + new Date().getTime();
  }

  // Check if we're within the accepted resolutions
  var minResolution = layer.getMinResolution();
  var maxResolution = layer.getMaxResolution();
  var currentResolution = this.ol3map.getView().getResolution();
  if (currentResolution < minResolution || currentResolution > maxResolution) {
    this.resetImageOverlay_(cacheItem);
    return;
  }

  /* We listen to both change:resolution and moveend events. However, changing
   * resolution eventually sends a moveend event as well. Using only the
   * moveend event makes zooming in/out look bad. To prevent rendering the
   * overlay twice when it happens, we save the request url, and if it's the
   * same as the last time, we don't render it.
   */
  if (url == cacheItem.lastUrl) {
    return;
  }

  cacheItem.lastUrl = url;

  // Create a new overlay
  var view = this.ol3map.getView();
  var size = this.ol3map.getSize();

  goog.asserts.assert(size !== undefined);

  var extent = view.calculateExtent(size);

  // First, get the coordinates of the top left corner
  var topLeft = ol.extent.getTopLeft(extent);

  // Then, convert it to LatLng coordinates for google
  var lngLat = ol.proj.transform(topLeft, 'EPSG:3857', 'EPSG:4326');
  var topLeftLatLng = new google.maps.LatLng(lngLat[1], lngLat[0]);

  var overlay = new olgm.gm.ImageOverlay(
      url,
      size,
      topLeftLatLng);
  overlay.setZIndex(cacheItem.zIndex);

  // Set the new overlay right away to give it time to render
  overlay.setMap(this.gmap);

  // Clean previous overlay
  this.resetImageOverlay_(cacheItem);

  // Save new overlay
  cacheItem.imageOverlay = overlay;
};

/**
 * Order the layers by index in the ol3 layers array
 * @api
 */
olgm.herald.ImageWMSSource.prototype.orderLayers = function() {
  for (var i = 0; i < this.cache_.length; i++) {
    var cacheItem = this.cache_[i];
    var layer = cacheItem.layer;
    var zIndex = this.findIndex(layer);
    cacheItem.zIndex = zIndex;

    // There won't be an imageOverlay while Google Maps isn't visible
    if (cacheItem.imageOverlay) {
      cacheItem.imageOverlay.setZIndex(zIndex);
    }
  }
};

/**
 * Refresh the image overlay for each cache item
 * @api
 */
olgm.herald.ImageWMSSource.prototype.refresh = function() {
  for (var i = 0; i < this.cache_.length; i++) {
    this.updateImageOverlay_(this.cache_[i], true);
  }
};

/**
 * Deal with the google WMS layer when we enable or disable the OL3 WMS layer
 * @param {olgm.herald.ImageWMSSource.LayerCache} cacheItem cacheItem for the
 * watched layer
 * @private
 */
olgm.herald.ImageWMSSource.prototype.handleVisibleChange_ = function(
    cacheItem) {
  var layer = cacheItem.layer;
  var visible = layer.getVisible();

  if (visible) {
    this.activateCacheItem_(cacheItem);
  } else {
    this.deactivateCacheItem_(cacheItem);
  }
};

/**
 * Handle the map being panned when an ImageWMS layer is present
 * @param {olgm.herald.ImageWMSSource.LayerCache} cacheItem cacheItem for the
 * watched layer
 * @private
 */
olgm.herald.ImageWMSSource.prototype.handleMoveEnd_ = function(
    cacheItem) {
  if (cacheItem.layer.getVisible() && this.ol3map.getView().getCenter()) {
    this.updateImageOverlay_(cacheItem);
  }
};

/**
 * @typedef {{
 *   imageOverlay: (olgm.gm.ImageOverlay),
 *   lastUrl: (string|null),
 *   layer: (ol.layer.Image),
 *   listenerKeys: (Array.<ol.EventsKey|Array.<ol.EventsKey>>),
 *   opacity: (number),
 *   zIndex: (number)
 * }}
 */
olgm.herald.ImageWMSSource.LayerCache;


text:
module Machine.Internal.Step where

import Control.Lens
import qualified Data.HashMap.Lazy as H

import Machine.Internal.Data
import Machine.Internal.GC.MarkScan
import Machine.Internal.Heap (Addr)
import Machine.Internal.Instantiate
import qualified Machine.Internal.Heap as U

-- TODO use prism?
isDataNode :: Node -> Bool
isDataNode (NNum _)    = True
isDataNode (NData _ _) = True
isDataNode _ = False

getargs :: Heap -> Stack -> [Addr]
getargs heap (sc:stack) = map getArg stack where
    getArg addr = arg where (NAp _ arg) = U.lookup addr heap

primStep :: State -> Primitive -> State
primStep state Neg = primNeg state
primStep state Add = primArith state (+)
primStep state Sub = primArith state (-)
primStep state Mul = primArith state (*)
primStep state Div = primArith state div
primStep state If  = primIf state
primStep state (PrimConstr tag arity) = primConstr state tag arity
primStep state Greater   = primComp state (>)
primStep state GreaterEq = primComp state (>=)
primStep state Less      = primComp state (<)
primStep state LessEq    = primComp state (<=)
primStep state Eq        = primComp state (==)
primStep state NotEq     = primComp state (/=)
primStep state CasePair = primCasePair state
primStep state Abort = error "Abort!"
primStep state CaseList = primCaseList state
primStep state Print = primPrint state
primStep state Stop = primStop state

primArith :: State -> (Int -> Int -> Int) -> State
primArith state f = primDyadic state (\(NNum x) (NNum y) -> (NNum (f x y)))

primComp :: State -> (Int -> Int -> Bool) -> State
primComp state f = primDyadic state $ \(NNum x) (NNum y) ->
    -- TODO remove all this magical NData 1/2 stuff!
    NData (if f x y then 2 else 1) []

primDyadic :: State -> (Node -> Node -> Node) -> State
primDyadic state f
    | length stack' > 3 = error "More than two arguments to dyadic prim"
    | length stack' < 3 = error "Less than two arguments to dyadic prim"
    | not (isDataNode m) = state & stack .~ [arg1Addr]
                                 & dump  %~ ([rootNode]:)
    | not (isDataNode n) = state & stack .~ [arg2Addr]
                                 & dump  %~ ([rootNode]:)
    | otherwise = state & stack %~ drop 2
                        &  heap %~ U.update rootNode (m `f` n)
    where stack' = state^.stack
          heap'  = state^.heap
          rootNode = stack' !! 2
          args = getargs heap' stack'
          arg1Addr = head args
          arg2Addr = head $ tail args
          m = U.lookup arg1Addr heap'
          n = U.lookup arg2Addr heap'

primNeg :: State -> State
primNeg state
    | length stack' > 2 = error "More than one argument to neg"
    | length stack' < 2 = error "No arguments to neg"
    | isDataNode arg = state & stack %~ tail
                             & heap  %~ U.update (stack' !! 1) (NNum (-n))
    | otherwise = state & stack .~ [argAddr]
                        & dump  %~ ([stack' !! 1]:)
    where stack' = state^.stack
          heap'  = state^.heap
          argAddr = head $ getargs heap' stack'
          arg = U.lookup argAddr heap'
          NNum n = arg

followIndirection :: Node -> Heap -> Node
followIndirection (NInd addr) heap = followIndirection (U.lookup addr heap) heap
followIndirection node        _    = node

--         a0:a1:...:an:s    d    h[a0:NSupercomb[x1, ..., xn] body]    f
--     ==>           ar:s    d    h'[an:NInd ar]                        f

--     a0:s d h[ a0:NPrim _ If
--               a1:NData _ ] f
-- ==>
primIf :: State -> State
primIf state
    | length stack' < 4 = error "Less than three arguments to if"
    | length stack' > 4 = error "More than three arguments to if"
    | isDataNode bool = state & stack .~ newStack
                              & heap  .~ newHeap
    | otherwise = state & stack .~ [boolAddr]
                        & dump  %~ ([stack' !! 3]:)
    where stack' = state^.stack
          heap'  = state^.heap
          args = getargs heap' stack'
          boolAddr = head args
          -- TODO - do we need followIndirection?
          bool = followIndirection (U.lookup boolAddr heap') heap'

          -- isDataNode case
          NData t _ = bool
          branchAddr = args !! (if t == 1 then 2 else 1)
          newHeap = U.update (stack' !! 3) (NInd branchAddr) heap'
          newStack = drop 3 stack'

primCasePair :: State -> State
primCasePair state
    | length stack' < 3 = error "Less than two arguments to casePair"
    | length stack' > 3 = error "More than two arguments to casePair"
    | isDataNode pair = state & stack .~ newStack
                              & heap  .~ newHeap
    | otherwise = state & stack .~ [pairAddr]
                        & dump  %~ ([stack' !! 2]:)
    where stack' = state^.stack
          heap'  = state^.heap
          args = getargs heap' stack'
          pairAddr = head args
          -- TODO - do we need followIndirection?
          pair = followIndirection (U.lookup pairAddr heap') heap'

          -- isDataNode case
          -- this is disgusting
          (NData _ [aAddr, bAddr]) = pair
          fAddr = head $ tail args
          (heap'', fAppA) = U.alloc (NAp fAddr aAddr) heap'
          (heap''', newRoot) = U.alloc (NAp fAppA bAddr) heap''
          newHeap = U.update (last stack') (NInd newRoot) heap'''
          newStack = [fAddr, fAppA, newRoot]

primCaseList :: State -> State
primCaseList state
    | length stack' < 4 = error "Less than three arguments to caseList"
    | length stack' > 4 = error "More than three arguments to caseList"
    | isDataNode lst = state & stack .~ newStack
                             & heap  .~ newHeap
    | otherwise = state & stack .~ [lstAddr]
                        & dump  %~ ([stack' !! 3]:)
    where stack' = state^.stack
          heap'  = state^.heap
          args = getargs heap' stack'
          lstAddr = head args
          -- TODO - do we need followIndirection?
          lst = followIndirection (U.lookup lstAddr heap') heap'
          cnAddr = args !! 1
          ccAddr = args !! 2

          -- isDataNode case
          -- caseList Pack{1, 0}        cn cc = cn
          -- caseList (Pack{2, 2} x xs) cn cc = cc x xs
          NData tag lstParts = lst
          (newHeap, newStack) = case tag of
              -- cn
              1 -> let heap'' = U.update (last stack') (NInd cnAddr) heap'
                   in (heap'', drop 3 stack')
              -- cc x xs
              2 -> let [xAddr, xsAddr] = lstParts
                       (heap'', app1)  = U.alloc (NAp ccAddr xAddr) heap'
                       (heap''', app2) = U.alloc (NAp app1 xsAddr) heap''
                   in (heap''', [ccAddr, app1, app2])

primStop :: State -> State
primStop state = state & stack .~ []

primPrint :: State -> State
primPrint state
    | b1IsNum = state & output <>~ [n]
                      & stack .~ [b2]
    | otherwise = state & stack .~ [b1]
                        & dump .~ [[stack' !! 2]]
    where heap'  = state^.heap
          stack' = state^.stack
          [b1, b2] = getargs heap' stack'
          b1' = U.lookup b1 heap'
          b1IsNum = case b1' of
              (NNum _) -> True
              _        -> False
          NNum n = b1'

--     a0:a1:...:an:[] d h [ a0:NPrim (PrimConstr t n)    f
--                           a1:NAp a b1
--                           ...
--                           an:NAp a(n-1) bn        ]
-- ==>           an:[] d h [ an:NData t [b1,...,bn]  ]   f
primConstr :: State -> Int -> Int -> State
primConstr state tag arity
    | length stack' > (arity + 1) = error "Too many arguments to constructor"
    | length stack' < (arity + 1) = error "Not enough arguments to constructor"
    | otherwise = state & stack .~ [updAddr]
                        & heap  .~ newHeap
    where stack' = state^.stack
          heap'  = state^.heap
          -- Get the addr of a component from the address where it's applied
          -- TODO - this is ill-conceived
          componentAddrs = getargs heap' stack'
          componentAddrs' = take arity componentAddrs
          updAddr = stack' ^?! ix arity
          -- updAddr = last stack'
          newHeap = U.update updAddr (NData tag componentAddrs') heap'

          -- (newHeap, dataAddr) = U.alloc (NData tag componentAddrs) (state^.heap)
          -- (newHeap, dataAddr) = instantiate constr (state^.heap)

unDump :: State -> State
unDump state
    | state^.stack^.to length == 1 && not (null $ state^.dump)
    = state & stack .~ head (state^.dump)
            & dump  %~ tail
unDump _ = error "Data applied as a function!"

step :: State -> State
step state = dispatch $ U.lookup (head (state^.stack)) (state^.heap) where
    dispatch (NNum _) = unDump state
    dispatch (NAp a1 a2) = apStep state a1 a2
    dispatch (NSupercomb sc args body) = scStep state sc args body
    --         a :s    d    h[a:NInd a1]    f
    --     ==> a1:s    d    h               f
    dispatch (NInd a1) = state & stack._head .~ a1 -- TODO update stats?
    dispatch (NPrim _ prim) = primStep state prim
    dispatch (NData _ _) = unDump state

apStep :: State -> Addr -> Addr -> State
apStep state a1 a2 = case state^.heap^.to (U.lookup a2) of
    NInd a2' -> state & heap  %~ U.update (head (state^.stack)) (NAp a1 a2')
    _        -> state & stack %~ (a1:)

-- | Step a supercombinator. Described by the transition rule:
--
--         a0:a1:...:an:s    d    h[a0:NSupercomb[x1, ..., xn] body]    f
--     ==>           ar:s    d    h'[an:NInd ar]                        f
--     where (h', ar) = instantiate body h f [x1 -> a1, ..., xn -> an]
--
-- In other words, overwrite node an (the root of the redex) with an
-- indirection to ar (the root of the result). If the supercombinator is
-- a CAF then n=0 and the node to be modified is the supercombinator node
-- itself.
scStep :: State -> Name -> [Name] -> CoreExpr -> State
scStep state _ argNames body = state & stack .~ newStack
                                     & heap  .~ newHeap
    where
    stack' = state^.stack
    heap'  = state^.heap
    newStack = drop (length argNames) stack'
    argBindings = zip argNames $ getargs heap' stack'
    env = H.union (H.fromList argBindings) (state^.globals)
    bodyAddr = head newStack
    newHeap = instantiateAndUpdate body bodyAddr heap' env


text:
- Wheat might not make it to countries who are mortally dependent on it amidst the current Russia-Ukraine War.
- This might cause massive famines.
- The UN has stated that ~49M people in 46 countries are at risk of falling into famine.

![](https://i.imgur.com/X33INNN.png)


text:
//
// $Id: Reader_Waters_Detail.hpp 6478 2014-07-08 20:01:38Z chambm $
//
//
// Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
//
// Copyright 2009 Vanderbilt University - Nashville, TN 37232
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#ifndef _READER_WATERS_DETAIL_HPP_
#define _READER_WATERS_DETAIL_HPP_

#include "pwiz/utility/misc/Export.hpp"
#include "pwiz/data/msdata/MSData.hpp"
#include <vector>

#ifdef PWIZ_READER_WATERS
#include "pwiz_aux/msrc/utility/vendor_api/Waters/MassLynxRaw.hpp"
using namespace pwiz::vendor_api::Waters;

namespace pwiz {
namespace msdata {
namespace detail {
namespace Waters {

PWIZ_API_DECL
std::vector<InstrumentConfiguration> createInstrumentConfigurations(RawDataPtr rawdata);

PWIZ_API_DECL CVID translateAsInstrumentModel(RawDataPtr rawdata);
PWIZ_API_DECL void translateFunctionType(PwizFunctionType functionType, int& msLevel, CVID& spectrumType);
PWIZ_API_DECL CVID translateAsIonizationType(PwizIonizationType ionizationType);
PWIZ_API_DECL CVID translate(PwizPolarityType polarityType);

/*PWIZ_API_DECL CVID translate(MassAnalyzerType type);
PWIZ_API_DECL CVID translateAsInletType(IonizationType ionizationType);
PWIZ_API_DECL CVID translate(ActivationType activationType);*/

} // Waters
} // detail
} // msdata
} // pwiz

#endif

#endif // _READER_WATERS_DETAIL_HPP_


text:
namespace Simple.Web.Hosting
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    internal sealed class HandlerTypeInfo
    {
        private readonly Type _type;
        private readonly HashSet<string> _respondsToTypes;
        private readonly HashSet<string> _respondsWithTypes;
        private readonly int _priority;

        public int Priority
        {
            get { return _priority; }
        }

        public HandlerTypeInfo(Type type) : this(type, null, null)
        {
        }

        public HandlerTypeInfo(Type type, IEnumerable<string> respondsToTypes, IEnumerable<string> respondsWithTypes)
        {
            _type = type;
            if (respondsToTypes != null)
            {
                _respondsToTypes = new HashSet<string>(respondsToTypes, StringComparer.OrdinalIgnoreCase);
                if (_respondsToTypes.Count == 0) _respondsToTypes = null;
            }
            if (respondsWithTypes != null)
            {
                _respondsWithTypes = new HashSet<string>(respondsWithTypes, StringComparer.OrdinalIgnoreCase);
                if (_respondsWithTypes.Count == 0) _respondsWithTypes = null;
            }
        }

        private HandlerTypeInfo(Type type, HashSet<string> respondsToTypes, HashSet<string> respondsWithTypes,
                                int priority)
        {
            _type = type;
            _respondsToTypes = respondsToTypes;
            _respondsWithTypes = respondsWithTypes;
            _priority = priority;
        }

        public int Property { get; set; }

        public Type HandlerType
        {
            get { return _type; }
        }

        public bool RespondsTo(string contentType)
        {
            return _respondsToTypes != null && _respondsToTypes.Contains(contentType);
        }

        public bool RespondsToAll
        {
            get { return _respondsToTypes == null; }
        }

        public bool RespondsWith(string acceptType)
        {
            return _respondsWithTypes != null && _respondsWithTypes.Contains(acceptType);
        }

        public bool RespondsWithAll
        {
            get { return _respondsWithTypes == null; }
        }

        public HandlerTypeInfo SetPriority(int priority)
        {
            return new HandlerTypeInfo(_type, _respondsToTypes, _respondsWithTypes, priority);
        }
    }
}


text:
package com.dke.pursuitevasion.AI;

import com.badlogic.gdx.ai.pfa.Connection;

/**
 * Created by Envy on 4/19/2017.
 */
public class CustomConnection implements Connection{

    Node fromNode;
    Node toNode;
    float cost;

    public CustomConnection(Node fNode, Node tNode, float Cost){
        fromNode = fNode;
        toNode = tNode;
        cost = Cost;
    }

    @Override
    public float getCost(){
        return cost;
    }

    @Override
    public Node getFromNode(){
        return fromNode;
    }

    @Override
    public Node getToNode(){
        return toNode;
    }
}


text:
@import UIKit;
#import <FBSnapshotTestCase/FBSnapshotTestCase.h>

#import "SDLLockScreenConfiguration.h"
#import "SDLLockScreenViewController.h"

@interface SDLLockScreenViewControllerSnapshotTests : FBSnapshotTestCase

@property (strong, nonatomic) SDLLockScreenViewController *lockScreenViewController;

@end

@implementation SDLLockScreenViewControllerSnapshotTests

- (void)setUp {
    [super setUp];

    self.lockScreenViewController = [[UIStoryboard storyboardWithName:@"SDLLockScreen" bundle:[NSBundle bundleForClass:[self class]]] instantiateInitialViewController];
    self.lockScreenViewController.view.frame = [[UIScreen mainScreen] bounds];

//    self.deviceAgnostic = YES;
//    self.recordMode = YES;
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testNoAppNoVehicleIcons {
    self.lockScreenViewController.appIcon = nil;
    self.lockScreenViewController.vehicleIcon = nil;
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;

    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testOnlyAppIcon {
    self.lockScreenViewController.appIcon = [UIImage imageNamed:@"TestLockScreenAppIcon" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
    self.lockScreenViewController.vehicleIcon = nil;
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;

    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testOnlyVehicleIcon {
    self.lockScreenViewController.appIcon = nil;
    self.lockScreenViewController.vehicleIcon = [UIImage imageNamed:@"testImagePNG" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;

    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testAppAndVehicleIcons {
    self.lockScreenViewController.appIcon = [UIImage imageNamed:@"TestLockScreenAppIcon" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];;
    self.lockScreenViewController.vehicleIcon = [UIImage imageNamed:@"testImagePNG" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
    self.lockScreenViewController.backgroundColor = [SDLLockScreenConfiguration enabledConfiguration].backgroundColor;

    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

- (void)testLightBackgroundNoAppNoVehicleIcons {
    self.lockScreenViewController.appIcon = nil;
    self.lockScreenViewController.vehicleIcon = nil;
    self.lockScreenViewController.backgroundColor = [UIColor whiteColor];

    FBSnapshotVerifyView(self.lockScreenViewController.view, nil);
}

@end


text: A test repository


text:
@interface YT_serviceWebController : UIViewController
@property (nonatomic,copy) NSString *navTitle;
@property (nonatomic,copy) NSString *url;
@end


text:
package org.springframework.boot.actuate.endpoint.annotation;

import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
import org.springframework.boot.actuate.endpoint.Operation;

/**
 * An {@link ExposableEndpoint endpoint} discovered by an {@link EndpointDiscoverer}.
 *
 * @param <O> the operation type
 * @author Phillip Webb
 * @since 2.0.0
 */
public interface DiscoveredEndpoint<O extends Operation> extends ExposableEndpoint<O> {

	/**
	 * Return {@code true} if the endpoint was discovered by the specified discoverer.
	 * @param discoverer the discoverer type
	 * @return {@code true} if discovered using the specified discoverer
	 */
	boolean wasDiscoveredBy(Class<? extends EndpointDiscoverer<?, ?>> discoverer);

	/**
	 * Return the source bean that was used to construct the {@link DiscoveredEndpoint}.
	 * @return the source endpoint bean
	 */
	Object getEndpointBean();

}


text:
{% extends "base.html" %}
{% block title %}Download {{ doc.properties.get("wof:name") |e }} Descendants{% endblock %}
{% block content %}

Download descendants of {{ doc.properties.get("wof:name") | e }}

		Choose each placetype you wish to download.

<input type="checkbox" name="pt-self" id="pt-self" value="1" class="placetype"> {{ doc.properties.get("wof:placetype") | e }} 1 ({{ doc.properties.get("wof:name") |e }} itself)

			{% for f in facets.placetype | reverse %}

<input type="checkbox" name="pt-{{ f.key | e }}" id="pt-{{ f.key | e }}" data-placetype="{{ f.key | e }}" value="1" class="placetype"> {{ f.key | e }} {{ f.doc_count |number_format|e }}

			{% endfor %}

				<input type="checkbox" id="bundle-simple-props">
				Simple properties

				Bundle a subset of simplified WOF properties

			You have selected 0 features. Cancel download

				Start download

					Save GeoJSON
					Save CSV
					{% if g.enable_feature_bundler_gists %}
					Upload to GitHub Gist
					{% endif %}

You will need login with GitHub to upload your results to a Gist.

You are logged in to upload your results to a GitHub Gist (logout).

Waiting for GitHub authorization (cancel).

Uploading your results to a GitHub Gist, please wait...

Uh oh, something unexpected happened.

		<input type="checkbox" id="preview-bundle" checked="checked">

			Show preview map

		previewing too many features will make your browser sad

		this feature was inspired by burritojustice's WOF Descender
		{% include "inc_log.html" %}

{% endblock %}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Pleospora kurdistanica var. stachydina Picb.

### Remarks
null


text:
find_library(HIDAPI_LIBRARY
	NAMES hidapi hidapi-hidraw hidapi-libusb)

find_path(HIDAPI_INCLUDE_DIR
	NAMES hidapi/hidapi.h)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HIDAPI
	DEFAULT_MSG
	HIDAPI_LIBRARY
	HIDAPI_INCLUDE_DIR)

if(HIDAPI_FOUND)
	set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")

	set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
endif()

mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)


text:
package com.opnitech.rules.core.test.engine.test_workflow;

import org.junit.Test;

import com.opnitech.rules.core.enums.ExecutionStrategyEnum;
import com.opnitech.rules.core.enums.WhenEnum;

/**
 * @author Rigre Gregorio Garciandia Sonora
 */
public class TestRuleEngineStopFirstStrategy extends AbstractTestRuleEngineStrategies {
    @Test
    public void testStopFirstExecutionStrategyWithAllRuleAccepting() throws Exception {

        testMultiRule(ExecutionStrategyEnum.STOP_FIRST, new WhenEnum[]
            {
                WhenEnum.ACCEPT,
                WhenEnum.ACCEPT,
                WhenEnum.ACCEPT
            }, new boolean[][]
            {
                {
                    true,
                    true
                        },
                {
                    false,
                    false
                        },
                {
                    false,
                    false
                        }
            });
    }

    @Test
    public void testStopFirstExecutionStrategyWithMiddleRuleAccepting() throws Exception {

        testMultiRule(ExecutionStrategyEnum.STOP_FIRST, new WhenEnum[]
            {
                WhenEnum.REJECT,
                WhenEnum.ACCEPT,
                WhenEnum.REJECT
            }, new boolean[][]
            {
                {
                    true,
                    false
                        },
                {
                    true,
                    true
                        },
                {
                    false,
                    false
                        }
            });
    }

    @Test
    public void testStopFirstExecutionStrategyWithLastRuleAccepting() throws Exception {

        testMultiRule(ExecutionStrategyEnum.STOP_FIRST, new WhenEnum[]
            {
                WhenEnum.REJECT,
                WhenEnum.REJECT,
                WhenEnum.ACCEPT
            }, new boolean[][]
            {
                {
                    true,
                    false
                        },
                {
                    true,
                    false
                        },
                {
                    true,
                    true
                        }
            });
    }

    @Test
    public void testStopFirstExecutionStrategyWithAnyRuleAccepting() throws Exception {

        testMultiRule(ExecutionStrategyEnum.STOP_FIRST, new WhenEnum[]
            {
                WhenEnum.REJECT,
                WhenEnum.REJECT,
                WhenEnum.REJECT
            }, new boolean[][]
            {
                {
                    true,
                    false
                        },
                {
                    true,
                    false
                        },
                {
                    true,
                    false
                        }
            });
    }

}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Linq;

namespace MarkdownSharp
{
    using System.IO;
    using System.Security;
    using System.Text.RegularExpressions;
    using MarkdownSharp.EpicMarkdown;

    [Flags]
    public enum PathElementType
    {
        Image       = 0x01,
        Bookmark    = 0x02,
        Attachment  = 0x04,
        Folder      = 0x08,
        Excerpt     = 0x10,
        Variable    = 0x20
    }

    public class PathElement
    {
        public string Text { get; private set; }
        public PathElementType Type { get; private set; }

        public PathElement(string text, PathElementType type)
        {
            Text = text;
            Type = type;
        }

        public override string ToString()
        {
            return string.Format("{0} {1}", Type.ToString(), Text);
        }
    }

    public static class PathCompletionHelper
    {
        public static List<PathElement> GetSuggestionList(EMDocument doc, string userPath, PathElementType options)
        {
            var list = new List<PathElement>();
            var emptyInputPath = false;

            if (string.IsNullOrWhiteSpace(userPath))
            {
                emptyInputPath = true;
                userPath = "";
            }

            var langId = LangIdPattern.Match(Path.GetFileName(doc.LocalPath)).Groups["langId"].Value;

            var m = RootKeywordPattern.Match(userPath);

            userPath = m.Success
                           ? userPath.Replace(m.Value, GetSourceDir(doc.LocalPath))
                           : Path.Combine(Path.GetDirectoryName(doc.LocalPath), userPath);

            DirectoryInfo userDir;

            try
            {
                userDir = new DirectoryInfo(userPath);
            }
            catch (Exception e)
            {
                if (e is ArgumentNullException || e is SecurityException || e is ArgumentException
                    || e is PathTooLongException)
                {
                    // ignore and output empty list
                    return list;
                }

                throw;
            }

            if (userDir.Exists)
            {
                if ((options & (PathElementType.Image | PathElementType.Attachment | PathElementType.Folder)) > 0)
                {
                    // File system infos.

                    var dirs = userDir.GetDirectories();

                    if (options.HasFlag(PathElementType.Image))
                    {
                        var imagesDirs = dirs.Where(d => d.Name.ToLower() == "images").ToArray();

                        if (imagesDirs.Length > 0)
                        {
                            list.AddRange(
                                imagesDirs[0].GetFiles().Select(f => new PathElement(f.Name, PathElementType.Image)));
                        }
                    }

                    if (options.HasFlag(PathElementType.Attachment))
                    {
                        var attachmentsDirs = dirs.Where(d => d.Name.ToLower() == "attachments").ToArray();

                        if (attachmentsDirs.Length > 0)
                        {
                            list.AddRange(
                                attachmentsDirs[0].GetFiles()
                                                  .Select(f => new PathElement(f.Name, PathElementType.Attachment)));
                        }
                    }

                    if (options.HasFlag(PathElementType.Folder))
                    {
                        if (emptyInputPath)
                        {
                            list.Add(new PathElement("%ROOT%", PathElementType.Folder));
                        }

                        list.AddRange(
                            dirs.Where(d => d.Name.ToLower() != "attachments" && d.Name.ToLower() != "images")
                                .Select(d => new PathElement(d.Name, PathElementType.Folder)));
                    }
                }

                if ((options & (PathElementType.Bookmark | PathElementType.Excerpt | PathElementType.Variable)) > 0)
                {
                    var files = userDir.GetFiles(string.Format("*.{0}.udn", langId));

                    if (files.Length > 0)
                    {
                        var linkedDocument = files[0].FullName.Equals(doc.LocalPath, StringComparison.InvariantCultureIgnoreCase)
                                                 ? doc
                                                 : doc.TransformationData.ProcessedDocumentCache.Get(files[0].FullName);

                        if (options.HasFlag(PathElementType.Bookmark) && emptyInputPath)
                        {
                            list.AddRange(linkedDocument.GetBookmarkKeys().Select(n => new PathElement(n, PathElementType.Bookmark)));
                        }

                        if (options.HasFlag(PathElementType.Excerpt))
                        {
                            list.AddRange(linkedDocument.GetExcerptNames().Select(n => new PathElement(n, PathElementType.Excerpt)));
                        }

                        if (options.HasFlag(PathElementType.Variable))
                        {
                            list.AddRange(linkedDocument.GetVariableNames().Select(n => new PathElement(n, PathElementType.Variable)));
                        }
                    }
                }
            }

            return list;
        }

        private static string GetSourceDir(string udnFilePath)
        {
            var sourceDir = Path.GetDirectoryName(udnFilePath);

            while (!sourceDir.EndsWith("Source"))
            {
                sourceDir = Path.GetDirectoryName(sourceDir);
            }

            return sourceDir;
        }

        private static readonly Regex RootKeywordPattern = new Regex(@"\%root\%", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        private static readonly Regex LangIdPattern = new Regex(@"^.+\.(?<langId>[A-Z]{3})\.udn$", RegexOptions.Compiled);
    }
}


text:
<?php
/* @var $this StateController */
/* @var $model State */
/* @var $form CActiveForm */
?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>

		<?php echo $form->label($model,'id'); ?>
		<?php echo $form->textField($model,'id'); ?>

		<?php echo $form->label($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>255)); ?>

		<?php echo $form->label($model,'abbreviation'); ?>
		<?php echo $form->textField($model,'abbreviation',array('size'=>60,'maxlength'=>255)); ?>

		<?php echo CHtml::submitButton('Search'); ?>

<?php $this->endWidget(); ?>


text: Copyright © Castlegate IT 2015. All rights reserved.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Center Popup</title>

your content


text:
class QuickActionController < ApplicationController
  before_action :authenticate_user!, PQUserFilter

  def dates
    params.permit(:total_pqs, :pqs_comma_separated_for_dates, :utf8, :authenticity_token, :qa_edit_deadline_date, :qa_edit_draft_date, :qa_edit_pod_date, :qa_edit_minister_date, :qa_edit_answered_date)
    @quick_actions_service = QuickActionsService.new
    @quick_actions_service.update_pq_list(params[:pqs_comma_separated_for_dates], params[:qa_edit_deadline_date], params[:qa_edit_draft_date], params[:qa_edit_pod_date], params[:qa_edit_minister_date], params[:qa_edit_answered_date])
    flash[:Success] = 'Date(s) updated'
    redirect_back fallback_location: root_path
  end

  def draft_reminders
    params.permit(:total_pqs, :pqs_comma_sep_for_drafts, :utf8, :authenticity_token)
    @quick_actions_service = QuickActionsService.new
    @quick_actions_service.mail_draft_list(params[:pqs_comma_sep_for_drafts])
    flash[:Success] = 'Draft Reminder(s) Sent'
    redirect_back fallback_location: root_path
  end
end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package exercises;

/**
 *
 * @author dmagadi
 */
public class TestInteface {

    public static void main(String[] args) {
        new SampleInterfaceMethod().searchContacts(new SampleInterfaceMethod.ICallMe() {

            @Override
            public void foundContact(String contact) {
                System.err.println(contact);
            }
        });

    }

}


text:
(function($){
  $.fn.identify = function(count) {
    return this.each(function() {
      $(this).find(":input").each(function() {
        $(this).attr("id",   $(this).attr("id").replace("0", count))
               .attr("name", $(this).attr("name").replace("0", count));
      });
    });
 };
})(jQuery);

var ThemeFileUpload = $.klass({
  initialize: function() {
    $("#theme_add_file").bind("click", this.addInput);
  },
  addInput: function() {
    var list = $("#files div"), copyFrom = list.find("p:first");
    var newNode = copyFrom.clone(true), files = list.children("p");
    newNode.find("input").each(function(){ $(this).val("") });
    var close = newNode.find(".theme_remove_file:first").show();
    newNode.identify(files.length);
    close.click(function(){
      $(this).parent("p").remove();
    });
    newNode.appendTo(list);
  }
});

$().ready(function(){
  new ThemeFileUpload();
});


text:
BioDynaMo

  Biology Dynamics Modeller

  Visit our website »

  Report bug
  ·
  Request feature
  ·
  User's guide
  ·
  Developer's guide

## What is BioDynaMo?

BioDynaMo is a software platform to easily create, run, and visualise 3D agent-based simulations.
* **Blazing fast:** The core of the platform is written in C++ and is highly optimized to harness the computational power of modern hardware.
* **Modular:** Reuse, adapt, or create modules that represents a specific biological behavior or entity. With BioDynaMo you don't need to start from scratch anymore!
* **Visual:** Effortlessly create astonishing images and animations of your simulations. Your publications and presentations will stand out even more!

## Installation

Simply run the following command:

```
curl https://biodynamo.org/install | bash
```

For more information, check out our [user's guide](https://biodynamo.org/docs/userguide/).

## Contributing

The main purpose of this repository is to evolve BioDynaMo, making it faster and
easier to use. Development of BioDynaMo happens in the open on Github, and we are
grateful to the community for contributing bugfixes and improvements. Please read our [contribution guide](https://biodynamo.org/docs/devguide/contribute/) and learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to BioDynaMo.

We expect contributors to adhere to our [Contributor Covenant](https://github.com/BioDynaMo/biodynamo/blob/master/CODE_OF_CONDUCT.md).

## Cite

When citing BioDynaMo, please use this reference:

```
Lukas Breitwieser et al. BioDynaMo: a modular platform for high-performance agent-based simulation.
Bioinformatics, 2021. DOI: https://doi.org/10.1093/bioinformatics/btab649.
```

We recommend specifying the exact BioDynaMo version used in the methods section.
For example:

```
We use BioDynaMo v1.01.115-e1088d4a (Breitwieser el al., 2021) for all simulations in this article.
```

The version can be obtained by executing `biodynamo --version` and can be interpreted as follows: `vMAJOR.MINOR.PATCH-SHA`
`SHA` is the git commit hash that can be used to check out the exact BioDynaMo version with `git checkout SHA`.

## License

BioDynaMo is [Apache 2.0 licensed](./LICENSE).


text:
"""Utilities for speech recognition apps."""

import numpy as np

def decode(model_output: np.ndarray, labels: dict) -> list:
    """Decodes the integer encoded results from inference into a string.

    Args:
        model_output: Results from running inference.
        labels: Dictionary of labels keyed on the classification index.

    Returns:
        Decoded string.
    """
    results = [labels[np.argmax(model_output)], model_output[0][0][np.argmax(model_output)]]

    return results

def display_text(text: list):
    """Presents the results on the console.

    Args:
        text: Results of performing ASR on the input audio data.
    """
    print('Classification: %s' % text[0])
    print('Probability: %s' % text[1])


text:
#ifndef _ESBMC_SOLVERS_CVC_CVC_CONV_H_
#define _ESBMC_SOLVERS_CVC_CVC_CONV_H_

#include <solvers/smt/smt_conv.h>

#include <cvc4/cvc4.h>

class cvc_smt_sort : public smt_sort
{
public:
#define cvc_sort_downcast(x) static_cast<const cvc_smt_sort *>(x)
  cvc_smt_sort(smt_sort_kind i, CVC4::Type &_t) : smt_sort(i), t(_t) { }
  cvc_smt_sort(smt_sort_kind i, CVC4::Type &_t, unsigned int w)
    : smt_sort(i, w), t(_t) { }
  cvc_smt_sort(smt_sort_kind i, CVC4::Type &_t, unsigned long w,unsigned long d)
    : smt_sort(i, w, d), t(_t) { }
  virtual ~cvc_smt_sort() { }

  CVC4::Type t;
};

class cvc_smt_ast : public smt_ast
{
public:
#define cvc_ast_downcast(x) static_cast<const cvc_smt_ast *>(x)
  cvc_smt_ast(smt_convt *ctx, const smt_sort *_s, CVC4::Expr &_e)
    : smt_ast(ctx, _s), e(_e) { }
  virtual ~cvc_smt_ast() { }

  CVC4::Expr e;
};

class cvc_convt : public smt_convt, public array_iface
{
public:
  cvc_convt(bool is_cpp, bool int_encoding, const namespacet &ns);
  ~cvc_convt();

  virtual resultt dec_solve();
  virtual tvt l_get(const smt_ast *l);
  virtual const std::string solver_text();

  virtual void assert_ast(const smt_ast *a);

  virtual smt_ast *mk_func_app(const smt_sort *s, smt_func_kind k,
                               const smt_ast * const *args,
                               unsigned int numargs);
  virtual smt_sort *mk_sort(const smt_sort_kind k, ...);
  virtual smt_ast *mk_smt_int(const mp_integer &theint, bool sign);
  virtual smt_ast *mk_smt_real(const std::string &str);
  virtual smt_ast *mk_smt_bvint(const mp_integer &theint, bool sign,
                                unsigned int w);
  virtual smt_ast *mk_smt_bool(bool val);
  virtual smt_ast *mk_smt_symbol(const std::string &name, const smt_sort *s);
  virtual smt_ast *mk_array_symbol(const std::string &name, const smt_sort *s,
                                   smt_sortt array_subtype);
  virtual smt_sort *mk_struct_sort(const type2tc &type);
  virtual smt_sort *mk_union_sort(const type2tc &type);
  virtual smt_ast *mk_extract(const smt_ast *a, unsigned int high,
                              unsigned int low, const smt_sort *s);

  const smt_ast *convert_array_of(smt_astt init_val,
                                  unsigned long domain_width);

  virtual void add_array_constraints_for_solving();
  void push_array_ctx(void);
  void pop_array_ctx(void);

  expr2tc get_bool(const smt_ast *a);
  expr2tc get_bv(const type2tc &t, const smt_ast *a);
  expr2tc get_array_elem(const smt_ast *array, uint64_t index,
                         const type2tc &elem_sort);

  CVC4::ExprManager em;
  CVC4::SmtEngine smt;
  CVC4::SymbolTable sym_tab;
};

#endif /* _ESBMC_SOLVERS_CVC_CVC_CONV_H_ */


text:
/**
 *
 */
package org.vaadin.special.data;

import java.util.Locale;

import com.vaadin.data.util.converter.Converter.ConversionException;

/**
 * @author kamil
 *
 */
@SuppressWarnings("serial")
public class IntegerValidator extends AbstractValidator {

	private StringToIntegerConverter converter;

	public IntegerValidator(String message) {
		super(message);
		converter = new StringToIntegerConverter();
	}

	@Override
	public boolean isValid(Object value) {
		if (null == value || Integer.class.isAssignableFrom(value.getClass())) {
			return true;
		}

		if (!(value instanceof String)) {
			return false;
		}

		try {
			@SuppressWarnings("unused")
			Integer integerValue = converter.convertToModel((String) value, Integer.class, Locale.ENGLISH);
			return true;
		} catch (ConversionException e) {
		}
		return false;
	}

}


text:
// +build !ignore_autogenerated

// This file was autogenerated by deepcopy-gen. Do not edit it manually!

package batch

import (
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	api "k8s.io/client-go/pkg/api"
	reflect "reflect"
)

func init() {
	SchemeBuilder.Register(RegisterDeepCopies)
}

// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
// to allow building arbitrary schemes.
func RegisterDeepCopies(scheme *runtime.Scheme) error {
	return scheme.AddGeneratedDeepCopyFuncs(
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJob, InType: reflect.TypeOf(&CronJob{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJobList, InType: reflect.TypeOf(&CronJobList{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJobSpec, InType: reflect.TypeOf(&CronJobSpec{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJobStatus, InType: reflect.TypeOf(&CronJobStatus{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_Job, InType: reflect.TypeOf(&Job{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobCondition, InType: reflect.TypeOf(&JobCondition{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobList, InType: reflect.TypeOf(&JobList{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobSpec, InType: reflect.TypeOf(&JobSpec{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobStatus, InType: reflect.TypeOf(&JobStatus{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobTemplate, InType: reflect.TypeOf(&JobTemplate{})},
		conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobTemplateSpec, InType: reflect.TypeOf(&JobTemplateSpec{})},
	)
}

func DeepCopy_batch_CronJob(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*CronJob)
		out := out.(*CronJob)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_batch_CronJobSpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		if err := DeepCopy_batch_CronJobStatus(&in.Status, &out.Status, c); err != nil {
			return err
		}
		return nil
	}
}

func DeepCopy_batch_CronJobList(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*CronJobList)
		out := out.(*CronJobList)
		*out = *in
		if in.Items != nil {
			in, out := &in.Items, &out.Items
			*out = make([]CronJob, len(*in))
			for i := range *in {
				if err := DeepCopy_batch_CronJob(&(*in)[i], &(*out)[i], c); err != nil {
					return err
				}
			}
		}
		return nil
	}
}

func DeepCopy_batch_CronJobSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*CronJobSpec)
		out := out.(*CronJobSpec)
		*out = *in
		if in.StartingDeadlineSeconds != nil {
			in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds
			*out = new(int64)
			**out = **in
		}
		if in.Suspend != nil {
			in, out := &in.Suspend, &out.Suspend
			*out = new(bool)
			**out = **in
		}
		if err := DeepCopy_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil {
			return err
		}
		return nil
	}
}

func DeepCopy_batch_CronJobStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*CronJobStatus)
		out := out.(*CronJobStatus)
		*out = *in
		if in.Active != nil {
			in, out := &in.Active, &out.Active
			*out = make([]api.ObjectReference, len(*in))
			copy(*out, *in)
		}
		if in.LastScheduleTime != nil {
			in, out := &in.LastScheduleTime, &out.LastScheduleTime
			*out = new(v1.Time)
			**out = (*in).DeepCopy()
		}
		return nil
	}
}

func DeepCopy_batch_Job(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Job)
		out := out.(*Job)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_batch_JobSpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		if err := DeepCopy_batch_JobStatus(&in.Status, &out.Status, c); err != nil {
			return err
		}
		return nil
	}
}

func DeepCopy_batch_JobCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*JobCondition)
		out := out.(*JobCondition)
		*out = *in
		out.LastProbeTime = in.LastProbeTime.DeepCopy()
		out.LastTransitionTime = in.LastTransitionTime.DeepCopy()
		return nil
	}
}

func DeepCopy_batch_JobList(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*JobList)
		out := out.(*JobList)
		*out = *in
		if in.Items != nil {
			in, out := &in.Items, &out.Items
			*out = make([]Job, len(*in))
			for i := range *in {
				if err := DeepCopy_batch_Job(&(*in)[i], &(*out)[i], c); err != nil {
					return err
				}
			}
		}
		return nil
	}
}

func DeepCopy_batch_JobSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*JobSpec)
		out := out.(*JobSpec)
		*out = *in
		if in.Parallelism != nil {
			in, out := &in.Parallelism, &out.Parallelism
			*out = new(int32)
			**out = **in
		}
		if in.Completions != nil {
			in, out := &in.Completions, &out.Completions
			*out = new(int32)
			**out = **in
		}
		if in.ActiveDeadlineSeconds != nil {
			in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds
			*out = new(int64)
			**out = **in
		}
		if in.Selector != nil {
			in, out := &in.Selector, &out.Selector
			if newVal, err := c.DeepCopy(*in); err != nil {
				return err
			} else {
				*out = newVal.(*v1.LabelSelector)
			}
		}
		if in.ManualSelector != nil {
			in, out := &in.ManualSelector, &out.ManualSelector
			*out = new(bool)
			**out = **in
		}
		if err := api.DeepCopy_api_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
			return err
		}
		return nil
	}
}

func DeepCopy_batch_JobStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*JobStatus)
		out := out.(*JobStatus)
		*out = *in
		if in.Conditions != nil {
			in, out := &in.Conditions, &out.Conditions
			*out = make([]JobCondition, len(*in))
			for i := range *in {
				if err := DeepCopy_batch_JobCondition(&(*in)[i], &(*out)[i], c); err != nil {
					return err
				}
			}
		}
		if in.StartTime != nil {
			in, out := &in.StartTime, &out.StartTime
			*out = new(v1.Time)
			**out = (*in).DeepCopy()
		}
		if in.CompletionTime != nil {
			in, out := &in.CompletionTime, &out.CompletionTime
			*out = new(v1.Time)
			**out = (*in).DeepCopy()
		}
		return nil
	}
}

func DeepCopy_batch_JobTemplate(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*JobTemplate)
		out := out.(*JobTemplate)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_batch_JobTemplateSpec(&in.Template, &out.Template, c); err != nil {
			return err
		}
		return nil
	}
}

func DeepCopy_batch_JobTemplateSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*JobTemplateSpec)
		out := out.(*JobTemplateSpec)
		*out = *in
		if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
			return err
		} else {
			out.ObjectMeta = *newVal.(*v1.ObjectMeta)
		}
		if err := DeepCopy_batch_JobSpec(&in.Spec, &out.Spec, c); err != nil {
			return err
		}
		return nil
	}
}


text:
<?php namespace Uxms\Sharecount\Updates;

use Illuminate\Support\Facades\Schema;
use October\Rain\Database\Updates\Migration;

class CreateSharecountMappings extends Migration
{
    public function up()
    {
        Schema::create('uxms_sharecount_webpages', function ($table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->index();
            $table->text('url');
            $table->integer('count_face')->default(0);
            $table->integer('count_twit')->default(0);
            $table->integer('count_gp')->default(0);
            $table->timestamp('last_fetched')->nullable();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('uxms_sharecount_webpages');
    }

}


text:
#region Licence

#endregion

using System;

namespace Paramore.Brighter.Tests.CommandProcessors.TestDoubles
{
    internal class FakeRepository<T> : IRepository<T> where T : IAmAnAggregate
    {
        private readonly IUnitOfWork _unitOfWork;

        public FakeRepository(IUnitOfWork unitOfWork)
        {
            _unitOfWork = unitOfWork;
        }

        public void Add(T aggregate)
        {
            _unitOfWork.Add(aggregate);
        }

        public T this[Guid id]
        {
            get { throw new NotImplementedException(); }
        }

        public IUnitOfWork UnitOfWork
        {
            set { throw new NotImplementedException(); }
        }
    }
}


text:
<resources>
    <string name="app_name">Ropasc Lisp</string>

    <string name="sign_lizard">Lizard</string>
    <string name="sign_paper">Paper</string>
    <string name="sign_rock">Rock</string>
    <string name="sign_scissors">Scissors</string>
    <string name="sign_spock">Spock</string>

</resources>


text:
package cn.wanghaomiao.seimi.exception;

/**
 * @author SeimiMaster seimimaster@gmail.com
 * @since 2015/10/26.
 */
public class SeimiBeanResolveException extends RuntimeException {
    public SeimiBeanResolveException(String message) {
        super(message);
    }
}


text:
[![Build Status](https://travis-ci.org/nukesz/snake.svg?branch=master)](https://travis-ci.org/nukesz/snake)

## Run the game

`gradlew desktop:run`


text:
<resources>
    <string name="app_name">Voluntunity</string>

    <string name="navigation_drawer_open">Open navigation drawer</string>
    <string name="navigation_drawer_close">Close navigation drawer</string>

    <string name="action_settings">Settings</string>

    <!--TODO: add facebook and google map app ids here-->
    <!--TODO: IMPORTANT: REMOVE APP IDs BEFORE COMMITTING-->
    <!--DO NOT COMMIT APP ID TO GITHUB-->
    <string name="facebook_app_id"></string>
    <string name="maps_app_id"></string>

    <string name="leaderboard_logged_out">Sign in to access your leaderboard.</string>
    <string name="leaderboard_no_friends">You have no friends who use this app. \nTell them about it!</string>
</resources>


text:
var express = require('express');
var router = express.Router();
var G = require('../../global');

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Lobster - A Time series data logging server.' });
});

switch (G.Env.mode){
	case "main":
		require("./metrics")(router);
		require("./write")(router);
	case "duplicate":
	default:
		require("./read")(router);
		require('./aggregation')(router);
}

module.exports = router;


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

<TITLE>
TextBytesAtom (POI API Documentation)
</TITLE>

<META NAME="date" CONTENT="2012-11-26">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.hslf.record

Class TextBytesAtom

java.lang.Object
  org.apache.poi.hslf.record.Record
      org.apache.poi.hslf.record.RecordAtom
          org.apache.poi.hslf.record.TextBytesAtom

public final class TextBytesAtom
extends RecordAtom

A TextBytesAtom (type 4008). Holds text in ascii form (unknown
  code page, for now assumed to be the default of
  org.apache.poi.util.StringUtil, which is the Excel default).
 The trailing return character is always stripped from this

Author:

Nick Burch

Field Summary

Fields inherited from class org.apache.poi.hslf.record.Record

logger

Constructor Summary

TextBytesAtom()

          Create an empty TextBytes Atom

protected
TextBytesAtom(byte[] source,
              int start,
              int len)

          For the TextBytes Atom

Method Summary

 long
getRecordType()

          We are of type 4008

 java.lang.String
getText()

          Grabs the text.

 void
setText(byte[] b)

          Updates the text in the Atom.

 java.lang.String
toString()

          dump debug info; use getText() to return a string
 representation of the atom

 void
writeOut(java.io.OutputStream out)

          Write the contents of the record back, so it can be written
  to disk

Methods inherited from class org.apache.poi.hslf.record.RecordAtom

getChildRecords, isAnAtom

Methods inherited from class org.apache.poi.hslf.record.Record

buildRecordAtOffset, createRecordForType, findChildRecords, writeLittleEndian, writeLittleEndian

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

TextBytesAtom

protected TextBytesAtom(byte[] source,
                        int start,
                        int len)

For the TextBytes Atom

TextBytesAtom

public TextBytesAtom()

Create an empty TextBytes Atom

Method Detail

getText

public java.lang.String getText()

Grabs the text. Uses the default codepage

setText

public void setText(byte[] b)

Updates the text in the Atom. Must be 8 bit ascii

getRecordType

public long getRecordType()

We are of type 4008

Specified by:
getRecordType in class Record

writeOut

public void writeOut(java.io.OutputStream out)
              throws java.io.IOException

Write the contents of the record back, so it can be written
  to disk

Specified by:
writeOut in class Record

Throws:

java.io.IOException

toString

public java.lang.String toString()

dump debug info; use getText() to return a string
 representation of the atom

Overrides:
toString in class java.lang.Object

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2012 The Apache Software Foundation or
        its licensors, as applicable.


text:
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;

namespace FitCalculator.iOS
{
	[Register ("PercentageViewController")]
	partial class PercentageViewController
	{
		[Outlet]
		UIKit.UIButton ExerciseButton { get; set; }

		void ReleaseDesignerOutlets ()
		{
		}
	}
}


text:
package com.nkanaev.comics.model;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;

public class Storage {
    public static abstract class Book implements BaseColumns {
        public static final String TABLE_NAME = "book";

        public static final String COLUMN_NAME_ID = "id";
        public static final String COLUMN_NAME_FILEPATH = "path";
        public static final String COLUMN_NAME_FILENAME = "name";
        public static final String COLUMN_NAME_NUM_PAGES = "num_pages";
        public static final String COLUMN_NAME_CURRENT_PAGE = "cur_page";
        public static final String COLUMN_NAME_TYPE = "type";

        public static final String[] columns = {
                Book.COLUMN_NAME_ID,
                Book.COLUMN_NAME_FILEPATH,
                Book.COLUMN_NAME_FILENAME,
                Book.COLUMN_NAME_NUM_PAGES,
                Book.COLUMN_NAME_CURRENT_PAGE,
                Book.COLUMN_NAME_TYPE
        };
    }

    public class ComicDbHelper extends SQLiteOpenHelper {
        public static final int DATABASE_VERSION = 1;
        public static final String DATABASE_NAME = "comics.db";

        public ComicDbHelper(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
        }

        @Override
        public void onCreate(SQLiteDatabase db) {
            final String sql = "CREATE TABLE " + Book.TABLE_NAME + " ("
                    + Book.COLUMN_NAME_ID + " INTEGER PRIMARY KEY,"
                    + Book.COLUMN_NAME_FILEPATH + " TEXT,"
                    + Book.COLUMN_NAME_FILENAME + " TEXT,"
                    + Book.COLUMN_NAME_NUM_PAGES + " INTEGER,"
                    + Book.COLUMN_NAME_CURRENT_PAGE + " INTEGER DEFAULT 0,"
                    + Book.COLUMN_NAME_TYPE + " TEXT"
                    + ")";
            db.execSQL(sql);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

        }
    }

    private ComicDbHelper mDbHelper;
    private static Storage mSharedInstance;

    private static final String SORT_ORDER = "lower(" + Book.COLUMN_NAME_FILEPATH + "|| '/' || " + Book.COLUMN_NAME_FILENAME + ") ASC";

    private Storage(Context context) {
        mDbHelper = new ComicDbHelper(context);
    }

    public static Storage getStorage(Context context) {
        if (mSharedInstance == null) {
            synchronized (Storage.class) {
                if (mSharedInstance == null) {
                    mSharedInstance = new Storage(context);
                }
            }
        }
        return mSharedInstance;
    }

    public void clearStorage() {
        SQLiteDatabase db = mDbHelper.getWritableDatabase();
        db.delete(Book.TABLE_NAME, null, null);
    }

    public void addBook(File filepath, String type, int numPages) {
        ContentValues cv = new ContentValues();
        cv.put(Book.COLUMN_NAME_FILEPATH, filepath.getParentFile().getAbsolutePath());
        cv.put(Book.COLUMN_NAME_FILENAME, filepath.getName());
        cv.put(Book.COLUMN_NAME_NUM_PAGES, numPages);
        cv.put(Book.COLUMN_NAME_TYPE, type);

        SQLiteDatabase db = mDbHelper.getWritableDatabase();
        db.insert(Book.TABLE_NAME, "null", cv);
    }

    public ArrayList<Comic> listDirectoryComics() {
        SQLiteDatabase db = mDbHelper.getReadableDatabase();

        Cursor c = db.query(
                Book.TABLE_NAME, Book.columns, null, null,
                null, null,
                SORT_ORDER);

        ArrayList<Comic> comics = new ArrayList<>();
        if (c.getCount() == 0) return comics;

        HashSet<String> group = new HashSet<>();
        c.moveToFirst();
        do {
            String filepath = c.getString(c.getColumnIndex(Book.COLUMN_NAME_FILEPATH));
            if (group.contains(filepath))
                continue;
            group.add(filepath);
            comics.add(comicFromCursor(c));
        } while (c.moveToNext());

        c.close();

        return comics;
    }

    public ArrayList<Comic> listComics() {
        return listComics(null);
    }

    public ArrayList<Comic> listComics(String path) {
        SQLiteDatabase db = mDbHelper.getReadableDatabase();

        String selection = "";
        if (path != null) {
            selection = Book.COLUMN_NAME_FILEPATH + "=\"" + path +  "\"";
        }

        Cursor c = db.query(Book.TABLE_NAME, Book.columns, selection, null, null, null, SORT_ORDER);
        ArrayList<Comic> comics = new ArrayList<>();

        c.moveToFirst();
        if (c.getCount() > 0) {
            do {
                comics.add(comicFromCursor(c));
            } while (c.moveToNext());
        }

        c.close();

        return comics;
    }

    public Comic getComic(int comicId) {
        SQLiteDatabase db = mDbHelper.getReadableDatabase();
        String order = Book.COLUMN_NAME_FILEPATH + " DESC";
        String selection = Book.COLUMN_NAME_ID + "=" + Integer.toString(comicId);
        Cursor c = db.query(Book.TABLE_NAME, Book.columns, selection, null, null, null, order);

        if (c.getCount() != 1) {
            return null;
        }

        c.moveToFirst();

        Comic comic = comicFromCursor(c);
        c.close();
        return comic;
    }

    private Comic comicFromCursor(Cursor c) {
        int id = c.getInt(c.getColumnIndex(Book.COLUMN_NAME_ID));
        String path = c.getString(c.getColumnIndex(Book.COLUMN_NAME_FILEPATH));
        String name = c.getString(c.getColumnIndex(Book.COLUMN_NAME_FILENAME));
        int numPages = c.getInt(c.getColumnIndex(Book.COLUMN_NAME_NUM_PAGES));
        int currentPage = c.getInt(c.getColumnIndex(Book.COLUMN_NAME_CURRENT_PAGE));
        String type = c.getString(c.getColumnIndex(Book.COLUMN_NAME_TYPE));

        return new Comic(this, id, path, name, type, numPages, currentPage);
    }

    public void bookmarkPage(int comicId, int page) {
        ContentValues values = new ContentValues();
        values.put(Book.COLUMN_NAME_CURRENT_PAGE, page);
        String filter = Book.COLUMN_NAME_ID + "=" + Integer.toString(comicId);
        SQLiteDatabase db = mDbHelper.getWritableDatabase();
        db.update(Book.TABLE_NAME, values, filter, null);
    }

    public void removeComic(int comicId) {
        SQLiteDatabase db = mDbHelper.getWritableDatabase();
        String whereClause = Book.COLUMN_NAME_ID + '=' + Integer.toString(comicId);
        db.delete(Book.TABLE_NAME, whereClause, null);
    }

    public Comic getPrevComic(Comic comic) {
        ArrayList<Comic> comics = listComics(comic.getFile().getParent());
        int idx = comics.indexOf(comic);
        if (idx != 0)
            return comics.get(idx-1);
        return null;
    }

    public Comic getNextComic(Comic comic) {
        ArrayList<Comic> comics = listComics(comic.getFile().getParent());
        int idx = comics.indexOf(comic);
        if (idx != (comics.size() - 1))
            return comics.get(idx+1);
        return null;
    }
}


text:
#ifndef STAN_MATH_PRIM_META_VOID_T_HPP
#define STAN_MATH_PRIM_META_VOID_T_HPP

#include <stan/math/prim/meta/bool_constant.hpp>
#include <type_traits>

namespace stan {

// Dummy struct that has a type void
template <typename... Ts>
struct make_void {
  typedef void type;
};

/**
 * Utility metafunction that maps a sequence of any types to the type void
 * This metafunction is used in template metaprogramming to detect ill-formed
 * types or the validity of an expression in an SFINAE context:
 */
template <typename... Ts>
using void_t = typename make_void<Ts...>::type;

}  // namespace stan
#endif


text:
set -e

CONF_INSTALL=/opt/confluence

echo Downloading unzip
DEBIAN_FRONTEND=noninteractive apt-get install -q -y unzip

echo Downloading Confluence $CONFLUENCE_VERSION
#curl -Lks http://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz -o /root/confluence.tar.gz
curl -Lks https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-${CONFLUENCE_VERSION}.zip -o /root/confluence.zip
/usr/sbin/useradd --create-home --home-dir ${CONF_INSTALL} --groups atlassian --shell /bin/bash confluence
#tar zxf /root/confluence.tar.gz --strip=1 -C ${CONF_INSTALL}
ln -s /opt/confluence /opt/confluence/atlassian-confluence-${CONFLUENCE_VERSION} # create a symlink that redirects output
unzip -a /root/confluence.zip -d /opt/confluence
rm /opt/confluence/atlassian-confluence-${CONFLUENCE_VERSION} # remote symlink
rm /root/confluence.zip
echo "confluence.home = /opt/atlassian-home/confluence" > ${CONF_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties
chown -R confluence:atlassian ${CONF_INSTALL}

chmod -R 700                   "${CONF_INSTALL}/conf"
chmod -R 700                   "${CONF_INSTALL}/temp"
chmod -R 700                   "${CONF_INSTALL}/logs"
chmod -R 700                   "${CONF_INSTALL}/work"

mv ${CONF_INSTALL}/conf/server.xml ${CONF_INSTALL}/conf/server-backup.xml


text:
import Ember from 'ember';
import BaseDemoController from '../controllers/base-demo-controller';

export default BaseDemoController.extend({
    demoName: 'content',

    init: function() {
        var content = [
            {name: 'hbs', content: 'content.hbs' }
        ];

        this.setSourceFiles(content);
    }

});


text:
void setup();
void loop();
void update_leds (void*);
void get_brightness (void*);
void update_mqtt_status (void*);
void update_mdns();

void setup_wifi();
void setup_OTA();
void callback (char* topic, byte* payload, unsigned int length);

static const char* myssid = MAKELIGHT_SSID;
static const char* mypass = MAKELIGHT_PASS;
static const char* mqtt_server = MAKELIGHT_MQTT_SERVER;
static const char* hostname = WEBNAME;
static const int mqtt_server_port = MAKELIGHT_MQTT_SERVER_PORT;
static const char* update_path = UPDATEPATH;
static const char* update_username = UPDATE_USERNAME;
static const char* update_passwort = UPDATE_PASSWORT;
static const int update_port = UPDATE_PORT;

// for OTA
static ESP8266WebServer httpServer (update_port);
static ESP8266HTTPUpdateServer httpUpdater;

// create MQTT client
static WiFiClient espClient;
static PubSubClient client (espClient);

static volatile bool autoSwitchOnEnabled = false;

// Ticker to update brightness
static TickerScheduler ticker (5);

void setup()
{
    pinMode (LED_BUILTIN, OUTPUT); // Initialize the BUILTIN_LED pin as an output

    // Serial Stuff
    Serial.begin (9600);
    Serial.setDebugOutput (true);
    Serial.println ("Start...");
    delay (10);
    // Hardware Stuff
    // A0 - ligth resistor (+>-|=L1=|-A0-|=Poti=|-D6)
    pinMode (A0, INPUT);
    // D6 - Power on/off light sensor (sink) Low, light sensor on
    pinMode (D6, OUTPUT);
    digitalWrite (D6, LOW);

    // initialize schedule
    ticker.add (0, LED_TICK, update_leds, 0);
    ticker.add (1, 1000, update_mqtt_status, 0);
    ticker.add (2, 1000, get_brightness, 0);
    //ticker.add(3, LED_TICK, update_mdns);

    // LED Strip acitvate
    CLedStrip* strip = CLedStrip::getStrip_ptr();
    strip->init();
    strip->getConf().ctr = 50;
    strip->getConf().min = 120;
    strip->getConf().period = 5;
    strip->switch_program (2);

    setup_wifi();
    setup_OTA();

    client.setServer (mqtt_server, mqtt_server_port);
    client.setCallback (callback);
}

void setup_wifi()
{

    digitalWrite (LED_BUILTIN, LOW);
    delay (10);
    // We start by connecting to a WiFi network
    Serial.println();
    Serial.print ("Connecting to ");
    Serial.println (myssid);

    WiFi.hostname (hostname);
    WiFi.begin (myssid, mypass);

    while (WiFi.status() != WL_CONNECTED)
    {
        digitalWrite (LED_BUILTIN, LOW);
        delay (500);
        Serial.print (".");
        digitalWrite (LED_BUILTIN, HIGH);
    }

    Serial.println ("");
    Serial.println ("WiFi connected");
    Serial.println ("IP address: ");
    Serial.println (WiFi.localIP());
    digitalWrite (LED_BUILTIN, HIGH);
    delay (100);
}

void callback (char* topic, byte* payload, size_t length)
{
    Serial.println (topic);

    if (String (topic) == String ("/home/wohnzimmer/flaschengeist/command"))
    {
        if (length > 0)
        {
            // Switch on the LED if an 1 was received as first character
            if (static_cast<char> (payload[0]) == '0')
            {
                CLedStrip* strip = CLedStrip::getStrip_ptr();
                strip->switch_program (0);
            }
            else
            {
                CLedStrip* strip = CLedStrip::getStrip_ptr();
                strip->switch_program (2);
            }
        }
    }

    if (String (topic) == String ("/home/wohnzimmer/flaschengeist/auto"))
    {
        if (static_cast<char> (payload[0]) == '0')
        {
            autoSwitchOnEnabled = false;
        }
        else
        {
            autoSwitchOnEnabled = true;
        }
    }
}

void reconnect()
{
    // Loop until we're reconnected
    while (!client.connected())
    {
        Serial.print ("Attempting MQTT connection...");

        // Attempt to connect
        if (client.connect (hostname))
        {
            Serial.println ("connected");
            // Once connected, publish an announcement...
            client.publish ("/home/wohnzimmer/flaschengeist/status",
                            String (CLedStrip::getStrip_ptr()->getConf().old_prog).c_str());
            // ... and resubscribe
            client.subscribe ("/home/wohnzimmer/command");
            client.subscribe ("/home/wohnzimmer/flaschengeist/command");
            client.subscribe ("/home/wohnzimmer/flaschengeist/auto");
            digitalWrite (LED_BUILTIN, HIGH);
        }
        else
        {
            //digitalWrite (BUILTIN_LED, LOW);
            Serial.print ("failed, rc=");
            Serial.print (client.state());
            Serial.println (" try again in 2 seconds");
            //delay (1000);
            digitalWrite (LED_BUILTIN, HIGH);
            delay (1000);
        }
    }
}

void loop()
{
    // do what, you need to do
    ticker.update();

    // this is only a test function
    //int a0 = analogRead(A0);
    // busy wait
    //	ns_net::Network::GetNetwork()->webwork();
    if (!client.connected())
    {
        reconnect();
    }

    client.loop();
    update_mdns();
}

void update_leds (void*)
{
    // update led pattern / program
    CLedStrip::getStrip_ptr()->update();
}

void get_brightness (void*)
{
    int br = analogRead (A0);

    if (client.connected())
    {
        client.publish ("/home/wohnzimmer/flaschengeist/brightness",
                        String (br).c_str());
    }

    if (autoSwitchOnEnabled)
    {
        CLedStrip* strip = CLedStrip::getStrip_ptr();

        if (br < 100)
        {
            strip->switch_program (2);
        }

        if (br > 120)
        {
            strip->switch_program (0);
        }
    }

    // ... and resubscribe
}

void update_mqtt_status (void*)
{
    if (client.connected())
    {
        client.publish ("/home/wohnzimmer/flaschengeist/status",
                        String (CLedStrip::getStrip_ptr()->getConf().old_prog).c_str());

        client.publish ("/home/wohnzimmer/flaschengeist/auto",
                        String (autoSwitchOnEnabled).c_str());
    }
}

void update_mdns()
{
    if (WiFi.isConnected())
    {
        MDNS.update();
    }
}

void setup_OTA()
{
    digitalWrite (LED_BUILTIN, LOW);

    MDNS.begin (hostname);
    httpUpdater.setup (&httpServer, update_path, update_username, update_passwort);
    httpServer.begin();
    MDNS.addService ("http", "tcp", update_port);
    Serial.println ("OTA setup finished!");
}


text:
module Spree
  class SizeValue < ActiveRecord::Base
    attr_accessible :size_type_id, :option_value_id, :value
    belongs_to  :size_type
    belongs_to  :size_chart
    belongs_to  :option_value
  end
end


text:
<?php

abstract class PhabricatorMetaMTAEmailHeraldAction
  extends HeraldAction {

  const DO_SEND = 'do.send';
  const DO_FORCE = 'do.force';

  public function getRequiredAdapterStates() {
    return array(
      HeraldMailableState::STATECONST,
    );
  }

  public function supportsObject($object) {
    return self::isMailGeneratingObject($object);
  }

  public static function isMailGeneratingObject($object) {
    // NOTE: This implementation lacks generality, but there's no great way to
    // figure out if something generates email right now.

    if ($object instanceof DifferentialDiff) {
      return false;
    }

    if ($object instanceof PhabricatorMetaMTAMail) {
      return false;
    }

    return true;
  }

  public function getActionGroupKey() {
    return HeraldNotifyActionGroup::ACTIONGROUPKEY;
  }

  protected function applyEmail(array $phids, $force) {
    $adapter = $this->getAdapter();

    $allowed_types = array(
      PhabricatorPeopleUserPHIDType::TYPECONST,
      PhabricatorProjectProjectPHIDType::TYPECONST,
    );

    // There's no stateful behavior for this action: we always just send an
    // email.
    $current = array();

    $targets = $this->loadStandardTargets($phids, $allowed_types, $current);
    if (!$targets) {
      return;
    }

    $phids = array_fuse(array_keys($targets));

    foreach ($phids as $phid) {
      $adapter->addEmailPHID($phid, $force);
    }

    if ($force) {
      $this->logEffect(self::DO_FORCE, $phids);
    } else {
      $this->logEffect(self::DO_SEND, $phids);
    }
  }

  protected function getActionEffectMap() {
    return array(
      self::DO_SEND => array(
        'icon' => 'fa-envelope',
        'color' => 'green',
        'name' => pht('Sent Mail'),
      ),
      self::DO_FORCE => array(
        'icon' => 'fa-envelope',
        'color' => 'blue',
        'name' => pht('Forced Mail'),
      ),
    );
  }

  protected function renderActionEffectDescription($type, $data) {
    switch ($type) {
      case self::DO_SEND:
        return pht(
          'Queued email to be delivered to %s target(s): %s.',
          phutil_count($data),
          $this->renderHandleList($data));
      case self::DO_FORCE:
        return pht(
          'Queued email to be delivered to %s target(s), ignoring their '.
          'notification preferences: %s.',
          phutil_count($data),
          $this->renderHandleList($data));
    }
  }

}


text:
'use strict';

/**
 * Module dependencies.
 */

var should = require('should');
var request = require('supertest');
var app = require('../../../servers/web');

describe('controllers/web/user.test.js', function () {
  before(function (done) {
    app.listen(0, done);
  });
  after(function (done) {
    app.close(done);
  });

  describe('GET /~:name', function (done) {
    it('should get 200', function (done) {
      request(app)
      .get('/~dead_horse')
      .expect(200)
      .expect(/
/)
      .expect(/Packages by /, done);
    });

    it('should get 404', function (done) {
      request(app)
      .get('/~not_exist_user')
      .expect(404, done);
    });

    it('should get not eixst user but have modules 200', function (done) {
      request(app)
      .get('/~tjholowaychuk')
      .expect(200)
      .expect(/
/)
      .expect(/Packages by/, done);
    });
  });
});