text:
<?php

namespace Topxia\Service\User\Dao\Impl;

use Topxia\Service\Common\BaseDao;
use Topxia\Service\User\Dao\UserDao;
use Topxia\Common\DaoException;
use PDO;

class UserDaoImpl extends BaseDao implements UserDao
{
    protected $table = 'user';

    public function getUser($id, $lock = false)
    {
        $sql = "SELECT * FROM {$this->table} WHERE id = ? LIMIT 1";
        if ($lock) {
            $sql .= " FOR UPDATE";
        }
        return $this->getConnection()->fetchAssoc($sql, array($id)) ? : null;
    }

    public function findUserByEmail($email)
    {
        $sql = "SELECT * FROM {$this->table} WHERE email = ? LIMIT 1";
        return $this->getConnection()->fetchAssoc($sql, array($email));
    }

    public function findUserByNickname($nickname)
    {
        $sql = "SELECT * FROM {$this->table} WHERE nickname = ? LIMIT 1";
        return $this->getConnection()->fetchAssoc($sql, array($nickname));
    }

    public function findUserByVerifiedMobile($mobile)
    {
        $sql = "SELECT * FROM {$this->table} WHERE verifiedMobile = ? LIMIT 1";
        return $this->getConnection()->fetchAssoc($sql, array($mobile));
    }

    public function findUsersByNicknames(array $nicknames)
    {
        if(empty($nicknames)) {
            return array();
        }

        $marks = str_repeat('?,', count($nicknames) - 1) . '?';
        $sql ="SELECT * FROM {$this->table} WHERE nickname IN ({$marks});";

        return $this->getConnection()->fetchAll($sql, $nicknames);
    }

    public function findUsersByIds(array $ids)
    {
        if(empty($ids)){
            return array();
        }
        $marks = str_repeat('?,', count($ids) - 1) . '?';
        $sql ="SELECT * FROM {$this->table} WHERE id IN ({$marks});";

        return $this->getConnection()->fetchAll($sql, $ids);
    }

    public function searchUsers($conditions, $orderBy, $start, $limit)
    {
        $this->filterStartLimit($start, $limit);
        $builder = $this->createUserQueryBuilder($conditions)
            ->select('*')
            ->orderBy($orderBy[0], $orderBy[1])
            ->setFirstResult($start)
            ->setMaxResults($limit);
        return $builder->execute()->fetchAll() ? : array();
    }

    public function searchUserCount($conditions)
    {
        $builder = $this->createUserQueryBuilder($conditions)
            ->select('COUNT(id)');
        return $builder->execute()->fetchColumn(0);
    }

    protected function createUserQueryBuilder($conditions)
    {
        $conditions = array_filter($conditions,function($v){
            if($v === 0){
                return true;
            }

            if(empty($v)){
                return false;
            }
            return true;
        });
        if (isset($conditions['roles'])) {
            $conditions['roles'] = "%{$conditions['roles']}%";
        }

        if (isset($conditions['role'])) {
            $conditions['role'] = "|{$conditions['role']}|";
        }

        if(isset($conditions['keywordType']) && isset($conditions['keyword'])) {
            $conditions[$conditions['keywordType']]=$conditions['keyword'];
            unset($conditions['keywordType']);
            unset($conditions['keyword']);
        }

        if (isset($conditions['keywordUserType'])) {
            $conditions['type'] = "%{$conditions['keywordUserType']}%";
            unset($conditions['keywordUserType']);
        }

        if (isset($conditions['nickname'])) {
            $conditions['nickname'] = "%{$conditions['nickname']}%";
        }

        if(!empty($conditions['datePicker'])&& $conditions['datePicker'] == 'longinDate'){
            if(isset($conditions['startDate'])){
                $conditions['loginStartTime'] = strtotime($conditions['startDate']);
            }
            if(isset($conditions['endDate'])){
                $conditions['loginEndTime'] = strtotime($conditions['endDate']);
            }
        }
        if(!empty($conditions['datePicker'])&& $conditions['datePicker'] == 'registerDate'){
            if(isset($conditions['startDate'])){
                $conditions['startTime'] = strtotime($conditions['startDate']);
            }
            if(isset($conditions['endDate'])){
                $conditions['endTime'] = strtotime($conditions['endDate']);
            }
        }

        return  $this->createDynamicQueryBuilder($conditions)
            ->from($this->table, 'user')
            ->andWhere('promoted = :promoted')
            ->andWhere('roles LIKE :roles')
            ->andWhere('roles = :role')
            ->andWhere('UPPER(nickname) LIKE :nickname')
            ->andWhere('loginIp = :loginIp')
            ->andWhere('createdIp = :createdIp')
            ->andWhere('approvalStatus = :approvalStatus')
            ->andWhere('email = :email')
            ->andWhere('level = :level')
            ->andWhere('createdTime >= :startTime')
            ->andWhere('createdTime <= :endTime')
            ->andWhere('approvalTime >= :startApprovalTime')
            ->andWhere('approvalTime <= :endApprovalTime')
            ->andWhere('loginTime >= :loginStartTime')
            ->andWhere('loginTime <= :loginEndTime')
            ->andWhere('locked = :locked')
            ->andWhere('level >= :greatLevel')
            ->andWhere('verifiedMobile = :verifiedMobile')
            ->andWhere('type LIKE :type')
            ->andWhere('id IN ( :userIds)')
            ->andWhere('id NOT IN ( :excludeIds )');
    }

    public function addUser($user)
    {
        $affected = $this->getConnection()->insert($this->table, $user);
        if ($affected <= 0) {
            throw $this->createDaoException('Insert user error.');
        }
        return $this->getUser($this->getConnection()->lastInsertId());
    }

    public function updateUser($id, $fields)
    {
        $this->getConnection()->update($this->table, $fields, array('id' => $id));
        return $this->getUser($id);
    }

    public function waveCounterById($id, $name, $number)
    {
        $names = array('newMessageNum', 'newNotificationNum');
        if (!in_array($name, $names)) {
            throw $this->createDaoException('counter name error');
        }
        $sql = "UPDATE {$this->table} SET {$name} = {$name} + ? WHERE id = ? LIMIT 1";
        return $this->getConnection()->executeQuery($sql, array($number, $id));
    }

    public function clearCounterById($id, $name)
    {
        $names = array('newMessageNum', 'newNotificationNum');
        if (!in_array($name, $names)) {
            throw $this->createDaoException('counter name error');
        }
        $sql = "UPDATE {$this->table} SET {$name} = 0 WHERE id = ? LIMIT 1";
        return $this->getConnection()->executeQuery($sql, array($id));
    }

    public function analysisRegisterDataByTime($startTime,$endTime)
    {
        $sql="SELECT count(id) as count, from_unixtime(createdTime,'%Y-%m-%d') as date FROM `{$this->table}` WHERE`createdTime`>=? AND `createdTime`<=? group by from_unixtime(`createdTime`,'%Y-%m-%d') order by date ASC ";
        return $this->getConnection()->fetchAll($sql, array($startTime, $endTime));
    }

    public function analysisUserSumByTime($endTime)
    {
         $sql="select date, count(*) as count from (SELECT from_unixtime(o.createdTime,'%Y-%m-%d') as date from user o where o.createdTime<=? ) dates group by dates.date order by date desc";
         return $this->getConnection()->fetchAll($sql, array($endTime));
    }

    public function findUsersCountByLessThanCreatedTime($endTime)
    {
        $sql="SELECT count(id) as count FROM `{$this->table}` WHERE  `createdTime`<=?  ";
        return $this->getConnection()->fetchColumn($sql, array($endTime));
    }

}


text:
package de.tu_darmstadt.gdi1.gorillas.ui.states;

import de.matthiasmann.twl.Button;
import de.matthiasmann.twl.slick.BasicTWLGameState;
import de.matthiasmann.twl.slick.RootPane;
import de.tu_darmstadt.gdi1.gorillas.assets.Assets;
import de.tu_darmstadt.gdi1.gorillas.main.Game;
import de.tu_darmstadt.gdi1.gorillas.main.Gorillas;
import de.tu_darmstadt.gdi1.gorillas.utils.KeyMap;
import eea.engine.entity.StateBasedEntityManager;
import org.newdawn.slick.*;
import org.newdawn.slick.state.StateBasedGame;

public class MainMenuState extends BasicTWLGameState {

    private StateBasedEntityManager entityManager;
    private Image background;
    private StateBasedGame game;

    //Buttons
    private Button btnNewGame;
    private Button btnHighScore;
    private Button btnHelp;
    private Button btnOptions;
    private Button btnExit;
    private Button btnMute;

    public MainMenuState() {
        entityManager = StateBasedEntityManager.getInstance();
    }

    @Override
    public int getID() {
        return de.tu_darmstadt.gdi1.gorillas.main.Game.MAINMENUSTATE;
    }

    @Override
    public void init(GameContainer container, StateBasedGame game) throws SlickException {
        if (!Game.getInstance().isTestMode()) {
            background = Assets.loadImage(Assets.Images.MAINMENU_BACKGROUND);
            float scaleFactor = (float) Gorillas.FRAME_WIDTH / background.getWidth();
            Game.BACKGROUND_SCALE = scaleFactor;
            if(Game.BACKGROUND_SCALE != 1) background = background.getScaledCopy(Game.BACKGROUND_SCALE);
        }
        this.game = game;
    }

    @Override
    protected RootPane createRootPane() {
        RootPane rp = super.createRootPane();

        btnNewGame = new Button("New Game");
        btnNewGame.addCallback(() -> game.enterState(Game.GAMESETUPSTATE) );

        btnHighScore = new Button("Highscore");
        btnHighScore.addCallback(() -> game.enterState(Game.HIGHSCORESTATE) );

        btnHelp = new Button("Help");
        btnHelp.addCallback(() -> game.enterState(Game.HELPSTATE) );

        btnOptions = new Button("Options");
        btnOptions.addCallback(() -> game.enterState(Game.OPTIONSTATE) );

        btnExit = new Button("Exit Game");
        btnExit.addCallback(() -> Game.getInstance().exitGame());

        btnMute = new Button("Mute");
        btnMute.addCallback(() -> Game.getInstance().toggleMute());

        rp.add(btnNewGame);
        rp.add(btnHighScore);
        rp.add(btnHelp);
        rp.add(btnOptions);
        rp.add(btnExit);
        rp.add(btnMute);
		return rp;
    }

