text:
package com.twu.biblioteca.view;

/**
 * Messages implementation.
 * Messages is responsible for holding all of the messages to display.
 *
 * @author Desiree Kelly
 * @version 1.0
 */
public class MessagesImpl implements Messages {

    @Override
    public String welcomeMessage() {
        return "Welcome to the Bangalore Public library!\n\nPlease login to your account to borrow or return an item.\n";
    }

    @Override
    public String mainMenuMessage() {
        return "\nEnter one of the following options:\n" +
                "1 Login to account\n" +
                "2 Exit\n";
    }

    @Override
    public String customerMenuMessage() {
        return "\nEnter one of the following options:\n" +
                "1 Display the list of available books\n" +
                "2 Borrow a book\n" +
                "3 Return a book\n" +
                "4 Display the list of available movies\n" +
                "5 Borrow a movie\n" +
                "6 Return a movie\n" +
                "7 Display account information\n" +
                "8 Logout\n";
    }

    @Override
    public String librarianMenuMessage() {
        return "\nEnter one of the following options:\n" +
                "1 Display items checked out by customers\n" +
                "2 Logout\n";
    }

    @Override
    public String itemsCheckedOutByCustomersMessage() {
        return "\nItems checked out by customers:\n\n";
    }

    @Override
    public String optionMessage() {
        return "Enter your option:";
    }

    @Override
    public String bookListingMessage() {
        return "\nAvailable Books:\n\n" + String.format("%-15s %-15s %-15s %-15s\n", "ID:", "Title:", "Author:", "Year Published:");
    }

    @Override
    public String incorrectAvailableBooksMessage() {
        return "\nSorry, there are no available books in the library.\n";
    }

    @Override
    public String incorrectOptionMessage() {
        return "\nIncorrect option, please try again.\n";
    }

    @Override
    public String incorrectInputMessage() {
        return "\nIncorrect input, please try again.\n";
    }

    @Override
    public String incorrectBookReturnMessage() {
        return "\nSorry, there are no available books to return\n";
    }

    @Override
    public String incorrectMovieReturnMessage() {
        return "\nSorry, there are no available movies to return\n";
    }

    @Override
    public String incorrectBookBorrowMessage() {
        return "\nSorry, there are no available books to borrow\n";
    }

    @Override
    public String exitMessage() {
        return "\nThank you for using the Bangalore Public library!\n";
    }

    @Override
    public String bookBorrowMessage() {
        return "\nSelect a book to borrow by entering the ID number or enter 0 to go back to the main menu:";
    }

    @Override
    public String bookBorrowThankYouMessage() {
        return "\nThank you! Enjoy reading ";
    }

    @Override
    public String bookReturnMessage() {
        return "\nSelect a book to return by entering the ID number or enter 0 to go back to the main menu:";
    }

    @Override
    public String returnThankYouMessage() {
        return "\nThank you for returning ";
    }

    @Override
    public String movieListingMessage(){
        return "\nAvailable Movies:\n\n" + String.format("%-20s %-30s %-20s %-35s %-20s\n", "ID:", "Title:", "Year:", "Director:", "Movie Rating:");
    }

    @Override
    public String incorrectMovieBorrowMessage(){
        return "\nSorry, there are no available movies to borrow\n";
    }

    @Override
    public String movieBorrowThankYouMessage(){
        return "\nThank you! Enjoy watching ";
    }

    @Override
    public String movieBorrowMessage(){
        return "\nSelect a movie to borrow by entering the ID number or enter 0 to go back to the main menu:\n";
    }

    @Override
    public String movieReturnMessage() {
        return "\nSelect a movie to return by entering the ID number or enter 0 to go back to the main menu:\n";
    }

    @Override
    public String incorrectAvailableMoviesMessage() {
        return "\nSorry, there are no available movies in the library.\n";
    }

    @Override
    public String libraryNumberMessage() {
        return "\nEnter your Library Number:";
    }

    @Override
    public String passwordMessage() {
        return "\nEnter your Password:";
    }

    @Override
    public String loginMessage() {
        return "\nPlease login with your Library Number and Password.\n";
    }

    @Override
    public String correctLoginMessage() {
        return "\nYou have logged in successfully ";
    }

    @Override
    public String logoutMessage() {
        return "\nYou have logged out.\n";
    }

    @Override
    public String incorrectItemsCheckedOutByCustomersMessage() {
        return "\nSorry, there are no items checked out from the Library.\n";
    }
}


text:
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- These settings headers are only used on tablets. -->

    <header
        android:fragment="com.xiaopeng.musicplayer.activity.SettingsActivity$GeneralPreferenceFragment"
        android:title="@string/pref_header_general" />

    <header
        android:fragment="com.xiaopeng.musicplayer.activity.SettingsActivity$NotificationPreferenceFragment"
        android:title="@string/pref_header_notifications" />

    <header
        android:fragment="com.xiaopeng.musicplayer.activity.SettingsActivity$DataSyncPreferenceFragment"
        android:title="@string/pref_header_data_sync" />

</preference-headers>

redpajama_set_name: RedPajamaGithub


text:
static HAFVoiceClockManager *instance;
@implementation HAFVoiceClockManager{
    HAFAudioPlayer                  *_player;
    HAFMandarinVoiceClock           *_mandarinClock;
    NSBundle                        *_bundleMandarin;
    NSTimer                         *_taskDistributorTimer;
    NSTimer                         *_taskerTimer;
    NSDate                          *_nextFireDate;
    __weak id<HAFVoiceClockManagerDelegate> _delegate;
}

+(instancetype)sharedManager{
    @synchronized (self) {
        if (nil == instance) {
            instance = [[HAFVoiceClockManager alloc] init];
        }
        return instance;
    }
}

-(instancetype)init{
    if (self = [super init]) {
        [self __initializeHAFVoiceClockManager];
    }
    return self;
}

-(void)announceThisTimeUsingMandarin{
    [_mandarinClock set24HourClock:[self isTwentyfourHour]];
    [_player setVolume:[[HAFConfigureManager sharedManager] volume]];
    [_delegate announcing];
    [_player startPlaying:[_mandarinClock announceThisTime:[self announceType]] withBundle:_bundleMandarin];
}

-(BOOL)isAnnouncing {
    return [_player isPlaying];
}

-(void)setAnnounceType:(HAF_Announce_Format_Type)announceType{
    [[HAFConfigureManager sharedManager] setAnnounceType:announceType];
}

-(HAF_Announce_Format_Type)announceType{
    return [[HAFConfigureManager sharedManager] announceType];
}

-(void)setAnnounceRule:(HAF_Announce_Rule)announceRule{
    [[HAFConfigureManager sharedManager] setAnnounceRule:announceRule];
}

-(HAF_Announce_Rule)announceRule{
    return [[HAFConfigureManager sharedManager] announceRule];
}

-(void)setTwentyfourHour:(BOOL)twentyfourHour{
    [[HAFConfigureManager sharedManager] setTwentyfourHour:twentyfourHour];
}

-(BOOL)isTwentyfourHour{
    return [[HAFConfigureManager sharedManager] isTwentyfourHour];
}

-(void)__initializeHAFVoiceClockManager{
    _player = [[HAFAudioPlayer alloc] init];
    _mandarinClock = [[HAFMandarinVoiceClock alloc] init];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"vc-ZH-Han" ofType:@"bundle"];
    _bundleMandarin = [NSBundle bundleWithPath:path];
    [self __distributeAnnounceTask];
    _taskDistributorTimer = [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(__distributeAnnounceTask) userInfo:nil repeats:YES];
}

-(void)__distributeAnnounceTask{
    NSDate *date = [self __dateToNearest15Minutes];
    if(![date isEqualToDate:_nextFireDate]){
        _nextFireDate = date;
        _taskerTimer = [[NSTimer alloc] initWithFireDate:_nextFireDate interval:0 target:self selector:@selector(__taskAction) userInfo:nil repeats:NO];
        [[NSRunLoop currentRunLoop] addTimer:_taskerTimer forMode:NSDefaultRunLoopMode];
    }
}

-(void)__taskAction{
    BOOL bAnnounce = NO;
    NSDateComponents *comps = [[NSCalendar currentCalendar] components:NSMinuteCalendarUnit fromDate:[NSDate date]];
    switch ([self announceRule]) {
        case eHAF_Announce_Hourly:
            bAnnounce = (0 == comps.minute);
            break;

        case eHAF_Announce_Half_Hourly:
            bAnnounce = (0 == comps.minute % 30);
            break;

        case eHAF_Announce_Quarter_Hourly:
            bAnnounce = (0 == comps.minute % 15);
            break;

        case eHAF_Announce_By_Hand:
        default:
            break;
    }
    if (bAnnounce) {
        [self announceThisTimeUsingMandarin];
    }
}

- (NSDate *)__dateToNearest15Minutes {
    unsigned unitFlags = NSYearCalendarUnit| NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekCalendarUnit |  NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSWeekdayCalendarUnit | NSWeekdayOrdinalCalendarUnit;
    NSDateComponents *comps = [[NSCalendar currentCalendar] components:unitFlags fromDate:[NSDate date]];
    [comps setMinute:((([comps minute] - 8 ) / 15 ) * 15 ) + 15];
    [comps setSecond:0];
    return [[NSCalendar currentCalendar] dateFromComponents:comps];
}

@end


text:
FROM kreczko/centos6

MAINTAINER Luke Kreczko <kreczko@cern.ch>

RUN yum -y update
RUN yum -y install traceroute net-tools ntp python-setuptools
RUN easy_install supervisor
RUN yum install -y https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
RUN yum install -y http://software.internet2.edu/rpms/el6/x86_64/main/RPMS/Internet2-repo-0.6-1.noarch.rpm
RUN yum -y install perfsonar-testpoint
RUN yum clean all
RUN mkdir -p /var/log/supervisor

