text:
import re
from bs4 import BeautifulSoup
import requests

from model import *

# ONLY does parsing; use something else to get the URL and pass it in as an html string
# this class is ordered by the navigation on sc2casts.com
class Sc2CastsParser(object):

    @staticmethod
    def _cleanup_path(path):
        ''' ensures that there is exactly one leading /, for building urls '''
        if not path.startswith('/'):
            return '/' + path
        return path

    # Best of 5
    # Best of 3 - All in 1 video
    # BO3 in 1 Video
    @staticmethod
    def _best_of(series_name):
        try:
            best_of_string = re.search('\((.*)\)', series_name).group(1)

            ''' returns: int, the number of games there are '''
            # case by case
            if '1 game' in best_of_string.lower():
                num_videos = 1
                best_of = 1
            elif 'best of ' in best_of_string.lower():
                num_videos = int(re.search('Best of (\d+)', best_of_string).group(1))
                best_of = num_videos
            elif 'bo' in best_of_string.lower():
                num_videos = int(re.search('BO(\d+)', best_of_string).group(1))
                best_of = num_videos
            else:
                num_videos = -1
                best_of = -1
            return best_of
        except AttributeError as e:
            # regex failed; either there's no best_of info in the name, or it's a new pattern
            return 'Unknown BestOf'

    def _parse_series_page(self, series_page_html):
        series = Sc2CastsSeries()
        soup = BeautifulSoup(series_page_html)

        # useful 'global' fields
        vs_label = soup.find('div', class_='vslabel')
        info_label = soup.find('div', class_='infolabel')

        # the series 'header' and metainfo

        # what a pain in the ass.
        # note that we manually add the "(best of ..)" info here, to maximize code reuse
        def name(vs_label, info_label):
            return '{0} ({1})'.format(vs_label.h1.text, info_label.h2.text)
        series.name = name(vs_label, info_label)
        series.path = None

        # first span: TODO convert to object
        def matchup(vs_label):
            try:
                images = vs_label.find_all('img')
                (left, right) = (images[0], images[1])
                (left_title, right_title) = (left['title'], right['title'])

                return "{0}v{1}".format(left_title[0:1], right_title[0:1])
            except Exception as e:
                # no matchup; probably team versus team
                return ''
        series.matchup = matchup(vs_label)

        def players(vs_label):
            return [
                Sc2CastsPlayer(name=a.b.text, path=a['href'])
                for a in vs_label.h1.find_all('a')
            ]
        series.players = players(vs_label)
        series.players_desc = None

        series.best_of = self._best_of(series.name)
        # will set this later
        series.num_videos = -2

        def event_info(info_label):
            return Sc2CastsEvent(
                name=info_label.find('span', class_='event_name').text,
                path=info_label.find('span', class_='event_name').parent['href'],
            )
        series.event = event_info(info_label)
        series.event_round = info_label.find('span', class_='round_name').text

        def casters(info_label):
            return [
                Sc2CastsCaster(
                    name=span.text,
                    path=span.parent['href'],
                ) for span in info_label.find_all('span', class_='caster_name')
            ]
        series.casters = casters(info_label)
        series.casters_desc = None

        # the last span in the breadcrumb...
        # TODO as datetime obj
        # TODO no longer available; now only has post_date
        def cast_date(breadcrumb):
            return breadcrumb.find_all('span')[-1].text
        def post_date(info_label):
            return info_label.find_all('span')[-1].text
        series.cast_date = None
        series.post_date = post_date(info_label)

        def scores_info(soup):
            scores_el = soup.find('div', id='tt')
            return {
                'up': int(scores_el.find('img', title='Yea').parent.parent.text),
                'down': int(scores_el.find('img', title='Nah').parent.parent.text),
            }
        series.score_up = scores_info(soup)['up']
        series.score_down = scores_info(soup)['down']

        # now we can finally do the casts themselves
        series.casts = [ ]
        for i, iframe in enumerate(soup.find_all('iframe')):
            cast = Sc2CastsCast()

            cast.name = 'Game ' + str(i + 1)
            def source(iframe):
                if 'youtube.com' in iframe['src'].lower():
                    return 'YouTube'
                return 'Unknown'
            cast.source = source(iframe)
            cast.video_url = iframe['src']
            # remove any query params
            if '?' in cast.video_url:
                cast.video_url = cast.video_url.rsplit('?', 1)[0]
            cast.video_id = cast.video_url.rsplit('/', 1)[-1]

            series.casts.append(cast)
        # now that we know now many
        series.num_videos = len(series.casts)

        return series

    def _parse_series_div(self, div):
        series = Sc2CastsSeries()

        def name(div):
            return div.find('a').get_text()
        series.name = name(div)

        def path(div):
            try:
                # index page has it as an h2
                return div.h2.a['href']
            except:
                # top pages and all has it as an h3
                return div.h3.a['href']
        series.path = path(div)

        # team matches don't have the matchup tag, fill with a dummy matchup object
        def matchup(div):
            span = div.find('span', style='color:#cccccc')
            return Sc2CastsMatchup(name=span.text)
        series.matchup = matchup(div)

        def players(div):
            return [
                # no path here, just the name
                Sc2CastsPlayer(name=b.text)
                for b in div.find_all('b')
            ]
        series.players = players(div)
        series.players_desc = None

        series.best_of = self._best_of(series.name)
        # can't be known; default is 0 to match with length of casts
        series.num_videos = 0

        def event(div):
            return Sc2CastsEvent(
                name=div.select('.event_name')[0].string,
                path=div.select('.event_name')[0].parent['href']
            )
        series.event = event(div)
        series.event_round = div.find('span', class_='round_name').text

        def casters(div):
            return [
                Sc2CastsCaster(
                    name=span.text,
                    path=span.parent['href'],
                ) for span in div.find_all('span', class_='caster_name')
            ]
        series.casters = casters(div)
        series.casters_desc = None

        series.cast_date = None

        series.score_up = -1
        series.score_down = -1

        # the actual casts themselves
        # can't find out
        series.casts = [ ]

        def source(div):
            return div.img['alt']

        return series

    def _parse_index(self, top_page_html):
        results = [ ]
        soup = BeautifulSoup(top_page_html)

        for div in soup.find_all('div', class_='latest_series'):
            result = self._parse_series_div(div)
            results.append(result)

        return results

    def _parse_top(self, top_page_html):
        results = [ ]
        soup = BeautifulSoup(top_page_html)

        for div in soup.find_all('div', class_='latest_series'):
            result = self._parse_series_div(div)
            results.append(result)

        return results

    def _parse_all(self, all_page_html):
        results = [ ]
        soup = BeautifulSoup(all_page_html)

        #content_div = soup.select('div .content')[0]
        #for div in content_div.find_all('div', recursive=False):
        for div in soup.find_all('div', class_='latest_series'):
            result = self._parse_series_div(div)
            results.append(result)

        return results

    # in: a section name; there are 4 'valign=top' fields:
    # events: prominent and all events
    # players: notable and all players
    # casters: prominent and all casters
    # matchups: matchups
    #
    # out: the `td` tag containing the given section
    def _parse_browse_page(self, browse_page_html, section_name):
        soup = BeautifulSoup(browse_page_html)

        section_id = {
            'events': 0,
            'players': 1,
            'casters': 2,
            'matchups': 3,
        }[section_name]

        content_div = soup.find_all('td', attrs={ 'valign': 'top' })[section_id]
        return content_div

    def casters(self, html):
        results = [ ]

        for anchor in self._parse_browse_page(html, 'casters').find_all('a'):
            result = Sc2CastsCaster()
            result.name = anchor.string
            result.path = self._cleanup_path(anchor['href'])

            results.append(result)

        return results

    def events(self, html):
        results = [ ]

        for anchor in self._parse_browse_page(html, 'events').find_all('a'):
            result = Sc2CastsEvent()
            result.name = anchor.string
            result.path = self._cleanup_path(anchor['href'])

            results.append(result)

        return results

    def matchups(self, html):
        results = [ ]

        for anchor in self._parse_browse_page(html, 'matchups').find_all('a'):
            result = Sc2CastsMatchup()
            result.name = anchor.string
            result.path = self._cleanup_path(anchor['href'])

            results.append(result)

        return results

    def players(self, html, filter='all'):
        results = [ ]

        # this is a little more annoying; has to be done linearly/statefully since <br> is the separator
        current = Sc2CastsPlayer()
        for el in self._parse_browse_page(html, 'players').children:
            # separator between 'Notable Players' and 'All Players'
            if el.name == 'span' and el.text == 'All Players':
                break

            # save the current and start a new one
            if el.name == 'br':
                # if there's not enough info for this player, don't add it
                if current.name:
                    results.append(current)
                current = Sc2CastsPlayer()

            if el.name == 'a':
                current.sc2ranks_link = el['href']
            if el.name == 'h3':
                current.name = el.a.text
                current.path = self._cleanup_path(el.a['href'])

        # TODO even more annoying that 'All Players' is embedded
        '''
        for anchor in self._parse_browse_page(html, 'players').find_all('a'):
            #print anchor
            #results.append({
                #'desc': anchor.string,
                #'path': anchor['href'],
            #})
            result = Sc2CastsPlayer()
            result.name = anchor.string
            result.path = self._cleanup_path(anchor['href'])

            results.append(result)
        '''

        return results

    def log(self, msg):
        print msg