    @Override
    public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
        entityManager.updateEntities(container, game, delta);
        KeyMap.globalKeyPressedActions(container.getInput(), game);
    }

	@Override
    public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
        if (Game.getInstance().isTestMode()) { return; } // Don't draw anything in testmode
        g.drawImage(background, 0, 0);
        entityManager.renderEntities(container, game, g);
    }

    @Override
    protected void layoutRootPane() {
        int paneHeight = this.getRootPane().getHeight();
        int paneWidth = this.getRootPane().getWidth();

        btnNewGame.setSize(128, 32);
        btnNewGame.setPosition(20, 20);

        btnHighScore.setSize(128, 32);
        btnHighScore.setPosition(20, 60);

        btnHelp.setSize(128, 32);
        btnHelp.setPosition(20, 100);

        btnOptions.setSize(128, 32);
        btnOptions.setPosition(20, 140);

        btnExit.setSize(128, 32);
        btnExit.setPosition(20, 180);

        btnMute.setSize(64, 64);
        btnMute.setPosition(0, paneHeight - btnMute.getHeight());
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace JMS\Serializer\Tests\Fixtures\DocBlockType\Collection;

class CollectionOfInterfacesFromSameNamespace
{
    /**
     * @var Vehicle[]
     */
    public array $vehicles;
}


text:
namespace _04.FixEmails
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class FixEmails
    {
        public static void Main()
        {
            var emails = new Dictionary<string, string>();

            string inputName = Console.ReadLine();

            while (inputName != "stop")
            {
                var inputMail = Console.ReadLine();

                string ending = inputMail.Substring(inputMail.Length - 2, 2).ToLower();
                if (ending != "uk" && ending != "us")
                {
                    emails.Add(inputName, inputMail);
                }

                inputName = Console.ReadLine();
            }

            foreach (var item in emails)
            {
                Console.WriteLine($"{item.Key} -> {item.Value}");
            }
        }
    }
}


text:
module ProMotion
  VERSION = "0.2.0" unless defined?(ProMotion::VERSION)
end


text:
static NSString * const kColorCellIdentifier = @"ColorCell";
static NSString * const kFontCellIdentifier = @"FontCell";
static NSString * const kEditColorSegue = @"EditColor";
static NSString * const kExportStyleSegue = @"ExportStyle";

@interface GlobalStyleController () <ColorPickerViewControllerDelegate>

@end

@implementation GlobalStyleController {
	StyleController *controller;
	NSIndexPath *selectedStyleIndexPath;
	NSString *selectedStyleKeyPath;
}

- (void)viewDidLoad {
    [super viewDidLoad];
	controller = [[StyleController alloc] initWithStyle:[[BRUIStyle defaultStyle] mutableCopy]];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return [controller numberOfSections];
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
	return [controller titleForSection:section];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
	return [controller numberOfItemsInSection:section];
}

static const NSInteger kFontSection = 1;

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	UITableViewCell *cell;

	NSString *displayName = [controller titleForStyleItemAtIndexPath:indexPath];

	if ( indexPath.section == kFontSection ) {
		// font section
		UITableViewCell *fontCell = [tableView dequeueReusableCellWithIdentifier:kFontCellIdentifier forIndexPath:indexPath];
		fontCell.textLabel.font = [controller styleItemAtIndexPath:indexPath];
		fontCell.textLabel.text = displayName;
		fontCell.detailTextLabel.text = [NSString stringWithFormat:@"%@ @ %d pt", [fontCell.textLabel.font fontName], (int)fontCell.textLabel.font.pointSize];
		fontCell.detailTextLabel.textColor = [UIColor lightGrayColor];
		fontCell.detailTextLabel.font = [UIFont systemFontOfSize:10];
		cell = fontCell;
	} else {
		// color section
		StyleColorTableViewCell *colorCell = [tableView dequeueReusableCellWithIdentifier:kColorCellIdentifier forIndexPath:indexPath];
		colorCell.titleLabel.text = displayName;
		colorCell.colorSwatch.color = [controller styleItemAtIndexPath:indexPath];
		cell = colorCell;
	}

    return cell;
}

#pragma mark - ColorPickerViewControllerDelegate

- (void)colorPickerDidPickColor:(ColorPickerViewController *)picker {
	if ( selectedStyleIndexPath ) {
		[controller.style setValue:picker.color forKeyPath:selectedStyleKeyPath];
		StyleColorTableViewCell *cell = (StyleColorTableViewCell *)[self.tableView cellForRowAtIndexPath:selectedStyleIndexPath];
		cell.colorSwatch.color = picker.color;
		[BRUIStyle setDefaultStyle:controller.style];
	}
}

#pragma mark - Actions

- (IBAction)exportStyle:(id)sender {
	[self performSegueWithIdentifier:kExportStyleSegue sender:sender];
}

#pragma mark - Navigation

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
	if ( [segue.identifier isEqualToString:kEditColorSegue] ) {
		NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
		selectedStyleIndexPath = indexPath;
		selectedStyleKeyPath = [controller styleItemKeyPathForIndexPath:indexPath];;
		ColorPickerViewController *dest = segue.destinationViewController;
		StyleColorTableViewCell *cell = (StyleColorTableViewCell *)[self.tableView cellForRowAtIndexPath:indexPath];
		dest.color = cell.colorSwatch.color;
		dest.delegate = self;
	} else if ( [segue.identifier isEqualToString:kExportStyleSegue] ) {
		StyleExportViewController *export = segue.destinationViewController;
		export.uiStyle = [controller.style copy];
	}
}

@end


text:
import os
import subprocess
import zipfile
import shutil
import glob
import threading

from sqlalchemy import inspect
from frt_server.font import Font
from frt_server.common import FamilyUploadStatus

def process(source_filename, family, user, commit_message, asynchronous):
    family.upload_status = FamilyUploadStatus.processing
    family.last_upload_error = None
    session = inspect(family).session
    session.commit()

    process = convert_font_after_upload(family, source_filename)

    if asynchronous:
        threading.Thread(target=handle_convert_result, args=(process, source_filename, family, user, commit_message)).start()
    else:
        handle_convert_result(process, source_filename, family, user, commit_message)

def handle_convert_result(process, source_filename, family, user, commit_message):
    session = inspect(family).session
    stdout, stderr = process.communicate()

    session.add(user)
    session.add(family)
    session.refresh(family)

    if process.returncode != 0:
        family.upload_status = FamilyUploadStatus.ready_for_upload
        family.last_upload_error = stderr or 'An unknown error occured'
        session.commit()
        return

    try:
        source_otf_path = os.path.join(family.source_folder_path(), 'master_otf')

        otf_filenames = [os.path.basename(filename) for filename in glob.glob(source_otf_path + '/*.otf')]
        if len(otf_filenames) < 1:
            raise FileNotFoundError('No otf files were generated')

        if is_ufo_file(source_filename):
            process_ufo_file(family, source_filename[:-4], otf_filenames[0], user)
        else:
            process_glyphs_file(family, source_filename, otf_filenames, user)
    finally:
        family.create_commit(commit_message, user)
        family.upload_status = FamilyUploadStatus.ready_for_upload
        session.commit()

def is_glyphs_file(filename):
    return filename.endswith('.glyphs')

def is_ufo_file(filename):
    return filename.endswith('.ufo.zip')

def unzip_file_for_family(family, filename):
    with zipfile.ZipFile(os.path.join(family.source_folder_path(), filename), "r") as ufo_zip_file:
        ufo_zip_file.extractall(family.source_folder_path())

def convert_font_after_upload(family, filename):
    """invoke fontmake in our source folder. no cleanup performed after, returns the running process handle"""
    type_parameter = None
    if is_glyphs_file(filename):
        type_parameter = "-g"
        temporary_filename = filename
    elif is_ufo_file(filename):
        unzip_file_for_family(family, filename)
        temporary_filename = filename[:-4]
        folders = glob.glob(os.path.join(family.source_folder_path(), '*.ufo'))
        if len(folders) != 1:
            raise Error(family.source_folder_path() + " should contain exactly 1 match for *.ufo, but contains " + len(folders))
        source = os.path.join(family.source_folder_path(), folders[0])
        destination = os.path.join(family.source_folder_path(), temporary_filename)
        if source != destination:
            move_file(source, destination)
        type_parameter = "-u"
    else:
        raise Exception("Exception: File is neither .ufo nor .glyphs")

    return subprocess.Popen(['fontmake', type_parameter, temporary_filename, '--no-production-names', '-o', 'otf', '--verbose', 'CRITICAL'],
            shell=False,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            cwd=family.source_folder_path())

def create_uploaded_font(family, font_name, ufo_filename, otf_filename, user):
    font = family.font_for_file_named(ufo_filename)
    if font:
        return font

    font = Font(font_name=font_name, author_id=user._id)
    family.fonts.append(font)
    session = inspect(family).session
    session.commit()
    session.refresh(font)

    font.clean_folders()
    font.ensure_folder_exists()
    return font

def process_glyphs_file(family, glyphs_filename, otf_filenames, user):
    source_otf_path = os.path.join(family.source_folder_path(), 'master_otf')
    source_ufo_path = os.path.join(family.source_folder_path(), 'master_ufo')

    for otf_filename in otf_filenames:
        font_name = otf_filename[:-4]
        ufo_filename = font_name + '.ufo'
        font = create_uploaded_font(family, font_name, ufo_filename, otf_filename, user)

        move_file(os.path.join(source_ufo_path, ufo_filename), os.path.join(font.ufo_folder_path(), ufo_filename))
        move_file(os.path.join(source_otf_path, otf_filename), os.path.join(font.otf_folder_path(), otf_filename))

    shutil.rmtree(source_ufo_path)
    shutil.rmtree(source_otf_path)

def process_ufo_file(family, ufo_filename, otf_filename, user):
    source_otf_path = os.path.join(family.source_folder_path(), 'master_otf')
    font_name = otf_filename[:-4]

    font = create_uploaded_font(family, font_name, ufo_filename, otf_filename, user)

    move_file(os.path.join(family.source_folder_path(), ufo_filename), os.path.join(font.ufo_folder_path(), ufo_filename))
    move_file(os.path.join(source_otf_path, otf_filename), os.path.join(font.otf_folder_path(), otf_filename))

    shutil.rmtree(source_otf_path)