ADD supervisord.conf /etc/supervisord.conf
ADD ls_registration_daemon.conf /opt/perfsonar_ps/ls_registration_daemon/etc/ls_registration_daemon.conf
ADD agent_configuration.conf /opt/perfsonar_ps/mesh_config/etc/agent_configuration.conf
#RUN sed -i 's/<insert_hostname_here>/g/' #TODO

CMD /usr/bin/supervisord -c /etc/supervisord.conf


text:
<?php

namespace App\Widgets\Revenue;

use App\Models\Payment;
use Arrilot\Widgets\AbstractWidget;
use Carbon\Carbon;

class Today extends AbstractWidget
{
    /**
     * The configuration array.
     *
     * @var array
     */
    protected $config = [
        'class' => 'col-sm-4'
    ];

    /**
     * Treat this method as a controller action.
     * Return view() or other content to display.
     */
    public function run()
    {
        $revenue = Payment::where([
            ['created_at', '>', Carbon::today()],
        ])->sum('amount');

        return view('widgets.revenue.today', [
            'config' => $this->config,
            'revenue' => $revenue
        ]);
    }
}


text:
    <title>Maintenance</title>

Maintenance

Ooops! We are are sorry for the inconvenience, but we are currently under maintenance.
This shouldn't take long, so why don't you come back in a few?


text:
We have a nice Javascript library for integrating MediaCrush into your website. You can get the latest
version [here](/static/mediacrush.js), or you can just use this:

## Usage

This library exposes a `MediaCrush` object, which you can use to interface with the MediaCrush API.
Additionally, the library will render any elements in your document that look like this:

To suppress this behavior, set `window.preventMediaCrushAutoload` before loading mediacrush.js.

You may also set `window.beforeMediaCrushLoad` to a function that should be executed before MediaCrush
does its initial sweep of the DOM for `.mediacrush` elements. This gives you a chance to change settings
like `MediaCrush.domain`.

mediacrush.js can also be used to embed MediaCrush objects into pages. This is the preferred means of
embedding files in third party sites. You can embed any MediaCrush file into a div, and it will
look like:

* Images will be inserted into the div directly
* Video and audio will be inserted in the form of an iframe sized to fit the contents correctly

Regarding the iframe sizing - mediacrush.js will insert the iframe into the page with `display: none`
and communicate with it to receive details on the resolution of the media within. It will then
size the iframe correctly and remove the `display: none`, then call the callback (if applicable).

## Examples

**Embed media**

If you have inserted the page into your markup on the server side, just add something like this and
it'll render on `window.onload`:

If you add a div like this into the page at runtime, you can use something like this:

    MediaCrush.render(document.getElementById('...')); // One item
    MediaCrush.renderAll(); // Re-discovers and renders all items on the page

MediaCrush.js will preserve all #controls in the data-media attribute. For example, you might do:

The full list of modifiers is:

* `autoplay`: Forces the media to autoplay
* `noautoplay`: Forces the media not to autoplay
* `loop`: Forces the media to loop
* `noloop`: Forces the media not to loop
* `mute`: Mutes the media by default
* `nobrand`: Does not show MediaCrush branding in the embedded media player (doing this makes us sad, but we won't stop you)

**Upload a file**

Say you have this in your page somewhere:

    <input type="file" id="fileToUpload" />

You can do this to upload it to MediaCrush:

    var file = document.getElementById('fileToUpload').files[0];
    MediaCrush.upload(file, function(media) {
        console.log('Processing...');
        media.wait(function() { // Wait for it to finish processing
            console.log(media.url);
        });
    };

**Get file information**

    MediaCrush.get('tG6dvDt2jNcr', function(media) {
        console.log(media.type);
    });

## MediaCrush

The MediaCrush object provides access to the MediaCrush API, with several methods and properties.

### MediaCrush.domain

This defaults to `https://mediacru.sh`. You may modify it to use alternate MediaCrush instances.

### MediaCrush.maxMediaWidth

Set to -1 (default) for unbounded width. Set to any other value to cause MediaCrush to limit the width of embedded
media to the specified value, in pixels.

### MediaCrush.maxMediaHeight

Set to -1 (default) for unbounded height. Set to any other value to cause MediaCrush to limit the height of embedded
media to the specified value, in pixels.

### MediaCrush.preserveAspectRatio

When true (default), and embedded media has to be limited by maxMediaWidth or maxMediaHeight, mediacrush.js will
preserve the aspect ratio of the embedded media upon scaling it down.

### MediaCrush.version

Returns the current version (integer) of the API and the mediacrush.js script.

### MediaCrush.checkStatus(hash, callback)

Checks the status of a processing media blob and calls back with the status, and the result. You should usually
just use the `Media.update` function from MediaCrush.upload.

### MediaCrush.exists(hash, callback)

Checks if the specified hash exists on MediaCrush. Calls back with a boolean.

### MediaCrush.get(hash, callback)

Retrieves information about the specified hash and calls back with a `Media` object.

    MediaCrush.get('tG6dvDt2jNcr', function(media) {
        // ...
    });

### MediaCrush.get(list, callback)

Retrieves information about several hashes at once and calls back with an array, and a dictionary, of `Media` objects.

    MediaCrush.get([ 'tG6dvDt2jNcr', 'nJlGaGbjQ716' ], function(array, dict) {
        // Use array[integer]
        // Or dict['hash'] to get a specific one
    });

### MediaCrush.render(element, [callback])

Renders a specific MediaCrush DOM element. The element should look like this:

When done, it'll call `callback(element, media)` with a `Media` object as the second parameter. `callback` is optional.

### MediaCrush.renderAll()

Discovers and renders all MediaCrush DOM elements. They should look like this:

This is preferred to using `MediaCrush.render` several times, since this will look them all up at once with a single
HTTP request.

### MediaCrush.upload(file, callback, progress)

Uploads the given [File](https://developer.mozilla.org/en-US/docs/Web/API/File?redirectlocale=en-US&redirectslug=DOM%2FFile)
to MediaCrush and calls back with a `Media` object. In some cases, this object will immediately finish processing and
will have its status set to 'done'. In most cases, you'll have to use the `update` function on the returned object.

If set, `progress` will be given to the XHR request's `onprogress` property.

### MediaCrush.upload(url, callback, progress)

Uploads the specified url to MediaCrush and calls back with a `Media` object. In some cases, this object will immediately
finish processing and will have its status set to 'done'. In most cases, you'll have to use the `update` function on the
returned object.

## Media

The `Media` object is returned by several functions, notably the upload function.

### Media.compression

If MediaCrush was able to compress this file a bit (losslessly), this will the the compression rate (or zero otherwise).

### Media.files

An array of the files associated with this media (different video formats, etc). Each one looks like this:

    {
        file: '/path-to-file',
        type: 'mimetype'
    }

The path is relative, so you'll have to add `https://mediacru.sh/` if you want it in a page.

### Media.original

The URL to the originally uploaded file.

The URL is relative, so you'll have to add `https://mediacru.sh/` if you want it in a page.

### Media.status

One of these values:

* 'done': When it's done processing and is ready to use
* 'processing': Still processing on MediaCrush
* 'error': Something went wrong while processing
* 'timeout': Took too long to process

Use `Media.update` to refresh this value.

### Media.type

The mimetype of the originally uploaded media.

### Media.url

The URL of this media on MediaCrush, when it's done processing.

### Media.delete(callback)

Deletes the Media object from the MediaCrush servers. You can only do this if your IP matches the bcrypted IP stored in
the MediaCrush database. Calls back with a boolean indicating success.

### Media.update(callback)

Checks the status of the Media object and calls the callback with itself when it's done.

### Media.wait(callback)

Polls MediaCrush for the status of this object. Calls back with the updated object as soon as the status is not 'processing'.


text:
var Scroller = function(options) {
    this.$document = $(document);
    this.$window = $(window);
    this.$el = $('html, body');
    this.$nav = $(options.navigationContainerSelector);
    this.$sections = $(options.contentSelector);
    this.selectedSection = '';
    this.$section = this.$sections.first();
    this.lastSection = '';
    this.sectionPosTop = 0;
    this.sectionLastPosTop = 0;
    this.scrollTop = 0;
    this.scrollLastTop = 0;

    var init = function init() {
        this.startHash = location.hash.replace('#', '');
        bindDomEvents();
        checkHash();
        this.$window.on('load', checkHash.bind(this));
        loop();
    }.bind(this);

    /**
     * @method bindDomEvents
     *
     * @author Dominik Matt
     */
    var bindDomEvents = function() {
        $(window).scroll(_.throttle(onScroll.bind(this), 10));
        $(window).on('touchmove', _.throttle(onTouchMove.bind(this), 10));
    }.bind(this);

    /**
     * @method onTouchMove
     *
     * @author Dominik Matt
     */
    var onTouchMove = function onTouchMove(event) {
        checkSection();
        calculateSectionPos();
        onScroll(event);
    }.bind(this);

    /**
     * @method onScroll
     *
     * @author Dominik Matt
     */
    var onScroll = function onScroll(event) {
        this.scrollTop = this.$document.scrollTop();
        this.$document.trigger('scroller:scroll', [this.scrollTop]);
    }.bind(this);

    /**
     * @method checkSection
     *
     * @author Dominik Matt
     */
    var checkSection = function checkSection() {
        var scrollTop = this.$document.scrollTop() + (this.$window.height() / 2);
        this.$sections.each(function(key, el) {
            var $el = $(el),
                offsetTop = $el.offset().top;
            if (scrollTop > offsetTop && scrollTop < ( offsetTop + $el.height() ) && $el.data('section-url') && $el.data('section-url') != this.selectedSection) {
                enterSection($el);
                return;
            }
        }.bind(this));
    }.bind(this);

    /**
     * @method enterSection
     *
     * @author Dominik Matt
     */
    var enterSection = function enterSection($el) {
        setActiveNavPoint($el.data('section-url'));

        window.location.hash = $el.data('section-url');

        this.lastSection = this.selectedSection;
        this.selectedSection = $el.data('section-url');
        this.$lastSection = this.$section;
        this.$section = $el;

        this.$document.trigger('scroller:section:enter', [this.selectedSection]);
        this.$section.trigger('scroller:section:entered', [this.selectedSection]);

        selectTransforms();
    }.bind(this);

    /**
     * @method calculateSectionPos
     *
     * @author Dominik Matt
     */
    var calculateSectionPos = function calculateSectionPos() {
        this.scrollTop = $(document).scrollTop();
        var direction = 'down';

        if (this.scrollLastTop > this.scrollTop) {
            direction = 'up';
        } else if (this.scrollLastTop == this.scrollTop) {
            direction = 'stand';
        }

        if (direction != 'stand') {
            this.sectionLastPosTop = this.sectionPosTop;
            this.sectionPosTop = parseInt(this.scrollTop - this.$section.offset().top);
            var posTop = this.sectionPosTop + (this.$window.height() / 2);

            var diff = this.scrollLastTop - this.scrollTop;

            this.$document.trigger('scroller:section:scroll', [this.$section, this.selectedSection, this.sectionPosTop, posTop, this.sectionLastPosTop, diff, direction]);
        }

        this.scrollLastTop = this.scrollTop;
    }.bind(this);

    /**
     * @method selectTransforms
     *
     * @author Dominik Matt
     */
    var selectTransforms = function selectTransforms() {
        if (this.transforms) {
            var selectorTo = ' > ' + this.selectedSection;
            var selectorFromTo = this.lastSection + ' > ' + this.selectedSection;
            var selectorFrom = this.lastSection + ' > ';

            handleTransform(selectorTo);
            handleTransform(selectorFromTo);
            handleTransform(selectorFrom);
        }
    }.bind(this);

    /**
     * @method handleTransform
     *
     * @author Dominik Matt
     */
    var handleTransform = function handleTransform(selector) {
        if (this.transforms[selector]) {
            this.transforms[selector](this.$section);
        }
    }.bind(this);

    /**
     * @method scrollTo
     *
     * @author Dominik Matt
     */
    this.scrollTo = function scrollTo(section, type) {
        if (!type) type = 'selector';

        switch (type) {
            case 'function':
                if (typeof window[section] == 'function') {
                    var pos = window[section](),
                        distance = 0;
                }

                break;
            default:
            case 'selector':
                var $el = $('#' + section + '-section');
                var pos;
                var distance;

                if ($el.length > 0) {
                    pos = $el.offset().top;
                    distance = parseInt($el.data('distance'));
                    setActiveNavPoint(section);
                }

                break;
        }

        this.$el
            .stop()
            .animate({
                scrollTop: pos + distance + 'px'
            }, 1000);
    }.bind(this);

    /**
     * @method setActiveNavPoint
     *
     * @author Dominik Matt
     */
    var setActiveNavPoint = function setActiveNavPoint(section) {
        var $navEl = $('.section-nav-' + section + '');

        this.$nav.find('a').removeClass('active');
        $navEl.addClass('active');
    }.bind(this);

    /**
     * @method checkHash
     *
     * @author Dominik Matt
     */
    var checkHash = function checkHash() {
        if (this.startHash) {
            if (options.sections && options.sections[this.startHash]) {
                var section = options.sections[this.startHash].scrollTo.section,
                    type = options.sections[this.startHash].scrollTo.type;
                this.scrollTo(section, type);
            } else {
                this.scrollTo(this.startHash);
            }
        }
    }.bind(this);

    /**
     * @method loop
     *
     * @author Dominik Matt
     */
    var loop = function loop(doAnimation) {
        var step = function step() {
            checkSection();
            calculateSectionPos();
            window.requestAnimationFrame(step);
        }.bind(this);

        window.requestAnimationFrame(step);
    }.bind(this);

    /**
     * @method getAnimation
     *
     * @author Dominik Matt <dma@massiveart.com>
     */
    this.getAnimation = function getAnimation(animStart, length, pause, maxIndex, scrollDiff) {
        var diff = this.scrollTop - animStart,
            index = Math.floor(diff / (length + pause)),
            state = 'playing',
            scrollDiff = (scrollDiff < 0) ? scrollDiff * -1 : scrollDiff;

        if (index < 0) {
            state = 'wait',
                done = 0;
            var time = 0;
        } else {
            var isPause = (diff - ((length + pause) * index) > length),
                done = diff - ((length + pause) * index);

            if (index >= maxIndex) state = 'end';
            if (isPause) state = 'pause';
            var time = scrollDiff * 2;
        }

        return {
            diff: diff,
            index: index,
            state: state,
            length: (isPause == true ? pause : length),
            time: time,
            done: done
        };
    }.bind(this);

    this.animStates = {};
    /**
     * @method getSingleAnimation
     *
     * @author Dominik Matt
     */
    this.getSingleAnimation = function getSingleAnimation(key, animStart, animHide, scrollDirection, onStartDown, onHide, onInit) {
        if (!this.animStates[key]) {
            this.animStates[key] = 'init';
        }

        var state = this.animStates[key],
            startDiff = this.scrollTop - animStart,
            hideDiff = this.scrollTop - animHide;

        var done = function(key, state) {
            if (key) {
                this.animStates[key] = state;
            }
        };

        if (state == 'init') {
            if (typeof onInit == 'function') {
                onInit(done.bind(this, key, 'wait'));
            }
        }

        if (startDiff >= 0 && state == 'wait') {
            if (typeof onStartDown == 'function') {
                onStartDown(done.bind(this, key, 'end'));
                this.animStates[key] = 'playing';
            }
        }

        if (hideDiff <= 0 && (state == 'end' || state == 'playing')) {
            if (typeof onHide == 'function') {
                this.animStates[key] = 'endPlaying';
                onHide(done.bind(this, key, 'wait'));
            }
        }

    }.bind(this);

    this.scrollToOrder = function scrollToOder(section) {};

    init();
};


text:
namespace CloudTemple.Models
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations.Schema;

    [Table("PurchaseLocations")]
    public class PurchaseLocation
    {
        private ICollection<Purchase> purchases;

        public PurchaseLocation()
        {
            this.purchases = new HashSet<Purchase>();
        }

        public int Id { get; set; }

        public string Name { get; set; }

        public virtual ICollection<Purchase> Purchases
        {
            get
            {
                return this.purchases;
            }

            set
            {
                this.purchases = value;
            }
        }
    }
}


text:
require "active_support/core_ext/string/conversions"

# This code is taken straight from Rails, prior to v6.1.0.
# I'm maintaining a copy here to save myself having to work through aliasing
# logic myself - there's a good chance I don't need all of thiis, but it'll do
# to get this gem working with Rails 6.1.

class Joiner::AliasTracker # :nodoc:
  def self.create(connection, initial_table, joins, aliases = nil)
    if joins.empty?
      aliases ||= Hash.new(0)
    elsif aliases
      default_proc = aliases.default_proc || proc { 0 }
      aliases.default_proc = proc { |h, k|
        h[k] = initial_count_for(connection, k, joins) + default_proc.call(h, k)
      }
    else
      aliases = Hash.new { |h, k|
        h[k] = initial_count_for(connection, k, joins)
      }
    end
    aliases[initial_table] = 1
    new(connection, aliases)
  end

  def self.initial_count_for(connection, name, table_joins)
    quoted_name = nil

    counts = table_joins.map do |join|
      if join.is_a?(Arel::Nodes::StringJoin)
        # quoted_name should be case ignored as some database adapters (Oracle) return quoted name in uppercase
        quoted_name ||= connection.quote_table_name(name)

        # Table names + table aliases
        join.left.scan(
          /JOIN(?:\s+\w+)?\s+(?:\S+\s+)?(?:#{quoted_name}|#{name})\sON/i
        ).size
      elsif join.is_a?(Arel::Nodes::Join)
        join.left.name == name ? 1 : 0
      else
        raise ArgumentError, "joins list should be initialized by list of Arel::Nodes::Join"
      end
    end

    counts.sum
  end

  # table_joins is an array of arel joins which might conflict with the aliases we assign here
  def initialize(connection, aliases)
    @aliases    = aliases
    @connection = connection
  end

  def aliased_table_for(table_name, aliased_name, type_caster)
    if aliases[table_name].zero?
      # If it's zero, we can have our table_name
      aliases[table_name] = 1
      Arel::Table.new(table_name, type_caster: type_caster)
    else
      # Otherwise, we need to use an alias
      aliased_name = @connection.table_alias_for(aliased_name)

      # Update the count
      aliases[aliased_name] += 1

      table_alias = if aliases[aliased_name] > 1
        "#{truncate(aliased_name)}_#{aliases[aliased_name]}"
      else
        aliased_name
      end
      Arel::Table.new(table_name, type_caster: type_caster).alias(table_alias)
    end
  end

  attr_reader :aliases

  private

  def truncate(name)
    name.slice(0, @connection.table_alias_length - 2)
  end
end


text:
angular
    .module('ZppAngular', ['Gallery', 'Version'])

    .config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
        $locationProvider.html5Mode(false);

        $routeProvider
            .otherwise('/');
    }])

// powoduje błąd podczas używania narzędzi do kompresji kodu JS
//    .config(function($locationProvider) {
//        $locationProvider.html5Mode(false);
//    })

    .run(function () {
    });


text:
package client

import (
	"encoding/json"
	"fmt"
	"strings"

	flag "github.com/docker/docker/pkg/mflag"
	"github.com/docker/docker/pkg/nat"
)