text:
(function() {
    'use strict'

    angular.module('formobject')
        .directive('ngObject', Directive);

    function Directive() {
        return {
            restrict: 'E',
            templateUrl: 'formobject/fo-object.tpl.html',
            scope: {
                model: "=",
                path: "=",
                formHorizontal: "=",
                formNoEditableKey: "="
            },
            controller: 'NgObjectCtrl as objCtrl',
            replace: true,
            link: function(scope) {
                if(scope.formHorizontal == undefined) {
                    scope.formHorizontal = true;
                }
            }
        }
    }
})();

redpajama_set_name: RedPajamaGithub


text:
//
//  TopicVideoView.m
//  BaiSiBuDeJie_Imitate
//
//  Created by apple on 17/9/21.
//  Copyright © 2017年 wy. All rights reserved.
//

#import "TopicVideoView.h"
#import "TopicItem.h"
#import "SeeBigPictureViewController.h"

#import <AVKit/AVKit.h>
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>

@interface TopicVideoView () <AVPlayerViewControllerDelegate>

@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UILabel *playCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *videoTimeLabel;
/**    播放视频的控制器    */
@property (strong, nonatomic) AVPlayerViewController *playerVc;

@end

@implementation TopicVideoView

- (void)awakeFromNib {

    [super awakeFromNib];

    self.autoresizingMask = UIViewAutoresizingNone;

    self.imageView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(seeBigPicture)];

    [self.imageView addGestureRecognizer:tap];
}

#pragma mark - 点击查看大图
- (void)seeBigPicture {

    SeeBigPictureViewController *seeBigPictureVc = [[SeeBigPictureViewController alloc] init];

    seeBigPictureVc.topicItem = self.item;

    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:seeBigPictureVc animated:YES completion:nil];

}

#pragma mark - 点击按钮播放视频
- (IBAction)playButtonClick:(UIButton *)sender {

    NSString *systemVersion = [UIDevice currentDevice].systemVersion;

    if ([systemVersion integerValue] < 9) {
        // iOS9 之前的用法
        MPMoviePlayerController *mpPlayerVc = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:self.item.videouri]];

        [[UIApplication sharedApplication].keyWindow.rootViewController presentModalViewController:mpPlayerVc animated:YES];

    } else {
        // iOS9 苹果推荐使用的方法
        AVPlayer *player = [AVPlayer playerWithURL:[NSURL URLWithString:self.item.videouri]];

        AVPlayerViewController *playerVc = [[AVPlayerViewController alloc] init];

        playerVc.player = player;
        // 一点进去就开始播放
        [playerVc.player play];

        playerVc.delegate = self;

        self.playerVc = playerVc;

        [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:playerVc animated:YES completion:nil];
        // 监听播放完后关闭播放器
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(dismissVc)
                                                     name:AVPlayerItemDidPlayToEndTimeNotification
                                                   object:nil];
    }

}

- (void)dealloc {

    // 移除通知
    [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
}

#pragma mark - 关闭播放器
- (void)dismissVc {
    WYFunc;

    [self.playerVc dismissViewControllerAnimated:YES completion:nil];
}

- (void)setItem:(TopicItem *)item {

    _item = item;
    // 设置播放数量
    if (_item.playcount >= 10000) {
        self.playCountLabel.text = [NSString stringWithFormat:@"%.1f万播放",_item.playcount / 10000.0];
    } else if (_item.playcount > 0) {
        self.playCountLabel.text = [NSString stringWithFormat:@"%zd播放",_item.playcount];
    }

    // 音频时长
    self.videoTimeLabel.text = [NSString stringWithFormat:@"%02zd:%02zd",_item.videotime / 60,_item.videotime % 60];

    // 根据网络状态加载相应的图片
    [self.imageView setOriginImage:_item.image1 thumbnailImage:_item.image0 placeholderImage:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {

    }];
}

@end


text:
/**
 * Tag
 * Uniquely tag a function. This is used to identify actions
 */

let uid = 0

module.exports = function tag (fn) {
  let name = fn.name || 'microcosm_action'
  let mark = uid++

  if (!fn.hasOwnProperty('toString')) {
    fn.toString = () => `${ name }_${ mark }`
  }

  return fn
}


text:
@interface UIViewController (Factory)

+ (instancetype)bra_controller;

@end


text:
<?php declare(strict_types=1);

namespace Symplify\ModularRouting\Tests\Routing\AbstractRouteCollectionProviderSource;

use Symfony\Component\Routing\RouteCollection;
use Symplify\ModularRouting\Routing\AbstractRouteCollectionProvider;

final class FilesRouteCollectionProvider extends AbstractRouteCollectionProvider
{
    public function getRouteCollection(): RouteCollection
    {
        return $this->loadRouteCollectionFromFiles([
            __DIR__ . '/routes.xml',
            __DIR__ . '/routes.yml',
        ]);
    }
}


text:
<!DOCTYPE html>

<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.0; user-scalable=0;">
<meta charset="utf-8">
<title>libopensso-php » \US\OpenSSO\Handler</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">

libopensso-php

                                    API Documentation

Namespaces

 US

                                    Charts

 Class hierarchy diagram

                                    Reports

 Errors
                0

 Markers

 Deprecated elements
                0

Back to top

                            Javascript is disabled; several features are only available
                            if Javascript is enabled.

<button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button>

<button class="btn details" title="Show descriptions and method names"></button><button class="btn simple" title="Show only method names"></button>

 Methods

Constructs a new OpenSSO client handler
__construct()

Returns all attributes
all_attributes()

Returns an attribute value/values
attribute()

Forces OpenSSO login
check_and_force_sso()

Checks if current user has a valid SSO session
check_sso()

Logs out user from OpenSSO
logout()

 Properties

» Protected

Chosen environment
$env

Cached metadata
$metadata

Metadata path
$path

» Private

Attributes for current user
$attributes

Context needed for stream functions
$context

Current cookie name
$cookiename

Current user SSO token
$token

 Constants

Default cookie name
cookiename

Library version, used inside User-Agent
version

\

US

\
OpenSSO

\Handler

Class for OpenSSO integration

package
libopensso-php

 Methods

Constructs a new OpenSSO client handler

__construct(string $env, boolean $fetch_cookie_name, string $metadata_dir)

Parameters

$env

string
Which environment from metadata should this helper use

$fetch_cookie_name

boolean
When true cookie name will be fetched from server using getCookieNameForToken

$metadata_dir

string
Directory to load metadata from

Exceptions

\Exception
On error

Returns all attributes

all_attributes(boolean $force_arrays)

Parameters

$force_arrays

boolean
Force use of arrays even on single valued attributes

Returns an attribute value/values

attribute(string $atr, boolean $force_array)

Parameters

$atr

string
Attribute name

$force_array

boolean
Whether to cast to array even if attribute has a single value

Forces OpenSSO login

check_and_force_sso(string $gotourl) : boolean

Parameters

$gotourl

string
Return URL. If not specified, current URL is used

Returns

booleanUser has a valid SSO session or not

Checks if current user has a valid SSO session

check_sso() : boolean

Returns

booleanUser has a valid SSO session or not

Logs out user from OpenSSO

logout(string $gotourl)

Parameters

$gotourl

string
URL to return to after logging out

 Properties

Chosen environment

$env

Cached metadata

$metadata

Metadata path

$path

Attributes for current user

$attributes

Context needed for stream functions

$context

Current cookie name

$cookiename

Current user SSO token

$token

 Constants

Default cookie name

cookiename

Library version, used inside User-Agent

version

            Template is built using Twitter Bootstrap 2 and icons provided by Glyphicons.

            Documentation is powered by phpDocumentor 2.0.0a3 and

            generated on 2012-08-31T12:31:04+02:00.


text:
module Neo4j
  class Label
    class << self
      def indexes
        schema_query(:get_indexes)
      end

      def constraints
        schema_query(:get_constraints)
      end

      def index?(label, property)
        schema_index_operation(label, property, :indexes)
      end

      def constraint?(label, property)
        schema_index_operation(label, property, :constraints)
      end

      def drop_all_indexes
        Neo4j::Transaction.run do
          schema.get_indexes.to_a.each do |i|
            begin
              i.drop
            rescue Java::JavaLang::IllegalStateException
            end
          end
        end
      end

      def drop_all_constraints
        Neo4j::Transaction.run do
          schema.get_constraints.to_a.each(&:drop)
        end
      end

      private

      def schema_query(query_method)
        [].tap do |index_array|
          Neo4j::Transaction.run do
            schema.send(query_method).to_a.each { |i| index_array << index_hash(i) }
          end
        end
      end

      def schema_index_operation(label, property, schema_method)
        label = label.to_s
        property = property.to_s
        !send(schema_method).select { |i| matched_index(i, label, property) }.empty?
      end

      def index_hash(java_index)
        {property_keys: java_index.get_property_keys.to_a, label: java_index.get_label.name}
      end

      def matched_index(java_index, label, property)
        java_index[:property_keys].first == property && java_index[:label] == label
      end

      def schema
        Neo4j::Session.current.graph_db.schema
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Chronic
{
    public class ScalarScanner : ITokenScanner
    {
        static readonly Regex _pattern = new Regex(
            @"^\d*$",
            RegexOptions.Singleline | RegexOptions.Compiled);

        static readonly Regex _dayPattern = new Regex(
            @"^\d\d?$",
            RegexOptions.Singleline | RegexOptions.Compiled);

        static readonly Regex _monthPattern = _dayPattern;
        static readonly Regex _yearPattern = new Regex(
            @"^([1-9]\d)?\d\d?$",
            RegexOptions.Singleline | RegexOptions.Compiled);

        static readonly string[] _dayPeriods = new string[] { "am", "pm", "morning", "afternoon", "evening", "night" };

        public IList<Token> Scan(IList<Token> tokens, Options options)
        {
            tokens.ForEach((token, nextToken) => token.Tag(
                new ITag[]
                    {
                        Scan(token, nextToken, options),
                        ScanDay(token, nextToken, options),
                        ScanMonth(token, nextToken, options),
                        ScanYear(token, nextToken, options),
                    }.Where(
                        x => x != null).ToList()));
            return tokens;
        }

        public static Scalar Scan(Token token, Token nextToken, Options options)
        {
            var match = _pattern.Match(token.Word);

            if (match.Success && String.IsNullOrEmpty(token.Word) == false
                && TokenIsAPeriodOfDay(nextToken) == false)
            {
                return new Scalar(int.Parse(match.Groups[0].Value));
            }
            return null;
        }

        public static Scalar ScanDay(Token token, Token nextToken, Options options)
        {
            if (_dayPattern.IsMatch(token.Word))
            {
                var value = int.Parse(token.Word);
                if (value <= 31 && TokenIsAPeriodOfDay(nextToken) == false)
                    return new ScalarDay(value);
            }
            return null;
        }

        public static Scalar ScanMonth(Token token, Token nextToken, Options options)
        {
            if (_monthPattern.IsMatch(token.Word))
            {
                var value = int.Parse(token.Word);
                if (value <= 12 && TokenIsAPeriodOfDay(nextToken) == false)
                    return new ScalarMonth(value);
            }
            return null;
        }

        public static Scalar ScanYear(Token token, Token nextToken, Options options)
        {
            if (_yearPattern.IsMatch(token.Word))
            {
                var value = int.Parse(token.Word);
                if (TokenIsAPeriodOfDay(nextToken) == false)
                {
                    if (value <= 37)
                    {
                        value += 2000;
                    }
                    else if (value <= 137 && value >= 69)
                    {
                        value += 1900;
                    }
                    return new ScalarYear(value);
                }
            }
            return null;
        }

        static bool TokenIsAPeriodOfDay(Token token)
        {
            return token != null && _dayPeriods.Contains(token.Word);
        }
    }
}


text:
from __future__ import absolute_import, division, print_function, unicode_literals

import base64
import json
import logging
import sys
import time

import sendgrid
from python_http_client.exceptions import HTTPError, TooManyRequestsError
from sendgrid.helpers.mail import (
    Attachment,
    Bcc,
    Category,
    Cc,
    ClickTracking,
    Content,
    CustomArg,
    FileContent,
    FileName,
    From,
    IpPoolName,
    Mail,
    MailSettings,
    BypassBounceManagement,
    BypassSpamManagement,
    BypassUnsubscribeManagement,
    MimeType,
    OpenTracking,
    OpenTrackingSubstitutionTag,
    ReplyTo,
    SendAt,
    Subject,
    Substitution,
    To,
    TrackingSettings,
)

from espwrap.adaptors.sendgrid_common import breakdown_recipients
from espwrap.base import MIMETYPE_HTML, MIMETYPE_TEXT, MassEmail, batch

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)

