text:
package org.apache.camel.language.simple;

import org.apache.camel.language.simple.types.SimpleToken;
import org.apache.camel.language.simple.types.SimpleTokenType;
import org.apache.camel.language.simple.types.TokenType;
import org.apache.camel.util.ObjectHelper;

/**
 * Tokenizer to create {@link SimpleToken} from the input.
 */
public final class SimpleTokenizer {

    // keep this number in sync with tokens list
    private static final int NUMBER_OF_TOKENS = 47;

    private static final SimpleTokenType[] KNOWN_TOKENS = new SimpleTokenType[NUMBER_OF_TOKENS];

    // optimise to be able to quick check for start functions
    private static final String[] FUNCTION_START = new String[] { "${", "$simple{" };

    static {
        // add known tokens
        KNOWN_TOKENS[0] = new SimpleTokenType(TokenType.functionStart, "${");
        KNOWN_TOKENS[1] = new SimpleTokenType(TokenType.functionStart, "$simple{");
        KNOWN_TOKENS[2] = new SimpleTokenType(TokenType.functionEnd, "}");
        KNOWN_TOKENS[3] = new SimpleTokenType(TokenType.whiteSpace, " ");
        KNOWN_TOKENS[4] = new SimpleTokenType(TokenType.whiteSpace, "\t");
        KNOWN_TOKENS[5] = new SimpleTokenType(TokenType.whiteSpace, "\n");
        KNOWN_TOKENS[6] = new SimpleTokenType(TokenType.whiteSpace, "\r");
        KNOWN_TOKENS[7] = new SimpleTokenType(TokenType.singleQuote, "'");
        KNOWN_TOKENS[8] = new SimpleTokenType(TokenType.doubleQuote, "\"");
        KNOWN_TOKENS[9] = new SimpleTokenType(TokenType.booleanValue, "true");
        KNOWN_TOKENS[10] = new SimpleTokenType(TokenType.booleanValue, "false");
        KNOWN_TOKENS[11] = new SimpleTokenType(TokenType.nullValue, "null");
        KNOWN_TOKENS[12] = new SimpleTokenType(TokenType.escape, "\\");

        // binary operators
        KNOWN_TOKENS[13] = new SimpleTokenType(TokenType.binaryOperator, "==");
        KNOWN_TOKENS[14] = new SimpleTokenType(TokenType.binaryOperator, "=~");
        KNOWN_TOKENS[15] = new SimpleTokenType(TokenType.binaryOperator, ">=");
        KNOWN_TOKENS[16] = new SimpleTokenType(TokenType.binaryOperator, "<=");
        KNOWN_TOKENS[17] = new SimpleTokenType(TokenType.binaryOperator, ">");
        KNOWN_TOKENS[18] = new SimpleTokenType(TokenType.binaryOperator, "<");
        KNOWN_TOKENS[19] = new SimpleTokenType(TokenType.binaryOperator, "!=~");
        KNOWN_TOKENS[20] = new SimpleTokenType(TokenType.binaryOperator, "!=");
        KNOWN_TOKENS[21] = new SimpleTokenType(TokenType.binaryOperator, "not is");
        KNOWN_TOKENS[22] = new SimpleTokenType(TokenType.binaryOperator, "!is");
        KNOWN_TOKENS[23] = new SimpleTokenType(TokenType.binaryOperator, "is");
        KNOWN_TOKENS[24] = new SimpleTokenType(TokenType.binaryOperator, "not contains");
        KNOWN_TOKENS[25] = new SimpleTokenType(TokenType.binaryOperator, "!contains");
        KNOWN_TOKENS[26] = new SimpleTokenType(TokenType.binaryOperator, "contains");
        KNOWN_TOKENS[27] = new SimpleTokenType(TokenType.binaryOperator, "!~~");
        KNOWN_TOKENS[28] = new SimpleTokenType(TokenType.binaryOperator, "~~");
        KNOWN_TOKENS[29] = new SimpleTokenType(TokenType.binaryOperator, "not regex");
        KNOWN_TOKENS[30] = new SimpleTokenType(TokenType.binaryOperator, "!regex");
        KNOWN_TOKENS[31] = new SimpleTokenType(TokenType.binaryOperator, "regex");
        KNOWN_TOKENS[32] = new SimpleTokenType(TokenType.binaryOperator, "not in");
        KNOWN_TOKENS[33] = new SimpleTokenType(TokenType.binaryOperator, "!in");
        KNOWN_TOKENS[34] = new SimpleTokenType(TokenType.binaryOperator, "in");
        KNOWN_TOKENS[35] = new SimpleTokenType(TokenType.binaryOperator, "not range");
        KNOWN_TOKENS[36] = new SimpleTokenType(TokenType.binaryOperator, "!range");
        KNOWN_TOKENS[37] = new SimpleTokenType(TokenType.binaryOperator, "range");
        KNOWN_TOKENS[38] = new SimpleTokenType(TokenType.binaryOperator, "startsWith");
        KNOWN_TOKENS[39] = new SimpleTokenType(TokenType.binaryOperator, "starts with");
        KNOWN_TOKENS[40] = new SimpleTokenType(TokenType.binaryOperator, "endsWith");
        KNOWN_TOKENS[41] = new SimpleTokenType(TokenType.binaryOperator, "ends with");

        // unary operators
        KNOWN_TOKENS[42] = new SimpleTokenType(TokenType.unaryOperator, "++");
        KNOWN_TOKENS[43] = new SimpleTokenType(TokenType.unaryOperator, "--");

        // logical operators
        KNOWN_TOKENS[44] = new SimpleTokenType(TokenType.logicalOperator, "&&");
        KNOWN_TOKENS[45] = new SimpleTokenType(TokenType.logicalOperator, "||");

        //binary operator
        // it is added as the last item because unary -- has the priority
        // if unary not found it is highly possible - operator is run into.
        KNOWN_TOKENS[46] = new SimpleTokenType(TokenType.minusValue, "-");
    }

    private SimpleTokenizer() {
        // static methods
    }

    /**
     * Does the expression include a simple function.
     *
     * @param  expression the expression
     * @return            <tt>true</tt> if one or more simple function is included in the expression
     */
    public static boolean hasFunctionStartToken(String expression) {
        if (expression != null) {
            return expression.contains(FUNCTION_START[0]) || expression.contains(FUNCTION_START[1]);
        }
        return false;
    }

    /**
     * Create the next token
     *
     * @param  expression  the input expression
     * @param  index       the current index
     * @param  allowEscape whether to allow escapes
     * @param  filter      defines the accepted token types to be returned (character is always used as fallback)
     * @return             the created token, will always return a token
     */
    public static SimpleToken nextToken(String expression, int index, boolean allowEscape, TokenType... filter) {
        return doNextToken(expression, index, allowEscape, filter);
    }

    /**
     * Create the next token
     *
     * @param  expression  the input expression
     * @param  index       the current index
     * @param  allowEscape whether to allow escapes
     * @return             the created token, will always return a token
     */
    public static SimpleToken nextToken(String expression, int index, boolean allowEscape) {
        return doNextToken(expression, index, allowEscape);
    }

    private static SimpleToken doNextToken(String expression, int index, boolean allowEscape, TokenType... filters) {

        boolean numericAllowed = acceptType(TokenType.numericValue, filters);
        if (numericAllowed) {
            // is it a numeric value
            StringBuilder sb = new StringBuilder();
            boolean digit = true;
            while (digit && index < expression.length()) {
                digit = Character.isDigit(expression.charAt(index));
                if (digit) {
                    char ch = expression.charAt(index);
                    sb.append(ch);
                    index++;
                    continue;
                }
                // is it a dot or comma as part of a floating point number
                boolean decimalSeparator = '.' == expression.charAt(index) || ',' == expression.charAt(index);
                if (decimalSeparator && sb.length() > 0) {
                    char ch = expression.charAt(index);
                    sb.append(ch);
                    index++;
                    // assume its still a digit
                    digit = true;
                    continue;
                }
            }
            if (sb.length() > 0) {
                return new SimpleToken(new SimpleTokenType(TokenType.numericValue, sb.toString()), index);
            }
        }

        boolean escapeAllowed = allowEscape && acceptType(TokenType.escape, filters);
        if (escapeAllowed) {
            StringBuilder sb = new StringBuilder();
            char ch = expression.charAt(index);
            boolean escaped = '\\' == ch;
            if (escaped && index < expression.length() - 1) {
                // grab next character to escape
                char next = expression.charAt(++index);
                // special for new line, tabs and carriage return
                boolean special = false;
                if ('n' == next) {
                    sb.append("\n");
                    special = true;
                } else if ('t' == next) {
                    sb.append("\t");
                    special = true;
                } else if ('r' == next) {
                    sb.append("\r");
                    special = true;
                } else if ('}' == next) {
                    sb.append("}");
                    special = true;
                } else {
                    // not special just a regular character
                    sb.append(ch);
                }

                // force 2 as length if special
                return new SimpleToken(new SimpleTokenType(TokenType.character, sb.toString()), index, special ? 2 : 1);
            }
        }

        // it could be any of the known tokens
        String text = expression.substring(index);
        for (int i = 0; i < NUMBER_OF_TOKENS; i++) {
            SimpleTokenType token = KNOWN_TOKENS[i];
            if (acceptType(token.getType(), filters)
                    && acceptToken(token, text, expression, index)) {
                return new SimpleToken(token, index);
            }
        }

        // fallback and create a character token
        char ch = expression.charAt(index);
        SimpleToken token = new SimpleToken(new SimpleTokenType(TokenType.character, "" + ch), index);
        return token;
    }

    private static boolean acceptType(TokenType type, TokenType... filters) {
        if (filters == null || filters.length == 0) {
            return true;
        }
        for (TokenType filter : filters) {
            if (type == filter) {
                return true;
            }
        }
        return false;
    }

    private static boolean acceptToken(SimpleTokenType token, String text, String expression, int index) {
        if (token.isUnary() && text.startsWith(token.getValue())) {
            int endLen = 1;

            // special check for unary as the previous must be a function end, and the next a whitespace
            // to ensure unary operators is only applied on functions as intended
            int len = token.getValue().length();

            String previous = "";
            if (index - endLen >= 0) {
                previous = expression.substring(index - endLen, index);
            }
            String after = text.substring(len);
            boolean whiteSpace = ObjectHelper.isEmpty(after) || after.startsWith(" ");
            boolean functionEnd = previous.equals("}");
            return functionEnd && whiteSpace;
        }

        return text.startsWith(token.getValue());
    }

}


text:
<?php

/**
 * Created by PhpStorm.
 * User: claud
 * Date: 27/05/2016
 * Time: 12:30
 */
class Cidade_Model extends CI_Model
{
    private $table = "tb_cidade";
    function __construct(){
        parent::__construct();
    }

    function getCidadesByUF($idEstado) {
        $result =  $this->db->query("SELECT * FROM tb_cidade WHERE id_estado = ".$idEstado);
        return $result->result();
    }

}

redpajama_set_name: RedPajamaGithub


text:
class Profile;
class PrefetchProxyService;

class PrefetchProxyServiceFactory : public BrowserContextKeyedServiceFactory {
 public:
  // Returns the PrefetchProxy for |profile|.
  static PrefetchProxyService* GetForProfile(Profile* profile);

  static PrefetchProxyServiceFactory* GetInstance();