// CmdPort lists port mappings for a container.
// If a private port is specified, it also shows the public-facing port that is NATed to the private port.
//
// Usage: docker port CONTAINER [PRIVATE_PORT[/PROTO]]
func (cli *DockerCli) CmdPort(args ...string) error {
	cmd := cli.Subcmd("port", []string{"CONTAINER [PRIVATE_PORT[/PROTO]]"}, "List port mappings for the CONTAINER, or lookup the public-facing port that\nis NAT-ed to the PRIVATE_PORT", true)
	cmd.Require(flag.Min, 1)
	cmd.ParseFlags(args, true)

	stream, _, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
	if err != nil {
		return err
	}

	var c struct {
		NetworkSettings struct {
			Ports nat.PortMap
		}
	}

	if err := json.NewDecoder(stream).Decode(&c); err != nil {
		return err
	}

	if cmd.NArg() == 2 {
		var (
			port  = cmd.Arg(1)
			proto = "tcp"
			parts = strings.SplitN(port, "/", 2)
		)

		if len(parts) == 2 && len(parts[1]) != 0 {
			port = parts[0]
			proto = parts[1]
		}
		natPort := port + "/" + proto
		if frontends, exists := c.NetworkSettings.Ports[nat.Port(port+"/"+proto)]; exists && frontends != nil {
			for _, frontend := range frontends {
				fmt.Fprintf(cli.out, "%s:%s\n", frontend.HostIp, frontend.HostPort)
			}
			return nil
		}
		return fmt.Errorf("Error: No public port '%s' published for %s", natPort, cmd.Arg(0))
	}

	for from, frontends := range c.NetworkSettings.Ports {
		for _, frontend := range frontends {
			fmt.Fprintf(cli.out, "%s -> %s:%s\n", from, frontend.HostIp, frontend.HostPort)
		}
	}

	return nil
}


text:
import { ExternalEditor } from '../../models/editors'

interface IProgramNotFound {
  readonly editor: ExternalEditor
  readonly installed: false
}

interface IProgramMissing {
  readonly editor: ExternalEditor
  readonly installed: true
  readonly pathExists: false
}

interface IProgramFound {
  readonly editor: ExternalEditor
  readonly installed: true
  readonly pathExists: true
  readonly path: string
}

export type LookupResult = IProgramNotFound | IProgramMissing | IProgramFound

/**
 * A found external editor on the user's machine
 */
export type FoundEditor = {
  /**
   * The friendly name of the editor, to be used in labels
   */
  editor: ExternalEditor
  /**
   * The executable associated with the editor to launch
   */
  path: string
}

interface IErrorMetadata {
  /** The error dialog should link off to the Atom website */
  suggestAtom?: boolean

  /** The error dialog should direct the user to open Preferences */
  openPreferences?: boolean
}

export class ExternalEditorError extends Error {
  /** The error's metadata. */
  public readonly metadata: IErrorMetadata

  public constructor(message: string, metadata: IErrorMetadata = {}) {
    super(message)

    this.metadata = metadata
  }
}


text:
module UserOrdersHelper
  def pay_link(order)
    if order.can_pay?
      link_to t('views.my_orders.pay'), pay_user_order_path(order), class: 'btn btn-info'
    end
  end

  def cancel_link(order)
    if order.can_cancel?
      link_to t('views.my_orders.cancel'), cancel_user_order_path(order),
              data: {confirm: t('confirmations.my_orders.cancel')},
              class: 'btn',
              method: 'put'
    end
  end

  def request_refund_link(order)
    if order.can_request_refund?
      link_to t('views.my_orders.request_refund'), request_refund_user_order_path(order),
              data: {confirm: t('confirmations.my_orders.refund')},
              class: 'btn',
              method: 'put'
    end
  end

  def operations(order)
    [pay_link(order), cancel_link(order), request_refund_link(order)].compact.join(' | ').html_safe
  end

  def orders_filtered?
    params[:event_id].present?
  end
end


text:
package org.sdgas.model;

import org.sdgas.util.ExcelResources;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by 120378 on 2015-03-03.
 */

@Entity
public class Contract {

    /**
     * 合同编号
     */
    private String contractId;

    /**
     * 合同名称
     */
    private ContractName contractName;

    /**
     * 合同金额
     */
    private double contractMoney = 0.0;

    /**
     * 单价金额
     */
    private double unit_price = 0.0d;

    /**
     * 合同版本
     * 0:非格式合同  1:格式合同
     */
    private int version;

    /**
     * 合同版本提供
     * 0我司  1外单位
     */
    private int contractProvide;

    /**
     * 履约保证金/质保金
     */
    private double performanceBond = 0.0d;

    /**
     * 质保金到期日期
     */
    private Date duePerformanceBond;

    /**
     * 质保期
     */
    private GuaranteePeriod guaranteePeriod;

    /**
     * 合同类别
     */
    private ContractType contractType;

    /**
     * 会签日期
     */
    private Date signContractDate;

    /**
     * 验收日期
     */
    private Date acceptance;

    /**
     * 咨询律师
     * 1是 0否
     */
    private int lawer;

    /**
     * 发票
     */
    private int invoice;

    /**
     * 采购方式
     * 0公开招标  1依法邀请招标  2内部邀请招标  3直接发包  4询价比价  5其他
     */
    private BiddingType biddingType;

    /**
     * 合同生效日期
     */
    private Date contractBeginDate;

    /**
     * 合同到期日期
     */
    private Date contractEndDate;

    /**
     * 合同经办人
     */
    private String contractOperator;

    /**
     * 合同原件份数
     */
    private int count;

    /**
     * 签约公司
     */
    private String contractSignCompany;

    /**
     * 预算  0预算内,1预算外
     */
    private Budget budget;

    /**
     * 预算类别
     */
    private String budgetType;

    /**
     * 预算外
     */
    private int outBudget;

    /**
     * 预算剩下金额
     */
    private double budgetMoney = 0.0d;

    /**
     * 审结日期(提交到招采部时间)
     */
    private Date contractCloseDate ;

    /**
     * 印花税 0未购买 1已购买 2无须购买
     */
    private int stampTax;

    /**
     * 支持文件
     */
    private String supportFile;

    /**
     * 经办部门
     */
    private Department department;

    /**
     * 合同属性
     * 0新签,1续签,2改签,3注销
     */
    private ContractProperty contractProperty;

    /**
     * 合同主要内容
     */
    private String mainContent;

    /**
     * 应收(付)金额
     */
    private Double receivableOrPayMoney = 0.0d;

    /**
     * 收、付标识   0付款  1收款
     */
    private ReceiveOrPay receivableOrPay;

    /**
     * 应收(付)时间
     */
    private String paymentDate;

    /**
     * 是否超结算  0否 1是,已审核  2是,未审核
     */
    private SettleAccount settleAccount;

    /**
     * 款项类型   0工程费  1履约保证金  2履约保函  3咨询费  4容量气价  5款货  6租赁费  7培训费  -1其他
     */
    private String paymentType;

    /**
     * 是否盖章
     * 0未盖章   1已盖章
     */
    private int stamp;

    /**
     * 备注
     */
    private String remark;

    /**
     * 合同状态
     */
    private ContractState state;

    @Id
    @ExcelResources(order = 2, title = "合同编号")
    public String getContractId() {
        return contractId;
    }

    public void setContractId(String contractId) {
        this.contractId = contractId;
    }

    @ManyToOne
    @JoinColumn(name = "contractName")
    @ExcelResources(order = 1, title = "合同名称")
    public ContractName getContractName() {
        return contractName;
    }

    public void setContractName(ContractName contractName) {
        this.contractName = contractName;
    }

    @ManyToOne
    @JoinColumn(name = "department")
    @ExcelResources(order = 9, title = "经办部门")
    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    //precision表示数值的总长度,scale表示小数点所占的位数
    @Column(precision = 12, scale = 2, nullable = false)
    @ExcelResources(order = 4, title = "合同签订金额")
    public double getContractMoney() {
        return contractMoney;
    }

    public void setContractMoney(double contractMoney) {
        this.contractMoney = contractMoney;
    }

    @Column(precision = 8, scale = 2, nullable = false)
    public double getPerformanceBond() {
        return performanceBond;
    }

