text:
package com.parse.starter;

import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.util.Log;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.parse.ParseUser;

/**
 * Created by francy on 17/02/16.
 */
public class FindMyPosition extends Service implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {

    private GoogleApiClient mGoogleApiClient;
    private LocationRequest mLocationRequest;
    private ParseUser parseUser;
    private SharedPreferences preferences;

    @Override
    public void onCreate() {
        super.onCreate();

        mLocationRequest = new LocationRequest();
        mLocationRequest.setInterval(10000);
        mLocationRequest.setFastestInterval(5000);
        mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);  //valutare bilanciato con battery

        preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());

        mGoogleApiClient = new GoogleApiClient.Builder(getApplicationContext())
                .addConnectionCallbacks(FindMyPosition.this)
                .addOnConnectionFailedListener(FindMyPosition.this)
                .addApi(LocationServices.API)
                .build();

        mGoogleApiClient.connect();

        Log.i("ServicePosition", "onCreate");

    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onConnected(Bundle bundle) {

        if (mGoogleApiClient.isConnected()) {

            Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);

            LocationServices.FusedLocationApi.requestLocationUpdates(
                    mGoogleApiClient, mLocationRequest, new com.google.android.gms.location.LocationListener() {      // Find my position.
                        @Override
                        public void onLocationChanged(Location location) {

                            Log.i("ServicePosition", "locationChanged");
                            parseUser = ParseUser.getCurrentUser();
                            Location l = location;

                            double lat = l.getLatitude();
                            double longit = l.getLongitude();
                            parseUser.put(UserKey.LAT_KEY, lat);
                            parseUser.put(UserKey.LNG_KEY, longit);
                            parseUser.saveInBackground();

                            preferences.edit().putString(UserKey.PREF_LNG_KEY, String.valueOf(longit)).apply();
                            preferences.edit().putString(UserKey.PREF_LAT_KEY, String.valueOf(lat)).apply();

                        }
                    });

        }

    }

    @Override
    public void onDestroy() {
        super.onDestroy();

        Log.i("ServicePosition", "stop");
    }

    @Override
    public void onConnectionSuspended(int i) {

    }

    @Override
    public void onConnectionFailed(ConnectionResult connectionResult) {

    }
}


text:
import argparse
from scutils.argparse_helper import ArgparseHelper

parser = argparse.ArgumentParser(
    description='example_ah.py: Prints various family members', add_help=False)
parser.add_argument('-h', '--help', action=ArgparseHelper,
                    help='show this help message and exit')
# use the default argparse setup, comment out the lines above
#parser = argparse.ArgumentParser(
#    description='example_ah.py: Prints various family members')

subparsers = parser.add_subparsers(help='commands', dest='command')

# args here are applied to all sub commands using the `parents` parameter
base_parser = argparse.ArgumentParser(add_help=False)
base_parser.add_argument('-n', '--name', action='store', required=True,
                        help="The name of the person running the program")

# subcommand 1, requires name of brother
bro_parser = subparsers.add_parser('bro', help='Prints only the brother\'s name',
                                   parents=[base_parser])
bro_parser.add_argument('-b', '--brother', action='store', required=True,
                         help="The brother's name")

# subcommand 2, requires name of sister and optionally mom
fam_parser = subparsers.add_parser('fam', help='Prints mom and sister\'s name',
                                   parents=[base_parser])
fam_parser.add_argument('-s', '--sister', action='store', required=True,
                         help="The sister's name")
fam_parser.add_argument('-m', '--mom', action='store', required=False,
                         default='Mom', help="The sister's name")

args = vars(parser.parse_args())

if args['command'] == 'bro':
    print "Your brother's name is " + args['brother']
elif args['command'] == 'fam':
    print "Your sister's name is " + args['sister'] + " and you call your "\
        "Mother '" + args['mom'] + "'"

redpajama_set_name: RedPajamaGithub


text:
namespace Target
{
    public class DeviceStorageItem
    {
        public string DeviceId { get; set; }
        public string Key { get; set; }
        public string Value { get; set; }
    }
}


text:
#include <cppassert/CppAssert.hpp>
#include <cppassert/details/DebugPrint.hpp>
#include <cppassert/details/AssertionMessage.hpp>
#include <cppassert/details/Helpers.hpp>
#include <cppassert/AssertionFailure.hpp>
#include <cppassert/details/StackTrace.hpp>
#include <cstdlib>
#include <cstdio>

namespace cppassert
{
using AssertionMessage = internal::AssertionMessage;

namespace internal
{

void onAssertionFailureDefaultHandler(const AssertionFailure &assertion)
{
    const std::string errorAsStr
        = CppAssert::getInstance()->formatAssertionMessage(assertion);

    PrintMessageToStdErr(errorAsStr.c_str());

#if defined(WIN32)
    /*
     * We used to call DebugBreak() on Windows, but amazingly, it causes
     * the MSVS 2010 debugger not to be able to recover a call stack.
     */
    *((int *) NULL) = 0;
    exit(3);
#elif defined(__APPLE__)
    /*
     * On Mac OS X, Breakpad ignores signals. Only real Mach exceptions are
     * trapped.
     */
    *((int *) NULL) = 0;  /* To continue from here in GDB: "return" then "continue". */
    ::abort();  /* In case above statement gets nixed by the optimizer. */
#else
    std::abort(); /* To continue from here in GDB: "signal 0". */
#endif

}
} //internal

std::string DefaultFormatter::formatBoolFailureMessage(const char* expressionText,
                                    const char* actualPredicateValue,
                                    const char* expectedPredicateValue)
{
    AssertionMessage msg;
    msg << "Assertion failure value of: " << expressionText
        << "\n  Actual: " << actualPredicateValue;
    msg << "\nExpected: " << expectedPredicateValue;
    return msg.str();
}

std::string DefaultFormatter::formatStreamedMessage(const std::string &message)
{
    AssertionMessage msg;
    msg<<'\n'<<message;
    return msg.str();
}

std::string DefaultFormatter::formatPredicateFailureMessage(const char* predicate,
                                    const char* value1Text,
                                    const char* value2Text,
                                    const std::string &value1,
                                    const std::string &value2)
{
    AssertionMessage msg;
    msg << "Assertion failure value of: ( " << value1Text <<' '<<predicate<<' '
        << value2Text<<" )";
    msg << "\n  "<<value1Text<<" evaluated to: "<<value1;
    msg << "\n  "<<value2Text<<" evaluated to: "<<value2;
    return msg.str();
}

std::string DefaultFormatter::formatAssertionMessage(const AssertionFailure &assertion)
{
    AssertionMessage error;
    error<<assertion.getSourceFileName()<<':'<<assertion.getSourceFileLine()
            <<": "<<assertion.getFunctionName()<<": ";
    error<<assertion.getMessage()<<std::endl;
    error<<assertion.getStackTrace()<<std::endl;
    return error.str();
}

std::string DefaultFormatter::formatStatementFailureMessage(const char *statement)
{
    AssertionMessage msg;
    msg<< "Assertion failure: "<<statement;
    return msg.str();
}

std::string DefaultFormatter::formatFrame(std::uint32_t frameNumber
                        , const void *address
                        , const char *symbol )
{
    AssertionMessage msg;
    msg<<std::setw(4)<<frameNumber<<' '
        <<address<<' '
        <<symbol<<std::endl;
    return msg.str();
}

} //asrt


text:
module Main where

import Bassbull
import Test.Hspec

main :: IO()
main = hspec $ do
    describe "Verify that bassbull outputs the correct data" $ do
        it "equals zero" $ do
            theSum <- getAtBatsSum "batting.csv"
            theSum `shouldBe` 4858210