 private:
  friend struct base::DefaultSingletonTraits<PrefetchProxyServiceFactory>;

  PrefetchProxyServiceFactory();
  ~PrefetchProxyServiceFactory() override;

  // BrowserContextKeyedServiceFactory:
  KeyedService* BuildServiceInstanceFor(
      content::BrowserContext* profile) const override;

  PrefetchProxyServiceFactory(const PrefetchProxyServiceFactory&) = delete;
  PrefetchProxyServiceFactory& operator=(const PrefetchProxyServiceFactory&) =
      delete;
};

#endif  // CHROME_BROWSER_PREFETCH_PREFETCH_PROXY_PREFETCH_PROXY_SERVICE_FACTORY_H_


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.wm;

import com.intellij.openapi.Disposable;
import com.intellij.openapi.ui.Painter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

public interface IdeGlassPane {
  void addMousePreprocessor(@NotNull MouseListener listener, @NotNull Disposable parent);

  void addMouseMotionPreprocessor(@NotNull MouseMotionListener listener, @NotNull Disposable parent);

  void addPainter(@Nullable Component component, @NotNull Painter painter, @NotNull Disposable parent);

  /**
   * @deprecated to remove the listener, invoke {@code Disposer.dispose(disposable);} on the disposable
   * which you've passed to {@link #addMouseMotionPreprocessor(MouseMotionListener, Disposable)} instead
   */
  @Deprecated
  void removeMouseMotionPreprocessor(@NotNull MouseMotionListener listener);

  void setCursor(@Nullable Cursor cursor, @NotNull Object requestor);

  interface TopComponent {
    boolean canBePreprocessed(@NotNull MouseEvent e);
  }
}


text:
static const NSInteger _count = 4;
static const NSInteger _interval = 10;

@implementation UICollectionViewDynamicLayout

- (instancetype)init {
    self = [super init];
    if (self) {
        self.sectionInset = UIEdgeInsetsMake(_interval, _interval, _interval, _interval);
        self.minimumLineSpacing = _interval;
        self.minimumInteritemSpacing = _interval;

        self.dynamicAnimator = [[UIDynamicAnimator alloc] initWithCollectionViewLayout:self];
    }
    return self;
}

- (void)prepareLayout {
    [super prepareLayout];

    NSInteger itemWidth = (self.collectionView.bounds.size.width-(_count+1)*_interval)/_count;
    self.itemSize = CGSizeMake(itemWidth, itemWidth);

    CGSize contentSize = self.collectionView.contentSize;
    NSArray *items = [super layoutAttributesForElementsInRect:
                      CGRectMake(0.0f, 0.0f, contentSize.width, contentSize.height)];

    if (self.dynamicAnimator.behaviors.count == 0) {
        [items enumerateObjectsUsingBlock:^(id<UIDynamicItem> obj, NSUInteger idx, BOOL *stop) {

            UIAttachmentBehavior *behaviour = [[UIAttachmentBehavior alloc] initWithItem:obj attachedToAnchor:[obj center]];
            behaviour.length = 0.0f;
            behaviour.damping = 0.8f;
            behaviour.frequency = 1.0f;

            [self.dynamicAnimator addBehavior:behaviour];

        }];
    }
}

- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect {
    return [self.dynamicAnimator itemsInRect:rect];
}

- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
    return [self.dynamicAnimator layoutAttributesForCellAtIndexPath:indexPath];
}

- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
    UIScrollView *scrollView = self.collectionView;
    CGFloat delta = newBounds.origin.y - scrollView.bounds.origin.y;

    CGPoint touchLocation = [self.collectionView.panGestureRecognizer locationInView:self.collectionView];

    [self.dynamicAnimator.behaviors enumerateObjectsUsingBlock:^(UIAttachmentBehavior *springBehaviour, NSUInteger idx, BOOL *stop) {
        CGFloat yDistanceFromTouch = fabs(touchLocation.y - springBehaviour.anchorPoint.y);
        CGFloat xDistanceFromTouch = fabs(touchLocation.x - springBehaviour.anchorPoint.x);
        CGFloat scrollResistance = (yDistanceFromTouch + xDistanceFromTouch) / 1500.0f;

        UICollectionViewLayoutAttributes *item = (UICollectionViewLayoutAttributes *)springBehaviour.items.firstObject;
        CGPoint center = item.center;
        if (delta < 0) {
            center.y += MAX(delta, delta*scrollResistance);
        }
        else {
            center.y += MIN(delta, delta*scrollResistance);
        }
        item.center = center;

        [self.dynamicAnimator updateItemUsingCurrentState:item];
    }];

    return NO;
}

@end


text:
/*window.esriGeowConfig = {
    baseUrl: 'http://www.arcgis.com/home/',
    restBaseUrl: 'http://www.arcgis.com/sharing/'
}*/

define ([
     "dojo/_base/declare",
     "dojo/ready",
     "dojo/on",
     "esri/main",
     "esri/arcgis/utils",
     "esri/arcgis/Portal"
], function(declare, ready, on, esri1, esri2, esriPortal) {

//BEGIN maps and apps custom scroll

var homePageFeaturedContentCount = 3;
var shiftStep = 220; // 120;
var shiftElements = 1;

function addToPane(results, strDomMapsAndApps, groupID, rand, _restBaseUrl) {

    dojo.query("#scrollPaneLeft" + rand ).forEach(function (e) {
        e.style['display'] = "block";
        dojo.addClass(e, "scrollDisabled");
    });
    dojo.query("#scrollPaneRight" + rand).forEach(function (e) {
        e.style['display'] = "block";
        if (results.length <= homePageFeaturedContentCount) {
            dojo.addClass(e, "scrollDisabled");
        }
    });

    dojo.byId("featuredMapsCarousel").parentNode.style['height'] = "200px";
    dojo.byId("featuredMapsCarousel").parentNode.style['overflow'] = "hidden";

}

return declare('esriTemplate.map_field.map',[], {

_mapElementId  : null,
_baseUrl       : null,
_elBaseSuffix  : null,
_map           : null,

constructor: function() {},

setElBaseSuffix: function(suffix) {
  this._elBaseSuffix = suffix;
},

setMapElementId: function(id) {
  this._mapElementId = id;
},

showWebMap: function(baseUrl, webmapId, extent, title) {

  if(typeof(title) != 'undefined' && title != null) {

    dojo.byId("esriMapTitleBar" + this._elBaseSuffix).innerHTML = '' + title + '';
  }
  if(this._map != null) {
      this._map.destroy();
  }

  esri.arcgis.utils.arcgisUrl = baseUrl + '/sharing/content/items';
  esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";

  var mapDeferred = esri.arcgis.utils.createMap(webmapId, this._mapElementId, {
	  mapOptions: {
		sliderStyle: "small"
	  }
	});
  mapDeferred.then(
    dojo.hitch(this, function(response) {
	      this._map = response.map;
		  if(typeof(extent) != 'undefined' && extent != null) {
		    this._map.setExtent(extent);
		  }
          dojo.byId("map-stats").innerHTML = '' + response.itemInfo.item.title + '';
          /*dojo.byId("subtitle").innerHTML = response.itemInfo.item.snippet;

          map = response.map;

          //add the legend
          var layers = response.itemInfo.itemData.operationalLayers;
          if (map.loaded) {
            initMap(layers);
          } else {
            dojo.connect(map, "onLoad", function() {
              initMap(layers);
            });
          }*/
    }),
	function(error){
          console.log("Map creation failed: ", dojo.toJson(error));
    }
  );

}

// end of class declare return
});

// end of module declaration
});


text:
<?php
/**
 * Multiple short texts question, item input text Html
 * @var $tip
 * @var $alert
 * @var $maxlength
 * @var $tiwidth
 * @var $extraclass
 * @var $sDisplayStyle
 * @var $prefix
 * @var $myfname
 * @var $labelText
 * @var $prefix
 * @var $kpclass
 * @var $rows
 * @var $checkconditionFunction
 * @var $dispVal
 * @var $suffix
 * @var $sUnformatedValue
 * @var $slider_min
 * @var $slider_max
 * @var $slider_step
 * @var $slider_default
 * @var $slider_middlestart
 * @var $slider_orientation
 * @var $slider_handle
 * @var $slider_reset
 * @var $sSeparator
 * @var $slider_debug
 */

//the complicated default slider setting will be simplified header_remove
//Three cases:
//  1: posted value safed
//  2: default value set
//  3: slider starts in middle position

$sliderStart = 'null';
if($dispVal) //posted value => higest priority
{
    $sliderStart = $dispVal;
}
else if($slider_default) //
{
    $sliderStart = $slider_default;
}
else if($slider_middlestart==1) //
{
    $sliderStart = intval(($slider_max + $slider_min)/2);
}

?>

<div  id='javatbd<?php echo $myfname; ?>' class="question-item answer-item numeric-item  text-item <?php echo $extraclass;?> col-sm-12" <?php echo $sDisplayStyle;?>>

        <?php if($alert):?>

                <?php echo $labelText;?>

        <?php else:?>
            <label class='control-label col-xs-12 numeric-label' for="answer<?php echo $myfname; ?>">
                <?php echo $labelText;?>

        <?php endif;?>

            <div class='col-xs-12 col-sm-<?php echo $tiwidth; ?>'>
                        <?php if (!empty($sliderright) || !empty($sliderleft)): ?>
                            <?php echo $sliderleft;?>
                        <?php endif; ?>

                        <?php if (empty($sliderleft) && empty($sliderright)): ?>

                        <?php else: ?>

                        <?php endif; ?>

                            <input
                                class="text form-control pull-left <?php echo $kpclass;?>"
                                type="text"
                                name="slider_<?php echo $myfname;?>"
                                id="slider_answer<?php echo $myfname; ?>"
                                value="<?php echo $sliderStart; ?>"
                                <?php echo $maxlength; ?>
                                data-slider-value="<?php echo $sliderStart; ?>"
                                data-slider-min='<?php echo $slider_min;?>'
                                data-slider-max='<?php echo $slider_max;?>'
                                data-slider-step='<?php echo $slider_step;?>'
                                data-slider-orientation='<?php echo $slider_orientation;?>'
                                data-slider-handle='<?php echo $slider_handle;?>'
                                data-slider-tooltip='always'
                                data-slider-reset='<?php echo $slider_reset; ?>'
                                data-slider-prefix='<?php echo $prefix; ?>'
                                data-slider-suffix='<?php echo $suffix; ?>'
                                data-separator='<?php echo $sSeparator;?>'
                            />

                            <?php if($slider_showminmax): ?>
                                <div class='pull-<?php if (getLanguageRTL(App()->language)): echo 'right'; else: echo 'left'; endif; ?> '>
                                    <?php echo $slider_min; ?>

                            <?php endif; ?>

                            <?php if($slider_showminmax): ?>
                                <div class='pull-<?php if (getLanguageRTL(App()->language)): echo 'left'; else: echo 'right'; endif; ?> '>
                                    <?php echo $slider_max; ?>

                            <?php endif; ?>

                        <?php if (!empty($sliderright) || !empty($sliderleft)): ?>
                            <?php echo $sliderright;?>
                        <?php endif; ?>

                    <?php if ($slider_reset): ?>

                            <div id="answer<?php echo $myfname; ?>_resetslider" class='pull-left btn btn-default'>
                                 <?php eT("Reset"); ?>

                    <?php endif; ?>

        <input type="hidden" name="<?php echo $myfname;?>" onchange="<?php echo $checkconditionFunction; ?>" id="answer<?php echo $myfname; ?>"  value="<?php echo ($dispVal ? $dispVal : null);?>" />