def move_file(source, destination):
    if os.path.exists(destination):
        if (os.path.isdir(destination)):
            shutil.rmtree(destination)
        else:
            os.remove(destination)
    shutil.move(source, destination)


text:
package com.planet_ink.coffee_web.util;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * A custom thread factory whose only virtue is that it gives nice names to the
 * threads to make them easier to track.
 * @author Bo Zimmerman
 *
 */
public class CWThreadFactory implements ThreadFactory
{
	private String 						serverName;
	private final AtomicInteger 		counter		= new AtomicInteger();
	private final LinkedList<Thread> 	active 		= new LinkedList<Thread>();
	private final CWConfig			config;

	public CWThreadFactory(final String serverName, final CWConfig config)
	{
		this.serverName=serverName;
		this.config=config;
	}
	public void setServerName(final String newName)
	{
		this.serverName=newName;
	}
	@Override
	public Thread newThread(final Runnable r)
	{
		final Thread t = new CWThread(config, r,"cweb-"+serverName+"#"+counter.addAndGet(1));
		active.add(t);
		return t;
	}
	public Collection<Thread> getThreads()
	{
		return active;
	}
}


text:
SimpliTax
=========

A simple tax bracket calculator written in HTML, CSS, and JavaScript.

How to use
----------

Two options

1. Visit <https://questyman.github.io/SimpliTax/index.html> to see the basic web application calculator in action.

2. Download the repo as a zip, extract the contents, open `index.html` in a
web browser, and there you go!

Contribute
----------

Feel free to clone or fork the repo. If you have any suggestions or ideas,
please contact me at michael@michaelwgunter.com.


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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>jp.igapyon.blanco.apex.parser</groupId>
    <artifactId>blancoApexParser</artifactId>
    <packaging>jar</packaging>
    <version>1.5.7-SNAPSHOT</version>

    <name>blancoApexParser</name>
    <description>blancoApexParser is a simple Apex Parser for developers written in Java.</description>
    <url>https://github.com/igapyon/blancoApexParser/</url>

    <!-- see: http://maven.apache.org/guides/mini/guide-central-repository-upload.html -->
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/igapyon/blancoApexParser/</url>
        <connection>scm:git:https://github.com/igapyon/blancoApexParser.git</connection>
        <developerConnection>scm:git:https://github.com/igapyon/blancoApexParser.git</developerConnection>
        <tag>blancoApexParser-1.5.2</tag>
    </scm>

    <developers>
        <developer>
            <id>igapyon</id>
            <name>Toshiki Iga</name>
            <email>igapyon@gmail.com</email>
            <url>http://www.igapyon.jp/</url>
            <roles>
                <role>lead</role>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>-9</timezone>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/
            </url>
        </repository>
    </distributionManagement>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/junit/junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- basic spec for jar -->
    <properties>
        <!-- set source as UTF-8 -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <!-- compile as JDK 1.6 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <!-- create sources.jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <configuration>
                    <author>true</author>
                    <source>1.6</source>
                    <locale>en</locale>
                    <showPackage>true</showPackage>
                    <charset>utf-8</charset>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- gpg -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- for dependency -->
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
package org.zaproxy.zap.extension.jiraIssueCreater; /**
 * Created by kasun on 10/21/15.
 */

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientHandlerException;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;

import javax.naming.AuthenticationException;

public class JiraRestClient {

    public static String invokeGetMethod(String auth, String url) throws AuthenticationException, ClientHandlerException {
        Client client = Client.create();
        WebResource webResource = client.resource(url);
        ClientResponse response = webResource.header("Authorization", "Basic " + auth).type("application/json")
                .accept("application/json").get(ClientResponse.class);
        int statusCode = response.getStatus();
        if (statusCode == 401) {
            throw new AuthenticationException("Invalid Username or Password");
        }else if(statusCode ==403){
            throw new AuthenticationException("Forbidden");
        }
        return response.getEntity(String.class);
    }

    public static String invokePostMethod(String auth, String url, String data) throws AuthenticationException, ClientHandlerException {
        Client client = Client.create();
        WebResource webResource = client.resource(url);
        ClientResponse response = webResource.header("Authorization", "Basic " + auth).type("application/json")
                .accept("application/json").post(ClientResponse.class, data);
        int statusCode = response.getStatus();
        if (statusCode == 401) {
            throw new AuthenticationException("Invalid Username or Password");
        }
        return response.getEntity(String.class);
    }

    public static void invokePutMethod(String auth, String url, String data) throws AuthenticationException, ClientHandlerException {
        Client client = Client.create();
        WebResource webResource = client.resource(url);
        ClientResponse response = webResource.header("Authorization", "Basic " + auth).type("application/json")
                .accept("application/json").put(ClientResponse.class, data);
        int statusCode = response.getStatus();
        if (statusCode == 401) {
            throw new AuthenticationException("Invalid Username or Password");
        }
    }

    private static void invokeDeleteMethod(String auth, String url) throws AuthenticationException, ClientHandlerException {
        Client client = Client.create();
        WebResource webResource = client.resource(url);
        ClientResponse response = webResource.header("Authorization", "Basic " + auth).type("application/json")
                .accept("application/json").delete(ClientResponse.class);
        int statusCode = response.getStatus();
        if (statusCode == 401) {
            throw new AuthenticationException("Invalid Username or Password");
        }
    }

}


text:
package org.apache.cassandra.tracing;

import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.cassandra.concurrent.Stage;
import org.apache.cassandra.concurrent.StageManager;
import org.apache.cassandra.db.*;
import org.apache.cassandra.db.marshal.TimeUUIDType;
import org.apache.cassandra.exceptions.OverloadedException;
import org.apache.cassandra.exceptions.UnavailableException;
import org.apache.cassandra.exceptions.WriteTimeoutException;
import org.apache.cassandra.net.MessageIn;
import org.apache.cassandra.net.MessagingService;
import org.apache.cassandra.service.StorageProxy;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.utils.UUIDGen;

/**
 * A trace session context. Able to track and store trace sessions. A session is usually a user initiated query, and may
 * have multiple local and remote events before it is completed. All events and sessions are stored at keyspace.
 */
public class Tracing
{
    public static final String TRACE_HEADER = "TraceSession";

    private static final Logger logger = LoggerFactory.getLogger(Tracing.class);

    private final InetAddress localAddress = FBUtilities.getLocalAddress();

    private final ThreadLocal<TraceState> state = new ThreadLocal<>();

    private final ConcurrentMap<UUID, TraceState> sessions = new ConcurrentHashMap<>();

    public static final Tracing instance = new Tracing();

    public UUID getSessionId()
    {
        assert isTracing();
        return state.get().sessionId;
    }

    /**
     * Indicates if the current thread's execution is being traced.
     */
    public static boolean isTracing()
    {
        return instance.state.get() != null;
    }

    public UUID newSession()
    {
        return newSession(TimeUUIDType.instance.compose(ByteBuffer.wrap(UUIDGen.getTimeUUIDBytes())));
    }

    public UUID newSession(UUID sessionId)
    {
        assert state.get() == null;

        TraceState ts = new TraceState(localAddress, sessionId);
        state.set(ts);
        sessions.put(sessionId, ts);

        return sessionId;
    }

    public void doneWithNonLocalSession(TraceState state)
    {
        if (state.releaseReference() == 0)
            sessions.remove(state.sessionId);
    }

    /**
     * Stop the session and record its complete.  Called by coodinator when request is complete.
     */
    public void stopSession()
    {
        TraceState state = this.state.get();
        if (state == null) // inline isTracing to avoid implicit two calls to state.get()
        {
            logger.debug("request complete");
        }
        else
        {
            final int elapsed = state.elapsed();
            final ByteBuffer sessionId = state.sessionIdBytes;

            StageManager.getStage(Stage.TRACING).execute(new Runnable()
            {
                public void run()
                {
                    mutateWithCatch(TraceKeyspace.toStopSessionMutation(sessionId, elapsed));
                }
            });

            sessions.remove(state.sessionId);
            this.state.set(null);
        }
    }

    public TraceState get()
    {
        return state.get();
    }

    public TraceState get(UUID sessionId)
    {
        return sessions.get(sessionId);
    }

    public void set(final TraceState tls)
    {
        state.set(tls);
    }

    public void begin(final String request, final Map<String, String> parameters)
    {
        assert isTracing();

        final long startedAt = System.currentTimeMillis();
        final ByteBuffer sessionId = state.get().sessionIdBytes;

        StageManager.getStage(Stage.TRACING).execute(new Runnable()
        {
            public void run()
            {
                mutateWithCatch(TraceKeyspace.toStartSessionMutation(sessionId, parameters, request, startedAt));
            }
        });
    }

    /**
     * Determines the tracing context from a message.  Does NOT set the threadlocal state.
     *
     * @param message The internode message
     */
    public TraceState initializeFromMessage(final MessageIn<?> message)
    {
        final byte[] sessionBytes = message.parameters.get(Tracing.TRACE_HEADER);

        if (sessionBytes == null)
            return null;

        assert sessionBytes.length == 16;
        UUID sessionId = UUIDGen.getUUID(ByteBuffer.wrap(sessionBytes));
        TraceState ts = sessions.get(sessionId);
        if (ts != null && ts.acquireReference())
            return ts;

        if (message.verb == MessagingService.Verb.REQUEST_RESPONSE)
        {
            // received a message for a session we've already closed out.  see CASSANDRA-5668
            return new ExpiredTraceState(sessionId);
        }
        else
        {
            ts = new TraceState(message.from, sessionId);
            sessions.put(sessionId, ts);
            return ts;
        }
    }

    public static void trace(String message)
    {
        final TraceState state = instance.get();
        if (state == null) // inline isTracing to avoid implicit two calls to state.get()
            return;

        state.trace(message);
    }

    public static void trace(String format, Object arg)
    {
        final TraceState state = instance.get();
        if (state == null) // inline isTracing to avoid implicit two calls to state.get()
            return;

        state.trace(format, arg);
    }

    public static void trace(String format, Object arg1, Object arg2)
    {
        final TraceState state = instance.get();
        if (state == null) // inline isTracing to avoid implicit two calls to state.get()
            return;

        state.trace(format, arg1, arg2);
    }

