text:
package com.google.api.ads.dfp.jaxws.v201306;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             Creates a new {@code CreativeWrapper}.
 *
 *             The following fields are required:
 *

 *
{@link CreativeWrapper#labelId}

 *
{@link CreativeWrapper#ordering}

 *
{@link CreativeWrapper#header} or {@link CreativeWrapper#footer}

 *

 *
 *             @param creativeWrapper the creative wrapper to create
 *             @return the creative wrapper with its ID filled in
 *             @throws ApiException
 *
 *
 *
Java class for createCreativeWrapper element declaration.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <element name="createCreativeWrapper">
 *   <complexType>
 *     <complexContent>
 *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *         <sequence>
 *           <element name="creativeWrapper" type="{https://www.google.com/apis/ads/publisher/v201306}CreativeWrapper" minOccurs="0"/>
 *         </sequence>
 *       </restriction>
 *     </complexContent>
 *   </complexType>
 * </element>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "creativeWrapper"
})
@XmlRootElement(name = "createCreativeWrapper")
public class CreativeWrapperServiceInterfacecreateCreativeWrapper {

    protected CreativeWrapper creativeWrapper;

    /**
     * Gets the value of the creativeWrapper property.
     *
     * @return
     *     possible object is
     *     {@link CreativeWrapper }
     *
     */
    public CreativeWrapper getCreativeWrapper() {
        return creativeWrapper;
    }

    /**
     * Sets the value of the creativeWrapper property.
     *
     * @param value
     *     allowed object is
     *     {@link CreativeWrapper }
     *
     */
    public void setCreativeWrapper(CreativeWrapper value) {
        this.creativeWrapper = value;
    }

}


text:
//
//  AppManager.m
//  WildcatConnectGITTest
//
//  Created by Kevin Lyons on 8/13/15.
//  Copyright (c) 2015 WildcatConnect. All rights reserved.
//

#import "AppManager.h"
#import <Parse/Parse.h>
#import "NewsArticleStructure.h"
#import "StaffMemberStructure.h"

@implementation AppManager

/*@synthesize newsArticles;
@synthesize newsArticleImages;
@synthesize likedNewsArticles;
@synthesize staffMembers;*/

static AppManager *instance = nil;

+ (AppManager *)getInstance {
     @synchronized(self) {
          if (instance == nil) {
               instance = [AppManager new];
          }
     }
     return instance;
}

- (UIImage *)imageFromImage:(UIImage *)sourceImage scaledToWidth:(float)imageWidth {
     float oldWidth = sourceImage.size.width;
     float scaleFactor = imageWidth / oldWidth;
     float newHeight = sourceImage.size.height * scaleFactor;
     float newWidth = oldWidth * scaleFactor;
     UIGraphicsBeginImageContext(CGSizeMake(newWidth, newHeight));
     [sourceImage drawInRect:CGRectMake(0, 0, newWidth, newHeight)];
     UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
     return newImage;
}

- (UIImage *)imageFromImage:(UIImage *)sourceImage scaledToHeight:(float)imageHeight {
     float oldHeight = sourceImage.size.height;
     float scaleFactor = imageHeight / oldHeight;
     float newWidth = sourceImage.size.width * scaleFactor;
     float newHeight = oldHeight * scaleFactor;
     UIGraphicsBeginImageContext(CGSizeMake(newWidth, newHeight));
     [sourceImage drawInRect:CGRectMake(0, 0, newWidth, newHeight)];
     UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
     return newImage;
}

- (void)loadUserDefaults {
     likedNewsArticles = [[NSUserDefaults standardUserDefaults] valueForKey:@"likedNewsArticles"];\
}

- (void)saveUserDefaults {
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
     NSArray *likedNewsArticlesArray = [NSArray arrayWithArray:likedNewsArticles];
     [userDefaults setObject:likedNewsArticlesArray forKey:@"likedNewsArticles"];
     [userDefaults synchronize];
}

- (void)loadAllData:(NSObject *)object forViewController:(UIViewController *)viewController {
     [self loadUserDefaults];
     dispatch_async(dispatch_get_main_queue(), ^(void) {
          [(UIActivityIndicatorView *)object stopAnimating];
          [viewController performSegueWithIdentifier:@"showApplicationSegue" sender:viewController];
     });
}

- (void)loadNewsArticles:(NSObject *)object forViewController:(UIViewController *)viewController {
     newsArticleImages = [[NSMutableArray alloc] init];
     newsArticles = [[NSMutableArray alloc] init];
     PFQuery *query = [NewsArticleStructure query];
     [query orderByAscending:@"createdAt"];
     query.limit = 10;
     [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
          if (! error) {
               self.newsArticles = (NSMutableArray *)objects;
               NewsArticleStructure *newsArticleStructure;
               for (int i = 0; i < newsArticles.count; i++) {
                    newsArticleStructure = (NewsArticleStructure *)[newsArticles objectAtIndex:i];
                    PFFile *file = newsArticleStructure.imageFile;
                    [file getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
                         if (! error) {
                              UIImage *image = [UIImage imageWithData:data];
                              image = [self imageFromImage:image scaledToWidth:70];
                              [self.newsArticleImages addObject:image];
                         }
                    }];
               }
               dispatch_async(dispatch_get_main_queue(), ^(void) {
                    [(UIActivityIndicatorView *)object stopAnimating];
                    [viewController performSegueWithIdentifier:@"showApplicationSegue" sender:viewController];
               });
          }
     }];
}

- (void)loadStaffDirectory {
     staffMembers = [[NSMutableArray alloc] init];
     PFQuery *query = [StaffMemberStructure query];
     [query orderByDescending:@"staffMemberLastName"];
     [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
          if (! error) {
               self.staffMembers = (NSMutableArray *)objects;
               instance = self;
               dispatch_async(dispatch_get_main_queue(), ^(void) {
                         //
               });
          }
     }];
}

- (NSMutableArray *)getStaffMembers {
     return self.staffMembers;
}

@end

redpajama_set_name: RedPajamaGithub


text:
from __future__ import absolute_import, division, print_function

import numpy as np

from ..core.client import Client
from ..core import message as msg
from ..core.data import Data, CategoricalComponent
from ..core.subset import RangeSubsetState, CategoricalRoiSubsetState
from ..core.exceptions import IncompatibleDataException, IncompatibleAttribute
from ..core.edit_subset_mode import EditSubsetMode
from .layer_artist import HistogramLayerArtist, LayerArtistContainer
from .util import update_ticks, visible_limits
from ..core.callback_property import CallbackProperty, add_callback
from ..utils import lookup_class

class UpdateProperty(CallbackProperty):

    """Descriptor that calls client's sync_all() method when changed"""

    def __init__(self, default, relim=False):
        super(UpdateProperty, self).__init__(default)
        self.relim = relim

    def __set__(self, instance, value):
        changed = value != self.__get__(instance)
        super(UpdateProperty, self).__set__(instance, value)
        if not changed:
            return
        instance.sync_all()
        if self.relim:
            instance._relim()

def update_on_true(func):
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        if result:
            args[0].sync_all()
        return result
    return wrapper