    public void setPerformanceBond(double performanceBond) {
        this.performanceBond = performanceBond;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(nullable = false)
    public Date getSignContractDate() {
        return signContractDate;
    }

    public void setSignContractDate(Date signContractDate) {
        this.signContractDate = signContractDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(nullable = false)
    @ExcelResources(order = 5, title = "合同生效日期")
    public Date getContractBeginDate() {
        return contractBeginDate;
    }

    public void setContractBeginDate(Date contractBeginDate) {
        this.contractBeginDate = contractBeginDate;
    }

    @Temporal(TemporalType.DATE)
    @ExcelResources(order = 6, title = "合同到期日期")
    public Date getContractEndDate() {
        return contractEndDate;
    }

    public void setContractEndDate(Date contractEndDate) {
        this.contractEndDate = contractEndDate;
    }

    @Column(nullable = false, length = 10)
    @ExcelResources(order = 7, title = "经办人")
    public String getContractOperator() {
        return contractOperator;
    }

    public void setContractOperator(String contractOperator) {
        this.contractOperator = contractOperator;
    }

    @Column(length = 150)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(length = 300, nullable = false)
    public String getMainContent() {
        return mainContent;
    }

    public void setMainContent(String mainContent) {
        this.mainContent = mainContent;
    }

    @ManyToOne
    @JoinColumn(name = "type")
    public ContractType getContractType() {
        return contractType;
    }

    public void setContractType(ContractType contractType) {
        this.contractType = contractType;
    }

    @Enumerated(EnumType.ORDINAL)
    public ContractProperty getContractProperty() {
        return contractProperty;
    }

    public void setContractProperty(ContractProperty contractProperty) {
        this.contractProperty = contractProperty;
    }

    @Enumerated(EnumType.ORDINAL)
    public Budget getBudget() {
        return budget;
    }

    public void setBudget(Budget budget) {
        this.budget = budget;
    }

    @Column(length = 4, nullable = false)
    @ExcelResources(order = 8, title = "合同原件份数")
    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Temporal(TemporalType.DATE)
    @ExcelResources(order = 10, title = "归档月份")
    public Date getContractCloseDate() {
        return contractCloseDate;
    }

    public void setContractCloseDate(Date contractCloseDate) {
        this.contractCloseDate = contractCloseDate;
    }

    @Column(length = 15)
    public String getBudgetType() {
        return budgetType;
    }

    public void setBudgetType(String budgetType) {
        this.budgetType = budgetType;
    }

    @Column(precision = 12, scale = 2)
    public double getBudgetMoney() {
        return budgetMoney;
    }

    public void setBudgetMoney(double budgetMoney) {
        this.budgetMoney = budgetMoney;
    }

    @Column(length = 255)
    @ExcelResources(order = 3, title = "签约对象")
    public String getContractSignCompany() {
        return contractSignCompany;
    }

    public void setContractSignCompany(String contractSignCompany) {
        this.contractSignCompany = contractSignCompany;
    }

    @Enumerated(EnumType.ORDINAL)
    public BiddingType getBiddingType() {
        return biddingType;
    }

    public void setBiddingType(BiddingType biddingType) {
        this.biddingType = biddingType;
    }

    @Enumerated(EnumType.ORDINAL)
    public GuaranteePeriod getGuaranteePeriod() {
        return guaranteePeriod;
    }

    public void setGuaranteePeriod(GuaranteePeriod guaranteePeriod) {
        this.guaranteePeriod = guaranteePeriod;
    }

    public int getStampTax() {
        return stampTax;
    }

    public void setStampTax(int stampTax) {
        this.stampTax = stampTax;
    }

    @Column(precision = 12, scale = 2, nullable = false)
    public Double getReceivableOrPayMoney() {
        return receivableOrPayMoney;
    }

    public void setReceivableOrPayMoney(Double receivableOrPayMoney) {
        this.receivableOrPayMoney = receivableOrPayMoney;
    }

    @Enumerated(EnumType.ORDINAL)
    public ReceiveOrPay getReceivableOrPay() {
        return receivableOrPay;
    }

    public void setReceivableOrPay(ReceiveOrPay receivableOrPay) {
        this.receivableOrPay = receivableOrPay;
    }

    @Column(precision = 12, scale = 2, nullable = false)
    public double getUnit_price() {
        return unit_price;
    }

    public void setUnit_price(double unit_price) {
        this.unit_price = unit_price;
    }

    @Enumerated(EnumType.ORDINAL)
    public SettleAccount getSettleAccount() {
        return settleAccount;
    }

    public void setSettleAccount(SettleAccount settleAccount) {
        this.settleAccount = settleAccount;
    }

    @Column(length = 4)
    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Column(length = 4)
    public int getStamp() {
        return stamp;
    }

    public void setStamp(int stamp) {
        this.stamp = stamp;
    }

    @Column(length = 255)
    public String getSupportFile() {
        return supportFile;
    }

    public void setSupportFile(String supportFile) {
        this.supportFile = supportFile;
    }

    @Column(length = 4)
    public int getInvoice() {
        return invoice;
    }

    public void setInvoice(int invoice) {
        this.invoice = invoice;
    }

    public String getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    public int getContractProvide() {
        return contractProvide;
    }

    public void setContractProvide(int contractProvide) {
        this.contractProvide = contractProvide;
    }

    @Temporal(TemporalType.DATE)
    public Date getDuePerformanceBond() {
        return duePerformanceBond;
    }

    public void setDuePerformanceBond(Date duePerformanceBond) {
        this.duePerformanceBond = duePerformanceBond;
    }

    @Temporal(TemporalType.DATE)
    public Date getAcceptance() {
        return acceptance;
    }

    public void setAcceptance(Date acceptance) {
        this.acceptance = acceptance;
    }

    public int getLawer() {
        return lawer;
    }

    public void setLawer(int lawer) {
        this.lawer = lawer;
    }

    @Enumerated(EnumType.ORDINAL)
    public ContractState getState() {
        return state;
    }

    public void setState(ContractState state) {
        this.state = state;
    }

    @Column(length = 100, nullable = false)
    public String getPaymentDate() {
        return paymentDate;
    }

    public void setPaymentDate(String paymentDate) {
        this.paymentDate = paymentDate;
    }

    public int getOutBudget() {
        return outBudget;
    }

    public void setOutBudget(int outBudget) {
        this.outBudget = outBudget;
    }
}


text:
package org.jhw.keep.app.fragments;

import java.util.ArrayList;
import java.util.List;

import org.jhw.keep.Constants;
import org.jhw.keep.R;
import org.jhw.keep.app.activities.ReadActivity;
import org.jhw.keep.app.adapters.MyCoverAdapter;
import org.jhw.keep.app.adapters.MyFeedAdapter;
import org.jhw.keep.cache.ImageCache.ImageCacheParams;
import org.jhw.keep.cache.ImageFetcher;
import org.jhw.keep.datatype.MyFeed;
import org.jhw.keep.datatype.MyFeedItem;
import org.jhw.keep.parser.FeedResult;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.AdapterView;
import android.widget.GridView;

public class CoverFragment extends Fragment implements AdapterView.OnItemClickListener{
    private static final String IMAGE_CACHE_DIR = "thumbs";

    private int mImageThumbSize;
    private int mImageThumbSpacing;
    private ImageFetcher mImageFetcher;

    private MyFeed mFeed;
    private List<MyFeedItem> data = new ArrayList<MyFeedItem>();
    FeedResult result;
    MyCoverAdapter mAdapter;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		mAdapter = new MyCoverAdapter(getActivity());

		initImageCache();
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		final View v = inflater.inflate(R.layout.cover, container, false);
		final GridView gridView = (GridView) v.findViewById(R.id.cover_view);
		gridView.setAdapter(mAdapter);
		gridView.setOnItemClickListener(this);
		// This listener is used to get the final width of the GridView and then calculate the
        // number of columns and the width of each column. The width of each column is variable
        // as the GridView has stretchMode=columnWidth. The column width is used to set the height
        // of each view so we get nice square thumbnails.
		gridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {

			@SuppressLint("NewApi")
			@Override
			public void onGlobalLayout() {
				if (mAdapter.getmNumColumns() == 0) {
					final int numColumns = (int)Math.floor(gridView.getWidth() / (mImageThumbSize + mImageThumbSpacing));

					if (numColumns > 0) {
						final int columnWidth = (gridView.getWidth() / numColumns) - mImageThumbSpacing;
						mAdapter.setmNumColumns(numColumns);
						mAdapter.setmItemHeight(columnWidth);
						Log.d(Constants.LOG_TAG, "columnWidth:" + columnWidth);
						gridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
					}
				}
			}
		});
		return v;
	}

	private void initImageCache() {
		// init image cache
		mImageThumbSize = getResources().getDimensionPixelSize(R.dimen.image_thumbnail_size);
		mImageThumbSpacing = getResources().getDimensionPixelSize(R.dimen.image_thumbnail_spacing);
		ImageCacheParams cacheParams = new ImageCacheParams(getActivity(), IMAGE_CACHE_DIR);
		cacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of app memory
		mImageFetcher = new ImageFetcher(getActivity(), mImageThumbSize);
		mImageFetcher.setLoadingImage(R.drawable.ati);
		mImageFetcher.addImageCache(getActivity().getSupportFragmentManager(), cacheParams);

	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id) {
		Log.e("org.jhw.keep", "gridView onItemClick");
		startActivity(new Intent(getActivity(), ReadActivity.class));
	}

}


text:
using System;
using Mono.Cecil;
using Mono.Cecil.Cil;

namespace TestNess.Lib
{
    public class MethodCall
    {
        public readonly Instruction Instruction;
        public readonly MethodReference MethodReference;

        public MethodCall(Instruction i, MethodReference m)
        {
            Instruction = i;
            MethodReference = m;
        }

        public MethodDefinition MethodDefinition
        {
            get
            {
                if (!MethodReference.IsDefinition)
                    throw new InvalidOperationException("Method is not a definition.");
                return MethodReference as MethodDefinition;
            }
        }

        public bool HasMethodDefinition
        {
            get { return MethodReference.IsDefinition; }
        }

        protected bool Equals(MethodCall other)
        {
            return Equals(Instruction, other.Instruction);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((MethodCall) obj);
        }

        public override int GetHashCode()
        {
            return (Instruction != null ? Instruction.GetHashCode() : 0);
        }
    }
}


text:
//
//  XQQLookGroupCell.h
//  XQQChatProj
//
//  Created by XQQ on 2016/12/6.
//  Copyright © 2016年 UIP. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface XQQLookGroupCell : UITableViewCell
+ (instancetype)cellForTableView:(UITableView*)tableView
                       indexPath:(NSIndexPath*)indexPath;
/** 群组 */
@property(nonatomic, strong)  EMGroup  *  group;

@end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Reflection;
using Xunit.Sdk;

namespace System.Linq.Expressions.Tests
{
    internal class InlinePerCompilationTypeAttribute : DataAttribute
    {
        private static readonly object[] s_boxedBooleans =
        {
            false,
#if FEATURE_COMPILE && FEATURE_INTERPRET
            true
#endif
        };

        private readonly object[] _data;

        public InlinePerCompilationTypeAttribute(params object[] data)
        {
            _data = data;
        }

        public override IEnumerable<object[]> GetData(MethodInfo testMethod)
        {
            // Re-using the arrays would be a nice optimization, and safe since this is internal and we could
            // just not do the sort of uses that would break that, but xUnit pre-loads GetData() results and
            // we'd therefore end up with multiple copies of the last result.
            foreach (object compilationType in s_boxedBooleans)
            {
                object[] withType = new object[_data.Length + 1];
                _data.CopyTo(withType, 0);
                withType[withType.Length - 1] = compilationType;
                yield return withType;
            }
        }
    }
}


text:
Source({name:"sourcetransformfile", namespace:"file.users"})
//Save all users
.save({name:"appbaseapp", namespace:"<APPNAME>.users"})

//Save just admin users
//.transform({filename: "./transform_admin.js", namespace:"."})
//.save({name:"appbaseapp", namespace:"<APPNAME>.admin"})

//Save just company names
//.transform({filename: "./transform_pickfields.js", namespace:"."})
//.save({name:"appbaseapp", namespace:"<APPNAME>.company"});


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

package adwords.axis.v201509.remarketing;