text:
* [GameOfStones](http://community.topcoder.com/stat?c=problem_statement&pm=13480&rd=16079)
* [SortishDiv2](http://community.topcoder.com/stat?c=problem_statement&pm=13500&rd=16079)
* [ChocolateDividingHard](http://community.topcoder.com/stat?c=problem_statement&pm=13388&rd=16079)


text:
int main() {
	int AmericanDollars = 0, value = 0;
	double rate = 0;

	int  BritishPoundstotal, MexicanPesostotal, Japaneseyentotal , CandainDollartotal, Eurototal, IndainRupeetotal, SouthAfricatotal;

	const double Britishpounds = .6178, Mexicanpeso = 13.1544, JapaneseYen = 80.92, CandaianDollar = .9813, Euro = .757, IndainRupee = 52.53, SouthAfricaRand = 7.7522;

	std::cout << " How much US dollar you want to converts to Pounds , Pesos , Yen , Canadain Dollar , Euro , Indain Rupee , South African Rand" << std::endl;
	std::cin >> AmericanDollars;

	BritishPoundstotal = AmericanDollars * Britishpounds;
	MexicanPesostotal = AmericanDollars * Mexicanpeso;
	Japaneseyentotal = AmericanDollars * JapaneseYen;
	CandainDollartotal = AmericanDollars * CandaianDollar;
	Eurototal = AmericanDollars * Euro;
	IndainRupeetotal = AmericanDollars * IndainRupee;
	SouthAfricatotal = AmericanDollars * SouthAfricaRand;

	std::cout << "Your total for Pound is " << BritishPoundstotal << std::endl;
	std::cout << "Your total for Pesos is " << MexicanPesostotal << std::endl;
	std::cout << "Your total for Yan is " << Japaneseyentotal << std::endl;
	std::cout << "Your total for Chanadain Dollar is " << CandainDollartotal << std::endl;
	std::cout << "Your total for Euro is " << Eurototal << std::endl;
	std::cout << "Your total for Indain Rupee is " << IndainRupeetotal << std::endl;
	std::cout << "Your total for South African Rand is " << SouthAfricatotal	 << std::endl;

}


text:
.class final Lnet/clickdev/music/ui/fragments/AudioPlayerFragment$PlaybackStatus;
.super Landroid/content/BroadcastReceiver;
.source "AudioPlayerFragment.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1a
    name = "PlaybackStatus"
.end annotation

# instance fields
.field private final mReference:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference",
            "<",
            "Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method public constructor <init>(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)V
    .locals 1
    .param p1, "fragment"    # Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;

    .prologue
    .line 787
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    .line 788
    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment$PlaybackStatus;->mReference:Ljava/lang/ref/WeakReference;

    .line 789
    return-void
.end method

# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 4
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "intent"    # Landroid/content/Intent;

    .prologue
    .line 796
    iget-object v2, p0, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment$PlaybackStatus;->mReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;

    .line 797
    .local v1, "audioPlayerFragment":Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    .line 798
    .local v0, "action":Ljava/lang/String;
    const-string v2, "net.clickdev.music.metachanged"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 800
    invoke-static {}, Lnet/clickdev/music/utils/MusicUtils;->getRepeatMode()I

    move-result v2

    const/4 v3, 0x1

    if-ne v2, v3, :cond_0

    .line 801
    iget-object v2, p0, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment$PlaybackStatus;->mReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;

    # invokes: Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->createAndSetAdapter()V
    invoke-static {v2}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->access$600(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)V

    .line 805
    :cond_0
    # invokes: Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->updateNowPlayingInfo()V
    invoke-static {v1}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->access$700(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)V

    .line 806
    invoke-virtual {v1}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->dismissPopupMenu()V

    .line 824
    :cond_1
    :goto_0
    return-void

    .line 807
    :cond_2
    const-string v2, "net.clickdev.music.playstatechanged"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    .line 809
    # getter for: Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->mPlayPauseProgressButton:Lnet/clickdev/music/widgets/PlayPauseProgressButton;
    invoke-static {v1}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->access$800(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)Lnet/clickdev/music/widgets/PlayPauseProgressButton;

    move-result-object v2

    invoke-virtual {v2}, Lnet/clickdev/music/widgets/PlayPauseProgressButton;->getPlayPauseButton()Lnet/clickdev/music/widgets/PlayPauseButton;

    move-result-object v2

    invoke-virtual {v2}, Lnet/clickdev/music/widgets/PlayPauseButton;->updateState()V

    goto :goto_0

    .line 810
    :cond_3
    const-string v2, "net.clickdev.music.repeatmodechanged"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_4

    const-string v2, "net.clickdev.music.shufflemodechanged"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_5

    .line 813
    :cond_4
    # getter for: Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->mRepeatButton:Lnet/clickdev/music/widgets/RepeatButton;
    invoke-static {v1}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->access$900(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)Lnet/clickdev/music/widgets/RepeatButton;

    move-result-object v2

    invoke-virtual {v2}, Lnet/clickdev/music/widgets/RepeatButton;->updateRepeatState()V

    .line 815
    # getter for: Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->mShuffleButton:Lnet/clickdev/music/widgets/ShuffleButton;
    invoke-static {v1}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->access$1000(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)Lnet/clickdev/music/widgets/ShuffleButton;

    move-result-object v2

    invoke-virtual {v2}, Lnet/clickdev/music/widgets/ShuffleButton;->updateShuffleState()V

    .line 818
    # invokes: Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->createAndSetAdapter()V
    invoke-static {v1}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->access$600(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)V

    goto :goto_0

    .line 819
    :cond_5
    const-string v2, "net.clickdev.music.queuechanged"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_6

    .line 820
    # invokes: Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->createAndSetAdapter()V
    invoke-static {v1}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->access$600(Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;)V

    goto :goto_0

    .line 821
    :cond_6
    const-string v2, "net.clickdev.music.lyrics"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 822
    const-string v2, "lyrics"

    invoke-virtual {p2, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lnet/clickdev/music/ui/fragments/AudioPlayerFragment;->onLyrics(Ljava/lang/String;)V

    goto :goto_0
.end method


text:
function jalangiRC() {}
function Foo() {
  return {};
}

Foo.prototype = {};

new Foo();

jalangiRC(Foo.prototype);


text:
import { Request, Response } from 'express';
import * as httpStatus from 'http-status-codes';
import { User } from '../models/user.model';
import { BaseRouter } from './base.router';

export class APIRouter extends BaseRouter {

    /**
     * Request that will return the user session, this is used when the client first loads.
     * path: /api/handshake
     * method: GET
     * returns:
     *  200 LoggedIn: The client has an active session
     *  200 NotLoggedIn: No client session was found
     */
    private static async doHandShake(request: Request, response: Response): Promise<Response> {

        if (!request.session!.user.id) {
            return BaseRouter.sendResponse(response, httpStatus.OK, 'NotLoggedIn');
        }

        const user: User | undefined = await User.doQuery()
            .leftJoinAndSelect('user.characters', 'character')
            .where('user.id = :id', {id: request.session!.user.id})
            .getOne();

        if (!user) {
            // No user found that matches the ID in the session.
            delete request.session!.user.id;
            return APIRouter.sendResponse(response, httpStatus.OK, 'NotLoggedIn');
        }

        user.timesLogin++;
        user.lastLogin = new Date();
        user.save().then();

        return APIRouter.sendResponse(response, httpStatus.OK, 'LoggedIn', user.sanitizedCopy);
    }

    /**
     * Destroy the user session.
     * path: /api/logout
     * method: POST
     */
    private static async logoutUser(request: Request, response: Response): Promise<Response | void> {

        User.doQuery()
            .leftJoinAndSelect('user.characters', 'character')
            .where('user.id = :id', {id: request.session!.user.id})
            .getOne().then((user) => {
            if (user && (!user.characters || !user.characters.length)) {
                user.remove().then();
            }
        });

        request.session!.destroy(() => {
            response.end();
        });
    }

    constructor() {
        super();
        this.createGetRoute('/handshake', APIRouter.doHandShake);
        this.createPostRoute('/logout', APIRouter.logoutUser);
    }
}


text:
import { Component, Injector, OnInit, AfterViewInit, OnDestroy } from '@angular/core';
import { Router } from '@angular/router';
import { AbpSessionService } from '@abp/session/abp-session.service';

import { AppComponentBase } from '@shared/app-component-base';
import { appModuleAnimation } from '@shared/animations/routerTransition';

import { AppAuthService } from '@shared/auth/app-auth.service';

import { MenuItem } from '@shared/layout/menu-item';

@Component({
    selector: 'app-admin-sidebar',
    templateUrl: './sidebar.component.html'
})
export class SidebarComponent extends AppComponentBase implements OnInit, AfterViewInit, OnDestroy {
    menuItems: MenuItem[] =
    [
        new MenuItem('MainBanners.Header', 'Pages.MainBanners', 'fa fa-home', '/admin/home', true),
        new MenuItem('Downloads.Header', 'Pages.Downloads', 'fa fa-link', '/admin/download', true),
        new MenuItem('Homes.Header', null, 'fa fa-globe', '', true, [
            new MenuItem('Banners.Header', 'Pages.Banners', 'fa fa-diamond', '/admin/banner', true),
            new MenuItem('Articles.Header', 'Pages.Articles', 'fa fa-info', '/admin/article', true),
            new MenuItem('Feature.Header', 'Pages.Features', 'fa fa-lightbulb-o', '/admin/feature', true),
            new MenuItem('功能管理', 'Pages', 'fa fa-info', '/admin/about', true)
        ]),
        new MenuItem('用户管理', null, 'fa fa-users', '', true, [
            new MenuItem('用户', 'Pages.Users', 'fa fa-info', '/admin/users', true),
            new MenuItem('角色', 'Pages', 'fa fa-info', '/admin/about', true)
        ]),
        new MenuItem('系统管理', null, 'fa fa-cogs', '', true, [
            new MenuItem('审计日志', 'Pages', 'fa fa-info', '/admin/about', true),
            new MenuItem('系统设置', 'Pages', 'fa fa-cog', '/admin/about', true)
        ]),
        new MenuItem('Abouts.Header', 'Pages', 'fa fa-info', '/admin/about', true),
    ];

    constructor(
        injector: Injector,
        private _authService: AppAuthService,
        private _sessionService: AbpSessionService,
        private _router: Router
    ) {
        super(injector);
    }
    ngOnInit(): void {
    }
    ngAfterViewInit(): void {
    }
    ngOnDestroy() {
    }

    checkChildMenuItemPermission(menuItem: MenuItem): boolean {

        for (let i = 0; i < menuItem.items.length; i++) {
            const subMenuItem = menuItem.items[i];

            if (subMenuItem.permissionName) {
                return this.permission.isGranted(subMenuItem.permissionName);
            }

            if (!subMenuItem.requiresAuthentication) {
                return true;
            }

            if (subMenuItem.items && subMenuItem.items.length) {
                return this.checkChildMenuItemPermission(subMenuItem);
            }
            return this._sessionService.userId > 0;
        }

        return false;
    }

    showMenuItem(menuItem: MenuItem): boolean {

        if (menuItem.permissionName) {
            return this.permission.isGranted(menuItem.permissionName);
        }

        if (!menuItem.requiresAuthentication) {
            return true;
        }

        if (menuItem.items && menuItem.items.length) {
            return this.checkChildMenuItemPermission(menuItem);
        }
        return this._sessionService.userId > 0;
    }
}


text:
package com.amazonaws.services.dynamodb.datamodeling;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Interface for marking a class property as non-modeled. Applied to the getter
 * method of a non-modeled property.
 * <p>
 * All getter methods not marked with this annotation are assumed to be modeled
 * properties and included in any save() requests.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface DynamoDBIgnore {

}


text:
import ctypes

from ctypes import windll
from ctypes import wintypes

class CryptoAPIException(Exception):

    def __init__(self):
        message = self._get_windows_error()
        super(CryptoAPIException, self).__init__(message)

    def _get_windows_error(self):
        err_code = GetLastError()
        return "CryptoAPI error: 0x%0x" % err_code

class SYSTEMTIME(ctypes.Structure):
    _fields_ = [
        ('wYear', wintypes.WORD),
        ('wMonth', wintypes.WORD),
        ('wDayOfWeek', wintypes.WORD),
        ('wDay', wintypes.WORD),
        ('wHour', wintypes.WORD),
        ('wMinute', wintypes.WORD),
        ('wSecond', wintypes.WORD),
        ('wMilliseconds', wintypes.WORD),
    ]

class FILETIME(ctypes.Structure):
    _fields_ = [
        ('dwLowDateTime', wintypes.DWORD),
        ('dwHighDateTime', wintypes.DWORD),
    ]

class CERT_CONTEXT(ctypes.Structure):
    _fields_ = [
        ('dwCertEncodingType', wintypes.DWORD),
        ('pbCertEncoded', ctypes.POINTER(wintypes.BYTE)),
        ('cbCertEncoded', wintypes.DWORD),
        ('pCertInfo', ctypes.c_void_p),
        ('hCertStore', wintypes.HANDLE),
    ]

class CRYPTOAPI_BLOB(ctypes.Structure):
    _fields_ = [
        ('cbData', wintypes.DWORD),
        ('pbData', ctypes.POINTER(wintypes.BYTE)),
    ]

class CRYPT_ALGORITHM_IDENTIFIER(ctypes.Structure):
    _fields_ = [
        ('pszObjId', wintypes.LPSTR),
        ('Parameters', CRYPTOAPI_BLOB),
    ]

class CRYPT_KEY_PROV_PARAM(ctypes.Structure):
    _fields_ = [
        ('dwParam', wintypes.DWORD),
        ('pbData', ctypes.POINTER(wintypes.BYTE)),
        ('cbData', wintypes.DWORD),
        ('dwFlags', wintypes.DWORD),
    ]

class CRYPT_KEY_PROV_INFO(ctypes.Structure):
    _fields_ = [
        ('pwszContainerName', wintypes.LPWSTR),
        ('pwszProvName', wintypes.LPWSTR),
        ('dwProvType', wintypes.DWORD),
        ('dwFlags', wintypes.DWORD),
        ('cProvParam', wintypes.DWORD),
        ('cProvParam', ctypes.POINTER(CRYPT_KEY_PROV_PARAM)),
        ('dwKeySpec', wintypes.DWORD),
    ]

class CRYPT_DECRYPT_MESSAGE_PARA(ctypes.Structure):
    _fields_ = [
        ('cbSize', wintypes.DWORD),
        ('dwMsgAndCertEncodingType', wintypes.DWORD),
        ('cCertStore', wintypes.DWORD),
        ('rghCertStore', ctypes.POINTER(wintypes.HANDLE)),
        ('dwFlags', wintypes.DWORD),
    ]

class CERT_KEY_CONTEXT(ctypes.Structure):
    _fields_ = [
        ('cbSize', wintypes.DWORD),
        ('hNCryptKey', wintypes.HANDLE),
        ('dwKeySpec', wintypes.DWORD),
    ]

AT_KEYEXCHANGE = 1
AT_SIGNATURE = 2
CERT_NAME_UPN_TYPE = 8
CERT_SHA1_HASH_PROP_ID = 3
CERT_STORE_ADD_REPLACE_EXISTING = 3
CERT_STORE_PROV_MEMORY = wintypes.LPSTR(2)
CERT_STORE_PROV_SYSTEM = wintypes.LPSTR(10)
CERT_SYSTEM_STORE_CURRENT_USER = 0x10000
CERT_SYSTEM_STORE_LOCAL_MACHINE = 0x20000
CERT_X500_NAME_STR = 3
CERT_STORE_ADD_NEW = 1
CERT_STORE_OPEN_EXISTING_FLAG = 0x4000
CERT_STORE_CREATE_NEW_FLAG = 0x2000
CRYPT_SILENT = 64
CRYPT_MACHINE_KEYSET = 32
CRYPT_NEWKEYSET = 8
CRYPT_STRING_BASE64 = 1
PKCS_7_ASN_ENCODING = 0x10000
PROV_RSA_FULL = 1
X509_ASN_ENCODING = 1
CERT_FIND_ANY = 0
CERT_FIND_SHA1_HASH = 0x10000
CERT_KEY_PROV_INFO_PROP_ID = 2
CERT_KEY_CONTEXT_PROP_ID = 5

szOID_PKIX_KP_SERVER_AUTH = b"1.3.6.1.5.5.7.3.1"
szOID_RSA_SHA1RSA = b"1.2.840.113549.1.1.5"

advapi32 = windll.advapi32
crypt32 = windll.crypt32
kernel32 = windll.kernel32

advapi32.CryptAcquireContextW.restype = wintypes.BOOL
advapi32.CryptAcquireContextW.argtypes = [wintypes.HANDLE, wintypes.LPCWSTR,
                                          wintypes.LPCWSTR, wintypes.DWORD,
                                          wintypes.DWORD]
CryptAcquireContext = advapi32.CryptAcquireContextW

advapi32.CryptReleaseContext.restype = wintypes.BOOL
advapi32.CryptReleaseContext.argtypes = [wintypes.HANDLE, wintypes.DWORD]
CryptReleaseContext = advapi32.CryptReleaseContext

advapi32.CryptGenKey.restype = wintypes.BOOL
advapi32.CryptGenKey.argtypes = [wintypes.HANDLE,
                                 wintypes.DWORD,
                                 wintypes.DWORD,
                                 ctypes.POINTER(wintypes.HANDLE)]
CryptGenKey = advapi32.CryptGenKey

advapi32.CryptDestroyKey.restype = wintypes.BOOL
advapi32.CryptDestroyKey.argtypes = [wintypes.HANDLE]
CryptDestroyKey = advapi32.CryptDestroyKey

crypt32.CertStrToNameW.restype = wintypes.BOOL
crypt32.CertStrToNameW.argtypes = [wintypes.DWORD, wintypes.LPCWSTR,
                                   wintypes.DWORD, ctypes.c_void_p,
                                   ctypes.POINTER(wintypes.BYTE),
                                   ctypes.POINTER(wintypes.DWORD),
                                   ctypes.POINTER(wintypes.LPCWSTR)]
CertStrToName = crypt32.CertStrToNameW

# TODO(alexpilotti): the following time related functions are not CryptoAPI
# specific, putting them in a separate module would be more correct
kernel32.GetSystemTime.restype = None
kernel32.GetSystemTime.argtypes = [ctypes.POINTER(SYSTEMTIME)]
GetSystemTime = kernel32.GetSystemTime

kernel32.SystemTimeToFileTime.restype = wintypes.BOOL
kernel32.SystemTimeToFileTime.argtypes = [ctypes.POINTER(SYSTEMTIME),
                                          ctypes.POINTER(FILETIME)]
SystemTimeToFileTime = kernel32.SystemTimeToFileTime

kernel32.FileTimeToSystemTime.restype = wintypes.BOOL
kernel32.FileTimeToSystemTime.argtypes = [ctypes.POINTER(FILETIME),
                                          ctypes.POINTER(SYSTEMTIME)]
FileTimeToSystemTime = kernel32.FileTimeToSystemTime

# TODO(alexpilotti): this is not a CryptoAPI function, putting it in a separate
# module would be more correct
kernel32.GetLastError.restype = wintypes.DWORD
kernel32.GetLastError.argtypes = []
GetLastError = kernel32.GetLastError

crypt32.CertCreateSelfSignCertificate.restype = ctypes.POINTER(CERT_CONTEXT)
crypt32.CertCreateSelfSignCertificate.argtypes = [
    wintypes.HANDLE,
    ctypes.POINTER(CRYPTOAPI_BLOB),
    wintypes.DWORD,
    ctypes.POINTER(CRYPT_KEY_PROV_INFO),
    ctypes.POINTER(CRYPT_ALGORITHM_IDENTIFIER),
    ctypes.POINTER(SYSTEMTIME),
    ctypes.POINTER(SYSTEMTIME),
    # PCERT_EXTENSIONS
    ctypes.c_void_p]
CertCreateSelfSignCertificate = crypt32.CertCreateSelfSignCertificate

crypt32.CertAddEnhancedKeyUsageIdentifier.restype = wintypes.BOOL
crypt32.CertAddEnhancedKeyUsageIdentifier.argtypes = [
    ctypes.POINTER(CERT_CONTEXT),
    wintypes.LPCSTR]
CertAddEnhancedKeyUsageIdentifier = crypt32.CertAddEnhancedKeyUsageIdentifier

crypt32.CertOpenStore.restype = wintypes.HANDLE
crypt32.CertOpenStore.argtypes = [wintypes.LPCSTR, wintypes.DWORD,
                                  wintypes.HANDLE, wintypes.DWORD,
                                  ctypes.c_void_p]
CertOpenStore = crypt32.CertOpenStore

crypt32.CertAddCertificateContextToStore.restype = wintypes.BOOL
crypt32.CertAddCertificateContextToStore.argtypes = [
    wintypes.HANDLE,
    ctypes.POINTER(CERT_CONTEXT),
    wintypes.DWORD,
    ctypes.POINTER(CERT_CONTEXT)]
CertAddCertificateContextToStore = crypt32.CertAddCertificateContextToStore

crypt32.CryptStringToBinaryW.restype = wintypes.BOOL
crypt32.CryptStringToBinaryW.argtypes = [wintypes.LPCWSTR,
                                         wintypes.DWORD,
                                         wintypes.DWORD,
                                         ctypes.POINTER(wintypes.BYTE),
                                         ctypes.POINTER(wintypes.DWORD),
                                         ctypes.POINTER(wintypes.DWORD),
                                         ctypes.POINTER(wintypes.DWORD)]
CryptStringToBinaryW = crypt32.CryptStringToBinaryW

crypt32.CertAddEncodedCertificateToStore.restype = wintypes.BOOL
crypt32.CertAddEncodedCertificateToStore.argtypes = [
    wintypes.HANDLE,
    wintypes.DWORD,
    ctypes.POINTER(wintypes.BYTE),
    wintypes.DWORD,
    wintypes.DWORD,
    ctypes.POINTER(ctypes.POINTER(CERT_CONTEXT))]
CertAddEncodedCertificateToStore = crypt32.CertAddEncodedCertificateToStore

crypt32.CertGetNameStringW.restype = wintypes.DWORD
crypt32.CertGetNameStringW.argtypes = [ctypes.POINTER(CERT_CONTEXT),
                                       wintypes.DWORD,
                                       wintypes.DWORD,
                                       ctypes.c_void_p,
                                       wintypes.LPWSTR,
                                       wintypes.DWORD]
CertGetNameString = crypt32.CertGetNameStringW

crypt32.CertFreeCertificateContext.restype = wintypes.BOOL
crypt32.CertFreeCertificateContext.argtypes = [ctypes.POINTER(CERT_CONTEXT)]
CertFreeCertificateContext = crypt32.CertFreeCertificateContext

crypt32.CertCloseStore.restype = wintypes.BOOL
crypt32.CertCloseStore.argtypes = [wintypes.HANDLE, wintypes.DWORD]
CertCloseStore = crypt32.CertCloseStore

crypt32.CertGetCertificateContextProperty.restype = wintypes.BOOL
crypt32.CertGetCertificateContextProperty.argtypes = [
    ctypes.POINTER(CERT_CONTEXT),
    wintypes.DWORD,
    ctypes.c_void_p,
    ctypes.POINTER(wintypes.DWORD)]
CertGetCertificateContextProperty = crypt32.CertGetCertificateContextProperty

crypt32.CryptBinaryToStringW.restype = wintypes.BOOL
crypt32.CryptBinaryToStringW.argtypes = [
    ctypes.c_void_p,
    wintypes.DWORD,
    wintypes.DWORD,
    wintypes.LPWSTR,
    ctypes.POINTER(wintypes.DWORD)]
CryptBinaryToString = crypt32.CryptBinaryToStringW

crypt32.CryptDecryptMessage.restype = wintypes.BOOL
crypt32.CryptDecryptMessage.argtypes = [
    ctypes.POINTER(CRYPT_DECRYPT_MESSAGE_PARA),
    ctypes.c_void_p,
    wintypes.DWORD,
    ctypes.c_void_p,
    ctypes.POINTER(wintypes.DWORD),
    ctypes.c_void_p]
CryptDecryptMessage = crypt32.CryptDecryptMessage

crypt32.CertAddCertificateLinkToStore.restype = wintypes.BOOL
crypt32.CertAddCertificateLinkToStore.argtypes = [
    wintypes.HANDLE,
    ctypes.POINTER(CERT_CONTEXT),
    wintypes.DWORD,
    ctypes.c_void_p
]
CertAddCertificateLinkToStore = crypt32.CertAddCertificateLinkToStore

crypt32.CertFindCertificateInStore.restype = ctypes.POINTER(CERT_CONTEXT)
crypt32.CertFindCertificateInStore.argtypes = [
    wintypes.HANDLE,
    wintypes.DWORD,
    wintypes.DWORD,
    wintypes.DWORD,
    ctypes.c_void_p,
    ctypes.c_void_p]
CertFindCertificateInStore = crypt32.CertFindCertificateInStore

crypt32.CertSetCertificateContextProperty.restype = wintypes.BOOL
crypt32.CertSetCertificateContextProperty.argtypes = [
    ctypes.POINTER(CERT_CONTEXT),
    wintypes.DWORD,
    wintypes.DWORD,
    ctypes.c_void_p]
CertSetCertificateContextProperty = crypt32.CertSetCertificateContextProperty

crypt32.PFXImportCertStore.restype = wintypes.HANDLE
crypt32.PFXImportCertStore.argtypes = [
    ctypes.POINTER(CRYPTOAPI_BLOB),
    wintypes.LPCWSTR,
    wintypes.DWORD]
PFXImportCertStore = crypt32.PFXImportCertStore

crypt32.CertDeleteCertificateFromStore.restype = wintypes.BOOL
crypt32.CertDeleteCertificateFromStore.argtypes = [
    ctypes.POINTER(CERT_CONTEXT)]
CertDeleteCertificateFromStore = crypt32.CertDeleteCertificateFromStore


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.tests;

import com.facebook.presto.Session;
import com.facebook.presto.metadata.QualifiedObjectName;
import com.facebook.presto.testing.MaterializedResult;
import com.facebook.presto.testing.MaterializedRow;
import com.facebook.presto.testing.QueryRunner;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMultiset;
import com.google.common.collect.Iterables;
import io.airlift.log.Logger;
import io.airlift.tpch.TpchTable;
import io.airlift.units.Duration;
import org.intellij.lang.annotations.Language;

import java.util.List;
import java.util.OptionalLong;

import static com.facebook.presto.util.Types.checkType;
import static io.airlift.units.Duration.nanosSince;
import static java.lang.String.format;
import static java.util.Locale.ENGLISH;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

public final class QueryAssertions
{
    private static final Logger log = Logger.get(QueryAssertions.class);

    private QueryAssertions()
    {
    }

    public static void assertUpdate(QueryRunner queryRunner, Session session, @Language("SQL") String sql, OptionalLong count)
    {
        long start = System.nanoTime();
        MaterializedResult results = queryRunner.execute(session, sql);
        log.info("FINISHED in presto: %s", nanosSince(start));

        if (!results.getUpdateType().isPresent()) {
            fail("update type is not set");
        }

        if (results.getUpdateCount().isPresent()) {
            if (!count.isPresent()) {
                fail("update count should not be present");
            }
            assertEquals(results.getUpdateCount().getAsLong(), count.getAsLong(), "update count");
        }
        else if (count.isPresent()) {
            fail("update count is not present");
        }
    }

    public static void assertQuery(QueryRunner actualQueryRunner,
            Session session,
            @Language("SQL") String actual,
            H2QueryRunner h2QueryRunner,
            @Language("SQL") String expected,
            boolean ensureOrdering,
            boolean compareUpdate)
            throws Exception
    {
        long start = System.nanoTime();
        MaterializedResult actualResults = actualQueryRunner.execute(session, actual).toJdbcTypes();
        Duration actualTime = nanosSince(start);

        long expectedStart = System.nanoTime();
        MaterializedResult expectedResults = h2QueryRunner.execute(session, expected, actualResults.getTypes());
        log.info("FINISHED in presto: %s, h2: %s, total: %s", actualTime, nanosSince(expectedStart), nanosSince(start));

        if (actualResults.getUpdateType().isPresent() || actualResults.getUpdateCount().isPresent()) {
            if (!actualResults.getUpdateType().isPresent()) {
                fail("update count present without update type");
            }
            if (!compareUpdate) {
                fail("update type should not be present (use assertUpdate)");
            }
        }

        List<MaterializedRow> actualRows = actualResults.getMaterializedRows();
        List<MaterializedRow> expectedRows = expectedResults.getMaterializedRows();

        if (compareUpdate) {
            if (!actualResults.getUpdateType().isPresent()) {
                fail("update type not present");
            }
            if (!actualResults.getUpdateCount().isPresent()) {
                fail("update count not present");
            }
            assertEquals(actualRows.size(), 1);
            assertEquals(expectedRows.size(), 1);
            MaterializedRow row = expectedRows.get(0);
            assertEquals(row.getFieldCount(), 1);
            assertEquals(row.getField(0), actualResults.getUpdateCount().getAsLong());
        }

        if (ensureOrdering) {
            if (!actualRows.equals(expectedRows)) {
                assertEquals(actualRows, expectedRows);
            }
        }
        else {
            assertEqualsIgnoreOrder(actualRows, expectedRows);
        }
    }

    public static void assertEqualsIgnoreOrder(Iterable<?> actual, Iterable<?> expected)
    {
        assertNotNull(actual, "actual is null");
        assertNotNull(expected, "expected is null");

        ImmutableMultiset<?> actualSet = ImmutableMultiset.copyOf(actual);
        ImmutableMultiset<?> expectedSet = ImmutableMultiset.copyOf(expected);
        if (!actualSet.equals(expectedSet)) {
            fail(format("not equal\nActual %s rows:\n    %s\nExpected %s rows:\n    %s\n",
                    actualSet.size(),
                    Joiner.on("\n    ").join(Iterables.limit(actualSet, 100)),
                    expectedSet.size(),
                    Joiner.on("\n    ").join(Iterables.limit(expectedSet, 100))));
        }
    }

    public static void assertContains(MaterializedResult actual, MaterializedResult expected)
    {
        for (MaterializedRow row : expected.getMaterializedRows()) {
            if (!actual.getMaterializedRows().contains(row)) {
                fail(format("expected row missing: %s\nActual %s rows:\n    %s\nExpected %s rows:\n    %s\n",
                        row,
                        actual.getMaterializedRows().size(),
                        Joiner.on("\n    ").join(Iterables.limit(actual, 100)),
                        expected.getMaterializedRows().size(),
                        Joiner.on("\n    ").join(Iterables.limit(expected, 100))));
            }
        }
    }

    public static void assertApproximateQuery(
            QueryRunner queryRunner,
            Session session,
            @Language("SQL") String actual,
            H2QueryRunner h2QueryRunner,
            @Language("SQL") String expected)
            throws Exception
    {
        long start = System.nanoTime();
        MaterializedResult actualResults = queryRunner.execute(session, actual);
        log.info("FINISHED in %s", nanosSince(start));

        MaterializedResult expectedResults = h2QueryRunner.execute(session, expected, actualResults.getTypes());
        assertApproximatelyEqual(actualResults.getMaterializedRows(), expectedResults.getMaterializedRows());
    }

    public static void assertApproximatelyEqual(List<MaterializedRow> actual, List<MaterializedRow> expected)
            throws Exception
    {
        // TODO: support GROUP BY queries
        assertEquals(actual.size(), 1, "approximate query returned more than one row");

        MaterializedRow actualRow = actual.get(0);
        MaterializedRow expectedRow = expected.get(0);

        for (int i = 0; i < actualRow.getFieldCount(); i++) {
            String actualField = (String) actualRow.getField(i);
            double actualValue = Double.parseDouble(actualField.split(" ")[0]);
            double error = Double.parseDouble(actualField.split(" ")[2]);
            Object expectedField = expectedRow.getField(i);
            assertTrue(expectedField instanceof String || expectedField instanceof Number);
            double expectedValue;
            if (expectedField instanceof String) {
                expectedValue = Double.parseDouble((String) expectedField);
            }
            else {
                expectedValue = ((Number) expectedField).doubleValue();
            }
            assertTrue(Math.abs(actualValue - expectedValue) < error);
        }
    }

    public static void copyTpchTables(
            QueryRunner queryRunner,
            String sourceCatalog,
            String sourceSchema,
            Session session,
            Iterable<TpchTable<?>> tables)
            throws Exception
    {
        log.info("Loading data from %s.%s...", sourceCatalog, sourceSchema);
        long startTime = System.nanoTime();
        for (TpchTable<?> table : tables) {
            copyTable(queryRunner, sourceCatalog, sourceSchema, table.getTableName().toLowerCase(ENGLISH), session);
        }
        log.info("Loading from %s.%s complete in %s", sourceCatalog, sourceSchema, nanosSince(startTime).toString(SECONDS));
    }

    public static void copyTable(QueryRunner queryRunner, String sourceCatalog, String sourceSchema, String sourceTable, Session session)
            throws Exception
    {
        QualifiedObjectName table = new QualifiedObjectName(sourceCatalog, sourceSchema, sourceTable);
        copyTable(queryRunner, table, session);
    }

    public static void copyTable(QueryRunner queryRunner, QualifiedObjectName table, Session session)
    {
        long start = System.nanoTime();
        log.info("Running import for %s", table.getObjectName());
        @Language("SQL") String sql = format("CREATE TABLE %s AS SELECT * FROM %s", table.getObjectName(), table);
        long rows = checkType(queryRunner.execute(session, sql).getMaterializedRows().get(0).getField(0), Long.class, "rows");
        log.info("Imported %s rows for %s in %s", rows, table.getObjectName(), nanosSince(start).convertToMostSuccinctTimeUnit());
    }
}


text:
extern "C" {
#include <slu_ddefs.h>
#include <slu_util.h>
}

#include <algorithm>

#include "tlin/tlin_cblas_wrap.h"

#include "tlin/tlin_superlu_wrap.h"

//*************************************************************************
//    Preliminaries
//*************************************************************************

struct tlin::SuperMatrix final : public ::SuperMatrix {};
struct tlin::superlu_options_t final : public ::superlu_options_t {};

//=======================================================================

namespace {
static const tlin::spmat::HashMap::size_t neg = -1;

bool initialized = false;
static tlin::superlu_options_t defaultOpt;

struct DefaultOptsInitializer {
  DefaultOptsInitializer() {
    set_default_options(&defaultOpt);
    defaultOpt.PrintStat = NO;
  }
} _instance;

inline bool rowLess(const tlin::spmat::HashMap::BucketNode *a,
                    const tlin::spmat::HashMap::BucketNode *b) {
  return a->m_key.first < b->m_key.first;
}
}

//*************************************************************************
//    SuperLU-specific Functions
//*************************************************************************

void tlin::allocS(SuperMatrix *&A, int rows, int cols, int nnz) {
  A              = (SuperMatrix *)SUPERLU_MALLOC(sizeof(SuperMatrix));
  double *values = doubleMalloc(nnz);
  int *rowind    = intMalloc(nnz);
  int *colptr    = intMalloc(cols + 1);

  dCreate_CompCol_Matrix(A, rows, cols, nnz, values, rowind, colptr, SLU_NC,
                         SLU_D, SLU_GE);
}

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

void tlin::allocD(SuperMatrix *&A, int rows, int cols) {
  A = (SuperMatrix *)SUPERLU_MALLOC(sizeof(SuperMatrix));

  double *values = doubleMalloc(rows * cols * sizeof(double));
  dCreate_Dense_Matrix(A, rows, cols, values, rows, SLU_DN, SLU_D, SLU_GE);
}

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

void tlin::allocS(SuperMatrix *&A, int rows, int cols, int nnz, int *colptr,
                  int *rowind, double *values) {
  A = (SuperMatrix *)SUPERLU_MALLOC(sizeof(SuperMatrix));
  dCreate_CompCol_Matrix(A, rows, cols, nnz, values, rowind, colptr, SLU_NC,
                         SLU_D, SLU_GE);
}

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

void tlin::allocD(SuperMatrix *&A, int rows, int cols, int lda,
                  double *values) {
  A = (SuperMatrix *)SUPERLU_MALLOC(sizeof(SuperMatrix));
  dCreate_Dense_Matrix(A, rows, cols, values, lda, SLU_DN, SLU_D, SLU_GE);
}

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

void tlin::freeS(SuperMatrix *m) {
  if (!m) return;
  Destroy_CompCol_Matrix(m);
  SUPERLU_FREE(m);
}

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

void tlin::freeD(SuperMatrix *m) {
  if (!m) return;
  Destroy_Dense_Matrix(m);
  SUPERLU_FREE(m);
}

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

void tlin::createS(SuperMatrix &A, int rows, int cols, int nnz) {
  double *values = doubleMalloc(nnz);
  int *rowind    = intMalloc(nnz);
  int *colptr    = intMalloc(cols + 1);

  dCreate_CompCol_Matrix(&A, rows, cols, nnz, values, rowind, colptr, SLU_NC,
                         SLU_D, SLU_GE);
}

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

void tlin::createD(SuperMatrix &A, int rows, int cols) {
  double *values = doubleMalloc(rows * cols * sizeof(double));
  dCreate_Dense_Matrix(&A, rows, cols, values, rows, SLU_DN, SLU_D, SLU_GE);
}

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

void tlin::createS(SuperMatrix &A, int rows, int cols, int nnz, int *colptr,
                   int *rowind, double *values) {
  dCreate_CompCol_Matrix(&A, rows, cols, nnz, values, rowind, colptr, SLU_NC,
                         SLU_D, SLU_GE);
}

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

void tlin::createD(SuperMatrix &A, int rows, int cols, int lda,
                   double *values) {
  dCreate_Dense_Matrix(&A, rows, cols, values, lda, SLU_DN, SLU_D, SLU_GE);
}

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

void tlin::destroyS(SuperMatrix &A, bool destroyData) {
  if (destroyData)
    Destroy_CompCol_Matrix(&A);
  else
    SUPERLU_FREE(A.Store);
}

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

void tlin::destroyD(SuperMatrix &A, bool destroyData) {
  if (destroyData)
    Destroy_Dense_Matrix(&A);
  else
    SUPERLU_FREE(A.Store);
}

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

void tlin::freeF(SuperFactors *F) {
  if (!F) return;
  Destroy_SuperNode_Matrix(F->L);
  Destroy_CompCol_Matrix(F->U);
  SUPERLU_FREE(F->L);
  SUPERLU_FREE(F->U);
  SUPERLU_FREE(F->perm_r);
  SUPERLU_FREE(F->perm_c);
  SUPERLU_FREE(F);
}

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

void tlin::readDN(SuperMatrix *A, int &lda, double *&values) {
  assert(A->Stype == SLU_DN);
  DNformat *storage = (DNformat *)A->Store;

  lda    = storage->lda;
  values = (double *)storage->nzval;
}

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

void tlin::readNC(SuperMatrix *A, int &nnz, int *&colptr, int *&rowind,
                  double *&values) {
  assert(A->Stype == SLU_NC);  // Only SLU_NC (CCS) format is supported here
  NCformat *storage = (NCformat *)A->Store;

  nnz    = storage->nnz;
  values = (double *)storage->nzval;
  rowind = (int *)storage->rowind;
  colptr = (int *)storage->colptr;
}

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

void tlin::traduceD(const mat &m, SuperMatrix *&A) {
  int rows = m.rows(), cols = m.cols();

  if (!A) allocD(A, rows, cols);

  int lda;
  double *Avalues = 0;
  readDN(A, lda, Avalues);

  assert(A->nrow == rows && A->ncol == cols && lda == rows);

  memcpy(Avalues, m.values(), rows * cols * sizeof(double));
}

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

void tlin::traduceS(spmat &m, SuperMatrix *&A) {
  int rows = m.rows(), cols = m.cols(), nnz = (int)m.entries().size();
  spmat::HashMap &entries = m.entries();

  // Build or extract pointers to out's data
  double *values;
  int *rowind, *colptr;

  if (!A) allocS(A, rows, cols, nnz);

  // Retrieve NC arrays from A
  int Annz;
  readNC(A, Annz, colptr, rowind, values);
  assert(A->nrow == rows && A->ncol == cols && Annz == nnz);

  // Rehash to cols buckets
  if (entries.hashFunctor().m_cols != cols) entries.hashFunctor().m_cols = cols;
  entries.rehash(cols);

  // Copy each bucket to the corresponding col
  const std::vector<spmat::HashMap::size_t> &buckets = m.entries().buckets();
  const tcg::list<spmat::HashMap::BucketNode> &nodes = m.entries().items();

  std::vector<const spmat::HashMap::BucketNode *> colEntries;
  std::vector<const spmat::HashMap::BucketNode *>::size_type j, size;

  double *currVal = values;
  int *currRowind = rowind;

  for (int i = 0; i < cols; ++i) {
    colptr[i]                      = (int)(currVal - values);
    spmat::HashMap::size_t nodeIdx = buckets[i];

    // Retrieve all column entry pointers.
    colEntries.clear();
    while (nodeIdx != neg) {
      const spmat::HashMap::BucketNode &node = nodes[nodeIdx];
      colEntries.push_back(&node);
      nodeIdx = nodes[nodeIdx].m_next;
    }

    // Sort them by row
    std::sort(colEntries.begin(), colEntries.end(), rowLess);

    // Finally, write them in the SuperMatrix
    size = colEntries.size();
    for (j = 0; j < size; ++j) {
      const spmat::HashMap::BucketNode &node = *colEntries[j];

      *currRowind = node.m_key.first;
      *currVal    = node.m_val;

      ++currVal, ++currRowind;
    }
  }

  colptr[cols] = nnz;
}

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

void tlin::traduceD(const tlin::sparse_matrix<double> &m, SuperMatrix *&A) {
  int rows = m.rows(), cols = m.cols();
  const spmat::HashMap &entries = m.entries();

  // Build or extract pointers to out's data
  double *values;

  if (!A) allocD(A, rows, cols);

  // Retrieve DN arrays from A
  int lda;
  readDN(A, lda, values);
  assert(A->nrow == rows && A->ncol == cols && lda == rows);

  // Copy each value in entries to A
  spmat::HashMap::const_iterator it;
  for (it = entries.begin(); it != entries.end(); ++it)
    values[it->m_key.second * rows + it->m_key.first] = it->m_val;
}

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

void tlin::factorize(SuperMatrix *A, SuperFactors *&F, superlu_options_t *opt) {
  assert(A->nrow == A->ncol);
  int n = A->nrow;

  if (!F) F = (SuperFactors *)SUPERLU_MALLOC(sizeof(SuperFactors));

  if (!opt) opt = &defaultOpt;

  F->perm_c = intMalloc(n);

  get_perm_c(3, A, F->perm_c);

  SuperMatrix AC;
  int *etree = intMalloc(n);

  sp_preorder(opt, A, F->perm_c, etree, &AC);

  F->L      = (SuperMatrix *)SUPERLU_MALLOC(sizeof(SuperMatrix));
  F->U      = (SuperMatrix *)SUPERLU_MALLOC(sizeof(SuperMatrix));
  F->perm_r = intMalloc(n);

  SuperLUStat_t stat;
  StatInit(&stat);

  int result;

#if defined(SUPERLU_MAJOR_VERSION) && (SUPERLU_MAJOR_VERSION >= 5)
  GlobalLU_t Glu;
  dgstrf(opt, &AC, sp_ienv(1), sp_ienv(2), etree, NULL, 0, F->perm_c, F->perm_r,
         F->L, F->U, &Glu, &stat, &result);
#else
  dgstrf(opt, &AC, sp_ienv(1), sp_ienv(2), etree, NULL, 0, F->perm_c, F->perm_r,
         F->L, F->U, &stat, &result);
#endif

  StatFree(&stat);

  Destroy_CompCol_Permuted(&AC);
  SUPERLU_FREE(etree);

  if (result != 0) freeF(F), F = 0;
}

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

void tlin::solve(SuperFactors *F, SuperMatrix *BX, superlu_options_t *opt) {
  assert(F);

  if (!opt) opt = &defaultOpt;

  SuperLUStat_t stat;
  StatInit(&stat);

  int result;
  dgstrs(NOTRANS, F->L, F->U, F->perm_c, F->perm_r, BX, &stat, &result);

  StatFree(&stat);
}

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

void tlin::solve(SuperFactors *F, SuperMatrix *B, SuperMatrix *&X,
                 superlu_options_t *opt) {
  if (!X) allocD(X, B->nrow, B->ncol);

  double *Bvalues = 0, *Xvalues = 0;
  int lda;
  readDN(B, lda, Bvalues);
  readDN(X, lda, Xvalues);
  memcpy(Xvalues, Bvalues, B->nrow * B->ncol * sizeof(double));

  solve(F, X, opt);
}

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

void tlin::solve(SuperMatrix *A, SuperMatrix *BX, superlu_options_t *opt) {
  assert(A->nrow == A->ncol);
  int n = A->nrow;

  if (!opt) opt = &defaultOpt;

  SuperMatrix L, U;
  int *perm_c, *perm_r;

  perm_c = intMalloc(n);
  perm_r = intMalloc(n);

  SuperLUStat_t stat;
  StatInit(&stat);

  int result;
  dgssv(opt, A, perm_c, perm_r, &L, &U, BX, &stat, &result);

  Destroy_SuperNode_Matrix(&L);
  Destroy_CompCol_Matrix(&U);
  SUPERLU_FREE(perm_r);
  SUPERLU_FREE(perm_c);
  StatFree(&stat);
}

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

void tlin::solve(SuperMatrix *A, SuperMatrix *B, SuperMatrix *&X,
                 superlu_options_t *opt) {
  if (!X) allocD(X, B->nrow, B->ncol);

  double *Bvalues = 0, *Xvalues = 0;
  int lda;
  readDN(B, lda, Bvalues);
  readDN(X, lda, Xvalues);
  memcpy(Xvalues, Bvalues, B->nrow * B->ncol * sizeof(double));

  solve(A, X, opt);
}

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

void tlin::solve(SuperFactors *F, double *bx, superlu_options_t *opt) {
  SuperMatrix BX;
  int rows = F->L->nrow;

  createD(BX, rows, 1, rows, bx);
  tlin::solve(F, &BX, opt);
  SUPERLU_FREE(BX.Store);
}

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

void tlin::solve(SuperFactors *F, double *b, double *&x,
                 superlu_options_t *opt) {
  SuperMatrix B, X;
  int rows = F->L->nrow;

  if (!x) x = (double *)malloc(rows * sizeof(double));

  createD(B, rows, 1, rows, b);
  createD(X, rows, 1, rows, x);

  SuperMatrix *Xptr = &X;  //&X is const
  tlin::solve(F, &B, Xptr, opt);

  SUPERLU_FREE(B.Store);
  SUPERLU_FREE(X.Store);
}

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

void tlin::solve(SuperMatrix *A, double *bx, superlu_options_t *opt) {
  SuperMatrix BX;
  int rows = A->nrow;

  createD(BX, rows, 1, rows, bx);
  tlin::solve(A, &BX, opt);
  SUPERLU_FREE(BX.Store);
}

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

void tlin::solve(SuperMatrix *A, double *b, double *&x,
                 superlu_options_t *opt) {
  SuperMatrix B, X;
  int rows = A->nrow;

  if (!x) x = (double *)malloc(rows * sizeof(double));

  createD(B, rows, 1, rows, b);
  createD(X, rows, 1, rows, x);

  SuperMatrix *Xptr = &X;  //&X is const
  tlin::solve(A, &B, Xptr, opt);
  SUPERLU_FREE(B.Store);
  SUPERLU_FREE(X.Store);
}

//*************************************************************************
//    BLAS-related Functions
//*************************************************************************

void tlin::multiplyS(const SuperMatrix *A, const double *x, double *&y) {
  /*
int sp_dgemv (char *, double, SuperMatrix *, double *,
                  int, double, double *, int);
*/

  if (!y) {
    y = (double *)malloc(A->nrow * sizeof(double));
    memset(y, 0, A->nrow * sizeof(double));
  }

  SuperMatrix *_A = const_cast<SuperMatrix *>(A);
  double *_x      = const_cast<double *>(x);

  sp_dgemv((char *)"N", 1.0, _A, _x, 1, 1.0, y, 1);
}

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

void tlin::multiplyD(const SuperMatrix *A, const double *x, double *&y) {
  int lda;
  double *values;
  tlin::readDN(const_cast<SuperMatrix *>(A), lda, values);

  tlin::multiply(A->nrow, A->ncol, values, x, y);
}


text:
package ru.spbstu.icc.kspt.kuznetsov.fpf4mir.core.facts.features;

import ru.spbstu.icc.kspt.kuznetsov.fpf4mir.core.facts.globals.GlobalFact;
import ru.spbstu.icc.kspt.kuznetsov.fpf4mir.core.utils.FPFCloneable;
import ru.spbstu.icc.kspt.kuznetsov.fpf4mir.core.utils.FactWithName;

public interface Feature extends GlobalFact, FactWithName, FPFCloneable {
	@Override public String getName();
	public String getVersion();
}


text:
package org.reldb.ldi.slip.values;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

public class TestValues {

	@Test
	public void testValueList() {
		Bunch v = new Bunch();
		v.insert(new Str("union"));
		v.insert(new Int(3));
		v.insert(new Int(4));
		Walker i = v.getWalker();
		Value p = i.next();
		assertEquals("union", p.toString());
		p = i.next();
		assertEquals("3", p.toString());
		p = i.next();
		assertEquals("4", p.toString());
		String s = v.toString();
		assertEquals("(union 3 4)", s);
	}

	@Test
	public void testValueInteger() {
		Int one = new Int(1);
		Int five = new Int(5);
		Int nFive = new Int(-5);
		assertEquals(6, one.add(five).longValue());
		assertEquals(-4, one.add(nFive).longValue());
		assertEquals(-25, nFive.mult(five).longValue());
	}

	@Test
	public void testValueBoolean() {
		Bool t = new Bool(true);
		Bool f = new Bool(false);
		assertTrue(t.neq(f).booleanValue());
		assertTrue(t.or(f).booleanValue());
		assertFalse(t.and(f).booleanValue());
	}

	@Test
	public void testValueDouble() {
		Rational onePointTwoFive = new Rational(1.25);
		Rational fivePointThree = new Rational(5.3);
		Rational nFivePointFourEight = new Rational(-5.48);
		assertEquals(6.55, onePointTwoFive.add(fivePointThree).doubleValue());
		assertEquals(-4.23, onePointTwoFive.add(nFivePointFourEight).doubleValue());
		assertEquals(-29.044, nFivePointFourEight.mult(fivePointThree).doubleValue());
	}

}


text:
'use strict';

var createReduced = require('dbjs-reduce/create');

module.exports = function (mainDb) {
	return createReduced(mainDb, 'statsBase');
};


text:
/**
 * @author Ed Spencer
 *
 * The JSON Reader is used by a Proxy to read a server response that is sent back in JSON format. This usually
 * happens as a result of loading a Store - for example we might create something like this:
 *
 *     Ext.define('User', {
 *         extend: 'Ext.data.Model',
 *         fields: ['id', 'name', 'email']
 *     });
 *
 *     var store = Ext.create('Ext.data.Store', {
 *         model: 'User',
 *         proxy: {
 *             type: 'ajax',
 *             url : 'users.json',
 *             reader: {
 *                 type: 'json'
 *             }
 *         }
 *     });
 *
 * The example above creates a 'User' model. Models are explained in the {@link Ext.data.Model Model} docs if you're
 * not already familiar with them.
 *
 * We created the simplest type of JSON Reader possible by simply telling our {@link Ext.data.Store Store}'s
 * {@link Ext.data.proxy.Proxy Proxy} that we want a JSON Reader. The Store automatically passes the configured model to the
 * Store, so it is as if we passed this instead:
 *
 *     reader: {
 *         type : 'json',
 *         model: 'User'
 *     }
 *
 * The reader we set up is ready to read data from our server - at the moment it will accept a response like this:
 *
 *     [
 *         {
 *             "id": 1,
 *             "name": "Ed Spencer",
 *             "email": "ed@sencha.com"
 *         },
 *         {
 *             "id": 2,
 *             "name": "Abe Elias",
 *             "email": "abe@sencha.com"
 *         }
 *     ]
 *
 * ## Reading other JSON formats
 *
 * If you already have your JSON format defined and it doesn't look quite like what we have above, you can usually
 * pass JsonReader a couple of configuration options to make it parse your format. For example, we can use the
 * {@link #cfg-rootProperty} configuration to parse data that comes back like this:
 *
 *     {
 *         "users": [
 *            {
 *                "id": 1,
 *                "name": "Ed Spencer",
 *                "email": "ed@sencha.com"
 *            },
 *            {
 *                "id": 2,
 *                "name": "Abe Elias",
 *                "email": "abe@sencha.com"
 *            }
 *         ]
 *     }
 *
 * To parse this we just pass in a {@link #root} configuration that matches the 'users' above:
 *
 *     reader: {
 *         type: 'json',
 *         rootProperty: 'users'
 *     }
 *
 * Sometimes the JSON structure is even more complicated. Document databases like CouchDB often provide metadata
 * around each record inside a nested structure like this:
 *
 *     {
 *         "total": 122,
 *         "offset": 0,
 *         "users": [
 *             {
 *                 "id": "ed-spencer-1",
 *                 "value": 1,
 *                 "user": {
 *                     "id": 1,
 *                     "name": "Ed Spencer",
 *                     "email": "ed@sencha.com"
 *                 }
 *             }
 *         ]
 *     }
 *
 * In the case above the record data is nested an additional level inside the "users" array as each "user" item has
 * additional metadata surrounding it ('id' and 'value' in this case). To parse data out of each "user" item in the
 * JSON above we need to specify the {@link #record} configuration like this:
 *
 *     reader: {
 *         type  : 'json',
 *         root  : 'users',
 *         record: 'user'
 *     }
 *
 * ## Response MetaData
 *
 * The server can return metadata in its response, in addition to the record data, that describe attributes
 * of the data set itself or are used to reconfigure the Reader. To pass metadata in the response you simply
 * add a `metaData` attribute to the root of the response data. The metaData attribute can contain anything,
 * but supports a specific set of properties that are handled by the Reader if they are present:
 *
 * - {@link #root}: the property name of the root response node containing the record data
 * - {@link #totalProperty}: property name for the total number of records in the data
 * - {@link #successProperty}: property name for the success status of the response
 * - {@link #messageProperty}: property name for an optional response message
 * - {@link Ext.data.Model#cfg-fields fields}: Config used to reconfigure the Model's fields before converting the
 * response data into records
 *
 * An initial Reader configuration containing all of these properties might look like this ("fields" would be
 * included in the Model definition, not shown):
 *
 *     reader: {
 *         type : 'json',
 *         root : 'root',
 *         totalProperty  : 'total',
 *         successProperty: 'success',
 *         messageProperty: 'message'
 *     }
 *
 * If you were to pass a response object containing attributes different from those initially defined above, you could
 * use the `metaData` attribute to reconifgure the Reader on the fly. For example:
 *
 *     {
 *         "count": 1,
 *         "ok": true,
 *         "msg": "Users found",
 *         "users": [{
 *             "userId": 123,
 *             "name": "Ed Spencer",
 *             "email": "ed@sencha.com"
 *         }],
 *         "metaData": {
 *             "root": "users",
 *             "totalProperty": 'count',
 *             "successProperty": 'ok',
 *             "messageProperty": 'msg'
 *         }
 *     }
 *
 * You can also place any other arbitrary data you need into the `metaData` attribute which will be ignored by the Reader,
 * but will be accessible via the Reader's {@link #metaData} property (which is also passed to listeners via the Proxy's
 * {@link Ext.data.proxy.Proxy#metachange metachange} event (also relayed by the {@link Ext.data.AbstractStore#metachange
 * store}). Application code can then process the passed metadata in any way it chooses.
 *
 * A simple example for how this can be used would be customizing the fields for a Model that is bound to a grid. By passing
 * the `fields` property the Model will be automatically updated by the Reader internally, but that change will not be
 * reflected automatically in the grid unless you also update the column configuration. You could do this manually, or you
 * could simply pass a standard grid {@link Ext.panel.Table#columns column} config object as part of the `metaData` attribute
 * and then pass that along to the grid. Here's a very simple example for how that could be accomplished:
 *
 *     // response format:
 *     {
 *         ...
 *         "metaData": {
 *             "fields": [
 *                 { "name": "userId", "type": "int" },
 *                 { "name": "name", "type": "string" },
 *                 { "name": "birthday", "type": "date", "dateFormat": "Y-j-m" },
 *             ],
 *             "columns": [
 *                 { "text": "User ID", "dataIndex": "userId", "width": 40 },
 *                 { "text": "User Name", "dataIndex": "name", "flex": 1 },
 *                 { "text": "Birthday", "dataIndex": "birthday", "flex": 1, "format": 'Y-j-m', "xtype": "datecolumn" }
 *             ]
 *         }
 *     }
 *
 * The Reader will automatically read the meta fields config and rebuild the Model based on the new fields, but to handle
 * the new column configuration you would need to handle the metadata within the application code. This is done simply enough
 * by handling the metachange event on either the store or the proxy, e.g.:
 *
 *     var store = Ext.create('Ext.data.Store', {
 *         ...
 *         listeners: {
 *             'metachange': function(store, meta) {
 *                 myGrid.reconfigure(store, meta.columns);
 *             }
 *         }
 *     });
 *
 */
Ext.define('Ext.data.reader.Json', {
    extend: 'Ext.data.reader.Reader',

    requires: [
        'Ext.JSON'
    ],

    alternateClassName: 'Ext.data.JsonReader',
    alias : 'reader.json',

    config: {
        /**
        * @cfg {String} record The optional location within the JSON response that the record data itself can be found at.
        * See the JsonReader intro docs for more details. This is not often needed.
        */
       record: null,

        /**
        * @cfg {String} [metaProperty]
        * Name of the property from which to retrieve the `metaData` attribute. See {@link #metaData}.
        */
        metaProperty: 'metaData',

        /**
        * @cfg {Boolean} useSimpleAccessors True to ensure that field names/mappings are treated as literals when
        * reading values.
        *
        * For example, by default, using the mapping "foo.bar.baz" will try and read a property foo from the root, then a property bar
        * from foo, then a property baz from bar. Setting the simple accessors to true will read the property with the name
        * "foo.bar.baz" direct from the root object.
        */
        useSimpleAccessors: false,

        /**
         * @cfg {Boolean} preserveRawData
         * The reader will keep a copy of the most recent request in the {@link #rawData} property. For performance reasons,
         * the data object for each record is used directly as the model data. This means that these objects may be modified and
         * thus modify the raw data. To ensure the objects are copied, set this option to `true`. NB: This only applies to items
         * that are read as part of the data array, any other metadata will not be modified:
         *
         *     {
         *         "someOtherData": 1, // Won't be modified
         *         "root": [{}, {}, {}] // The objects here will be modified
         *     }
         */
        preserveRawData: false
    },

    updateRootProperty: function() {
        this.forceBuildExtractors();
    },

    updateMetaProperty: function() {
        this.forceBuildExtractors();
    },

    /**
     * Reads a JSON object and returns a ResultSet. Uses the internal getTotal and getSuccess extractors to
     * retrieve meta data from the response, and extractData to turn the JSON data into model instances.
     * @param {Object} data The raw JSON data
     * @param {Object} [readOptions] See {@link #read} for details.
     * @return {Ext.data.ResultSet} A ResultSet containing model instances and meta data about the results
     */
    readRecords: function(data, readOptions) {
        var me = this,
            meta;

        //this has to be before the call to super because we use the meta data in the superclass readRecords
        if (me.getMeta) {
            meta = me.getMeta(data);
            if (meta) {
                me.onMetaChange(meta);
            }
        } else if (data.metaData) {
            me.onMetaChange(data.metaData);
        }

        return me.callParent([data, readOptions]);
    },

    //inherit docs
    getResponseData: function(response) {
        try {
            return Ext.decode(response.responseText);
        } catch (ex) {
            Ext.Logger.warn('Unable to parse the JSON returned by the server');
            return this.createReadError(ex.message);
        }
    },

    //inherit docs
    buildExtractors : function() {
        var me = this,
            metaProp = me.getMetaProperty(),
            root = me.getRootProperty();

        // Will only return true if we need to build
        if (me.callParent(arguments)) {
            if (root) {
                me.getRoot = me.createAccessor(root);
            } else {
                me.getRoot = Ext.identityFn;
            }

            if (metaProp) {
                me.getMeta = me.createAccessor(metaProp);
            }
        }
    },

    /**
     * @private
     * We're just preparing the data for the superclass by pulling out the record objects we want. If a {@link #record}
     * was specified we have to pull those out of the larger JSON object, which is most of what this function is doing
     * @param {Object} root The JSON root node
     * @param {Object} [readOptions] See {@link #read} for details.
     * @return {Ext.data.Model[]} The records
     */
    extractData: function(root, readOptions) {
        var recordName = this.getRecord(),
            data = [],
            length, i;

        if (recordName) {
            length = root.length;

            if (!length && Ext.isObject(root)) {
                length = 1;
                root = [root];
            }

            for (i = 0; i < length; i++) {
                data[i] = root[i][recordName];
            }
        } else {
            data = root;
        }
        return this.callParent([data, readOptions]);
    },

    getModelData: function(raw) {
        return this.getPreserveRawData() ? Ext.apply({}, raw) : raw;
    },

    /**
     * @private
     * @method
     * Returns an accessor function for the given property string. Gives support for properties such as the following:
     *
     * - 'someProperty'
     * - 'some.property'
     * - '["someProperty"]'
     * - 'values[0]'
     *
     * This is used by {@link #buildExtractors} to create optimized extractor functions for properties that are looked
     * up directly on the source object (e.g. {@link #successProperty}, {@link #messageProperty}, etc.).
     */
    createAccessor: (function() {
        var re = /[\[\.]/;

        return function(expr) {
            var me = this,
                simple = me.getUseSimpleAccessors(),
                operatorIndex, result,
                current, parts, part, inExpr,
                isDot, isLeft, isRight,
                special, c, i, bracketed, len;

            if (!(expr || expr === 0)) {
                return;
            }

            if (typeof expr === 'function') {
                return expr;
            }

            if (!simple) {
                operatorIndex = String(expr).search(re);
            }

            if (simple === true || operatorIndex < 0) {
                result = function(raw) {
                    return raw[expr];
                };
            } else {
                // The purpose of this part is to generate a "safe" accessor for any complex
                // json expression. For example 'foo.bar.baz' will get transformed:
                // raw.foo && raw.foo.bar && raw.foo.bar.baz
                current = 'raw';
                parts = [];
                part = '';
                inExpr = 0;
                len = expr.length;

                // The <= is intentional here. We handle the last character
                // being undefined so that we can append any final values at
                // the end
                for (i = 0; i <= len; ++i) {
                    c = expr[i];

                    isDot = c === '.';
                    isLeft = c === '[';
                    isRight = c === ']';

                    special = isDot || isLeft || isRight || !c;
                    // If either:
                    // a) Not a special char
                    // b) We're nested more than 1 deep, no single char can bring us out
                    // c) We are in an expr & it's not an ending brace
                    // Then just push the character on
                    if (!special || inExpr > 1 || (inExpr && !isRight)) {
                        part += c;
                    } else if (special) {
                        bracketed = false;
                        if (isLeft) {
                            ++inExpr;
                        } else if (isRight) {
                            --inExpr;
                            bracketed = true;
                        }

                        if (part) {
                            if (bracketed) {
                                part = '[' + part + ']';
                            } else {
                                part = '.' + part;
                            }
                            current += part;
                            // Concatting the empty string to the start fixes a very odd intermittent bug with IE9/10.
                            // On some occasions, without it, it will end up generating
                            // raw.foo.bar.baz && raw.foo.bar.baz && raw.foo.bar.baz
                            // At this point, not really sure why forcibly casting it to a string makes a difference
                            parts.push('' + current);
                            part = '';
                        }
                    }
                }
                result = parts.join(' && ');
                result = Ext.functionFactory('raw', 'return ' + result);
            }
            return result;
        };
    }()),

    /**
     * @private
     * @method
     * Returns an accessor function for the passed Field. Gives support for properties such as the following:
     *
     * - 'someProperty'
     * - 'some.property'
     * - '["someProperty"]'
     * - 'values[0]'
     *
     * This is used by {@link #buildExtractors} to create optimized extractor expressions when converting raw
     * data into model instances. This method is used at the field level to dynamically map values to model fields.
     */
    createFieldAccessor: function(field) {
        // Need to capture me for the extractor
        var me = this,
            mapping = field.mapping,
            hasMap = mapping || mapping === 0,
            map    = hasMap ? mapping : field.name;

        if (hasMap) {
            if (typeof map === 'function') {
                return function(raw) {
                    return field.mapping(raw, me);
                };
            } else {
                return me.createAccessor(map);
            }
        }
    }
});


text:
git-rev-sync
============

[![Build Status](https://travis-ci.org/kurttheviking/git-rev-sync.svg?branch=master)](https://travis-ci.org/kurttheviking/git-rev-sync.svg?branch=master)

Synchronously get the current git commit hash, tag, branch or commit message. Forked from [git-rev](https://github.com/tblobaum/git-rev).

## Example

```js
var git = require('git-rev-sync');

console.log(git.short());
// 75bf4ee

console.log(git.long());
// 75bf4eea9aa1a7fd6505d0d0aa43105feafa92ef

console.log(git.branch());
// master

console.log(git.message());
// initial commit

console.log(git.tag());
// v1.3.1

console.log(git.log());
// not implemented
```

You can also run these examples via: `npm run examples`

## Install

`npm install git-rev-sync --save`

## API

``` js
var git = require('git-rev-sync');
```

#### git.short() → <String>

return the result of `git rev-parse --short HEAD`

#### git.long() → <String>

return the result of `git rev-parse HEAD`

#### git.branch() → <String>

return the current branch

#### git.tag() → <String>

return the current tag

#### git.message() → <String>

return the current commit message; this method will fail if the `git` command is not found in your `PATH`

## License

[MIT](https://github.com/kurttheviking/git-rev-sync/blob/master/LICENSE)


text:
package com.roncoo.pay.notify.dao;

import com.roncoo.pay.common.core.dao.BaseDao;
import com.roncoo.pay.notify.entity.RpNotifyRecordLog;

/**
 * @功能说明:
 * @创建者: Peter
 * @创建时间: 16/6/2  上午11:20
 * @公司名称:广州市领课网络科技有限公司 龙果学院(www.roncoo.com)
 * @版本:V1.0
 */
public interface RpNotifyRecordLogDao  extends BaseDao<RpNotifyRecordLog> {

    int deleteByPrimaryKey(String id);

    int insertSelective(RpNotifyRecordLog record);

    RpNotifyRecordLog selectByPrimaryKey(String id);

    int updateByPrimaryKey(RpNotifyRecordLog record);
}


text:
#ifndef __CONDOR_RW_H__
#define __CONDOR_RW_H__

#include "sock.h"

 // Returns < 0 upon an error.
int condor_read(char const *peer_description,SOCKET fd, char *buf, int sz, int timeout, int flags=0, bool non_blocking=false);

int condor_write(char const *peer_description,SOCKET fd, const char *buf, int sz, int timeout, int flags=0, bool non_blocking=false);

#endif


text:
package ai.verta.swagger._public.modeldb.model

import scala.util.Try

import net.liftweb.json._

import ai.verta.swagger._public.modeldb.model.ArtifactTypeEnumArtifactType._
import ai.verta.swagger._public.modeldb.model.OperatorEnumOperator._
import ai.verta.swagger._public.modeldb.model.ProtobufNullValue._
import ai.verta.swagger._public.modeldb.model.TernaryEnumTernary._
import ai.verta.swagger._public.modeldb.model.ValueTypeEnumValueType._
import ai.verta.swagger.client.objects._

case class ModeldbLogVersionedInput (
  id: Option[String] = None,
  versioned_inputs: Option[ModeldbVersioningEntry] = None
) extends BaseSwagger {
  def toJson(): JValue = ModeldbLogVersionedInput.toJson(this)
}

object ModeldbLogVersionedInput {
  def toJson(obj: ModeldbLogVersionedInput): JObject = {
    new JObject(
      List[Option[JField]](
        obj.id.map(x => JField("id", JString(x))),
        obj.versioned_inputs.map(x => JField("versioned_inputs", ((x: ModeldbVersioningEntry) => ModeldbVersioningEntry.toJson(x))(x)))
      ).flatMap(x => x match {
        case Some(y) => List(y)
        case None => Nil
      })
    )
  }

  def fromJson(value: JValue): ModeldbLogVersionedInput =
    value match {
      case JObject(fields) => {
        val fieldsMap = fields.map(f => (f.name, f.value)).toMap
        ModeldbLogVersionedInput(
          // TODO: handle required
          id = fieldsMap.get("id").map(JsonConverter.fromJsonString),
          versioned_inputs = fieldsMap.get("versioned_inputs").map(ModeldbVersioningEntry.fromJson)
        )
      }
      case _ => throw new IllegalArgumentException(s"unknown type ${value.getClass.toString}")
    }
}


text:
<!DOCTYPE html>

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

    <title>Sailing - Page 1 - incertae sedis</title>
    <meta name="description" content="" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="https://evolgenomology.github.io/favicon.ico">

    <link rel="stylesheet" type="text/css" href="//evolgenomology.github.io/themes/ichi/assets/css/normalize.css?v=1475050879736" />
    <link rel="stylesheet" type="text/css" href="//evolgenomology.github.io/themes/ichi/assets/css/foundation.min.css?v=1475050879736" />

    <link rel="stylesheet" type="text/css" href="//evolgenomology.github.io/themes/ichi/assets/fonts/foundation-icons/foundation-icons.css?v=1475050879736" />
    <link rel="stylesheet" type="text/css" href="//evolgenomology.github.io/themes/ichi/assets/css/styles.css?v=1475050879736" />
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:300,700,400|Source+Sans+Pro:300,400,600,700,900,300italic,400italic,600italic,700italic,900italic" />

    <link rel="canonical" href="https://evolgenomology.github.io/https://evolgenomology.github.io/tag/Sailing/" />
    <meta name="referrer" content="origin" />

    <meta property="og:site_name" content="incertae sedis" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="Sailing - Page 1 - incertae sedis" />
    <meta property="og:url" content="https://evolgenomology.github.io/https://evolgenomology.github.io/tag/Sailing/" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Sailing - Page 1 - incertae sedis" />
    <meta name="twitter:url" content="https://evolgenomology.github.io/https://evolgenomology.github.io/tag/Sailing/" />

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="incertae sedis" href="https://evolgenomology.github.io/rss/" />

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

    <button type="button" class="overlay-close">Close</button>

Home

incertae sedis

musing on science and evolution ...
oh, and other important stuff, like Rugby for example.

Sailing

            <time datetime="2016-07-26">26 Jul 2016</time>

Sailing

Last weekend I went sailing with a friend, who actually owns a small boat. We went to the Ijsselmeer in the Netherlands on Friday evening, a smoth 3 hour drive, and then had some beers and a real good chat about life and everything in the habour pub. Actually, we hadn’t spoken like that for a very long time and I enjoyed it very much. The next morning we went out and crossed the Ijsselmeer…

        Read more
        Posted on Sailing,  Time out,  fun,  flies,  nematodes

            <time datetime="2016-07-18">18 Jul 2016</time>

Real trees

Now this is some real tree. Seen in Hampstead Heath last week. Wow! We also went to the London Zoo, which is quite nicely embedded into Regents Park. However, it is also very, very expensive I have to say. Anyway, the kids liked it. We even saw a tiger, and this guy later on - taking it easy in the sun. Now I am already back in Germany, frantically putting results together for my poster for the E…

        Read more
        Posted on Trees,  Sailing,  Sweden,  Work,  Conference

    Page 1 of 1


text:
package parser_test

import (
	"github.com/bytesparadise/libasciidoc/pkg/types"
	. "github.com/bytesparadise/libasciidoc/testsupport"

	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"
)

var _ = Describe("source blocks", func() {

	Context("in final documents", func() {

		Context("as Asciidoc block", func() {

			It("with source attribute only", func() {
				source := `[source]
----
require 'sinatra'

get '/hi' do
  "Hello World!"
end
----`
				expected := &types.Document{
					Elements: []interface{}{
						&types.DelimitedBlock{
							Kind: types.Listing,
							Attributes: types.Attributes{
								types.AttrStyle: types.Source,
							},
							Elements: []interface{}{
								&types.StringElement{
									Content: `require 'sinatra'

get '/hi' do
  "Hello World!"
end`,
								},
							},
						},
					},
				}
				Expect(ParseDocument(source)).To(MatchDocument(expected))
			})

			It("with title, source and languages attributes", func() {
				source := `[source,ruby]
.Source block title
----
require 'sinatra'

get '/hi' do
  "Hello World!"
end
----`
				expected := &types.Document{
					Elements: []interface{}{
						&types.DelimitedBlock{
							Kind: types.Listing,
							Attributes: types.Attributes{
								types.AttrStyle:    types.Source,
								types.AttrLanguage: "ruby",
								types.AttrTitle:    "Source block title",
							},
							Elements: []interface{}{
								&types.StringElement{
									Content: `require 'sinatra'

get '/hi' do
  "Hello World!"
end`,
								},
							},
						},
					},
				}
				Expect(ParseDocument(source)).To(MatchDocument(expected))
			})

			It("with id, title, source, languages and linenums attributes", func() {
				source := `[#id-for-source-block]
[source,ruby,linenums]
.app.rb
----
require 'sinatra'

get '/hi' do
  "Hello World!"
end
----`
				expected := &types.Document{
					Elements: []interface{}{
						&types.DelimitedBlock{
							Kind: types.Listing,
							Attributes: types.Attributes{
								types.AttrStyle:    types.Source,
								types.AttrLanguage: "ruby",
								types.AttrID:       "id-for-source-block",
								types.AttrTitle:    "app.rb",
								types.AttrLineNums: true,
							},
							Elements: []interface{}{
								&types.StringElement{
									Content: `require 'sinatra'

get '/hi' do
  "Hello World!"
end`,
								},
							},
						},
					},
					ElementReferences: types.ElementReferences{
						"id-for-source-block": "app.rb",
					},
				}
				Expect(ParseDocument(source)).To(MatchDocument(expected))
			})

			It("with callout and admonition block afterwards", func() {
				source := `[source]
----
const cookies = "cookies" <1>
----
<1> a constant

[NOTE]
====
a note
====`

				expected := &types.Document{
					Elements: []interface{}{
						&types.DelimitedBlock{
							Kind: types.Listing,
							Attributes: types.Attributes{
								types.AttrStyle: types.Source,
							},
							Elements: []interface{}{
								&types.StringElement{
									Content: `const cookies = "cookies" `,
								},
								&types.Callout{
									Ref: 1,
								},
							},
						},
						&types.List{
							Kind: types.CalloutListKind,
							Elements: []types.ListElement{
								&types.CalloutListElement{
									Ref: 1,
									Elements: []interface{}{
										&types.Paragraph{
											Elements: []interface{}{
												&types.StringElement{
													Content: "a constant",
												},
											},
										},
									},
								},
							},
						},
						&types.DelimitedBlock{
							Kind: types.Example,
							Attributes: types.Attributes{
								types.AttrStyle: types.Note,
							},
							Elements: []interface{}{
								&types.Paragraph{
									Elements: []interface{}{
										&types.StringElement{
											Content: "a note",
										},
									},
								},
							},
						},
					},
				}
				Expect(ParseDocument(source)).To(MatchDocument(expected))
			})

			Context("with variable delimiter length", func() {

				It("with 5 chars", func() {
					source := `[source]
-----
some *source* content
-----`
					expected := &types.Document{
						Elements: []interface{}{
							&types.DelimitedBlock{
								Kind: types.Listing,
								Attributes: types.Attributes{
									types.AttrStyle: types.Source,
								},
								Elements: []interface{}{
									&types.StringElement{
										Content: "some *source* content",
									},
								},
							},
						},
					}
					Expect(ParseDocument(source)).To(MatchDocument(expected))
				})

				It("with 5 chars with nested with 4 chars", func() {
					source := `[source]
-----
[source]
----
some *source* content
----
-----`
					expected := &types.Document{
						Elements: []interface{}{
							&types.DelimitedBlock{
								Kind: types.Listing,
								Attributes: types.Attributes{
									types.AttrStyle: types.Source,
								},
								Elements: []interface{}{
									&types.StringElement{
										Content: "[source]\n----\nsome *source* content\n----",
									},
								},
							},
						},
					}
					Expect(ParseDocument(source)).To(MatchDocument(expected))
				})
			})
		})

		Context("as Markdown block", func() {

			It("with html content", func() {
				source := ".title\n" +
					"```html\n" +
					"<!DOCTYPE html>\n" +
					"</html>\n" +
					"```"
				expected := &types.Document{
					Elements: []interface{}{
						&types.DelimitedBlock{
							Kind: types.Listing,
							Attributes: types.Attributes{
								types.AttrTitle:    "title",
								types.AttrStyle:    types.Source,
								types.AttrLanguage: "html",
							},
							Elements: []interface{}{
								&types.SpecialCharacter{
									Name: "<",
								},
								&types.StringElement{
									Content: "!DOCTYPE html",
								},
								&types.SpecialCharacter{
									Name: ">",
								},
								&types.StringElement{
									Content: "\n",
								},
								&types.SpecialCharacter{
									Name: "<",
								},
								&types.StringElement{
									Content: "/html",
								},
								&types.SpecialCharacter{
									Name: ">",
								},
							},
						},
					},
				}
				Expect(ParseDocument(source)).To(MatchDocument(expected))
			})
		})
	})
})


text:
using std::string;
using std::set;
using std::vector;
using std::map;
using __gnu_cxx::hash_set;
using __gnu_cxx::hash_map;

// define the hash method for STL strings
namespace __gnu_cxx
{
  template<> struct hash< std::string >
  {
    size_t operator()( const std::string& x ) const
    {
      return hash< const char* >()( x.c_str() );
    }
  };
}

class php_stl : public php
{
public:
  php_stl(bool type_warnings = false) : php(type_warnings) {};
  ~php_stl(){};

  // STL strings are more convenient than C strings
  string call_string(char *fn, char *argspec =  "", ...);

  // NOTE ON INT AND UINT TYPES
  // these just truncate php longs into integers before insertion

  vector<string> call_string_vector(char *fn, char *argspec =  "", ...);
  vector<double> call_double_vector(char *fn, char *argspec =  "", ...);
  vector<long> call_long_vector(char *fn, char *argspec =  "", ...);
  vector<bool> call_bool_vector(char *fn, char *argspec =  "", ...);
  vector<int> call_int_vector(char *fn, char *argspec =  "", ...);
  vector<unsigned int> call_uint_vector(char *fn, char *argspec =  "", ...);

  // a set of bools doesn't make much sense
  set<string> call_string_set(char *fn, char *argspec =  "", ...);
  set<double> call_double_set(char *fn, char *argspec =  "", ...);
  set<long> call_long_set(char *fn, char *argspec =  "", ...);
  set<int> call_int_set(char *fn, char *argspec =  "", ...);
  set<unsigned int> call_uint_set(char *fn, char *argspec =  "", ...);

  // a hash set of bools also makes no sense
  hash_set<string> call_string_hash_set(char *fn, char *argspec =  "", ...);
  hash_set<long> call_long_hash_set(char *fn, char *argspec =  "", ...);
  hash_set<int> call_int_hash_set(char *fn, char *argspec =  "", ...);
  hash_set<unsigned int> call_uint_hash_set(char *fn, char *argspec =  "", ...);

  // NOTE ON NESTED ARRAYS: These maps only support flat associative arrays
  // for nested arrays you'll need to use the php_arr class!

  // We only support string and long indices since that is what is in PHP
  map<string, string> call_string_string_map(char *fn, char *argspec = "", ...);
  map<string, double> call_string_double_map(char *fn, char *argspec = "", ...);
  map<string, long> call_string_long_map(char *fn, char *argspec = "", ...);
  map<string, bool> call_string_bool_map(char *fn, char *argspec = "", ...);
  map<string, int> call_string_int_map(char *fn, char *argspec =  "", ...);
  map<string, unsigned int> call_string_uint_map(char *fn, char *argspec =  "", ...);
  map<long, string> call_long_string_map(char *fn, char *argspec = "", ...);
  map<long, double> call_long_double_map(char *fn, char *argspec = "", ...);
  map<long, long> call_long_long_map(char *fn, char *argspec = "", ...);
  map<long, bool> call_long_bool_map(char *fn, char *argspec = "", ...);
  map<long, int> call_long_int_map(char *fn, char *argspec =  "", ...);
  map<long, unsigned int> call_long_uint_map(char *fn, char *argspec =  "", ...);

  hash_map<string, string> call_string_string_hash_map(char *fn, char *argspec = "", ...);
  hash_map<string, double> call_string_double_hash_map(char *fn, char *argspec = "", ...);
  hash_map<string, long> call_string_long_hash_map(char *fn, char *argspec = "", ...);
  hash_map<string, bool> call_string_bool_hash_map(char *fn, char *argspec = "", ...);
  hash_map<string, int> call_string_int_hash_map(char *fn, char *argspec = "", ...);
  hash_map<string, unsigned int> call_string_uint_hash_map(char *fn, char *argspec = "", ...);
  hash_map<long, string> call_long_string_hash_map(char *fn, char *argspec = "", ...);
  hash_map<long, double> call_long_double_hash_map(char *fn, char *argspec = "", ...);
  hash_map<long, long> call_long_long_hash_map(char *fn, char *argspec = "", ...);
  hash_map<long, bool> call_long_bool_hash_map(char *fn, char *argspec = "", ...);
  hash_map<long, int> call_long_int_hash_map(char *fn, char *argspec = "", ...);
  hash_map<long, unsigned int> call_long_uint_hash_map(char *fn, char *argspec = "", ...);
};

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>proctor-pipet-deploy</artifactId>
    <packaging>war</packaging>

    <parent>
        <groupId>com.indeed</groupId>
        <artifactId>proctor-pipet-parent</artifactId>
        <version>9999-SNAPSHOT</version>
    </parent>

    <properties>
        <bitwalker.version>1.20</bitwalker.version>
    </properties>

    <repositories>
        <repository>
            <id>bitwalker.user-agent-utils.mvn.repo</id>
            <url>
                https://raw.githubusercontent.com/HaraldWalker/user-agent-utils/mvn-repo/
            </url>
            <!-- use snapshot version -->
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>proctor-pipet-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>eu.bitwalker</groupId>
            <artifactId>UserAgentUtils</artifactId>
            <version>${bitwalker.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.jsimone</groupId>
            <artifactId>webapp-runner</artifactId>
            <version>7.0.34.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.github.jsimone</groupId>
                                    <artifactId>webapp-runner</artifactId>
                                    <version>7.0.34.0</version>
                                    <destFileName>webapp-runner.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>