if sys.version_info > (2,):
    basestring = str

_HTTP_EXC_MSG = "SendGrid responded with an HTTP-error code.  Email Subject: %s, Status Code: %s, Reason: %s, Body: %s"
MAX_ATTEMPTS = 3

class SendGridMassEmail(MassEmail):
    def __init__(self, api_key, *args, **kwargs):
        super(SendGridMassEmail, self).__init__(*args, **kwargs)

        self.client = sendgrid.SendGridAPIClient(api_key)

        self.delimiters = ("-", "-")
        self.mail_settings = MailSettings()

    def set_variable_delimiters(self, start="-", end="-"):
        self.delimiters = (start, end)

    def get_variable_delimiters(self, as_dict=False):
        if as_dict:
            return {
                "start": self.delimiters[0],
                "end": self.delimiters[1],
            }
        return self.delimiters

    def set_bypass_management(self,
        bypass_spam_management=False,
        bypass_bounce_management=False,
        bypass_unsubscribe_management=False):

        # mail_settings see https://docs.sendgrid.com/api-reference/mail-send/mail-send
        self.mail_settings.bypass_spam_management = BypassSpamManagement(bypass_spam_management),
        self.mail_settings.bypass_bounce_management = BypassBounceManagement(bypass_bounce_management)
        self.mail_settings.bypass_unsubscribe_management = BypassUnsubscribeManagement(bypass_unsubscribe_management)

    def add_tags(self, *tags):
        if len(tags) > 10:
            raise Exception("Too many tags, SendGrid limits to 10 per email")

        if len(tags) + len(self.tags) > 10:
            raise Exception("Requested tags would have raised total to above Sendgrid limit of 10")

        return super(SendGridMassEmail, self).add_tags(*tags)

    def message_constructor(self, to_send):
        message = Mail()
        to_emails = []

        # Content (Text)
        if self.body[MIMETYPE_TEXT]:
            content = Content(MimeType.text, self.body[MIMETYPE_TEXT])
            message.content = content

        # Content (Html)
        if self.body[MIMETYPE_HTML]:
            content = Content(MimeType.html, self.body[MIMETYPE_HTML])
            message.content = content

        message.subject = Subject(self.subject)

        # Category
        if self.tags:
            for tag in self.tags:
                message.category = Category(tag)

        # Reply
        if self.reply_to_addr:
            message.reply_to = ReplyTo(self.reply_to_addr)

        # Send At
        if self.send_at:
            message.send_at = SendAt(self.send_at)

        # IP Pool
        if self.ip_pool:
            message.ip_pool_name = IpPoolName(self.ip_pool)

        # Attachment
        if self.attachments:
            for file_name, file_path_or_string in self.attachments.items():
                attachment = Attachment()
                encoded = base64.b64encode(file_path_or_string).decode("ascii")
                attachment.file_content = FileContent(encoded)
                attachment.file_name = FileName(file_name)
            message.attachment = attachment

        # Webhook Data
        if self.webhook_data:
            for key, val in self.webhook_data.items():
                message.custom_arg = CustomArg(key, val)

        # Metadata
        if self.metadata:
            for key, val in self.metadata.items():
                message.custom_arg = CustomArg(key, val)

        # Template Name
        if self.template_name:
            message.custom_arg = CustomArg("template_name", self.template_name)

        # Tracking
        tracking_settings = TrackingSettings()
        # Opens
        if self.track_opens:
            tracking_settings.open_tracking = OpenTracking(
                self.track_opens, OpenTrackingSubstitutionTag("open_tracking")
            )
        # Clicks
        if self.track_clicks:
            tracking_settings.click_tracking = ClickTracking(self.track_clicks, self.track_clicks)
        message.tracking_settings = tracking_settings

        # mail_settings see https://docs.sendgrid.com/api-reference/mail-send/mail-send
        message.mail_settings = self.mail_settings

        if self.from_addr and self.from_name:
            message.from_email = From(email=self.from_addr, name=self.from_name)
        else:
            message.from_email = From(email=self.from_addr)

        for subgrps in to_send:
            for subgrp in subgrps:
                substitutions = subgrp["merge_vars"]
                substitutions_dict = {}

                for key, val in substitutions.items():
                    new_key = "{1}{0}{2}".format(key, *self.delimiters)
                    formatted_val = val
                    if not isinstance(val, basestring):
                        try:
                            formatted_val = str(val)
                        except UnicodeEncodeError:
                            formatted_val = val.encode("utf-8")

                    substitutions_dict[new_key] = formatted_val

                email = subgrp["email"]
                name = subgrp["name"]
                to_emails.append(
                    To(
                        email=email,
                        name=name,
                        substitutions=substitutions_dict,
                        subject=self.generate_subject(email, name),
                    )
                )

        message.add_to(to_emails, is_multiple=True)

        #CC and BCC
        for personalization in message.personalizations:
            for cc_email in self.cc_list:
                personalization.add_cc(Cc(cc_email))
            for bcc_email in self.bcc_list:
                personalization.add_bcc(Bcc(bcc_email))

        # Global Subs
        for key, val in self.global_merge_vars.items():
            new_key = "{1}{0}{2}".format(key, *self.delimiters)
            formatted_val = val
            if not isinstance(val, basestring):
                try:
                    formatted_val = str(val)
                except UnicodeEncodeError:
                    formatted_val = val.encode("utf-8")

            message.substitution = Substitution(new_key, formatted_val)

        return message

    def generate_subject(self, email, name):
        """
        Generate email subject for recipient.
        If username contains "." or "+" it is considered an alias so we
        prepend a custom greeting to avoid bounces from providers like Gmail
        :param email: Recipient email
        :param name: Recipient name
        :return subject: sendgrid.helpers.mail.Subject
        """
        try:
            username = email.split("@")[0]
            if "." in username or "+" in username:
                return Subject("{} [{}]".format(self.subject, email))
        except Exception as e:
            logger.exception(e)

        return Subject(self.subject)

    def send(self):

        responses = []

        self.validate()

        grouped_recipients = batch(list(self.recipients), self.partition)

        for grp in grouped_recipients:
            to_send = breakdown_recipients(grp)

            message = self.message_constructor(to_send)

            # message data as dict for examination/validation below
            message_dict = message.get()

            # do not send if custom args >10 KB (sendgrid rule)
            if "custom_args" in message_dict:
                message_custom_args = len(json.dumps(message_dict["custom_args"]))
                custom_args_size = sys.getsizeof(message_custom_args)
                custom_args_kb = 0.001 * float(custom_args_size)
                if custom_args_kb > 10:
                    raise Exception("attempted to send {} KB custom_args, not to exceed 10 KB.".format(custom_args_kb))

            # do not send if number of recipients >1000 (sendgrid rule)
            num_recips = len(message_dict["personalizations"])
            if num_recips > 1000:
                raise Exception(
                    "attempted to send to {} email addresses, not to exceed 1000 addresses.".format(num_recips)
                )

            """
            send message and append response from this grp to list of returned responses for all grouped_recipients
            """
            attempt = 0
            logger.debug(message)
            while attempt < MAX_ATTEMPTS:
                try:
                    response = self.client.send(message)
                    responses.append(response)
                except TooManyRequestsError:
                    attempt += 1
                    logger.exception("[{}] Too many requests, trying to resend the message...".format(attempt))
                    time.sleep(1)
                    continue
                except HTTPError as e:
                    logger.exception(_HTTP_EXC_MSG, self.subject, e.status_code, e.reason, e.body)
                except Exception:
                    logger.exception("Unknown exception while sending a SendGridMassEmail.")
                break

        # return list of all responses for each grp in grouped_recipients
        return responses