import com.google.api.ads.adwords.axis.factory.AdWordsServices;
import com.google.api.ads.adwords.axis.v201509.cm.OfflineConversionFeed;
import com.google.api.ads.adwords.axis.v201509.cm.OfflineConversionFeedOperation;
import com.google.api.ads.adwords.axis.v201509.cm.OfflineConversionFeedReturnValue;
import com.google.api.ads.adwords.axis.v201509.cm.OfflineConversionFeedServiceInterface;
import com.google.api.ads.adwords.axis.v201509.cm.Operator;
import com.google.api.ads.adwords.lib.client.AdWordsSession;
import com.google.api.ads.common.lib.auth.OfflineCredentials;
import com.google.api.ads.common.lib.auth.OfflineCredentials.Api;
import com.google.api.client.auth.oauth2.Credential;

/**
 * This code example imports offline conversion values for specific clicks to
 * your account. To get Google Click ID for a click, run
 * CLICK_PERFORMANCE_REPORT. To set up a conversion tracker, run the
 * AddConversionTracker.java example.
 */
public class UploadOfflineConversions {

  public static void main(String[] args) throws Exception {
    // Generate a refreshable OAuth2 credential.
    Credential oAuth2Credential = new OfflineCredentials.Builder()
        .forApi(Api.ADWORDS)
        .fromFile()
        .build()
        .generateCredential();

    // Construct an AdWordsSession.
    AdWordsSession session = new AdWordsSession.Builder()
        .fromFile()
        .withOAuth2Credential(oAuth2Credential)
        .build();

    AdWordsServices adWordsServices = new AdWordsServices();

    // Name of the conversion tracker to upload to.
    String conversionName = "INSERT_CONVERSION_NAME_HERE";

    // Google Click ID should be newer than 30 days.
    String gClId = "INSERT_GOOGLE_CLICK_ID_HERE";

    // Conversion time should be after the click time.
    String conversionTime = "INSERT_CONVERSION_TIME_HERE";
    Double conversionValue = Double.valueOf("INSERT_CONVERSION_VALUE_HERE");

    runExample(adWordsServices, session, conversionName, gClId, conversionTime, conversionValue);
  }

  public static void runExample(AdWordsServices adWordsServices, AdWordsSession session,
      String conversionName, String gClid, String conversionTime,
      double conversionValue) throws Exception {

    // Get the OfflineConversionFeedService.
    OfflineConversionFeedServiceInterface offlineConversionFeedService =
        adWordsServices.get(session, OfflineConversionFeedServiceInterface.class);

    // Associate offline conversions with the existing named conversion tracker. If this tracker
    // was newly created, it may be a few hours before it can accept conversions.
    OfflineConversionFeed feed = new OfflineConversionFeed();
    feed.setConversionName(conversionName);
    feed.setConversionTime(conversionTime);
    feed.setConversionValue(conversionValue);
    feed.setGoogleClickId(gClid);

    OfflineConversionFeedOperation offlineConversionOperation =
        new OfflineConversionFeedOperation();
    offlineConversionOperation.setOperator(Operator.ADD);
    offlineConversionOperation.setOperand(feed);

    OfflineConversionFeedReturnValue offlineConversionReturnValue = offlineConversionFeedService
        .mutate(new OfflineConversionFeedOperation[] {offlineConversionOperation});

    OfflineConversionFeed newFeed = offlineConversionReturnValue.getValue(0);

    System.out.printf(
        "Uploaded offline conversion value of %.4f for Google Click ID '%s' to '%s'.%n",
        newFeed.getConversionValue(), newFeed.getGoogleClickId(), newFeed.getConversionName());
  }
}


text:
class MessagesFlowsTest < ActionDispatch::IntegrationTest

  def setup
    @name = 'Alex'
    @email = 'yay@gmail.com'
    @password = '54321'
    @message = 'This is a text message '
    post '/api/v1/users', :user => {:name => @name, :email => @email, :password => @password}
    create_user_json_response = ActiveSupport::JSON.decode response.body
    assert_not_nil create_user_json_response

    basic = ActionController::HttpAuthentication::Basic
    credentials = basic.encode_credentials(@email, @password)
    get '/api/v1/sessions', nil, {'Authorization': credentials}
    authorization_json_response = ActiveSupport::JSON.decode response.body
    @auth_token = authorization_json_response['auth_token']

    @message_id = Message.create(sender_id: 12345, text: @message).id
  end

  def teardown
    User.delete_all
    Message.delete_all
  end

  test 'should get message by id' do
    get "/api/v1/messages/#{@message_id}", nil, {'X-Api-Key': @auth_token}
    get_json_response = ActiveSupport::JSON.decode response.body

    assert_equal "#{@message_id}", get_json_response['data']['id']
    assert_equal '200', response.code
  end

  test 'should not get message by id when API key header is not set' do
    get "/api/v1/messages/#{@message_id}"
    error_json_response = ActiveSupport::JSON.decode response.body

    assert_not_nil error_json_response
    assert_equal 'X-Api-Key header is not set', error_json_response['description']
    assert_equal 401, error_json_response['code']
    assert_equal '401', response.code
  end

end


text:
class Surplus < Condition
  def qty
    begin
      surplus_individual.to_i || 0
    rescue
      return 0
    end
  end
  def qty=(n)
    write_attribute("surplus_individual", n)
  end
end


text:
package org.onosproject.netl3vpn.manager.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.onosproject.ne.Bgp;
import org.onosproject.ne.BgpImportProtocol;
import org.onosproject.ne.BgpImportProtocol.ProtocolType;
import org.onosproject.ne.NeData;
import org.onosproject.ne.VpnAc;
import org.onosproject.ne.VpnInstance;
import org.onosproject.ne.VrfEntity;
import org.onosproject.net.AnnotationKeys;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Port;
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceService;
import org.onosproject.netl3vpn.entity.NetL3VpnAllocateRes;
import org.onosproject.netl3vpn.entity.WebAc;
import org.onosproject.netl3vpn.entity.WebNetL3vpnInstance;

/**
 * L3vpn network decompose configuration handler.
 */
public final class NetL3vpnDecompHandler {
    private static NetL3vpnDecompHandler netL3vpnDecompHandler = null;
    private NetL3VpnAllocateRes l3VpnAllocateRes;
    private DeviceService deviceService;

    /**
     * Initializes default values.
     */
    private NetL3vpnDecompHandler() {
    }

    /**
     * Returns single instance of this class.
     *
     * @return this class single instance
     */
    public static NetL3vpnDecompHandler getInstance() {
        if (netL3vpnDecompHandler == null) {
            netL3vpnDecompHandler = new NetL3vpnDecompHandler();
        }
        return netL3vpnDecompHandler;
    }

    /**
     * Initialization the allocate resource entity and device service.
     *
     * @param l3VpnAllocateRes the allocate resource entity
     * @param deviceService device service
     */
    public void initialize(NetL3VpnAllocateRes l3VpnAllocateRes,
                           DeviceService deviceService) {
        this.l3VpnAllocateRes = l3VpnAllocateRes;
        this.deviceService = deviceService;
    }

    /**
     * Decompose the l3vpn network instance to network element data.
     *
     * @param webNetL3vpnInstance the l3vpn network instance
     * @return network element data
     */
    public NeData decompNeData(WebNetL3vpnInstance webNetL3vpnInstance) {
        List<VpnInstance> vpnInstanceList = new ArrayList<VpnInstance>();
        List<VpnAc> vpnAcList = new ArrayList<VpnAc>();

        Map<String, List<String>> acIdsByNeMap = new HashMap<String, List<String>>();
        Map<String, List<WebAc>> acsByNeMap = new HashMap<String, List<WebAc>>();
        for (WebAc webAc : webNetL3vpnInstance.getAcList()) {
            String neId = webAc.getNeId();
            List<String> acIdsByNeList = acIdsByNeMap.get(neId);
            if (acIdsByNeList == null) {
                acIdsByNeList = new ArrayList<String>();
            }
            acIdsByNeList.add(webAc.getId());
            acIdsByNeMap.put(neId, acIdsByNeList);
            List<WebAc> acsByNeList = acsByNeMap.get(neId);
            if (acsByNeList == null) {
                acsByNeList = new ArrayList<WebAc>();
            }
            acsByNeList.add(webAc);
            acsByNeMap.put(neId, acsByNeList);
        }

        vpnInstanceList = decompVpnInstance(acIdsByNeMap, webNetL3vpnInstance);
        vpnAcList = decompVpnAc(acsByNeMap, webNetL3vpnInstance);
        return new NeData(vpnInstanceList, vpnAcList);
    }

    /**
     * Decompose the l3vpn network instance to list of vpn instance.
     *
     * @param acIdsByNeMap a map of ac ids to each ne
     * @param webNetL3vpnInstance the l3vpn network instance
     * @return list of vpn instance
     */
    public List<VpnInstance> decompVpnInstance(Map<String, List<String>> acIdsByNeMap,
                                               WebNetL3vpnInstance webNetL3vpnInstance) {
        List<VpnInstance> vpnInstanceList = new ArrayList<VpnInstance>();
        for (String neId : webNetL3vpnInstance.getNeIdList()) {
            String vrfName = l3VpnAllocateRes.getVrfName();
            String netVpnId = webNetL3vpnInstance.getId();
            String routeDistinguisher = l3VpnAllocateRes
                    .getRouteDistinguisherMap().get(neId);
            List<String> importTargets = l3VpnAllocateRes.getRouteTargets();
            List<String> exportTargets = l3VpnAllocateRes.getRouteTargets();
            List<String> acIdList = acIdsByNeMap.get(neId);

            BgpImportProtocol bgpImportProtocol = new BgpImportProtocol(ProtocolType.DIRECT, "0");
            List<BgpImportProtocol> importProtocols = new ArrayList<BgpImportProtocol>();
            importProtocols.add(bgpImportProtocol);
            Bgp bgp = new Bgp(importProtocols);

            VrfEntity vrfEntity = new VrfEntity(vrfName, netVpnId,
                                                routeDistinguisher,
                                                importTargets, exportTargets,
                                                acIdList, bgp);
            List<VrfEntity> vrfList = new ArrayList<VrfEntity>();
            vrfList.add(vrfEntity);
            VpnInstance vpnInstance = new VpnInstance(neId, vrfList);
            vpnInstanceList.add(vpnInstance);
        }
        return vpnInstanceList;
    }