    public static void trace(String format, Object[] args)
    {
        final TraceState state = instance.get();
        if (state == null) // inline isTracing to avoid implicit two calls to state.get()
            return;

        state.trace(format, args);
    }

    static void mutateWithCatch(Mutation mutation)
    {
        try
        {
            StorageProxy.mutate(Arrays.asList(mutation), ConsistencyLevel.ANY);
        }
        catch (UnavailableException | WriteTimeoutException e)
        {
            // should never happen; ANY does not throw UAE or WTE
            throw new AssertionError(e);
        }
        catch (OverloadedException e)
        {
            logger.warn("Too many nodes are overloaded to save trace events");
        }
    }
}


text:
<?php
namespace Elementor;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

class Widget_Shortcode extends Widget_Base {

	public function get_name() {
		return 'shortcode';
	}

	public function get_title() {
		return __( 'Shortcode', 'elementor' );
	}

	public function get_icon() {
		return 'shortcode';
	}

	public function is_reload_preview_required() {
		return true;
	}

	protected function _register_controls() {
		$this->start_controls_section(
			'section_shortcode',
			[
				'label' => __( 'Shortcode', 'elementor' ),
			]
		);

		$this->add_control(
			'shortcode',
			[
				'label' => __( 'Insert your shortcode here', 'elementor' ),
				'type' => Controls_Manager::TEXTAREA,
				'placeholder' => '[gallery id="123" size="medium"]',
				'default' => '',
			]
		);

		$this->end_controls_section();
	}

	protected function render() {
		$shortcode = $this->get_settings( 'shortcode' );

		$shortcode = do_shortcode( shortcode_unautop( $shortcode ) );
		?>

<?php echo $shortcode; ?>

		<?php
	}

	public function render_plain_content() {
		// In plain mode, render without shortcode
		echo $this->get_settings( 'shortcode' );
	}

	protected function _content_template() {}
}


text:
namespace eosio { namespace chain { namespace webassembly {
   inline static constexpr size_t max_assert_message = 1024;
   void interface::abort() const {
      EOS_ASSERT( false, abort_called, "abort() called" );
   }

   void interface::eosio_assert( bool condition, null_terminated_ptr msg ) const {
      if( BOOST_UNLIKELY( !condition ) ) {
         const size_t sz = strnlen( msg.data(), max_assert_message );
         std::string message( msg.data(), sz );
         EOS_THROW( eosio_assert_message_exception, "assertion failure with message: ${s}", ("s",message) );
      }
   }

   void interface::eosio_assert_message( bool condition, legacy_span<const char> msg ) const {
      if( BOOST_UNLIKELY( !condition ) ) {
         const size_t sz = msg.size() > max_assert_message ? max_assert_message : msg.size();
         std::string message( msg.data(), sz );
         EOS_THROW( eosio_assert_message_exception, "assertion failure with message: ${s}", ("s",message) );
      }
   }

   void interface::eosio_assert_code( bool condition, uint64_t error_code ) const {
      if( BOOST_UNLIKELY( !condition ) ) {
         if( error_code >= static_cast<uint64_t>(system_error_code::generic_system_error) ) {
            restricted_error_code_exception e( FC_LOG_MESSAGE(
                                                   error,
                                                   "eosio_assert_code called with reserved error code: ${error_code}",
                                                   ("error_code", error_code)
            ) );
            e.error_code = static_cast<uint64_t>(system_error_code::contract_restricted_error_code);
            throw e;
         } else {
            eosio_assert_code_exception e( FC_LOG_MESSAGE(
                                             error,
                                             "assertion failure with error code: ${error_code}",
                                             ("error_code", error_code)
            ) );
            e.error_code = error_code;
            throw e;
         }
      }
   }

   void interface::eosio_exit( int32_t code ) const {
      context.control.get_wasm_interface().exit();
   }
}}} // ns eosio::chain::webassembly


text:
<?xml version="1.0" encoding="UTF-8"?>
<resourceInfo xmlns="http://www.ilsp.gr/META-XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ilsp.gr/META-XMLSchema http://metashare.ilsp.gr/META-XMLSchema/v3.0/META-SHARE-Resource.xsd">
   <identificationInfo>
      <resourceName lang="en">Concise Oxford-Duden German Dictionary</resourceName>
      <resourceName lang="fr">Dictionnaire bilingue abrégé anglais-allemand " Concise Oxford-Duden German Dictionary "</resourceName>
      <description lang="en">Based on the highly acclaimed Oxford-Duden German Dictionary, recommended by academics, professionals, and students across the world, this dictionary provides learners at intermediate level with an authoritative guide to German and English in a concise and easy-access format. It incorporates the recent German spelling reforms, with changes signalled throughout.  It contains 150,000 words and phrases, and 240,000 translations. It is available in XML and SGML.</description>
      <description lang="fr">Dérivé du "Oxford-Duden German Dictionary", que professionnels et étudiants du monde entier recommandent, ce dictionnaire fournit aux personnes en cours d'apprentissage de la langue un guide de référence pour l'allemand et l'anglais, facile d'accès et concis. Les réformes de l'orthographe allemande sont inclues, et les modifications signalées. Ce dictionnaire contient 150 000 mots et expressions, et 240 000 traductions. Il est disponible aux formats XML et SGML.</description>
      <resourceShortName/>
      <url>http://catalog.elra.info/product_info.php?products_id=684</url>
      <metaShareId>NOT_DEFINED_FOR_V2</metaShareId>
      <identifier>ELRA-M0028</identifier>
   </identificationInfo>
   <distributionInfo>
      <availability>available-restrictedUse</availability>
      <licenceInfo>
         <licence>ELRA_END_USER</licence>
         <restrictionsOfUse>academic-nonCommercialUse</restrictionsOfUse>
         <fee>7000.00</fee>
         <userNature>academic</userNature>
         <membershipInfo>
            <member>false</member>
            <membershipInstitution>ELRA</membershipInstitution>
         </membershipInfo>
      </licenceInfo>
      <licenceInfo>
         <licence>ELRA_END_USER</licence>
         <restrictionsOfUse>academic-nonCommercialUse</restrictionsOfUse>
         <fee>4900.00</fee>
         <userNature>academic</userNature>
         <membershipInfo>
            <member>true</member>
            <membershipInstitution>ELRA</membershipInstitution>
         </membershipInfo>
      </licenceInfo>
      <availabilityStartDate>2002-10-23</availabilityStartDate>
   </distributionInfo>
   <contactPerson>
      <surname>Valérie</surname>
      <givenName>Mapelli</givenName>
      <communicationInfo>
         <email>mapelli@elda.org</email>
         <url>http://www.elda.org</url>
         <address>55-57 rue Brillat-Savarin</address>
         <zipCode>75013</zipCode>
         <city>Paris</city>
         <country>France</country>
         <telephoneNumber>+1 43 13 33 33</telephoneNumber>
         <faxNumber>+1 43 14 33 30</faxNumber>
      </communicationInfo>
   </contactPerson>
   <metadataInfo>
      <metadataCreationDate>2005-05-12</metadataCreationDate>
   </metadataInfo>
   <versionInfo>
      <version>1.0</version>
      <lastDateUpdated>2005-10-05</lastDateUpdated>
   </versionInfo>
   <resourceComponentType>
      <lexicalConceptualResourceInfo>
         <resourceType>lexicalConceptualResource</resourceType>
         <lexicalConceptualResourceType>lexicon</lexicalConceptualResourceType>
         <lexicalConceptualResourceMediaType>
            <lexicalConceptualResourceTextInfo>
               <mediaType>text</mediaType>
               <lingualityInfo>
                  <lingualityType>monolingual</lingualityType>
               </lingualityInfo>
               <languageInfo>
                  <languageId>eng</languageId>
                  <languageName>English</languageName>
               </languageInfo>
               <languageInfo>
                  <languageId>ger/deu</languageId>
                  <languageName>German</languageName>
               </languageInfo>
               <sizeInfo>
                  <size>no size available</size>
                  <sizeUnit>other</sizeUnit>
               </sizeInfo>
            </lexicalConceptualResourceTextInfo>
         </lexicalConceptualResourceMediaType>
      </lexicalConceptualResourceInfo>
   </resourceComponentType>
</resourceInfo>


text:
import * as React from 'react';
import { Text, FlatList } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useSelector } from 'react-redux';

import { useStyles } from '../themes/colors';
import AppListing from './app-listing.react';

const safeAreaEdges = ['top', 'bottom'];
const APP_DIRECTORY_DATA = [
  {
    id: 'chat',
    alwaysEnabled: true,
    appName: 'Chat',
    appIcon: 'message-square',
    appCopy: 'Keep in touch with your community',
  },
  {
    id: 'calendar',
    alwaysEnabled: false,
    appName: 'Calendar',
    appIcon: 'calendar',
    appCopy: 'Shared calendar for your community',
  },
];

// eslint-disable-next-line no-unused-vars
function AppsDirectory(props: { ... }): React.Node {
  const styles = useStyles(unboundStyles);
  const enabledApps = useSelector(state => state.enabledApps);

  const renderAppCell = React.useCallback(
    ({ item }) => (
      <AppListing
        id={item.id}
        enabled={enabledApps[item.id]}
        alwaysEnabled={item.alwaysEnabled}
        appName={item.appName}
        appIcon={item.appIcon}
        appCopy={item.appCopy}
      />
    ),
    [enabledApps],
  );
  const getItemID = React.useCallback(item => item.id, []);

  return (
    <SafeAreaView style={styles.view} edges={safeAreaEdges}>
      <Text style={styles.title}>Choose Apps</Text>
      <FlatList
        data={APP_DIRECTORY_DATA}
        renderItem={renderAppCell}
        keyExtractor={getItemID}
      />
    </SafeAreaView>
  );
}

const unboundStyles = {
  view: {
    flex: 1,
    backgroundColor: 'panelBackground',
    padding: 18,
  },
  title: {
    color: 'white',
    fontSize: 28,
    paddingVertical: 12,
  },
};

export default AppsDirectory;


text:
call bower install
call npm install
call go build
call nuget pack -BasePath . .\spec\octo\windows-dashing-go-demo.nuspec


text:
package org.springframework.boot.context.config;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.logging.Log;

