text:
<!DOCTYPE html>

      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      <meta http-equiv="x-ua-compatible" content="ie=edge">

        <meta name="description" content="A lightweight mobile interface for Wirecard Payment Gateway">

        <meta name="author" content="paymentSDK Team">

        <meta name="lang:clipboard.copy" content="Copy to clipboard">

        <meta name="lang:clipboard.copied" content="Copied to clipboard">

        <meta name="lang:search.language" content="en">

        <meta name="lang:search.pipeline.stopwords" content="True">

        <meta name="lang:search.pipeline.trimmer" content="True">

        <meta name="lang:search.result.none" content="No matching documents">

        <meta name="lang:search.result.one" content="1 matching document">

        <meta name="lang:search.result.other" content="# matching documents">

        <meta name="lang:search.tokenizer" content="[\s\-]+">

      <link rel="shortcut icon" href="../assets/images/favicon.png">
      <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-3.1.0">

        <title>Zapp - paymentSDK Guide</title>

      <link rel="stylesheet" href="../assets/stylesheets/application.11e41852.css">

        <link rel="stylesheet" href="../assets/stylesheets/application-palette.22915126.css">

        <meta name="theme-color" content="#00bcd4">

        <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web:300,400,400i,700|Fira+Mono">

    <link rel="stylesheet" href="../assets/fonts/material-icons.css">

      <link rel="stylesheet" href="../css/code-tabs.css">

    <svg class="md-svg">
      <defs>

      </defs>
    </svg>
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">

        Skip to content

            developer_mode

                paymentSDK Guide

                Zapp

    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">

      <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
        
      </button>
    </form>

            Type to start searching

        developer_mode

    paymentSDK Guide

      Start Here

      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" checked>

      Payment Methods

        Payment Methods

      Apple Pay

      Card Payments

      PayPal

      SEPA Direct Debit

    <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">

        Zapp

      Zapp

    Table of contents

    Supported Transaction Types

    Zapp transaction and delivery types

    Basic Setup

    Cocoapods

    Simple Zapp Payment

      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">

      Customization

        Customization

      User Interface

      Localization

      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">

      About

        About

      Release Notes

      License

    Table of contents

    Supported Transaction Types

    Zapp transaction and delivery types

    Basic Setup

    Cocoapods

    Simple Zapp Payment

Zapp¶

With Zapp, there are two payments flow. Whether the customer has a banking application installed on their phone decides which one is used :

Banking application is installed - this app is opened after a successful response from Wirecard payment gateway.

No banking application - SDK prompts a pop-up informing the user to provide BRN (see explanation below) to a banking application on another device and awaits confirmation.

BRN is short for Basket Reference Number, a unique temporary code provided by Zapp (and conveyed to the customer by the merchant) which identifies the order which is being paid.

Supported Transaction Types¶

WDECTransactionTypeDebit - charges the specified amount from the account holder's bank account and marks it for immediate transfer.

Zapp transaction and delivery types¶

Transaction types:

BILLPT - Bill payment

PAYMT - Retail item payment

INVOICE - Invoice payment

DONATIONS - Donation payment

Delivery types:

COLLST - Store collection. The consumer chose to collect the goods from the store personally.

DELTAD - Delivery to address. The Consumer chose to have the goods delivered to the specified address.

DIGDEL - Digital delivery. The Consumer chose to receive items electronically.

SERVICE - Service provided. For SMB transactions where there is no need for a delivery address

F2F - Face-to-face transactions. Primarily for use with an SMB transaction.

NONE - No delivery

Basic Setup¶

Cocoapods¶

Add to your app's Podfile subspecs:

1

pod 'paymentSDK/ZAPP,          '~> 4.1.0'

Simple Zapp Payment¶

Zapp requires additional setup of the appScheme field in payment object  and CFBundleURLSchemes and LSApplicationQueriesSchemes keys in Info.plist of the app.

Info.plist:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>your.app.bundleID</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>yourAppScheme</string>
        </array>
    </dict>
</array>

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>zapp</string>
</array>

SDK handles redirect from payment provider app or web page. Method openURL should be called in AppDelegate delegate method.

<input name=tab-group-2 type=radio id=tab-group-2-0_objective-c checked=checked class=code-tab data-lang=objective-c aria-controls=tab-group-2-0_objective-c-panel role=tab>Objective-C

1
2
3
4
5
6

- (BOOL)application:(UIApplication *)app
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    BOOL openURL = [self.client openURL:url];
    return openURL;
}

<input name=tab-group-2 type=radio id=tab-group-2-1_swift class=code-tab data-lang=swift aria-controls=tab-group-2-1_swift-panel role=tab>Swift

1
2
3
4

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
    let openURL = self.client?.open(url) ?? false
    return openURL
}

<input name=tab-group-2 type=radio id=tab-group-2-2_swift class=code-tab data-lang=swift aria-controls=tab-group-2-2_swift-panel role=tab>Swift

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

// 1. Initialize client object
// Parameters (hostname, merchantAccountID) may come from server to make it configurable.

do {
    try self.client = WDECClient.init(hostname: hostname)
} catch {
    // the device is checked during initialization for jailbreak.
    // It is risky to make payments on jailbroken devices.
    return
}

// 2. Initialize payment object and set mandatory properties
// Parameters (amount, currency, transactionType) shall be sent to server for validation or just provided by server
// and used to generate signature. Signature MUST be generated on server side.
// Signature doc: https://document-center.wirecard.com/display/PTD/Signature+v2
// Secret Key shall never be stored in application.

let payment = WDECPBBAPayment()
payment.merchantAccountID = merchantAccountID  // provided by merchant support
payment.requestID = requestID                  // generated on server; unique for merchantAccountID
payment.amount = NSDecimalNumber(mantissa: 199, exponent: -2, isNegative: NO)
payment.currency = "GBP"
payment.transactionType = .debit
payment.pbbaTransactionType = "PAYMNT"
payment.pbbaDeliveryType = "SERVICE"
payment.appScheme = yourAppScheme
payment.signature = signature

// 3. Trigger the payment and handle response in payment completion block.
self.client?.make(payment, withCompletion:{(response: WDECPaymentResponse?,error: Error?) in
// for each failure error object is provided;
guard let error = error else { return }
    if let response = response {
        self.handleResponse(response)
    }
})

<input name=tab-group-2 type=radio id=tab-group-2-3_objective-c class=code-tab data-lang=objective-c aria-controls=tab-group-2-3_objective-c-panel role=tab>Objective-C

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

// 1. Initialize client object
// Parameters (hostname, merchantAccountID) may come from server to make it configurable.

NSError *error = nil;
self.client = [[WDECClient alloc] initWithHostname:hostname error:&error];
if (error) {
    // the device is checked during initialization for jailbreak.
    // It is risky to make payments on jailbroken devices.
    return;
}

// 2. Initialize payment object and set mandatory properties
// Parameters (amount, currency, transactionType) shall be sent to server for validation or just provided by server
// and used to generate signature. Signature MUST be generated on server side.
// Signature doc: https://document-center.wirecard.com/display/PTD/Signature+v2
// Secret Key shall never be stored in application.

WDECPBBAPayment *payment = [WDECPBBAPayment new];
payment.merchantAccountID = merchantAccountID;  // provided by merchant support
payment.requestID = requestID;                  // generated on server; unique for merchantAccountID
payment.amount = [NSDecimalNumber decimalNumberWithMantissa:199 exponent:-2 isNegative:NO];
payment.currency = @"GBP";
payment.transactionType = WDECTransactionTypeDebit;
payment.pbbaTransactionType = @"PAYMNT";
payment.pbbaDeliveryType = @"SERVICE";
payment.appScheme = yourAppScheme;
payment.signature = signature;

 // 3. Create payment completion block to handle response

@weakify(self);
WDECCompletionBlock completionBlock = ^(WDECPaymentResponse * _Nullable response, NSError * _Nullable error) {
    @strongify(self);
    // for each failure error object is provided;
    if (error) {
        return;
    }
    [self handleResponse:response];
}

// 4. Trigger the payment
[self.client makePayment:payment withCompletion:completionBlock];

                  Previous

                SEPA Direct Debit

                  Next

                User Interface

            © 2019 by Wirecard AG

        powered by
        MkDocs
        and

          Material for MkDocs

    <link rel="stylesheet" href="../assets/fonts/font-awesome.css">


text:
namespace offline_pages {

StartUpgradeResult::StartUpgradeResult()
    : status(StartUpgradeStatus::DB_ERROR) {}

StartUpgradeResult::StartUpgradeResult(StartUpgradeStatus status)
    : status(status) {}

StartUpgradeResult::StartUpgradeResult(StartUpgradeStatus status,
                                       const std::string& digest,
                                       const base::FilePath& file_path)
    : status(status), digest(digest), file_path(file_path) {}

}  // namespace offline_pages

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Created by PhpStorm.
 * User: Gavin
 * Date: 22/10/14
 * Time: 18:01
 */

namespace Apprecie\Library\Users;

use Phalcon\DI;

trait PortalSourcePrefixTrait
{
    protected static $_forcedSource = '';

    public static function setForcedSource($portalId)
    {
        static::$_forcedSource = $portalId;
    }

    public static function getSourcePrefix()
    {
        if (static::$_forcedSource != '') {
            $prefix = static::$_forcedSource;
        } else {
            $prefix = DI::getDefault()->get('portalid');
        }

        return $prefix;
    }

    protected function getEncryptionKey()
    {
        $key1 = static::getSourcePrefix();
        $key2 = $this->getDI()->get('fieldkey');
        return $key1 . $key2;
    }
}