    /**
     * Decompose the l3vpn network instance to list of vpn ac.
     *
     * @param acsByNeMap a map of ac entities to each ne
     * @param webNetL3vpnInstance the l3vpn network instance
     * @return list of vpn ac
     */
    public List<VpnAc> decompVpnAc(Map<String, List<WebAc>> acsByNeMap,
                                   WebNetL3vpnInstance webNetL3vpnInstance) {
        List<VpnAc> vpnAcList = new ArrayList<VpnAc>();
        String netVpnId = webNetL3vpnInstance.getId();
        for (String neId : webNetL3vpnInstance.getNeIdList()) {
            List<WebAc> webAcList = acsByNeMap.get(neId);
            for (WebAc webAc : webAcList) {
                String acId = webAc.getId();
                Port port = deviceService
                        .getPort(DeviceId.deviceId(neId),
                                 PortNumber.portNumber(webAc.getL2Access()
                                         .getPort().getLtpId()));
                String acName = port.annotations()
                        .value(AnnotationKeys.PORT_NAME);
                String ipAddress = webAc.getL3Access().getAddress();
                int subNetMask = Integer.parseInt(webAc.getL3Access()
                        .getAddress().split("/")[1]);
                VpnAc vpnAc = new VpnAc(netVpnId, acId, acName, ipAddress,
                                        subNetMask);
                vpnAcList.add(vpnAc);
            }
        }
        return vpnAcList;
    }
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>Pertiwigroup | Online Inventory System</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

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

        <link href="../../css/font-awesome.min.css" rel="stylesheet" type="text/css" />

        <link href="../../css/ionicons.min.css" rel="stylesheet" type="text/css" />

        <link href="../../css/AdminLTE.css" rel="stylesheet" type="text/css" />

        <link href="../../css/timepicker/bootstrap-timepicker.min.css" type="text/css" />

        <link href="../../css/datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet"/>
        <link href="../../css/customstyle.css" rel="stylesheet" type="text/css" />

                Inventory System

                    Toggle navigation

                                10

You have 10 notifications

                                                 5 new members joined today

                                                 Very long description here that may not fit into the page and may cause design problems

                                                 5 new members joined

                                                 25 sales made

                                                 You changed your username

View all

                                Sabekti Anggara

                                        Sabekti Anggara - Web Developer
                                        Member Sejak Nov. 2012

                                        Followers

                                        Sales

                                        Friends

                                        Profile

                                        Sign out

Hello, Sabekti

                             Online

                    <form action="#" method="get" class="sidebar-form">

                            <input type="text" name="q" class="form-control" placeholder="Search..."/>

                                <button type='submit' name='seach' id='search-btn' class="btn btn-flat"></button>

                    </form>

                                 Dashboard

                                 Index Asset

                                Charts

 Morris

 Flot

 Inline charts

                                UI Elements

 General

 Icons

 Buttons

 Sliders

 Timeline

                                 Forms

 General Elements

 Advanced Elements

 Editors

                                 Tables

 Simple tables

 Data tables

                                 Calendar
                                3

                                 Mailbox
                                12

                                 Examples

 Invoice

 Login

 Register

 Lockscreen

 404 Error

 500 Error

 Blank Page

                        Tambah Asset
                        Modul tambah aset

 Home

Tambah Aset

Tambah Aset

                                    <form role="form">

                                            Kode Aset
                                            <input type="text" class="form-control" placeholder="Autogenerated" disabled>

                                        Tanggal Beli

                                            <input data-format="dd-MM-yyyy" type="text">

                                            Nama Asset
                                            <textarea class="form-control" rows="3" placeholder="Nama & Deskripsi Aset"></textarea>

                                            Kategori
                                            <select class="form-control">
                                                <option>CPU</option>
                                                <option>Monitor</option>
                                                <option>Printer</option>
                                                <option>Proyektor</option>
                                            </select>
                                            <button type="submit" class="btn btn-primary">Tambah Kategori</button>

                                            Vendor
                                            <input type="text" class="form-control" placeholder="Nama Vendor">

                                            Serial Number
                                            <input type="text" class="form-control" placeholder="Serial Number">

                                        Garansi

                                            <input data-format="dd-MM-yyyy" type="text" placeholder="tanggal berahir garansi">

                                            Jumlah
                                            <input type="text" class="form-control" placeholder="Jumlah Penambahan Aset">

                                            Gambar
                                            <input type="file" id="attachment">

Masukkan Gambar.

                                            Lokasi
                                            <input type="text" class="form-control" placeholder="Lokasi item (diisi maka aset akan langsung dimutasi)">

                                            Status
                                            <select class="form-control">
                                                <option>Aktif</option>
                                                <option>Tidak Aktif</option>
                                                <option>Servis</option>
                                                <option>Rusak</option>
                                            </select>

                                        <button type="submit" class="btn btn-primary">Submit</button>
                                        <button type="submit" class="btn btn-danger">Batal</button>
                                    </form>


text:
import unittest

try:
    from unittest.mock import patch, MagicMock
except ImportError:
    from mock import patch, MagicMock

from armus.migrations import apply_new, revert_last

class TestApplyNewMigrations(unittest.TestCase):

        @patch('os.listdir')
        @patch('armus.migrations._import_module')
        def test_applies_all_new_migrations(self, mock_import_module, mock_listdir):
            # this list comes from the database
            some_module = MagicMock()
            applied_migrations = []
            test_directory_listing = [
                "migration_20121016182212_second_thing.py",
                "migration_20121016152357_first_thing.py",
                "im_not_a_migration_file.py"
            ]

            mock_listdir.return_value = test_directory_listing
            mock_import_module.return_value = some_module

            migrations_run = apply_new("this/is/some_path", applied_migrations)

            self.assertEqual([
                "migration_20121016152357_first_thing",
                "migration_20121016182212_second_thing",
            ], migrations_run)
            self.assertEqual(2, mock_import_module.return_value.up.call_count)

        @patch('os.listdir')
        @patch('importlib.import_module')
        def test_applies_some_new_migrations(self, mock_import_module, mock_listdir):
            # this list comes from the database
            applied_migrations = ["migration_20121016152357_first_thing"]
            test_directory_listing = [
                "migration_20121016182212_second_thing.py",
                "migration_20121016152357_first_thing.py",
                "im_not_a_migration_file.py"
            ]

            mock_listdir.return_value = test_directory_listing

            migrations_run = apply_new("this/is/some_path", applied_migrations, test="test")

            mock_import_module.assert_called_with('some_path.migration_20121016182212_second_thing')
            self.assertEqual([
                "migration_20121016182212_second_thing",
            ], migrations_run)
            mock_import_module.return_value.up.assert_called_with(test="test")
            self.assertEqual(1, mock_import_module.return_value.up.call_count)

        @patch('os.listdir')
        @patch('importlib.import_module')
        def test_applies_no_new_migrations(self, mock_import_module, mock_listdir):
            # this list comes from the database
            applied_migrations = [
                "migration_20121016152357_first_thing",
                "migration_20121016182212_second_thing",
            ]
            test_directory_listing = [
                "migration_20121016182212_second_thing.py",
                "migration_20121016152357_first_thing.py",
                "im_not_a_migration_file.py"
            ]

            mock_listdir.return_value = test_directory_listing

            migrations_run = apply_new("this/is/some_path", applied_migrations)

            self.assertEqual(0, mock_import_module.call_count)
            self.assertEqual([], migrations_run)
            self.assertEqual(0, mock_import_module.return_value.up.call_count)

        @patch('os.listdir')
        @patch('armus.migrations._import_module')
        def test_reverts_most_recent_migration(self, mock_import_module, mock_listdir):
            some_module = MagicMock()
            pre_revert_migrations = [
                "migration_20121016152357_first_thing.py",
                "migration_20121016182212_second_thing.py",
            ]

            expected_migration = "migration_20121016182212_second_thing.py"

            test_directory_listing = [
                "migration_20121016182212_second_thing.py",
                "migration_20121016152357_first_thing.py",
                "im_not_a_migration_file.py"
            ]

            mock_listdir.return_value = test_directory_listing
            mock_import_module.return_value = some_module

            reverted_migration = revert_last(
                "/this/is/some/path", pre_revert_migrations, test="test")