import org.springframework.boot.logging.DeferredLogFactory;

/**
 * Imports {@link ConfigData} by {@link ConfigDataLocationResolver resolving} and
 * {@link ConfigDataLoader loading} locations. {@link ConfigDataResource resources} are
 * tracked to ensure that they are not imported multiple times.
 *
 * @author Phillip Webb
 * @author Madhura Bhave
 */
class ConfigDataImporter {

	private final Log logger;

	private final ConfigDataLocationResolvers resolvers;

	private final ConfigDataLoaders loaders;

	private final ConfigDataNotFoundAction notFoundAction;

	private final Set<ConfigDataResource> loaded = new HashSet<>();

	/**
	 * Create a new {@link ConfigDataImporter} instance.
	 * @param logFactory the log factory
	 * @param notFoundAction the action to take when a location cannot be found
	 * @param resolvers the config data location resolvers
	 * @param loaders the config data loaders
	 */
	ConfigDataImporter(DeferredLogFactory logFactory, ConfigDataNotFoundAction notFoundAction,
			ConfigDataLocationResolvers resolvers, ConfigDataLoaders loaders) {
		this.logger = logFactory.getLog(getClass());
		this.resolvers = resolvers;
		this.loaders = loaders;
		this.notFoundAction = notFoundAction;
	}

	/**
	 * Resolve and load the given list of locations, filtering any that have been
	 * previously loaded.
	 * @param activationContext the activation context
	 * @param locationResolverContext the location resolver context
	 * @param loaderContext the loader context
	 * @param locations the locations to resolve
	 * @return a map of the loaded locations and data
	 */
	Map<ConfigDataResolutionResult, ConfigData> resolveAndLoad(ConfigDataActivationContext activationContext,
			ConfigDataLocationResolverContext locationResolverContext, ConfigDataLoaderContext loaderContext,
			List<ConfigDataLocation> locations) {
		try {
			Profiles profiles = (activationContext != null) ? activationContext.getProfiles() : null;
			List<ConfigDataResolutionResult> resolved = resolve(locationResolverContext, profiles, locations);
			return load(loaderContext, resolved);
		}
		catch (IOException ex) {
			throw new IllegalStateException("IO error on loading imports from " + locations, ex);
		}
	}

	private List<ConfigDataResolutionResult> resolve(ConfigDataLocationResolverContext locationResolverContext,
			Profiles profiles, List<ConfigDataLocation> locations) {
		List<ConfigDataResolutionResult> resolved = new ArrayList<>(locations.size());
		for (ConfigDataLocation location : locations) {
			resolved.addAll(resolve(locationResolverContext, profiles, location));
		}
		return Collections.unmodifiableList(resolved);
	}

	private List<ConfigDataResolutionResult> resolve(ConfigDataLocationResolverContext locationResolverContext,
			Profiles profiles, ConfigDataLocation location) {
		try {
			return this.resolvers.resolve(locationResolverContext, location, profiles);
		}
		catch (ConfigDataNotFoundException ex) {
			handle(ex, location);
			return Collections.emptyList();
		}
	}

	private Map<ConfigDataResolutionResult, ConfigData> load(ConfigDataLoaderContext loaderContext,
			List<ConfigDataResolutionResult> candidates) throws IOException {
		Map<ConfigDataResolutionResult, ConfigData> result = new LinkedHashMap<>();
		for (int i = candidates.size() - 1; i >= 0; i--) {
			ConfigDataResolutionResult candidate = candidates.get(i);
			ConfigDataLocation location = candidate.getLocation();
			ConfigDataResource resource = candidate.getResource();
			if (this.loaded.add(resource)) {
				try {
					ConfigData loaded = this.loaders.load(loaderContext, resource);
					if (loaded != null) {
						result.put(candidate, loaded);
					}
				}
				catch (ConfigDataNotFoundException ex) {
					handle(ex, location);
				}
			}
		}
		return Collections.unmodifiableMap(result);
	}

	private void handle(ConfigDataNotFoundException ex, ConfigDataLocation location) {
		if (ex instanceof ConfigDataResourceNotFoundException) {
			ex = ((ConfigDataResourceNotFoundException) ex).withLocation(location);
		}
		getNotFoundAction(location).handle(this.logger, ex);
	}

	private ConfigDataNotFoundAction getNotFoundAction(ConfigDataLocation location) {
		return (!location.isOptional()) ? this.notFoundAction : ConfigDataNotFoundAction.IGNORE;
	}

}


text:
package smile.data.parser;

import java.io.*;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

/**
 * Simple IO stream manipulation utilities.
 *
 * @author Haifeng Li
 */
public class IOUtils {
    private static String home = System.getProperty("smile.home", "shell/src/universal/bin");

    /** Get the file path of sample dataset. */
    public static String getTestDataPath(String path) {
        return home + "/../data/" + path;
    }

    /** Get the file object of sample dataset. */
    public static File getTestDataFile(String path) {
        return new java.io.File(getTestDataPath(path));
    }

    /** Get the reader of sample datasets. */
    public static BufferedReader getTestDataReader(String path) throws FileNotFoundException {
        return new BufferedReader(new InputStreamReader(new FileInputStream(getTestDataFile(path))));
    }

    /**
     * Returns the lines of an InputStream as a list of Strings.
     *
     * @param input  the InputStream to read from.
     * @return the list of lines.
     */
    public static List<String> readLines(InputStream input) throws IOException {
        final InputStreamReader reader = new InputStreamReader(input);
        return readLines(reader);
    }

    /**
     * Returns the lines of an InputStream as a list of Strings.
     *
     * @param input  the InputStream to read from.
     * @param charset a charset.
     * @return the list of lines.
     */
    public static List<String> readLines(InputStream input, Charset charset) throws IOException {
        final InputStreamReader reader = new InputStreamReader(input, charset);
        return readLines(reader);
    }

    /**
     * Returns the lines of a Reader as a list of Strings.
     *
     * @param input  the Reader to read from.
     * @return the list of lines.
     */
    public static List<String> readLines(Reader input) throws IOException {
        BufferedReader reader = input instanceof BufferedReader ? (BufferedReader) input : new BufferedReader(input);
        List<String> list = new ArrayList<String>();
        String line = reader.readLine();
        while (line != null) {
            list.add(line);
            line = reader.readLine();
        }
        reader.close();
        return list;
    }
}


text:
Description
===========
This package contains an efficient implementation
of a fixed size in-memory bitset.

The operations supported on a BitSet are:

- Get
- Set, SetAll
- Clear, ClearAll
- Invert, InvertAll

There is also a Parse method that allows construction of BitSets
from a string of zeroes and ones.

Example
=======

	package main

	import (
		"fmt"
		"github.com/lazybeaver/bitset"
	)

	func main() {
		bs := bitset.New(4)
		bs.Set(0)
		bs.Set(2)
		bs.InvertAll()
		if bs.Get(1) {
			bs.Clear(3)
		}
		fmt.Println(bs.String())
	}

Benchmarks
==========
The index bounds checking and the function call to get position and mask
are currently the most expensive parts of the implementation.

	$ go test -bench=.
	PASS
	BenchmarkGet	500000000	         6.34 ns/op
	BenchmarkSet	500000000	         6.41 ns/op
	BenchmarkInvert	500000000	         6.49 ns/op
	ok		github.com/lazybeaver/bitset	11.581s


text:
<?php

namespace SteamCondenser\Servers\Packets;

use SteamCondenser\Exceptions\PacketFormatException;
use SteamCondenser\Servers\Packets\RCON\RCONGoldSrcResponse;

/**
 * This module provides functionality to handle raw packet data, including data
 * split into several UDP / TCP packets and BZIP2 compressed data. It's the
 * main utility to transform data bytes into packet objects.
 *
 * @author     Sebastian Staudt
 * @package    steam-condenser
 * @subpackage packets
 * @see        SteamPacket
 */
abstract class SteamPacketFactory {

    /**
     * Creates a new packet object based on the header byte of the given raw
     * data
     *
     * @param string $rawData The raw data of the packet
     * @throws PacketFormatException if the packet header is not recognized
     * @return SteamPacket The packet object generated from the packet data
     */
    public static function getPacketFromData($rawData) {
        $header = ord($rawData[0]);
        $data = substr($rawData, 1);

        switch($header) {
            case SteamPacket::S2A_INFO_DETAILED_HEADER:
                return new S2AINFODETAILEDPacket($data);

            case SteamPacket::S2A_INFO2_HEADER:
                return new S2AINFO2Packet($data);

            case SteamPacket::S2A_PLAYER_HEADER:
                return new S2APLAYERPacket($data);

            case SteamPacket::S2A_RULES_HEADER:
                return new S2ARULESPacket($data);

            case SteamPacket::S2C_CHALLENGE_HEADER:
                return new S2CCHALLENGEPacket($data);

            case SteamPacket::M2A_SERVER_BATCH_HEADER:
                return new M2ASERVERBATCHPacket($data);

            case SteamPacket::RCON_GOLDSRC_CHALLENGE_HEADER:
            case SteamPacket::RCON_GOLDSRC_NO_CHALLENGE_HEADER:
            case SteamPacket::RCON_GOLDSRC_RESPONSE_HEADER:
                return new RCONGoldSrcResponse($data);

            default:
                throw new PacketFormatException('Unknown packet with header 0x' . dechex($header) . ' received.');
        }
    }

    /**
     * Reassembles the data of a split and/or compressed packet into a single
     * packet object
     *
     * @param array $splitPackets An array of packet data
     * @param bool $isCompressed whether the data of this packet is compressed
     * @param int $packetChecksum The CRC32 checksum of the decompressed
     *        packet data
     * @throws PacketFormatException if the calculated CRC32 checksum does not
     *         match the expected value
     * @return SteamPacket The reassembled packet
     * @see packetFromData()
     */
    public static function reassemblePacket($splitPackets, $isCompressed = false, $packetChecksum = 0) {
        $packetData = join('', $splitPackets);

        if($isCompressed) {
            $packetData = bzdecompress($packetData);

            if(crc32($packetData) != $packetChecksum) {
                throw new PacketFormatException('CRC32 checksum mismatch of uncompressed packet data.');
            }
        }

        $packetData = substr($packetData, 4);

        return self::getPacketFromData($packetData);
    }
}


