text:
// Code generated by go-swagger; DO NOT EDIT.

package storage

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/netapp/trident/storage_drivers/ontap/api/rest/models"
)

// AggregateCreateReader is a Reader for the AggregateCreate structure.
type AggregateCreateReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AggregateCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewAggregateCreateAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	default:
		result := NewAggregateCreateDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewAggregateCreateAccepted creates a AggregateCreateAccepted with default headers values
func NewAggregateCreateAccepted() *AggregateCreateAccepted {
	return &AggregateCreateAccepted{}
}

/*
AggregateCreateAccepted describes a response with status code 202, with default header values.

Accepted
*/
type AggregateCreateAccepted struct {
	Payload *models.JobLinkResponse
}

// IsSuccess returns true when this aggregate create accepted response has a 2xx status code
func (o *AggregateCreateAccepted) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this aggregate create accepted response has a 3xx status code
func (o *AggregateCreateAccepted) IsRedirect() bool {
	return false
}

// IsClientError returns true when this aggregate create accepted response has a 4xx status code
func (o *AggregateCreateAccepted) IsClientError() bool {
	return false
}

// IsServerError returns true when this aggregate create accepted response has a 5xx status code
func (o *AggregateCreateAccepted) IsServerError() bool {
	return false
}

// IsCode returns true when this aggregate create accepted response a status code equal to that given
func (o *AggregateCreateAccepted) IsCode(code int) bool {
	return code == 202
}

func (o *AggregateCreateAccepted) Error() string {
	return fmt.Sprintf("[POST /storage/aggregates][%d] aggregateCreateAccepted  %+v", 202, o.Payload)
}

func (o *AggregateCreateAccepted) String() string {
	return fmt.Sprintf("[POST /storage/aggregates][%d] aggregateCreateAccepted  %+v", 202, o.Payload)
}

func (o *AggregateCreateAccepted) GetPayload() *models.JobLinkResponse {
	return o.Payload
}