text:
import "./docsify-footer"
import "./docsify-katex"


text:
@interface USBDeviceInterface ()

@property (assign, nonatomic, readwrite) IOUSBDeviceInterfaceLatest ** device;

@end

@implementation USBDeviceInterface

- (instancetype)initWithService:(io_service_t)service {
    self = [super init];
    if (self) {
        IOCFPlugInInterface ** plugInInterface;
        SInt32 score;

        // Use IOReturn instead kern_return_t
        IOReturn err;
        err = IOCreatePlugInInterfaceForService(service, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score);
        if (err != kIOReturnSuccess) {
            return nil; // `dealloc` will be called
        }
        err = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceIDLatest), (LPVOID)&_device);
        if (err != kIOReturnSuccess) {
            // Ignore result
            IODestroyPlugInInterface(plugInInterface);
            return nil; // `dealloc` will be called
        }

        // Ignore result
        IODestroyPlugInInterface(plugInInterface);
    }
    return self;
}

- (instancetype)initWithDevice:(IOUSBDeviceInterfaceLatest **)device {
    self = [super init];
    if (self) {
        _device = device;
        [self setup];
    }
    return self;
}

- (void)dealloc {
    [self close];
    IOReturn err = (*_device)->Release(_device);
    if (err != kIOReturnSuccess) {
        NSLog(@"Warning: 0x%08x at %s, line %d", err, __PRETTY_FUNCTION__, __LINE__);
    }
}

- (void)setup {
    // DEBUG:
    UInt32 locationID;
    (*_device)->GetLocationID(_device, &locationID);
}

- (IOUSBConfigurationDescriptor *)getConfigurationDescriptor:(NSError **)error {
    UInt8 configIndex = 0;
    IOUSBConfigurationDescriptorPtr configurationDescriptor;
    IOReturn err = (*_device)->GetConfigurationDescriptorPtr(_device, configIndex, &configurationDescriptor);
    if (err != kIOReturnSuccess) {
        NSLog(@"Error: 0x%08x at %s, line %d", err, __PRETTY_FUNCTION__, __LINE__);
        *error = [NSError BBBUSBKitErrorWithIOReturnError: err];
        return nil;
    }
    return configurationDescriptor;
}

- (IOReturn)open {
    IOReturn err = (*_device)->USBDeviceOpenSeize(_device);
    if (err != kIOReturnSuccess) {
        NSLog(@"Error: 0x%08x at %s, line %d", err, __PRETTY_FUNCTION__, __LINE__);
    }
    return err;
}

- (IOReturn)close {
    IOReturn err = (*_device)->USBDeviceClose(_device);
    if (err == kIOReturnNotOpen) {
        // Ignore
    }
    else if (err != kIOReturnSuccess) {
        NSLog(@"Error: 0x%08x at %s, line %d", err, __PRETTY_FUNCTION__, __LINE__);
    }
    return err;
}

- (IOReturn)getUSBInterfaceIterator:(io_iterator_t *)iterator {
    IOUSBFindInterfaceRequest request;
    request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
    request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
    request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
    request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
    IOReturn err = (*_device)->CreateInterfaceIterator(_device, &request, iterator);
    if (err != kIOReturnSuccess) {
        NSLog(@"Error: 0x%08x at %s, line %d", err, __PRETTY_FUNCTION__, __LINE__);
    }
    return err;
}

/// MARK: - advanced

- (IOReturn)deviceRequestWithRequestType:(UInt8)bmRequestType request:(UInt8)bRequest value:(UInt16)wValue index:(UInt16)wIndex length:(UInt16)wLength data:(void *)pData {
    return [self deviceRequest:(IOUSBDevRequest){ bmRequestType, bRequest, wValue, wIndex, wLength, pData }];
}

- (IOReturn)deviceRequest:(IOUSBDevRequest)request {
    IOReturn err = (*_device)->DeviceRequest(_device, &request);
    if (err != kIOReturnSuccess) {
        return err;
    }
    // TODO: compare request.wLength and request.wLenDone
    return kIOReturnSuccess;
}

- (BOOL)deviceRequest:(IOUSBDevRequest *)request error:(NSError **)error {
    IOReturn err = (*_device)->DeviceRequest(_device, request);
    if (err != kIOReturnSuccess) {
        *error = [NSError BBBUSBKitErrorWithIOReturnError:err];
        return false;
    }
    return true;
}

- (NSString *)getStringDescriptorAtIndex:(UInt8)index error:(NSError **)error {
    UInt8 temp[2];
    IOUSBDevRequest request;
    request.bmRequestType = USBmakebmRequestType(kUSBIn, kUSBStandard, kUSBDevice);
    request.bRequest = kUSBRqGetDescriptor;
    request.wValue = (kUSBStringDesc << 8) | index;
    request.wIndex = 0;
    request.wLength = 2;
    request.pData = &temp;
    if (![self deviceRequest:&request error:error]) {
        return false;
    }

    UInt8 string[temp[0]];
    request.wLength = temp[0];
    request.pData = &string;
    if (![self deviceRequest:&request error:error]) {
        return false;
    }

    return [[NSString alloc] initWithBytes:&string[2] length:string[0] - 2 encoding:NSUTF16LittleEndianStringEncoding];
}

@end


text:
import mock
import os
from django.contrib.auth import get_user_model
from django.test.client import Client
from django.core.urlresolvers import reverse
from favit.models import Favorite
from firecares.firecares_core.tests.base import BaseFirecaresTestcase
from firecares.firestation.models import FireDepartment, FireStation

User = get_user_model()