<?php if($sliders): ?>

<?php endif; ?>


text:
require('controllers/application');

require('controllers/configs');
require('controllers/configs/index');
require('controllers/configs/messages');
require('controllers/configs/messages/create');
require('controllers/configs/messages/index');
require('controllers/configs/messages/view');

require('controllers/index');

require('controllers/users');
require('controllers/users/create');
require('controllers/users/index');
require('controllers/users/view');


text:
<?php
/**
 * Created by PhpStorm.
 * User: Erasto Malema
 * Date: 10/1/2017
 * Time: 2:40 PM
 */

class Home extends CI_Controller {

    public function __construct()
    {
        parent::__construct();
    }

    function index(){
        echo "Hell World";
    }

}


text:
layout: post
title: Peron
date: 2015-12-16 12:00:00.000000000 +07:00
type: post
published: true
status: publish
categories:
- blog
tags: []
---

Kamu duduk di peron 2, menunggu kereta datang, tak sabar pulang. Seperti kebanyakan orang, kamu sesekali memainkan ponsel pintarmu, mengecek surat elektronik dan sosial media. Disesaki kebosanan, sesekali memandang kanan kiri, sampai matamu menatap matanya. Mata seorang wanita yang tidak kamu kenal, yang balas menatap matamu, di seberang peron sana. Kamu melepaskan pandangan, namun sejurus kemudian kembali menatapnya. Hal yang sama yang dilakukan wanita itu. Saling tatap ini tidak sebentar, pikirmu. Kemudian wanita itu tersenyum sedikit. Kemudian keretamu datang menghalangi pandangan. Kemudian kamu lupa wajahnya.

Itulah pertama kali kamu bertemu dengannya, dipisah dua rel kereta yang berkarat.

Tidak penting, pikirmu.  Tapi hal ini mengganggumu selama berhari-hari. Membuatmu menumpahkan kopi atau tersandung sesuatu saat berjalan. Siapakah dia?

Kamu duduk di peron 2, menunggu kereta datang, tak sabar pulang. Wanita itu di sana, di seberang peron. Kamu menatapnya, memandangi wajahnya, menunggu-nunggu sampai ia membalas tatapanmu.

Adakah aku lupa? pikirmu. Wanita itu balas menatapmu, dan tersenyum sedikit, sebentar. Kerongkonganmu tercekat. Kamu berniat membalas senyumnya saat keretamu datang, menghalangi pandangan.

Untuk pertama kalinya dalam hidupmu, kamu berharap keretamu terlambat. Untuk pertama kalinya dalam hidupmu, kamu dihinggapi rasa penasaran yang berlebihan.

Kamu berlari menyusuri trotoar, tersandung, berlari lagi. Pikirmu, jika kamu berlari lebih cepat, ada menit-menit tersisa, lebih banyak waktu untuk menatap wanita itu. Kamu tak sabar menunggu antrian, menempelkan tiket elektronikmu dengan tergesa-gesa, menyenggol petugas, dan kemudian berdiri di pinggir peron, gelisah.

Wanita itu tidak disana. Tidak juga untuk menit-menit selanjutnya sampai keretamu datang.

"Pak, tolong berdiri di belakang garis", seorang petugas menegurmu dan kamu melangkah mundur. Dia tidak muncul hari ini dan hari berikutnya.

Hari berikutnya dan hari berikutnya

Hari ini dia muncul. Berdiri, menenteng barang belanjaan. Ketika kamu saling bertatap mata dengannya, kamu mencoba tersenyum. Dia tidak membalas. Hanya membuang pandangan, menunggu keretanya.

Adakah aku lupa? pikirmu.

Untuk pertama kalinya dalam hidupmu, kamu dibuat gundah oleh orang yang kamu pikir kamu tidak mengenalnya. Kamu marah-marah sendiri.

Wanita itu kadang muncul kadang tidak. Jika muncul, ia memberikanmu kesempatan saling tatap yang tidak sebentar, kadang-kadang dengan senyuman (yang kadang-kadang juga kamu balas). Dan dalam tujuh minggu kamu mempelajari polanya. Bahkan setelah berminggu-minggu yang menjengkelkan ini, kamu masih belum mampu mengingatnya.

Ia selalu ada di peron 1, setiap hari selasa dan rabu malam, nyaris tepat saat kamu tiba di peron 2, setelah pulang dari kantormu. Hari jumat ia kadang muncul kadang tidak.

Jadi kamu menyusun rencana agar bisa pulang dari kantor lebih cepat di hari selasa dan rabu. Kadang-kadang kamu berpikir untuk membolos dan mengerahkan sehari penuh untuk menguntit wanita itu. Tapi pikirmu itu terlalu berlebihan, tidak baik. Kamu menyiapkan satu kamera dengan lensa yang baik. Kamu mengganti tasmu dengan yang lebih ramping, yang nyaman dibawa berlari. Kamu mempersiapkan semuanya. Jadwal kereta. Mengabaikan makan malam. Kabur lebih awal dari kantor.

Kamu berdiri di sana, di pinggir peron. Terengah-engah. Seharusnya dia muncul. Seharusnya dia ada di sini. Kamu mondar-mandir sambil mengawasi seberang peron. Kamu ragu, apakah sebaiknya menunggu di sini, di sisi peron yang sepi dan mengawasi peron seberang yang lebih ramai. Atau menaiki tangga, menyeberang dan menunggu di sana sambil berdesakan dengan orang banyak.

Kamu memutuskan tetep berdiri di tempatmu sekarang. Orang-orang berlalu lalang. Detik menyusul menit. Kamu sempat bimbang, "Apa yang kulakukan di sini?".

Suara kereta dari kejauhan. Wanita itu muncul di peron seberang. Kamu mengambil kamera, mengambil gambar wanita itu sekali, kemudian berlari ke arah tangga.

Kamu sedang berjuang untuk pergi ke peron sebelah. Kamu bisa merasakan lantai sedikit bergetar ketika kereta yang akan menjemput wanita itu sudah tiba. Kamu menabrak satu, dua, tiga orang. Empat. Kamu tidak ingat lagi. Kamu tidak peduli.

Ketika kamu tiba di peron satu, kamu tidak bisa langsung mengetahui dimana wanita itu berada. Di gerbong berapa? Terlalu banyak orang. Terlalu panik.

Mendadak kamu menangkap matanya. Wanita itu  berpaling dan menaiki kereta. Gerbong 4. Kamu marah sekali.

Kamu bergegas menyusulnya. Menabrak lebih banyak orang, membiarkan kakimu terjepit sebentar oleh pintu otomatis gerbong, dan bergabung dengan kubangan manusia dalam gerbong kereta. Semua berjejal. Semua sesak. Tapi hanya kamu yang panik.

Kamu melihat wanita itu bergerak ke gerbong 3. Kamu menyusulnya. Menerobos banyak orang. Memancing sumpah serapah yang tidak enak didengar. Wanita itu bergerak pelan, tapi kamu merasa kamu semakin jauh tertinggal. Kamu menyeberangi satu gerbong lagi. "Permisi. Permisi. Permisi. Maaf". Kamu panik.

Mendadak langkahmu ditahan. Kamu marah. Namun lekas redam karena yang menahan dadamu adalah petugas kereta. Kamu berusaha mengatur nafasmu.

"Khusus wanita."

Wanita itu bergerak pelan tanpa menoleh ke belakang, bergabung dengan orang-orang yang satu gender dengannya di gerbong khusus wanita. Lenyap. Hilang dari pandanganmu.

Kamu marah sekali. Kamu merasa bodoh sekali. Untuk apa semua ini? Kamu berdiri di gerbong yang penuh sekali dengan manusia, satu kereta dengan orang yang paling kamu cari dan benci, yang bergerak menjauhi rumahmu. Jauh sekali sekarang. Kamu sudah tidak hitung lagi, sudah berapa stasiun yang lewat. Kamu terlalu lama berdiri di situ. Merenungkan semua ini.

Wanita itu berutang penjelasan. Tentang tatapan mata yang tidak sebentar. Tentang senyuman yang kadang-kadang.

Ponselmu bergetar. Istrimu menanyakan kenapa kamu lama sekali pulang.

Kamu menghela nafas, menggigit bibir. Bingung.

*Bersambung.*


text:
package org.locationtech.geomesa.spark.jts.encoders

import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
import org.apache.spark.sql.{Encoder, Encoders}

import java.lang
import scala.reflect.runtime.universe._

/**
 * These encoders exist only for simplifying the construction of DataFrame/Dataset DSL
 * functions. End users should get their default encoders via the Spark recommended
 * pattern:
 * {{{
 *   val spark: SparkSession = ...
 *   import spark.implicits._
 * }}}
 *
 */
private[jts] trait SparkDefaultEncoders {
  implicit def stringEncoder: Encoder[String] = Encoders.STRING
  implicit def jFloatEncoder: Encoder[lang.Float] = Encoders.FLOAT
  implicit def doubleEncoder: Encoder[Double] = Encoders.scalaDouble
  implicit def jDoubleEncoder: Encoder[lang.Double] = Encoders.DOUBLE
  implicit def intEncoder: Encoder[Int] = Encoders.scalaInt
  implicit def jBooleanEncoder: Encoder[lang.Boolean] = Encoders.BOOLEAN
  implicit def booleanEncoder: Encoder[Boolean] = Encoders.scalaBoolean
  implicit def arrayEncoder[T: TypeTag]: Encoder[Array[T]] = ExpressionEncoder()
}
private[jts] object SparkDefaultEncoders extends SparkDefaultEncoders


text:
import sys
import optparse
import unittest

def parse_options(argv):
    parser = optparse.OptionParser()
    parser.add_option(
        '-i', '--integration', action='store_true', default=False,
        help='run only integration tests',
    )
    parser.add_option(
        '-a', '--all', action='store_true', default=False,
        help='run integration and unit tests',
    )
    options, args = parser.parse_args(argv)
    return options

if __name__ == '__main__':
    options = parse_options(sys.argv)

    loader = unittest.TestLoader()
    suite = unittest.TestSuite()

    if options.all or options.integration:
        integration = loader.discover('.', pattern='integration*.py')
        suite.addTest(integration)
    if options.all or not options.integration:
        unit = loader.discover('.', pattern='test*.py')
        suite.addTest(unit)

    runner = unittest.TextTestRunner()
    runner.run(suite)


text:
#include <aws/sagemaker/model/CreateStudioLifecycleConfigRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::SageMaker::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

CreateStudioLifecycleConfigRequest::CreateStudioLifecycleConfigRequest() :
    m_studioLifecycleConfigNameHasBeenSet(false),
    m_studioLifecycleConfigContentHasBeenSet(false),
    m_studioLifecycleConfigAppType(StudioLifecycleConfigAppType::NOT_SET),
    m_studioLifecycleConfigAppTypeHasBeenSet(false),
    m_tagsHasBeenSet(false)
{
}

Aws::String CreateStudioLifecycleConfigRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_studioLifecycleConfigNameHasBeenSet)
  {
   payload.WithString("StudioLifecycleConfigName", m_studioLifecycleConfigName);

  }

  if(m_studioLifecycleConfigContentHasBeenSet)
  {
   payload.WithString("StudioLifecycleConfigContent", m_studioLifecycleConfigContent);

  }

  if(m_studioLifecycleConfigAppTypeHasBeenSet)
  {
   payload.WithString("StudioLifecycleConfigAppType", StudioLifecycleConfigAppTypeMapper::GetNameForStudioLifecycleConfigAppType(m_studioLifecycleConfigAppType));
  }

  if(m_tagsHasBeenSet)
  {
   Array<JsonValue> tagsJsonList(m_tags.size());
   for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
   {
     tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
   }
   payload.WithArray("Tags", std::move(tagsJsonList));

  }

  return payload.View().WriteReadable();
}

Aws::Http::HeaderValueCollection CreateStudioLifecycleConfigRequest::GetRequestSpecificHeaders() const
{
  Aws::Http::HeaderValueCollection headers;
  headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "SageMaker.CreateStudioLifecycleConfig"));
  return headers;

}


text:
package Google::Ads::GoogleAds::V10::Services::CampaignExperimentService;

use strict;
use warnings;
use base qw(Google::Ads::GoogleAds::BaseService);

sub create {
  my $self          = shift;
  my $request_body  = shift;
  my $http_method   = 'POST';
  my $request_path  = 'v10/customers/{+customerId}/campaignExperiments:create';
  my $response_type = 'Google::Ads::GoogleAds::LongRunning::Operation';

  return $self->SUPER::call($http_method, $request_path, $request_body,
    $response_type);
}

sub end {
  my $self          = shift;
  my $request_body  = shift;
  my $http_method   = 'POST';
  my $request_path  = 'v10/{+campaignExperiment}:end';
  my $response_type = '';

  return $self->SUPER::call($http_method, $request_path, $request_body,
    $response_type);
}

sub graduate {
  my $self         = shift;
  my $request_body = shift;
  my $http_method  = 'POST';
  my $request_path = 'v10/{+campaignExperiment}:graduate';
  my $response_type =
'Google::Ads::GoogleAds::V10::Services::CampaignExperimentService::GraduateCampaignExperimentResponse';

  return $self->SUPER::call($http_method, $request_path, $request_body,
    $response_type);
}

sub list_async_errors {
  my $self         = shift;
  my $request_body = shift;
  my $http_method  = 'GET';
  my $request_path = 'v10/{+resourceName}:listAsyncErrors';
  my $response_type =
'Google::Ads::GoogleAds::V10::Services::CampaignExperimentService::ListCampaignExperimentAsyncErrorsResponse';

  return $self->SUPER::call($http_method, $request_path, $request_body,
    $response_type);
}

sub mutate {
  my $self         = shift;
  my $request_body = shift;
  my $http_method  = 'POST';
  my $request_path = 'v10/customers/{+customerId}/campaignExperiments:mutate';
  my $response_type =
'Google::Ads::GoogleAds::V10::Services::CampaignExperimentService::MutateCampaignExperimentsResponse';

  return $self->SUPER::call($http_method, $request_path, $request_body,
    $response_type);
}

sub promote {
  my $self          = shift;
  my $request_body  = shift;
  my $http_method   = 'POST';
  my $request_path  = 'v10/{+campaignExperiment}:promote';
  my $response_type = 'Google::Ads::GoogleAds::LongRunning::Operation';

  return $self->SUPER::call($http_method, $request_path, $request_body,
    $response_type);
}

1;


text:
<?php defined('BX_DOL') or die('hack attempt');

class BxMarketCmtsSearchResult extends BxBaseModGeneralCmtsSearchResult
{
    function __construct($sMode = '', $aParams = array())
    {
    	$this->sModule = 'bx_market';

        parent::__construct($sMode, $aParams);

        $this->aCurrent['title'] = _t('_bx_market_page_block_title_browse_cmts');
    }
}

/** @} */


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Proc. Phil. Soc. Glasgow 13: 191 (1881)

#### Original name
Verrucaria anoista Stirt.

### Remarks
null


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Testing Maper</title>

    <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css">