text:
import {Component, Input, Output, EventEmitter, OnInit} from '@angular/core';

@Component({
  selector: 'my-child',
  template: `
  <div class="child">
    {{desc}} belongs to {{parent}} with {{emoji}}
  </div>`,
  styles: [`
    .child {
      background: red;
      color: yellow;
    }
  `]
})
export class ChildComponent implements OnInit {
  @Input() desc: string;
  @Input('owner') parent: string;
  private _emoji: string;
  @Input() set emoji(value: string) {
    this._emoji = value || 'happy';
  }
  get emoji(): string {
    return this._emoji;
  }

  @Output() status: EventEmitter<string> = new EventEmitter<string>();

  ngOnInit(): void {
    this.status.emit('Ready');
  }
}


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.Management.Resources.Models
{
    public partial class ManagementLockListResult
    {
        internal static ManagementLockListResult DeserializeManagementLockListResult(JsonElement element)
        {
            IReadOnlyList<ManagementLockObject> value = default;
            string nextLink = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List<ManagementLockObject> array = new List<ManagementLockObject>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(ManagementLockObject.DeserializeManagementLockObject(item));
                        }
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return new ManagementLockListResult(value, nextLink);
        }
    }
}


text:
package org.apache.jackrabbit.oak.plugins.document;

import java.io.Closeable;
import java.io.IOException;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import javax.annotation.Nonnull;

import com.google.common.base.Joiner;
import com.google.common.base.Predicate;
import com.google.common.base.Stopwatch;
import com.google.common.collect.Iterators;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

import org.apache.jackrabbit.oak.commons.sort.StringSort;
import org.apache.jackrabbit.oak.plugins.document.UpdateOp.Condition;
import org.apache.jackrabbit.oak.plugins.document.UpdateOp.Key;
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.StandardSystemProperty.LINE_SEPARATOR;
import static com.google.common.collect.Iterators.partition;
import static java.util.Collections.singletonMap;
import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES;
import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.MODIFIED_IN_SECS;
import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.SplitDocType.COMMIT_ROOT_ONLY;
import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.SplitDocType.DEFAULT_LEAF;
import static org.apache.jackrabbit.oak.plugins.document.UpdateOp.Condition.newEqualsCondition;

public class VersionGarbageCollector {
    //Kept less than MongoDocumentStore.IN_CLAUSE_BATCH_SIZE to avoid re-partitioning
    private static final int DELETE_BATCH_SIZE = 450;
    private static final int PROGRESS_BATCH_SIZE = 10000;
    private static final Key KEY_MODIFIED = new Key(MODIFIED_IN_SECS, null);
    private final DocumentNodeStore nodeStore;
    private final DocumentStore ds;
    private final VersionGCSupport versionStore;
    private int overflowToDiskThreshold = 100000;

    private static final Logger log = LoggerFactory.getLogger(VersionGarbageCollector.class);

    /**
     * Split document types which can be safely garbage collected
     */
    private static final Set<NodeDocument.SplitDocType> GC_TYPES = EnumSet.of(
            DEFAULT_LEAF, COMMIT_ROOT_ONLY);

    VersionGarbageCollector(DocumentNodeStore nodeStore,
                            VersionGCSupport gcSupport) {
        this.nodeStore = nodeStore;
        this.versionStore = gcSupport;
        this.ds = nodeStore.getDocumentStore();
    }

    public VersionGCStats gc(long maxRevisionAge, TimeUnit unit) throws IOException {
        long maxRevisionAgeInMillis = unit.toMillis(maxRevisionAge);
        Stopwatch sw = Stopwatch.createStarted();
        VersionGCStats stats = new VersionGCStats();
        final long oldestRevTimeStamp = nodeStore.getClock().getTime() - maxRevisionAgeInMillis;
        final RevisionVector headRevision = nodeStore.getHeadRevision();

        log.info("Starting revision garbage collection. Revisions older than [{}] will be " +
                "removed", Utils.timestampToString(oldestRevTimeStamp));

        //Check for any registered checkpoint which prevent the GC from running
        Revision checkpoint = nodeStore.getCheckpoints().getOldestRevisionToKeep();
        if (checkpoint != null && checkpoint.getTimestamp() < oldestRevTimeStamp) {
            log.info("Ignoring revision garbage collection because a valid " +
                            "checkpoint [{}] was found, which is older than [{}].",
                    checkpoint.toReadableString(),
                    Utils.timestampToString(oldestRevTimeStamp)
            );
            stats.ignoredGCDueToCheckPoint = true;
            return stats;
        }

        collectDeletedDocuments(stats, headRevision, oldestRevTimeStamp);
        collectSplitDocuments(stats, oldestRevTimeStamp);

        sw.stop();
        log.info("Revision garbage collection finished in {}. {}", sw, stats);
        return stats;
    }

    public void setOverflowToDiskThreshold(int overflowToDiskThreshold) {
        this.overflowToDiskThreshold = overflowToDiskThreshold;
    }

    private void collectSplitDocuments(VersionGCStats stats, long oldestRevTimeStamp) {
        stats.collectAndDeleteSplitDocs.start();
        versionStore.deleteSplitDocuments(GC_TYPES, oldestRevTimeStamp, stats);
        stats.collectAndDeleteSplitDocs.stop();
    }

    private void collectDeletedDocuments(VersionGCStats stats,
                                         RevisionVector headRevision,
                                         long oldestRevTimeStamp)
            throws IOException {
        int docsTraversed = 0;
        DeletedDocsGC gc = new DeletedDocsGC(headRevision);
        try {
            stats.collectDeletedDocs.start();
            Iterable<NodeDocument> itr = versionStore.getPossiblyDeletedDocs(oldestRevTimeStamp);
            try {
                for (NodeDocument doc : itr) {
                    // Check if node is actually deleted at current revision
                    // As node is not modified since oldestRevTimeStamp then
                    // this node has not be revived again in past maxRevisionAge
                    // So deleting it is safe
                    docsTraversed++;
                    if (docsTraversed % PROGRESS_BATCH_SIZE == 0){
                        log.info("Iterated through {} documents so far. {} found to be deleted",
                                docsTraversed, gc.getNumDocuments());
                    }
                    gc.possiblyDeleted(doc);
                }
            } finally {
                Utils.closeIfCloseable(itr);
            }
            stats.collectDeletedDocs.stop();

            if (gc.getNumDocuments() == 0){
                return;
            }

            stats.deleteDeletedDocs.start();

            gc.removeDocuments(stats);

            nodeStore.invalidateDocChildrenCache();
            stats.deleteDeletedDocs.stop();
        } finally {
            gc.close();
        }
    }

    public static class VersionGCStats {
        boolean ignoredGCDueToCheckPoint;
        int deletedDocGCCount;
        int splitDocGCCount;
        int intermediateSplitDocGCCount;
        final Stopwatch collectDeletedDocs = Stopwatch.createUnstarted();
        final Stopwatch deleteDeletedDocs = Stopwatch.createUnstarted();
        final Stopwatch collectAndDeleteSplitDocs = Stopwatch.createUnstarted();

        @Override
        public String toString() {
            return "VersionGCStats{" +
                    "ignoredGCDueToCheckPoint=" + ignoredGCDueToCheckPoint +
                    ", deletedDocGCCount=" + deletedDocGCCount +
                    ", splitDocGCCount=" + splitDocGCCount +
                    ", intermediateSplitDocGCCount=" + intermediateSplitDocGCCount +
                    ", timeToCollectDeletedDocs=" + collectDeletedDocs +
                    ", timeTakenToDeleteDeletedDocs=" + deleteDeletedDocs +
                    ", timeTakenToCollectAndDeleteSplitDocs=" + collectAndDeleteSplitDocs +
                    '}';
        }
    }

    /**
     * A helper class to remove document for deleted nodes.
     */
    private class DeletedDocsGC implements Closeable {

        private final RevisionVector headRevision;
        private final StringSort docIdsToDelete = newStringSort();
        private final StringSort prevDocIdsToDelete = newStringSort();
        private final Set<String> exclude = Sets.newHashSet();
        private boolean sorted = false;

        public DeletedDocsGC(@Nonnull RevisionVector headRevision) {
            this.headRevision = checkNotNull(headRevision);
        }

        /**
         * @return the number of documents gathers so far that have been
         * identified as garbage via {@link #possiblyDeleted(NodeDocument)}.
         * This number does not include the previous documents.
         */
        long getNumDocuments() {
            return docIdsToDelete.getSize();
        }

        /**
         * Informs the GC that the given document is possibly deleted. The
         * implementation will check if the node still exists at the head
         * revision passed to the constructor to this GC. The implementation
         * will keep track of documents representing deleted nodes and remove
         * them together with associated previous document
         *
         * @param doc the candidate document.
         */
        void possiblyDeleted(NodeDocument doc)
                throws IOException {
            if (doc.getNodeAtRevision(nodeStore, headRevision, null) == null) {
                // construct an id that also contains
                // the _modified time of the document
                String id = doc.getId() + "/" + doc.getModified();
                addDocument(id);
                // Collect id of all previous docs also
                Iterator<NodeDocument> it = doc.getAllPreviousDocs();
                while (it.hasNext()) {
                    addPreviousDocument(it.next().getId());
                }
            }
        }

        /**
         * Removes the documents that have been identified as garbage. This
         * also includes previous documents. This method will only remove
         * documents that have not been modified since they were passed to
         * {@link #possiblyDeleted(NodeDocument)}.
         *
         * @param stats to track the number of removed documents.
         */
        void removeDocuments(VersionGCStats stats) throws IOException {
            stats.deletedDocGCCount += removeDeletedDocuments();
            // FIXME: this is incorrect because that method also removes intermediate docs
            stats.splitDocGCCount += removeDeletedPreviousDocuments();
        }

        public void close() {
            try {
                docIdsToDelete.close();
            } catch (IOException e) {
                log.warn("Failed to close docIdsToDelete", e);
            }
            try {
                prevDocIdsToDelete.close();
            } catch (IOException e) {
                log.warn("Failed to close prevDocIdsToDelete", e);
            }
        }

        //------------------------------< internal >----------------------------

        private void addDocument(String id) throws IOException {
            docIdsToDelete.add(id);
        }

        private long getNumPreviousDocuments() {
            return prevDocIdsToDelete.getSize() - exclude.size();
        }