class HistogramClient(Client):

    """
    A client class to display histograms
    """
    normed = UpdateProperty(False)
    cumulative = UpdateProperty(False)
    autoscale = UpdateProperty(True)
    nbins = UpdateProperty(30)
    xlog = UpdateProperty(False, relim=True)
    ylog = UpdateProperty(False)

    def __init__(self, data, figure, artist_container=None):
        super(HistogramClient, self).__init__(data)

        self._artists = artist_container or LayerArtistContainer()
        self._axes = figure.add_subplot(111)
        self._component = None
        self._saved_nbins = None
        self._xlim = {}

        try:
            self._axes.figure.set_tight_layout(True)
        except AttributeError:  # pragma: nocover (matplotlib < 1.1)
            pass

    @property
    def bins(self):
        """ An array of bin edges for the histogram.

        Returns None if no histogram has been computed yet.
        """
        for art in self._artists:
            if not isinstance(art, HistogramLayerArtist):
                continue
            return art.x

    @property
    def axes(self):
        return self._axes

    @property
    def xlimits(self):
        try:
            return self._xlim[self.component]
        except KeyError:
            pass

        lo, hi = self._default_limits()
        self._xlim[self.component] = lo, hi
        return lo, hi

    def _default_limits(self):
        if self.component is None:
            return 0, 1
        lo, hi = np.inf, -np.inf
        for a in self._artists:
            try:
                data = a.layer[self.component]
            except IncompatibleAttribute:
                continue

            if data.size == 0:
                continue
            lo = min(lo, np.nanmin(data))
            hi = max(hi, np.nanmax(data))
        return lo, hi

    @xlimits.setter
    @update_on_true
    def xlimits(self, value):
        lo, hi = value
        old = self.xlimits
        if lo is None:
            lo = old[0]
        if hi is None:
            hi = old[1]

        self._xlim[self.component] = min(lo, hi), max(lo, hi)
        self._relim()
        return True

    def layer_present(self, layer):
        return layer in self._artists

    def add_layer(self, layer):
        if layer.data not in self.data:
            raise IncompatibleDataException("Layer not in data collection")

        self._ensure_layer_data_present(layer)
        if self.layer_present(layer):
            return self._artists[layer][0]

        art = HistogramLayerArtist(layer, self._axes)
        self._artists.append(art)

        self._ensure_subsets_present(layer)
        self._sync_layer(layer)
        self._redraw()
        return art

    def _redraw(self):
        self._axes.figure.canvas.draw()

    def _ensure_layer_data_present(self, layer):
        if layer.data is layer:
            return
        if not self.layer_present(layer.data):
            self.add_layer(layer.data)

    def _ensure_subsets_present(self, layer):
        for subset in layer.data.subsets:
            self.add_layer(subset)

    @update_on_true
    def remove_layer(self, layer):
        if not self.layer_present(layer):
            return

        for a in self._artists.pop(layer):
            a.clear()

        if isinstance(layer, Data):
            for subset in layer.subsets:
                self.remove_layer(subset)

        return True

    @update_on_true
    def set_layer_visible(self, layer, state):
        if not self.layer_present(layer):
            return
        for a in self._artists[layer]:
            a.visible = state
        return True

    def is_layer_visible(self, layer):
        if not self.layer_present(layer):
            return False
        return any(a.visible for a in self._artists[layer])

    def _update_axis_labels(self):
        xlabel = self.component.label if self.component is not None else ''
        if self.xlog:
            xlabel = "Log %s" % xlabel
        ylabel = 'N'
        self._axes.set_xlabel(xlabel)
        self._axes.set_ylabel(ylabel)
        components = list(self._get_data_components('x'))
        if components:
            bins = update_ticks(self.axes, 'x',
                                components, False)

            return
            if bins is not None:
                prev_bins = self.nbins
                auto_bins = self._auto_nbin(calculate_only=True)
                if prev_bins == auto_bins:
                    # try to assign a bin to each category,
                    # but only if self.nbins hasn't been overridden
                    # from auto_nbin
                    self.nbins = min(bins, 100)
                    self.xlimits = (-0.5, bins - 0.5)

    def _get_data_components(self, coord):
        """ Returns the components for each dataset for x and y axes.
        """
        if coord == 'x':
            attribute = self.component
        else:
            raise TypeError('coord must be x')

        for data in self._data:
            try:
                yield data.get_component(attribute)
            except IncompatibleAttribute:
                pass

    def _auto_nbin(self, calculate_only=False):
        data = set(a.layer.data for a in self._artists)
        if len(data) == 0:
            return
        dx = np.mean([d.size for d in data])
        val = min(max(5, (dx / 1000) ** (1. / 3.) * 30), 100)

        c = list(self._get_data_components('x'))
        if c:
            c = c[0]
            if isinstance(c, CategoricalComponent):
                val = min(c._categories.size, 100)
                if not calculate_only:
                    self.xlimits = (-0.5, c._categories.size - 0.5)

        if not calculate_only:
            self.nbins = val
        return val

    def _sync_layer(self, layer, force=False):
        for a in self._artists[layer]:
            a.lo, a.hi = self.xlimits
            a.nbins = self.nbins
            a.xlog = self.xlog
            a.ylog = self.ylog
            a.cumulative = self.cumulative
            a.normed = self.normed
            a.att = self._component
            a.update() if not force else a.force_update()

    def sync_all(self, force=False):
        layers = set(a.layer for a in self._artists)
        for l in layers:
            self._sync_layer(l, force=force)

        self._update_axis_labels()

        if self.autoscale:
            lim = visible_limits(self._artists, 1)
            if lim is not None:
                lo = 1e-5 if self.ylog else 0
                hi = lim[1]
                # pad the top
                if self.ylog:
                    hi = lo * (hi / lo) ** 1.03
                else:
                    hi *= 1.03
                self._axes.set_ylim(lo, hi)

        yscl = 'log' if self.ylog else 'linear'
        self._axes.set_yscale(yscl)

        self._redraw()

    @property
    def component(self):
        return self._component

    @component.setter
    def component(self, value):
        self.set_component(value)

    def set_component(self, component):
        """
        Redefine which component gets plotted

        Parameters
        ----------
        component: ComponentID
            The new component to plot
        """
        if self._component is component:
            return

        iscat = lambda x: isinstance(x, CategoricalComponent)

        def comp_obj():
            # the current Component (not ComponentID) object
            x = list(self._get_data_components('x'))
            if x:
                x = x[0]
            return x

        prev = comp_obj()
        old = self.nbins

        first_add = self._component is None
        self._component = component
        cur = comp_obj()

        if first_add or iscat(cur):
            self._auto_nbin()

        # save old bins if switch from non-category to category
        if prev and not iscat(prev) and iscat(cur):
            self._saved_nbins = old

        # restore old bins if switch from category to non-category
        if iscat(prev) and cur and not iscat(cur) and self._saved_nbins is not None:
            self.nbins = self._saved_nbins
            self._saved_nbins = None

        self.sync_all()
        self._relim()

    def _relim(self):
        lim = self.xlimits
        if self.xlog:
            lim = list(np.log10(lim))
            if not np.isfinite(lim[0]):
                lim[0] = 1e-5
            if not np.isfinite(lim[1]):
                lim[1] = 1

        self._axes.set_xlim(lim)
        self._redraw()

    def _numerical_data_changed(self, message):
        data = message.sender
        self.sync_all(force=True)

    def _on_component_replaced(self, msg):
        if self.component is msg.old:
            self.set_component(msg.new)

    def _update_data(self, message):
        self.sync_all()

    def _update_subset(self, message):
        self._sync_layer(message.subset)
        self._redraw()

    def _add_subset(self, message):
        self.add_layer(message.sender)
        assert self.layer_present(message.sender)
        assert self.is_layer_visible(message.sender)

    def _remove_data(self, message):
        self.remove_layer(message.data)

    def _remove_subset(self, message):
        self.remove_layer(message.subset)

    def apply_roi(self, roi):
        x, _ = roi.to_polygon()
        lo = min(x)
        hi = max(x)

        # expand roi to match bin edges
        bins = self.bins

        if lo >= bins.min():
            lo = bins[bins <= lo].max()
        if hi <= bins.max():
            hi = bins[bins >= hi].min()

        if self.xlog:
            lo = 10 ** lo
            hi = 10 ** hi

        comp = list(self._get_data_components('x'))
        if comp:
            comp = comp[0]
            if comp.categorical:
                state = CategoricalRoiSubsetState.from_range(comp, self.component,
                                                             lo, hi)
            else:
                state = RangeSubsetState(lo, hi)
                state.att = self.component
            mode = EditSubsetMode()
            visible = [d for d in self.data if self.is_layer_visible(d)]
            focus = visible[0] if len(visible) > 0 else None
            mode.update(self.data, state, focus_data=focus)

    def register_to_hub(self, hub):
        dfilter = lambda x: x.sender.data in self._artists
        dcfilter = lambda x: x.data in self._artists
        subfilter = lambda x: x.subset in self._artists

        hub.subscribe(self,
                      msg.SubsetCreateMessage,
                      handler=self._add_subset,
                      filter=dfilter)
        hub.subscribe(self,
                      msg.SubsetUpdateMessage,
                      handler=self._update_subset,
                      filter=subfilter)
        hub.subscribe(self,
                      msg.SubsetDeleteMessage,
                      handler=self._remove_subset)
        hub.subscribe(self,
                      msg.DataUpdateMessage,
                      handler=self._update_data,
                      filter=dfilter)
        hub.subscribe(self,
                      msg.DataCollectionDeleteMessage,
                      handler=self._remove_data)
        hub.subscribe(self,
                      msg.NumericalDataChangedMessage,
                      handler=self._numerical_data_changed)
        hub.subscribe(self,
                      msg.ComponentReplacedMessage,
                      handler=self._on_component_replaced)

    def restore_layers(self, layers, context):
        for layer in layers:
            lcls = lookup_class(layer.pop('_type'))
            if lcls != HistogramLayerArtist:
                raise ValueError("Cannot restore layers of type %s" % lcls)
            data_or_subset = context.object(layer.pop('layer'))
            result = self.add_layer(data_or_subset)
            result.properties = layer