func (o *AggregateCreateAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.JobLinkResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewAggregateCreateDefault creates a AggregateCreateDefault with default headers values
func NewAggregateCreateDefault(code int) *AggregateCreateDefault {
	return &AggregateCreateDefault{
		_statusCode: code,
	}
}

/*
	AggregateCreateDefault describes a response with status code -1, with default header values.

	ONTAP Error Response Codes

| Error Code | Description |
| ---------- | ----------- |
| 460770 | The aggregate create job failed to create the aggregate. |
| 786438 | Failed to create an aggregate on the node. |
| 786439 | An aggregate already uses the specified name. |
| 786446 | The node is not in cluster. |
| 786468 | VLDB is offline. |
| 786819 | The value is invalid for the specified option at the current privilege level. |
| 786902 | RAID-TEC aggregate is not fully supported. |
| 786911 | Not every node in the cluster has the Data ONTAP version required for the feature. |
| 787069 | Node is setup for MetroCluster over IP configuration; creating an unmirrored aggregate is not supported in this configuration. |
| 787092 | The target field cannot be specified for this operation. |
| 918138 | Internal error. Failed to get encryption operation status. |
| 1114292 | The required SnapLock license is not installed. |
| 2425736 | No matching node found for the target UUID. |
| 19726341 | Not enough eligible spare disks are available on the node. |
| 19726344 | No recommendation can be made for this cluster. |
| 19726357 | Automatic aggregate creation is not supported on MetroCluster with Fibre Channel (FC). |
| 19726358 | Automatic aggregate creation is not supported on ONTAP Cloud. |
| 19726373 | Recommendation specified for creating aggregates is not current. |
| 19726378 | Failed to create recommended aggregates on one or more nodes. |
| 19726382 | Another provisioning operation is in progress on this cluster. Wait a few minutes, and try the operation again. |
| 19726386 | Encountered an error when retrieving licensing information on this cluster. |
| 19726387 | No recommendation can be provided for this cluster within the license capacity. |
| 19726401 | Aggregate recommendations are not supported when the DR group is not in the "normal" state. |
| 19726402 | Internal error. Unable to determine the MetroCluster configuration state. |
| 19726403 | Aggregate recommendation is not supported when there are no healthy target connections to remote storage. |
| 196608055 | Aggregate recommendation is not supported on this node because it does not support NetApp Aggregate Encryption (NAE). |
| 196608206 | Internal error. Failed to get encryption operation status. |
*/
type AggregateCreateDefault struct {
	_statusCode int

	Payload *models.ErrorResponse
}

// Code gets the status code for the aggregate create default response
func (o *AggregateCreateDefault) Code() int {
	return o._statusCode
}

// IsSuccess returns true when this aggregate create default response has a 2xx status code
func (o *AggregateCreateDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this aggregate create default response has a 3xx status code
func (o *AggregateCreateDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this aggregate create default response has a 4xx status code
func (o *AggregateCreateDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this aggregate create default response has a 5xx status code
func (o *AggregateCreateDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this aggregate create default response a status code equal to that given
func (o *AggregateCreateDefault) IsCode(code int) bool {
	return o._statusCode == code
}

func (o *AggregateCreateDefault) Error() string {
	return fmt.Sprintf("[POST /storage/aggregates][%d] aggregate_create default  %+v", o._statusCode, o.Payload)
}

func (o *AggregateCreateDefault) String() string {
	return fmt.Sprintf("[POST /storage/aggregates][%d] aggregate_create default  %+v", o._statusCode, o.Payload)
}

func (o *AggregateCreateDefault) GetPayload() *models.ErrorResponse {
	return o.Payload
}

func (o *AggregateCreateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.ErrorResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}


text:
<TITLE>Review for Rock, The (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Rock, The (1996)

reviewed by
Christopher Null

                                 THE ROCK
                      A film review by Christopher Null
                       Copyright 1996 Christopher Null

     Long touted as the low-budget (in action movie terms) alternative to
this summer's Hollywood blockbusters, THE ROCK has been something of a
question mark among movie forecasters.  It doesn't have any real special
effects like TWISTER or INDEPENDENCE DAY.  It doesn't build on a 40
year-old history like MISSION: IMPOSSIBLE.  It doesn't even have any big
name action stars.

     What it *does* have is some of the best actors working in film today
(Nicolas Cage, Sean Connery, and Ed Harris), seasoned producers Jerry
Bruckheimer and the late Don Simpson (TOP GUN, for starters), BAD BOYS
director Michael Bay, and some relatively unknown screenwriters (David
Weisberg, Douglas S. Cook, and Mark Rosner), who all pull together to tell
one hell of a story -- and hands-down the best action flick of the
year-to-date.

     Based on the first 15 minutes of the film, I started off with some
severe doubts.  Poorly photographed and edited, the intro barely managed to
belch out the premise of the movie: that jaded General Francis X. Hummel
(Harris) and his gang of marine mutineers are taking over Alcatraz with 15
rockets full of V.X. nerve gas, holding the city of San Francisco hostage
until his demands are met.  (These demands are pretty stupid, involving
some cash and reparations for injury to the honor of dead marines.)  Well,
actually paying the money is never an option, so the FBI sends in a group
of Navy SEALS, plus biochemist Stanley Goodspeed (Cage) and hardened
criminal/Alcatraz escapee Patrick Mason (Connery).

     But after this 15 minute lull, THE ROCK explodes into an
incredibly-paced actioner that turns in one of the best entries of the
ever-growing DIE HARD genre.  The best part of the film is Cage and
Connery's chemistry -- the fact that they are such unlikely action heroes
makes them so very believable and so fun to watch.  The comedy in the film
also goes a long way -- something Bay is also good at, as he proved in BAD
BOYS.

     THE ROCK has one thing going for it that no other summer actioner
does, and that's believability.  It's just outrageous enough to make a
movie out of -- just real enough to make you wonder why it couldn't happen
tomorrow.  Plus, you get to see a guy's face melt off, which is always a
bonus.  (The production notes say that this V.X. stuff is *real*.)

     Minor quibbles aside (composer Nick Glennie-Smith ripping off his own
CRIMSON TIDE score and a huge 10-minute meaningless car chase), I highly
recommend action fans see THE ROCK when they finally wake up and realize
just how stupid MISSION: IMPOSSIBLE *really* is.

RATING:  ****

|------------------------------|
 \ ***** Perfection             \
  \ **** Good, memorable film    \
   \ *** Average, hits and misses \
    \ ** Sub-par on many levels    \
     \ * Unquestionably awful       \
      |------------------------------|

-Christopher Null  /  null@filmcritic.com
-Screenwriter-Producer  /  Novelist-Publisher
-Visit the Movie Emporium at http://www.filmcritic.com/
-and e-mail requests to join the movie review mailing list

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews

redpajama_set_name: RedPajamaGithub


text:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AlertModule } from 'ngx-bootstrap';
import { ChartsModule } from 'ng2-charts';
import { TabsModule } from 'ngx-bootstrap/tabs';

import { AppComponent } from './app.component';
import { TasksComponent } from './tasks/tasks.component';
import { WorkbasketComponent } from './workbasket/workbasket.component';

@NgModule({
  declarations: [
    AppComponent,
    TasksComponent,
    WorkbasketComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    AlertModule.forRoot(),
    ChartsModule,
    TabsModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }


text:
<?php
namespace jvdh\Serialization\Stub\Serializable;

class ObjectContainingSimpleReferencesStub
{
    public $publicFirstValue;
    public $publicSecondValue;
    public $publicThirdValue;
    public $publicFourthValue;
    public $publicFifthValue;

    public function __construct()
    {
        $this->publicFirstValue = 'lorem ipsum dolem';
        $this->publicSecondValue = 2;
        $this->publicThirdValue = &$this->publicFirstValue;
        $this->publicFourthValue = 4.0;
        $this->publicFifthValue = &$this->publicSecondValue;
    }
}


text:
INSERT INTO hydra_oauth2_flow (
    state,
    login_challenge,
    requested_scope,
    login_verifier,
    login_csrf,
    subject,
    request_url,
    login_skip,
    client_id,
    requested_at,
    login_initialized_at,
    oidc_context,
    login_session_id,
    requested_at_audience,

    login_remember,
    login_remember_for,
    login_error,
    acr,
    login_authenticated_at,
    login_was_used,
    forced_subject_identifier,
    context,
    amr,

    `consent_challenge_id`,
    `consent_verifier`,
    `consent_skip`,
    `consent_csrf`,

    `granted_scope`,
    `consent_remember`,
    `consent_remember_for`,
    `consent_error`,
    `session_access_token`,
    `session_id_token`,
    `consent_was_used`,
    `granted_at_audience`,
    `consent_handled_at`
) SELECT
    case
        when hydra_oauth2_authentication_request_handled.error IS NOT NULL then 128
        when hydra_oauth2_consent_request_handled.error IS NOT NULL then 129
        when hydra_oauth2_consent_request_handled.was_used = true then 6
        when hydra_oauth2_consent_request_handled.challenge IS NOT NULL then 5
        when hydra_oauth2_consent_request.challenge IS NOT NULL then 4
        when hydra_oauth2_authentication_request_handled.was_used = true then 3
        when hydra_oauth2_authentication_request_handled.challenge IS NOT NULL then 2
        else 1
    end,
    hydra_oauth2_authentication_request.challenge,
    hydra_oauth2_authentication_request.requested_scope,
    hydra_oauth2_authentication_request.verifier,
    hydra_oauth2_authentication_request.csrf,
    hydra_oauth2_authentication_request.subject,
    hydra_oauth2_authentication_request.request_url,
    hydra_oauth2_authentication_request.skip,
    hydra_oauth2_authentication_request.client_id,
    hydra_oauth2_authentication_request.requested_at,
    hydra_oauth2_authentication_request.authenticated_at,
    coalesce(hydra_oauth2_authentication_request.oidc_context, '{}'),
    hydra_oauth2_authentication_request.login_session_id,
    hydra_oauth2_authentication_request.requested_at_audience,

    coalesce(hydra_oauth2_authentication_request_handled.remember, false),
    coalesce(hydra_oauth2_authentication_request_handled.remember_for, 0),
    hydra_oauth2_authentication_request_handled.error,
    coalesce(hydra_oauth2_authentication_request_handled.acr, ''),
    hydra_oauth2_authentication_request_handled.authenticated_at,
    coalesce(hydra_oauth2_authentication_request_handled.was_used, false),
    coalesce(hydra_oauth2_consent_request.forced_subject_identifier, hydra_oauth2_authentication_request_handled.forced_subject_identifier, ''),
    coalesce(hydra_oauth2_authentication_request_handled.context, '{}'),
    coalesce(hydra_oauth2_authentication_request_handled.amr, ''),

    hydra_oauth2_consent_request.challenge,
    hydra_oauth2_consent_request.verifier,
    coalesce(hydra_oauth2_consent_request.skip, false),
    hydra_oauth2_consent_request.csrf,

    coalesce(hydra_oauth2_consent_request_handled.granted_scope, '[]'),
    coalesce(hydra_oauth2_consent_request_handled.remember, false),
    coalesce(hydra_oauth2_consent_request_handled.remember_for, 0),
    hydra_oauth2_consent_request_handled.error,
    coalesce(hydra_oauth2_consent_request_handled.session_access_token, ('{}')),
    coalesce(hydra_oauth2_consent_request_handled.session_id_token, ('{}')),
    coalesce(hydra_oauth2_consent_request_handled.was_used, false),
    coalesce(hydra_oauth2_consent_request_handled.granted_at_audience, '[]'),
    hydra_oauth2_consent_request_handled.handled_at
FROM hydra_oauth2_authentication_request
LEFT JOIN hydra_oauth2_authentication_request_handled
ON hydra_oauth2_authentication_request.challenge = hydra_oauth2_authentication_request_handled.challenge
LEFT JOIN hydra_oauth2_consent_request
ON hydra_oauth2_authentication_request.challenge = hydra_oauth2_consent_request.login_challenge
LEFT JOIN hydra_oauth2_consent_request_handled
ON hydra_oauth2_consent_request.challenge = hydra_oauth2_consent_request_handled.challenge;


text:
package com.yahoo.platform.yui.compressor.org.mozilla.javascript;

import java.io.Serializable;

/**
 * This class implements the object lookup required for the
 * with statement.
 * It simply delegates every action to its prototype except
 * for operations on its parent.
 */
public class NativeWith implements Scriptable, IdFunctionCall, Serializable {

    private static final long serialVersionUID = 1L;

    static void init(Scriptable scope, boolean sealed)
    {
        NativeWith obj = new NativeWith();

        obj.setParentScope(scope);
        obj.setPrototype(ScriptableObject.getObjectPrototype(scope));

        IdFunctionObject ctor = new IdFunctionObject(obj, FTAG, Id_constructor,
                                         "With", 0, scope);
        ctor.markAsConstructor(obj);
        if (sealed) {
            ctor.sealObject();
        }
        ctor.exportAsScopeProperty();
    }

    private NativeWith() {
    }

    protected NativeWith(Scriptable parent, Scriptable prototype) {
        this.parent = parent;
        this.prototype = prototype;
    }

    public String getClassName() {
        return "With";
    }

    public boolean has(String id, Scriptable start)
    {
        return prototype.has(id, prototype);
    }

    public boolean has(int index, Scriptable start)
    {
        return prototype.has(index, prototype);
    }

    public Object get(String id, Scriptable start)
    {
        if (start == this)
            start = prototype;
        return prototype.get(id, start);
    }

    public Object get(int index, Scriptable start)
    {
        if (start == this)
            start = prototype;
        return prototype.get(index, start);
    }

    public void put(String id, Scriptable start, Object value)
    {
        if (start == this)
            start = prototype;
        prototype.put(id, start, value);
    }

    public void put(int index, Scriptable start, Object value)
    {
        if (start == this)
            start = prototype;
        prototype.put(index, start, value);
    }

    public void delete(String id)
    {
        prototype.delete(id);
    }

    public void delete(int index)
    {
        prototype.delete(index);
    }

    public Scriptable getPrototype() {
        return prototype;
    }

    public void setPrototype(Scriptable prototype) {
        this.prototype = prototype;
    }

    public Scriptable getParentScope() {
        return parent;
    }

    public void setParentScope(Scriptable parent) {
        this.parent = parent;
    }

    public Object[] getIds() {
        return prototype.getIds();
    }

    public Object getDefaultValue(Class<?> typeHint) {
        return prototype.getDefaultValue(typeHint);
    }

    public boolean hasInstance(Scriptable value) {
        return prototype.hasInstance(value);
    }

    /**
     * Must return null to continue looping or the final collection result.
     */
    protected Object updateDotQuery(boolean value)
    {
        // NativeWith itself does not support it
        throw new IllegalStateException();
    }

    public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
                             Scriptable thisObj, Object[] args)
    {
        if (f.hasTag(FTAG)) {
            if (f.methodId() == Id_constructor) {
                throw Context.reportRuntimeError1("msg.cant.call.indirect", "With");
            }
        }
        throw f.unknown();
    }

    static boolean isWithFunction(Object functionObj)
    {
        if (functionObj instanceof IdFunctionObject) {
            IdFunctionObject f = (IdFunctionObject)functionObj;
            return f.hasTag(FTAG) && f.methodId() == Id_constructor;
        }
        return false;
    }

    static Object newWithSpecial(Context cx, Scriptable scope, Object[] args)
    {
        ScriptRuntime.checkDeprecated(cx, "With");
        scope = ScriptableObject.getTopLevelScope(scope);
        NativeWith thisObj = new NativeWith();
        thisObj.setPrototype(args.length == 0
                             ? ScriptableObject.getClassPrototype(scope,
                                                                  "Object")
                             : ScriptRuntime.toObject(cx, scope, args[0]));
        thisObj.setParentScope(scope);
        return thisObj;
    }

    private static final Object FTAG = "With";

    private static final int
        Id_constructor = 1;

    protected Scriptable prototype;
    protected Scriptable parent;
}


text:
'use strict';

app.controller('LanguageController',
  ['$scope', '$translate', '$location', 'LANGUAGES',
  function($scope, $translate, $location, languages) {
    $scope.$emit('noneActive');
    $scope.changeTo = function(lang) {
      $scope.switchLang(lang);
      if ($scope.previous) {
        $location.path($scope.previous.$$route.originalPath);
      } else {
        $location.path('/');
      }
    };
    $scope.languages = languages;
  },]);


text:
class CreateFaeFiles < ActiveRecord::Migration[4.2]
  def change
    create_table :fae_files do |t|
      t.string :name
      t.string :asset
      t.references :fileable, polymorphic: true, index: true
      t.integer :file_size
      t.integer :position, default: 0
      t.string :attached_as, index: true
      t.boolean :on_stage, default: true
      t.boolean :on_prod, default: false

      t.timestamps
    end
  end
end


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [("api", "0015_auto_20151022_1008")]

    operations = [
        migrations.AlterField(
            model_name="check",
            name="status",
            field=models.CharField(
                default="new",
                max_length=6,
                choices=[
                    ("up", "Up"),
                    ("down", "Down"),
                    ("new", "New"),
                    ("paused", "Paused"),
                ],
            ),
        )
    ]


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>Derby 2015
 - program</title>
<meta name="author" content="" >

<link rel="alternate" type="application/rss+xml" title="devopsdays RSS Feed" href="http://www.devopsdays.org/feed/" >

<link rel="stylesheet" href="/css/devops.min.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="/css/blueprint/print.css" type="text/css" media="print">

      Home

      Contact

      Events

      Presentations

      Blog

Derby 2015
 - program

Gold sponsors

Welcome
Register
Propose

Sponsor
Contact
Conduct

If you are new to the Open Space concept you may want to read some more details.

Day 1

08:15-09:00

Registration and Breakfast

09:00-09:15

Introduction

09:15-09:45

  Lessons learned trying to implement DevOps in a rapidly growing environment

  Michael Collins

09:45-10:15

    Living system or build factory. Two approaches to operations

  Chris Maxwell

10:15-10:30

break

10:30-11:00

    Comparative study of analytics algorithms for anomaly detection in the data center

    Toufic Boubez

11:00-11:30

    Sensu Introduction

    Sean Porter

11:30-12:00

Ignites Part 1

12:00-13:00

Lunch

13:00-14:30

Opening Open Space

14:30-15:20

Open Space Slot1

15:20-16:10

Open Space Slot2

16:10-17:00

Open Space Slot 3

17:05-17:15

Day One Closing Comments

17:30-19:00

time for you to get some food, check in the hotel ...

19:00-21:30

Sponsored drinks

Day 2

08:15-09:00

Registration and Breakfast

09:00-09:15

Kickoff Day 2

09:15-09:45

    From Vagrant to production

    Mark Eijsermans

09:45-10:15

    Test Kitchen 1.0 - A Config Management-Neutral Integration Testing Tool

    Fletcher Nichol

10:15-10:30

break

10:30-11:00

    Amazon OpsWorks: It's DevOps with Chef Jim, but not as we know it

    Yuichiro Mori

    Jerome Pimmel

    Chris Barclay

11:00-11:30

    Building Applications for Operability

    Reinhardt Quelle

11:30-12:00

Ignites Part 2

12:00-13:00

Lunch

14:00-14:30

Re-Opening Open Space

14:30-15:20

Open Space Slot4

15:20-16:10

Open Space Slot5

16:10-17:00

Open Space Slot6

17:05-17:15

Closing comments

   Be the first to sponsor!


text:
package com.amazonaws.transform;

public interface Marshaller<T, R> {

    public T marshall(R in) throws Exception;

}


text:
package in.twizmwaz.cardinal.module.modules.ctf.net;

import in.twizmwaz.cardinal.GameHandler;
import in.twizmwaz.cardinal.chat.ChatConstant;
import in.twizmwaz.cardinal.chat.LocalizedChatMessage;
import in.twizmwaz.cardinal.event.ScoreUpdateEvent;
import in.twizmwaz.cardinal.event.flag.FlagCaptureEvent;
import in.twizmwaz.cardinal.event.flag.NetEnterEvent;
import in.twizmwaz.cardinal.event.flag.NetLeaveEvent;
import in.twizmwaz.cardinal.module.Module;
import in.twizmwaz.cardinal.module.modules.ctf.FlagObjective;
import in.twizmwaz.cardinal.module.modules.ctf.post.Post;
import in.twizmwaz.cardinal.module.modules.filter.FilterModule;
import in.twizmwaz.cardinal.module.modules.filter.FilterState;
import in.twizmwaz.cardinal.module.modules.regions.RegionModule;
import in.twizmwaz.cardinal.module.modules.score.ScoreModule;
import in.twizmwaz.cardinal.module.modules.team.TeamModule;
import in.twizmwaz.cardinal.util.Fireworks;
import in.twizmwaz.cardinal.util.Flags;
import in.twizmwaz.cardinal.util.MiscUtil;
import in.twizmwaz.cardinal.util.Teams;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.util.Vector;

import java.util.Set;

public class Net implements Module {

    private String id;
    private RegionModule region;            // required
    private TeamModule owner;
    private int points;                     // Default: 0
    private Post post;
    private Set<FlagObjective> flagObjectives; // Default: ALL FLAGS
    private Set<FlagObjective> rescue;
    private boolean sticky;                 // Default: true
    private FilterModule captureFilter;
    private String denyMessage;
    private boolean respawnTogether;        // Default: false
    private FilterModule respawnFilter;
    private String respawnMessage;
    private Vector location;

    public Net(String id,
               RegionModule region,
               TeamModule owner,
               int points,
               Post post,
               Set<FlagObjective> flagObjectives,
               Set<FlagObjective> rescue,
               boolean sticky,
               FilterModule captureFilter,
               String denyMessage,
               boolean respawnTogether,
               FilterModule respawnFilter,
               String respawnMessage,
               Vector location) {
        this.id = id;
        this.region = region;
        this.owner = owner;
        this.points = points;
        this.post = post;
        this.flagObjectives = flagObjectives;
        this.rescue = rescue;
        this.sticky = sticky;
        this.captureFilter = captureFilter;
        this.denyMessage = denyMessage;
        this.respawnTogether = respawnTogether;
        this.respawnFilter = respawnFilter;
        this.respawnMessage = respawnMessage;
        this.location = location;
    }

    @Override
    public void unload() {
        HandlerList.unregisterAll(this);
    }

    public String getId() {
        return id;
    }

    public FilterModule getCaptureFilter() {
        return captureFilter;
    }

    public Set<FlagObjective> getFlags() {
        return flagObjectives;
    }

    public void setFlag(FlagObjective flag) {
        flagObjectives.add(flag);
    }

    public Post getPost() {
        return post;
    }

    public RegionModule getRegion() {
        return region;
    }

    public Vector getLocation() {
        return location;
    }

    private boolean rescueCarried() {
        int i = 0;
        for (FlagObjective flag : rescue) {
            if (flag.isCarried()) i++;
        }
        return i > 1;
    }

    private boolean allFlagsWaiting() {
        int i = 0;
        for (FlagObjective flag : flagObjectives) {
            if (!flag.isWaitingToRespawn()) i++;
        }
        return i == 0;
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        playerMove(event.getPlayer(), event.getFrom().position(), event.getTo().position());
    }

    @EventHandler
    public void onPlayerMove(PlayerTeleportEvent event) {
        playerMove(event.getPlayer(), event.getFrom().position(), event.getTo().position());
    }

    private void playerMove(Player player, Vector from, Vector to) {
        FlagObjective flag = Flags.getFlag(player);
        if (flag == null) return;
        if (region.contains(to) && !region.contains(from)) {
            NetEnterEvent e = new NetEnterEvent(player, this, flag);
            Bukkit.getServer().getPluginManager().callEvent(e);
        } else if (!region.contains(to) && region.contains(from)) {
            NetLeaveEvent e = new NetLeaveEvent(player, this, flag);
            Bukkit.getServer().getPluginManager().callEvent(e);
        }
    }

    @EventHandler
    public void onEnterNet(NetEnterEvent event) {
        if (event.getNet().equals(this)) {
            tryCapture(event.getFlag());
            if (event.getFlag().isCarried() && sticky) event.getFlag().setLastNet(this);
        }
    }

    public void tryCapture(FlagObjective flag) {
        Player player = flag.getPicker();
        if (flagObjectives.contains(flag) && (owner == null || owner.equals(Teams.getTeamByPlayer(player).get()))) {
            FilterModule captureFilt = null;
            if (getCaptureFilter() != null || flag.getCaptureFilter() != null) {
                captureFilt = getCaptureFilter() != null ? getCaptureFilter() : flag.getCaptureFilter();
            }
            if (captureFilt == null || captureFilt.evaluate(player).equals(FilterState.ALLOW)) {
                if (rescueCarried()) {
                    player.sendMessage(denyMessage);
                    return;
                }
                flag.setRespawnFilter(this.respawnFilter);
                flag.setRespawnMessage(this.respawnMessage);
                FlagCaptureEvent e = new FlagCaptureEvent(player, flag, this);
                Bukkit.getServer().getPluginManager().callEvent(e);
            } else if (denyMessage != null) {
                player.sendMessage(denyMessage);
            }
        }
    }

    @EventHandler(priority = EventPriority.LOW)
    public void onCaptureFlag(FlagCaptureEvent event) {
        if (event.getNet().equals(this) && respawnTogether) {
            event.getFlag().setCanRespawn(false);
        }
    }

    @EventHandler(priority = EventPriority.HIGH)
    public void onCaptureFlag2(FlagCaptureEvent event) {
        if (event.getNet().equals(this) && respawnTogether) {
            if (allFlagsWaiting()) {
                for (FlagObjective flag : flagObjectives) flag.setCanRespawn(true);
            }
        }
    }

    @EventHandler(priority = EventPriority.MONITOR)
    public void onCaptureFlag3(FlagCaptureEvent event) {
        Player player = event.getPlayer();
        FlagObjective flag = event.getFlag();
        if (event.getNet().equals(this)) {
            Fireworks.spawnFireworks(region.getCenterBlock().getAlignedVector(), (region.getMax().minus(region.getMin()).length()) * 0.55 + 1, 6, MiscUtil.convertChatColorToColor(flag.getChatColor()), 1);
            for (Player message : Bukkit.getOnlinePlayers()) {
                message.sendMessage(new LocalizedChatMessage(ChatConstant.UI_FLAG_CAPTURED, flag.getDisplayName() + ChatColor.RESET, Teams.getTeamByPlayer(player).get().getColor() + player.getName()).getMessage(player.getLocale()));
            }
            int pointsToAdd = points > 0 ? points : flag.getPoints();
            if (pointsToAdd > 0) {
                TeamModule team = owner == null ? Teams.getTeamByPlayer(player).get() : owner;
                for (ScoreModule score : GameHandler.getGameHandler().getMatch().getModules().getModules(ScoreModule.class)) {
                    if (score.getTeam().equals(team)) {
                        score.setScore(score.getScore() + pointsToAdd);
                        Bukkit.getServer().getPluginManager().callEvent(new ScoreUpdateEvent(score));
                    }
                }
            }
        }
    }
}


text:
require File.join(File.dirname(__FILE__), *%w[.. lib stock-data-recorder.rb])
require 'vcr'

VCR.configure do |c|
  c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
  c.hook_into :webmock
end

Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each {|f| require f}

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.extend VCR::RSpec::Macros
  config.include QuotedItemMacros
end


text:
/**
 *  \file   watchdog.h
 *
 *  \brief  Watchdog timer APIs and macros.
 *
 *   This file contains the driver API prototypes and macro definitions.
 */

/*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*/
/*
*  Redistribution and use in source and binary forms, with or without
*  modification, are permitted provided that the following conditions
*  are met:
*
*    Redistributions of source code must retain the above copyright
*    notice, this list of conditions and the following disclaimer.
*
*    Redistributions in binary form must reproduce the above copyright
*    notice, this list of conditions and the following disclaimer in the
*    documentation and/or other materials provided with the
*    distribution.
*
*    Neither the name of Texas Instruments Incorporated nor the names of
*    its contributors may be used to endorse or promote products derived
*    from this software without specific prior written permission.
*
*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
*  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
*  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
*  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
*  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
*  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
*  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
*  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
*  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

#ifndef __WDT_H__
#define __WDT_H__

#include "hw_watchdog.h"

#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************/
/*
** Values that can be passed to WatchdogTimerEmulationModeConfigure API as
** emuMode.
*/
/* WDT counter free-running in emulation mode */
#define WDT_EMULATION_FREE              (WDT_WDSC_EMUFREE)

/* WDT counter frozen in emulation mode */
#define WDT_EMULATION_FROZEN            (WDT_WDSC_EMUFREE_TIMER_FROZEN)

/*****************************************************************************/
/*
** Values that can be passed to WatchdogTimerPreScalerClkEnable API as ptv.
*/
/* Divide functional clock by 1 */
#define WDT_PRESCALER_CLK_DIV_1        (0x00000000u)

/* Divide functional clock by 2 */
#define WDT_PRESCALER_CLK_DIV_2        (0x00000004u)

/* Divide functional clock by 4 */
#define WDT_PRESCALER_CLK_DIV_4        (0x00000008u)

/* Divide functional clock by 8 */
#define WDT_PRESCALER_CLK_DIV_8        (0x0000000Cu)

/* Divide functional clock by 16 */
#define WDT_PRESCALER_CLK_DIV_16       (0x00000010u)

/* Divide functional clock by 32 */
#define WDT_PRESCALER_CLK_DIV_32       (0x00000014u)

/* Divide functional clock by 64 */
#define WDT_PRESCALER_CLK_DIV_64       (0x00000018u)

/* Divide functional clock by 128 */
#define WDT_PRESCALER_CLK_DIV_128      (0x0000001Cu)

/*****************************************************************************/
/*
** Values that can be passed to WatchdogTimerIntRawStatusSet,
** WatchdogTimerIntStatusClear APIs as intFlags.
** These values can also be used to read the status obatined from
** WatchdogTimerIntRawStatusGet, WatchdogTimerIntStatusGet APIs.
** These values can also be combined together and passed.
** For e.g. (WDT_INT_DELAY | WDT_INT_OVERFLOW)
*/
/* Watchdog delay interrupt */
#define WDT_INT_DELAY                   (WDT_WIRQSTATRAW_EVENT_DLY)

/* Watchdog overflow interrupt */
#define WDT_INT_OVERFLOW                (WDT_WIRQSTATRAW_EVENT_OVF)

/*****************************************************************************/
/*
** Values that can be passed to WatchdogTimerIntEnable as intFlags.
** These values can also be used to read the status obtained from
** WatchdogTimerIntEnableStatusGet API.
** These values can also be combined together and passed.
** For e.g. (WDT_INT_ENABLE_DELAY | WDT_INT_ENABLE_OVRFLW)
*/
/* Enable delay interrupt */
#define WDT_INT_ENABLE_DELAY           (WDT_WIRQENSET_ENABLE_DLY)

/* Enable overflow interrupt */
#define WDT_INT_ENABLE_OVRFLW          (WDT_WIRQENSET_ENABLE_OVF)

/*****************************************************************************/
/*
** Values that can be passed to WatchdogTimerIntDisable as intFlags.
** These values can also be combined together and passed.
** For e.g. (WDT_INT_DISABLE_DELAY | WDT_INT_DISABLE_OVRFLW)
*/
/* Enable delay interrupt */
#define WDT_INT_DISABLE_DELAY           (WDT_WIRQENCLR_ENABLE_DLY)

/* Enable overflow interrupt */
#define WDT_INT_DISABLE_OVRFLW          (WDT_WIRQENCLR_ENABLE_OVF)

/*****************************************************************************/
/*
** Values that can be used to read the status obtained from
** WatchdogTimerWritePostedStatusGet API.
** These values can also be combined while reading.
** For e.g. (WDT_WRITE_PENDING_WCLR | WDT_WRITE_PENDING_WCRR)
*/
/* Write pending for register WDT_WCLR */
#define WDT_WRITE_PENDING_WCLR          (WDT_WWPS_W_PEND_WCLR)

/* Write pending for register WDT_WCRR */
#define WDT_WRITE_PENDING_WCRR          (WDT_WWPS_W_PEND_WCRR)

/* Write pending for register WDT_WLDR */
#define WDT_WRITE_PENDING_WLDR          (WDT_WWPS_W_PEND_WLDR)

/* Write pending for register WDT_WTGR */
#define WDT_WRITE_PENDING_WTGR          (WDT_WWPS_W_PEND_WTGR)

/* Write pending for register WDT_WSPR */
#define WDT_WRITE_PENDING_WSPR          (WDT_WWPS_W_PEND_WSPR)

/* Write pending for register WDT_WDLY */
#define WDT_WRITE_PENDING_WDLY          (WDT_WWPS_W_PEND_WDLY)

/***************************************************************************/
/*
** Watchdog timer API prototypes
*/
extern void WatchdogTimerEnable(unsigned int baseAdd);
extern void WatchdogTimerDisable(unsigned int baseAdd);
extern unsigned int WatchdogTimerRevisionIDGet(unsigned int baseAdd);
extern void WatchdogTimerReset(unsigned int baseAdd);
extern void WatchdogTimerEmulationModeConfigure(unsigned int baseAdd,
                                         unsigned int emuMode);
extern void WatchdogTimerPreScalerClkEnable(unsigned int baseAdd, unsigned int ptv);
extern void WatchdogTimerPreScalerClkDisable(unsigned int baseAdd);
extern void WatchdogTimerCounterSet(unsigned int baseAdd, unsigned int countVal);
extern unsigned int WatchdogTimerCounterGet(unsigned int baseAdd);
extern void WatchdogTimerReloadSet(unsigned int baseAdd, unsigned int reloadVal);
extern unsigned int WatchdogTimerReloadGet(unsigned int baseAdd);
extern void WatchdogTimerTriggerSet(unsigned int baseAdd, unsigned int trigVal);
extern void WatchdogTimerDelaySet(unsigned int baseAdd, unsigned int delayVal);
extern unsigned int WatchdogTimerDelayGet(unsigned int baseAdd);
extern void WatchdogTimerIntRawStatusSet(unsigned int baseAdd, unsigned int intFlags);
extern unsigned int WatchdogTimerIntRawStatusGet(unsigned int baseAdd);
extern unsigned int WatchdogTimerIntStatusGet(unsigned int baseAdd);
extern void WatchdogTimerIntStatusClear(unsigned int baseAdd, unsigned int intFlags);
extern void WatchdogTimerIntEnable(unsigned int baseAdd, unsigned int intFlags);
extern unsigned int WatchdogTimerIntEnableStatusGet(unsigned int baseAdd);
extern void WatchdogTimerIntDisable(unsigned int baseAdd, unsigned int intFlags);
extern unsigned int WatchdogTimerWritePostedStatusGet(unsigned int baseAdd, unsigned int flags);

#ifdef __cplusplus
}
#endif

#endif

/********************************* END OF FILE ********************************/


text:
import * as jqxcore from '../../jqwidgets/jqxcore';
import * as jqxcheckbox from '../../jqwidgets/jqxcheckbox';
import { createElement, PureComponent } from 'react';

/* global Reflect, Promise */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

function __extends(d, b) {
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var JqxCheckBox = /** @class */ (function (_super) {
    __extends(JqxCheckBox, _super);
    function JqxCheckBox(props) {
        var _this = _super.call(this, props) || this;
        /* tslint:disable:variable-name */
        _this._jqx = JQXLite;
        _this._id = 'JqxCheckBox' + _this._jqx.generateID();
        _this._componentSelector = '#' + _this._id;
        _this.state = { lastProps: props };
        return _this;
    }
    JqxCheckBox.getDerivedStateFromProps = function (props, state) {
        if (!Object.is) {
            Object.is = function (x, y) {
                if (x === y) {
                    return x !== 0 || 1 / x === 1 / y;
                }
                else {
                    return x !== x && y !== y;
                }
            };
        }
        var areEqual = Object.is(props, state.lastProps);
        if (!areEqual) {
            var newState = { lastProps: props };
            return newState;
        }
        return null;
    };
    JqxCheckBox.prototype.componentDidMount = function () {
        var widgetOptions = this._manageProps();
        this._jqx(this._componentSelector).jqxCheckBox(widgetOptions);
        this._wireEvents();
    };
    JqxCheckBox.prototype.componentDidUpdate = function () {
        var widgetOptions = this._manageProps();
        this.setOptions(widgetOptions);
        this._wireEvents();
    };
    JqxCheckBox.prototype.render = function () {
        return (createElement("div", { id: this._id, className: this.props.className, style: this.props.style },
            createElement("span", null, this.props.children)));
    };
    JqxCheckBox.prototype.setOptions = function (options) {
        this._jqx(this._componentSelector).jqxCheckBox(options);
    };
    JqxCheckBox.prototype.getOptions = function (option) {
        return this._jqx(this._componentSelector).jqxCheckBox(option);
    };
    JqxCheckBox.prototype.check = function () {
        this._jqx(this._componentSelector).jqxCheckBox('check');
    };
    JqxCheckBox.prototype.disable = function () {
        this._jqx(this._componentSelector).jqxCheckBox('disable');
    };
    JqxCheckBox.prototype.destroy = function () {
        this._jqx(this._componentSelector).jqxCheckBox('destroy');
    };
    JqxCheckBox.prototype.enable = function () {
        this._jqx(this._componentSelector).jqxCheckBox('enable');
    };
    JqxCheckBox.prototype.focus = function () {
        this._jqx(this._componentSelector).jqxCheckBox('focus');
    };
    JqxCheckBox.prototype.indeterminate = function () {
        this._jqx(this._componentSelector).jqxCheckBox('indeterminate');
    };
    JqxCheckBox.prototype.renderWidget = function () {
        this._jqx(this._componentSelector).jqxCheckBox('render');
    };
    JqxCheckBox.prototype.toggle = function () {
        this._jqx(this._componentSelector).jqxCheckBox('toggle');
    };
    JqxCheckBox.prototype.uncheck = function () {
        this._jqx(this._componentSelector).jqxCheckBox('uncheck');
    };
    JqxCheckBox.prototype.val = function (value) {
        if (value) {
            this._jqx(this._componentSelector).jqxCheckBox('val', value);
        }
        else {
            return this._jqx(this._componentSelector).jqxCheckBox('val');
        }
    };
    JqxCheckBox.prototype._manageProps = function () {
        var widgetProps = ['animationShowDelay', 'animationHideDelay', 'boxSize', 'checked', 'disabled', 'enableContainerClick', 'groupName', 'height', 'hasThreeStates', 'locked', 'rtl', 'theme', 'width'];
        var options = {};
        for (var prop in this.props) {
            if (widgetProps.indexOf(prop) !== -1) {
                options[prop] = this.props[prop];
            }
        }
        return options;
    };
    JqxCheckBox.prototype._wireEvents = function () {
        for (var prop in this.props) {
            if (prop.indexOf('on') === 0) {
                var originalEventName = prop.slice(2);
                originalEventName = originalEventName.charAt(0).toLowerCase() + originalEventName.slice(1);
                this._jqx(this._componentSelector).off(originalEventName);
                this._jqx(this._componentSelector).on(originalEventName, this.props[prop]);
            }
        }
    };
    return JqxCheckBox;
}(PureComponent));
var jqx = window.jqx;
var JQXLite = window.JQXLite;

export default JqxCheckBox;
export { jqx, JQXLite };


text:
var minimatch = require('minimatch');
var _ = require('lodash');
var matchOpts = { matchBase: true };

module.exports.filterOnGlobs = function(paths, globs, ignores) {
  return _(paths)
    .filter(function(p) {
      var match = false;
      var ignored = false;

      // support a hash with filePath prop or string
      var path = p.filePath || p;

      // first process ignores from .gitignore
      if(ignores && ignores.length) {
        _.each(ignores, function(i) {
          if(minimatch(path, i, matchOpts)) {
            ignored = true;
            return false;
          }
        });
      }

      if(ignored === true) return false;

      // next process glob matches
      _.each(globs, function(g) {
        //console.log('path:' + path + ' glob:' + g);
        if(minimatch(path, g, matchOpts)) {
          //console.log('matched');
          match = true;
          return false;
        }
        //console.log('not a match');
      });

      return match;
    })
    .value();
};


text:
(function($){
    $.fn.capacityFixed = function(options) {
        var opts = $.extend({},$.fn.capacityFixed.deflunt,options);
        var FixedFun = function(element) {
            var top = opts.top;
            element.css({
                "top":top
            });

            $(window).scroll(function() {
                var scrolls = $(this).scrollTop();
                if (scrolls > top) {
                    if (window.XMLHttpRequest) {
                        element.css({
                            position: "fixed",
                            top: 0
                        });
                    } else {
                        element.css({
                            top: scrolls
                        });
                    }
                }else {
                    element.css({
                        position: "absolute",
                        top: top
                    });
                }
            });
            element.find(".close-ico").click(function(event){
                element.remove();
                event.preventDefault();
            })
        };
        return $(this).each(function() {
            FixedFun($(this));
        });
    };
    $.fn.capacityFixed.deflunt={

        top:33,
        pageWidth :980
   };
})(jQuery);


text:
package com.intel.analytics.bigdl.dllib.utils

import scala.reflect.ClassTag

trait Shape {
  /**
   * Use this method if its only a single Shape
   */
  def toSingle(): List[Int] = {
    Log4Error.invalidOperationError(false, "Invalid operation")
    null
  }

  /**
   * Use this method if the current Shape consist of multiple value
   */
  def toMulti(): List[Shape] = {
    Log4Error.invalidOperationError(false, "Invalid operation")
    null
  }

  /**
   * Update the given dim and return a new copy
   */
  def copyAndUpdate(dim: Int, v: Int): Shape = {
    Log4Error.invalidOperationError(false, "Invalid operation")
    null
  }

  /**
   * Update the given dim and return a new copy
   */
  def copyAndUpdate(dim: Int, v: Shape): Shape
    = {
    Log4Error.invalidOperationError(false, "Invalid operation")
    null
  }

  protected def getDim(dim: Int, length: Int): Int = {
    val rdim = if (dim < 0) {
      length + dim
    } else {
      dim
    }
    Log4Error.invalidInputError(rdim < length && rdim >=0,
      s"rdim $rdim out of range [0, $length)")
    rdim
  }
}

case class SingleShape(val value: List[Int]) extends Shape {
  override def toSingle(): List[Int] = value

  override def copyAndUpdate(dim: Int, v: Int): Shape = {
    val cValue = value.toArray
    cValue(getDim(dim, value.length)) = v
    Shape(cValue)
  }

  override def canEqual(a: Any): Boolean = a.isInstanceOf[SingleShape]

  override def equals(that: Any): Boolean =
    that match {
      case that: SingleShape => that.canEqual(this) && this.hashCode == that.hashCode
      case _ => false
    }

  override def hashCode: Int = {
    val prime = 31
    var result = 1
    result = prime * value.hashCode()
    return result
  }
}

case class MultiShape(val value: List[Shape]) extends Shape {

  override def toMulti(): List[Shape] = value

  override def copyAndUpdate(dim: Int, v: Shape): Shape = {
    val cValue = value.toArray
    cValue(getDim(dim, value.length)) = v
    MultiShape(cValue.toList)
  }

  override def canEqual(a: Any): Boolean = a.isInstanceOf[MultiShape]

  override def equals(that: Any): Boolean =
    that match {
      case that: MultiShape => that.canEqual(this) && this.hashCode == that.hashCode
      case _ => false
    }

  override def hashCode: Int = {
    val prime = 31
    var result = 1
    result = prime * value.hashCode()
    return result
  }
}

object Shape {

  def apply(item : Array[Int]): Shape = {
    if (item == null) {
      Log4Error.invalidOperationError(false, "Empty value")
    }
    new SingleShape(item.toList)
  }

  def apply(item : Int*): Shape = {
    new SingleShape(item.toList)
  }

  def apply[T <: Shape : ClassTag](shapes : List[Shape]): Shape = {
    if (shapes.length > 1) {
      MultiShape(shapes.toList)
    } else if (shapes.length == 1) {
      shapes(0)
    } else {
      Log4Error.invalidOperationError(false, "Empty value")
      shapes(0)
    }
  }
}


text:
/* # gateAnnotator
 * integration test for gate markups
 *
 * requires running GATE service
 */

/*jslint node: true */
/* global describe, it */

'use strict';

var fs = require('fs'), expect = require("expect.js"), path = require('path');
var annotatorGate = require('../lib/annotators/gateAnnotator.js');
var sampleDoc = fs.readFileSync('./data/annotated.html').toString();

describe('GATE markup', function(done){
  it('should mark up content', function(done) {
    annotatorGate.markup(sampleDoc, function(err, res) {
      expect(err).to.be(undefined);
      expect(res.length).to.be(861);
      done();
    });
  });
});

describe('gateAnnotator', function(done){
  it('should extract keyword instances', function(done) {
    var sampleDoc = fs.readFileSync('./data/annotated.html').toString();
    annotatorGate.doProcess({ uri: GLOBAL.config.HOMEPAGE + '/test', html: sampleDoc, selector: '.contents'}, function(err, result) {
      expect(err).to.be(undefined);
      var annos = result.annoRows;
      var l = annos.length;
      expect(l).to.be(21);
      done();
    });
  });
});


text:
layout: page
title: Murray Holdings Party
date: 2016-05-24
author: Brittany Rasmussen
tags: weekly links, java
status: published
summary: Proin metus urna, pretium sed.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 08/28/2018
  endDate: 09/02/2018
  ctyhocn: WASSSHX
  groupCode: MHP
published: true
---
Sed tempor blandit rhoncus. Curabitur non ligula in eros sollicitudin accumsan. Vestibulum ac odio arcu. Donec non imperdiet erat. Aenean vitae viverra enim, pharetra blandit enim. Nunc lobortis tellus urna. Nam nec turpis quis ipsum porttitor ullamcorper vel lobortis augue. Nullam placerat luctus neque, quis finibus lacus. Ut volutpat lacus sit amet cursus ultricies. Fusce molestie tellus a est tempor, non efficitur massa lacinia.

1 Morbi et lectus pellentesque neque tempor lobortis
1 Nam fringilla nibh auctor molestie consectetur
1 Curabitur laoreet elit quis ante fermentum ultricies
1 Etiam vitae est vitae leo suscipit ullamcorper in sit amet lorem.

Donec convallis sollicitudin erat a bibendum. Nullam ut semper justo, sed condimentum tortor. Integer lacus turpis, elementum quis maximus quis, blandit non augue. Pellentesque vehicula blandit orci, quis maximus metus sagittis quis. Morbi molestie enim sodales nibh vehicula fermentum. Nam efficitur laoreet elit, vel ullamcorper magna bibendum eget. Curabitur non eleifend ligula. Ut finibus vel lacus luctus suscipit. Mauris condimentum enim vitae magna dapibus tristique. Donec id sem elit.


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**items** | [**[ProductListItem]**](ProductListItem.md) | The array of products | [optional]


text:
{-# LANGUAGE TemplateHaskell #-}

-- | <http://strava.github.io/api/v3/uploads/>
module Strive.Types.Uploads
  ( UploadStatus (..)
  ) where

import Data.Aeson.TH (deriveFromJSON)
import Data.Text (Text)
import Strive.Internal.TH (options)

-- | <http://strava.github.io/api/v3/uploads/#attributes>
data UploadStatus = UploadStatus
  { uploadStatus_activityId :: Maybe Integer
  , uploadStatus_error      :: Maybe Text
  , uploadStatus_externalId :: Maybe Text
  , uploadStatus_id         :: Integer
  , uploadStatus_status     :: Text
  } deriving Show

$(deriveFromJSON options ''UploadStatus)


text:
import * as getmac from 'getmac';
import * as crypto from 'crypto';
import * as winreg from 'winreg';
import * as Platform from 'vs/base/common/platform';
import * as os from 'os';
import {TPromise} from 'vs/base/common/winjs.base';
import * as errors from 'vs/base/common/errors';
import * as uuid from 'vs/base/common/uuid';
import {IStorageService} from 'vs/platform/storage/common/storage';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';

namespace StorageKeys {
	export const MachineId = 'telemetry.machineId';
	export const InstanceId = 'telemetry.instanceId';
	export const sqmUserId: string = 'telemetry.sqm.userId';
	export const sqmMachineId: string = 'telemetry.sqm.machineId';
	export const lastSessionDate: string = 'telemetry.lastSessionDate';
	export const firstSessionDate: string = 'telemetry.firstSessionDate';
	export const SQM_KEY: string = '\\Software\\Microsoft\\SQMClient';
}

export function resolveCommonProperties(storageService: IStorageService, contextService: IWorkspaceContextService): TPromise<{ [name: string]: string }> {

	let result: { [name: string]: any } = Object.create(null);

	result['sessionID'] = uuid.generateUuid() + Date.now();
	result['commitHash'] = contextService.getConfiguration().env.commitHash;

	// add shell & render version
	result['version'] = contextService.getConfiguration().env.version;
	result['common.version.shell'] = process.versions && (<any>process).versions['electron'];
	result['common.version.renderer'] = process.versions && (<any>process).versions['chrome'];
	result['common.osVersion'] = os.release();

	// session dates, first, last, isNewSession
	const lastSessionDate = storageService.get(StorageKeys.lastSessionDate);
	const firstSessionDate = storageService.get(StorageKeys.firstSessionDate) || new Date().toUTCString();
	storageService.store(StorageKeys.firstSessionDate, firstSessionDate);
	storageService.store(StorageKeys.lastSessionDate, new Date().toUTCString());
	result['common.firstSessionDate'] = firstSessionDate;
	result['common.lastSessionDate'] = lastSessionDate;
	result['common.isNewSession'] = !lastSessionDate ? 1 : 0;

	// dynamic properties which value differs on each call
	let seq = 0;
	const startTime = Date.now();
	Object.defineProperties(result, {
		'timestamp': {
			get: () => new Date(),
			enumerable: true
		},
		'common.timesincesessionstart': {
			get: () => Date.now() - startTime,
			enumerable: true
		},
		'common.platform': {
			get: () => Platform.Platform[Platform.platform],
			enumerable: true
		},
		'common.sequence': {
			get: () => seq++,
			enumerable: true
		}
	});

	// promise based properties
	let promises: TPromise<any>[] = [];
	promises.push(getOrCreateInstanceId(storageService).then(value => result['common.instanceId'] = value));
	promises.push(getOrCreateMachineId(storageService).then(value => result['common.machineId'] = value));
	if (process.platform === 'win32') {
		promises.push(getSqmUserId(storageService).then(value => result['common.sqm.userid']= value));
		promises.push(getSqmMachineId(storageService).then(value => result['common.sqm.machineid']= value));
	}

	return TPromise.join(promises).then(_ => result);
}

function getOrCreateInstanceId( storageService: IStorageService): TPromise<string> {
	let result = storageService.get(StorageKeys.InstanceId) || uuid.generateUuid();
	storageService.store(StorageKeys.InstanceId, result);
	return TPromise.as(result);
}

function getOrCreateMachineId(storageService: IStorageService): TPromise<string> {
	return new TPromise<string>(resolve => {
		let result = storageService.get(StorageKeys.MachineId);
		if (result) {
			return resolve(result);
		}
		// add a unique machine id as a hash of the macAddress
		try {
			getmac.getMac((error, macAddress) => {
				if (!error) {
					// crypt machine id
					result = crypto.createHash('sha256').update(macAddress, 'utf8').digest('hex');
				} else {
					result = uuid.generateUuid(); // fallback, generate a UUID
				}
				resolve(result);
			});
		} catch (err) {
			errors.onUnexpectedError(err);
			resolve(uuid.generateUuid()); // fallback, generate a UUID
		}
	}).then(result => {
		storageService.store(StorageKeys.MachineId, result);
		return result;
	});
}

function getSqmUserId(storageService: IStorageService): TPromise<string> {
	var sqmUserId = storageService.get(StorageKeys.sqmUserId);
	if (sqmUserId) {
		return TPromise.as(sqmUserId);
	}
	return getWinRegKeyData(StorageKeys.SQM_KEY, 'UserId', winreg.HKCU).then(result => {
		if (result) {
			storageService.store(StorageKeys.sqmUserId, result);
			return result;
		}
	});
}

function getSqmMachineId(storageService: IStorageService): TPromise<string> {
	let sqmMachineId = storageService.get(StorageKeys.sqmMachineId);
	if (sqmMachineId) {
		return TPromise.as(sqmMachineId);
	}
	return getWinRegKeyData(StorageKeys.SQM_KEY, 'MachineId', winreg.HKLM).then(result => {
		if (result) {
			storageService.store(StorageKeys.sqmMachineId, result);
			return result;
		}
	});
}

function getWinRegKeyData(key: string, name: string, hive: string): TPromise<string> {
	return new TPromise<string>((resolve, reject) => {
		if (process.platform === 'win32') {
			try {
				var reg = new winreg({ hive, key });
				reg.get(name, (e, result) => {
					if (e || !result) {
						reject(null);
					} else {
						resolve(result.value);
					}
				});
			} catch (err) {
				errors.onUnexpectedError(err);
				reject(err);
			}
		} else {
			resolve(null);
		}
	}).then(undefined, err => {
		// we only want success
		return undefined;
	});
}


text:
package net.kalmas.cruzers.config;

import java.io.File;
import java.io.IOException;

import org.apache.tomcat.util.http.fileupload.FileUtils;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.lease.Releasable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.client.NodeClientFactoryBean;
import org.springframework.data.elasticsearch.client.TransportClientFactoryBean;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;

@Configuration
@EnableElasticsearchRepositories(basePackages = "net.kalmas.cruzers.repo")
@EnableConfigurationProperties(ElasticsearchProperties.class)
public class ElasticsearchConfig implements DisposableBean
{
    /**
     * If running Elasticsearch as embedded node, data files will be written to this path.
     */
    private static final String DATA_DIRECTORY = "build/data";

    @Autowired
    private ApplicationProperties appProperties;

    @Autowired
    private ElasticsearchProperties elasticProperties;

    private final Logger log = LoggerFactory.getLogger(this.getClass());

    private Releasable releasable;

    private void deleteDirectory(final String path) {
        try {
            FileUtils.deleteDirectory(new File(path));
        } catch (final IOException e) {
            throw new RuntimeException("Could not delete data directory of embedded elasticsearch server", e);
        }
    }

    @Override
    public void destroy()
            throws Exception
    {
        this.log.info("Closing connection to Elasticsearch.");
        this.releasable.close();

        if (this.appProperties.getEmbeddedTestElastic()) {
            this.log.info(String.format("Cleaning data directory at %s.", DATA_DIRECTORY));
            this.deleteDirectory(DATA_DIRECTORY);
        }
    }

    @Bean
    public Client elasticSearchClient()
            throws Exception
    {
        if (this.appProperties.getEmbeddedTestElastic()) {
            this.log.info(String.format("Starting local Elasticsearch instance in %s.", DATA_DIRECTORY));

            final NodeClientFactoryBean factory = new NodeClientFactoryBean(true);
            factory.setPathData(DATA_DIRECTORY);
            factory.setEnableHttp(false);
            factory.setPathHome(".");
            factory.setClusterName("elasticsearch");
            factory.afterPropertiesSet();

            final NodeClient client = factory.getObject();
            this.releasable = client;
            return client;
        } else {
            final String clusterNodes = this.elasticProperties.getClusterNodes();

            this.log.info(String.format("Connecting to remote Elasticsearch instance at %s.", clusterNodes));

            final TransportClientFactoryBean factory = new TransportClientFactoryBean();
            factory.setClusterNodes(clusterNodes);
            factory.setClientIgnoreClusterName(true);
            factory.afterPropertiesSet();

            final TransportClient transportClient = factory.getObject();
            this.releasable = transportClient;
            return transportClient;
        }
    }

    @Bean
    public ElasticsearchOperations elasticsearchTemplate()
            throws Exception
    {
        return new ElasticsearchTemplate(this.elasticSearchClient());
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
XMLResourceBundle (Apache FOP 1.1 API)
</TITLE>

<META NAME="date" CONTENT="2012-10-16">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

fop 1.1

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.fop.util

Class XMLResourceBundle

java.lang.Object
  java.util.ResourceBundle
      org.apache.fop.util.XMLResourceBundle

public class XMLResourceBundle
extends java.util.ResourceBundle

This class is a ResourceBundle that loads its contents from XML files instead of properties
 files (like PropertiesResourceBundle).

 The XML format for this resource bundle implementation is the following
 (the same as Apache Cocoon's XMLResourceBundle):

 <catalogue xml:lang="en">
   <message key="key1">Message <br/> Value 1</message>
   <message key="key2">Message <br/> Value 1</message>
   ...
 </catalogue>

Nested Class Summary

Nested classes/interfaces inherited from class java.util.ResourceBundle

java.util.ResourceBundle.Control

Field Summary

Fields inherited from class java.util.ResourceBundle

parent

Constructor Summary

XMLResourceBundle(java.io.InputStream in)

          Creates a resource bundle from an InputStream.

Method Summary

 java.util.Enumeration
getKeys()

 java.util.Locale
getLocale()

static java.util.ResourceBundle
getXMLBundle(java.lang.String baseName,
             java.lang.ClassLoader loader)

          Gets a resource bundle using the specified base name, default locale, and class loader.

static java.util.ResourceBundle
getXMLBundle(java.lang.String baseName,
             java.util.Locale locale,
             java.lang.ClassLoader loader)

          Gets a resource bundle using the specified base name, locale, and class loader.

protected  java.lang.Object
handleGetObject(java.lang.String key)

 java.lang.String
toString()

Methods inherited from class java.util.ResourceBundle

clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParent

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

XMLResourceBundle

public XMLResourceBundle(java.io.InputStream in)
                  throws java.io.IOException

Creates a resource bundle from an InputStream.

Parameters:
in - the stream to read from

Throws:

java.io.IOException - if an I/O error occurs

Method Detail

getXMLBundle

public static java.util.ResourceBundle getXMLBundle(java.lang.String baseName,
                                                    java.lang.ClassLoader loader)
                                             throws java.util.MissingResourceException

Gets a resource bundle using the specified base name, default locale, and class loader.

Parameters:
baseName - the base name of the resource bundle, a fully qualified class name
loader - the class loader from which to load the resource bundle

Returns:
a resource bundle for the given base name and the default locale

Throws:

java.util.MissingResourceException - if no resource bundle for the specified base name can be
                                          found
See Also:
ResourceBundle.getBundle(String)

getXMLBundle

public static java.util.ResourceBundle getXMLBundle(java.lang.String baseName,
                                                    java.util.Locale locale,
                                                    java.lang.ClassLoader loader)
                                             throws java.util.MissingResourceException

Gets a resource bundle using the specified base name, locale, and class loader.

Parameters:
baseName - the base name of the resource bundle, a fully qualified class name
locale - the locale for which a resource bundle is desired
loader - the class loader from which to load the resource bundle

Returns:
a resource bundle for the given base name and locale

Throws:

java.util.MissingResourceException - if no resource bundle for the specified base name can be
                                          found
See Also:
ResourceBundle.getBundle(String, Locale, ClassLoader)

getLocale

public java.util.Locale getLocale()

Overrides:
getLocale in class java.util.ResourceBundle

getKeys

public java.util.Enumeration getKeys()

Specified by:
getKeys in class java.util.ResourceBundle

handleGetObject

protected java.lang.Object handleGetObject(java.lang.String key)

Specified by:
handleGetObject in class java.util.ResourceBundle

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

fop 1.1

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.


text:
/**
 * Document CSS
 */
.navigation {
	display: none;
}


text:
package io.crossbar.autobahn.websocket.messages;

import java.util.Map;

/// Initial WebSockets handshake (server response).
public class ServerHandshake extends Message {
    public Map<String, String> headers;

    public ServerHandshake(Map<String, String> headers) {
        this.headers = headers;
    }
}


text:
package com.android.ide.common.rendering.api;

/**
 * Scene result class. This is an immutable class.
 *

 * This cannot be allocated directly, instead use
 * {@link Status#createResult()},
 * {@link Status#createResult(String, Throwable)},
 * {@link Status#createResult(String)}
 * {@link Status#createResult(Object)}
 */
public class Result {

    private final Status mStatus;
    private final String mErrorMessage;
    private final Throwable mThrowable;
    private Object mData;

    /**
     * Scene Status enum.
     *
This indicates the status of all scene actions.
     */
    public enum Status {
        SUCCESS,
        NOT_IMPLEMENTED,
        ERROR_TIMEOUT,
        ERROR_LOCK_INTERRUPTED,
        ERROR_INFLATION,
        ERROR_VIEWGROUP_NO_CHILDREN,
        ERROR_NOT_INFLATED,
        ERROR_RENDER,
        ERROR_ANIM_NOT_FOUND,
        ERROR_NOT_A_DRAWABLE,
        ERROR_REFLECTION,
        ERROR_UNKNOWN;

        private Result mResult;

        /**
         * Returns a {@link Result} object with this status.
         * @return an instance of SceneResult;
         */
        public Result createResult() {
            // don't want to get generic error that way.
            assert this != ERROR_UNKNOWN;

            if (mResult == null) {
                mResult = new Result(this);
            }

            return mResult;
        }

        /**
         * Returns a {@link Result} object with this status, and the given data.
         * @return an instance of SceneResult;
         *
         * @see Result#getData()
         */
        public Result createResult(Object data) {
            Result res = createResult();

            if (data != null) {
                res = res.getCopyWithData(data);
            }

            return res;
        }

        /**
         * Returns a {@link #ERROR_UNKNOWN} result with the given message and throwable
         * @param errorMessage the error message
         * @param throwable the throwable
         * @return an instance of SceneResult.
         */
        public Result createResult(String errorMessage, Throwable throwable) {
            return new Result(this, errorMessage, throwable);
        }

        /**
         * Returns a {@link #ERROR_UNKNOWN} result with the given message
         * @param errorMessage the error message
         * @return an instance of SceneResult.
         */
        public Result createResult(String errorMessage) {
            return new Result(this, errorMessage, null /*throwable*/);
        }
    }

    /**
     * Creates a {@link Result} object with the given SceneStatus.
     *
     * @param status the status. Must not be null.
     */
    private Result(Status status) {
        this(status, null, null);
    }

    /**
     * Creates a {@link Result} object with the given SceneStatus, and the given message
     * and {@link Throwable}
     *
     * @param status the status. Must not be null.
     * @param errorMessage an optional error message.
     * @param t an optional exception.
     */
    private Result(Status status, String errorMessage, Throwable t) {
        assert status != null;
        mStatus = status;
        mErrorMessage = errorMessage;
        mThrowable = t;
    }

    private Result(Result result) {
        mStatus = result.mStatus;
        mErrorMessage = result.mErrorMessage;
        mThrowable = result.mThrowable;
    }

    /**
     * Returns a copy of the current result with the added (or replaced) given data
     * @param data the data bundle
     *
     * @return returns a new SceneResult instance.
     */
    public Result getCopyWithData(Object data) {
        Result r = new Result(this);
        r.mData = data;
        return r;
    }

    /**
     * Returns whether the status is successful.
     *

     * This is the same as calling getStatus() == SceneStatus.SUCCESS
     * @return true if the status is successful.
     */
    public boolean isSuccess() {
        return mStatus == Status.SUCCESS;
    }

    /**
     * Returns the status. This is never null.
     */
    public Status getStatus() {
        return mStatus;
    }

    /**
     * Returns the error message. This is only non-null when {@link #getStatus()} returns
     * {@link Status#ERROR_UNKNOWN}
     */
    public String getErrorMessage() {
        return mErrorMessage;
    }

    /**
     * Returns the exception. This is only non-null when {@link #getStatus()} returns
     * {@link Status#ERROR_UNKNOWN}
     */
    public Throwable getException() {
        return mThrowable;
    }

    /**
     * Returns the optional data bundle stored in the result object.
     * @return the data bundle or null if none have been set.
     */
    public Object getData() {
        return mData;
    }
}


text:
package yushijinhun.authlibagent.web.manager;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "login-param")
public class LoginParam implements Serializable {

	private static final long serialVersionUID = 1L;

	private String username;
	private String password;
	private boolean ignoreBanned = false;

	@XmlElement
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@XmlElement
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@XmlElement
	public boolean isIgnoreBanned() {
		return ignoreBanned;
	}

	public void setIgnoreBanned(boolean ignoreBanned) {
		this.ignoreBanned = ignoreBanned;
	}

}


text:
<?php

namespace AppBundle\Controller;

use AppBundle\Forms\galleryForm;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\File;
use AppBundle\Forms\ArticleForm;
use AppBundle\Forms\photosForm;
use AppBundle\Entity\Article;
use AppBundle\functions\Functions;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\Validator\Constraints\DateTime;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use AppBundle\Entity\photo;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use AppBundle\Entity\user;
use AppBundle\Forms\UserForm;
use ZipArchive;

class AdminController extends Controller
{

    /**
     * @Route("/admin", name="admin")
     */
    public function RenderAdmin()
    {
        return $this->render('admin/admin.html.twig');
    }

    /**
     * var_dump
     * @Route("/admin/article/creat", name="article-creat")
     */
    public function CreateArticle(Request $request)
    {
        $Article = new Article();

        $form = $this->createForm(ArticleForm::class, $Article);

        $form->handleRequest($request);
        if ($form->isSubmitted()) {

            $file = $Article->getPicture();

            $em = $this->getDoctrine()->getManager();
            $zapytanieX = $em->getRepository('AppBundle:Article')
                ->findAll();
            $ilosc_wierszy = count($zapytanieX);
            $fileName =  $ilosc_wierszy+1 ;
            $fileName2 =  "$fileName.jpg";
            $file->move(
                $this->getParameter('picture_directory'),
                $fileName
            );

            $Article->setPicture($fileName);
            $Article = $form->getData();
            $Article->setDate(new \DateTime('now'));
            $em->persist($Article);
            $em->flush();

            $this->addFlash('success',
                sprintf('Udało się stowrzyć artykuł !')
            );

            return $this->redirectToRoute('admin');
        }
        $dir = '%kernel.root_dir%/../galeria/uploads/photos/';

        $opcje = scandir($dir);
        unset($opcje[0]);
        unset($opcje[1]);
        sort($opcje);
        if($opcje==null)
        {
           $opcje[0] = '1.jpg';
        }

        $length= count($opcje)-1;

        return $this->render('admin/article-creat.html.twig', [
            'ArticleForm' => $form->createView(),
            'opcje' => $opcje,
            'length' => $length
        ]);
    }

    /**
     * @Route("/admin/article", name="articles")
     */
    public function Articles()
    {
        $em = $this->getDoctrine()->getManager();

        $articles=  $em ->getRepository('AppBundle:Article')->findAll();

        return $this->render('admin/article.html.twig', array(
            'articles' =>  $articles
        ));
    }

    /**
     * @Route("/admin/article/edit/{id}", name="article-edit")
     */
    public function EditArticle(Request $request, Article $Article)
    {
        $form = $this->createForm(ArticleForm::class, $Article);
        $form->handleRequest($request);

        $dir = '%kernel.root_dir%/../galeria/uploads/photos/';

        $opcje = scandir($dir);

        unset($opcje[0]);
        unset($opcje[1]);
        sort($opcje);

        if($opcje==null)
        {
           $opcje[0] = '1.jpg';
        }

        $length= count($opcje)-1;

        if ($form->isSubmitted() && $form->isValid()) {

            $file = $Article->getPicture();
            $em = $this->getDoctrine()->getManager();
            $zapytanieX = $em->getRepository('AppBundle:Article')
                ->findAll();
            $ilosc_wierszy = count($zapytanieX);
            $fileName =  $ilosc_wierszy+1 ;
            $fileName2 =  "$fileName.jpg";
            $file->move(
                $this->getParameter('picture_directory'),
                $fileName2
            );
            $Article->setPicture($fileName2);
            $Article = $form->getData();

            $em->persist($Article);
            $em->flush();

            $this->addFlash('success',
                sprintf('Udało się edytować artykuł !')
            );

            return $this->redirectToRoute('articles');
        }

        return $this->render('admin/article-edit.html.twig', [
            'ArticleForm' => $form->createView(),
            'opcje' => $opcje,
            'length' => $length
        ]);

    }

    /**
     * @Route("/admin/article/delete/{id}", name="article_delete")
     */
    public function CancelArticle($id)
    {
        $em = $this->getDoctrine()->getManager();

        $article = $em->getRepository('AppBundle:Article')
            ->findOneBy([
                'id' => $id
            ]);

        $this->addFlash('success',
            sprintf('Udało się usunąć artykuł !')
        );

        $em->remove($article);
        $em->flush();
        return $this->redirectToRoute('articles');
    }

    /**
     * @Route("/admin/gallery-creat", name="open-source")
     */
    public function CreatGallery(Request $request)
    {

        $photo = new photo();

        $form = $this->createForm(galleryForm::class, $photo);

        $form->handleRequest($request);
        if ($form->isSubmitted()) {

            $file = $photo->getphoto();

            $em = $this->getDoctrine()->getManager();
            $zapytanieX = $em->getRepository('AppBundle:photo')
                ->findAll();
            $ilosc_wierszy = count($zapytanieX);
            $fileName =  $ilosc_wierszy+1 ;
            $fileName2 =  "$fileName.jpg";

            $file->move(
                $this->getParameter('picture_directory2'),
                $fileName2
            );

               $var = $form->get('name')->getData();

           $photo->setphoto($fileName2);

           $photo = $form->getData();

           $fs = new Filesystem();

      try {
$fs->mkdir('%kernel.root_dir%/../galeria/uploads/photos/'. $var.'/zdjecia');
} catch (IOExceptionInterface $e) {
    echo "An error occurred while creating your directory at ".$e->getPath();
}

            $em->persist($photo);
            $em->flush();

            $this->addFlash('success',
                sprintf('Udało się dodać Galerie !')
            );

            return $this->redirectToRoute('admin');
        }

        return $this->render('admin/gallery-creat.html.twig', [
            'galleryForm' => $form->createView()
        ]);

    }

     /**
     * @Route("/admin/gallery-admin", name="gallery-admin")
     */
    public function CreatGalleryAdmin()
    {
           $em=$this->getDoctrine()->getManager();
           $galeria=$em->getRepository('AppBundle:photo')->findAll();

    return $this->render('admin/gallery-admin.html.twig', array(
              'Galeria' => $galeria
    ));
    }

    /**
     * @Route("/admin/gallery-admin/edit/{id}", name="gallery-Edit")
     */
    public function EditGalleryAdmin(Request $request, photo $photo)
    {

        $form = $this->createForm(galleryForm::class, $photo);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {

            $file = $photo->getphoto();

            $em = $this->getDoctrine()->getManager();
            $zapytanieX = $em->getRepository('AppBundle:photo')
                ->findAll();
            $ilosc_wierszy = count($zapytanieX);
            $fileName =  $ilosc_wierszy+1 ;
            $fileName2 =  "$fileName.jpg";
            $file->move(
                $this->getParameter('picture_directory2'),
                $fileName2
            );

            $photo->setphoto($fileName2);
            $photo = $form->getData();

            $em->persist($photo);
            $em->flush();

            $this->addFlash('success',
                sprintf('Udało się edytować zdjęcie !')
            );

            return $this->redirectToRoute('gallery-admin');
        }

        return $this->render('admin/gallery-edit.html.twig', [
            'galleryForm' => $form->createView()
        ]);

    return $this->render('admin/gallery-admin.html.twig');
    }

   /**
     * @Route("/admin/gallery-admin/delete/{id}", name="gallery-Cancel")
     */
    public function DeleteGalleryAdmin($id)
    {

      $em = $this->getDoctrine()->getManager();

        $photo= $em->getRepository('AppBundle:photo')
            ->findOneBy([
                'id' => $id
            ]);

        $this->addFlash('success',
            sprintf('Udało się usunąć Galerie !')
        );

        $new=$photo->getname();

        $route = __DIR__.'\AdminController.php';
        // chdir('%kernel.root_dir%/../galeria/uploads/photos/'.$new); // Comment this out if you are on the same folder
        // chmod('%kernel.root_dir%/../galeria/uploads/photos/'.$new.'/zdjecia',0777);
        chown('%kernel.root_dir%/../galeria/uploads/photos/'.$new, "Rafał");
        chown($route,"Rafał");
        $stat = stat('%kernel.root_dir%/../galeria/uploads/photos/'.$new);

        chmod('%kernel.root_dir%/../galeria/uploads/photos/'.$new,0777);
        chmod($route, 0777);
        //  rmdir('%kernel.root_dir%/../galeria/uploads/photos/'.$new);
        $dir = '%kernel.root_dir%/../galeria/uploads/photos/'.$new.'/zdjecia';

        $files1 = scandir($dir);
        unset($files1[0]);
        unset($files1[1]);
        sort($files1);
        $length=count($files1);
        if($length!=0)
        {
        for($i=0;$i<$length;$i++)
        {
        unlink('%kernel.root_dir%/../galeria/uploads/photos/'.$new.'/zdjecia/'.$files1[$i]);
        }
        }
            rmdir('%kernel.root_dir%/../galeria/uploads/photos/'.$new.'/zdjecia');
            rmdir('%kernel.root_dir%/../galeria/uploads/photos/'.$new);

        $em->remove($photo);
        $em->flush();

        return $this->redirectToRoute('gallery-admin');

     return $this->render('admin/gallery-admin.html.twig');
    }

   /**
     * @Route("/admin/g/photos/{name}", name="update-photos")
     */
    public function schowek($name,Request $request)
    {

      $fs = new Filesystem();

      $form = $this->createForm(photosForm::class);
      $form->handleRequest($request);

       if ($form->isSubmitted() && $form->isValid())
       {

      $file=$form->get('photos')->getData();
      $exfile=$file->getClientOriginalName();

      $zip = new ZipArchive;
// Jesli pojawia sie bład ze stringiem !! ze empty czy jaki chuj to tak na prawde ten plik wazy za duzo.....
// $ file->getClientOriginalName()
      $x = $zip->open($file);  // open the zip file to extract
      if ($x === true)
     {

      $zip->extractTo('%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia'); // place in the directory with same name
      $zip->close();
     }
      $obrazek = explode('.', $exfile);

      $dir = '%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia/'.$obrazek[0];

      $files1 = scandir($dir);
      unset($files1[0]);
      unset($files1[1]);
      sort($files1);

      $length=count($files1);
      if($length!=0)
      {
      for($i=0;$i<$length;$i++)
      {
      rename('%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia/'.$obrazek[0].'/'.$files1[$i], '%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia/'.$files1[$i]);
      //   $fs->remove('%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia/', $files1[$i]);
      }
      }
      rmdir('%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia/'.$obrazek[0]);
      //  rename('%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/'.$obrazek[0], '%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia');
      $this->addFlash('success',
            sprintf('Udało się dodać zdjęcia!')
        );
        return $this->redirectToRoute('gallery-admin');
       }

        $dir = '%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia';

        $photos = scandir($dir);
        unset($photos[0]);
        unset($photos[1]);
        sort($photos);

        $length= count($photos)-1;

    return $this->render('admin/photo-updates.html.twig', [
             'photosForm' => $form->createView(),
             'photos' => $photos,
             'length' => $length,
             'name' => $name
      ]);
     }

  /**
    * @Route("/admin/g/photos/{name}/delete/{name2}", name="photo-Cancel")
    */
   public function singlegalleryDelete($name, $name2)
   {

    $this->addFlash('success',
                sprintf('Udało się usunąć zdjęcie !')
            );

   unlink('%kernel.root_dir%/../galeria/uploads/photos/'.$name.'/zdjecia/'.$name2);

   return $this->redirectToRoute('gallery-admin');
   }

  /**
     * @Route("/admin/user", name="users")
     */
    public function users()
    {
        $em = $this->getDoctrine()->getManager();

        $users=$em->getRepository('AppBundle:user')
            ->findAll();

       return $this->render('admin/users.html.twig', [
          'users' => $users
        ]);
    }

   /**
     * @Route("/admin/user/creat", name="users-creat")
     */
    public function usersCreat(Request $request)
    {

        $user = new user();

        $form = $this->createForm(UserForm::class, $user);

        $form->handleRequest($request);
        if ($form->isSubmitted()) {

         $em = $this->getDoctrine()->getManager();
         $user = $form->getData();

        $factory = $this->get('security.encoder_factory');
        $encoder = $factory->getEncoder($user);
        $password = $encoder->encodePassword($user->getpass(), $user->getSalt());
        $user->setpass($password);
        $em->persist($user);
        $em->flush($user);

       $this->addFlash('success',
                sprintf('Udało się stowrzyć artykuł !')
            );

       return $this->redirectToRoute('users');
        }

       return $this->render('admin/users-creat.html.twig', [
         'UserForm' => $form->createView(),
        ]);
    }

     /**
     * @Route("/admin/user/edit/{id}", name="users-edit")
     */
    public function usersEdit(Request $request, user $user)
    {

        $form = $this->createForm(UserForm::class, $user);

        $form->handleRequest($request);
        if ($form->isSubmitted()) {

         $em = $this->getDoctrine()->getManager();

    //    $user =$em->getRepository('AppBundle:user')
    //        ->findOneBy([
    //            'id' => $id
    //        ]);

         $user = $form->getData();

         $factory = $this->get('security.encoder_factory');
         $encoder = $factory->getEncoder($user);
         $password = $encoder->encodePassword($user->getpass(), $user->getSalt());
         $user->setpass($password);

         $em->persist($user);
         $em->flush();

       $this->addFlash('success',
                sprintf('Udało się Edytować Usera !')
            );

       return $this->redirectToRoute('users');
        }
       return $this->render('admin/users-edit.html.twig', [
         'UserForm' => $form->createView(),
        ]);
    }

 /**
     * @Route("/admin/user/delete/{id}", name="users-delete")
     */
    public function usersDelete($id)
    {

      $em = $this->getDoctrine()->getManager();

       $user =$em->getRepository('AppBundle:user')
            ->findOneBy([
                'id' => $id
            ]);

        $em->remove($user);
        $em->flush();

         $this->addFlash('success',
                sprintf('Udało się usunąć Usera !')
            );

       return $this->redirectToRoute('users');
    }

}


text:
Go package for Adobe's color theme service, [Kuler][1].

This is an unofficial wrapper for [Kuler API][2].
Docs are avaiable at [godoc.org][3].

## Install

    $ go get github.com/suapapa/go_kuler

## Example

Search pony themes:

    import "github.com/suapapa/go_kuler"
    ...
    // Set yout kuler apikey to evnvar, KULER_APIKEY
    ks := kuler.NewService(os.Getenv("KULER_APIKEY"))
    themes, _ := ks.Search("MLP", 0, 20)
    for _, t := range themes {
        fmt.Println(t)
    }

You need an [Kuler API Key][4] to use the service.
A theme is consist of 5 swatches. Swatch is [color.Color][5].

[1]:http://kuler.adobe.com
[2]:https://learn.adobe.com/wiki/display/kulerdev/A.+Kuler+API+Documentation
[3]:http://godoc.org/github.com/suapapa/go_kuler
[4]:https://kuler.adobe.com/api/
[5]:http://godoc.org/image/color#Color


text:
<?php

/*
 *contains functions that are used to manipulate the registration table
 */

namespace Peninsula\Model;

use Zend\Db\TableGateway\TableGateway;

 class RegistrationTable
 {
     protected $tableGateway;

     public function __construct(TableGateway $tableGateway)
     {
         $this->tableGateway = $tableGateway;
     }

     public function fetchAll()
     {
         $resultSet = $this->tableGateway->select();
         return $resultSet;
     }

     public function getStud($studID)
     {
         $studID  = (int) $studID;
         $rowset = $this->tableGateway->select(array('studID' => $studID));
         $row = $rowset->current();
         if (!$row) {
             throw new \Exception("Could not find row $studID");
         }
         return $row;
     }

     public function saveStud(Registration $stud)
     {
         $data = array(
             'firstName' => $stud->firstName,
             'lastName'  => $stud->lastName,
             'email'  => $stud->email,
             'phone'  => $stud->phone,

         );

         $studID = (int) $stud->studID;
         if ($studID == 0) {
             $this->tableGateway->insert($data);
         } else {
             if ($this->getStud($studID)) {
                 $this->tableGateway->update($data, array('studID' => $studID));
             } else {
                 throw new \Exception('Student id does not exist');
             }
         }
     }

     public function deleteAlbum($studID)
     {
         $this->tableGateway->delete(array('studID' => (int) $studID));
     }
 }


text:
NewAccount creates a new account. If settings are nil, the account is initialized with the default settings provided by DefaultSettings().
> **Important note:** This API is currently in Beta and is subject to change. Use of these APIs in production applications is not supported.

## Input

| Parameter       | Type | Required or Optional | Description |
|:---------------|:--------|:--------| :--------|
| setts | *Settings | Optional | The settings to use for the account.  |

## Output

| Return type     | Description |
|:---------------|:--------|
| Account | The account itself. |
| error | Returned for misconfiguration or other types of errors. |

## Example

```go
func ExampleNewAccount()
	newAccount, err := account.NewAccount(account.DefaultSettings())
	if err != nil {
		log.Fatal(err)
	}
	if err := newAccount.Start(); err != nil {
		log.Fatal(err)
	}
}

```


text:
namespace base {
template <typename T>
struct DefaultSingletonTraits;
}  // namespace base

namespace ash {

class KerberosCredentialsManager;

// Singleton that creates and owns one KerberosCredentialsManager instance
// associated with primary profile. Note that KerberosCredentialsManager holds
// non-owning pointer to primary profile, so its life-time depends on the
// life-time of the primary profile.
class KerberosCredentialsManagerFactory
    : public BrowserContextKeyedServiceFactory {
 public:
  // Get existing service instance associated with the primary profile.
  // Note that the interface still expects the context in case primary profile
  // creation is not finalized. It returns nullptr if primary profile doesn't
  // exist or primary profile has changed.
  static KerberosCredentialsManager* GetExisting(
      content::BrowserContext* context);

  // Get existing service instance or create a service instance associated with
  // the primary profile.
  // Note that the interface still expects the context in case primary profile
  // creation is not finalized. It returns nullptr if primary profile doesn't
  // exist or primary profile has changed.
  static KerberosCredentialsManager* Get(content::BrowserContext* context);

  static KerberosCredentialsManagerFactory* GetInstance();

 private:
  friend struct base::DefaultSingletonTraits<KerberosCredentialsManagerFactory>;

  KerberosCredentialsManagerFactory();
  ~KerberosCredentialsManagerFactory() override;

  // Not copyable.
  KerberosCredentialsManagerFactory(const KerberosCredentialsManagerFactory&) =
      delete;
  KerberosCredentialsManagerFactory& operator=(
      const KerberosCredentialsManagerFactory&) = delete;

  bool ServiceIsCreatedWithBrowserContext() const override;

  // Returns nullptr in case context is not a primary profile. Otherwise returns
  // valid KerberosCredentialsManager.
  KeyedService* BuildServiceInstanceFor(
      content::BrowserContext* context) const override;

  // This is workaround to make sure we create only one service (singleton) and
  // prevent errors when two primary profiles are present (which normally
  // shouldn't happen, except in tests).
  // Additional reason to keep this workaround for now is that
  // KerberosCredentialsManager cannot be restarted at the moment, because it's
  // tightly coupled with KerberosClient singleton.
  // Note that it is potential risk for multi-threaded initialization (which is
  // not supported at the moment).
  mutable bool service_instance_created_;
};

}  // namespace ash

// TODO(https://crbug.com/1164001): remove when ChromOS code migration is done.
namespace chromeos {
using ::ash::KerberosCredentialsManagerFactory;
}  // namespace chromeos

#endif  // CHROME_BROWSER_ASH_KERBEROS_KERBEROS_CREDENTIALS_MANAGER_FACTORY_H_