        private void addPreviousDocument(String id) throws IOException {
            prevDocIdsToDelete.add(id);
        }

        private Iterator<String> getDocIdsToDelete() throws IOException {
            ensureSorted();
            return docIdsToDelete.getIds();
        }

        private void concurrentModification(NodeDocument doc) {
            Iterator<NodeDocument> it = doc.getAllPreviousDocs();
            while (it.hasNext()) {
                exclude.add(it.next().getId());
            }
        }

        private Iterator<String> getPrevDocIdsToDelete() throws IOException {
            ensureSorted();
            return Iterators.filter(prevDocIdsToDelete.getIds(),
                    new Predicate<String>() {
                @Override
                public boolean apply(String input) {
                    return !exclude.contains(input);
                }
            });
        }

        private int removeDeletedDocuments() throws IOException {
            Iterator<String> docIdsToDelete = getDocIdsToDelete();
            log.info("Proceeding to delete [{}] documents", getNumDocuments());

            Iterator<List<String>> idListItr = partition(docIdsToDelete, DELETE_BATCH_SIZE);
            int deletedCount = 0;
            int lastLoggedCount = 0;
            int recreatedCount = 0;
            while (idListItr.hasNext()) {
                Map<String, Map<Key, Condition>> deletionBatch = Maps.newLinkedHashMap();
                for (String s : idListItr.next()) {
                    int idx = s.lastIndexOf('/');
                    String id = s.substring(0, idx);
                    long modified = -1;
                    try {
                        modified = Long.parseLong(s.substring(idx + 1));
                    } catch (NumberFormatException e) {
                        log.warn("Invalid _modified {} for {}", s.substring(idx + 1), id);
                    }
                    deletionBatch.put(id, singletonMap(KEY_MODIFIED, newEqualsCondition(modified)));
                }

                if (log.isDebugEnabled()) {
                    StringBuilder sb = new StringBuilder("Performing batch deletion of documents with following ids. \n");
                    Joiner.on(LINE_SEPARATOR.value()).appendTo(sb, deletionBatch.keySet());
                    log.debug(sb.toString());
                }

                int nRemoved = ds.remove(NODES, deletionBatch);

                if (nRemoved < deletionBatch.size()) {
                    // some nodes were re-created while GC was running
                    // find the document that still exist
                    for (String id : deletionBatch.keySet()) {
                        NodeDocument d = ds.find(NODES, id);
                        if (d != null) {
                            concurrentModification(d);
                        }
                    }
                    recreatedCount += (deletionBatch.size() - nRemoved);
                }

                deletedCount += nRemoved;
                log.debug("Deleted [{}] documents so far", deletedCount);

                if (deletedCount + recreatedCount - lastLoggedCount >= PROGRESS_BATCH_SIZE){
                    lastLoggedCount = deletedCount + recreatedCount;
                    double progress = lastLoggedCount * 1.0 / getNumDocuments() * 100;
                    String msg = String.format("Deleted %d (%1.2f%%) documents so far", deletedCount, progress);
                    log.info(msg);
                }
            }
            return deletedCount;
        }

        private int removeDeletedPreviousDocuments() throws IOException {
            log.info("Proceeding to delete [{}] previous documents", getNumPreviousDocuments());

            int deletedCount = 0;
            int lastLoggedCount = 0;
            Iterator<List<String>> idListItr =
                    partition(getPrevDocIdsToDelete(), DELETE_BATCH_SIZE);
            while (idListItr.hasNext()) {
                List<String> deletionBatch = idListItr.next();
                deletedCount += deletionBatch.size();

                if (log.isDebugEnabled()) {
                    StringBuilder sb = new StringBuilder("Performing batch deletion of previous documents with following ids. \n");
                    Joiner.on(LINE_SEPARATOR.value()).appendTo(sb, deletionBatch);
                    log.debug(sb.toString());
                }

                ds.remove(NODES, deletionBatch);

                log.debug("Deleted [{}] previous documents so far", deletedCount);

                if (deletedCount - lastLoggedCount >= PROGRESS_BATCH_SIZE){
                    lastLoggedCount = deletedCount;
                    double progress = deletedCount * 1.0 / (prevDocIdsToDelete.getSize() - exclude.size()) * 100;
                    String msg = String.format("Deleted %d (%1.2f%%) previous documents so far", deletedCount, progress);
                    log.info(msg);
                }
            }
            return deletedCount;
        }

        private void ensureSorted() throws IOException {
            if (!sorted) {
                docIdsToDelete.sort();
                prevDocIdsToDelete.sort();
                sorted = true;
            }
        }
    }

    @Nonnull
    private StringSort newStringSort() {
        return new StringSort(overflowToDiskThreshold,
                NodeDocumentIdComparator.INSTANCE);
    }
}


text:
For each deployed environment, a `.env` needs to be created. This is by
convention located in the Capistrano `shared` directory for that
deployment.

For example, for the `demo` environment, a `demo.env` file is located in
`/var/www/antiqua/demo/shared`.

## Example

```
APP_ENV=demo
APP_RUBY=ruby-1.9.3-p125
CONFIG_AIRBRAKE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONFIG_APP_SECRET_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONFIG_AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx
CONFIG_AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONFIG_BASIC_AUTH_USERNAME=xxxxxxxxxxxxxxxxx
CONFIG_BASIC_AUTH_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONFIG_GITHUB_TOKEN=xxxxxxxxxxxxxxxxxxxx
CONFIG_GITHUB_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONFIG_GLOBAL_ALERT_ID=demo_warning
CONFIG_GOOGLE_ANALYTICS_ACCOUNT=xxxxxxxxxxxxx
CONFIG_GOOGLE_ANALYTICS_DOMAIN=demo.antiqua.io
CONFIG_HAS_GLOBAL_ALERT=true
CONFIG_SENDGRID_DOMAIN=demo.antiqua.io
CONFIG_SENDGRID_PASSWORD=xxxxxxxxxxxxxxxxxx
CONFIG_SENDGRID_USER_NAME=xxxxxx
CONFIG_STRIPE_INDIVIDUAL_PLAN_ID=xxxxxxxxxx
CONFIG_STRIPE_PUBLISHABLE_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONFIG_STRIPE_SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONFIG_USE_BASIC_AUTH=true
CONFIG_USE_GOOGLE_ANALYTICS=true
RACK_ENV=demo
RAILS_ENV=demo
```

## Configurable Keys

* `CONFIG_USE_BASIC_AUTH` :: If set to `true`, `CONFIG_BASIC_AUTH_USERNAME` and `CONFIG_BASIC_AUTH_PASSWORD` are required
* `CONFIG_USE_GOOGLE_ANALYTICS` :: If set to `true`, `CONFIG_GOOGLE_ANALYTICS_ACCOUNT` and `CONFIG_GOOGLE_ANALYTICS_DOMAIN` are required
* `CONFIG_HAS_GLOBAL_ALERT` :: If set to `true`, `CONFIG_GLOBAL_ALERT_ID` is required to be set to a value that matches a key in `app/lib/global_alert.rb`


text:
from moderation.managers import ModerationObjectsManager
from django.contrib.gis.db.models import GeoManager

class ModeratedAdManager(ModerationObjectsManager, GeoManager):
    """
    Manager for Ad with moderation feature and geo enabled
    """
    pass


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: java.util.concurrent.atomic.AtomicLong
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMICLONG_HPP_DECL
#define J2CPP_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMICLONG_HPP_DECL

namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace lang { class Number; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace io { class Serializable; } } }

#include <java/io/Serializable.hpp>
#include <java/lang/Number.hpp>
#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>

namespace j2cpp {

namespace java { namespace util { namespace concurrent { namespace atomic {

	class AtomicLong;
	class AtomicLong
		: public object<AtomicLong>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)
		J2CPP_DECLARE_METHOD(6)
		J2CPP_DECLARE_METHOD(7)
		J2CPP_DECLARE_METHOD(8)
		J2CPP_DECLARE_METHOD(9)
		J2CPP_DECLARE_METHOD(10)
		J2CPP_DECLARE_METHOD(11)
		J2CPP_DECLARE_METHOD(12)
		J2CPP_DECLARE_METHOD(13)
		J2CPP_DECLARE_METHOD(14)
		J2CPP_DECLARE_METHOD(15)
		J2CPP_DECLARE_METHOD(16)
		J2CPP_DECLARE_METHOD(17)

		explicit AtomicLong(jobject jobj)
		: object<AtomicLong>(jobj)
		{
		}

		operator local_ref<java::lang::Number>() const;
		operator local_ref<java::lang::Object>() const;
		operator local_ref<java::io::Serializable>() const;

		AtomicLong(jlong);
		AtomicLong();
		jlong get();
		void set(jlong);
		jlong getAndSet(jlong);
		jboolean compareAndSet(jlong, jlong);
		jboolean weakCompareAndSet(jlong, jlong);
		jlong getAndIncrement();
		jlong getAndDecrement();
		jlong getAndAdd(jlong);
		jlong incrementAndGet();
		jlong decrementAndGet();
		jlong addAndGet(jlong);
		local_ref< java::lang::String > toString();
		jint intValue();
		jlong longValue();
		jfloat floatValue();
		jdouble doubleValue();
	}; //class AtomicLong

} //namespace atomic
} //namespace concurrent
} //namespace util
} //namespace java

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMICLONG_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMICLONG_HPP_IMPL
#define J2CPP_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMICLONG_HPP_IMPL

namespace j2cpp {

java::util::concurrent::atomic::AtomicLong::operator local_ref<java::lang::Number>() const
{
	return local_ref<java::lang::Number>(get_jobject());
}

java::util::concurrent::atomic::AtomicLong::operator local_ref<java::lang::Object>() const
{
	return local_ref<java::lang::Object>(get_jobject());
}

java::util::concurrent::atomic::AtomicLong::operator local_ref<java::io::Serializable>() const
{
	return local_ref<java::io::Serializable>(get_jobject());
}

java::util::concurrent::atomic::AtomicLong::AtomicLong(jlong a0)
: object<java::util::concurrent::atomic::AtomicLong>(
	call_new_object<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(0),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(0)
	>(a0)
)
{
}

java::util::concurrent::atomic::AtomicLong::AtomicLong()
: object<java::util::concurrent::atomic::AtomicLong>(
	call_new_object<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(1),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(1)
	>()
)
{
}

jlong java::util::concurrent::atomic::AtomicLong::get()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(2),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(2),
		jlong
	>(get_jobject());
}