class TestFavorites(BaseFirecaresTestcase):
    @mock.patch('geopy.geocoders.base.urllib_urlopen')
    def test_favorite_stations_list_view(self, urllib_urlopen):
        """
        Tests the favorite stations list view.
        """

        c = urllib_urlopen.return_value
        c.read.return_value = open(os.path.join(os.path.dirname(__file__), 'mock/geocode.json')).read()
        c.headers.getparam.return_value = 'utf-8'

        fd = FireDepartment.objects.create(name='Fire Department 1')

        fs1 = FireStation.create_station(department=fd, address_string='1', name='Fire Station 1')
        fs2 = FireStation.create_station(department=fd, address_string='1', name='Fire Station 2')
        fs3 = FireStation.create_station(department=fd, address_string='1', name='Fire Station 3')
        # add these stations as favorites and remove the last one
        user = User.objects.get(username='admin')
        Favorite.objects.create(user, fs1)
        Favorite.objects.create(user, fs2)
        fav = Favorite.objects.create(user, fs3)
        fav.delete()

        c = Client()
        c.login(**{'username': 'admin', 'password': 'admin'})

        response = c.get(reverse('firestation_favorite_list'))
        self.assertTrue(fs1 in response.context['object_list'])
        self.assertTrue(fs2 in response.context['object_list'])
        self.assertTrue(fs3 not in response.context['object_list'])
        self.assertEqual(response.status_code, 200)

    def test_favorite_departments_list_view(self):
        """
        Tests the favorite departments list view.
        """
        fd1 = FireDepartment.objects.create(name='Fire Department 1')
        fd2 = FireDepartment.objects.create(name='Fire Department 2')
        fd3 = FireDepartment.objects.create(name='Fire Department 3')
        # add these departments as favorites and remove the last one
        user = User.objects.get(username='admin')
        Favorite.objects.create(user, fd1)
        Favorite.objects.create(user, fd2)
        fav = Favorite.objects.create(user, fd3)
        fav.delete()

        c = Client()
        c.login(**{'username': 'admin', 'password': 'admin'})

        response = c.get(reverse('firedepartment_list') + '?favorites=true')
        self.assertTrue(fd1 in response.context['object_list'])
        self.assertTrue(fd2 in response.context['object_list'])
        self.assertTrue(fd3 not in response.context['object_list'])
        self.assertEqual(response.status_code, 200)

        c.logout()

        try:
            response = c.get(reverse('firedepartment_list') + '?favorites=true')
        except:
            self.fail('Logged-out user triggering favorites search should not throw exception')


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>MyPhotobooth | Settings</title>

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

  <link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">

  <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css">

  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">

          MyPhotobooth
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">

          </button>

                  Alexander Pierce

                    Alexander Pierce

                    Settings

                    Sign out

            Settings

Profile Details

              <button type="button" class="btn btn-default pull-right" ng-hide="editing" ng-click="editing=true"> Edit</button>

Nombre

Alexander Pierce

Email

alexander.pierce@example.com

Password

*********

Phone Number:

(787)-567-9928

<form class="form-horizontal" ng-show="editing">

                  Nombre

                    <input type="text" class="form-control" id="inputEmail3" value="Alexander Pierce" >

                  Email

                    <input type="text" class="form-control" id="inputPassword3" value="alexander.pierce@example.com" >

                  Event Location

                    <input type="text" class="form-control" id="inputPassword3" value="Centro de convenciones" >

                      Password

                    <input type="password" class="form-control" id="inputPassword3">

                      Re-type Password

                    <input type="password" class="form-control" id="inputPassword3">

                  Phone Number:

                    <input type="text" class="form-control" id="inputEmail3" value="(787)-567-9928" >

                <button type="submit" ng-click="editing=false" class="btn btn-default">Cancel</button>
                <button type="submit" data-toggle="modal" data-target="#modal-default" class="btn btn-info pull-right">Save Changes</button>

            </form>

                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  ×</button>

Save Changes

                <form class="form-horizontal">

Are you sure you want to make these changes?

                </form>

                <button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="editing=false">Save Changes</button>


text:
<?php

App::uses('CakeEventListener', 'Event');
App::uses('Translations', 'Translate.Lib');

/**
 * TranslateEventHandler
 *
 * @package  Croogo.Translate.Event
 * @author   Rachman Chavik <rchavik@gmail.com>
 * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
 * @link     http://www.croogo.org
 */
class TranslateEventHandler implements CakeEventListener {

	public function implementedEvents() {
		return array(
			'Croogo.bootstrapComplete' => array(
				'callable' => 'onCroogoBootstrapComplete',
			),
		);
	}

	public function onCroogoBootstrapComplete($event) {
		Translations::translateModels();
	}

}


text:
set -e
set -x
export DEBIAN_FRONTEND=noninteractive

GHQ_ROOT=$HOME/go/src
DATA_ROOT=$HOME/tdiary

##
## git clone tdiary-xxx
##
mkdir -p $GHQ_ROOT/github.com/tdiary/
for repo in tdiary-core \
            tdiary-contrib \
            tdiary-blogkit \
            tdiary-cache-redis \
            tdiary-cache-memcached \
            tdiary-cache-null \
            tdiary-io-mongodb \
            tdiary-io-rdb \
            tdiary-theme \
            tdiary-theme-nonfree \
            tdiary-style-emptdiary \
            tdiary-style-etdiary \
            tdiary-style-gfm \
            tdiary-style-rd \
; do
  git clone https://github.com/tdiary/${repo}.git $GHQ_ROOT/github.com/tdiary/${repo}
done

## run bundle install
cd $GHQ_ROOT/github.com/tdiary/tdiary-core
mkdir -p vendor/bundle
bash -l -c "bundle config set --local path vendor/bundle"
bash -l -c "bundle install --jobs=4"

## add Gemfile.local
install -m 644 -p /tmp/build/tdiary/$GHQ_ROOT/github.com/tdiary/tdiary-core/Gemfile.local $GHQ_ROOT/github.com/tdiary/tdiary-core/Gemfile.local

## run bundle install again
bash -l -c "bundle lock --update faraday octokit"
bash -l -c "bundle install"
bash -l -c "bundle clean"

## show diff
GIT_PAGER= git diff Gemfile.lock

##
## tdiary data
##
mkdir -p $DATA_ROOT/data

## add .htpasswd (user=debian, password=debian)
install -m 600 -p /tmp/build/tdiary/$DATA_ROOT/.htpasswd    $DATA_ROOT/.htpasswd

## add tdiary.conf, start.sh
install -m 644 -p /tmp/build/tdiary/$DATA_ROOT/tdiary.conf  $DATA_ROOT/tdiary.conf
install -m 755 -p /tmp/build/tdiary/$DATA_ROOT/start.sh     $DATA_ROOT/start.sh

## symlink .htpasswd, tdiary.conf into tdiary-core
cd $GHQ_ROOT/github.com/tdiary/tdiary-core
ln -s $DATA_ROOT/.htpasswd $DATA_ROOT/tdiary.conf .


text:
(function (angular) {
  'use strict';

  angular.module('myApp.projects', ['ngRoute'])

    .config(['$routeProvider', function ($routeProvider) {
      $routeProvider.when('/projects', {
        templateUrl: 'app/components/projects/projects.html',
        controller: 'View1Ctrl'
      });
    }])

    .controller('View1Ctrl', [function () {
      this.projectList1 = [
        {title: 'Heading', content: 'Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. '+
          'Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, ' +
          'vestibulum at eros. Praesent commodo cursus magna.', link: '#', image: 'assets/images/projects/1.png'},
        {title: 'Virtual StrongBox', content: 'Virtual StrongBox's patented encryption-at-rest data security & ' +
          'file exchange solution is regulatory compliant and allows financial institutions to transition to the cloud. ' +
          'We provide the security and technology required to connect banking legacy technology and workflows to ' +
          'the consumer and their technology, reducing the workflow burden and achieving cloud-cost benefits..',
          link: '#', image: 'assets/images/projects/2.png'},
        {title: 'Heading', content: 'Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. '+
          'Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, ' +
          'vestibulum at eros. Praesent commodo cursus magna.', link: '#', image: 'assets/images/projects/3.png'}
      ];
      this.projectList2 = [
        {title: 'LeefLet', subTitle: 'Save the Trees, Empower the Branches.',
          content: 'With a few, non-sensitive pieces of consumer information (name and email), ' +
          'an electronic brochure is automatically sent to the consumer with information related to their specific needs. ' +
          'No brochures to carry, none to print – just the info they've requested.', link: '#',
          image: 'assets/images/projects/4.png'},
        {title: "Oh yeah, it's that good.", subTitle: 'See for yourself.',
          content: 'Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. ' +
          'Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.', link: '#',
          image: 'assets/images/projects/5.png'},
        {title: 'And lastly, this one.', subTitle: 'Checkmate.',
          content: 'With a few, non-sensitive pieces of consumer information (name and email), ' +
          'an electronic brochure is automatically sent to the consumer with information related to their specific needs. ' +
          'No brochures to carry, none to print – just the info they've requested.', link: '#',
          image: 'assets/images/projects/6.png'}
      ];
    }]);
}(angular));


text:
#ifndef ANDROID_GUI_ISENSORSERVER_H
#define ANDROID_GUI_ISENSORSERVER_H

#include <stdint.h>
#include <sys/types.h>

#include <utils/Errors.h>
#include <utils/RefBase.h>

#include <binder/IInterface.h>

namespace android {
// ----------------------------------------------------------------------------

class Sensor;
class ISensorEventConnection;

class ISensorServer : public IInterface
{
public:
    DECLARE_META_INTERFACE(SensorServer);

    virtual Vector<Sensor> getSensorList() = 0;
    virtual sp<ISensorEventConnection> createSensorEventConnection() = 0;
};

// ----------------------------------------------------------------------------

class BnSensorServer : public BnInterface<ISensorServer>
{
public:
    virtual status_t    onTransact( uint32_t code,
                                    const Parcel& data,
                                    Parcel* reply,
                                    uint32_t flags = 0);
};

// ----------------------------------------------------------------------------
}; // namespace android