text:
//
//  AppDelegate.m
//  YWPushFactoryDemo
//
//  Created by yw on 2017/2/27.
//  Copyright © 2017年 yw. All rights reserved.
//

#import "AppDelegate.h"
#import "FactoryManager.h"

@interface AppDelegate ()<FactoryManagerDelegate>

/** */
@property (nonatomic, copy) id<PushProtocol>factory;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    FactoryManager *manager = [FactoryManager new];

    manager.delegate = self;

    //    需要极光推送,把此注释打开,然后把友盟推送的代码注释掉,其余均不用操作
    //    _factory = [manager getJPushFactory:launchOptions];

    //    友盟推送
    _factory = [manager getUMessageFactory:launchOptions];

    return YES;
}
/**
 iOS 10以上的收到远程推送通知的回调方法

 @param code 1-仅仅代表在前台收到信息,还没有开始点击消息*----*0-代表开始点击消息,不管app是运行在前台还是后台
 @param userInfo 通知内容
 */
- (void)didRemoteNotificationAppStatues:(NSInteger)code withUserInfo:(NSDictionary *)userInfo{

    if (code == 0) {

        NSLog(@"要开始点击推送消息了:%@", userInfo);

    }else if (code == 1){

        NSLog(@"刚收到推送消息了,还未开始点击:%@", userInfo);

    }

}
/**
 iOS 10以上的收到本地推送通知的回调方法

 @param code code 1-仅仅代表在前台收到信息,还没有开始点击消息*----*0-代表开始点击消息,不管app是运行在前台还是后台
 @param userInfo 通知内容
 */
- (void)didLocalNotificationAppStatues:(NSInteger)code withUserInfo:(NSDictionary *)userInfo{

    if (code == 0) {

        NSLog(@"要开始点击推送消息了:%@", userInfo);

    }else if (code == 1){

        NSLog(@"刚收到推送消息了,还未开始点击:%@", userInfo);

    }

}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {

    [_factory handleRemoteNotification:userInfo];

    NSLog(@"iOS6及以下系统,收到通知:%@", userInfo);

}

- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:
(void (^)(UIBackgroundFetchResult))completionHandler {

    [_factory handleRemoteNotification:userInfo];

    NSLog(@"iOS6及以下系统,收到通知:%@", userInfo);

}

- (void)applicationDidEnterBackground:(UIApplication *)application {

    //    清除角标
    [_factory setApplicationBadgeNumber:application];

}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    //    清除角标
    [_factory setApplicationBadgeNumber:application];

}

- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    //    注册deviceToken
    [_factory registerDeviceToken:deviceToken];

}

@end


text:
using System;
using PA.TileList;
using PA.TileList.Geometrics;
using NUnit.Framework;

namespace PA.TileList
{
    [TestFixtureAttribute]
    public class AreaTests
    {
        [Test]
        public void CreateArea()
        {
            var a = new Area(-1, -1,10,10);
            var b = new Area(new Coordinate(-1, -1),  new Coordinate(10,10));

            Assert.AreEqual(a.SizeX , b.SizeX);
            Assert.AreEqual(a.SizeY , b.SizeY);

        }

    }
}


text:
::This script is used to accomplish a android automated compiler.
::You should make sure have accomplished the environment setting.
::You should add %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools to the environment variable of Path.

::Copy monkeyrunner python script to android sdk tools directory.
cd ..\..
copy %cd%\Monkeyrunner_TestCpp.py %ANDROID_HOME%\tools
copy %cd%\ReportManager.py %ANDROID_HOME%\tools

cd ..\..
set PROJECT_HOME=%cd%
cd samples\TestCpp\proj.android\bin

::Copy test apk to android sdk tools directory.
copy %cd%\TestCpp-release-14.apk %ANDROID_HOME%\tools
copy %cd%\TestCpp-release-15.apk %ANDROID_HOME%\tools

::Enter android sdk tools directory.
set ANDROID_ROOT=%ANDROID_HOME:~0,2%
%ANDROID_ROOT%
cd %ANDROID_HOME%\tools

::If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero.

::Running monkeyrunner test(release,API level:14).
ren TestCpp-release-14.apk TestCpp-release.apk
call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk
if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1
rm TestCpp-release.apk

::Running monkeyrunner test(release,API level:15).
ren TestCpp-release-15.apk TestCpp-release.apk
call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk
if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1
rm TestCpp-release.apk

rm Monkeyrunner_TestCpp.py
rm ReportManager.py

::Monkeyrunner success!
echo Monkeyrunner Test Success!

::Clean project files.
set PROJECT_ROOT=%PROJECT_HOME:~0,2%
%PROJECT_ROOT%
cd %PROJECT_HOME%

git checkout -f
git clean -df -x
exit 0

::End


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
          "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<part>
  <partinfo>
    <releaseinfo role="CVS">$Id: part.001.xml 8020 2008-05-30 16:28:36Z abdelazer $</releaseinfo>
  </partinfo>
  <title>Unit Test: part.001</title>
  <chapter>
    <title>Chapter</title>
    <para>Some test data
    <indexterm>
      <primary>First Part</primary>
    </indexterm></para>
    <para>Referencing <firstterm>gloss-1</firstterm>.</para>
    <sect1>
      <title>A sect1 in a chapter</title>
      <para>With a little text.</para>
    </sect1>
  </chapter>

  <glossary role="auto">
    <remark>make sure <glossterm>gloss-2</glossterm> is referenced</remark>
    <glossdiv>
      <title>foo</title>
      <glossentry><glossterm>irrelevant</glossterm>
      <glossdef><para/></glossdef>
      </glossentry>
    </glossdiv>
  </glossary>

  <bibliography>
    <bibliographyinfo>
      <author><firstname>Norman</firstname><surname>Walsh</surname>
      <affiliation><address><email>ndw@nwalsh.com</email></address></affiliation>
      </author>
    </bibliographyinfo>

    <bibliodiv>
      <title>Entries using biblioentry</title>

      <biblioentry>
	<abbrev>AhoSethiUllman96</abbrev>
	<authorgroup>
	  <author><firstname>Alfred V.</firstname><surname>Aho</surname></author>
	  <author><firstname>Ravi</firstname><surname>Sethi</surname></author>
	  <author><firstname>Jeffrey D.</firstname><surname>Ullman</surname></author>
	</authorgroup>
	<title>Compilers, Principles, Techniques, and Tools</title>
	<publisher>
	  <publishername>Addison-Wesley Publishing Company</publishername>
	</publisher>
	<copyright><year>1996</year>
	<holder>Bell Telephone Laboratories, Inc.</holder></copyright>
	<isbn>0-201-10088-6</isbn>
	<editor><firstname>James T.</firstname><surname>DeWolf</surname></editor>
      </biblioentry>

    </bibliodiv>
  </bibliography>
  <index/>
</part>


text:
FROM debian:jessie

MAINTAINER Jürgen Viljaste <j.viljaste@gmail.com>

LABEL vendor=dockerizedrupal.com

ENV TERM xterm

ADD ./src /src

RUN /src/entrypoint.sh build

ENTRYPOINT ["/src/entrypoint.sh", "run"]


text:
var assert = require("assert"),
    vows = require("vows"),
    qs = require("querystring"),
    querystring = require("./../lib/querystring");

vows.describe("querystring").addBatch({
    "A Parser": {
        "write": {
            topic: new querystring.Parser,
            "should return the length of the written buffer": function (parser) {
                var a = new Buffer("a=1");
                assert.equal(parser.write(a), a.length);
                var b = new Buffer("&b=2");
                assert.equal(parser.write(b), b.length);
                assert.equal(parser.body, a + b);
            }
        },
        'when parsing "a=1&a=2"': parserContext("a=1&a=2"),
        'when parsing "a=1&b=2%20&b=3"': parserContext("a=1&b=2%20&b=3")
    }
}).export(module);