text:
<!DOCTYPE html>

        <meta name="text:Twitter Username" content="" />
        <meta name="text:Facebook Username" content="" />
        <meta name="text:SoundCloud Username" content="" />
        <meta name="text:Bandcamp URL" content="" />
        <meta name="text:GitHub Username" content="" />
        <meta name="text:Skype Username" content="" />
        <meta name="text:Steam Profile Link" content="" />
        <meta name="text:LastFM Username" content="" />
        <meta name="text:YouTube Username" content="" />
        <meta name="text:Custom Head HTML" content="" />
        <meta name="text:Custom Sidebar Footer HTML" content="" />
        <meta name="text:Custom Sidebar HTML" content="" />
        <meta name="image:Background" content="" />
        <meta name="color:Background Color" content="#fff" />
        <meta name="color:Dark Accent Color" content="#427ea3">

        <meta name="if:Use Bold Titles" content="0" />
        <meta name="if:Sidebar on Left" content="0" />
        <meta name="if:Repeat Background Horizontally" content="1" />
        <meta name="if:Repeat Background Vertically" content="1" />
        <meta name="if:Align Navbar Toggle to Left" content="1" />
        <meta name="if:Inverse Navbar Color" content="0" />
        <meta name="if:Panels with slight transparency" content="1" />
        <meta name="if:Display Search" content="1" />
        <meta name="if:Fluid" content="0" />

        <meta name="if:Show Post Actions" content="1" />
        <meta name="if:Show Portrait" content="1" />
        <meta name="if:Show Follow Me" content="1" />
        <meta name="if:Show Archive and Random" content="1" />
        <meta name="if:Show Following" content="0" />
        <meta name="if:Show Theme Credit" content="1" />
        <meta name="if:Show RSS Feed" content="1" />
        <meta name="if:Show Twitter Link" content="0" />
        <meta name="if:Show Facebook Link" content="0" />
        <meta name="if:Show SoundCloud Link" content="0" />
        <meta name="if:Show GitHub Link" content="0" />
        <meta name="if:Show Skype Username" content="0" />
        <meta name="if:Show Steam Link" content="0" />
        <meta name="if:Show LastFM Link" content="0" />
        <meta name="if:Show Bandcamp Link" content="0" />
        <meta name="if:Show YouTube Link" content="0" />

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <link rel="shortcut icon" href="{Favicon}">
        <link rel="alternate" type="application/rss+xml" href="{RSS}">
        {block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
        <title>{Title}</title>
        <link href="//cdn.jsdelivr.net/bootstrap/latest/css/bootstrap.min.css" rel="stylesheet">
        <link href="//cdn.jsdelivr.net/font-entypo/latest/dev/entypo.css" rel="stylesheet">
        <link href="//cdn.jsdelivr.net/fontawesome/latest/css/font-awesome.css" rel="stylesheet">

        {text:Custom Head HTML}

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        {lang:Navigate}

                    </button>
                    {Title}

                        {block:AskEnabled}

                             {AskLabel}

{/block:AskEnabled}
                        {block:SubmissionsEnabled}

                             {SubmitLabel}

{/block:SubmissionsEnabled}
                        {block:HasPages}{block:Pages}

                            {Label}

{/block:Pages}{/block:HasPages}

                    {block:IfDisplaySearch}<form class='navbar-form' role='search' action='/search' method='get'>

                            <input name='q' type='search' class='form-control' placeholder='Search' value='{SearchQuery}'>

                    </form>{/block:IfDisplaySearch}

                {block:IfSidebarOnLeft}

                            {block:IfShowPortrait}

{/block:IfShowPortrait}
                            {block:Description}
{Description}
{/block:Description}
                            {block:IfShowFollowMe} {lang:Follow me}
{/block:IfShowFollowMe}
                            {block:IfShowArchiveAndRandom}

                                 {lang:Archive}
                                 {lang:Random}

{/block:IfShowArchiveAndRandom}
                            {text:Custom Sidebar HTML}

                            {block:IfShowRSSFeed}{/block:IfShowRSSFeed}
                            {block:IfShowTwitterLink}{/block:IfShowTwitterLink}
                            {block:IfShowFacebookLink}{/block:IfShowFacebookLink}
                            {block:IfShowSoundCloudLink}{/block:IfShowSoundCloudLink}
                            {block:IfShowGitHubLink}{/block:IfShowGitHubLink}
                            {block:IfShowSkypeUsername}{/block:IfShowSkypeUsername}
                            {block:IfShowSteamLink}{/block:IfShowSteamlink}
                            {block:IfShowLastFmLink}{/block:IfShowLastFmLink}
                            {block:IfShowBandcampLink}{/block:IfShowBandcampLink}
                            {block:IfShowYouTubeLink}{/block:IfShowYouTubeLink}
                            {text:Custom Sidebar Footer HTML}

                    {block:IfShowFollowing}{block:Following}

                        {block:Followed}{/block:Followed}

{/block:Following}{/block:IfShowFollowing}
                    {block:IfShowThemeCredit}

                        {block:English}This tumblr is Bootstrapped{/block:English}{block:NotEnglish}{lang:Install this theme}{/block:NotEnglish}.

{/block:IfShowThemeCredit}

                {/block:IfSidebarOnLeft}

                    {block:TagPage}
{lang:Showing posts tagged Tag 2}
{/block:TagPage}
                    {block:SearchPage}
{lang:Showing SearchResultCount results for SearchQuery 2}
{/block:SearchPage}

                        {block:Posts}

                            {block:Title}

                                    {Title}

{/block:Title}
                            {block:Chat}

                                    {block:Lines}

                                        {block:Label}{Label} {/block:Label}{Line}

{/block:Lines}

{/block:Chat}
                            {block:Link}

                                    {block:Thumbnail}

{/block:Thumbnail}

                                        {Name}

                                {block:Description}{Description}{/block:Description}

{/block:Link}
                            {block:Answer}

{lang:Asker asked 2}

                                                {Question}

{Answerer}{block:NotReblog}{PostAuthorName}{/block:NotReblog} answered

                                                {Answer}

                                {block:RebloggedFrom}{Replies}{/block:RebloggedFrom}

{/block:Answer}
                            {block:Video}
{VideoEmbed-500}
{/block:Video}
                            {block:Audio}
{block:AudioEmbed}{AudioEmbed color="white"}{/block:AudioEmbed}
{/block:Audio}
                            {block:Quote}

{Quote}{block:Source}{Source}{/block:Source}

{/block:Quote}
                            {block:Photo}{LinkOpenTag}{LinkCloseTag}{/block:Photo}
                            {block:Photoset}
{Photoset}
{/block:Photoset}
                            {block:Panorama}
{LinkOpenTag}{LinkCloseTag}
{/block:Panorama}
                            {block:Body}
{Body}
{/block:Body}
                            {block:Caption}
{Caption}
{/block:Caption}

{block:RebloggedFrom}<a href='{ReblogParentURL}' title='{lang:Reblogged from ReblogParentName}' {/block:RebloggedFrom}{block:ContentSource}{/block:ContentSource}{block:HasTags} {block:Tags}{Tag}{/block:Tags}{/block:HasTags}

                                {block:Date}{TimeAgo}{/block:Date}{block:PlayCount}{block:ExternalAudio}{/block:ExternalAudio}{PlayCountWithLabel}{block:ExternalAudio}{/block:ExternalAudio}{/block:PlayCount}{block:NoteCount}{NoteCountWithLabel}{/block:NoteCount}{block:IfShowPostActions}{block:Date}{LikeButton}{ReblogButton}{/block:Date}{/block:IfShowPostActions}

                        {block:PostNotes}

                            {PostNotes-64}

{/block:PostNotes}
{/block:Posts}

                    {block:PermalinkPagination}

                        {block:PreviousPost}

                                  {lang:Previous post}

                        {/block:PreviousPost}
                        {block:NextPost}

                                {lang:Next post}

                        {/block:NextPost}

{/block:PermalinkPagination}
                    {block:Pagination}

                        {block:PreviousPage}

                                  {lang:Previous}

                        {/block:PreviousPage}
                        {block:NextPage}

                                {lang:Next}

                        {/block:NextPage}

{/block:Pagination}

                {block:IfNotSidebarOnLeft}

                            {block:IfShowPortrait}

{/block:IfShowPortrait}
                            {block:Description}
{Description}
{/block:Description}
                            {block:IfShowFollowMe} {lang:Follow me}
{/block:IfShowFollowMe}
                            {block:IfShowArchiveAndRandom}

                                 {lang:Archive}
                                 {lang:Random}

{/block:IfShowArchiveAndRandom}
                            {text:Custom Sidebar HTML}

                            {block:IfShowRSSFeed}{/block:IfShowRSSFeed}
                            {block:IfShowTwitterLink}{/block:IfShowTwitterLink}
                            {block:IfShowFacebookLink}{/block:IfShowFacebookLink}
                            {block:IfShowSoundCloudLink}{/block:IfShowSoundCloudLink}
                            {block:IfShowGitHubLink}{/block:IfShowGitHubLink}
                            {block:IfShowSkypeUsername}{/block:IfShowSkypeUsername}
                            {block:IfShowSteamLink}{/block:IfShowSteamlink}
                            {block:IfShowLastFmLink}{/block:IfShowLastFmLink}
                            {block:IfShowBandcampLink}{/block:IfShowBandcampLink}
                            {block:IfShowYouTubeLink}{/block:IfShowYouTubeLink}
                            {text:Custom Sidebar Footer HTML}

                    {block:IfShowFollowing}{block:Following}

{/block:Following}{/block:IfShowFollowing}
                    {block:IfShowThemeCredit}

                        {block:English}This tumblr Awesome

{/block:IfShowThemeCredit}

                {/block:IfNotSidebarOnLeft}

Example courtesy


text:
\hypertarget{interface_c_s_map_annotation}{
\subsection{CSMapAnnotation Klassenreferenz}
\label{interface_c_s_map_annotation}\index{CSMapAnnotation@{CSMapAnnotation}}
}

{\ttfamily \#import $<$CSMapAnnotation.h$>$}\subsubsection*{Öffentliche Methoden}
\begin{DoxyCompactItemize}
\item
(id) -\/ \hyperlink{interface_c_s_map_annotation_a59239c83c34dd66add7bbc27492d636c}{initWithCoordinate:annotationType:title:}
\end{DoxyCompactItemize}
\subsubsection*{Geschützte Attribute}
\begin{DoxyCompactItemize}
\item
CLLocationCoordinate2D \hyperlink{interface_c_s_map_annotation_a582707c028b9f92b952475fc0d6b6fee}{\_\-coordinate}
\item
\hyperlink{_c_s_map_annotation_8h_a5a0fe47e1e7efa6aae66effae002d410}{CSMapAnnotationType} \hyperlink{interface_c_s_map_annotation_a6c62bc91ec129a0eccdd33b67132a6ba}{\_\-annotationType}
\item
NSString $\ast$ \hyperlink{interface_c_s_map_annotation_ab46f2fe2f09d5a915a7822be0afe075a}{\_\-title}
\item
NSString $\ast$ \hyperlink{interface_c_s_map_annotation_a59d92c9b7f147399b428a5ef97eef757}{\_\-userData}
\item
NSURL $\ast$ \hyperlink{interface_c_s_map_annotation_aa08c22c0cfbd8cf2c4f05cbfc992d006}{\_\-url}
\end{DoxyCompactItemize}
\subsubsection*{Propertys}
\begin{DoxyCompactItemize}
\item
\hyperlink{_c_s_map_annotation_8h_a5a0fe47e1e7efa6aae66effae002d410}{CSMapAnnotationType} \hyperlink{interface_c_s_map_annotation_a073d4596a4598c6e8b4b6c1acb24cc4d}{annotationType}
\item
NSString $\ast$ \hyperlink{interface_c_s_map_annotation_a8afd11417c3990f0db0c9437da102419}{userData}
\item
NSURL $\ast$ \hyperlink{interface_c_s_map_annotation_a181ec27d42b87d0115b9f3df411fdbb7}{url}
\end{DoxyCompactItemize}

\subsubsection{Ausführliche Beschreibung}

Definiert in Zeile 19 der Datei CSMapAnnotation.h.

\subsubsection{Dokumentation der Elementfunktionen}
\hypertarget{interface_c_s_map_annotation_a59239c83c34dd66add7bbc27492d636c}{
\index{CSMapAnnotation@{CSMapAnnotation}!initWithCoordinate:annotationType:title:@{initWithCoordinate:annotationType:title:}}
\index{initWithCoordinate:annotationType:title:@{initWithCoordinate:annotationType:title:}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{initWithCoordinate:annotationType:title:}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (id) initWithCoordinate: (CLLocationCoordinate2D) {\em coordinate}\/ annotationType: ({\bf CSMapAnnotationType}) {\em annotationType}\/ title: (NSString$\ast$) {\em title}}\hfill}
\label{interface_c_s_map_annotation_a59239c83c34dd66add7bbc27492d636c}

Definiert in Zeile 19 der Datei CSMapAnnotation.m.

Benutzt \_\-annotationType, \_\-coordinate, \_\-title, \_\-userData und annotationType.

\subsubsection{Dokumentation der Datenelemente}
\hypertarget{interface_c_s_map_annotation_a6c62bc91ec129a0eccdd33b67132a6ba}{
\index{CSMapAnnotation@{CSMapAnnotation}!\_\-annotationType@{\_\-annotationType}}
\index{\_\-annotationType@{\_\-annotationType}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{\_\-annotationType}]{\setlength{\rightskip}{0pt plus 5cm}-\/ ({\bf CSMapAnnotationType}) {\bf \_\-annotationType}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_a6c62bc91ec129a0eccdd33b67132a6ba}

Definiert in Zeile 23 der Datei CSMapAnnotation.h.

Wird benutzt von initWithCoordinate:annotationType:title:.\hypertarget{interface_c_s_map_annotation_a582707c028b9f92b952475fc0d6b6fee}{
\index{CSMapAnnotation@{CSMapAnnotation}!\_\-coordinate@{\_\-coordinate}}
\index{\_\-coordinate@{\_\-coordinate}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{\_\-coordinate}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (CLLocationCoordinate2D) {\bf \_\-coordinate}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_a582707c028b9f92b952475fc0d6b6fee}

Definiert in Zeile 22 der Datei CSMapAnnotation.h.

Wird benutzt von initWithCoordinate:annotationType:title:.\hypertarget{interface_c_s_map_annotation_ab46f2fe2f09d5a915a7822be0afe075a}{
\index{CSMapAnnotation@{CSMapAnnotation}!\_\-title@{\_\-title}}
\index{\_\-title@{\_\-title}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{\_\-title}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (NSString$\ast$) {\bf \_\-title}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_ab46f2fe2f09d5a915a7822be0afe075a}

Definiert in Zeile 24 der Datei CSMapAnnotation.h.

Wird benutzt von initWithCoordinate:annotationType:title:.\hypertarget{interface_c_s_map_annotation_aa08c22c0cfbd8cf2c4f05cbfc992d006}{
\index{CSMapAnnotation@{CSMapAnnotation}!\_\-url@{\_\-url}}
\index{\_\-url@{\_\-url}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{\_\-url}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (NSURL$\ast$) {\bf \_\-url}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_aa08c22c0cfbd8cf2c4f05cbfc992d006}

Definiert in Zeile 26 der Datei CSMapAnnotation.h.\hypertarget{interface_c_s_map_annotation_a59d92c9b7f147399b428a5ef97eef757}{
\index{CSMapAnnotation@{CSMapAnnotation}!\_\-userData@{\_\-userData}}
\index{\_\-userData@{\_\-userData}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{\_\-userData}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (NSString$\ast$) {\bf \_\-userData}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_a59d92c9b7f147399b428a5ef97eef757}

Definiert in Zeile 25 der Datei CSMapAnnotation.h.

Wird benutzt von initWithCoordinate:annotationType:title:.

\subsubsection{Dokumentation der Propertys}
\hypertarget{interface_c_s_map_annotation_a073d4596a4598c6e8b4b6c1acb24cc4d}{
\index{CSMapAnnotation@{CSMapAnnotation}!annotationType@{annotationType}}
\index{annotationType@{annotationType}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{annotationType}]{\setlength{\rightskip}{0pt plus 5cm}-\/ ({\bf CSMapAnnotationType}) annotationType\hspace{0.3cm}{\ttfamily  \mbox{[}read, write, assign\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_a073d4596a4598c6e8b4b6c1acb24cc4d}

Definiert in Zeile 33 der Datei CSMapAnnotation.h.

Wird benutzt von initWithCoordinate:annotationType:title:.\hypertarget{interface_c_s_map_annotation_a181ec27d42b87d0115b9f3df411fdbb7}{
\index{CSMapAnnotation@{CSMapAnnotation}!url@{url}}
\index{url@{url}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{url}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (NSURL$\ast$) url\hspace{0.3cm}{\ttfamily  \mbox{[}read, write, retain\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_a181ec27d42b87d0115b9f3df411fdbb7}

Definiert in Zeile 35 der Datei CSMapAnnotation.h.\hypertarget{interface_c_s_map_annotation_a8afd11417c3990f0db0c9437da102419}{
\index{CSMapAnnotation@{CSMapAnnotation}!userData@{userData}}
\index{userData@{userData}!CSMapAnnotation@{CSMapAnnotation}}
\paragraph[{userData}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (NSString$\ast$) userData\hspace{0.3cm}{\ttfamily  \mbox{[}read, write, retain\mbox{]}}}\hfill}
\label{interface_c_s_map_annotation_a8afd11417c3990f0db0c9437da102419}

Definiert in Zeile 34 der Datei CSMapAnnotation.h.

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien:\begin{DoxyCompactItemize}
\item
Classes/\hyperlink{_c_s_map_annotation_8h}{CSMapAnnotation.h}\item
Classes/\hyperlink{_c_s_map_annotation_8m}{CSMapAnnotation.m}\end{DoxyCompactItemize}


text:
package io.solo.squash.service2;

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

        import static spark.Spark.*;

/**
 * Service 2 - Java implementation of calculator service for Squash demo
 *
 * @author axhixh
 */
public class Service2
{
    public static void main( String[] args )
    {
        port(8080);
        post("/calculate", (req, res) -> {
            try {
                JSONObject j = new JSONObject(req.body());
                int op1 = j.getInt("Op1");
                int op2 = j.getInt("Op2");
                boolean isAdd = j.getBoolean("IsAdd");

                return isAdd ? (op1 - op2) : (op1 + op2);
            } catch (JSONException err) {
                res.status(401);
                return "Invalid JSON request: " + err.getMessage();
            }
        });
    }
}


text:
content_t gcn_game_policy(game *g, int player_index) {
    practice_game *pg = game_as_practice(g, player_index);
    if (!pg) {
        return CHOICE_PASS;
    }
    content_t choice = gcn_practice_policy(pg, pg->deals, pg->num_deals);
    free(pg);
    return choice;
}

content_t mc_game_policy(game *g, int player_index) {
    practice_game *pg = game_as_practice(g, player_index);
    if (!pg) {
        return CHOICE_PASS;
    }
    mc_options options = simple_mc_options(10000, random_policy);
    options.step = step_practice;
    options.copy = copy_practice;
    content_t choice = iterate_mc(pg, pg->deals, pg->num_deals, options);
    free(pg);
    return choice;
}

content_t gcnk_game_policy(game *g, int player_index) {
    practice_game *pg = game_as_practice(g, player_index);
    if (!pg) {
        return CHOICE_PASS;
    }
    pg->time = 0;
    pg->player.total_score = 0;
    knockout_context *context = new_knockout(g, 1 - player_index);
    tree_options options;
    content_t choice = CHOICE_PASS;

    int iterations = 10000;
    int turns = 25;
    double eval_early(void *pg) {
        return eval_random_knockout_prototype(pg, iterations, turns, context);
    }
    options = simple_tree_options(eval_early, 0, 1);
    options.step = step_practice;
    options.copy = copy_practice;

    for (int num_deals = 1; num_deals <= g->num_deals; ++num_deals) {
        value_node *root = make_full_tree(num_deals, options.depth);
        solve_tree(pg, root, pg->deals, num_deals, options);
        if (root->value > 1e10) {
            choice = choose(root)->content;
        }
        free_tree(root);
    }
    if (choice != CHOICE_PASS) {
        free(pg);
        free(context);
        return choice;
    }

    double eval(void *_pg) {
        practice_game *pg = _pg;
        state *s = &pg->player.state;
        double groups = eval_groups(s);
        double chains = eval_groups(s);
        double nuisance = popcount(s->floors[0][GARBAGE]) + popcount(s->floors[1][GARBAGE]);
        double knockout = eval_random_knockout_prototype(pg, iterations, turns, context);
        return
            1 * groups +
            20 * chains +
            (-0.96) * nuisance +
            (-4.0 - 1.0 / (pg->delay + 2)) * pg->incoming +
            0.00001 * knockout;
    }

    options = simple_tree_options(eval, 1, 0.5);
    options.step = step_practice;
    options.copy = copy_practice;
    choice = solve(pg, pg->deals, pg->num_deals, options);
    free(pg);
    free(context);
    return choice;
}


text:
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("jquery"));
	else if(typeof define === 'function' && define.amd)
		define(["jquery"], factory);
	else if(typeof exports === 'object')
		exports["carty"] = factory(require("jquery"));
	else
		root["carty"] = factory(root["jQuery"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_14__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var carty = __webpack_require__(1);

	carty.format = {
	    currency: __webpack_require__(8),
	    number: __webpack_require__(10)
	};

	carty.storage = {
	    localStorage: __webpack_require__(12)
	};

	carty.ui = {
	    jquery: __webpack_require__(13)
	};

	module.exports = carty;

/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	module.exports = carty;

	var extend = __webpack_require__(2);
	var emitter = __webpack_require__(3);
	var toNumber = __webpack_require__(5);
	var options = __webpack_require__(6);
	var value = __webpack_require__(7);
	var type = __webpack_require__(4);

	var resolve = Promise.resolve.bind(Promise);
	var reject = Promise.reject.bind(Promise);

	var _defaultOptions = {
	    storage: null,
	    subtotal: function(cart) {
	        return cart.items().reduce(function(previous, item) {
	            return previous + (item.price * item.quantity);
	        }, 0);
	    },
	    discount: null,
	    shipping: null,
	    tax: null
	};

	var _defaultItemAttributes = {
	    quantity: 1
	};

	function carty(opts) {
	    function cart() {
	        return {
	            size: cart.size(),
	            quantity: cart.quantity(),
	            subtotal: cart.subtotal(),
	            discount: cart.discount(),
	            shipping: cart.shipping(),
	            tax: cart.tax(),
	            total: cart.total(),
	            items: _items.map(function(item) {
	                return item();
	            })
	        };
	    }

	    var emit = emitter(cart);

	    var _options = extend({}, _defaultOptions, opts);
	    var _items = [];
	    var _ready;

	    cart.on(['load', 'add', 'update', 'remove', 'clear', 'checkout'], emit.bind(undefined, 'change'));
	    cart.on(['loaded', 'added', 'updated', 'removed', 'cleared', 'checkedout'], emit.bind(undefined, 'changed'));
	    cart.on(['loadfailed', 'addfailed', 'updatefailed', 'removefailed', 'clearfailed', 'checkoutfailed'], emit.bind(undefined, 'changefailed'));

	    cart.options = options.bind(cart, _options);

	    cart.ready = function(onReady) {
	        ready(onReady);

	        return cart;
	    };

	    cart.error = function(onError) {
	        error(onError);

	        return cart;
	    };

	    cart.size = function() {
	        return _items.length;
	    };

	    cart.has = function(item) {
	        return !!has(item);
	    };

	    cart.get = function(item) {
	        var found = has(item);

	        return !found ? null : found.item();
	    };

	    cart.add = function(item) {
	        ready(add.bind(cart, item));

	        return cart;
	    };

	    cart.update = function(item) {
	        ready(update.bind(cart, item));

	        return cart;
	    };

	    cart.remove = function(item) {
	        ready(remove.bind(cart, item));

	        return cart;
	    };

	    cart.clear = function() {
	        ready(clear);

	        return cart;
	    };

	    cart.checkout = function(data) {
	        ready(checkout.bind(cart, data));

	        return cart;
	    };

	    cart.load = function() {
	        if (!_ready) {
	            _ready = load();
	        } else {
	            ready(load);
	        }

	        return cart;
	    };

	    cart.changed = function() {
	        if (!_ready) {
	            _ready = emit('changed');
	        } else {
	            ready(emit.bind(undefined, 'changed'));
	        }

	        return cart;
	    };

	    cart.each = function(callback, context) {
	        _items.every(function(item, index) {
	            return false !== callback.call(context, item(), index, cart);
	        });

	        return cart;
	    };

	    cart.items = function() {
	        return _items.map(function(item) {
	            return item();
	        });
	    };

	    cart.quantity = function() {
	        return _items.reduce(function(previous, item) {
	            return previous + item().quantity;
	        }, 0);
	    };

	    cart.subtotal = function() {
	        return toNumber(value(_options.subtotal, undefined, [cart]), _options);
	    };

	    cart.discount = function() {
	        return toNumber(value(_options.discount, undefined, [cart]), _options);
	    };

	    cart.shipping = function() {
	        if (!cart.size()) {
	            return 0;
	        }

	        return toNumber(value(_options.shipping, undefined, [cart]), _options);
	    };

	    cart.tax = function() {
	        if (!cart.size()) {
	            return 0;
	        }

	        return toNumber(value(_options.tax, undefined, [cart]), _options);
	    };

	    cart.total = function() {
	        return cart.subtotal() - cart.discount() + cart.tax() + cart.shipping();
	    };

	    cart.item = function(attr) {
	        return createItem(attr);
	    };

	    function ready(onReady) {
	        if (!_ready) {
	            _ready = load();
	        }

	        _ready['catch'](function(e) {
	            setTimeout(function() { throw e; });
	        });

	        _ready = _ready.then(function() {
	            return onReady(cart);
	        });
	    }

	    function error(onError) {
	        if (!_ready) {
	            _ready = load();
	        }

	        _ready = _ready['catch'](function(e) {
	            return onError(e, cart);
	        });
	    }

	    function load() {
	        return emit('load').then(function() {
	            return resolve(
	                _options.storage && _options.storage.load(cart)
	            ).then(function(items) {
	                if (type(items) === 'array') {
	                    _items = items.map(function(attr) {
	                        return createItem(attr);
	                    });
	                }
	            }).then(emit.bind(cart, 'loaded'), function(e) {
	                    emit('loadfailed', e);
	                    return reject(e);
	            });
	        }, function() {
	            // Catch load event listener rejections
	        });
	    }

	    function has(attr) {
	        var checkItem;
	        var found = false;

	        try {
	            checkItem = createItem(attr).call();
	        } catch (e) {
	            return false;
	        }

	        _items.every(function(item, index) {
	            if (item.equals(checkItem)) {
	                found = {item: item, index: index};
	            }

	            return !found;
	        });

	        return found;
	    }

	    function update(attr) {
	        return emit('update', attr).then(function() {
	            var existing = has(attr);

	            if (!existing) {
	                return;
	            }

	            var item = existing.item.merge(attr);
	            var state = item();

	            if (state.quantity < 1) {
	                return remove(state);
	            }

	            _items[existing.index] = item;

	            return resolve(
	                _options.storage && _options.storage.put(state, cart)
	            ).then(emit.bind(cart, 'updated', state), function(e) {
	                emit('updatefailed', e, state);
	                return reject(e);
	            })['catch'](function() {
	                // Catch updated event listener rejections
	            });
	        }, function() {
	            // Catch update event listener rejections
	        });
	    }

	    function add(attr) {
	        return emit('add', attr).then(function() {
	            var item = createItem(attr);
	            var existing = has(attr);

	            if (existing) {
	                attr = extend({}, attr, {
	                    quantity: existing.item().quantity + item().quantity
	                });

	                item = existing.item.merge(attr);
	            }

	            var state = item();

	            if (state.quantity < 1) {
	                return remove(state);
	            }

	            if (existing) {
	                _items[existing.index] = item;
	            } else {
	                _items.push(item);
	            }

	            return resolve(
	                _options.storage && _options.storage.put(state, cart)
	            ).then(emit.bind(cart, 'added', state), function(e) {
	                emit('addfailed', e, state);
	                return reject(e);
	            })['catch'](function() {
	                // Catch added event listener rejections
	            });
	        }, function() {
	            // Catch add event listener rejections
	        });
	    }

	    function remove(attr) {
	        return emit('remove', attr).then(function() {
	            var existing = has(attr);

	            if (!existing) {
	                return;
	            }

	            _items.splice(existing.index, 1);

	            var state = existing.item();

	            return resolve(
	                _options.storage && _options.storage.remove(state, cart)
	            ).then(emit.bind(cart, 'removed', state), function(e) {
	                emit('removefailed', e, state);
	                return reject(e);
	            })['catch'](function() {
	                // Catch removed event listener rejections
	            });
	        }, function() {
	            // Catch remove event listener rejections
	        });
	    }

	    function clear() {
	        return emit('clear').then(function() {
	            _items.length = 0;

	            return resolve(
	                _options.storage && _options.storage.clear(cart)
	            ).then(emit.bind(cart, 'cleared'), function(e) {
	                emit('clearfailed', e);
	                return reject(e);
	            })['catch'](function() {
	                // Catch cleared event listener rejections
	            });
	        }, function() {
	            // Catch clear event listener rejections
	        });
	    }

	    function checkout(data) {
	        return emit('checkout').then(function() {
	            return resolve(
	                _options.storage && _options.storage.checkout(data, cart)
	            )
	            .then(function(value) {
	                _items.length = 0;

	                return value;
	            })
	            .then(emit.bind(cart, 'checkedout'), function(e) {
	                emit('checkoutfailed', e);
	                return reject(e);
	            })['catch'](function() {
	                // Catch checkedout event listener rejections
	            });
	        }, function() {
	            // Catch checkout event listener rejections
	        });
	    }

	    function normalize(attr) {
	        if (type(attr) === 'function') {
	            attr = attr(cart);
	        }

	        if (type(attr) !== 'object') {
	            return {id: attr};
	        }

	        return attr;
	    }

	    function createItem(attributes) {
	        var _attributes = extend({}, _defaultItemAttributes, normalize(attributes));

	        if (!_attributes.id) {
	            throw 'Item must be a string or an object with at least an id property.';
	        }

	        function item() {
	            return extend({}, _attributes, {
	                id: _attributes.id,
	                label: _attributes.label || _attributes.id,
	                quantity: toNumber(_attributes.quantity, _options),
	                price: toNumber(_attributes.price, _options),
	                variant: variant()
	            });
	        }

	        function variant() {
	            if (_attributes.variant == null) {
	                return {};
	            }

	            if (type(_attributes.variant) !== 'object') {
	                return {variant: _attributes.variant};
	            }

	            return _attributes.variant;
	        }

	        item.merge = function(attr) {
	            return createItem(extend({}, _attributes, normalize(attr)));
	        };

	        item.equals = function(other) {
	            try {
	                var otherItem = createItem(other).call();
	            } catch (e) {
	                return false;
	            }

	            function compareValue(value1, value2) {
	                if ('number' === type(value1)) {
	                    value1 = '' + value1;
	                }

	                if ('number' === type(value2)) {
	                    value2 = '' + value2;
	                }

	                return value1 === value2;
	            }

	            if (!compareValue(otherItem.id, _attributes.id)) {
	                return false;
	            }

	            var itemVariant = variant();
	            var otherVariant = otherItem.variant;

	            function compare(key) {
	                return compareValue(otherVariant[key], itemVariant[key]);
	            }

	            return Object.keys(itemVariant).every(compare) && Object.keys(otherVariant).every(compare);
	        };

	        return item;
	    }

	    return cart;
	}

	carty.options = options.bind(carty, _defaultOptions);

/***/ }),
/* 2 */
/***/ (function(module, exports) {

	'use strict';

	var hasOwn = Object.prototype.hasOwnProperty;
	var toStr = Object.prototype.toString;
	var defineProperty = Object.defineProperty;
	var gOPD = Object.getOwnPropertyDescriptor;

	var isArray = function isArray(arr) {
		if (typeof Array.isArray === 'function') {
			return Array.isArray(arr);
		}

		return toStr.call(arr) === '[object Array]';
	};

	var isPlainObject = function isPlainObject(obj) {
		if (!obj || toStr.call(obj) !== '[object Object]') {
			return false;
		}

		var hasOwnConstructor = hasOwn.call(obj, 'constructor');
		var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
		// Not own constructor property must be Object
		if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
			return false;
		}

		// Own properties are enumerated firstly, so to speed up,
		// if last one is own, then all properties are own.
		var key;
		for (key in obj) { /**/ }

		return typeof key === 'undefined' || hasOwn.call(obj, key);
	};

	// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
	var setProperty = function setProperty(target, options) {
		if (defineProperty && options.name === '__proto__') {
			defineProperty(target, options.name, {
				enumerable: true,
				configurable: true,
				value: options.newValue,
				writable: true
			});
		} else {
			target[options.name] = options.newValue;
		}
	};

	// Return undefined instead of __proto__ if '__proto__' is not an own property
	var getProperty = function getProperty(obj, name) {
		if (name === '__proto__') {
			if (!hasOwn.call(obj, name)) {
				return void 0;
			} else if (gOPD) {
				// In early versions of node, obj['__proto__'] is buggy when obj has
				// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
				return gOPD(obj, name).value;
			}
		}

		return obj[name];
	};

	module.exports = function extend() {
		var options, name, src, copy, copyIsArray, clone;
		var target = arguments[0];
		var i = 1;
		var length = arguments.length;
		var deep = false;

		// Handle a deep copy situation
		if (typeof target === 'boolean') {
			deep = target;
			target = arguments[1] || {};
			// skip the boolean and the target
			i = 2;
		}
		if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
			target = {};
		}

		for (; i < length; ++i) {
			options = arguments[i];
			// Only deal with non-null/undefined values
			if (options != null) {
				// Extend the base object
				for (name in options) {
					src = getProperty(target, name);
					copy = getProperty(options, name);

					// Prevent never-ending loop
					if (target !== copy) {
						// Recurse if we're merging plain objects or arrays
						if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
							if (copyIsArray) {
								copyIsArray = false;
								clone = src && isArray(src) ? src : [];
							} else {
								clone = src && isPlainObject(src) ? src : {};
							}

							// Never move original objects, clone them
							setProperty(target, { name: name, newValue: extend(deep, clone, copy) });

						// Don't bring in undefined values
						} else if (typeof copy !== 'undefined') {
							setProperty(target, { name: name, newValue: copy });
						}
					}
				}
			}
		}

		// Return the modified object
		return target;
	};

/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	module.exports = emitter;

	var type = __webpack_require__(4);

	function isArray(value) {
	    return type(value) === 'array';
	}

	// Adapted from component-emitter
	function emitter(object) {
	    var _callbacks = {};

	    object.on = function(event, fn) {
	        if (isArray(event)) {
	            event.forEach(function(evt) {
	                object.on(evt, fn);
	            });
	        } else {
	            (_callbacks['$' + event] = _callbacks['$' + event] || [])
	                .push(fn);
	        }

	        return object;
	    };

	    object.once = function(event, fn) {
	        if (isArray(event)) {
	            event.forEach(function(evt) {
	                object.once(evt, fn);
	            });

	            return object;
	        }

	        function on() {
	            object.off(event, on);
	            fn.apply(object, arguments);
	        }

	        on.fn = fn;
	        object.on(event, on);

	        return object;
	    };

	    object.off = function(event, fn) {
	        if (0 == arguments.length) {
	            _callbacks = {};
	            return object;
	        }

	        if (isArray(event)) {
	            event.forEach(function(evt) {
	                object.off(evt, fn);
	            });

	            return object;
	        }

	        var callbacks = _callbacks['$' + event];

	        if (!callbacks) {
	            return object;
	        }

	        if (1 == arguments.length) {
	            delete _callbacks['$' + event];
	            return object;
	        }

	        var cb;

	        for (var i = 0; i < callbacks.length; i++) {
	            cb = callbacks[i];
	            if (cb === fn || cb.fn === fn) {
	                callbacks.splice(i, 1);
	                break;
	            }
	        }

	        return object;
	    };

	    return function emit(event) {
	        var args = [].slice.call(arguments, 1), ret;

	        if (isArray(event)) {
	            return Promise.all(event.map(function(evt) {
	                return emit.apply(object, [evt].concat(args));
	            }));
	        }

	        var callbacks = _callbacks['$' + event];

	        if (!callbacks) {
	            return Promise.resolve();
	        }

	        return Promise.all(callbacks.slice(0).map(function(callback) {
	            ret = callback.apply(object, args);

	            if (false === ret) {
	                return Promise.reject();
	            }

	            return ret;
	        }));
	    };
	}

/***/ }),
/* 4 */
/***/ (function(module, exports) {

	'use strict';

	module.exports = type;

	var natives = {
	    '[object Arguments]': 'arguments',
	    '[object Array]': 'array',
	    '[object Date]': 'date',
	    '[object Function]': 'function',
	    '[object Number]': 'number',
	    '[object RegExp]': 'regexp',
	    '[object String]': 'string'
	};

	function type(obj) {
	    var str = Object.prototype.toString.call(obj);

	    if (natives[str]) {
	        return natives[str];
	    }

	    if (obj === null) {
	        return 'null';
	    }

	    if (obj === undefined) {
	        return 'undefined';
	    }

	    if (obj === Object(obj)) {
	        return 'object';
	    }

	    return typeof obj;
	}

/***/ }),
/* 5 */
/***/ (function(module, exports) {

	'use strict';

	module.exports = toNumber;

	var numIsFinite = Number.isFinite || function(value) {
	    return typeof value === 'number' && isFinite(value);
	};

	function toNumber(value, options) {
	    return _toNumber(options, value);
	}

	toNumber.configure = function(options) {
	    return _toNumber.bind(undefined, options);
	};

	function _toNumber(options, value) {
	    if (numIsFinite(value)) {
	        return value;
	    }

	    var decimalSeparator = options && options.decimalSeparator || '.';

	    var string = '' + value;

	    var dotPos = string.indexOf('.');
	    var commaPos = string.indexOf(',');

	    if (commaPos > -1) {
	        if (dotPos > -1 && commaPos > dotPos) {
	            decimalSeparator = ',';
	        } else if (dotPos === -1) {
	            var decimalLength = string.substr(commaPos + 1).length;
	            if (decimalLength > 0 && decimalLength < 3) {
	                decimalSeparator = ',';
	            }
	        }
	    }

	    if (dotPos > -1 && commaPos > -1 && commaPos > dotPos) {
	        decimalSeparator = ',';
	    } else if (dotPos === -1 && commaPos > -1 && string.substr(commaPos + 1).length < 3) {
	        decimalSeparator = ',';
	    }

	    var regex = new RegExp("[^0-9-" + decimalSeparator + "]", ["g"]);

	    return parseFloat(
	        string
	            .replace(/\(([^-]+)\)/, "-$1") // replace bracketed values with negatives
	            .replace(regex, '') // strip out any cruft
	            .replace(decimalSeparator, '.') // make sure decimal separator is standard
	    ) || 0;
	}

/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	module.exports = options;

	var extend = __webpack_require__(2);
	var type = __webpack_require__(4);

	function options(options, key, value) {
	    if (arguments.length === 1) {
	        return extend(true, {}, options);
	    }

	    if (type(key) === 'string') {
	        if (type(value) === 'undefined') {
	            return type(options[key]) === 'undefined' ? null : options[key];
	        }

	        options[key] = value;
	    } else {
	        extend(options, key);
	    }

	    return this;
	}

/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	module.exports = value;

	var type = __webpack_require__(4);

	function value(value, context, args) {
	    if (type(value) === 'function') {
	        return value.apply(context, args || []);
	    }

	    return value;
	}

/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	module.exports = formatCurrency;

	var extend = __webpack_require__(2);
	var defaultCurrencies = __webpack_require__(9);
	var formatNumber = __webpack_require__(10);

	function formatCurrency(value, options) {
	    return _formatCurrency(options, value);
	}

	formatCurrency.configure = function(options) {
	    return _formatCurrency.bind(undefined, options);
	};

	function _formatCurrency(options, value) {
	    options = options || {};

	    var currency = options.currency;
	    var currencies = options.currencies || defaultCurrencies;
	    var currencyOpts = currencies[currency] || {suffix: currency ? ' ' + currency : ''};

	    var opts = extend(
	        {precision: 2},
	        currencyOpts,
	        options
	    );

	    return formatNumber(value, opts);
	}

/***/ }),
/* 9 */
/***/ (function(module, exports) {

	'use strict';

	module.exports = {
	    AED: { prefix: '\u062c' },
	    ANG: { prefix: '\u0192' },
	    ARS: { prefix: '$', suffix: ' ARS' },
	    AUD: { prefix: '$', suffix: ' AUD' },
	    AWG: { prefix: '\u0192' },
	    BBD: { prefix: '$', suffix: ' BBD' },
	    BGN: { prefix: '\u043b\u0432' },
	    BTC: { suffix: ' BTC', precision: 4 },
	    BMD: { prefix: '$', suffix: ' BMD' },
	    BND: { prefix: '$', suffix: ' BND' },
	    BRL: { prefix: 'R$' },
	    BSD: { prefix: '$', suffix: ' BSD' },
	    CAD: { prefix: '$', suffix: ' CAD' },
	    CHF: { suffix: ' CHF' },
	    CLP: { prefix: '$', suffix: ' CLP' },
	    CNY: { prefix: '\u00A5' },
	    COP: { prefix: '$', suffix: ' COP' },
	    CRC: { prefix: '\u20A1' },
	    CZK: { prefix: 'Kc' },
	    DKK: { prefix: 'kr' },
	    DOP: { prefix: '$', suffix: ' DOP' },
	    EEK: { prefix: 'kr' },
	    EUR: { prefix: '\u20AC' },
	    GBP: { prefix: '\u00A3' },
	    GTQ: { prefix: 'Q' },
	    HKD: { prefix: '$', suffix: ' HKD' },
	    HRK: { prefix: 'kn' },
	    HUF: { prefix: 'Ft' },
	    IDR: { prefix: 'Rp' },
	    ILS: { prefix: '\u20AA' },
	    INR: { prefix: 'Rs.' },
	    ISK: { prefix: 'kr' },
	    JMD: { prefix: 'J$' },
	    JPY: { prefix: '\u00A5', precision: 0 },
	    KRW: { prefix: '\u20A9' },
	    KYD: { prefix: '$', suffix: ' KYD' },
	    LTL: { prefix: 'Lt' },
	    LVL: { prefix: 'Ls' },
	    MXN: { prefix: '$', suffix: ' MXN' },
	    MYR: { prefix: 'RM' },
	    NOK: { prefix: 'kr' },
	    NZD: { prefix: '$', suffix: ' NZD' },
	    PEN: { prefix: 'S/' },
	    PHP: { prefix: 'Php' },
	    PLN: { prefix: 'z' },
	    QAR: { prefix: '\ufdfc' },
	    RON: { prefix: 'lei' },
	    RUB: { prefix: '\u0440\u0443\u0431' },
	    SAR: { prefix: '\ufdfc' },
	    SEK: { prefix: 'kr' },
	    SGD: { prefix: '$', suffix: ' SGD' },
	    THB: { prefix: '\u0E3F' },
	    TRY: { prefix: 'TL' },
	    TTD: { prefix: 'TT$' },
	    TWD: { prefix: 'NT$' },
	    UAH: { prefix: '\u20b4' },
	    USD: { prefix: '$' },
	    UYU: { prefix: '$U' },
	    VEF: { prefix: 'Bs' },
	    VND: { prefix: '\u20ab' },
	    XCD: { prefix: '$', suffix: ' XCD' },
	    ZAR: { prefix: 'R' }
	};

/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	module.exports = formatNumber;

	var toNumber = __webpack_require__(5);
	var toFixed = __webpack_require__(11);
	var type = __webpack_require__(4);

	function formatNumber(value, options) {
	    return _formatNumber(options, value);
	}

	formatNumber.configure = function(options) {
	    return _formatNumber.bind(undefined, options);
	};

	function _formatNumber(options, value) {
	    var number = toNumber(value);

	    options = options || {};

	    var isNeg = (number < 0),
	        output = number + '',
	        precision = options.precision,
	        decSep = options.decimalSeparator || '.',
	        groupSep = options.groupingSeparator,
	        groupSize = type(options.groupingSize) === 'number' ? options.groupingSize : 3,
	        decIndex,
	        newOutput, count, i;

	    // Decimal precision
	    if (type(precision) === 'number') {
	        // Round to the correct decimal place
	        output = toFixed(number, precision);
	    }

	    // Decimal separator
	    if (decSep !== '.') {
	        output = output.replace('.', decSep);
	    }

	    // Add the grouping separator
	    if (groupSep) {
	        // Find the dot or where it would be
	        decIndex = output.lastIndexOf(decSep);
	        decIndex = (decIndex > -1) ? decIndex : output.length;
	        // Start with the dot and everything to the right
	        newOutput = output.substring(decIndex);
	        // Working left, every third time add a separator, every time add a digit
	        for (count = 0, i = decIndex; i > 0; i--) {
	            if ((count % groupSize === 0) && (i !== decIndex) && (!isNeg || (i > 1))) {
	                newOutput = groupSep + newOutput;
	            }
	            newOutput = output.charAt(i - 1) + newOutput;
	            count++;
	        }
	        output = newOutput;
	    }

	    return (options.prefix || '') + output + (options.suffix || '');
	}

/***/ }),
/* 11 */
/***/ (function(module, exports) {

	'use strict';

	module.exports = toFixed;

	function toFixed(value, precision, options) {
	    return _toFixed(options, value, precision);
	}

	toFixed.configure = function(options) {
	    return _toFixed.bind(undefined, options);
	};

	function _toFixed(options, value, precision) {
	    var roundingFunction = options && options.roundingFunction || Math.round;
	    var power = Math.pow(10, precision || 0);

	    return (roundingFunction(value * power) / power).toFixed(precision);
	}

/***/ }),
/* 12 */
/***/ (function(module, exports) {

	'use strict';

	module.exports = storageLocalStorage;

	function storageLocalStorage(namespace, localStorage) {
	    namespace = namespace || 'carty';
	    localStorage = localStorage || window.localStorage;

	    function save(item, cart) {
	        localStorage.setItem(namespace, JSON.stringify(cart.items()));
	    }

	    function empty() {
	        localStorage.removeItem(namespace);
	    }

	    return {
	        load: function() {
	            try {
	                return JSON.parse(localStorage.getItem(namespace));
	            } catch (e) {
	                return []
	            }
	        },
	        put: save,
	        remove: save,
	        clear: empty,
	        checkout: empty
	    };
	}

/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	module.exports = uiJquery;

	var $ = __webpack_require__(14);

	var _defaultOptions = {
	    namespace: 'carty',
	    numberFormatter: function(number) {
	        return number;
	    },
	    currencyFormatter: function(number) {
	        return number;
	    }
	};

	var _inputSelector = 'input,select,textarea';
	var _dataAttrPrefixLength = 'data-'.length;

	function uiJquery(cart, options) {
	    var _options = $.extend({}, _defaultOptions, options);

	    function dataKey(prop) {
	        return _options.namespace + '-' + prop;
	    }

	    function dataAttr(prop) {
	        return 'data-' + dataKey(prop);
	    }

	    function dataSelector(prop) {
	        return '[' + dataAttr(prop) + ']';
	    }

	    var _itemSelector = dataSelector('item');
	    var _itemDataKey = dataKey('item');
	    var _itemDataAttrPrefix = dataAttr('item-');
	    var _itemVariantDataAttr = dataAttr('item-variant');
	    var _itemVariantDataAttrPrefix = dataAttr('item-variant-');

	    var _addDataKey = dataKey('add');
	    var _addSelector = dataSelector('add');
	    var _addButtonSelector = dataSelector('add') + ':not(' + _inputSelector + ')';
	    var _addInputSelector = dataSelector('add') + _inputSelector;
	    var _updateDataKey = dataKey('update');
	    var _updateSelector = dataSelector('update');
	    var _updateButtonSelector = dataSelector('update') + ':not(' + _inputSelector + ')';
	    var _updateInputSelector = dataSelector('update') + _inputSelector;
	    var _removeSelector = dataSelector('remove');
	    var _removeDataKey = dataKey('remove');
	    var _clearSelector = dataSelector('clear');

	    function ensureObject(data) {
	        return $.type(data) !== 'object' ? {} : data;
	    }

	    function setValue(el, value) {
	        el
	            .filter(_inputSelector)
	            .val(value)
	            .end()
	            .filter('a')
	            .attr('href', value)
	            .end()
	            .filter('img')
	            .attr('src', value)
	            .end()
	            .not(_inputSelector)
	            .not('img')
	            .not('a')
	            .text(value)
	        ;
	    }

	    function getValue(el, dataKey) {
	        return el.data(dataKey) // data- attribute
	            || el.val() // form element
	            || el.attr('href') // <a> element
	            || el.attr('src') // <img> element
	            || $.trim(el.text()) // html container element
	            || null;
	    }

	    function collectItemData(el, elData) {
	        var itemEl = el;

	        var itemData = {};
	        var itemVariants = {};
	        var itemVariantsFound = false;

	        function extract() {
	            var el = $(this);

	            if (el.is(':checkbox,:radio') && !el.is(':checked')) {
	                return;
	            }

	            $.each(this.attributes, function() {
	                if (this.name.indexOf(_itemDataAttrPrefix) < 0) {
	                    return;
	                }

	                var name = el.attr('name');
	                var val  = getValue(el, this.name.substr(_dataAttrPrefixLength));

	                if (this.name.indexOf(_itemVariantDataAttr) > -1) {
	                    if (name || this.name.indexOf(_itemVariantDataAttrPrefix) >= 0) {
	                        itemVariants[name || this.name.substr(_itemVariantDataAttrPrefix.length)] = val;
	                    } else {
	                        $.extend(itemVariants, val);
	                    }

	                    itemVariantsFound = true;
	                } else {
	                    itemData[name || this.name.substr(_itemDataAttrPrefix.length)] = val;
	                }
	            });
	        }

	        if (!itemEl.is(_itemSelector)) {
	            itemEl = el.closest(_itemSelector);
	        }

	        itemEl.each(extract);
	        itemEl.find('*').each(extract);

	        if (itemVariantsFound) {
	            $.extend(itemData, {variant: itemVariants});
	        }

	        elData = ensureObject(elData);

	        if (el.is(_inputSelector)) {
	            var name = el.attr('name');

	            if (name) {
	                elData[name] = el.val();
	            }
	        }

	        return $.extend(
	            itemData,
	            ensureObject(itemEl.data(_itemDataKey)),
	            elData
	        );
	    }

	    // ---

	    var addHandler = function(e) {
	        var el = $(this);

	        cart.add(collectItemData(el, el.data(_addDataKey)));
	    };

	    var updateHandler = function(e) {
	        var el = $(this);

	        cart.update(collectItemData(el, el.data(_updateDataKey)));
	    };

	    $(document)
	        .on('click', _addButtonSelector, addHandler)
	        .on('change', _addInputSelector, addHandler)
	        .on('click', _updateButtonSelector, updateHandler)
	        .on('change', _updateInputSelector, updateHandler)
	        .on('click', _removeSelector, function(e) {
	            var el = $(this);

	            cart.remove(collectItemData(el, el.data(_removeDataKey)));
	        })
	        .on('click', _clearSelector, function() {
	            cart.clear()
	        })
	    ;

	    // ---

	    function update() {
	        $.each([
	            'size',
	            'quantity'
	        ], function (i, prop) {
	            setValue(
	                $(dataSelector(prop)),
	                _options.numberFormatter(cart[prop]())
	            );
	        });

	        $.each([
	            'subtotal',
	            'discount',
	            'shipping',
	            'tax',
	            'total'
	        ], function (i, prop) {
	            setValue(
	                $(dataSelector(prop)),
	                _options.currencyFormatter(cart[prop]())
	            );
	        });
	    }

	    $(function() {
	        cart.ready(function() {
	            update();
	            cart.on('changed', update);
	        });
	    });

	    return update;
	}

/***/ }),
/* 14 */
/***/ (function(module, exports) {

	module.exports = __WEBPACK_EXTERNAL_MODULE_14__;

/***/ })
/******/ ])
});
;


text:
        This metric reports the number of lines of product code in each package, including sub-packages.
        Comments are counted for purposes of this metric, but whitespace is not.

Abbreviation: LOCp(rec)

Powered by MetricsReloaded


text:
package main

import (
	"fmt"
	"sync/atomic"

	"github.com/kataras/iris/v12"

	"github.com/kataras/iris/v12/websocket"
)

var events = websocket.Namespaces{
	"default": websocket.Events{
		websocket.OnRoomJoined: onRoomJoined,
		websocket.OnRoomLeft:   onRoomLeft,
	},
}

func main() {
	// init the web application instance
	// app := iris.New()
	app := iris.Default()

	// load templates
	app.RegisterView(iris.HTML("./templates", ".html").Reload(true))
	// setup the websocket server
	ws := websocket.New(websocket.DefaultGorillaUpgrader, events)

	app.Get("/my_endpoint", websocket.Handler(ws))

	// register static assets request path and system directory
	app.HandleDir("/js", iris.Dir("./static/assets/js"))

	h := func(ctx iris.Context) {
		ctx.ViewData("", page{PageID: "index page"})
		ctx.View("index.html")
	}

	h2 := func(ctx iris.Context) {
		ctx.ViewData("", page{PageID: "other page"})
		ctx.View("other.html")
	}

	// Open some browser tabs/or windows
	// and navigate to
	// http://localhost:8080/ and http://localhost:8080/other multiple times.
	// Each page has its own online-visitors counter.
	app.Get("/", h)
	app.Get("/other", h2)
	app.Listen(":8080")
}

type page struct {
	PageID string
}

type pageView struct {
	source string
	count  uint64
}

func (v *pageView) increment() {
	atomic.AddUint64(&v.count, 1)
}

func (v *pageView) decrement() {
	atomic.AddUint64(&v.count, ^uint64(0))
}

func (v *pageView) getCount() uint64 {
	return atomic.LoadUint64(&v.count)
}

type (
	pageViews []pageView
)

func (v *pageViews) Add(source string) {
	args := *v
	n := len(args)
	for i := 0; i < n; i++ {
		kv := &args[i]
		if kv.source == source {
			kv.increment()
			return
		}
	}

	c := cap(args)
	if c > n {
		args = args[:n+1]
		kv := &args[n]
		kv.source = source
		kv.count = 1
		*v = args
		return
	}

	kv := pageView{}
	kv.source = source
	kv.count = 1
	*v = append(args, kv)
}

func (v *pageViews) Get(source string) *pageView {
	args := *v
	n := len(args)
	for i := 0; i < n; i++ {
		kv := &args[i]
		if kv.source == source {
			return kv
		}
	}
	return nil
}

func (v *pageViews) Reset() {
	*v = (*v)[:0]
}

var v pageViews

func viewsCountBytes(viewsCount uint64) []byte {
	// * there are other methods to convert uint64 to []byte
	return []byte(fmt.Sprintf("%d", viewsCount))
}

func onRoomJoined(ns *websocket.NSConn, msg websocket.Message) error {
	// the roomName here is the source.
	pageSource := string(msg.Room)

	v.Add(pageSource)

	viewsCount := v.Get(pageSource).getCount()
	if viewsCount == 0 {
		viewsCount++ // count should be always > 0 here
	}

	// fire the "onNewVisit" client event
	// on each connection joined to this room (source page)
	// and notify of the new visit,
	// including this connection (see nil on first input arg).
	ns.Conn.Server().Broadcast(nil, websocket.Message{
		Namespace: msg.Namespace,
		Room:      pageSource,
		Event:     "onNewVisit", // fire the "onNewVisit" client event.
		Body:      viewsCountBytes(viewsCount),
	})

	return nil
}

func onRoomLeft(ns *websocket.NSConn, msg websocket.Message) error {
	// the roomName here is the source.
	pageV := v.Get(msg.Room)
	if pageV == nil {
		return nil // for any case that this room is not a pageView source
	}
	// decrement -1 the specific counter for this page source.
	pageV.decrement()

	// fire the "onNewVisit" client event
	// on each connection joined to this room (source page)
	// and notify of the new, decremented by one, visits count.
	ns.Conn.Server().Broadcast(nil, websocket.Message{
		Namespace: msg.Namespace,
		Room:      msg.Room,
		Event:     "onNewVisit",
		Body:      viewsCountBytes(pageV.getCount()),
	})

	return nil
}


text:
<?xml version="1.0" encoding="utf-8"?>
<Module>
  <Name>SubmoduleA</Name>
  <DefaultAction>resync</DefaultAction>
  <GenerateNuGetRepositories>true</GenerateNuGetRepositories>
  <Packages>
    <Package Uri="http://protobuild.org/hach-que/TestEmptyPackage" Folder="Package" GitRef="master" />
  </Packages>
</Module>


text:
require 'test_helper'

class PurposesControllerTest < ActionController::TestCase
  setup do
    @purpose = purposes(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:purposes)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create purpose" do
    assert_difference('Purpose.count') do
      post :create, purpose: { goal: @purpose.goal, user_id: @purpose.user_id }
    end

    assert_redirected_to purpose_path(assigns(:purpose))
  end

  test "should show purpose" do
    get :show, id: @purpose
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @purpose
    assert_response :success
  end

  test "should update purpose" do
    patch :update, id: @purpose, purpose: { goal: @purpose.goal, user_id: @purpose.user_id }
    assert_redirected_to purpose_path(assigns(:purpose))
  end

  test "should destroy purpose" do
    assert_difference('Purpose.count', -1) do
      delete :destroy, id: @purpose
    end

    assert_redirected_to purposes_path
  end
end


text:
package app

import (
	"errors"
	"fmt"
	"reflect"

	"k8s.io/apimachinery/pkg/types"
	"k8s.io/apiserver/pkg/authentication/authenticator"
	"k8s.io/apiserver/pkg/authentication/authenticatorfactory"
	"k8s.io/apiserver/pkg/authorization/authorizer"
	"k8s.io/apiserver/pkg/authorization/authorizerfactory"
	"k8s.io/apiserver/pkg/server/dynamiccertificates"
	clientset "k8s.io/client-go/kubernetes"
	authenticationclient "k8s.io/client-go/kubernetes/typed/authentication/v1"
	authorizationclient "k8s.io/client-go/kubernetes/typed/authorization/v1"

	kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
	"k8s.io/kubernetes/pkg/kubelet/server"
)

// BuildAuth creates an authenticator, an authorizer, and a matching authorizer attributes getter compatible with the kubelet's needs
func BuildAuth(nodeName types.NodeName, client clientset.Interface, config kubeletconfig.KubeletConfiguration) (server.AuthInterface, error) {
	// Get clients, if provided
	var (
		tokenClient authenticationclient.TokenReviewInterface
		sarClient   authorizationclient.SubjectAccessReviewInterface
	)
	if client != nil && !reflect.ValueOf(client).IsNil() {
		tokenClient = client.AuthenticationV1().TokenReviews()
		sarClient = client.AuthorizationV1().SubjectAccessReviews()
	}

	authenticator, err := BuildAuthn(tokenClient, config.Authentication)
	if err != nil {
		return nil, err
	}

	attributes := server.NewNodeAuthorizerAttributesGetter(nodeName)

	authorizer, err := BuildAuthz(sarClient, config.Authorization)
	if err != nil {
		return nil, err
	}

	return server.NewKubeletAuth(authenticator, attributes, authorizer), nil
}

// BuildAuthn creates an authenticator compatible with the kubelet's needs
func BuildAuthn(client authenticationclient.TokenReviewInterface, authn kubeletconfig.KubeletAuthentication) (authenticator.Request, error) {
	var clientCertificateCAContentProvider authenticatorfactory.CAContentProvider
	var err error
	if len(authn.X509.ClientCAFile) > 0 {
		clientCertificateCAContentProvider, err = dynamiccertificates.NewDynamicCAContentFromFile("client-ca-bundle", authn.X509.ClientCAFile)
		if err != nil {
			return nil, err
		}
	}

	authenticatorConfig := authenticatorfactory.DelegatingAuthenticatorConfig{
		Anonymous:                          authn.Anonymous.Enabled,
		CacheTTL:                           authn.Webhook.CacheTTL.Duration,
		ClientCertificateCAContentProvider: clientCertificateCAContentProvider,
	}

	if authn.Webhook.Enabled {
		if client == nil {
			return nil, errors.New("no client provided, cannot use webhook authentication")
		}
		authenticatorConfig.TokenAccessReviewClient = client
	}

	authenticator, _, err := authenticatorConfig.New()
	return authenticator, err
}

// BuildAuthz creates an authorizer compatible with the kubelet's needs
func BuildAuthz(client authorizationclient.SubjectAccessReviewInterface, authz kubeletconfig.KubeletAuthorization) (authorizer.Authorizer, error) {
	switch authz.Mode {
	case kubeletconfig.KubeletAuthorizationModeAlwaysAllow:
		return authorizerfactory.NewAlwaysAllowAuthorizer(), nil

	case kubeletconfig.KubeletAuthorizationModeWebhook:
		if client == nil {
			return nil, errors.New("no client provided, cannot use webhook authorization")
		}
		authorizerConfig := authorizerfactory.DelegatingAuthorizerConfig{
			SubjectAccessReviewClient: client,
			AllowCacheTTL:             authz.Webhook.CacheAuthorizedTTL.Duration,
			DenyCacheTTL:              authz.Webhook.CacheUnauthorizedTTL.Duration,
		}
		return authorizerConfig.New()

	case "":
		return nil, fmt.Errorf("no authorization mode specified")

	default:
		return nil, fmt.Errorf("unknown authorization mode %s", authz.Mode)

	}
}


text:
{% extends "base.html" %}
{% load dajaxice_templatetags %}
{% load staticfiles %}

{% block headerscripts %}
    {% dajaxice_js_import %}

{% endblock %}

{% block content %}
    {% include 'includes/searchbar_snippet.html' %}
    <input type="hidden" id="search_request" value="{{ search_param }}">

TODO: HELP TEXT HERE!

Loading Data...

Heroes

Players

{% endblock %}

{% block scripts %}

{% endblock %}


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="@dimen/widget_margin"
    android:background="@android:color/transparent">

    <LinearLayout
        android:id="@+id/ll_widget_container"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/appwidget_dark_bg_clickable"
        android:clickable="true"
        android:paddingLeft="4dp"
        android:paddingRight="4dp">

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="22dp"
            android:gravity="center_vertical">

            <TextView
                android:id="@+id/application_name"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center_vertical"
                style="@style/ApplicationTitleText"
                android:text="@string/app_name"/>

            <TextView
                android:id="@+id/syncDateTextView"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center_vertical|right"
                android:paddingRight="8dp"
                android:layout_weight="1"
                style="@style/DateUpdateText"
                android:textColor="@color/DarkGray" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:background="@color/White">
        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="4dp">

            <TextView
                android:id="@+id/surnameTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingRight="16dp"
                style="@style/NameSurnamePatronymicText" />

            <TextView
                android:id="@+id/nameTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingRight="8dp"
                style="@style/NameSurnamePatronymicText" />

            <TextView
                android:id="@+id/patronymicTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingRight="8dp"
                style="@style/NameSurnamePatronymicText" />

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <TextView
                    android:id="@+id/seriesTextView"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:paddingRight="8dp"
                    style="@style/SeriesNumberText"
                    android:gravity="center_vertical" />

                <TextView
                    android:id="@+id/numberTextView"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    style="@style/SeriesNumberText"
                    android:gravity="center_vertical" />

            </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <TextView
                android:id="@+id/resultTextView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                style="@style/ResultText" />

        </LinearLayout>

    </LinearLayout>

</FrameLayout>


text:
using Advobot.Attributes;
using Advobot.Utilities;

using Discord.Commands;

using ImageMagick;

namespace Advobot.TypeReaders;

/// <summary>
/// Attempts to parse a percentage from a string.
/// </summary>
[TypeReaderTargetType(typeof(Percentage))]
public sealed class PercentageTypeReader : TypeReader
{
	/// <summary>
	/// Creates a percentage from a string.
	/// </summary>
	/// <param name="context"></param>
	/// <param name="input"></param>
	/// <param name="services"></param>
	/// <returns></returns>
	public override Task<TypeReaderResult> ReadAsync(
		ICommandContext context,
		string input,
		IServiceProvider services)
	{
		if (double.TryParse(input, out var value))
		{
			return TypeReaderResult.FromSuccess(new Percentage(value)).AsTask();
		}
		return TypeReaderUtils.ParseFailedResult<Percentage>().AsTask();
	}
}


text:
package com.google.jam.solvers;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;
import java.util.function.Supplier;

import com.google.jam.Round;

import static java.util.concurrent.Executors.newFixedThreadPool;

public class MultiThreadRoundResolver
        implements RoundResolver {

    private final ExecutorService executor;
    private final Lock lock;
    private final AtomicInteger taskCounter;

    public MultiThreadRoundResolver(final Supplier<Integer> numberOfThreadSupplier) {
        this.executor = newFixedThreadPool(numberOfThreadSupplier.get());
        this.lock = new ReentrantLock();
        this.taskCounter = new AtomicInteger();
    }

    @Override
    public void shutDownResolver() {
        executor.shutdown();
    }

    @Override
    public Map<Integer, String> solve(final Round round, final Function<String, String> algorithm) {
        resetCounters();
        final Map<Integer, String> results = buildCollectionOfResults(round);
        submitAllTasks(round, algorithm, results);
        waitForCompletion(results, round.numberOfTasks());
        final int resultsSize = results.size();
        final int roundNumberOfTasks = round.numberOfTasks();
        assert resultsSize == roundNumberOfTasks
                : "Results should have size " + roundNumberOfTasks + " but is " + resultsSize;
        return results;
    }

    private void resetCounters() {
        taskCounter.set(0);
    }

    private Map<Integer, String> buildCollectionOfResults(final Round round) {
        return new ConcurrentHashMap<>(round.numberOfTasks(), 1.0f);
    }

    private void submitAllTasks(
            final Round round,
            final Function<String, String> algorithm,
            final Map<Integer, String> results) {
        Callable<Void> callable = buildTask(round, algorithm, results);
        Collection<Callable<Void>> callableCollection = Collections.nCopies(round.numberOfTasks(), callable);
        try {
            executor.invokeAll(callableCollection);
        }
        catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }

    private Callable<Void> buildTask(
            final Round round,
            final Function<String, String> algorithm,
            final Map<Integer, String> results) {
        return () -> {
            String task;
            int index;
            lock.lock();
            try {
                task = round.getNextTask();
                index = taskCounter.incrementAndGet();
            }
            finally {
                lock.unlock();
            }
            final String result = algorithm.apply(task);
            results.put(index, result);
            return null;
        };
    }

    private void waitForCompletion(final Map<Integer, String> results, final int numberOfTasks) {
        while (results.size() < numberOfTasks) {
        }
    }
}


text: features["DOM.Element.prepend"] = !!(document.documentElement.prepend);


text:
create database jusoft_shop\g
GRANT ALL PRIVILEGES ON jusoft_shop.* TO jusoft_shop@localhost IDENTIFIED BY 'test'\g


text:
<?php

declare(strict_types=1);

namespace BinSoul\Common\I18n;

/**
 * Provides a default implementation of the {@see StoredMessage} interface.
 */
class DefaultStoredMessage implements StoredMessage
{
    /**
     * @var Message
     */
    private $message;

    /**
     * @var string
     */
    private $format;

    /**
     * Constructs an instance of this class.
     */
    public function __construct(Message $message, string $format)
    {
        $this->message = $message;
        $this->format = $format;
    }

    public function __toString(): string
    {
        return $this->format;
    }

    public function getKey(): string
    {
        return $this->message->getKey();
    }

    public function getDomain(): ?string
    {
        return $this->message->getDomain();
    }

    public function withDomain(?string $domain): Message
    {
        return new self($this->message->withDomain($domain), $this->format);
    }

    public function getFormat(): string
    {
        return $this->format;
    }
}


text:
ENV["RAILS_ENV"] = "development"
ENV["MONGOID_ENV"] = "development"

require "rubygems"
require "serialize_with"
require "active_record"
require "mongoid"
require "mongoid/serialize_with"

Mongoid.load!("#{Dir.pwd}/spec/mongoid.yml")

ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
ActiveRecord::Migration.verbose = false
ActiveRecord::Base.include_root_in_json = false

migration = Class.new(ActiveRecord::Migration) do
  def change
    create_table :customers, :force => true do |t|
      t.string :first_name
      t.string :last_name
      t.string :address
    end
    create_table :products, :force => true do |t|
      t.string :name
      t.string :sku
      t.string :manufacturer
      t.decimal :price
    end
    create_table :orders, :force => true do |t|
      t.integer :customer_id
      t.decimal :order_total
    end
    create_table :order_items, :force => true do |t|
      t.integer :order_id
      t.string :product_sku
      t.integer :quantity
      t.integer :product_id
      t.decimal :price
    end
  end
end

migration.new.migrate(:up)

ActiveSupport.on_load(:active_record) do
  self.extend SerializeWith
end

RSpec.configure do |config|
  config.mock_with :rspec
end


text:
// More info on Webpack's Node API here: https://webpack.github.io/docs/node.js-api.html
// Allowing console calls below since this is a build file.
/* eslint-disable no-console */
var webpack = require('webpack');
var config = require('../webpack/webpack.config');

const branchName = process.env.npm_package_config_build_branch; // ok if this is undefined
process.env.NODE_ENV = 'production'; // this assures React is built in prod mode and that the Babel dev config doesn't apply.

console.log('Generating minified bundle for production via Webpack. This will take a moment...');

webpack(config).run(function (error, stats) {
  console.log('anything?');
  if (error) {
    // so a fatal error occurred. Stop here.
    console.log(error);
    return 1;
  }

  const jsonStats = stats.toJson();
  if (jsonStats.errors.length) {
    return jsonStats.errors.map((error) => console.log(error));
  }

  // // uncomment if you want warnings, but there are a LOT
  // if (jsonStats.warnings.length) {
  //   console.log(chalkWarning('Webpack generated the following warnings: '));
  //   jsonStats.warnings.map(warning => console.log(chalkWarning(warning)));
  // }

  // console.log(`Webpack stats: ${stats}`);

  // if we got this far, the build succeeded.
  console.log("Your app is compiled in production mode in /dist. It's ready to roll!");

  return 0;
});


text:
function Get-DbaSqlManagementObject {
    <#
        .SYNOPSIS
            Gets SQL Mangaement Object versions installed on the machine.

        .DESCRIPTION
            The Get-DbaSqlManagementObject returns an object with the Version and the
            Add-Type Load Template for each version on the server.

        .PARAMETER ComputerName
            The name of the target you would like to check

        .PARAMETER Credential
            This command uses Windows credentials. This parameter allows you to connect remotely as a different user.

        .PARAMETER VersionNumber
            This is the specific version number you are looking for. The function will look
            for that version only.

        .PARAMETER EnableException
            By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
            This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
            Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

        .NOTES
            Tags: SMO
            Author: Ben Miller (@DBAduck - http://dbaduck.com)

            Website: https://dbatools.io
            Copyright: (C) Chrissy LeMaire, clemaire@gmail.com
            License: MIT https://opensource.org/licenses/MIT

        .LINK
            https://dbatools.io/Get-DbaSqlManagementObject

        .EXAMPLE
            Get-DbaSqlManagementObject

            Returns all versions of SMO on the computer

        .EXAMPLE
            Get-DbaSqlManagementObject -VersionNumber 13

            Returns just the version specified. If the version does not exist then it will return nothing.

    #>
    [CmdletBinding()]
    param (
        [parameter(ValueFromPipeline)]
        [Alias("ServerInstance", "SqlServer", "SqlInstance")]
        [DbaInstanceParameter[]]$ComputerName = $env:COMPUTERNAME,
        [PSCredential]
        $Credential,
        [int]$VersionNumber,
        [Alias('Silent')]
        [switch]$EnableException
    )

    begin {
        if (!$VersionNumber) {
            $VersionNumber = 0
        }
        $scriptblock = {
            $VersionNumber = [int]$args[0]

            Write-Message -Level Verbose -Message "Checking currently loaded SMO version"
            $loadedversion = [AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.Fullname -like "Microsoft.SqlServer.SMO,*" }
            if ($loadedversion) {
                $loadedversion = $loadedversion | ForEach-Object {
                    if ($_.Location -match "__") {
                        ((Split-Path (Split-Path $_.Location) -Leaf) -split "__")[0]
                    }
                    else {
                        ((Get-ChildItem -Path $_.Location).VersionInfo.ProductVersion)
                    }
                }
            }

            Write-Message -Level Verbose -Message "Looking for included smo library"
            $localversion = [version](Get-ChildItem -Path "$script:PSModuleRoot\bin\smo\Microsoft.SqlServer.Smo.dll").VersionInfo.ProductVersion

            foreach ($version in $localversion) {
                if ($VersionNumber -eq 0) {
                    Write-Message -Level Verbose -Message "Did not pass a version"
                    [PSCustomObject]@{
                        ComputerName = $env:COMPUTERNAME
                        Version      = $localversion
                        Loaded       = $loadedversion -contains $localversion
                        LoadTemplate = "Add-Type -Path $("$script:PSModuleRoot\bin\smo\Microsoft.SqlServer.Smo.dll")"
                    }
                }
                else {
                    Write-Message -Level Verbose -Message "Passed version $VersionNumber, looking for that specific version"
                    if ($localversion.ToString().StartsWith("$VersionNumber.")) {
                        Write-Message -Level Verbose -Message "Found the Version $VersionNumber"
                        [PSCustomObject]@{
                            ComputerName = $env:COMPUTERNAME
                            Version      = $localversion
                            Loaded       = $loadedversion -contains $localversion
                            LoadTemplate = "Add-Type -Path $("$script:PSModuleRoot\bin\smo\Microsoft.SqlServer.Smo.dll")"
                        }
                    }
                }
            }

            Write-Message -Level Verbose -Message "Looking for SMO in the Global Assembly Cache"
            $smolist = (Get-ChildItem -Path "$env:SystemRoot\assembly\GAC_MSIL\Microsoft.SqlServer.Smo" | Sort-Object Name -Descending).Name

            foreach ($version in $smolist) {
                $array = $version.Split("__")
                if ($VersionNumber -eq 0) {
                    Write-Message -Level Verbose -Message "Did not pass a version, looking for all versions"
                    $currentversion = $array[0]
                    [PSCustomObject]@{
                        ComputerName = $env:COMPUTERNAME
                        Version      = $currentversion
                        Loaded       = $loadedversion -contains $currentversion
                        LoadTemplate = "Add-Type -AssemblyName `"Microsoft.SqlServer.Smo, Version=$($array[0]), Culture=neutral, PublicKeyToken=89845dcd8080cc91`""
                    }
                }
                else {
                    Write-Message -Level Verbose -Message "Passed version $VersionNumber, looking for that specific version"
                    if ($array[0].StartsWith("$VersionNumber.")) {
                        Write-Message -Level Verbose -Message "Found the Version $VersionNumber"
                        $currentversion = $array[0]
                        [PSCustomObject]@{
                            ComputerName = $env:COMPUTERNAME
                            Version      = $currentversion
                            Loaded       = $loadedversion -contains $currentversion
                            LoadTemplate = "Add-Type -AssemblyName `"Microsoft.SqlServer.Smo, Version=$($array[0]), Culture=neutral, PublicKeyToken=89845dcd8080cc91`""
                        }
                    }
                }
            }
        }
    }

    process {
        foreach ($computer in $ComputerName.ComputerName) {
            try {
                Invoke-Command2 -ComputerName $computer -ScriptBlock $scriptblock -Credential $Credential -ArgumentList $VersionNumber -ErrorAction Stop
            }
            catch {
                Stop-Function -Continue -Message "Failure" -ErrorRecord $_ -Target $ComputerName
            }
        }
    }
}