#endif // ANDROID_GUI_ISENSORSERVER_H


text:
package org.wso2.carbon.event.core.sharedmemory;

import org.wso2.carbon.event.core.delivery.MatchingManagerFactory;
import org.wso2.carbon.event.core.delivery.MatchingManager;
import org.wso2.carbon.event.core.exception.EventBrokerException;
import org.wso2.carbon.event.core.exception.EventBrokerConfigurationException;
import org.apache.axiom.om.OMElement;
import org.wso2.carbon.event.core.sharedmemory.util.SharedMemoryCacheUtil;

import javax.cache.Cache;

@Deprecated
public class SharedMemoryMatchingManagerFactory implements MatchingManagerFactory {

	private static Cache<Integer, SharedMemoryMatchingManager> getInMemoryMatchingCache() {
        return SharedMemoryCacheUtil.getInMemoryMatchingCache();
    }

    public MatchingManager getMatchingManager(OMElement config) throws EventBrokerConfigurationException {
        SharedMemoryMatchingManager inMemoryMatchingManager = null ;

        if(getInMemoryMatchingCache().get(1) == null) {
            inMemoryMatchingManager = new SharedMemoryMatchingManager();
            getInMemoryMatchingCache().put(1, inMemoryMatchingManager);
        }

        try {
            //call initialize tenant for super tenant
            inMemoryMatchingManager.initializeTenant();
        } catch (EventBrokerException e) {
            throw new EventBrokerConfigurationException("Can not initialize the in memory mathing manager",e);
        }
        return inMemoryMatchingManager;
    }
}