function parserContext(query) {
    var context = {};

    context.topic = function () {
        var parser = new querystring.Parser,
            params = {},
            self = this;

        parser.onParam = function (name, value) {
            params[name] = value;
        };
        parser.onEnd = function () {
            self.callback(null, params);
        };

        parser.write(query);
        parser.end();
    };

    context["should parse correctly"] = function (params) {
        assert.deepEqual(params, qs.parse(query));
    };

    return context;
}


text:
'use strict';
const fs = require('fs');
const path = require('path');
const serveStatic = require('feathers').static;
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const bodyParser = require('body-parser');
const socketio = require('feathers-socketio');
const middleware = require('./middleware');
const services = require('./services');
const express = require('express');
//REMOVE FROM PRODUCTION
const webpack = require('webpack');
const config = require('../webpack.config.js');
//BLOCK END

const app = feathers();
const api = feathers();

//REMOVE FROM PRODUCTION

let compiler = webpack(config);
app.use(require('webpack-dev-middleware')(compiler, {
  publicPath: config.output.publicPath,
  historyApiFallback: true
}));
app.use(require('webpack-hot-middleware')(compiler));

//BLOCK END

app.configure(configuration(path.join(__dirname, '..')));

app.use(compress())
    .options('*', cors())
    .use(cors())
    .use(favicon( path.join(app.get('public'), 'favicon.ico') ))
    .get('/login*', (req, res) => {
        res.sendFile(path.resolve(app.get('public'), 'index.html'));
    })
    .get('/dashboard*', (req, res) => {
        res.sendFile(path.resolve(app.get('public'), 'index.html'));
    })
    .use('/', serveStatic( app.get('public') ));

// api config
api.configure(configuration(path.join(__dirname, '..')));

api.use(bodyParser.json())
.use(bodyParser.urlencoded({ extended: true }))
.configure(hooks())
.configure(rest())
.configure(socketio())
.configure(services)
.configure(middleware);

app.use('/api', api);

module.exports.app = app;
module.exports.services = api;


text:
package org.apache.shiro.util;

/**
 * Shiro container-agnostic interface that indicates that this object requires a callback during destruction.
 *
 * @since 0.2
 */
public interface Destroyable {

    /**
     * Called when this object is being destroyed, allowing any necessary cleanup of internal resources.
     *
     * @throws Exception if an exception occurs during object destruction.
     */
    void destroy() throws Exception;

}


text:
import { CliController } from 'cli-router';
import { promiseResolve } from 'azk/utils/promises';

export default class TestOptions extends CliController {
  index(params={}) {
    return promiseResolve([{ number: params.number }]);
  }
}


text:
package org.elasticsearch.action.admin.cluster.shards;

import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.routing.GroupShardsIterator;
import org.elasticsearch.cluster.routing.ShardIterator;
import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;

import java.util.Map;
import java.util.Set;

import static com.google.common.collect.Sets.newHashSet;

/**
 */
public class TransportClusterSearchShardsAction extends TransportMasterNodeReadAction<ClusterSearchShardsRequest, ClusterSearchShardsResponse> {

    @Inject
    public TransportClusterSearchShardsAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters) {
        super(settings, ClusterSearchShardsAction.NAME, transportService, clusterService, threadPool, actionFilters, ClusterSearchShardsRequest.class);
    }

    @Override
    protected String executor() {
        // all in memory work here...
        return ThreadPool.Names.SAME;
    }

    @Override
    protected ClusterBlockException checkBlock(ClusterSearchShardsRequest request, ClusterState state) {
        return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_READ, state.metaData().concreteIndices(request.indicesOptions(), request.indices()));
    }

    @Override
    protected ClusterSearchShardsResponse newResponse() {
        return new ClusterSearchShardsResponse();
    }

    @Override
    protected void masterOperation(final ClusterSearchShardsRequest request, final ClusterState state, final ActionListener<ClusterSearchShardsResponse> listener) {
        ClusterState clusterState = clusterService.state();
        String[] concreteIndices = clusterState.metaData().concreteIndices(request.indicesOptions(), request.indices());
        Map<String, Set<String>> routingMap = clusterState.metaData().resolveSearchRouting(request.routing(), request.indices());
        Set<String> nodeIds = newHashSet();
        GroupShardsIterator groupShardsIterator = clusterService.operationRouting().searchShards(clusterState, request.indices(), concreteIndices, routingMap, request.preference());
        ShardRouting shard;
        ClusterSearchShardsGroup[] groupResponses = new ClusterSearchShardsGroup[groupShardsIterator.size()];
        int currentGroup = 0;
        for (ShardIterator shardIt : groupShardsIterator) {
            String index = shardIt.shardId().getIndex();
            int shardId = shardIt.shardId().getId();
            ShardRouting[] shardRoutings = new ShardRouting[shardIt.size()];
            int currentShard = 0;
            shardIt.reset();
            while ((shard = shardIt.nextOrNull()) != null) {
                shardRoutings[currentShard++] = shard;
                nodeIds.add(shard.currentNodeId());
            }
            groupResponses[currentGroup++] = new ClusterSearchShardsGroup(index, shardId, shardRoutings);
        }
        DiscoveryNode[] nodes = new DiscoveryNode[nodeIds.size()];
        int currentNode = 0;
        for (String nodeId : nodeIds) {
            nodes[currentNode++] = clusterState.getNodes().get(nodeId);
        }
        listener.onResponse(new ClusterSearchShardsResponse(groupResponses, nodes));
    }
}


text:
package org.darkstorm.darkbot.minecraftbot.protocol.v78.packets;

import java.io.*;

import org.darkstorm.darkbot.minecraftbot.protocol.*;

public class Packet204ClientInfo extends AbstractPacket implements WriteablePacket {
	public String language;
	public int renderDistance;
	public int chatVisisble;
	public boolean chatColours;
	public int gameDifficulty;
	public boolean showCape;

	public Packet204ClientInfo() {
	}

	public Packet204ClientInfo(String par1Str, int par2, int par3, boolean par4, int par5, boolean par6) {
		language = par1Str;
		renderDistance = par2;
		chatVisisble = par3;
		chatColours = par4;
		gameDifficulty = par5;
		showCape = par6;
	}

	@Override
	public void writeData(DataOutputStream out) throws IOException {
		writeString(language, out);
		out.writeByte(renderDistance);
		out.writeByte(chatVisisble | (chatColours ? 1 : 0) << 3);
		out.writeByte(gameDifficulty);
		out.writeBoolean(showCape);
	}

	@Override
	public int getId() {
		return 204;
	}
}


text:
//=================================================================================================

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

#ifndef _BLAZE_MATH_SMP_OPENMP_DENSEVECTOR_H_
#define _BLAZE_MATH_SMP_OPENMP_DENSEVECTOR_H_

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <omp.h>
#include <blaze/math/DenseSubvector.h>
#include <blaze/math/expressions/DenseVector.h>
#include <blaze/math/expressions/SparseVector.h>
#include <blaze/math/Functions.h>
#include <blaze/math/intrinsics/IntrinsicTrait.h>
#include <blaze/math/smp/SerialSection.h>
#include <blaze/math/SparseSubvector.h>
#include <blaze/math/traits/SubvectorExprTrait.h>
#include <blaze/system/OpenMP.h>
#include <blaze/util/Assert.h>
#include <blaze/util/EnableIf.h>
#include <blaze/util/logging/FunctionTrace.h>
#include <blaze/util/StaticAssert.h>
#include <blaze/util/typetraits/IsSame.h>

namespace blaze {

//=================================================================================================
//
//  GLOBAL FUNCTIONS
//
//=================================================================================================

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Default implementation of the OpenMP-based SMP assignment of a vector to a dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side vector to be assigned.
// \return void
//
// This function implements the default OpenMP-based SMP assignment of a vector to a dense
// vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side vector
        , bool TF2 >    // Transpose flag of the right-hand side vector
inline void smpAssign( DenseVector<VT1_,TF1>& lhs, const Vector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
   assign( ~lhs, ~rhs );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP assignment of a dense vector to a dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side dense vector to be assigned.
// \return void
//
// This function implements the OpenMP-based SMP assignment of a dense vector to a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpAssign( DenseVector<VT1_,TF1>& lhs, const DenseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      assign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef IntrinsicTrait<typename VT1_::ElementType>         IT;
   typedef typename SubvectorExprTrait<VT1_,aligned>::Type    AlignedTarget;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

   const bool vectorizable( VT1_::vectorizable && VT2_::vectorizable && IsSame<ET1,ET2>::value );
   const bool lhsAligned  ( (~lhs).isAligned() );
   const bool rhsAligned  ( (~rhs).isAligned() );

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t equalShare   ( (~lhs).size() / threads + addon );
      const size_t rest         ( equalShare & ( IT::size - 1UL ) );
      const size_t sizePerThread( ( vectorizable && rest )?( equalShare - rest + IT::size ):( equalShare ) );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );

         if( vectorizable && lhsAligned && rhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            assign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && lhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            assign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && rhsAligned ) {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            assign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            assign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP assignment of a sparse vector to a dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side sparse vector to be assigned.
// \return void
//
// This function implements the OpenMP-based SMP assignment of a sparse vector to a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpAssign( DenseVector<VT1_,TF1>& lhs, const SparseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      assign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t sizePerThread( (~lhs).size() / threads + addon );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );
         UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
         assign( target, subvector<unaligned>( ~rhs, index, size ) );
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Default implementation of the OpenMP-based SMP addition assignment of a vector to a
//        dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side vector to be added.
// \return void
//
// This function implements the default OpenMP-based SMP addition assignment of a vector to
// a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side vector
        , bool TF2 >    // Transpose flag of the right-hand side vector
inline void smpAddAssign( DenseVector<VT1_,TF1>& lhs, const Vector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
   addAssign( ~lhs, ~rhs );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP addition assignment of a dense vector to a
//        dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side dense vector to be added.
// \return void
//
// This function implements the OpenMP-based SMP addition assignment of a dense vector to a
// dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpAddAssign( DenseVector<VT1_,TF1>& lhs, const DenseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      addAssign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef IntrinsicTrait<typename VT1_::ElementType>         IT;
   typedef typename SubvectorExprTrait<VT1_,aligned>::Type    AlignedTarget;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

   const bool vectorizable( VT1_::vectorizable && VT2_::vectorizable && IsSame<ET1,ET2>::value );
   const bool lhsAligned  ( (~lhs).isAligned() );
   const bool rhsAligned  ( (~rhs).isAligned() );

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t equalShare   ( (~lhs).size() / threads + addon );
      const size_t rest         ( equalShare & ( IT::size - 1UL ) );
      const size_t sizePerThread( ( vectorizable && rest )?( equalShare - rest + IT::size ):( equalShare ) );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );

         if( vectorizable && lhsAligned && rhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            addAssign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && lhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            addAssign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && rhsAligned ) {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            addAssign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            addAssign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP addition assignment of a sparse vector to a
//        dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side sparse vector to be added.
// \return void
//
// This function implements the OpenMP-based SMP addition assignment of a sparse vector to a
// dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpAddAssign( DenseVector<VT1_,TF1>& lhs, const SparseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      addAssign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t sizePerThread( (~lhs).size() / threads + addon );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );
         UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
         addAssign( target, subvector<unaligned>( ~rhs, index, size ) );
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Default implementation of the OpenMP-based SMP subtraction assignment of a vector to
//        a dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side vector to be subtracted.
// \return void
//
// This function implements the default OpenMP-based SMP subtraction assignment of a vector to
// a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side vector
        , bool TF2 >    // Transpose flag of the right-hand side vector
inline void smpSubAssign( DenseVector<VT1_,TF1>& lhs, const Vector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
   subAssign( ~lhs, ~rhs );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP subtraction assignment of a dense vector to a
//        dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side dense vector to be subtracted.
// \return void
//
// This function implements the OpenMP-based SMP subtraction assignment of a dense vector to
// a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpSubAssign( DenseVector<VT1_,TF1>& lhs, const DenseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      subAssign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef IntrinsicTrait<typename VT1_::ElementType>         IT;
   typedef typename SubvectorExprTrait<VT1_,aligned>::Type    AlignedTarget;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

   const bool vectorizable( VT1_::vectorizable && VT2_::vectorizable && IsSame<ET1,ET2>::value );
   const bool lhsAligned  ( (~lhs).isAligned() );
   const bool rhsAligned  ( (~rhs).isAligned() );

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t equalShare   ( (~lhs).size() / threads + addon );
      const size_t rest         ( equalShare & ( IT::size - 1UL ) );
      const size_t sizePerThread( ( vectorizable && rest )?( equalShare - rest + IT::size ):( equalShare ) );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );

         if( vectorizable && lhsAligned && rhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            subAssign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && lhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            subAssign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && rhsAligned ) {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            subAssign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            subAssign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP subtraction assignment of a sparse vector to a
//        dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side sparse vector to be subtracted.
// \return void
//
// This function implements the OpenMP-based SMP subtraction assignment of a sparse vector to
// a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpSubAssign( DenseVector<VT1_,TF1>& lhs, const SparseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      subAssign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t sizePerThread( (~lhs).size() / threads + addon );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );
         UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
         subAssign( target, subvector<unaligned>( ~rhs, index, size ) );
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Default implementation of the OpenMP-based SMP multiplication assignment of a vector
//        to a dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side vector to be multiplied.
// \return void
//
// This function implements the default OpenMP-based SMP multiplication assignment of a vector
// to a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side vector
        , bool TF2 >    // Transpose flag of the right-hand side vector
inline void smpMultAssign( DenseVector<VT1_,TF1>& lhs, const Vector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
   multAssign( ~lhs, ~rhs );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP multiplication assignment of a dense vector
//        to a dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side dense vector to be multiplied.
// \return void
//
// This function implements the OpenMP-based SMP multiplication assignment of a dense vector
// to a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpMultAssign( DenseVector<VT1_,TF1>& lhs, const DenseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      multAssign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef IntrinsicTrait<typename VT1_::ElementType>         IT;
   typedef typename SubvectorExprTrait<VT1_,aligned>::Type    AlignedTarget;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

   const bool vectorizable( VT1_::vectorizable && VT2_::vectorizable && IsSame<ET1,ET2>::value );
   const bool lhsAligned  ( (~lhs).isAligned() );
   const bool rhsAligned  ( (~rhs).isAligned() );

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t equalShare   ( (~lhs).size() / threads + addon );
      const size_t rest         ( equalShare & ( IT::size - 1UL ) );
      const size_t sizePerThread( ( vectorizable && rest )?( equalShare - rest + IT::size ):( equalShare ) );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );

         if( vectorizable && lhsAligned && rhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            multAssign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && lhsAligned ) {
            AlignedTarget target( subvector<aligned>( ~lhs, index, size ) );
            multAssign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
         else if( vectorizable && rhsAligned ) {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            multAssign( target, subvector<aligned>( ~rhs, index, size ) );
         }
         else {
            UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
            multAssign( target, subvector<unaligned>( ~rhs, index, size ) );
         }
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Implementation of the OpenMP-based SMP multiplication assignment of a sparse vector
//        to a dense vector.
// \ingroup smp
//
// \param lhs The target left-hand side dense vector.
// \param rhs The right-hand side sparse vector to be multiplied.
// \return void
//
// This function implements the OpenMP-based SMP multiplication assignment of a sparse vector
// to a dense vector.\n
// This function must \b NOT be called explicitly! It is used internally for the performance
// optimized evaluation of expression templates. Calling this function explicitly might result
// in erroneous results and/or in compilation errors. Instead of using this function use the
// assignment operator.
*/
template< typename VT1_  // Type of the left-hand side dense vector
        , bool TF1      // Transpose flag of the left-hand side dense vector
        , typename VT2_  // Type of the right-hand side dense vector
        , bool TF2 >    // Transpose flag of the right-hand side dense vector
typename EnableIfTrue< VT1_::smpAssignable && VT2_::smpAssignable >::Type
   smpMultAssign( DenseVector<VT1_,TF1>& lhs, const SparseVector<VT2_,TF2>& rhs )
{
   BLAZE_FUNCTION_TRACE;

   BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );

   if( isSerialSectionActive() || omp_get_num_threads() != 1 || !(~rhs).canSMPAssign() ) {
      multAssign( ~lhs, ~rhs );
      return;
   }

   typedef typename VT1_::ElementType                         ET1;
   typedef typename VT2_::ElementType                         ET2;
   typedef typename SubvectorExprTrait<VT1_,unaligned>::Type  UnalignedTarget;

#pragma omp parallel shared( lhs, rhs )
   {
      const int    threads      ( omp_get_num_threads() );
      const size_t addon        ( ( ( (~lhs).size() % threads ) != 0UL )? 1UL : 0UL );
      const size_t sizePerThread( (~lhs).size() / threads + addon );

#pragma omp for schedule(dynamic,1) nowait
      for( int i=0UL; i<threads; ++i )
      {
         const size_t index( i*sizePerThread );

         if( index >= (~lhs).size() )
            continue;

         const size_t size( min( sizePerThread, (~lhs).size() - index ) );
         UnalignedTarget target( subvector<unaligned>( ~lhs, index, size ) );
         multAssign( target, subvector<unaligned>( ~rhs, index, size ) );
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//=================================================================================================
//
//  COMPILE TIME CONSTRAINT
//
//=================================================================================================

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
namespace {

BLAZE_STATIC_ASSERT( BLAZE_OPENMP_PARALLEL_MODE > 0 );

}
/*! \endcond */
//*************************************************************************************************

} // namespace blaze

#endif


text:
<?php
namespace Aura\SqlSchema;

abstract class AbstractSchemaTest extends \PHPUnit_Framework_TestCase
{
    protected $extension;

    protected $pdo_type;

    protected $schema;

    protected $expect_fetch_table_list;

    protected $expect_fetch_table_cols;

    protected $expect_quote_name = '"one"."two"';

    public function setUp()
    {
        // skip if we don't have the extension
        if (! extension_loaded($this->extension)) {
            $this->markTestSkipped("Extension '{$this->extension}' not loaded.");
        }

        // convert column arrays to objects
        foreach ($this->expect_fetch_table_cols as $name => $info) {
            $this->expect_fetch_table_cols[$name] = new Column(
                $info['name'],
                $info['type'],
                $info['size'],
                $info['scale'],
                $info['notnull'],
                $info['default'],
                $info['autoinc'],
                $info['primary']
            );
        }

        // database setup
        $setup_class = 'Aura\SqlSchema\Setup\\' . ucfirst($this->pdo_type) . 'Setup';
        $this->setup = new $setup_class;

        // schema class same as this class, minus "Test"
        $class = substr(get_class($this), 0, -4);
        $this->schema = new $class(
            $this->setup->getPdo(),
            new ColumnFactory
        );
    }

    public function testGetColumnFactory()
    {
        $actual = $this->schema->getColumnFactory();
        $this->assertInstanceOf('\Aura\SqlSchema\ColumnFactory', $actual);
    }

    public function testFetchTableList()
    {
        $actual = $this->schema->fetchTableList();
        $this->assertEquals($this->expect_fetch_table_list, $actual);
    }

    public function testFetchTableList_schema()
    {
        $schema2 = $this->setup->getSchema2();
        $actual = $this->schema->fetchTableList($schema2);
        $this->assertEquals($this->expect_fetch_table_list_schema, $actual);
    }

    public function testFetchTableCols()
    {
        $table  = $this->setup->getTable();
        $actual = $this->schema->fetchTableCols($table);
        $expect = $this->expect_fetch_table_cols;
        ksort($actual);
        ksort($expect);
        $this->assertSame(count($expect), count($actual));
        foreach (array_keys($expect) as $name) {
            $this->assertEquals($expect[$name], $actual[$name]);
        }
    }

    public function testFetchTableCols_schema()
    {
        $table  = $this->setup->getTable();
        $schema2 = $this->setup->getSchema2();
        $actual = $this->schema->fetchTableCols("{$schema2}.{$table}");
        $expect = $this->expect_fetch_table_cols;
        ksort($actual);
        ksort($expect);
        $this->assertSame(count($expect), count($actual));
        foreach ($expect as $name => $info) {
            $this->assertEquals($expect[$name], $actual[$name]);
        }
    }

    public function testQuoteName()
    {
        $actual = $this->schema->quoteName('one.two');
        $this->assertSame($this->expect_quote_name, $actual);
    }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Allocarya divergens Piper

### Remarks
null


text: Our attempt at a game for Ludum Dare 33


text:
package com.sebastian_daschner.jaxrs_analyzer.analysis.classes.testclasses.resource.object;

import com.sebastian_daschner.jaxrs_analyzer.model.elements.HttpResponse;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import java.util.*;

public class TestClass8 {

    @javax.ws.rs.GET public List<Model> method() {
        if ("".equals(""))
            return handleResponse();
        return new LinkedList<>();
    }

    private List<Model> handleResponse() {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
    }

    public static Set<HttpResponse> getResult() {
        final HttpResponse httpResponse = new HttpResponse();
        httpResponse.getEntityTypes().add("Ljava/util/List<Lcom/sebastian_daschner/jaxrs_analyzer/analysis/classes/testclasses/resource/object/TestClass8$Model;>;");

        final HttpResponse notFoundResponse = new HttpResponse();
        notFoundResponse.getStatuses().add(404);

        return new HashSet<>(Arrays.asList(httpResponse, notFoundResponse));
    }

    private class Model {
        public Model(final String string) {
        }
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <title>$partname current feedback amplifier test</title>

$partname: current feedback amplifier test

    part name:  $partname

    description:  $description

    documentation:  $documentation

    model name:  $modelname

    library file:  $file

	    Input and output voltage of an non-inverting amplifier with amplification factor of 2.

      Transfer function of an AC non-inverting amplifier.

 Test logging messages

$test_result

    <address>Werner Hoch</address>

Last modified: Wed Nov 21 15:29:09 CET 2007


text:
package org.lcmanager.gdb.service.data.model;

import java.util.Locale;

import org.lcmanager.gdb.base.Formatable;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * Represents a processor and all its relevant technical data.
 *
 */
@Data
@Accessors(chain = true)
public class Processor implements BaseModel<Integer>, Formatable {
    /**
     * The serial version UID.
     *
     */
    private static final long serialVersionUID = -1608938574683528407L;

    /**
     * The ID of this processor.
     *
     */
    private Integer id;
    /**
     * The model ID of the processor.
     *
     */
    private String model;
    /**
     * The number of processor cores.
     *
     */
    private Integer cores;
    /**
     * The number of processor threads.
     *
     */
    private Integer threads;
    /**
     * The processor frequency in megahertz.
     *
     */
    private Integer frequency;
    /**
     * The with of the instruction set (e.g. 32 or 64 Bit).
     *
     */
    private Integer instructionSet;

    // ~ Mapped ~
    /**
     * The brand of the processor.
     *
     */
    private Brand brand;

    /**
     * {@inheritDoc}
     *
     * @see org.lcmanager.gdb.base.Formatable#format(java.util.Locale)
     */
    @Override
    public String format(final Locale locale) {
        return this.brand.format() + " " + this.model;
    }
}


text:
<?php

namespace app\modules\support\controllers;

use yii\web\Controller;

/**
 * Default controller for the `support` module
 */
class DefaultController extends Controller
{
    public $layout = '@app/modules/core/views/layouts/admin';

    public function behaviors()
    {
        return [
            'access' => [
                'class' => \yii\filters\AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'actions' => ['index'],
                        'roles' => ['support.default.index'],
                    ],
                ],
            ],
        ];
    }

    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionIndex()
    {
        return $this->render('index');
    }
}


text:
package net.wasdev.gameon.room.engine.sample.items;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import net.wasdev.gameon.room.engine.Room;
import net.wasdev.gameon.room.engine.User;
import net.wasdev.gameon.room.engine.meta.ItemDesc;
import net.wasdev.gameon.room.engine.parser.CommandTemplate;
import net.wasdev.gameon.room.engine.parser.ContainerItem;
import net.wasdev.gameon.room.engine.parser.Item;
import net.wasdev.gameon.room.engine.parser.ItemUseHandler;
import net.wasdev.gameon.room.engine.parser.Node.Type;
import net.wasdev.gameon.room.engine.parser.ParsedCommand;

public class Fuse extends ItemDesc {

    public static final ItemUseHandler handler = new ItemUseHandler() {
        private final CommandTemplate useInventoryFuseWithRoomItem = new CommandTemplateBuilder()
                .build(Type.INVENTORY_ITEM).build(Type.LINKWORD, "With").build(Type.CONTAINER_ITEM).build();
        private final Set<CommandTemplate> templates = Collections.unmodifiableSet(
                new HashSet<CommandTemplate>(Arrays.asList(new CommandTemplate[] { useInventoryFuseWithRoomItem })));

        @Override
        public Set<CommandTemplate> getTemplates() {
            return templates;
        }

        @Override
        public boolean isHidden() {
            return false;
        }

        @Override
        public void processCommand(Room room, String execBy, ParsedCommand command) {
            String key = command.key;
            User u = room.getUserById(execBy);
            if (u != null) {
                // every template has this item as the first item..
                Item fuse = (Item) command.args.get(0);
                ContainerItem jb = (ContainerItem) command.args.get(2);
                if (key.equals(useInventoryFuseWithRoomItem.key)) {
                    if (jb.item.equals(Items.jukebox)) {
                        room.playerEvent(execBy, "You take the fuse, and insert it into the jukebox. Fingers crossed!",
                                u.username + " installs the fuse into the jukebox.");
                        jb.container.items.add(Items.fuse);
                        u.inventory.remove(Items.fuse);
                    } else {
                        room.playerEvent(execBy, "You try several times to use the " + fuse.item.name + " with the "
                                + jb.item.name + " but can't seem to figure out how.", null);
                    }
                }
            }
        }

        @Override
        public void processUnknown(Room room, String execBy, String origCmd, String cmdWithoutVerb) {
            room.playerEvent(execBy, "That doesn't sound like the way you are supposed to use the " + cmdWithoutVerb,
                    null);
        }
    };

    public Fuse() {
        super("Fuse", "A small 5 amp cartridge fuse, it appears to be functional.", true, false, handler);

        /*
         * new ItemCommand(){
         *
         * @Override public void processCommand(ItemDesc item, String execBy,
         * String cmd, Room room) { //allow use of fuse with jukebox //using
         * fuse with jukebox should move it from player inv into jukebox. User u
         * = room.getUserById(execBy); if(u!=null){ //remove the 'use itemname'
         * String restOfCmd = getCommandWithoutVerbAndItemAsString(cmd,item);
         * //is the next word 'with' ? String next =
         * getFirstWordFromCommand(restOfCmd); if(next==null){
         * room.playerEvent(execBy,
         * "The thing about fuses, is they are not all that interesting, they don't play video games, and they don't have buttons to press."
         * ,null); }else{ if("WITH".equals(next)){ //remove with.. restOfCmd =
         * getCommandWithoutVerbAsString(restOfCmd); //assume rest of string is
         * an item. ItemDesc otherItem = findItemInRoomOrInventory(u, restOfCmd,
         * room); if(otherItem!=null){ if(otherItem.equals(Items.jukebox)){ //is
         * the fuse in the users inventory.. boolean itemIsInInventory =
         * findItemInInventory(item.name, u)!=null; if(itemIsInInventory){
         * //yes, player has item in inventory room.playerEvent(execBy,
         * "You take the fuse, and insert it into the jukebox. Fingers crossed!"
         * ,u.username+" installs the fuse into the jukebox."); ContainerDesc jb
         * = (ContainerDesc)otherItem; jb.items.add(Items.fuse);
         * u.inventory.remove(Items.fuse); }else{ //no, item is in room.
         * room.playerEvent(execBy,
         * "That fuse looks remarkably like it might fit in that jukebox, but the fuse is all the way over there, perhaps you should take the fuse first?"
         * ,null); } }else{ room.playerEvent(execBy,
         * "You try several times to use the "+item.name+" with the "
         * +otherItem.name+" but can't seem to figure out how.",null); } }else{
         * room.playerEvent(execBy, "You aren't quite sure what "+restOfCmd+
         * " is, or how to use it with "+item.name,null); } }else{
         * room.playerEvent(execBy, "I'm sorry dave, I cannot do that!", null);
         * } } }else{ //player not in room anymore. } }});
         */
    }
}


text:
import { N_ } from '../../../src/i18n';
import jobsListController from '../jobsList.controller';

const jobsListTemplate = require('~features/jobs/jobsList.view.html');

export default {
    url: '/completed_jobs',
    params: {
        job_search: {
            value: {
                page_size: '20',
                job__hosts: '',
                order_by: '-id'
            },
            dynamic: true,
            squash: ''
        }
    },
    data: {
        socket: {
            groups: {
                jobs: ['status_changed']
            }
        }
    },
    ncyBreadcrumb: {
        label: N_('COMPLETED JOBS')
    },
    views: {
        related: {
            templateUrl: jobsListTemplate,
            controller: jobsListController,
            controllerAs: 'vm'
        }
    },
    resolve: {
        resolvedModels: [
            'UnifiedJobModel',
            (UnifiedJob) => {
                const models = [
                    new UnifiedJob(['options']),
                ];
                return Promise.all(models);
            },
        ],
        Dataset: [
            '$stateParams',
            'Wait',
            'GetBasePath',
            'QuerySet',
            ($stateParams, Wait, GetBasePath, qs) => {
                const hostId = $stateParams.host_id;

                const searchParam = _.assign($stateParams
                    .job_search, { job__hosts: hostId });

                const searchPath = GetBasePath('unified_jobs');

                Wait('start');
                return qs.search(searchPath, searchParam)
                    .finally(() => Wait('stop'));
            }
        ],
        SearchBasePath: [
            'GetBasePath',
            (GetBasePath) => GetBasePath('unified_jobs')
        ]
    }
};


text:
package org.elasticsearch.ingest.geoip;

import java.io.IOException;
import java.net.InetAddress;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

import com.maxmind.geoip2.DatabaseReader;
import com.maxmind.geoip2.exception.AddressNotFoundException;
import com.maxmind.geoip2.model.CityResponse;
import com.maxmind.geoip2.model.CountryResponse;
import com.maxmind.geoip2.record.City;
import com.maxmind.geoip2.record.Continent;
import com.maxmind.geoip2.record.Country;
import com.maxmind.geoip2.record.Location;
import com.maxmind.geoip2.record.Subdivision;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.SpecialPermission;
import org.elasticsearch.common.network.InetAddresses;
import org.elasticsearch.common.network.NetworkAddress;
import org.elasticsearch.ingest.AbstractProcessor;
import org.elasticsearch.ingest.IngestDocument;
import org.elasticsearch.ingest.Processor;

import static org.elasticsearch.ingest.ConfigurationUtils.newConfigurationException;
import static org.elasticsearch.ingest.ConfigurationUtils.readBooleanProperty;
import static org.elasticsearch.ingest.ConfigurationUtils.readOptionalList;
import static org.elasticsearch.ingest.ConfigurationUtils.readStringProperty;

public final class GeoIpProcessor extends AbstractProcessor {

    public static final String TYPE = "geoip";
    private static final String CITY_DB_TYPE = "GeoLite2-City";
    private static final String COUNTRY_DB_TYPE = "GeoLite2-Country";

    private final String field;
    private final String targetField;
    private final DatabaseReader dbReader;
    private final Set<Property> properties;
    private final boolean ignoreMissing;

    GeoIpProcessor(String tag, String field, DatabaseReader dbReader, String targetField, Set<Property> properties,
                   boolean ignoreMissing) throws IOException {
        super(tag);
        this.field = field;
        this.targetField = targetField;
        this.dbReader = dbReader;
        this.properties = properties;
        this.ignoreMissing = ignoreMissing;
    }

    boolean isIgnoreMissing() {
        return ignoreMissing;
    }

    @Override
    public void execute(IngestDocument ingestDocument) {
        String ip = ingestDocument.getFieldValue(field, String.class, ignoreMissing);

        if (ip == null && ignoreMissing) {
            return;
        } else if (ip == null) {
            throw new IllegalArgumentException("field [" + field + "] is null, cannot extract geoip information.");
        }

        final InetAddress ipAddress = InetAddresses.forString(ip);

        Map<String, Object> geoData;
        switch (dbReader.getMetadata().getDatabaseType()) {
            case CITY_DB_TYPE:
                try {
                    geoData = retrieveCityGeoData(ipAddress);
                } catch (AddressNotFoundRuntimeException e) {
                    geoData = Collections.emptyMap();
                }
                break;
            case COUNTRY_DB_TYPE:
                try {
                    geoData = retrieveCountryGeoData(ipAddress);
                } catch (AddressNotFoundRuntimeException e) {
                    geoData = Collections.emptyMap();
                }
                break;
            default:
                throw new ElasticsearchParseException("Unsupported database type [" + dbReader.getMetadata().getDatabaseType()
                        + "]", new IllegalStateException());
        }
        if (geoData.isEmpty() == false) {
            ingestDocument.setFieldValue(targetField, geoData);
        }
    }

    @Override
    public String getType() {
        return TYPE;
    }

    String getField() {
        return field;
    }

    String getTargetField() {
        return targetField;
    }

    DatabaseReader getDbReader() {
        return dbReader;
    }

    Set<Property> getProperties() {
        return properties;
    }

    private Map<String, Object> retrieveCityGeoData(InetAddress ipAddress) {
        SpecialPermission.check();
        CityResponse response = AccessController.doPrivileged((PrivilegedAction<CityResponse>) () -> {
            try {
                return dbReader.city(ipAddress);
            } catch (AddressNotFoundException e) {
                throw new AddressNotFoundRuntimeException(e);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        });

        Country country = response.getCountry();
        City city = response.getCity();
        Location location = response.getLocation();
        Continent continent = response.getContinent();
        Subdivision subdivision = response.getMostSpecificSubdivision();

        Map<String, Object> geoData = new HashMap<>();
        for (Property property : this.properties) {
            switch (property) {
                case IP:
                    geoData.put("ip", NetworkAddress.format(ipAddress));
                    break;
                case COUNTRY_ISO_CODE:
                    String countryIsoCode = country.getIsoCode();
                    if (countryIsoCode != null) {
                        geoData.put("country_iso_code", countryIsoCode);
                    }
                    break;
                case COUNTRY_NAME:
                    String countryName = country.getName();
                    if (countryName != null) {
                        geoData.put("country_name", countryName);
                    }
                    break;
                case CONTINENT_NAME:
                    String continentName = continent.getName();
                    if (continentName != null) {
                        geoData.put("continent_name", continentName);
                    }
                    break;
                case REGION_NAME:
                    String subdivisionName = subdivision.getName();
                    if (subdivisionName != null) {
                        geoData.put("region_name", subdivisionName);
                    }
                    break;
                case CITY_NAME:
                    String cityName = city.getName();
                    if (cityName != null) {
                        geoData.put("city_name", cityName);
                    }
                    break;
                case TIMEZONE:
                    String locationTimeZone = location.getTimeZone();
                    if (locationTimeZone != null) {
                        geoData.put("timezone", locationTimeZone);
                    }
                    break;
                case LOCATION:
                    Double latitude = location.getLatitude();
                    Double longitude = location.getLongitude();
                    if (latitude != null && longitude != null) {
                        Map<String, Object> locationObject = new HashMap<>();
                        locationObject.put("lat", latitude);
                        locationObject.put("lon", longitude);
                        geoData.put("location", locationObject);
                    }
                    break;
            }
        }
        return geoData;
    }

    private Map<String, Object> retrieveCountryGeoData(InetAddress ipAddress) {
        SpecialPermission.check();
        CountryResponse response = AccessController.doPrivileged((PrivilegedAction<CountryResponse>) () -> {
            try {
                return dbReader.country(ipAddress);
            } catch (AddressNotFoundException e) {
                throw new AddressNotFoundRuntimeException(e);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        });

        Country country = response.getCountry();
        Continent continent = response.getContinent();

        Map<String, Object> geoData = new HashMap<>();
        for (Property property : this.properties) {
            switch (property) {
                case IP:
                    geoData.put("ip", NetworkAddress.format(ipAddress));
                    break;
                case COUNTRY_ISO_CODE:
                    String countryIsoCode = country.getIsoCode();
                    if (countryIsoCode != null) {
                        geoData.put("country_iso_code", countryIsoCode);
                    }
                    break;
                case COUNTRY_NAME:
                    String countryName = country.getName();
                    if (countryName != null) {
                        geoData.put("country_name", countryName);
                    }
                    break;
                case CONTINENT_NAME:
                    String continentName = continent.getName();
                    if (continentName != null) {
                        geoData.put("continent_name", continentName);
                    }
                    break;
            }
        }
        return geoData;
    }

    public static final class Factory implements Processor.Factory {
        static final Set<Property> DEFAULT_CITY_PROPERTIES = EnumSet.of(
            Property.CONTINENT_NAME, Property.COUNTRY_ISO_CODE, Property.REGION_NAME,
            Property.CITY_NAME, Property.LOCATION
        );
        static final Set<Property> DEFAULT_COUNTRY_PROPERTIES = EnumSet.of(Property.CONTINENT_NAME, Property.COUNTRY_ISO_CODE);

        private final Map<String, DatabaseReader> databaseReaders;

        public Factory(Map<String, DatabaseReader> databaseReaders) {
            this.databaseReaders = databaseReaders;
        }

        @Override
        public GeoIpProcessor create(Map<String, Processor.Factory> registry, String processorTag,
                                       Map<String, Object> config) throws Exception {
            String ipField = readStringProperty(TYPE, processorTag, config, "field");
            String targetField = readStringProperty(TYPE, processorTag, config, "target_field", "geoip");
            String databaseFile = readStringProperty(TYPE, processorTag, config, "database_file", "GeoLite2-City.mmdb.gz");
            List<String> propertyNames = readOptionalList(TYPE, processorTag, config, "properties");
            boolean ignoreMissing = readBooleanProperty(TYPE, processorTag, config, "ignore_missing", false);

            DatabaseReader databaseReader = databaseReaders.get(databaseFile);
            if (databaseReader == null) {
                throw newConfigurationException(TYPE, processorTag,
                    "database_file", "database file [" + databaseFile + "] doesn't exist");
            }

            String databaseType = databaseReader.getMetadata().getDatabaseType();

            final Set<Property> properties;
            if (propertyNames != null) {
                properties = EnumSet.noneOf(Property.class);
                for (String fieldName : propertyNames) {
                    try {
                        properties.add(Property.parseProperty(databaseType, fieldName));
                    } catch (IllegalArgumentException e) {
                        throw newConfigurationException(TYPE, processorTag, "properties", e.getMessage());
                    }
                }
            } else {
                if (CITY_DB_TYPE.equals(databaseType)) {
                    properties = DEFAULT_CITY_PROPERTIES;
                } else if (COUNTRY_DB_TYPE.equals(databaseType)) {
                    properties = DEFAULT_COUNTRY_PROPERTIES;
                } else {
                    throw newConfigurationException(TYPE, processorTag, "database_file", "Unsupported database type ["
                            + databaseType + "]");
                }
            }

            return new GeoIpProcessor(processorTag, ipField, databaseReader, targetField, properties, ignoreMissing);
        }
    }

    // Geoip2's AddressNotFoundException is checked and due to the fact that we need run their code
    // inside a PrivilegedAction code block, we are forced to catch any checked exception and rethrow
    // it with an unchecked exception.
    private static final class AddressNotFoundRuntimeException extends RuntimeException {

        AddressNotFoundRuntimeException(Throwable cause) {
            super(cause);
        }
    }

    enum Property {

        IP,
        COUNTRY_ISO_CODE,
        COUNTRY_NAME,
        CONTINENT_NAME,
        REGION_NAME,
        CITY_NAME,
        TIMEZONE,
        LOCATION;

        static final EnumSet<Property> ALL_CITY_PROPERTIES = EnumSet.allOf(Property.class);
        static final EnumSet<Property> ALL_COUNTRY_PROPERTIES = EnumSet.of(Property.IP, Property.CONTINENT_NAME,
            Property.COUNTRY_NAME, Property.COUNTRY_ISO_CODE);

        public static Property parseProperty(String databaseType, String value) {
            Set<Property> validProperties = EnumSet.noneOf(Property.class);
            if (CITY_DB_TYPE.equals(databaseType)) {
                validProperties = ALL_CITY_PROPERTIES;
            } else if (COUNTRY_DB_TYPE.equals(databaseType)) {
                validProperties = ALL_COUNTRY_PROPERTIES;
            }

            try {
                Property property = valueOf(value.toUpperCase(Locale.ROOT));
                if (validProperties.contains(property) == false) {
                    throw new IllegalArgumentException("invalid");
                }
                return property;
            } catch (IllegalArgumentException e) {
                throw new IllegalArgumentException("illegal property value [" + value + "]. valid values are " +
                        Arrays.toString(validProperties.toArray()));
            }
        }
    }
}


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('crm', '0036_auto_20180123_1157'),
    ]

    operations = [
        migrations.AlterField(
            model_name='changes',
            name='phone',
            field=models.CharField(blank=True, max_length=40, null=True),
        ),
        migrations.AlterField(
            model_name='changes',
            name='phone_main',
            field=models.CharField(blank=True, max_length=40, null=True),
        ),
    ]