            mock_import_module.return_value.down.assert_called_with(test="test")
            self.assertEqual(expected_migration, reverted_migration)


text:
package swagger

import (
	"github.com/go-openapi/spec"
	types    "github.com/xuybin/go-mysql-api/types"
)

func GenSwaggerFromDBMetadata(dbMetadata *types.DataBaseMetadata) (s *spec.Swagger) {
	s = &spec.Swagger{}
	s.SwaggerProps = spec.SwaggerProps{}
	s.Swagger = "2.0"
	s.Schemes = []string{"http"}
	s.Tags = GetTagsFromDBMetadata(dbMetadata)
	s.Info = NewSwaggerInfo(dbMetadata, "1.0.0")
	s.Definitions = SwaggerDefinationsFromDabaseMetadata(dbMetadata)
	s.Paths = &spec.Paths{Paths: SwaggerPathsFromDatabaseMetadata(dbMetadata)}
	return
}


text:
Sequel.migration do
  change do
    create_table(:accounts) do
      String :id, size: 50
      foreign_key :wallet_id, :wallets, type: "varchar(250)"
      Integer :order, index: true
      String :private_key, size: 250
      String :public_key, size: 250
      String :address, size: 250
      primary_key [:wallet_id, :id], name: :accounts_pk
    end
  end
end


text:
/*jslint indent: 2, unparam: true*/
/*global $: false, createTag: false, togglbutton: false*/

'use strict';

togglbutton.render('#frmMain', {}, function (elem) {
  var link, liTag;

  link = togglbutton.createTimerLink({
    className: 'xero',
    projectName: 'Finance',
    description: $('#frmMain h1').textContent.trim()
  });

  liTag = createTag("li", "xn-h-menu");
  liTag.appendChild(link);
  $('.xn-h-header-tabs ul').appendChild(liTag);
});


text:
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;

namespace System.Linq.Parallel
{
    /// <summary>
    /// This class is common to all of the "inlined" versions of various aggregations.  The
    /// inlined operators ensure that real MSIL instructions are used to perform elementary
    /// operations versus general purpose delegate-based binary operators.  For obvious reasons
    /// this is a quite bit more efficient, although it does lead to a fair bit of unfortunate
    /// code duplication.
    /// </summary>
    /// <typeparam name="TSource"></typeparam>
    /// <typeparam name="TIntermediate"></typeparam>
    /// <typeparam name="TResult"></typeparam>
    internal abstract class InlinedAggregationOperator<TSource, TIntermediate, TResult> :
        UnaryQueryOperator<TSource, TIntermediate>
    {
        //---------------------------------------------------------------------------------------
        // Constructs a new instance of an inlined sum associative operator.
        //

        internal InlinedAggregationOperator(IEnumerable<TSource> child)
            : base(child)
        {
            Debug.Assert(child != null, "child data source cannot be null");
        }

        //---------------------------------------------------------------------------------------
        // Executes the entire query tree, and aggregates the intermediate results into the
        // final result based on the binary operators and final reduction.
        //
        // Return Value:
        //     The single result of aggregation.
        //

        internal TResult Aggregate()
        {
            TResult tr;
            Exception toThrow = null;

            try
            {
                tr = InternalAggregate(ref toThrow);
            }
#if SUPPORT_THREAD_ABORT
            catch (ThreadAbortException)
            {
                // Do not wrap ThreadAbortExceptions
                throw;
            }
#endif
            catch (Exception ex)
            {
                // If the exception is not an aggregate, we must wrap it up and throw that instead.
                if (!(ex is AggregateException))
                {
                    //
                    // Special case: if the query has been canceled, we do not want to wrap the
                    // OperationCanceledException with an AggregateException.
                    //
                    // The query has been canceled iff these conditions hold:
                    // -  The exception thrown is OperationCanceledException
                    // -  We find the external CancellationToken for this query in the OperationCanceledException
                    // -  The externalToken is actually in the canceled state.

                    OperationCanceledException cancelEx = ex as OperationCanceledException;
                    if (cancelEx != null
                        && cancelEx.CancellationToken == SpecifiedQuerySettings.CancellationState.ExternalCancellationToken
                        && SpecifiedQuerySettings.CancellationState.ExternalCancellationToken.IsCancellationRequested)
                    {
                        throw;
                    }

                    throw new AggregateException(ex);
                }

                // Else, just rethrow the current active exception.
                throw;
            }

            // If the aggregation requested that we throw a singular exception, throw it.
            if (toThrow != null)
            {
                throw toThrow;
            }

            return tr;
        }

        //---------------------------------------------------------------------------------------
        // Performs the operator-specific aggregation.
        //
        // Arguments:
        //     singularExceptionToThrow - if the aggregate exception should throw an exception
        //                                without aggregating, this ref-param should be set
        //
        // Return Value:
        //     The single result of aggregation.
        //

        protected abstract TResult InternalAggregate(ref Exception singularExceptionToThrow);

        //---------------------------------------------------------------------------------------
        // Just opens the current operator, including opening the child and wrapping it with
        // partitions as needed.
        //

        internal override QueryResults<TIntermediate> Open(
            QuerySettings settings, bool preferStriping)
        {
            QueryResults<TSource> childQueryResults = Child.Open(settings, preferStriping);
            return new UnaryQueryOperatorResults(childQueryResults, this, settings, preferStriping);
        }

        internal override void WrapPartitionedStream<TKey>(
            PartitionedStream<TSource, TKey> inputStream, IPartitionedStreamRecipient<TIntermediate> recipient,
            bool preferStriping, QuerySettings settings)
        {
            int partitionCount = inputStream.PartitionCount;
            PartitionedStream<TIntermediate, int> outputStream = new PartitionedStream<TIntermediate, int>(
                partitionCount, Util.GetDefaultComparer<int>(), OrdinalIndexState.Correct);

            for (int i = 0; i < partitionCount; i++)
            {
                outputStream[i] = CreateEnumerator<TKey>(i, partitionCount, inputStream[i], null, settings.CancellationState.MergedCancellationToken);
            }
            recipient.Receive(outputStream);
        }

        protected abstract QueryOperatorEnumerator<TIntermediate, int> CreateEnumerator<TKey>(
            int index, int count, QueryOperatorEnumerator<TSource, TKey> source, object sharedData, CancellationToken cancellationToken);

        internal override IEnumerable<TIntermediate> AsSequentialQuery(CancellationToken token)
        {
            Debug.Fail("This method should never be called. Associative aggregation can always be parallelized.");
            throw new NotSupportedException();
        }

        //---------------------------------------------------------------------------------------
        // Whether this operator performs a premature merge that would not be performed in
        // a similar sequential operation (i.e., in LINQ to Objects).
        //

        internal override bool LimitsParallelism
        {
            get { return false; }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<artifactId>flink-parent</artifactId>
		<groupId>org.apache.flink</groupId>
		<version>1.10-SNAPSHOT</version>
		<relativePath>..</relativePath>
	</parent>

	<artifactId>flink-python_${scala.binary.version}</artifactId>
	<name>flink-python</name>

	<packaging>jar</packaging>

	<dependencies>

		<!-- core dependencies -->

		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-core</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-java</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-table-common</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>

		<!-- Python API dependencies -->

		<dependency>
			<groupId>net.sf.py4j</groupId>
			<artifactId>py4j</artifactId>
			<version>${py4j.version}</version>
		</dependency>
		<dependency>
			<groupId>net.razorvine</groupId>
			<artifactId>pyrolite</artifactId>
			<version>4.13</version>
			<exclusions>
				<exclusion>
					<groupId>net.razorvine</groupId>
					<artifactId>serpent</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>clean</id>
						<phase>clean</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<delete>
									<fileset dir="${project.basedir}/pyflink"
											 includes="**/*.pyc"/>
								</delete>
								<delete file="${project.basedir}/lib/pyflink.zip"/>
								<delete dir="${project.basedir}/target"/>
								<delete dir="${project.basedir}/build"/>
								<delete dir="${project.basedir}/dist"/>
								<delete dir="${project.basedir}/apache_flink.egg-info"/>
							</target>
						</configuration>
					</execution>
					<execution>
						<id>generate-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<delete>
									<fileset dir="${project.basedir}/pyflink"
											 includes="**/*.pyc"/>
								</delete>
								<delete file="${project.basedir}/lib/pyflink.zip"/>
								<zip destfile="${project.basedir}/lib/pyflink.zip">
									<fileset dir="${project.basedir}"
											 includes="pyflink/**/*"/>
								</zip>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<executions>
					<execution>
						<id>shade-flink</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<artifactSet>
								<includes combine.children="append">
									<include>net.razorvine:*</include>
									<include>net.sf.py4j:*</include>
								</includes>
							</artifactSet>
							<relocations combine.children="append">
								<relocation>
									<pattern>py4j</pattern>
									<shadedPattern>org.apache.flink.api.python.shaded.py4j</shadedPattern>
								</relocation>
								<relocation>
									<pattern>net.razorvine</pattern>
									<shadedPattern>org.apache.flink.api.python.shaded.net.razorvine</shadedPattern>
								</relocation>
							</relocations>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
This is the open FDA (U.S. Food & Drug Administration) data regarding the food events which consists of data regarding the events or reactions caused due to the usage of particular product.

## About Data

* Size: 45,3821 KB
* Format: JSON Files with total record of 64517.
* Sample Column Header :

It consists of two sections i.e. meta and results.

* meta - consists of desclaimer,a link to the openFDA data license, and information about the results that follow.
* results - consists of array of matching records for reactions, report_number, outcomes, products, date_created, date_started, consumer.

### File to Download
Since the data is larger than 100 MB that github allow to upload, data on food event can be downloaded from [https://open.fda.gov/downloads/](https://open.fda.gov/downloads/)

## License

This data is licensed under [FDA](https://open.fda.gov/license/).
As per FDA, "
The terms of service govern how you may access openFDA as a service. Use of the data made available via openFDA is generally unrestricted, however, the service through which we make that data available is offered subject to your acceptance of those terms and conditions as well as any relevant sections of the FDA Website Policies.

As noted in the terms of service, unless otherwise noted, the content, data, documentation, code, and related materials on openFDA is public domain and made available with a Creative Commons CC0 1.0 Universal dedication. Under CC0, FDA has dedicated the work to the public domain by waiving all rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission."

## Potential User and Decision Maker

Potential data user can be public, policy maker, health researcher, Students etc.  Decision Maker can be the health department who can plan the policies and necessary steps to meet the local health objectives, implement health awareness program, promote healthy living and evaluate the products quality in market.

## Questions that might be answered

* Correaltation of reaction and product.
* gender and age demographics using the particular product
* Data might give us answer on which population, gender and age decision maker can foccus on to make policies and health campaigns, product knowledge in particular area.

## Citation

U.S. Food and Drug Administration, August 2017,Retrieved from [https://open.fda.gov/downloads/](https://open.fda.gov/downloads/)


text:
A really simple Unity3D/DirectX 11 particle system using compute shaders to handle millions of particles.

![](https://github.com/antoinefournier/XParticle/blob/master/readme_img_1.png)
![](https://github.com/antoinefournier/XParticle/blob/master/readme_img_2.png)


text:
<?php

namespace Coomute\Bundle\OmgaBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class MetaType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('meta')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Coomute\Bundle\OmgaBundle\Entity\Meta'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'coomute_bundle_omgabundle_meta';
    }
}