text:
/*
 * decaffeinate suggestions:
 * DS102: Remove unnecessary code created because of implicit returns
 * DS207: Consider shorter variations of null checks
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
const sinon = require("sinon")
const Inquiry = require("../../models/inquiry")
const { fabricate } = require("@artsy/antigravity")

describe("Inquiry", function () {
  beforeEach(function () {
    return (this.inquiry = new Inquiry(fabricate("artwork_inquiry_request")))
  })

  return describe("#validate", function () {
    it("ensures a name and email for inquiries with a session", function () {
      this.inquiry.set({ session_id: "foobar", name: null })
      return this.inquiry
        .validate(this.inquiry.toJSON())
        .should.containEql("Please include a valid name")
    })

    it("allows valid emails and names", function () {
      this.inquiry.set({
        session_id: "foobar",
        name: "Craig",
        email: "craigspaeth@gmail.com",
      })
      return (
        this.inquiry.validate(this.inquiry.toJSON()) != null
      ).should.not.be.ok()
    })

    return it("doesnt complain about trailing/leading whitespace", function () {
      this.inquiry.set({
        session_id: "foobar",
        name: "Craig",
        email: "craigspaeth@gmail.com ",
      })
      return (
        this.inquiry.validate(this.inquiry.toJSON()) != null
      ).should.not.be.ok()
    })
  })
})


text:
  LIVE

KICKICO

     1 = 3 000KC
    prix ICO

    + BONUS KC
    For 2 ETH or more

  On accepte les deux

  et

   KICKICO adresse officielle pour contrat crowdsale:
    0x3AA5FA4FBF18d19548680a5f2BbA061b18Fed26b

            ATTENTION!

N´envoyez pas ETH à partir des échanges - vous ne serez plus capable de recevoir KickCoins.

Envoyez votre ETH à partir d'une adresse avec accés complet (y inclus votre clé privée).

 1. Montant minimal est de 0,05 ETH;

 2. Régler GAS 300 000 (les GAS non utilisés vous seront
retournés)

 3. Comment participer - si vous ne savez pas comment acheter la
crypto-monnaie;

 KICKICO — Crowdfunding (Financement communautaire) 2.0

 KICKICO est la première plateforme opérationnelle de financement
Blockchain qui offre des solutions compréhensive pour les ICO, le
financement communautaire et le Crowdinvesting.

On remplace les plateformes traditionnelles de Crowdfunding et leurs
problèmes: Documentation, commisions élevées et limitations
géographiques pour certains participants.

Notre mission consiste à assister les innovateurs, développeurs de
jeux vidéo, entrepreneurs, concepteurs et autre créateurs à
perspectives à long terme pour mettre en réalité leurs idées,
indépendamment de leurs endroit, origine et statut économique.

On a déjà commencé à travailler en mode opérationnel. On a plus de
300 campagnes et on reçoît plus de 15 projets chaque jour au niveau
mondial et de la part de différentes secteurs de l'industrie.

Notre ICO est lancé sur notre propre plateforme puisque celle-ci est
déjà opérationnelle.

On va utiliser le succés et la promotion de notre propre ICO pour
entrer comme consultant pour les campagnes de nos clients dans le
future.

KickCoin: Une devise solide et pas seulement un
jeton.

KickCoin est une devise virtuelle qui sera acceptée et utilisée par
les projets qui étaient lancés à partir de notre plateforme (comme par
tous nos partenaires), et aprés, aussi acceptée comme méthode de
payement. KC sera principalement utilisée comme méthode de payement sur
notre plateforme.

Le concept de KickCoin à été développé en partenariat avec nos
consultants:

  Roel
Wolfert

  Edgar
Kampers

  Scott
Morris

On attend le taux de croissance suivant pour le
KickCoin

Puisque KICKICO prend la moitié de la commission des campagnes d'ICO
sur leurs jetons, la croissance positive de cettes crypto-devises
affecte le portfolio de la plateforme en entier et, ainsi, supporte
indirectement la valeur de KC.

De plus, la valeur des jetons de KickCoin sera aussi supportée par
la création d'un fond symbolique: KICKICO prend 4% des jetons ou
crypto-devise produits par une campagne ICO et la dépose dans le fond.
Ce dernier va appuyer la valeur des jetons KC, dans le temps où des
projets; qui ont été lancés par l'intermédiaire de KICKICO, augmentent
en valeur.

KickCoin déclenche le protocol Bancor et, étant un ''jeton
intelligent'', possédera des réserves qui le rend liquide dans le
réseau Bancor.

KickCoin sera aussi un réseau symbolique pour tous les projets qui
collectent des fonds sur la plateforme KICKICO. Ceci implique que la
valeur du KickCoin sera supportée par tous les jetons des projets
KICKICO, qui constituent des réserves dans le réseau Bancor. Ceci créa
une occasion d'arbitrage pour augmenter la valeur de KickCoin dans les
bourses.

Ce modèle économique s'appelle la KICKONOMY.

Pendant les deux premières années aprés l'ICO, on va creér une
émission bonus limitée pour récompenser les membres de notre communauté
qui maintenaient les KickCoins. Les bonus seront crédités le dernier
jour de chaque mois. Chacun en possesion de KC aura automatiquement des
KC de plus le dernier jour de chaque mois. Des émissions bonus seront
actives durant 2 années. Le pourcentage est différent pour chaque mois:
3%, 2%, 1%, 2%, 3%, 5% etc.

% de bonus crédité aux titulaires de
KickCoin par mois

KickCoin sera classé au top des crypto-bourses.

Voir 10 de plus

Montrer moins

Grâce à notre partenariat stratégique avec Coinhill's (Corée), on
est en phase de négotiation avec les top bourses coréennes.

Termes ICO

On possédera bonus pendant l'ICO: et Bonus
Montant Payement

Bonus Montant Payement

Plus vous payez avec une seule transaction, plus le % bonus de
KickCoins vous recevrez. Le système Tier est ci-dessus:

Plus que, ETH

KickCoins additionnels, %

 3000,00

 2000,00

 1500,00

 1000,00

 750,00

 500,00

 300,00

 200,00

 150,00

 100,00

 75,00

 50,00

 +13,0% 3390

 +12,0% 3360

 +11,0% 3330

 +10,0% 3300

 +9,0% 3270

 +8,0% 3240

 +7,5% 3225

 +7,0% 3210

 +6,0% 3180

 +5,5% 3165

 +5,0% 3150

 +4,5% 3135

Plus que, ETH

KickCoins additionnels, %

 30,00

 20,00

 15,00

 10,00

 7,00

 5,00

 3,00

 2,00

 1,00

 0,50

 0,20

 0,10

 +4,0% 3120

 +3.5% 3105

 +3,0% 3090

 +2.5% 3075

 +2,0% 3060

 +1,5% 3045

 +1,0% 3030

 +0,5% 3015

 0,0% 3000

 0,0% 3000

 0,0% 3000

 0,0% 3000

Tier et Bonus sont comptés séparemment du prix
de base 1 ETH = 3000 KC. Par exemple, pour une contribution de 100 ETH
dans une période inférieure à 10% de l'objectif, le prix final pour KC
sera: 1 ETH = 3765 KC (3000 + 3000*5.5% + 3000*20%).

Le problème initial de KickCoins est programmé par un
contrat intelligent et sera réparti.

Loterie

Aprés l'ICO, on va mener une loterie entre tous les participants
ayant contribués plus aue 10 Ether, ou équivalent en Bitcoins. Les
bonus seront répartis dans les proportions suivantes:

 Prix

 Distribution

 Prix, KC

 1

 2

 3

 4

 5

 6

 7

 8

 9

 10

 30%

 20%

 10%

 9%

 8%

 7%

 6%

 5%

 2,5%

 2,5%

 300,000

 200,000

 100,000

 90,000

 80,000

 70,000

 60,000

 50,000

 25,000

 25,000

On est légaux et conformes

Selon l'avis juridique de nos consultants légaux, basé sur le test
Howey, applicable sur des cas similaires, les KickCoins ne doivent pas
être jugés comme titres et il n'est pas nécessaire de les déclarer
comme titre.

KICKICO se focalise sur la régulation législative de ICO; jetons
digitals et opérations avec crypto-devises pour fournir nos solutions
sécurisées et fiables Crowdfunding 2.0 à nos utilisateurs et
contributeurs .

Rapports et évaluations

5.0 (Record maximal)

Positive

Feuille de route

 Marché Crowdsourcing et Analyse globale

 Développement d'architecture projet

 Prototypage

 Financement de démarrage reçu

Développement de plateforme

 Première vision Blockchain

 KICKICO Version Alpha

 Analyse de risques Blockchain terminée avec succés

Intégration de la plateforme avec Blockchain

 Lancement de la version Beta de Blockchain

 Annoncement publique du livre blanc

Déploiement des contrats intelligents

Audit de contrat intelligent

 Premiers créateurs ajoutent leurs projets

 Pré-ICO atteint, avec succés, le plafond de 5000 Ethereum

 ICO

Démarrage publique de KICKICO

 Développement de l'infrastructure

 Attraction de créateurs de projets

 Développement de la communauté

 Premiers projets faisant partie de KICKONOMY

 Démarrage du programme de support

 Cryptocrowdfunding Robot de discussion ver
1.0

 Intégration de Salesforce CRM

 Lancement de la communauté des Crowdfunders

 Partage de widgets

 Démarrage SDEX

Démarrage du système de récompense

 Kit visuel des contrats intelligents

Marché

 Enquête UX

 Programme de loyauté pour mécanismes de ludification

Localisation

 Evénements hors ligne pour la communauté du Crowdfunding

 Lancement de l'académie pour le Cryptocrowdfunding

 Développement d'application pour Android
& iOS

 Intégration avec plateformes additionnelles à partir
d'écosystèmes Ethereum

 Fond de Crowdfunding Blockchain lancé

 Système de payement (API) KICKCOIN pour intégration aisée
dans des applications ou plateformes indépendantes

 Développement des communautés de créateurs locaux et
bailleurs

 Développement boîte à outils de la plateforme:
consultation, marketing, support juridique

 Publication des applications mobiles

Intégration sur Smart appareils (Blockchain des chose)

 API pour campagnes autonomes de crowdfunding

 Compte Buisness pour toute pénétration dans le marketing
et la consultation projets

 Equipe

Anti A. Danilevski

Fondateur et PDG

Alexander Petrov

Co-Fondateur et Directeur financier

Andrew Perepelitsa

Co-Fondateur et Directeur
technique

Dmitry Raskladka

Développement Buisness

Verdandi Cao

Concepteur principal

Yury Parsamov

Directeur des partenariats stratégiques

 TOUTE
L'EQUIPE

Joignez nos discussions!

Contactez-nous si vous avez des questions.

Notre support rapide et convivial est disponisble 24/7.

 Groupe Telegram

 Agent Support Telegram

 Facebook

 Twitter

Vous pouvez aussi lire notre FAQ


text:
class PasswordResetsController < ApplicationController
  layout 'home'
  before_filter :require_no_logined
  after_filter :inc_ip_count, :only => :create
  helper_method :require_recaptcha?

  def new
  end

  def create
    if !require_recaptcha? || verify_recaptcha(:model => @user)
      @user = User.where(:email => /^#{Regexp.escape params[:email]}$/i).first
      if @user
        @user.generate_password_reset_token
        SystemMailer.delay.password_reset(@user.id.to_s)
        flash[:info] = I18n.t(:password_reset_email_send)
      else
        flash[:error] = I18n.t(:password_reset_email_no_found)
      end
    else
      flash[:error] = I18n.t('recaptcha.errors.verification_failed')
    end
  end

  def edit
    @user = User.where(:password_reset_token => params[:id]).first

    if @user && @user.password_reset_token_created_at > 2.hours.ago
      @user.in_password_reset = true
      render :edit
    else
      flash[:error] = I18n.t(:password_reset_not_found_or_expired)
      redirect_to new_password_reset_url
    end
  end

  def update
    @user = User.find_by(:password_reset_token => params[:id])
    @user.in_password_reset = true
    if @user.update_attributes params.require(:user).permit(:password, :password_confirmation)
      @user.unset_password_reset_token
      flash[:success] = I18n.t(:password_reset_success)
    end
  end

  private

  def inc_ip_count
    Rails.cache.write "password_reset_count/#{request.remote_ip}", ip_count + 1, :expires_in => 60.seconds
  end

  def ip_count
    Rails.cache.read("password_reset_count/#{request.remote_ip}").to_i
  end

  def require_recaptcha?
    ip_count >= 3
  end
end


text:
This file documents all notable changes to this project.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [1.0.0] 2015-12-13

### Changed

Moved the fix for brettle/meteor-accounts-deluxe#1 (Red text error message when adding password account) into optional `brettle:accounts-patch-ui` package which patches the `accounts-ui` package and the `useraccounts` suite to workaround the problem.

## [0.3.5] 2015-11-13

### Fixed

Bug #1: Existing account without resume service deleted if logged in user logs
into it. For details, see the [Notes section of README.md](README.md#notes)

## [0.3.4] 2015-11-09

### Fixed

Bug #3: Missing email expiration tokens

## [0.3.3] 2015-09-26

### Fixed

Support Meteor 1.2.

## [0.3.2] 2015-09-26

### Fixed

Support Meteor 1.2.

## [0.3.1] 2015-09-07

### Fixed

Bug brettle/meteor-accounts-deluxe#1: Red text error message when using
`accounts-ui` to add password account.

## 0.3.0 2015-08-17

### Changed

Worked around meteor/meteor#4331 and moved all workarounds to their own
packages.

### Added

Support Meteor 1.0.4 or later.

[Unreleased]: https://github.com/brettle/meteor-accounts-add-service/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/brettle/meteor-accounts-add-service/compare/v0.3.5...v1.0.0
[0.3.5]: https://github.com/brettle/meteor-accounts-add-service/compare/v0.3.4...v0.3.5
[0.3.4]: https://github.com/brettle/meteor-accounts-add-service/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/brettle/meteor-accounts-add-service/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/brettle/meteor-accounts-add-service/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/brettle/meteor-accounts-add-service/compare/v0.3.0...v0.3.1


text:
.class final Landroid/app/assist/AssistStructure$ViewStackEntry;
.super Ljava/lang/Object;
.source "AssistStructure.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/app/assist/AssistStructure;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "ViewStackEntry"
.end annotation

# instance fields
.field curChild:I

.field node:Landroid/app/assist/AssistStructure$ViewNode;

.field numChildren:I

# direct methods
.method constructor <init>()V
    .locals 0

    .prologue
    .line 98
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>org.jsonschema2pojo</groupId>
    <artifactId>jsonschema2pojo</artifactId>
    <version>0.4.36-SNAPSHOT</version>

    <packaging>pom</packaging>
    <name>jsonschema2pojo</name>
    <description>Generate DTO style Java classes from JSON Schema documents</description>
    <url>https://github.com/joelittlejohn/jsonschema2pojo</url>

    <modules>
        <module>jsonschema2pojo-ant</module>
        <module>jsonschema2pojo-cli</module>
        <module>jsonschema2pojo-core</module>
        <module>jsonschema2pojo-gradle-plugin</module>
        <module>jsonschema2pojo-maven-plugin</module>
        <module>jsonschema2pojo-integration-tests</module>
    </modules>

    <developers>
        <developer>
            <name>Joe Littlejohn</name>
            <email>joe.littlejohn@gmail.com</email>
            <organization>Nokia MixRadio</organization>
            <organizationUrl>http://mixrad.io</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/joelittlejohn/jsonschema2pojo</url>
        <connection>scm:git:git@github.com:joelittlejohn/jsonschema2pojo.git</connection>
        <developerConnection>scm:git:git@github.com:joelittlejohn/jsonschema2pojo.git</developerConnection>
    </scm>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <groovy.version>1.8.6</groovy.version>
        <gradle.version>1.6</gradle.version>
        <gson.version>2.5</gson.version>
        <moshi.version>1.1.0</moshi.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.mycila.maven-license-plugin</groupId>
                                        <artifactId>maven-license-plugin</artifactId>
                                        <versionRange>[0.0,)</versionRange>
                                        <goals>
                                             <goal>format</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[0.0,)</versionRange>
                                        <goals>
                                            <goal>copy-dependencies</goal>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-compiler-plugin</artifactId>
                                        <versionRange>[3.0,)</versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                            <goal>testCompile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-enforcer-plugin</artifactId>
                                        <versionRange>[0.0,)</versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>

                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>1.8.0</version>
                <configuration>
                    <aggregate>true</aggregate>
                    <encoding>UTF-8</encoding>
                    <excludes>
                        <exclude>**/src/main/java/org/jsonschema2pojo/util/Inflector.java</exclude>
                    </excludes>
                    <failIfMissing>true</failIfMissing>
                    <header>NOTICE</header>
                    <includes>
                        <include>**/src/main/java/**</include>
                        <include>**/src/test/java/**</include>
                    </includes>
                    <skipExistingHeaders>true</skipExistingHeaders>
                    <strictCheck>true</strictCheck>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.6</source>
                    <target>1.6</target>
                    <testSource>1.7</testSource>
                    <testTarget>1.7</testTarget>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <!-- http://jira.codehaus.org/browse/MGPG-9 -->
                    <mavenExecutorId>forked-path</mavenExecutorId>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>aggregate-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.1.2</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <!-- Allows Findbugs annotations in submodules to suppress inaccurate warnings.-->
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
            <version>1.3.9</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.beust</groupId>
                <artifactId>jcommander</artifactId>
                <version>1.30</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.7.2</version>
            </dependency>
            <dependency>
                <groupId>com.github.stefanbirkner</groupId>
                <artifactId>system-rules</artifactId>
                <version>1.16.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.android</groupId>
                <artifactId>android</artifactId>
                <version>4.1.1.4</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.1</version>
            </dependency>

            <dependency>
                <groupId>com.squareup.moshi</groupId>
                <artifactId>moshi</artifactId>
                <version>${moshi.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.javaparser</groupId>
                <artifactId>javaparser</artifactId>
                <version>1.0.11</version>
            </dependency>
            <dependency>
                <groupId>com.sun.codemodel</groupId>
                <artifactId>codemodel</artifactId>
                <version>2.6</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.9</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.6</version>
            </dependency>
            <dependency>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                <version>1.0.0.GA</version>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.2</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.11</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>1.7.24</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.github.tomakehurst</groupId>
                <artifactId>wiremock</artifactId>
                <version>2.5.1</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <artifactId>slf4j-api</artifactId>
                        <groupId>org.slf4j</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>jackson-core</artifactId>
                        <groupId>com.fasterxml.jackson.core</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>jackson-annotations</artifactId>
                        <groupId>com.fasterxml.jackson.core</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant</artifactId>
                <version>1.8.4</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.2.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>2.2.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-project</artifactId>
                <version>2.2.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.shared</groupId>
                <artifactId>maven-shared-utils</artifactId>
                <version>0.6</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-mapper-asl</artifactId>
                <version>1.9.13</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jdt.core.compiler</groupId>
                <artifactId>ecj</artifactId>
                <version>4.4.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>4.3.0.Final</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.9.5</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>qdox</groupId>
                <artifactId>qdox</artifactId>
                <version>1.6.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
               <groupId>org.robolectric</groupId>
               <artifactId>robolectric</artifactId>
               <version>2.2</version>
               <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.skyscreamer</groupId>
                <artifactId>jsonassert</artifactId>
                <version>1.1.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>maven-central</id>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <id>gradle-workaround</id>
            <url>http://repo.spring.io/plugins-release</url>
            <snapshots>
              <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

</project>


text:
package org.apache.sling.commons.metrics;

import aQute.bnd.annotation.ProviderType;

/**
 * A meter metric which measures mean throughput
 */