void java::util::concurrent::atomic::AtomicLong::set(jlong a0)
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(3),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(3),
		void
	>(get_jobject(), a0);
}

jlong java::util::concurrent::atomic::AtomicLong::getAndSet(jlong a0)
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(4),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(4),
		jlong
	>(get_jobject(), a0);
}

jboolean java::util::concurrent::atomic::AtomicLong::compareAndSet(jlong a0, jlong a1)
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(5),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(5),
		jboolean
	>(get_jobject(), a0, a1);
}

jboolean java::util::concurrent::atomic::AtomicLong::weakCompareAndSet(jlong a0, jlong a1)
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(6),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(6),
		jboolean
	>(get_jobject(), a0, a1);
}

jlong java::util::concurrent::atomic::AtomicLong::getAndIncrement()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(7),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(7),
		jlong
	>(get_jobject());
}

jlong java::util::concurrent::atomic::AtomicLong::getAndDecrement()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(8),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(8),
		jlong
	>(get_jobject());
}

jlong java::util::concurrent::atomic::AtomicLong::getAndAdd(jlong a0)
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(9),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(9),
		jlong
	>(get_jobject(), a0);
}

jlong java::util::concurrent::atomic::AtomicLong::incrementAndGet()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(10),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(10),
		jlong
	>(get_jobject());
}

jlong java::util::concurrent::atomic::AtomicLong::decrementAndGet()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(11),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(11),
		jlong
	>(get_jobject());
}

jlong java::util::concurrent::atomic::AtomicLong::addAndGet(jlong a0)
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(12),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(12),
		jlong
	>(get_jobject(), a0);
}

local_ref< java::lang::String > java::util::concurrent::atomic::AtomicLong::toString()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(13),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(13),
		local_ref< java::lang::String >
	>(get_jobject());
}

jint java::util::concurrent::atomic::AtomicLong::intValue()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(14),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(14),
		jint
	>(get_jobject());
}

jlong java::util::concurrent::atomic::AtomicLong::longValue()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(15),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(15),
		jlong
	>(get_jobject());
}

jfloat java::util::concurrent::atomic::AtomicLong::floatValue()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(16),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(16),
		jfloat
	>(get_jobject());
}

jdouble java::util::concurrent::atomic::AtomicLong::doubleValue()
{
	return call_method<
		java::util::concurrent::atomic::AtomicLong::J2CPP_CLASS_NAME,
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_NAME(17),
		java::util::concurrent::atomic::AtomicLong::J2CPP_METHOD_SIGNATURE(17),
		jdouble
	>(get_jobject());
}

J2CPP_DEFINE_CLASS(java::util::concurrent::atomic::AtomicLong,"java/util/concurrent/atomic/AtomicLong")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,0,"<init>","(J)V")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,1,"<init>","()V")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,2,"get","()J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,3,"set","(J)V")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,4,"getAndSet","(J)J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,5,"compareAndSet","(JJ)Z")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,6,"weakCompareAndSet","(JJ)Z")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,7,"getAndIncrement","()J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,8,"getAndDecrement","()J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,9,"getAndAdd","(J)J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,10,"incrementAndGet","()J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,11,"decrementAndGet","()J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,12,"addAndGet","(J)J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,13,"toString","()Ljava/lang/String;")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,14,"intValue","()I")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,15,"longValue","()J")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,16,"floatValue","()F")
J2CPP_DEFINE_METHOD(java::util::concurrent::atomic::AtomicLong,17,"doubleValue","()D")

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_CONCURRENT_ATOMIC_ATOMICLONG_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
package com.sbgapps.scoreit.utils;

import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.StateListDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.util.TypedValue;

/**
 * Created by Stéphane on 14/10/2014.
 */
public class Utils {

    public static int shiftColorDown(int color) {
        float[] hsv = new float[3];
        Color.colorToHSV(color, hsv);
        hsv[2] *= 0.9f; // value component
        return Color.HSVToColor(hsv);
    }

    public static int shiftColorUp(int color) {
        float[] hsv = new float[3];
        Color.colorToHSV(color, hsv);
        hsv[2] *= 1.1f; // value component
        return Color.HSVToColor(hsv);
    }

    public static Drawable createSelector(int color) {
        ShapeDrawable darkerCircle = new ShapeDrawable(new OvalShape());
        darkerCircle.getPaint().setColor(translucentColor(shiftColorDown(color)));
        StateListDrawable stateListDrawable = new StateListDrawable();
        stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, darkerCircle);
        return stateListDrawable;
    }

    public static int translucentColor(int color) {
        final float factor = 0.7f;
        int alpha = Math.round(Color.alpha(color) * factor);
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        return Color.argb(alpha, red, green, blue);
    }

    public static int dpToPx(float dp, Resources resources) {
        float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                dp, resources.getDisplayMetrics());
        return (int) px;
    }

    public static int spToPx(int textSizeSp, Resources resources) {
        final float density = resources.getDisplayMetrics().density;
        return (int) (0.5f + density * textSizeSp);
    }

    public static boolean hasLollipopApi() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
    }
}


text:
from django.contrib import admin
from dictionaries.models import Category, DictionariesType, Dictionary

class DictionariesTypeAdmin(admin.ModelAdmin):
    list_display = ('name', 'category', 'slug', 'position')
    list_filter = ('category',)

class DictionaryAdmin(admin.ModelAdmin):
    list_display = ('name', 'type')
    list_filter = ('type',)

admin.site.register(Category)
admin.site.register(DictionariesType, DictionariesTypeAdmin)
admin.site.register(Dictionary, DictionaryAdmin)


text:
// RobotBuilder Version: 2.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.

package org.usfirst.frc3824.PrototypePrinted.subsystems;

import org.usfirst.frc3824.PrototypePrinted.RobotMap;
import org.usfirst.frc3824.PrototypePrinted.commands.*;
import org.usfirst.frc3824.PrototypePrinted.Constants;

import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.TalonSRX;

import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 *
 */
public class Shooter extends Subsystem
{
	private boolean m_enabled = true;

	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS

	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    private final SpeedController wheelRight = RobotMap.shooterWheelRight;
    private final SpeedController wheelLeft = RobotMap.shooterWheelLeft;
    private final Solenoid ballShooter = RobotMap.shooterBallShooter;

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS

	// Put methods for controlling this subsystem
	// here. Call these from Commands.

	public void initDefaultCommand()
	{
		// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND

        setDefaultCommand(new ShooterWheelSpeedControl());

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND

		// Set the default command for a subsystem here.
		// setDefaultCommand(new MySpecialCommand());
	}

	/**
	 * Method to enable or disable the shooter wheels. Note: The actual control
	 * of the shooter wheels is in the default ShooterControl command.
	 */
	public void ShooterWheelEnableDisable(boolean enable)
	{
		// Remember the requested state of the shooter wheels
		m_enabled = enable;
		SmartDashboard.putBoolean("Shooter Enabled", enable);
	}

	/**
	 * Method to determine if the shooter wheels are enabled
	 */
	public boolean IsShooterWheelEnabled()
	{
		// Return the state of the shooter wheels
		return (m_enabled);
	}

	/**
	 * Method to enable the shooter with the specified speed. The method can
	 * also disable the shooter with a speed of zero.
	 */
	public void ShooterWheelControl(double speed)
	{
		ShooterWheelControl(speed,0);
	}

	/**
	 * Method to enable the shooter with the specified speed and curve
	 * Curve is a percent of the speed parameter to be added to the right and subtracted from the left
	 * Positve curves right, Negative curves left
	 */
	public void ShooterWheelControl(double speed, double curvePercent)
	{
		// Set the shooter wheel motor speeds
		// Note: The multiplier is to ensure maximum speed is reached
		// The multiplier also reduces the minimum speed

		double curvePart = speed * curvePercent;

		if (speed<0)
		{
			wheelRight.set(speed * Constants.SHOOTER_WHEEL_MIN_MULTIPLIER+curvePart);
			wheelLeft.set(speed * Constants.SHOOTER_WHEEL_MIN_MULTIPLIER-curvePart);
		} else {
			wheelRight.set(speed * Constants.SHOOTER_WHEEL_MAX_MULTIPLIER+curvePart);
			wheelLeft.set(speed * Constants.SHOOTER_WHEEL_MAX_MULTIPLIER-curvePart);
		}
	}

	/**
	 * Method to shoot the ball
	 */
	public void ShooterShootBallControl(boolean state)
	{
		// Control the gear shift piston
		ballShooter.set(state);
	}
}


text:
'use strict';

import type {SymbolicatedStackTrace} from '../../../Core/Devtools/symbolicateStackTrace';
import type {StackFrame} from '../../../Core/NativeExceptionsManager';

const LogBoxSymbolication = require('../LogBoxSymbolication');

jest.mock('../../../Core/Devtools/symbolicateStackTrace');

const symbolicateStackTrace: JestMockFn<
  $ReadOnlyArray<Array<StackFrame>>,
  Promise<SymbolicatedStackTrace>,
> = (require('../../../Core/Devtools/symbolicateStackTrace'): any);

const createStack = (methodNames: Array<string>) =>
  methodNames.map(methodName => ({
    column: null,
    file: 'file://path/to/file.js',
    lineNumber: 1,
    methodName,
  }));

describe('LogBoxSymbolication', () => {
  beforeEach(() => {
    jest.resetModules();
    symbolicateStackTrace.mockImplementation(async stack => ({
      stack,
      codeFrame: null,
    }));
  });

  it('symbolicates different stacks', () => {
    LogBoxSymbolication.symbolicate(createStack(['A', 'B', 'C']));
    LogBoxSymbolication.symbolicate(createStack(['D', 'E', 'F']));

    expect(symbolicateStackTrace.mock.calls.length).toBe(2);
  });

  it('batch symbolicates equivalent stacks', () => {
    const stack = createStack(['A', 'B', 'C']);
    LogBoxSymbolication.symbolicate(stack);
    LogBoxSymbolication.symbolicate(stack);

    expect(symbolicateStackTrace.mock.calls.length).toBe(1);
  });
});