text:
package com.amazonaws.services.ecs.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.ecs.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * RunTaskRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class RunTaskRequestMarshaller {

    private static final MarshallingInfo<String> CLUSTER_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("cluster").build();
    private static final MarshallingInfo<String> TASKDEFINITION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("taskDefinition").build();
    private static final MarshallingInfo<StructuredPojo> OVERRIDES_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("overrides").build();
    private static final MarshallingInfo<Integer> COUNT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("count").build();
    private static final MarshallingInfo<String> STARTEDBY_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("startedBy").build();
    private static final MarshallingInfo<String> GROUP_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("group").build();
    private static final MarshallingInfo<List> PLACEMENTCONSTRAINTS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("placementConstraints").build();
    private static final MarshallingInfo<List> PLACEMENTSTRATEGY_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("placementStrategy").build();

    private static final RunTaskRequestMarshaller instance = new RunTaskRequestMarshaller();

    public static RunTaskRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(RunTaskRequest runTaskRequest, ProtocolMarshaller protocolMarshaller) {

        if (runTaskRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(runTaskRequest.getCluster(), CLUSTER_BINDING);
            protocolMarshaller.marshall(runTaskRequest.getTaskDefinition(), TASKDEFINITION_BINDING);
            protocolMarshaller.marshall(runTaskRequest.getOverrides(), OVERRIDES_BINDING);
            protocolMarshaller.marshall(runTaskRequest.getCount(), COUNT_BINDING);
            protocolMarshaller.marshall(runTaskRequest.getStartedBy(), STARTEDBY_BINDING);
            protocolMarshaller.marshall(runTaskRequest.getGroup(), GROUP_BINDING);
            protocolMarshaller.marshall(runTaskRequest.getPlacementConstraints(), PLACEMENTCONSTRAINTS_BINDING);
            protocolMarshaller.marshall(runTaskRequest.getPlacementStrategy(), PLACEMENTSTRATEGY_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
{-# LANGUAGE DeriveDataTypeable #-}

module Compiler.Lp where

import Data.Data
import Compiler.Util

prims = ["takeWhileNot","endBy"]
libs = ["spaces","name"]

type RuleName = String
type RuleArg = String

type Program = [Rule]

data Rule = Rule {ruleName :: RuleName, ruleArgs :: [RuleArg], ruleBody :: Choice}
            deriving (Eq,Ord,Typeable,Data)

data Choice = Choice [(Bind Pat,Seq)]
            | NoChoice Seq
              deriving (Eq,Ord,Typeable,Data)

type Action = String

data Seq = Seq [Bind Exp] Action
           deriving (Eq,Ord,Typeable,Data)

data Exp = Prim {expName :: String  , expArgs :: [Exp]}
         | Call {expName :: RuleName, expArgs :: [Exp]}
         | Lit  String
         | Var  RuleArg
           deriving (Eq,Ord,Typeable,Data)

data Pat = PVar RuleArg
         | PLit {fromPLit :: String}
         | PPrim String
         | PWildcard
           deriving (Eq,Ord,Typeable,Data)

data Bind a = Bind {bindVar :: Maybe String, bindBody :: a}
              deriving (Eq,Ord,Typeable,Data)

asLit (Lit x) = Just x
asLit _ = Nothing

isCall Call{} = True; isCall _ = False

getRule xs name = fromJust $ find ((==) name . ruleName) xs

-- $ = variable
-- @ = rule
-- ! = primitive

instance Show Rule where
    show (Rule name args x) = unwords $ name : map ('$':) args ++["=",show x]
    showList = showString . unlines . map show

instance Show Choice where
    show (NoChoice x) = show x
    show (Choice xs) = concat ["\n  " ++ show a ++ " = " ++ show b | (a,b) <- xs]

instance Show Seq where
    show (Seq xs y) = unwords $ map show xs ++ ["{" ++ y ++ "}"]

instance Show Exp where
    show (Prim x ys) = show $ Call ('#':x) ys
    show (Call x []) = x
    show (Call x ys) = "(" ++ unwords (x : map show ys) ++ ")"
    show (Lit x) = show x
    show (Var x) = '$':x

instance Show Pat where
    show (PVar x) = '$':x
    show (PPrim x) = '#':x
    show (PLit x) = show x
    show PWildcard = "_"

instance Show a => Show (Bind a) where
    show (Bind (Just a) b) = a ++ "@" ++ show b
    show (Bind _ b) = show b


text:
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { NgbModal, NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';

// Import any modal content components
import { SampleModalComponent, LogoutModalComponent } from 'app-components';

@Component({
  selector: 'button-modal',
  template: `<button class="{{classes}}" (click)="openModal()">
                <ng-content></ng-content>
            </button>`
})
export class ButtonModalComponent implements OnInit {

    @Input() modal: string; // The name of the component modal
    @Input() data: any; // Any model data that needs to be passed to the modal component
    @Input() classes: string = 'btn btn-outline-primary btn-sm'; // CSS classes to apply to the button
    @Input() size: any = 'md'; // Default size of the modal, can be sm/md/lg
    @Output() onSuccess: EventEmitter<any> = new EventEmitter(); // A method to emit events to pass up to parent

    // List all modals with reference here, used for string lookup
    public modalsList = {
        SampleModalComponent: SampleModalComponent,
        LogoutModalComponent: LogoutModalComponent
    }

    constructor(
        private modalService: NgbModal
    ) {
    }

    ngOnInit() {
    }

    /**
    * Open a modal window
    * Attach a success function and pass any relevant data to the modal component
    */
    public openModal() {
        let modalToOpen = this.modalsList[this.modal];

        let options = { size: this.size };

        // Store reference to the modal instance
        let modalRef = this.modalService.open(modalToOpen, options);

        if (this.data){
        // Add any passed in data to the modal instance
            modalRef.componentInstance.data = this.data;
        }

        // Wait for promise that is returned when modal is closed or dismissed
        modalRef.result.then((closeReason) => {
            // On modal close (which is the success indicator), emit OnSuccess method
            this.onSuccess.emit(closeReason);
        }, (dismissReason) => {
            // On modal dismiss, which is closed without performing an action
        });
    }//end openModal

}


text:
package com.autumncode.suexec.servlet;

import freemarker.ext.servlet.FreemarkerServlet;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(urlPatterns = {"*.ftl","*.ftlh","*.ftlx"},
        loadOnStartup = 1,
        initParams = {
        @WebInitParam(name="TemplatePath", value="/"),
        @WebInitParam(name="NoCache", value="true"),
        @WebInitParam(name="ResponseCharacterEncoding", value="fromTemplate"),
        @WebInitParam(name="ExceptionOnMissingTemplate", value="true"),
        @WebInitParam(name="incompatible_improvements", value="2.3.25"),
        @WebInitParam(name="template_exception_handler", value="html_debug"),
        @WebInitParam(name="default_encoding", value="UTF-8"),
        @WebInitParam(name="output_encoding", value="UTF-8"),
        @WebInitParam(name="locale", value="en_US"),
        @WebInitParam(name="number_format", value="0.########"),
})
public class MyFreemarkerServlet extends FreemarkerServlet {
}


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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: Namespace Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

tesseract
    4.0.0-beta.1-59-g2cc4

- a -

ACTION_1_CMD_EVENT
: tesseract

ACTION_2_CMD_EVENT
: tesseract

AMBIG_TYPE_COUNT
: tesseract

Generated on Wed Mar 28 2018 20:00:48 for tesseract by

     1.8.13


text:
import logging

import mitogen.core
import mitogen.parent

LOG = logging.getLogger(__name__)

class Stream(mitogen.parent.Stream):
    child_is_immediate_subprocess = True

    pod = None
    kubectl_path = 'kubectl'
    kubectl_args = None

    # TODO: better way of capturing errors such as "No such container."
    create_child_args = {
        'merge_stdio': True
    }

    def construct(self, pod, kubectl_path=None, kubectl_args=None, **kwargs):
        super(Stream, self).construct(**kwargs)
        assert pod
        self.pod = pod
        if kubectl_path:
            self.kubectl_path = kubectl_path
        self.kubectl_args = kubectl_args or []

    def connect(self):
        super(Stream, self).connect()
        self.name = u'kubectl.%s%s' % (self.pod, self.kubectl_args)

    def get_boot_command(self):
        bits = [self.kubectl_path] + self.kubectl_args + ['exec', '-it', self.pod]
        return bits + ["--"] + super(Stream, self).get_boot_command()


text:
<?xml version="1.0" encoding="UTF-8"?>
<LearningStandards>
  <LearningStandardItem xml:lang="en" RefID="">
    <RefURI>http://corestandards.org/ELA-Literacy/RL/K/8/</RefURI>
    <StandardHierarchyLevel>
      <number>6</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode></StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>(RL.K.8 not applicable to literature)</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>K</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>0FAC40650F514a459951A657F942B845</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">EFDB02303EB14626A397674146BA2EA8</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
</LearningStandards>


text:
<?php

namespace gamerwalt\LaraMultiDbTenant;

use App;
use Illuminate\Support\ServiceProvider;
use Illuminate\Contracts\Http\Kernel;
use gamerwalt\LaraMultiDbTenant\Commands\BaseModelsCommand;
use gamerwalt\LaraMultiDbTenant\Commands\MultiDbFoldersCommand;
use gamerwalt\LaraMultiDbTenant\Commands\ResyncMigrationCommand;

class LaraMultiDbTenantServiceProvider extends ServiceProvider
{

    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->mergeConfig();
        $this->setup();
        $this->registerCommands();
        $this->registerSingletons();
    }

    /**
     * Bootstrap the application events
     *
     * @param \Illuminate\Contracts\Http\Kernel $kernel
     *
     * @return void
     */
    public function boot(Kernel $kernel)
    {
        $app = $this->app;

        $configPath = __DIR__ . '/../config/laramultidbtenant.php';
        $this->publishes([$configPath => $this->getConfigPath()], 'config');

        $migrationsPath = __DIR__ . '/../migrations/';
        $this->publishes([$migrationsPath => $this->getMigrationsPath()], 'migrations');

        $prefix = $this->app['config']->get('laramultidbtenant.prefix');
        $tenantModel = $this->app['config']->get('laramultidbtenant.tenantmodel');

        $this->registerRoutes();
        $this->registerResources();

        if($app->runningInConsole()) {
            return;
        }

        $this->app['router']->middleware('authTenant', 'gamerwalt\LaraMultiDbTenant\AuthTenant');

        $laraMultidbTenant = $this->app['laramultitenantdb'];
        $laraMultidbTenant->boot($tenantModel, $prefix);
    }

    /**
     * Register the Horizon routes.
     *
     * @return void
     */
    protected function registerRoutes()
    {
        $this->getRouter()->group([
            'namespace' => 'gamerwalt\LaraMultiDbTenant\Http\Controllers',
        ], function () {
            $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
        });
    }

    /**
     * Register the Horizon resources.
     *
     * @return void
     */
    protected function registerResources()
    {
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'tenants');
    }

    /**
     * Setup
     *
     *
     * @return void
     */
    protected function setup()
    {
        $this->app->singleton('LaraMultiDbTenant', function($app) {
            $laraMultiDbTenant = new LaraMultiDbTenant($app['config'],$app);

            return $laraMultiDbTenant;
        });

        $this->app->alias('laramultitenantdb', 'gamerwalt\LaraMultiDbTenant\LaraMultiDbTenant');
    }

    /**
     * Register Singletons
     *
     *
     * @return void
     */
    protected function registerSingletons()
    {
        App::singleton('laramultitenantdb', function($app){
            return new LaraMultiDbTenant($app['config'],$app);
        });

        App::singleton('tenantdatabaseprovisioner', function(){
            return new MysqlDatabaseProvisioner($this->app->make('Illuminate\Contracts\Console\Kernel'));
        });

        App::singleton('authTenant', function(){
            return new AuthTenant();
        });
    }

    /**
     * Register commands needed
     *
     *
     * @return void
     */
    protected function registerCommands()
    {
        $this->app->singleton('command.tenant.migrations', function($app) {
            return new MultiDbFoldersCommand($app['laramultitenantdb']);
        });

        $this->app->singleton('command.tenant.basemodels', function($app) {
            return new BaseModelsCommand($app['laramultitenantdb'], $this->app->make('Illuminate\Contracts\Console\Kernel'));
        });

        $this->app->singleton('command.tenant.migrate-resync', function($app) {
            return new ResyncMigrationCommand($app['laramultitenantdb'], $this->app->make('Illuminate\Contracts\Console\Kernel'), $this->app->make('gamerwalt\LaraMultiDbTenant\Migrator'));
        });

        $this->commands(array('command.tenant.migrations'));
        $this->commands(array('command.tenant.basemodels'));
        $this->commands(array('command.tenant.migrate-resync'));
    }

    /**
     * Merge configuration
     *
     *
     * @return void
     */
    protected function mergeConfig()
    {
        $configPath = __DIR__ . '/../config/laramultidbtenant.php';
        $this->mergeConfigFrom($configPath, 'laramultidbtenant');
    }

    /**
     * Get the active router.
     *
     * @return Router
     */
    protected function getRouter()
    {
        return $this->app['router'];
    }

    /**
     * Returns the config path for
     */
    private function getConfigPath()
    {
        return config_path('laramultidbtenant.php');
    }

    /**
     * Returns the migrations path for
     */
    private function getMigrationsPath()
    {
        return database_path('migrations');
    }
}


text:
package edu.cmu.hcii.citrus;

import java.util.Iterator;
import java.util.LinkedList;

import edu.cmu.hcii.citrus.views.Transition;

public abstract class Group<CollectionType extends Element,ItemType extends Element> extends BootElement<CollectionType> implements Iterable<ItemType> {

	protected static final BootDec<?> itemDeclaration = new BootDec(null);
	static {
		itemDeclaration.name = new Text("item");
		itemDeclaration.type = new BootTypeExpression(Boot.ELEMENT);
	}

	// A wrapper for a set iterator.
	private class GroupIterator implements Iterator<ItemType> {

		private Property<ItemType> last = null;
		private Iterator<Property<ItemType>> iterator = propertyIterator();
		public boolean hasNext() { return iterator.hasNext(); }
		public ItemType next() {
			last = iterator.next();
			return last.peek();
		}
		public void remove() {
			// Make sure we release the property as owner
			iterator.remove();
			last.set(null);
		}

	}

	public Iterator<ItemType> iterator() { return new GroupIterator(); }
	public abstract Iterator<Property<ItemType>> propertyIterator();

	protected final Property<ItemType> generateProperty(ItemType item) {

		Property<ItemType> newProperty = new Property<ItemType>(this, (DecInterface<ItemType>)itemDeclaration);
		newProperty.initialize(item, false, null);
		return newProperty;

	}

	public Namespace<?> getType() { return Boot.GROUP; }

	public abstract Bool isEmpty();
	public final Bool remove(ItemType item) { return removeOverTime(item, null); }
	public abstract Bool removeOverTime(ItemType item, Transition t);

	public Bool contains(ItemType item) {

		for(ItemType i : this)
			if(i.isEquivalentTo(item).value) return new Bool(true);
		return new Bool(false);

	}

	public Bool containsItemThat(Function f) {

		for(ItemType i : this) {
			Bool b = (Bool)Evaluate.eval(this, this, f, new List<Arg>(new Arg("", false, i)));
			if(b.value) return b;
		}
		return new Bool(false);

	}

	public Bool containsA(Type t) {

		for(ItemType i : this)
			if(i.isa(t).value) return Bool.TRUE;
		return Bool.FALSE;

	}

	public Nothing foreach(Function f) {

		for(ItemType i : this)
			Evaluate.eval(this, this, f, new List<Arg>(new Arg("", false, i)));
		return null;

	}

	public Nothing foreachProperty(Function f) {

		Iterator<Property<ItemType>> it = propertyIterator();
		while(it.hasNext())
			Evaluate.eval(this, this, f, new List<Arg>(new Arg("", false, it.next())));
		return null;

	}

	public ItemType itemThat(Function f) {

		for(ItemType i : this) {
			Bool b = (Bool)Evaluate.eval(this, this, f, new List<Arg>(new Arg("", false, i)));
			if(b.value) return i;
		}
		return null;

	}

	// Takes a two argument function, which is given the current top choice and a new candidate. It should
	// return true if the new candidate should be chosen over the current candidate.
	// fun [ refs Element topChoice refs Element candidate ]
	public ItemType choose(Function f) {

		ItemType choice = null;
		for(ItemType i : this) {
			Bool b = (Bool)Evaluate.eval(this, this, f, new List<Arg>(new Arg("", false, choice), new Arg("", false, i)));
			if(b.value) choice = i;
		}
		return choice;

	}

	public Bool removeItemsThat(Function f) {

		boolean removed = false;
		LinkedList<ItemType> itemsToRemove = new LinkedList<ItemType>();
		for(ItemType i : this) {
			Bool b = (Bool)Evaluate.eval(this, this, f, new List<Arg>(new Arg("", false, i)));
			if(b.value) itemsToRemove.add(i);
		}
		for(ItemType i : itemsToRemove)
			remove(i);

		return new Bool(itemsToRemove.size() > 0);

	}

	public Nothing foreachUntilFalse(Function f) {

		for(ItemType i : this) {
			if(!((Bool)Evaluate.eval(this, this, f, new List<Arg>(new Arg("", false, i)))).value)
				return null;
		}
		return null;

	}

}


text: <script src="//connect.facebook.net/{{ facebook_jssdk_locale }}/all.js"></script>


text:
package dao;

import db.PersistenceUtil;
import static db.PersistenceUtil.closeEntityManager;
import java.util.List;
import javax.persistence.EntityManager;
import model.TbProgram;
import org.apache.log4j.Logger;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author tassio
 */
public class TbProgramDAO {

    Logger logger = Logger.getLogger("DAO");
    public static TbProgramDAO programDAO;

    public static TbProgramDAO getInstance() {
        if (programDAO == null) {
            programDAO = new TbProgramDAO();
        }
        return programDAO;
    }

    public TbProgram save(TbProgram value) {
        logger.trace("Start Method");

        EntityManager em = PersistenceUtil.getEntityManager();
        em.getTransaction().begin();
        try {
            value = em.merge(value);
            em.getTransaction().commit();
        } catch (RuntimeException e) {
            em.getTransaction().rollback();
            logger.error("Unexpected error", e);
        } finally {
            logger.trace("Ended Method");
        }

        return value;
    }

    public List<TbProgram> getAll() {
        logger.trace("Start Method");
        try {
            EntityManager em = PersistenceUtil.getEntityManager();
            javax.persistence.Query query = em.createQuery("from TbProgram As a");
            return query.getResultList();
        } catch (Exception ex) {
            logger.error("Unexpected error", ex);
        } finally {
            logger.trace("Ended Method");
            closeEntityManager();
        }
        return null;
    }

    private static Session session;

    public TbProgram get(int value) {
        logger.trace("Start Method");
        try {
            session = PersistenceUtil.getSession();
            Query query = session.createQuery("select a from TbProgram as a where  a.intCodProgram=:value");
            query.setParameter("value", value);
            query.setCacheable(true);

            List<TbProgram> instances = query.list();
            if (instances != null && instances.size() > 0) {
                return instances.get(0);
            }
            return null;
        } catch (Exception ex) {
            logger.error("Unexpected error", ex);
        } finally {
            logger.trace("Ended Method");
        }
        return null;
    }

    public void delete(TbProgram value) {
        logger.trace("Start Method");
        EntityManager em = PersistenceUtil.getEntityManager();
        em.getTransaction().begin();
        try {
            value = em.merge(value);
            em.remove(value);
            em.getTransaction().commit();
        } catch (RuntimeException e) {
            em.getTransaction().rollback();
            logger.error("Unexpected error", e);
        } finally {
            logger.trace("Ended Method");
            closeEntityManager();
        }
    }

    public void deleteAll() {
        logger.trace("Start Method");
        EntityManager em = PersistenceUtil.getEntityManager();
        em.getTransaction().begin();
        try {
            javax.persistence.Query query = em.createQuery(" delete from TbProgram");
            query.executeUpdate();
            em.getTransaction().commit();
        } catch (Exception e) {
            logger.error("Unexpected error", e);
            em.getTransaction().rollback();
        } finally {
            logger.trace("Ended Method");
            closeEntityManager();
        }
    }
}


text:
<!DOCTYPE html>

  <link href="http://gmpg.org/xfn/11" rel="profile">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">

  <title>

      About · Rohit Varkey Thankachan's blog!

  </title>

  <link rel="stylesheet" href="/public/css/poole.css">
  <link rel="stylesheet" href="/public/css/syntax.css">
  <link rel="stylesheet" href="/public/css/hyde.css">
  <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">

  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/public/apple-touch-icon-144-precomposed.png">

  <link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">

          Rohit Varkey Thankachan's blog!

I read about code. Write a little of it too! This blog lists my experiences while playing with code.

      Home

            About

            Archive

© 2016. All rights reserved.

About

Hey there! This is Rohit Varkey Thankachan's blog, a Computer Science undergrad at National Institute of Technology Karnataka, Surathkal. I am passionate about the open source world, a Pythonista, and I have worked on some web development projects!

I am also a Kerala Blasters and Manchester United fan!

You can find my projects on my Github repository.

You can find me on :

Facebook

Twitter

This blog is built using Jekyll using the brilliant Hyde theme and hosted on Github Pages!


text:
**Bootie Docs** is a simple [hugo](http://gohugo.io/) theme for documentation.
The name "bootie" comes from [Bootstrap](http://getbootstrap.com/) CSS.

![Bootie Docs screenshot](https://raw.githubusercontent.com/progrhyme/hugo-theme-bootie-docs/master/images/tn.png)

You can see demo and full documentation at http://progrhyme.github.io/bootie-docs-demo/ .

## CONTENTS

* [QUICKSTART](#quickstart)
* [MENUS](#menus)
* [OPTIONS](#options)
* [LIMITATION](#limitation)
* [DEPENDENCIES](#dependencies)
* [LICENSE](#license)

## QUICKSTART

1. `hugo new _index.md`
1. Edit `content/_index.md`

Then the content appears on top page.

## MENUS

You can customize the menu items in the header navigation bar by configuring `menu.main` in your
_config.toml_ (or _config.yaml_) supported by Hugo's [Menu System](https://gohugo.io/extras/menus/).

```
# example of config.toml
[params]
  highlightStyle = "github"

[[menu.main]]
  name   = "Usage"
  url    = "/usage/"
  weight = 10

[[menu.main]]
  name   = "News"
  url    = "/categories/news/"
  weight = 20
```

NOTE:

- Nested menus are not supported.

## OPTIONS

All other options and usages for _Bootie Docs_ are described at the documentation site --
http://progrhyme.github.io/bootie-docs-demo/ .

## LIMITATION

Because _Bootie Docs_ is developed for documentation, it lacks many blog-type facilities such as RSS
feeds, pagination of posts and so on.

## DEPENDENCIES

**Bootie Docs** includes following libraries:

* [Bootstrap](http://getbootstrap.com/) v3.3.7 ... Well-known CSS framework.
* [jQuery](https://jquery.com/) v3.2.1 ... Requried by _Bootstrap_.
* [highlight.js](https://highlightjs.org/) v9.12.0 ... For syntax highlighting.

## LICENSE

Copyright (C) 2015-2017 IKEDA Kiyoshi.
Released under the MIT License.


text:
#ifndef TI_FILESYSTEM_MODULE_H_
#define TI_FILESYSTEM_MODULE_H_

#include <kroll/kroll.h>

#if defined(OS_OSX) || defined(OS_LINUX)
#define EXPORT __attribute__((visibility("default")))
#define TITANIUM_FILESYSTEM_API EXPORT
#elif defined(OS_WIN32)
# ifdef TITANIUM_FILESYSTEM_API_EXPORT
#  define TITANIUM_FILESYSTEM_API __declspec(dllexport)
# else
#  define TITANIUM_FILESYSTEM_API __declspec(dllimport)
# endif
# define EXPORT __declspec(dllexport)
#endif

namespace ti
{
	class TITANIUM_FILESYSTEM_API FilesystemModule : public kroll::Module
	{
		KROLL_MODULE_CLASS(FilesystemModule)

		private:
			SharedKObject binding;
	};

}
#endif


text:
package org.smajko.watapp;

import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.widget.ListView;
import android.util.Log;
import android.util.Base64;
import android.widget.Toast;

import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cz.msebera.android.httpclient.Header;

public class ListResults extends Activity {
    private String outputFilePath;
    ProgressDialog pdLoading;
    JSONObject serverResp;
    ArrayList<String> conditions = new ArrayList<String>();
    Map<String, String> dictionary = new HashMap<String, String>();
    Map<String, String> dictionary2 = new HashMap<String, String>();
    String current[] = new String[10];
    List<Result> resultList = new ArrayList<>();

    boolean request = false;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_results);

        //hard-coded condition descriptions
        dictionary.put("Acne", "Acne, or acne vulgaris, is a skin problem that starts when oil and dead skin cells clog up your pores.");
        dictionary.put("Hives", "Urticaria, also known as hives, is an outbreak of swollen, pale red bumps or plaques (wheals) on the skin that appear suddenly -- either as a result of the body's reaction to certain allergens, or for unknown reasons.");
        dictionary.put("Shingles", "Shingles is a painful skin rash. It is caused by the varicella zoster virus. Shingles usually appears in a band, a strip, or a small area on one side of the face or body.");
        dictionary.put("Chicken pox", "Chickenpox (varicella) is a contagious illness that causes an itchy rash and red spots or blisters (pox) all over the body. ");
        dictionary.put("Melanoma", "Melanoma, the most serious type of skin cancer, develops in the cells (melanocytes) that produce melanin — the pigment that gives your skin its color. Melanoma can also form in your eyes and, rarely, in internal organs, such as your intestines.");
        dictionary.put("Ingrown Hair", "Ingrown hairs are hairs that have curled around and grown back into your skin instead of rising up from it. Sometimes, dead skin can clog up a hair follicle. That forces the hair inside it to grow sideways under the skin, rather than upward and outward.");
        dictionary.put("Warts", "A wart is a skin growth caused by some types of the virus called the human papillomavirus (HPV). HPV infects the top layer of skin, usually entering the body in an area of broken skin. The virus causes the top layer of skin to grow rapidly, forming a wart.");
        dictionary.put("Poison Ivy Rash", "Poison ivy is a plant that can cause a red, itchy rash called allergic contact dermatitis. It is the most common skin problem caused by contact with plants.");
        dictionary.put("Scabies", "Scabies is not an infection, but an infestation. Tiny mites called Sarcoptes scabiei set up shop in the outer layers of human skin. The skin does not take kindly to the invasion. As the mites burrow and lay eggs inside the skin, the infestation leads to relentless itching and an angry rash.");

        //translated condition names to get from post
        dictionary2.put("Acne", "acne");
        dictionary2.put("Hives", "hives");
        dictionary2.put("Shingles", "herpes");
        dictionary2.put("Chicken pox", "varicella");
        dictionary2.put("Melanoma", "melanoma");
        dictionary2.put("Ingrown Hair", "ingrown_hair");
        dictionary2.put("Warts", "warts");
        dictionary2.put("Poison Ivy Rash", "poison_ivy");
        dictionary2.put("Scabies", "scabies");

        //get list of possible conditions
        conditions = (ArrayList<String>) getIntent().getStringArrayListExtra("conditions");
        request = getIntent().getBooleanExtra("took_picture", false);

        for (int i = 0; i < 10; i++)
            current[i] = "";

        //if picture was taken, do image processing
        if (request) {
            pdLoading = new ProgressDialog(ListResults.this);
            pdLoading.setMessage("\tProcessing image...");
            pdLoading.show();

            //create base64 encoded string from png
            RequestParams params = new RequestParams();
            outputFilePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/myimage.png";
            File myFile = new File(outputFilePath);
            Bitmap bitmapOrg = BitmapFactory.decodeFile(myFile.getAbsolutePath());
            ByteArrayOutputStream bao = new ByteArrayOutputStream();
            bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 100, bao);
            byte[] ba = bao.toByteArray();
            String ba1 = Base64.encodeToString(ba, Base64.DEFAULT);
            Log.d("ListResults", "size: " + ba1.getBytes().length);

            //send request as json string
            params.put("picture", ba1);
            params.setUseJsonStreamer(true);

            HttpUtils.post("calculate", params, new JsonHttpResponseHandler() {
                @Override
                public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
                    // get percentages from JSONObject response
                    try {
                        serverResp = new JSONObject(response.toString());
                        for (int i = 0; i < conditions.size(); i++) {
                            String fullpercent = "Photo analysis: ";
                            try {
                                current[i] = response.getString(dictionary2.get(conditions.get(i)));
                            } catch (JSONException e) {
                                fullpercent += "n/a";
                            }
                            float result = Float.parseFloat(current[i]);
                            result *= 100;
                            String resultString = String.format("%.2f", result);
                            Log.d("ListResults", resultString);
                            fullpercent += resultString;
                            fullpercent += "%";
                            Result example = new Result(conditions.get(i), dictionary.get(conditions.get(i)), fullpercent);
                            resultList.add(example);
                        }
                        ListView listView = (ListView) findViewById(android.R.id.list);
                        ResultAdapter resultAdapter = new ResultAdapter(getApplicationContext(), R.layout.result_view, resultList);
                        listView.setAdapter(resultAdapter);
                        if (pdLoading.isShowing()) {
                            pdLoading.dismiss();
                        }

                    } catch (JSONException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }

                @Override
                public void onSuccess(int statusCode, Header[] headers, JSONArray timeline) {
                    String respArray = timeline.toString();
                    Log.d("ListResults", "onSuccess Array: " + respArray.toString());
                }

                @Override
                public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
                    Log.d("ListResults", "onFailure response String: " + responseString);
                    for (int i = 0; i < conditions.size(); i++) {
                        String fullpercent = "Photo analysis: n/a";

                        Result example = new Result(conditions.get(i), dictionary.get(conditions.get(i)), fullpercent);
                        resultList.add(example);
                    }
                    ListView listView = (ListView) findViewById(android.R.id.list);
                    ResultAdapter resultAdapter = new ResultAdapter(getApplicationContext(), R.layout.result_view, resultList);
                    listView.setAdapter(resultAdapter);
                    if (pdLoading.isShowing()) {
                        pdLoading.dismiss();
                    }
                    Toast.makeText(ListResults.this, "Network error",
                            Toast.LENGTH_LONG).show();
                }

                @Override
                public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject response) {
                    for (int i = 0; i < conditions.size(); i++) {
                        String fullpercent = "Photo analysis: n/a";

                        Result example = new Result(conditions.get(i), dictionary.get(conditions.get(i)), fullpercent);
                        resultList.add(example);
                    }
                    ListView listView = (ListView) findViewById(android.R.id.list);
                    ResultAdapter resultAdapter = new ResultAdapter(getApplicationContext(), R.layout.result_view, resultList);
                    listView.setAdapter(resultAdapter);
                    if (pdLoading.isShowing()) {
                        pdLoading.dismiss();
                    }
                    Toast.makeText(ListResults.this, "Network error",
                            Toast.LENGTH_LONG).show();
                }
            });
        //if not creating a request to process image
        } else {
            for (int i = 0; i < conditions.size(); i++) {
                Result example = new Result(conditions.get(i), dictionary.get(conditions.get(i)), "");
                resultList.add(example);
            }
            ListView listView = (ListView) findViewById(android.R.id.list);
            ResultAdapter resultAdapter = new ResultAdapter(getApplicationContext(), R.layout.result_view, resultList);
            listView.setAdapter(resultAdapter);
        }
    }
}


text:
package org.apache.jackrabbit.oak.spi.security.authorization.principalbased.impl;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import org.apache.jackrabbit.JcrConstants;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
import org.apache.jackrabbit.api.security.authorization.PrincipalAccessControlList;
import org.apache.jackrabbit.api.security.principal.PrincipalManager;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl;
import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants;
import org.apache.jackrabbit.util.Text;
import org.junit.Before;
import org.junit.Test;

import javax.jcr.PropertyType;
import javax.jcr.Value;
import javax.jcr.security.AccessControlPolicy;
import java.security.Principal;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AccessControlConstants.REP_GLOB;
import static org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AccessControlConstants.REP_NT_NAMES;
import static org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants.JCR_LIFECYCLE_MANAGEMENT;
import static org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants.JCR_NAMESPACE_MANAGEMENT;
import static org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants.JCR_READ;
import static org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants.REP_WRITE;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class EffectivePolicyTest extends AbstractPrincipalBasedTest {

    private PrincipalBasedAccessControlManager acMgr;
    private Principal validPrincipal;
    private Principal validPrincipal2;
    private String jcrEffectivePath;

    @Before
    public void testBefore() throws Exception {
        super.before();

        setupContentTrees(TEST_OAK_PATH);
        jcrEffectivePath = PathUtils.getAncestorPath(getNamePathMapper().getJcrPath(TEST_OAK_PATH), 3);

        validPrincipal2 = getUserManager(root).createSystemUser("anotherValidPrincipal", INTERMEDIATE_PATH).getPrincipal();
        root.commit();

        acMgr = createAccessControlManager(root);
        validPrincipal = getTestSystemUser().getPrincipal();

        // create 2 entries for 'validPrincipal'
        // - jcrEffectivePath : read, write
        // - null : namespaceMgt
        PrincipalPolicyImpl policy = setupPrincipalBasedAccessControl(validPrincipal, jcrEffectivePath, JCR_READ, REP_WRITE);
        addPrincipalBasedEntry(policy, null, JCR_NAMESPACE_MANAGEMENT);

        // create 2 entries for 'validPrincipal2'
        // - jcrEffectivePath : read
        // - root : lifecycleMgt
        policy = (PrincipalPolicyImpl) acMgr.getApplicablePolicies(validPrincipal2)[0];
        Map<String, Value> restrictions = ImmutableMap.of(getNamePathMapper().getJcrName(REP_GLOB), getValueFactory(root).createValue("/*/glob"));
        policy.addEntry(jcrEffectivePath, privilegesFromNames(JCR_READ), restrictions, ImmutableMap.of());

        String ntJcrName = getNamePathMapper().getJcrName(JcrConstants.NT_RESOURCE);
        Map<String, Value[]> mvRestrictions = ImmutableMap.of(getNamePathMapper().getJcrName(REP_NT_NAMES), new Value[] {getValueFactory(root).createValue(ntJcrName, PropertyType.NAME)});
        policy.addEntry(PathUtils.ROOT_PATH, privilegesFromNames(PrivilegeConstants.JCR_LIFECYCLE_MANAGEMENT), ImmutableMap.of(), mvRestrictions);

        acMgr.setPolicy(policy.getPath(), policy);

        root.commit();
    }

    @Test
    public void testEffectivePolicyByPrincipal() throws Exception {
        AccessControlPolicy[] effective = acMgr.getEffectivePolicies(ImmutableSet.of(validPrincipal));
        assertEquals(1, effective.length);
        assertTrue(effective[0] instanceof ImmutablePrincipalPolicy);

        List<JackrabbitAccessControlEntry> entries = ((ImmutablePrincipalPolicy)effective[0]).getEntries();
        assertEquals(2, entries.size());

        assertTrue(entries.get(0) instanceof PrincipalAccessControlList.Entry);
        assertEquals(validPrincipal, entries.get(0).getPrincipal());
        assertArrayEquals(privilegesFromNames(JCR_READ, REP_WRITE), entries.get(0).getPrivileges());
        assertEquals(jcrEffectivePath, ((PrincipalAccessControlList.Entry) entries.get(0)).getEffectivePath());

        assertNull(((PrincipalAccessControlList.Entry) entries.get(1)).getEffectivePath());
    }

    @Test
    public void testEffectivePolicyByPrincipal2() throws Exception {
        AccessControlPolicy[] effective = acMgr.getEffectivePolicies(ImmutableSet.of(validPrincipal2));
        assertEquals(1, effective.length);
        assertTrue(effective[0] instanceof ImmutablePrincipalPolicy);

        List<JackrabbitAccessControlEntry> entries = ((ImmutablePrincipalPolicy)effective[0]).getEntries();
        assertEquals(2, entries.size());

        assertTrue(entries.get(0) instanceof PrincipalAccessControlList.Entry);
        assertEquals(validPrincipal2, entries.get(0).getPrincipal());
        assertArrayEquals(privilegesFromNames(JCR_READ), entries.get(0).getPrivileges());
        assertEquals(jcrEffectivePath, ((PrincipalAccessControlList.Entry) entries.get(0)).getEffectivePath());

        assertEquals(validPrincipal2, entries.get(1).getPrincipal());
        assertArrayEquals(privilegesFromNames(JCR_LIFECYCLE_MANAGEMENT), entries.get(1).getPrivileges());
        assertEquals(PathUtils.ROOT_PATH, ((PrincipalAccessControlList.Entry) entries.get(1)).getEffectivePath());
    }

    @Test
    public void testEffectivePolicyByPath() throws Exception {
        String path = getNamePathMapper().getJcrPath(TEST_OAK_PATH);
        AccessControlPolicy[] effective = acMgr.getEffectivePolicies(path);
        assertEquals(2, effective.length);

        for (AccessControlPolicy policy : effective) {
            assertTrue(policy instanceof ImmutablePrincipalPolicy);
            ImmutablePrincipalPolicy effectivePolicy = (ImmutablePrincipalPolicy) policy;

            // filter expected entries: only entries that take effect at the target path should be taken into consideration
            ImmutablePrincipalPolicy byPrincipal = (ImmutablePrincipalPolicy) acMgr.getEffectivePolicies(ImmutableSet.of(effectivePolicy.getPrincipal()))[0];
            Set<JackrabbitAccessControlEntry> expected = ImmutableSet.copyOf(Iterables.filter(byPrincipal.getEntries(), entry -> {
                String effectivePath = ((PrincipalAccessControlList.Entry) entry).getEffectivePath();
                return effectivePath != null && Text.isDescendantOrEqual(effectivePath, path);
            }));

            assertEquals(expected.size(), effectivePolicy.size());
            List<JackrabbitAccessControlEntry> entries = effectivePolicy.getEntries();
            for (JackrabbitAccessControlEntry entry : expected) {
                assertTrue(entries.contains(entry));
            }
        }
    }

    @Test
    public void testEffectivePolicyByPathVerifiesPrincipals() throws Exception {
        PrincipalManager principalMgr = mock(PrincipalManager.class);
        when(principalMgr.getPrincipal(validPrincipal.getName())).thenReturn(null);
        when(principalMgr.getPrincipal(validPrincipal2.getName())).thenReturn(new PrincipalImpl(validPrincipal2.getName()));

        MgrProvider provider = mock(MgrProvider.class);
        when(provider.getPrincipalManager()).thenReturn(principalMgr);
        when(provider.getRoot()).thenReturn(root);
        when(provider.getSecurityProvider()).thenReturn(securityProvider);
        when(provider.getNamePathMapper()).thenReturn(getNamePathMapper());

        PrincipalBasedAccessControlManager acm = new PrincipalBasedAccessControlManager(provider, getFilterProvider());
        AccessControlPolicy[] effective = acm.getEffectivePolicies(getNamePathMapper().getJcrPath(TEST_OAK_PATH));
        assertEquals(0, effective.length);
    }

    @Test
    public void testEffectivePolicyByNullPath() throws Exception {
        AccessControlPolicy[] effective = acMgr.getEffectivePolicies((String) null);
        assertEquals(1, effective.length);
        assertTrue(effective[0] instanceof ImmutablePrincipalPolicy);
        assertEquals(validPrincipal, ((ImmutablePrincipalPolicy)effective[0]).getPrincipal());

        List<JackrabbitAccessControlEntry> entries = ((ImmutablePrincipalPolicy)effective[0]).getEntries();
        assertEquals(1, entries.size());

        assertTrue(entries.get(0) instanceof PrincipalAccessControlList.Entry);
        assertNull(((PrincipalAccessControlList.Entry)entries.get(0)).getEffectivePath());
        assertEquals(validPrincipal, entries.get(0).getPrincipal());
        assertArrayEquals(privilegesFromNames(JCR_NAMESPACE_MANAGEMENT), entries.get(0).getPrivileges());
    }
}


text:
package com.streamsets.datacollector.security;

import com.streamsets.datacollector.main.RuntimeInfo;
import com.streamsets.datacollector.util.Configuration;
import com.streamsets.pipeline.api.impl.Utils;

import java.io.File;
import java.net.InetAddress;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SecurityConfiguration {

  public final static String KERBEROS_ENABLED_KEY = "kerberos.client.enabled";
  public final static boolean KERBEROS_ENABLED_DEFAULT = false;
  public final static String KERBEROS_PRINCIPAL_KEY = "kerberos.client.principal";
  public final static String KERBEROS_PRINCIPAL_DEFAULT = "sdc/_HOST";
  public final static String KERBEROS_KEYTAB_KEY = "kerberos.client.keytab";
  public final static String KERBEROS_KEYTAB_DEFAULT = "sdc.keytab";

  private final boolean kerberosEnabled;
  private final String kerberosPrincipal;
  private final String kerberosKeytab;

  public SecurityConfiguration(RuntimeInfo runtimeInfo, Configuration serviceConf) {
    kerberosEnabled = serviceConf.get(KERBEROS_ENABLED_KEY, KERBEROS_ENABLED_DEFAULT);
    kerberosPrincipal = (kerberosEnabled) ? resolveKerberosPrincipal(serviceConf) : null;
    if (kerberosEnabled) {
      String keytab = serviceConf.get(KERBEROS_KEYTAB_KEY, KERBEROS_KEYTAB_DEFAULT);
      if (!(keytab.charAt(0) == '/')) {
        String confDir = runtimeInfo.getConfigDir();
        keytab = new File(confDir, keytab).getAbsolutePath();
      }
      File keytabFile = new File(keytab);
      if (!keytabFile.exists()) {
        throw new RuntimeException(Utils.format("Keytab file '{}' does not exist", keytabFile));
      }
      kerberosKeytab = keytab;
    } else {
      kerberosKeytab = null;
    }
  }

  /**
   * Returns if Kerberos authentication is enabled.
   *
   * @return true if Kerberos authentication is enabled, false otherwise.
   */
  public boolean isKerberosEnabled() {
    return kerberosEnabled;
  }

  private String resolveKerberosPrincipal(Configuration conf) {
    String principal = conf.get(KERBEROS_PRINCIPAL_KEY, KERBEROS_PRINCIPAL_DEFAULT);
    int idx = -1;
    int len = -1;
    Matcher matcher = Pattern.compile("\\W_HOST(\\W|$)").matcher(principal);
    if (matcher.find()) {
      idx = matcher.start() + 1;
      len = "_HOST".length();
    } else {
      matcher = Pattern.compile("\\W0.0.0.0(\\W|$)").matcher(principal);
      if (matcher.find()) {
        idx = matcher.start() + 1;
        len = "0.0.0.0".length();
      }
    }
    if (idx > -1) {
      principal = principal.substring(0, idx) + getLocalHostName() + principal.substring(idx + len);
    }
    return principal;
  }

  /**
   * Returns the Kerberos principal being used.
   *
   * @return the Kerberos principal being used, or null if Kerberos authentication is not enabled.
   */
  public String getKerberosPrincipal() {
    return kerberosPrincipal;
  }

  /**
   * Returns the Kerberos keytab being used.
   *
   * @return the Kerberos keytab being used, or null if Kerberos authentication is not enabled.
   */

  public String getKerberosKeytab() {
    return kerberosKeytab;
  }

  static String getLocalHostName() {
    try {
      return InetAddress.getLocalHost().getCanonicalHostName();
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    }
  }

}


text:
#ifndef _MSTREAMABLE_HH_
#define _MSTREAMABLE_HH_ 1

#ifdef __GNUG__
#pragma interface
#endif

#include <iostream>

#include "CgiDefs.hh"

CGICC_BEGIN_NAMESPACE

// ============================================================
// Class MStreamable
// ============================================================
/**
 * Abstract mix-in class which makes classes streamable via
 * the << operator.
 * Written in the spirit of a Java interface.
 */
class MStreamable
{

  friend STDNS ostream& operator<<(STDNS ostream& out, const MStreamable& obj);

public:
  /**
   * Write this object to a stream.  Subclasses must implement this function.
   * @param out The ostream to which to write.
   */
  virtual void
  render(STDNS ostream& out) 				const = 0;
};

CGICC_END_NAMESPACE

#endif /* ! _MSTREAMABLE_HH_ */


text:
/**
 * Created by wendywang on 2016-03-16.
 */
import {Component,View} from 'angular2/core';

@Component({
    selector:'report',
    templateUrl:'views/report.component.html'
})

export class ReportComponent{
}


text:
namespace media {

class VideoFrame;

// VideoCapturerSource is an interface representing the source for captured
// video.  An implementation will periodically call the frame callback with new
// video frames.
class CAPTURE_EXPORT VideoCapturerSource {
 public:
  virtual ~VideoCapturerSource();

  // This callback is used to deliver video frames.
  //
  // |estimated_capture_time| - The capture time of the delivered video
  // frame. This field represents the local time at which either: 1) the frame
  // was generated, if it was done so locally; or 2) the targeted play-out time
  // of the frame, if it was generated from a remote source. Either way, an
  // implementation should not present the frame before this point-in-time. This
  // value is NOT a high-resolution timestamp, and so it should not be used as a
  // presentation time; but, instead, it should be used for buffering playback
  // and for A/V synchronization purposes. NOTE: It is possible for this value
  // to be null if the current implementation lacks this timing information.
  //
  // |video_frame->timestamp()| gives the presentation timestamp of the video
  // frame relative to the first frame generated by the corresponding source.
  // Because a source can start generating frames before a subscriber is added,
  // the first video frame delivered may not have timestamp equal to 0.
  using VideoCaptureDeliverFrameCB =
      base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame,
                          base::TimeTicks estimated_capture_time)>;

  using VideoCaptureDeviceFormatsCB =
      base::Callback<void(const media::VideoCaptureFormats&)>;

  using RunningCallback = base::Callback<void(bool)>;

  // Collects the formats that can currently be used.
  // |max_requested_height|, |max_requested_width|, and
  // |max_requested_frame_rate| is used by Tab and Screen capture to decide what
  // resolution/framerate to generate. |callback| is triggered when the formats
  // have been collected.
  virtual void GetCurrentSupportedFormats(
      int max_requested_width,
      int max_requested_height,
      double max_requested_frame_rate,
      const VideoCaptureDeviceFormatsCB& callback) = 0;

  // Starts capturing frames using the capture |params|. |new_frame_callback| is
  // triggered when a new video frame is available.
  // If capturing is started successfully then |running_callback| will be
  // called with a parameter of true. Note that some implementations may
  // simply reject StartCapture (by calling running_callback with a false
  // argument) if called with the wrong task runner.
  // If capturing fails to start or stopped due to an external event then
  // |running_callback| will be called with a parameter of false.
  // |running_callback| will always be called on the same thread as the
  // StartCapture.
  virtual void StartCapture(
      const media::VideoCaptureParams& params,
      const VideoCaptureDeliverFrameCB& new_frame_callback,
      const RunningCallback& running_callback) = 0;

  // Asks source to send a refresh frame. In cases where source does not provide
  // a continuous rate of new frames (e.g. canvas capture, screen capture where
  // the screen's content has not changed in a while), consumers may request a
  // "refresh frame" to be delivered. For instance, this would be needed when
  // a new sink is added to a MediaStreamTrack.
  //
  // The default implementation is a no-op and implementations are not required
  // to honor this request. If they decide to and capturing is started
  // successfully, then |new_frame_callback| should be called with a frame.
  //
  // Note: This should only be called after StartCapture() and before
  // StopCapture(). Otherwise, its behavior is undefined.
  virtual void RequestRefreshFrame() {}

  // Optionally suspends frame delivery. The source may or may not honor this
  // request. Thus, the caller cannot assume frame delivery will actually
  // stop. Even if frame delivery is suspended, this might not take effect
  // immediately.
  //
  // The purpose of this is to allow minimizing resource usage while
  // there are no frame consumers present.
  //
  // Note: This should only be called after StartCapture() and before
  // StopCapture(). Otherwise, its behavior is undefined.
  virtual void MaybeSuspend() {}

  // Resumes frame delivery, if it was suspended. If frame delivery was not
  // suspended, this is a no-op, and frame delivery will continue.
  //
  // Note: This should only be called after StartCapture() and before
  // StopCapture(). Otherwise, its behavior is undefined.
  virtual void Resume() {}

  // Stops capturing frames and clears all callbacks including the
  // SupportedFormatsCallback callback. Note that queued frame callbacks
  // may still occur after this call, so the caller must take care to
  // use refcounted or weak references in |new_frame_callback|.
  virtual void StopCapture() = 0;
};

}  // namespace media

#endif  // MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_


text:
1.1.0 / 2015-04-22
==================

  * Use `setprototypeof` instead of `__proto__`
  * deps: debug@~2.1.3
    - Fix high intensity foreground color for bold
    - deps: ms@0.7.0

1.0.0 / 2015-01-13
==================

  * Fix crash from error within `OPTIONS` response handler
  * deps: array-flatten@1.0.2
    - Remove redundant code path

1.0.0-beta.3 / 2015-01-11
=========================

  * Fix duplicate methods appearing in OPTIONS responses
  * Fix OPTIONS responses to include the HEAD method properly
  * Remove support for leading colon in `router.param(name, fn)`
  * Use `array-flatten` for flattening arrays
  * deps: debug@~2.1.1
  * deps: methods@~1.1.1

1.0.0-beta.2 / 2014-11-19
=========================

  * Match routes iteratively to prevent stack overflows

1.0.0-beta.1 / 2014-11-16
=========================

  * Initial release ported from Express 4.x
    - Altered to work without Express


text:
layout: post
published: true
title: Title
---

## Title section worked
w00t!


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Raven Examples - Empty Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="user-scalable=no,width=device-width" />
    <link rel="stylesheet" type="text/css" href="../../styles/reset.css">
    <link rel="stylesheet" type="text/css" href="../../styles/default.css">
    <script type="text/javascript" src="../../src/Raven.js"></script>
</head>
<body>
    <canvas id="world"></canvas>
    <script type="text/javascript" src="App.js" ></script>
</body>
</html>


text:
// <copyright file="SqlServerDatabase.cs" company="Meld contributors">
//  Copyright (c) Meld contributors. All rights reserved.
// </copyright>

namespace Meld.Tests.Feature
{
    using System;
    using System.Data;
    using System.Data.SqlClient;
    using FluentAssertions;
    using Meld.Tests.Sdk;
    using Xbehave;
    using Xunit;

    [Collection("SQL Server Collection")]
    public class SqlServerDatabase : SqlServerFeature
    {
        public SqlServerDatabase(SqlServerFixture fixture)
            : base(fixture)
        {
        }

        // can create database
        // can create multiple databases
        // rollback on error is atomic
        [Scenario]
        public void CanInitializeDatabase(SqlConnection connection, int result)
        {
            "Given a SQL Server connection"
                .f(c => connection = new SqlConnection(this.ConnectionString).Using(c));

            "When I initialize that connection for this test"
                .f(() => connection.InitializeSchema("features", "CanInitializeDatabase"));

            "And I query the database"
                .f(() =>
                {
                    using (var command = new SqlCommand("features.CanInitializeDatabase", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        connection.Open();
                        result = int.Parse(command.ExecuteScalar().ToString());
                    }
                });

            "Then the result is expected"
                .f(() => result.Should().Be(42));
        }

        [Scenario]
        public void CanAlterDatabase(SqlConnection connection, Action action)
        {
            "Given a SQL Server connection"
                .f(c => connection = new SqlConnection(this.ConnectionString).Using(c));

            "When I initialize that connection for this test"
                .f(() => action = () => connection.InitializeSchema("features", "CanAlterDatabase"));

            "Then that action should succeed"
                .f(() => action.ShouldNotThrow());
        }
    }
}