@ProviderType
public interface Meter extends Counting, Metric{
    /**
     * Mark the occurrence of an event.
     */
    void mark();

    /**
     * Mark the occurrence of a given number of events.
     *
     * @param n the number of events
     */
    void mark(long n);
}


text:
class StoreController < ApplicationController
  def index
    @products = Product.order(:title)

    if (:in_stock).nil?
     flash[:notice] = "No Product in Stock"
    else
     flash[:notice] = "Store in Stock"
    end

    if (:online).nil?
      flash[:notice] = "Online Stock Sold Out"
    else
      flash[:notice] = "Online Stock Available"
    end

    #this is the landing (home) page. When the user visits, we want to remember when he/she visited
    session[:index]=Time.now.to_s

  end

  def last
    @time=session[:index]
  end

end


text:
"""
This converts a binary imagge to an object file
"""
from __future__ import print_function
import subprocess
import argparse
import re
from subprocess import PIPE

# pylint: disable=invalid-name
parser = argparse.ArgumentParser(description='Convert bin to obj.')
parser.add_argument('--c_flags', required=True)
parser.add_argument('--c_compiler', required=True)
parser.add_argument('--include_path', required=True)
parser.add_argument('--nm', required=True)
parser.add_argument('--ld', required=True)
parser.add_argument('--objcopy', required=True)
parser.add_argument('--bin', required=True)
parser.add_argument('--obj', required=True)
parser.add_argument('--var', required=True)
args = parser.parse_args()

in_bin = args.bin
c_flags = args.c_flags
c_compiler = args.c_compiler
include_path = args.include_path
nm = args.nm
ld = args.ld
obj = args.obj
var = args.var
objcopy = args.objcopy

sym = "_binary_" + in_bin.replace('/', '_').replace('.', '_').replace('-', '_')
# print("sym: ", sym)

# write empty file
with open('{obj:s}.c'.format(**locals()), 'w') as f:
    f.write("")

def run_cmd(cmd, d):
    cmd = cmd.format(**d)
    # print(cmd)
    proc = subprocess.Popen(cmd.split(), stdout=PIPE, stderr=PIPE)
    stdout, stderr = proc.communicate()
    if stderr.decode() != "":
        raise RuntimeError(stderr)
    return stdout

# do compile
run_cmd("{c_compiler:s} -I{include_path:s} {c_flags:s} -c {obj:s}.c -o {obj:s}.c.o",
        locals())

# link
run_cmd("{ld:s} -r -o {obj:s}.bin.o {obj:s}.c.o -b binary {in_bin:s}",
        locals())

# get size of image
stdout = run_cmd("{nm:s} -p --radix=x {obj:s}.bin.o", locals())
re_string = r"^([0-9A-Fa-f]+) .*{sym:s}_size".format(**locals())
re_size = re.compile(re_string, re.MULTILINE)
size_match = re.search(re_size, stdout.decode())

try:
    size = size_match.group(1)
except AttributeError as e:
    raise RuntimeError("{:s}\nre:{:s}\n{:s}".format(
        e, re_string, stdout))
except IndexError as e:
    group0 = size_match.group(0)
    raise RuntimeError("{:s}\ngroup 0:{:s}\n{:s}".format(
        e, group0, stdout))

# print("romfs size: ", size)

# write size to file
with open('{obj:s}.c'.format(**locals()), 'w') as f:
    f.write("const unsigned int {var:s}_len = 0x{size:s};".format(
        **locals()))

# do compile
run_cmd("{c_compiler:s} -I{include_path:s} {c_flags:s} -c {obj:s}.c -o {obj:s}.c.o",
        locals())

# link
run_cmd("{ld:s} -r -o {obj:s} {obj:s}.c.o {obj:s}.bin.o",
        locals())

# obj copy
run_cmd("""
{objcopy:s} {obj:s}
    --redefine-sym {sym:s}_start={var:s}
    --strip-symbol {sym:s}_size
    --strip-symbol {sym:s}_end
    --rename-section .data=.rodata
""", locals())

# vim: set et ft=python fenc= ff=unix sts=4 sw=4 ts=4 :


text:
class AddMetadataToDelayedJobs < ActiveRecord::Migration
  def self.up
    add_column :delayed_jobs, :metadata, :text
  end

  def self.down
    remove_column :delayed_jobs, :metadata
  end
end


text:
/** @namespace */
de.benshu.stringifyable.predicates = {};

/** @type {de.benshu.stringifyable.predicates.Predicate<*>} */
de.benshu.stringifyable.predicates.alwaysTrue;

/** @type {de.benshu.stringifyable.predicates.Predicate<*>} */
de.benshu.stringifyable.predicates.alwaysFalse;

/**
 * @template T
 *
 * @param {Array<de.benshu.stringifyable.predicates.Predicate<T>>} components
 * @returns de.benshu.stringifyable.predicates.Predicate<T>
 */
de.benshu.stringifyable.predicates.and = function (components) {};

/**
 * @template T
 *
 * @param {function(T):boolean} predicate
 * @returns de.benshu.stringifyable.predicates.Predicate<T>
 */
de.benshu.stringifyable.predicates.from;

/**
 * @template T
 *
 * @param {Array<de.benshu.stringifyable.predicates.Predicate<T>>} components
 * @returns de.benshu.stringifyable.predicates.Predicate<T>
 */
de.benshu.stringifyable.predicates.or = function (components) {};

/**
 * @param {RegExp} regularExpression
 * @returns de.benshu.stringifyable.predicates.Predicate<string>
 */
de.benshu.stringifyable.predicates.regularExpression = function (regularExpression) {};