text:
{
  /* global angular, APP_NAME */
  angular.module(APP_NAME).factory('dialogService', dialogService);

  dialogService.$inject = ['$mdDialog'];

  function dialogService($mdDialog) {

    var service = {
      confirm
    }

    return service;

    /////////////////////

    function confirm(message) {
      var dialog = $mdDialog.confirm({
        title: 'Warning',
        textContent: message,
        ok: 'Yes',
        cancel: 'No'
      })
      return $mdDialog.show(dialog);
    }

    function dialogDefaults() {

    }

  }
}


text:
var express = require('express');
var fs = require('fs');
var bodyParser = require('body-parser');
var routes = require('./routes');
var app = express();
app.use(bodyParser.json());
routes(app);
app.listen(9090);

redpajama_set_name: RedPajamaGithub


text:
package io.github.m0pt0pmatt.survivalgames.task;

import io.github.m0pt0pmatt.survivalgames.game.SurvivalGame;
import org.spongepowered.api.util.TextMessageException;

/** Clears players and spectators from the game. */
public class ClearPlayersTask implements Task {

    private static final Task INSTANCE = new ClearPlayersTask();

    @Override
    public void execute(SurvivalGame survivalGame) throws TextMessageException {
        survivalGame.clearPlayerUUIDs();
        survivalGame.clearSpectatorUUIDs();
    }

    public static Task getInstance() {
        return INSTANCE;
    }
}


text:
        TreeTable
        TreeTable is used to display hierarchical data in tabular format..

        Basic

        Singe Selection

    Selected Node: {{selectedFile ? selectedFile.data.name : 'none'}}

        Multiple Selection

    Selected Nodes: {{file.data.name}}

        Editable Cells with Templating

            <template let-node="rowData">
                <input type="text" [(ngModel)]="node.data.name" style="width:100%;box-sizing:border-box;border-width:0px 0px 1px 0px">
            </template>

            <template let-node="rowData">
                <input type="text" [(ngModel)]="node.data.size" style="width:100%;box-sizing:border-box;border-width:0px 0px 1px 0px">
            </template>

            <template let-node="rowData">
                <input type="text" [(ngModel)]="node.data.type" style="width:100%;box-sizing:border-box;border-width:0px 0px 1px 0px">
            </template>

        Lazy Loading

Import

import {TreeTable} from 'primeng/primeng';
import {TreeNode} from 'primeng/primeng';
import {Column} from 'primeng/primeng';

Getting Started

TreeTable component requires an array of TreeNode objects as its value. Let's begin with the TreeNode api.

                            Name
                            Type
                            Default
                            Description

                            label
                            string
                            null
                            Label of the node.

                            data
                            any
                            null
                            Data represented by the node.

                            icon
                            string
                            null
                            Icon of the node to display next to content. Not used by TreeTable.

                            expandedIcon
                            string
                            null
                            Icon to use in expanded state. Not used by TreeTable.

                            collapsedIcon
                            string
                            null
                            Icon to use in collapsed state. Not used by TreeTable.

                            children
                            TreeNode[]
                            null
                            An array of treenodes as children.

                            leaf
                            boolean
                            null
                            Specifies if the node has children. Used in lazy loading.

                            style
                            string
                            null
                            Inline style of the node.

                            styleClass
                            string
                            null
                            Style class of the node.

Most of the time, nodes will be loaded from a remote datasoure, here is an example NodeService that fetches the data from a json file.

@Injectable()
export class NodeService {

    constructor(private http: Http) {}

    getFilesystem() {
        return this.http.get('showcase/resources/data/filesystem.json')
                    .toPromise()
                    .then(res => <TreeNode[]> res.json().data)
                    .then(data => { return data; });
    }
}

The filesystem.json file consists of sample data. In a real application, this should be a dynamic response generated from the remote call.

{
    "data":
    [
        {
            "data":{
                "name":"Documents",
                "size":"75kb",
                "type":"Folder"
            },
            "children":[
                {
                    "data":{
                        "name":"Work",
                        "size":"55kb",
                        "type":"Folder"
                    },
                    "children":[
                        {
                            "data":{
                                "name":"Expenses.doc",
                                "size":"30kb",
                                "type":"Document"
                            }
                        },
                        {
                            "data":{
                                "name":"Resume.doc",
                                "size":"25kb",
                                "type":"Resume"
                            }
                        }
                    ]
                },
                {
                    "data":{
                        "name":"Home",
                        "size":"20kb",
                        "type":"Folder"
                    },
                    "children":[
                        {
                            "data":{
                                "name":"Invoices",
                                "size":"20kb",
                                "type":"Text"
                            }
                        }
                    ]
                }
            ]
        },
        {
            "data":{
                "name":"Pictures",
                "size":"150kb",
                "type":"Folder"
            },
            "children":[
                {
                    "data":{
                        "name":"barcelona.jpg",
                        "size":"90kb",
                        "type":"Picture"
                    }
                },
                {
                    "data":{
                        "name":"primeui.png",
                        "size":"30kb",
                        "type":"Picture"
                    }
                },
                {
                    "data":{
                        "name":"optimus.jpg",
                        "size":"30kb",
                        "type":"Picture"
                    }
                }
            ]
        }
    ]
}

The component that uses this service makes a call to getFiles() and assigns them back to files property that is bound to the tree.

export class TreeTableDemoComponent implements OnInit {

    files: TreeNode[];

    constructor(private nodeService: NodeService) {}

    ngOnInit() {
        this.nodeService.getFileSystem().then(files => this.files = files);
    }

}

<p-treeTable [value]="files">
    <p-column field="name" header="Name"></p-column>
    <p-column field="size" header="Size"></p-column>
    <p-column field="type" header="Type"></p-column>
</p-treeTable>

Column Component

TreeTable utilizes the following options defined by a column component.

Attributes

                            Name
                            Type
                            Default
                            Description

                            field
                            string
                            null
                            Property of a row data.

                            header
                            string
                            null
                            Header text of a column.

                            footer
                            string
                            null
                            Footer text of a column.

                            style
                            string
                            null
                            Inline style of the column.

                            styleClass
                            string
                            null
                            Style class of the column.

<p-column field="vin" header="Vin"></p-column>

Dynamic Colums

Columns can be instantiated using an array as well by iterating with ngFor.

export class TreeTableDemoComponent implements OnInit {

    files: TreeNode[];

    constructor(private nodeService: NodeService) {}

    ngOnInit() {
        this.nodeService.getFileSystem().then(files => this.files = files);

        this.cols = [
                {field: 'name', header: 'Name'},
                {field: 'size', header: 'Size'},
                {field: 'type', header: 'Type'}
            ];
        }
    }
}

<p-treeTable [value]="cars">
    <p-column *ngFor="let col of cols" [field]="col.field" [header]="col.header"></p-column>
</p-treeTable>

Facets

Header and Footer are the two sections aka facets that are capable of displaying custom content.

import {Header} from 'primeng/primeng';
import {Footer} from 'primeng/primeng';

<p-treeTable [value]="files">
    <header>List of Files</header>
    <footer>Choose from the list.</footer>
    <p-column field="name" header="Name"></p-column>
    <p-column field="size" header="Size"></p-column>
    <p-column field="type" header="Type"></p-column>
</p-treeTable>

Selection

TreeTable supports two selection methods, single and multiple. Selection is enabled by setting selectionMode property and providing a single TreeNode or
            an array of TreeNodes to reference the selections depending on the selection mode.

export class TreeTableDemoComponent implements OnInit {

    files: TreeNode[];

    selectedFile: TreeNode;

    constructor(private nodeService: NodeService) {}

    ngOnInit() {
        this.nodeService.getFiles().then(files => this.files = files);
    }

}

<p-treeTable [value]="files" selectionMode="single" [(selection)]="selectedFile"></p-treeTable>

In multiple mode, selection property should be an array.

    export class TreeTableDemoComponent implements OnInit {

        files: TreeNode[];

        selectedFiles: TreeNode[];

        constructor(private nodeService: NodeService) {}

        ngOnInit() {
            this.nodeService.getFiles().then(files => this.files = files);
        }

    }

<p-treeTable [value]="files" selectionMode="single" [(selection)]="selectedFiles"></p-treeTable>

TreeTable provides onNodeSelect and onNodeUnselect options as callbacks for selection feature.

<p-treeTable [value]="files" selectionMode="single" [(selection)]="selectedFiles" (onNodeSelect)="nodeSelect($event)"></p-treeTable>

export class TreeTableDemoComponent implements OnInit {

    files: TreeNode[];

    selectedFiles: TreeNode[];

    constructor(private nodeService: NodeService) {}

    ngOnInit() {
        this.nodeService.getFiles().then(files => this.files = files);
    }

    nodeSelect(event) {
        //event.node = selected node
    }

}

Templating

By default label of a treenode is displayed inside a tree node, in case you need to place custom content define a template inside a column that gets
                the column as an implicit variable and rowData as the node instance. Example below places an input field to create editable treenodes.

<h3>Template</h3>
<p-treeTable [value]="files">
    <p:column>
        <template let-col #node="rowData">
            <input [(ngModel)]="node.data.name" type="text" style="width:100%">
        </template>
    </p:column>
</p-treeTable>

Lazy Loading

Lazy loading is handy to deal with large datasets. Instead of loading the whole tree, nodes can be loaded at onNodeExpand event.
            Important part of implementing lazy loading is defining leaf property of a node as false, this will instruct tree to display an arrow icon
            to indicate there are children of this node although they are not loaded yet. When the lazy node is expanded, onNodeExpand is called
            and a remote call can be made to add the children to the expanded node.

<p-treeTable [value]="files" (onNodeExpand)="loadNode($event)"></p-treeTable>

export class TreeTableDemoComponent implements OnInit {

    files: TreeNode[];

    selectedFiles: TreeNode[];

    constructor(private nodeService: NodeService) {}

    ngOnInit() {
        //initial nodes
        this.nodeService.getFiles().then(files => this.files = files);
    }

    loadNode(event) {
        if(event.node) {
            //in a real application, make a call to a remote url to load children of the current node and add the new nodes as children
            this.nodeService.getLazyFilesystem().then(nodes => event.node.children = nodes);
        }
    }

}

Assume at ngOnInit treetable is initialized with a data like below that has nodes having no actual children but leaf property is set false.

{
    "data":
    [
        {
            "data":{
                "name":"Lazy Folder 0",
                "size":"75kb",
                "type":"Folder"
            },
            "leaf": false
        },
        {
            "data":{
                "name":"Lazy Folder 1",
                "size":"150kb",
                "type":"Folder"
            },
            "leaf": false
        }
    ]
}

Attributes

                            Name
                            Type
                            Default
                            Description

                            value
                            array
                            null
                            An array of treenodes.

                            selectionMode
                            string
                            null
                            Defines the selection mode, valid values "single" and "multiple".

                            selection
                            any
                            null
                            A single treenode instance or an array to refer to the selections.

                            style
                            string
                            null
                            Inline style of the component.

                            styleClass
                            string
                            null
                            Style class of the component.

Events

                            Name
                            Parameters
                            Description

                            onNodeSelect
                            event.originalEvent: browser event

                                event.node: Selected node instance.
                            Callback to invoke when a node is selected.

                            onNodeUnselect
                            event.originalEvent: browser event

                                event.node: Unselected node instance.
                            Callback to invoke when a node is unselected.

                            onNodeExpand
                            event.originalEvent: browser event

                                event.node: Expanded node instance.
                            Callback to invoke when a node is expanded.

                            onNodeCollapse
                            event.originalEvent: browser event

                                event.node: Collapsed node instance.
                            Callback to invoke when a node is collapsed.

Styling

Following is the list of structural style classes, for theming classes visit theming page.

                            Name
                            Element

                            ui-treetable
                            Main container element

                            ui-treetable-header
                            Header element

                            ui-treetable-tablewrapper
                            Container of table

                            ui-treetable-footer
                            Footer element

Dependencies

Native component that requires the css of PrimeUI TreeTable.

<p-growl [value]="msgs"></p-growl>

<p-treeTable [value]="files" [style]="{'margin-bottom':'30px'}">
    <header>Basic</header>
    <p-column field="name" header="Name"></p-column>
    <p-column field="size" header="Size"></p-column>
    <p-column field="type" header="Type"></p-column>
</p-treeTable>

<p-treeTable [value]="files" selectionMode="single" [(selection)]="selectedFile"
    (onNodeSelect)="nodeSelect($event)" (onNodeUnselect)="nodeUnselect($event)">
    <header>Singe Selection</header>
    <p-column field="name" header="Name"></p-column>
    <p-column field="size" header="Size"></p-column>
    <p-column field="type" header="Type"></p-column>
</p-treeTable>
Selected Node: {{selectedFile ? selectedFile.data.name : 'none'}}

<p-treeTable [value]="files" selectionMode="multiple" [(selection)]="selectedFiles"
    (onNodeSelect)="nodeSelect($event)" (onNodeUnselect)="nodeUnselect($event)" [style]="{'margin-top':'30px'}">
    <header>Multiple Selection</header>
    <p-column field="name" header="Name"></p-column>
    <p-column field="size" header="Size"></p-column>
    <p-column field="type" header="Type"></p-column>
</p-treeTable>
Selected Nodes: <span *ngFor="let file of selectedFiles">{{file.data.name}} </span>

<p-treeTable [value]="files" [style]="{'margin-top':'30px'}">
    <header>Editable Cells with Templating</header>
    <p-column field="name" header="Name">
        <template let-node="rowData">
            <input type="text" [(ngModel)]="node.data.name" style="width:100%;box-sizing:border-box;border-width:0px 0px 1px 0px">
        </template>
    </p-column>
    <p-column field="size" header="Size">
        <template let-node="rowData">
            <input type="text" [(ngModel)]="node.data.size" style="width:100%;box-sizing:border-box;border-width:0px 0px 1px 0px">
        </template>
    </p-column>
    <p-column field="type" header="Type">
        <template let-node="rowData">
            <input type="text" [(ngModel)]="node.data.type" style="width:100%;box-sizing:border-box;border-width:0px 0px 1px 0px">
        </template>
    </p-column>
</p-treeTable>

<p-treeTable [value]="lazyFiles" [style]="{'margin-top':'30px'}"
    (onNodeExpand)="nodeExpand($event)">
    <header>Lazy Loading</header>
    <p-column field="name" header="Name"></p-column>
    <p-column field="size" header="Size"></p-column>
    <p-column field="type" header="Type"></p-column>
</p-treeTable>

export class TreeTableDemo implements OnInit {

    msgs: Message[];

    files: TreeNode[];

    lazyFiles: TreeNode[];

    selectedFile: TreeNode;

    selectedFiles: TreeNode[];

    constructor(private nodeService: NodeService) { }

    ngOnInit() {
        this.nodeService.getFilesystem().then(files => this.files = files);
        this.nodeService.getLazyFilesystem().then(files => this.lazyFiles = files);
    }

    nodeSelect(event) {
        this.msgs = [];
        this.msgs.push({severity: 'info', summary: 'Node Selected', detail: event.node.data.name});
    }

    nodeUnselect(event) {
        this.msgs = [];
        this.msgs.push({severity: 'info', summary: 'Node Unselected', detail: event.node.data.name});
    }

    nodeExpand(event) {
        if(event.node) {
            //in a real application, make a call to a remote url to load children of the current node and add the new nodes as children
            this.nodeService.getLazyFilesystem().then(nodes => event.node.children = nodes);
        }
    }
}


text:
#pragma once
#include <aws/elasticbeanstalk/ElasticBeanstalk_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace ElasticBeanstalk
{
namespace Model
{

  /**
   *
Describes the solution stack.

   */
  class AWS_ELASTICBEANSTALK_API SolutionStackDescription
  {
  public:
    SolutionStackDescription();
    SolutionStackDescription(const Aws::Utils::Xml::XmlNode& xmlNode);
    SolutionStackDescription& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
The name of the solution stack.

     */
    inline const Aws::String& GetSolutionStackName() const{ return m_solutionStackName; }

    /**
     *
The name of the solution stack.

     */
    inline void SetSolutionStackName(const Aws::String& value) { m_solutionStackNameHasBeenSet = true; m_solutionStackName = value; }

    /**
     *
The name of the solution stack.

     */
    inline void SetSolutionStackName(Aws::String&& value) { m_solutionStackNameHasBeenSet = true; m_solutionStackName = value; }

    /**
     *
The name of the solution stack.

     */
    inline void SetSolutionStackName(const char* value) { m_solutionStackNameHasBeenSet = true; m_solutionStackName.assign(value); }

    /**
     *
The name of the solution stack.

     */
    inline SolutionStackDescription& WithSolutionStackName(const Aws::String& value) { SetSolutionStackName(value); return *this;}

    /**
     *
The name of the solution stack.

     */
    inline SolutionStackDescription& WithSolutionStackName(Aws::String&& value) { SetSolutionStackName(value); return *this;}

    /**
     *
The name of the solution stack.

     */
    inline SolutionStackDescription& WithSolutionStackName(const char* value) { SetSolutionStackName(value); return *this;}

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline const Aws::Vector<Aws::String>& GetPermittedFileTypes() const{ return m_permittedFileTypes; }

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline void SetPermittedFileTypes(const Aws::Vector<Aws::String>& value) { m_permittedFileTypesHasBeenSet = true; m_permittedFileTypes = value; }

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline void SetPermittedFileTypes(Aws::Vector<Aws::String>&& value) { m_permittedFileTypesHasBeenSet = true; m_permittedFileTypes = value; }

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline SolutionStackDescription& WithPermittedFileTypes(const Aws::Vector<Aws::String>& value) { SetPermittedFileTypes(value); return *this;}

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline SolutionStackDescription& WithPermittedFileTypes(Aws::Vector<Aws::String>&& value) { SetPermittedFileTypes(value); return *this;}

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline SolutionStackDescription& AddPermittedFileTypes(const Aws::String& value) { m_permittedFileTypesHasBeenSet = true; m_permittedFileTypes.push_back(value); return *this; }

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline SolutionStackDescription& AddPermittedFileTypes(Aws::String&& value) { m_permittedFileTypesHasBeenSet = true; m_permittedFileTypes.push_back(value); return *this; }

    /**
     *
The permitted file types allowed for a solution stack.

     */
    inline SolutionStackDescription& AddPermittedFileTypes(const char* value) { m_permittedFileTypesHasBeenSet = true; m_permittedFileTypes.push_back(value); return *this; }

  private:
    Aws::String m_solutionStackName;
    bool m_solutionStackNameHasBeenSet;
    Aws::Vector<Aws::String> m_permittedFileTypes;
    bool m_permittedFileTypesHasBeenSet;
  };

} // namespace Model
} // namespace ElasticBeanstalk
} // namespace Aws


text:
package gopack

import (
	"fmt"
	"reflect"
	"sync"
)

// Any panic originating from this package
// will be of type Error.
type Error struct {
	error
}

type cachedPacker struct {
	packer
	bytes int
}

var packerCache struct {
	sync.RWMutex
	m map[reflect.Type]cachedPacker
}

var unpackerCache struct {
	sync.RWMutex
	m map[reflect.Type]unpacker
}

// Pack the fields of strct into b. Fields must be
// of an int or bool type, or must be of a struct
// type whose fields are properly typed (structs
// may be nested arbitrarily deep). If strct is not
// a struct or a pointer to a struct, or if any
// of the fields are not of an allowed type, Pack
// will panic.
//
// Fields may optionally be tagged with a size in
// bits using the key "gopack".
//
//	type unixMode struct {
//		User, Group, Other uint8 `gopack:"3"`
//	}
//
// Fields without a tag are taken to be their native
// sizes (for example, 8 bits for uint8, 16 for int16,
// etc). If a field is tagged with an impossible size
// (less than 1, or larger than the native size of the
// field), or if the tag value cannot be parsed as an
// integer, Pack will panic. If a field holds a value
// which cannot be packed in the specified number of
// bits, Pack will panic (for example, if unixMode.User
// from the above example were set to 8, which cannot
// be stored in 3 bits).
//
// bool-typed fields always take up 1 bit, and any field
// tags are ignored.
//
// If there are bits in the last used byte of b which
// are beyond the end of the packed data (for example,
// the last four bits of the second byte when packing
// 12 bits), those bits will be zeroed. If b is not
// sufficiently long to hold all of the bits of strct,
// Pack will panic.
//
// Fields which are not exported are ignored, and
// take up no space in the packing.
//
//	// Only requires 2 bytes to store
//	type person struct {
//		name string
//		Age, Height uint8
//	}
func Pack(b []byte, strct interface{}) {
	v := reflect.ValueOf(strct)
	p, bytes := packerFor(v)
	if len(b) < bytes {
		panic(Error{fmt.Errorf("gopack: buffer too small (%v; need %v)", len(b), bytes)})
	}
	for i := 0; i < bytes; i++ {
		b[i] = 0
	}
	p(b, v)
}

// PackedSizeof returns the number of bytes needed to pack the given value.
func PackedSizeof(strct interface{}) int {
	_, bytes := packerFor(reflect.ValueOf(strct))
	return bytes
}

// Returns the packer and number of bytes needed by this packer.
func packerFor(v reflect.Value) (packer, int) {
	typ := v.Type()
	packerCache.RLock()
	entry, ok := packerCache.m[typ]
	packerCache.RUnlock()
	if ok {
		return entry.packer, entry.bytes
	}

	p, bytes := makePackerWrapper(typ)
	packerCache.Lock()
	packerCache.m[typ] = cachedPacker{packer: p, bytes: bytes}
	packerCache.Unlock()
	return p, bytes
}

// Unpack the data in b into the fields of strct.
// strct must be either a struct or a pointer to
// a struct, or else Unpack will panic. However,
// if strct is not a pointer, all values extracted
// from b will be discarded since strct is passed by
// value.
//
// All of the restrictions on the type of strct
// documented for Pack apply to Unpack.
//
// If b is not sufficiently long to hold all of
// the bits of strct, Unpack will panic.
func Unpack(b []byte, strct interface{}) {
	v := reflect.ValueOf(strct)
	typ := v.Type()
	unpackerCache.RLock()
	u, ok := unpackerCache.m[typ]
	unpackerCache.RUnlock()
	if ok {
		u(b, v)
		return
	}

	u = makeUnpackerWrapper(typ)
	unpackerCache.Lock()
	unpackerCache.m[typ] = u
	unpackerCache.Unlock()
	u(b, v)
}

func init() {
	packerCache.m = make(map[reflect.Type]cachedPacker)
	unpackerCache.m = make(map[reflect.Type]unpacker)
}


text: This site was built using Jekyll and is hosted on Github Photos from Unsplash and text generated with Hipster Ipsum. © 2017


text:
module Strava

  class DataStore
    def initialize
      @store = {
        athletes: [],
      }
    end

    def athletes
       @store[:athletes]
    end

    def add_athlete(athlete)
      @store[:athletes] << athlete
    end
  end
end


text:
title: "Open Source Software"
excerpt: "Open Source Living is a great reference website of open source software divided by any category, from web development to entertainment."
header:
  teaser: /images/osliving.jpg
  og_image: /images/osliving.jpg
---

![osliving](/images/osliving.jpg){: .align-left}

Para todos que pretendam enveredar no caminho do bem, fica aqui um site de referência de software [Open Source](http://en.wikipedia.org/wiki/Open_source) de qualidade.

[Open Source Living](http://www.osliving.com/index.html){: .btn .btn--info}

Usem e abusem...
May the source be with you!


text:
package org.terracotta.statistics;

import org.terracotta.statistics.observer.ChainedObserver;

import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * An abstract {@code SourceStatistic} that handles derived statistic
 * (de)registration.
 * <p>
 * This implementation exposes the currently registered statistics via the
 * {@link #derivedStatistics} collection.  Concrete implementations of this class should
 * fire on the contents of this to update the derived statistics.
 */
public class AbstractSourceStatistic<T extends ChainedObserver> implements SourceStatistic<T> {

  protected final Collection<T> derivedStatistics = new CopyOnWriteArrayList<>();

  @Override
  public void addDerivedStatistic(T derived) {
    derivedStatistics.add(derived);
  }

  @Override
  public void removeDerivedStatistic(T derived) {
    derivedStatistics.remove(derived);
  }

  public Collection<T> getDerivedStatistics() {
    return Collections.unmodifiableCollection(derivedStatistics);
  }
}


text:
<?php

/**
 * sfDatabaseManager allows you to setup your database connectivity before the
 * request is handled. This eliminates the need for a filter to manage database
 * connections.
 *
 * @package    symfony
 * @subpackage database
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @author     Sean Kerr <sean@code-box.org>
 * @version    SVN: $Id: sfDatabaseManager.class.php 7791 2008-03-09 21:57:09Z fabien $
 */
class sfDatabaseManager
{
  protected
    $databases = array();

  /**
   * Retrieves the database connection associated with this sfDatabase implementation.
   *
   * @param string A database name
   *
   * @return mixed A Database instance
   *
   * @throws sfDatabaseException If the requested database name does not exist
   */
  public function getDatabase($name = 'default')
  {
    if (isset($this->databases[$name]))
    {
      return $this->databases[$name];
    }

    // nonexistent database name
    $error = 'Database "%s" does not exist';
    $error = sprintf($error, $name);

    throw new sfDatabaseException($error);
  }

  /**
   * Initializes this sfDatabaseManager object
   *
   * @return bool true, if initialization completes successfully, otherwise false
   *
   * @throws sfInitializationException If an error occurs while initializing this sfDatabaseManager object
   */
  public function initialize()
  {
    // load database configuration
    require(sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_config_dir_name').'/databases.yml'));
  }

  /**
   * Executes the shutdown procedure
   *
   * @return void
   *
   * @throws sfDatabaseException If an error occurs while shutting down this DatabaseManager
   */
  public function shutdown()
  {
    // loop through databases and shutdown connections
    foreach ($this->databases as $database)
    {
      $database->shutdown();
    }
  }
}


text:
package net.java.sip.communicator.impl.osdependent;

import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.*;

import javax.swing.*;
import javax.swing.event.*;

import net.java.sip.communicator.impl.osdependent.SystemTray.SystemTrayPeer;

import org.jitsi.util.*;

/**
 * @author Lubomir Marinov
 */
public class TrayIcon
{
    private final TrayIconPeer peer;

    public TrayIcon(ImageIcon icon, String tooltip, Object popup)
        throws IllegalArgumentException,
        UnsupportedOperationException,
        HeadlessException,
        SecurityException
    {
        SystemTrayPeer systemTrayPeer =
            SystemTray.getDefaultSystemTray().getPeer();
        if (systemTrayPeer != null)
            peer = systemTrayPeer.createTrayIcon(icon, tooltip, popup);
        else
            peer = null;
    }

    public void addActionListener(ActionListener listener)
    {
        if (peer != null)
            peer.addActionListener(listener);
    }

    public void addBalloonActionListener(ActionListener listener)
    {
        if (peer != null)
            peer.addBalloonActionListener(listener);
    }

    public void displayMessage(String caption, String text,
                               java.awt.TrayIcon.MessageType messageType)
        throws NullPointerException
    {
        if (peer != null)
            peer.displayMessage(caption, text, messageType);
    }

    TrayIconPeer getPeer()
    {
        return peer;
    }

    public void setIcon(ImageIcon icon) throws NullPointerException
    {
        if (peer != null)
            peer.setIcon(icon);
    }

    public void setIconAutoSize(boolean autoSize)
    {
        if (peer != null)
            peer.setIconAutoSize(autoSize);
    }

    static interface TrayIconPeer
    {
        void addActionListener(ActionListener listener);

        void addBalloonActionListener(ActionListener listener);

        void displayMessage(String caption, String text,
                            java.awt.TrayIcon.MessageType messageType)
            throws NullPointerException;

        void setIcon(ImageIcon icon) throws NullPointerException;

        void setIconAutoSize(boolean autoSize);
    }

    static class AWTTrayIconPeer
        implements TrayIconPeer
    {
        private final Method addActionListener;

        private final Method addMouseListener;

        private final Method displayMessage;

        private final Object impl;

        private final Class<?> messageTypeClass;

        private final Method setIcon;

        private final Method setIconAutoSize;

        public AWTTrayIconPeer(Class<?> clazz, Image image, String tooltip,
            Object popup)
            throws IllegalArgumentException,
            UnsupportedOperationException,
            HeadlessException,
            SecurityException
        {
            Constructor<?> constructor;
            try
            {
                if (popup instanceof JPopupMenu)
                {
                    constructor = clazz.getConstructor(new Class<?>[]
                        { Image.class, String.class });
                }
                else
                {
                    constructor = clazz.getConstructor(new Class<?>[]
                        { Image.class, String.class, PopupMenu.class });
                }
                addActionListener =
                    clazz.getMethod("addActionListener", new Class<?>[]
                    { ActionListener.class });
                addMouseListener =
                    clazz.getMethod("addMouseListener", new Class<?>[]
                    { MouseListener.class });
                messageTypeClass =
                    Class.forName("java.awt.TrayIcon$MessageType");
                displayMessage =
                    clazz.getMethod("displayMessage", new Class<?>[]
                    { String.class, String.class, messageTypeClass });
                setIcon = clazz.getMethod("setImage", new Class<?>[]
                { Image.class });
                setIconAutoSize =
                    clazz.getMethod("setImageAutoSize", new Class<?>[]
                    { boolean.class });
            }
            catch (ClassNotFoundException ex)
            {
                throw new UnsupportedOperationException(ex);
            }
            catch (NoSuchMethodException ex)
            {
                throw new UnsupportedOperationException(ex);
            }

            try
            {
                if (popup instanceof JPopupMenu)
                {
                    impl = constructor.newInstance(
                        new Object[] { image, tooltip });
                    addMouseListener(new AWTMouseAdapter((JPopupMenu) popup));
                }
                else
                {
                    impl = constructor.newInstance(
                        new Object[] { image, tooltip, popup });
                }
            }
            catch (IllegalAccessException ex)
            {
                throw new UnsupportedOperationException(ex);
            }
            catch (InstantiationException ex)
            {
                throw new UnsupportedOperationException(ex);
            }
            catch (InvocationTargetException ex)
            {
                Throwable cause = ex.getCause();
                if (cause == null)
                    throw new UnsupportedOperationException(ex);
                if (cause instanceof IllegalArgumentException)
                    throw (IllegalArgumentException) cause;
                if (cause instanceof UnsupportedOperationException)
                    throw (UnsupportedOperationException) cause;
                if (cause instanceof HeadlessException)
                    throw (HeadlessException) cause;
                if (cause instanceof SecurityException)
                    throw (SecurityException) cause;
                throw new UnsupportedOperationException(cause);
            }
        }

        public void addActionListener(ActionListener listener)
        {
            try
            {
                addActionListener.invoke(getImpl(), new Object[]
                { listener });
            }
            catch (IllegalAccessException ex)
            {
                throw new UndeclaredThrowableException(ex);
            }
            catch (InvocationTargetException ex)
            {
                Throwable cause = ex.getCause();
                throw new UndeclaredThrowableException((cause == null) ? ex
                    : cause);
            }
        }

        public void addMouseListener(MouseListener listener)
        {
            try
            {
                addMouseListener.invoke(getImpl(), new Object[] { listener });
            }
            catch (IllegalAccessException ex)
            {
                throw new UndeclaredThrowableException(ex);
            }
            catch (InvocationTargetException ex)
            {
                Throwable cause = ex.getCause();
                throw new UndeclaredThrowableException((cause == null) ? ex
                    : cause);
            }
        }

        public void addBalloonActionListener(ActionListener listener)
        {
            // java.awt.TrayIcon doesn't support addBalloonActionListener()
        }

        public void displayMessage(String caption, String text,
                                   java.awt.TrayIcon.MessageType messageType)
            throws NullPointerException
        {
            try
            {
                displayMessage.invoke(getImpl(), new Object[]
                { caption, text, messageType.name() });
            }
            catch (IllegalAccessException ex)
            {
                throw new UndeclaredThrowableException(ex);
            }
            catch (InvocationTargetException ex)
            {
                Throwable cause = ex.getCause();
                if (cause instanceof NullPointerException)
                    throw (NullPointerException) cause;
                throw new UndeclaredThrowableException((cause == null) ? ex
                    : cause);
            }
        }

        public Object getImpl()
        {
            return impl;
        }

        public void setIcon(ImageIcon icon) throws NullPointerException
        {
            try
            {
                setIcon.invoke(getImpl(), new Object[]
                { (icon == null) ? null : icon.getImage() });
            }
            catch (IllegalAccessException ex)
            {
                throw new UndeclaredThrowableException(ex);
            }
            catch (InvocationTargetException ex)
            {
                Throwable cause = ex.getCause();
                if (cause instanceof NullPointerException)
                    throw (NullPointerException) cause;
                throw new UndeclaredThrowableException((cause == null) ? ex
                    : cause);
            }
        }

        public void setIconAutoSize(boolean autoSize)
        {
            try
            {
                setIconAutoSize.invoke(getImpl(), new Object[]
                { autoSize });
            }
            catch (IllegalAccessException ex)
            {
                throw new UndeclaredThrowableException(ex);
            }
            catch (InvocationTargetException ex)
            {
                Throwable cause = ex.getCause();
                throw new UndeclaredThrowableException((cause == null) ? ex
                    : cause);
            }
        }
    }

    /**
     * Extended mouse adapter to show the JPopupMenu in Java 6
     * Based on : http://weblogs.java.net/blog/ixmal/archive/2006/05/using_jpopupmen.html
     * And : http://weblogs.java.net/blog/alexfromsun/archive/2008/02/jtrayicon_updat.html
     *
     * Use a hidden JWindow (JDialog for Windows) to manage the JPopupMenu.
     *
     * @author Damien Roth
     */
    private static class AWTMouseAdapter
        extends MouseAdapter
    {
        private JPopupMenu popup = null;
        private Window hiddenWindow = null;

        public AWTMouseAdapter(JPopupMenu p)
        {
            this.popup = p;
            this.popup.addPopupMenuListener(new PopupMenuListener()
            {
                public void popupMenuWillBecomeVisible(PopupMenuEvent e)
                {}

                public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
                {
                    if (hiddenWindow != null)
                    {
                        hiddenWindow.dispose();
                        hiddenWindow = null;
                    }
                }

                public void popupMenuCanceled(PopupMenuEvent e)
                {
                    if (hiddenWindow != null)
                    {
                        hiddenWindow.dispose();
                        hiddenWindow = null;
                    }
                }
            });
        }

        @Override
        public void mouseReleased(MouseEvent e)
        {
            showPopupMenu(e);
        }

        @Override
        public void mousePressed(MouseEvent e)
        {
            showPopupMenu(e);
        }

        private void showPopupMenu(MouseEvent e)
        {
            if (e.isPopupTrigger() && popup != null)
            {
                if (hiddenWindow == null)
                {
                    if (OSUtils.IS_WINDOWS)
                    {
                        hiddenWindow = new JDialog((Frame) null);
                        ((JDialog) hiddenWindow).setUndecorated(true);
                    }
                    else
                        hiddenWindow = new JWindow((Frame) null);

                    hiddenWindow.setAlwaysOnTop(true);
                    Dimension size = popup.getPreferredSize();

                    Point centerPoint = GraphicsEnvironment
                                            .getLocalGraphicsEnvironment()
                                                .getCenterPoint();

                    if(e.getY() > centerPoint.getY())
                        hiddenWindow
                            .setLocation(e.getX(), e.getY() - size.height);
                    else
                        hiddenWindow
                            .setLocation(e.getX(), e.getY());

                    hiddenWindow.setVisible(true);

                    popup.show(
                            ((RootPaneContainer)hiddenWindow).getContentPane(),
                            0, 0);

                    // popup works only for focused windows
                    hiddenWindow.toFront();
                }
            }
        }
    }
}


text:
<?php

namespace frontend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\PsikologiProfil;

/**
 * PsikologiProfilSearch represents the model behind the search form about `app\models\PsikologiProfil`.
 */
class PsikologiProfilSearch extends PsikologiProfil
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['psikologi_profil_id'], 'integer'],
            [['nama', 'pangkat', 'no_kad_pengenalan', 'tarikh_lahir', 'jantina', 'alamat_1', 'alamat_2', 'alamat_3', 'alamat_negeri', 'alamat_bandar', 'alamat_poskod', 'no_tel_bimbit', 'emel', 'facebook'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = PsikologiProfil::find()
                ->joinWith(['refPangkatPsikologi']);

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'psikologi_profil_id' => $this->psikologi_profil_id,
            'tarikh_lahir' => $this->tarikh_lahir,
        ]);

        $query->andFilterWhere(['like', 'nama', $this->nama])
            ->andFilterWhere(['like', 'tbl_ref_pangkat_psikologi.desc', $this->pangkat])
            ->andFilterWhere(['like', 'no_kad_pengenalan', $this->no_kad_pengenalan])
            ->andFilterWhere(['like', 'jantina', $this->jantina])
            ->andFilterWhere(['like', 'alamat_1', $this->alamat_1])
            ->andFilterWhere(['like', 'alamat_2', $this->alamat_2])
            ->andFilterWhere(['like', 'alamat_3', $this->alamat_3])
            ->andFilterWhere(['like', 'alamat_negeri', $this->alamat_negeri])
            ->andFilterWhere(['like', 'alamat_bandar', $this->alamat_bandar])
            ->andFilterWhere(['like', 'alamat_poskod', $this->alamat_poskod])
            ->andFilterWhere(['like', 'no_tel_bimbit', $this->no_tel_bimbit])
            ->andFilterWhere(['like', 'emel', $this->emel])
            ->andFilterWhere(['like', 'facebook', $this->facebook]);

        return $dataProvider;
    }
}


text:
package org.apache.cloudstack.api.command.admin;

import org.apache.cloudstack.api.ResponseObject.ResponseView;
import org.apache.cloudstack.api.command.user.UserCmd;

public interface AdminCmd extends UserCmd {
    default ResponseView getResponseView() {
        return ResponseView.Full;
    }
}


text:
package ru.r2cloud.device;

import ru.r2cloud.lora.LoraStatus;
import ru.r2cloud.lora.loraat.LoraAtClient;
import ru.r2cloud.model.DeviceConfiguration;
import ru.r2cloud.model.DeviceConnectionStatus;
import ru.r2cloud.model.DeviceStatus;
import ru.r2cloud.model.DeviceType;
import ru.r2cloud.model.ObservationRequest;
import ru.r2cloud.model.Transmitter;
import ru.r2cloud.predict.PredictOreKit;
import ru.r2cloud.satellite.IObservationDao;
import ru.r2cloud.satellite.ObservationFactory;
import ru.r2cloud.satellite.Schedule;
import ru.r2cloud.satellite.TransmitterFilter;
import ru.r2cloud.satellite.decoder.DecoderService;
import ru.r2cloud.satellite.reader.IQReader;
import ru.r2cloud.satellite.reader.LoraAtReader;
import ru.r2cloud.util.Clock;
import ru.r2cloud.util.Configuration;
import ru.r2cloud.util.ThreadPoolFactory;

public class LoraAtDevice extends Device {

	private final LoraAtClient client;
	private final Configuration config;

	public LoraAtDevice(String id, TransmitterFilter filter, int numberOfConcurrentObservations, ObservationFactory observationFactory, ThreadPoolFactory threadpoolFactory, Clock clock, DeviceConfiguration deviceConfiguration, IObservationDao observationDao, DecoderService decoderService,
						Configuration config, PredictOreKit predict, Schedule schedule, LoraAtClient client) {
		super(id, filter, numberOfConcurrentObservations, observationFactory, threadpoolFactory, clock, deviceConfiguration, observationDao, decoderService, predict, schedule);
		this.client = client;
		this.config = config;
	}

	@Override
	public IQReader createReader(ObservationRequest req, Transmitter satellite) {
		return new LoraAtReader(config, req, client, satellite);
	}

	@Override
	public DeviceStatus getStatus() {
		DeviceStatus result = super.getStatus();
		result.setType(DeviceType.LORA);
		LoraStatus loraStatus = client.getStatus();
		result.setStatus(loraStatus.getDeviceStatus());
		if (loraStatus.getDeviceStatus().equals(DeviceConnectionStatus.FAILED)) {
			result.setFailureMessage(loraStatus.getStatus());
		}
		return result;
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>P-POD Auxiliary Payload on the STP-ST26/Minotaur-IV Launch</AwardTitle>
    <AwardEffectiveDate>02/14/2008</AwardEffectiveDate>
    <AwardExpirationDate>02/28/2010</AwardExpirationDate>
    <AwardAmount>121438</AwardAmount>
    <AwardInstrument>
      <Value>Contract Interagency Agreement</Value>
    </AwardInstrument>
    <Organization>
      06020204
      <Directorate>
        <LongName>Directorate For Geosciences</LongName>
      </Directorate>
      <Division>
        <LongName>Div Atmospheric & Geospace Sciences</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Therese Moretto Jorgensen</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>This is a transfer of funds to the U.S. Air Force Space Test Program for accommodations and launch services for an auxiliary payload carrying a NSF-sponsored spacecraft on the STP-S26/Minotaur-IV launch scheduled for December 2009. The NSF sponsored nano-satellite will be a "triple (3U) cubesat" and will utilize the Poly-Picosat Orbital Deployer (P-POD) system. The purpose of the NSF nano-satellite mission will be space weather research. The selection of the mission will be done following a solicitation for proposals and scientific and technical review of the proposals. This will be the first project under a new NSF initiative titled: "CubeSat-based Science Missions for Space Weather and Atmospheric Research."</AbstractNarration>
    <MinAmdLetterDate>02/14/2008</MinAmdLetterDate>
    <MaxAmdLetterDate>04/26/2011</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>0822792</AwardID>
    <Investigator>
      <FirstName>Dennis</FirstName>
      <LastName>McNabb</LastName>
      <EmailAddress>dennis.mcnabb@kirtland.af.mil</EmailAddress>
      <StartDate>02/14/2008</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Department of the Air Force, Space and Missile Systems Center</Name>
      <CityName>Kirtland AFB</CityName>
      <ZipCode>871175776</ZipCode>
      <PhoneNumber></PhoneNumber>
      <StreetAddress>SMC Det 12/rp</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>New Mexico</StateName>
      <StateCode>NM</StateCode>
    </Institution>
  </Award>
</rootTag>


text:
*%%description%%*

## Link plugin
`./node_modules/.bin/actionhero link --%%dirname%%` in project root

## To finish setup
`cd plugins/%%dirname%%`
`npm init` in the plugin root, if this plugin is to have its own npm package.json file
`git init` in the plugin root, if this plugin is to have its own git repo

## Make sure that the plugin root is an option in api.config.general.paths in config/api.js:
`'plugin':      [
  __dirname + '/../plugins'  ,
  __dirname + '/../node_modules',
]`


text:
/****************************************************************************
** Meta object code from reading C++ file 'qdeclarativeanchors_p.h'
**
** Created: Mon 26. Nov 09:57:16 2012
**      by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "../../../graphicsitems/qdeclarativeanchors_p.h"
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'qdeclarativeanchors_p.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.4. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_QDeclarativeAnchors[] = {

 // content:
       6,       // revision
       0,       // classname
       0,    0, // classinfo
      19,   14, // methods
      17,  109, // properties
       0,    0, // enums/sets
       0,    0, // constructors
       0,       // flags
      17,       // signalCount

 // signals: signature, parameters, type, tag, flags
      21,   20,   20,   20, 0x05,
      35,   20,   20,   20, 0x05,
      50,   20,   20,   20, 0x05,
      63,   20,   20,   20, 0x05,
      79,   20,   20,   20, 0x05,
     103,   20,   20,   20, 0x05,
     129,   20,   20,   20, 0x05,
     147,   20,   20,   20, 0x05,
     161,   20,   20,   20, 0x05,
     179,   20,   20,   20, 0x05,
     199,   20,   20,   20, 0x05,
     220,   20,   20,   20, 0x05,
     239,   20,   20,   20, 0x05,
     261,   20,   20,   20, 0x05,
     278,   20,   20,   20, 0x05,
     308,   20,   20,   20, 0x05,
     340,   20,   20,   20, 0x05,

 // slots: signature, parameters, type, tag, flags
     364,   20,   20,   20, 0x08,
     395,  391,   20,   20, 0x08,

 // properties: name, type, flags
     447,  424, 0x0049510f,
     452,  424, 0x0049510f,
     458,  424, 0x0049510f,
     475,  424, 0x0049510f,
     479,  424, 0x0049510f,
     486,  424, 0x0049510f,
     501,  424, 0x0049510f,
     516,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     524,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     535,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     547,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     570,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     580,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     593,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     614,  510, ((uint)QMetaType::QReal << 24) | 0x00495103,
     646,  629, 0x0049510f,
     651,  629, 0x0049510f,

 // properties: notify_signal_id
       0,
       1,
       5,
       2,
       3,
       4,
       6,
      13,
       9,
      10,
      15,
      11,
      12,
      14,
      16,
       7,
       8,

       0        // eod
};

static const char qt_meta_stringdata_QDeclarativeAnchors[] = {
    "QDeclarativeAnchors\0\0leftChanged()\0"
    "rightChanged()\0topChanged()\0bottomChanged()\0"
    "verticalCenterChanged()\0"
    "horizontalCenterChanged()\0baselineChanged()\0"
    "fillChanged()\0centerInChanged()\0"
    "leftMarginChanged()\0rightMarginChanged()\0"
    "topMarginChanged()\0bottomMarginChanged()\0"
    "marginsChanged()\0verticalCenterOffsetChanged()\0"
    "horizontalCenterOffsetChanged()\0"
    "baselineOffsetChanged()\0"
    "_q_widgetGeometryChanged()\0obj\0"
    "_q_widgetDestroyed(QObject*)\0"
    "QDeclarativeAnchorLine\0left\0right\0"
    "horizontalCenter\0top\0bottom\0verticalCenter\0"
    "baseline\0qreal\0margins\0leftMargin\0"
    "rightMargin\0horizontalCenterOffset\0"
    "topMargin\0bottomMargin\0verticalCenterOffset\0"
    "baselineOffset\0QGraphicsObject*\0fill\0"
    "centerIn\0"
};

void QDeclarativeAnchors::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
    if (_c == QMetaObject::InvokeMetaMethod) {
        Q_ASSERT(staticMetaObject.cast(_o));
        QDeclarativeAnchors *_t = static_cast<QDeclarativeAnchors *>(_o);
        switch (_id) {
        case 0: _t->leftChanged(); break;
        case 1: _t->rightChanged(); break;
        case 2: _t->topChanged(); break;
        case 3: _t->bottomChanged(); break;
        case 4: _t->verticalCenterChanged(); break;
        case 5: _t->horizontalCenterChanged(); break;
        case 6: _t->baselineChanged(); break;
        case 7: _t->fillChanged(); break;
        case 8: _t->centerInChanged(); break;
        case 9: _t->leftMarginChanged(); break;
        case 10: _t->rightMarginChanged(); break;
        case 11: _t->topMarginChanged(); break;
        case 12: _t->bottomMarginChanged(); break;
        case 13: _t->marginsChanged(); break;
        case 14: _t->verticalCenterOffsetChanged(); break;
        case 15: _t->horizontalCenterOffsetChanged(); break;
        case 16: _t->baselineOffsetChanged(); break;
        case 17: _t->d_func()->_q_widgetGeometryChanged(); break;
        case 18: _t->d_func()->_q_widgetDestroyed((*reinterpret_cast< QObject*(*)>(_a[1]))); break;
        default: ;
        }
    }
}

const QMetaObjectExtraData QDeclarativeAnchors::staticMetaObjectExtraData = {
    0,  qt_static_metacall
};

const QMetaObject QDeclarativeAnchors::staticMetaObject = {
    { &QObject::staticMetaObject, qt_meta_stringdata_QDeclarativeAnchors,
      qt_meta_data_QDeclarativeAnchors, &staticMetaObjectExtraData }
};

#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &QDeclarativeAnchors::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION

const QMetaObject *QDeclarativeAnchors::metaObject() const
{
    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}

void *QDeclarativeAnchors::qt_metacast(const char *_clname)
{
    if (!_clname) return 0;
    if (!strcmp(_clname, qt_meta_stringdata_QDeclarativeAnchors))
        return static_cast<void*>(const_cast< QDeclarativeAnchors*>(this));
    return QObject::qt_metacast(_clname);
}

int QDeclarativeAnchors::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 19)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 19;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QDeclarativeAnchorLine*>(_v) = left(); break;
        case 1: *reinterpret_cast< QDeclarativeAnchorLine*>(_v) = right(); break;
        case 2: *reinterpret_cast< QDeclarativeAnchorLine*>(_v) = horizontalCenter(); break;
        case 3: *reinterpret_cast< QDeclarativeAnchorLine*>(_v) = top(); break;
        case 4: *reinterpret_cast< QDeclarativeAnchorLine*>(_v) = bottom(); break;
        case 5: *reinterpret_cast< QDeclarativeAnchorLine*>(_v) = verticalCenter(); break;
        case 6: *reinterpret_cast< QDeclarativeAnchorLine*>(_v) = baseline(); break;
        case 7: *reinterpret_cast< qreal*>(_v) = margins(); break;
        case 8: *reinterpret_cast< qreal*>(_v) = leftMargin(); break;
        case 9: *reinterpret_cast< qreal*>(_v) = rightMargin(); break;
        case 10: *reinterpret_cast< qreal*>(_v) = horizontalCenterOffset(); break;
        case 11: *reinterpret_cast< qreal*>(_v) = topMargin(); break;
        case 12: *reinterpret_cast< qreal*>(_v) = bottomMargin(); break;
        case 13: *reinterpret_cast< qreal*>(_v) = verticalCenterOffset(); break;
        case 14: *reinterpret_cast< qreal*>(_v) = baselineOffset(); break;
        case 15: *reinterpret_cast< QGraphicsObject**>(_v) = fill(); break;
        case 16: *reinterpret_cast< QGraphicsObject**>(_v) = centerIn(); break;
        }
        _id -= 17;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setLeft(*reinterpret_cast< QDeclarativeAnchorLine*>(_v)); break;
        case 1: setRight(*reinterpret_cast< QDeclarativeAnchorLine*>(_v)); break;
        case 2: setHorizontalCenter(*reinterpret_cast< QDeclarativeAnchorLine*>(_v)); break;
        case 3: setTop(*reinterpret_cast< QDeclarativeAnchorLine*>(_v)); break;
        case 4: setBottom(*reinterpret_cast< QDeclarativeAnchorLine*>(_v)); break;
        case 5: setVerticalCenter(*reinterpret_cast< QDeclarativeAnchorLine*>(_v)); break;
        case 6: setBaseline(*reinterpret_cast< QDeclarativeAnchorLine*>(_v)); break;
        case 7: setMargins(*reinterpret_cast< qreal*>(_v)); break;
        case 8: setLeftMargin(*reinterpret_cast< qreal*>(_v)); break;
        case 9: setRightMargin(*reinterpret_cast< qreal*>(_v)); break;
        case 10: setHorizontalCenterOffset(*reinterpret_cast< qreal*>(_v)); break;
        case 11: setTopMargin(*reinterpret_cast< qreal*>(_v)); break;
        case 12: setBottomMargin(*reinterpret_cast< qreal*>(_v)); break;
        case 13: setVerticalCenterOffset(*reinterpret_cast< qreal*>(_v)); break;
        case 14: setBaselineOffset(*reinterpret_cast< qreal*>(_v)); break;
        case 15: setFill(*reinterpret_cast< QGraphicsObject**>(_v)); break;
        case 16: setCenterIn(*reinterpret_cast< QGraphicsObject**>(_v)); break;
        }
        _id -= 17;
    } else if (_c == QMetaObject::ResetProperty) {
        switch (_id) {
        case 0: resetLeft(); break;
        case 1: resetRight(); break;
        case 2: resetHorizontalCenter(); break;
        case 3: resetTop(); break;
        case 4: resetBottom(); break;
        case 5: resetVerticalCenter(); break;
        case 6: resetBaseline(); break;
        case 15: resetFill(); break;
        case 16: resetCenterIn(); break;
        }
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 17;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}

// SIGNAL 0
void QDeclarativeAnchors::leftChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 0, 0);
}

// SIGNAL 1
void QDeclarativeAnchors::rightChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 1, 0);
}

// SIGNAL 2
void QDeclarativeAnchors::topChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 2, 0);
}

// SIGNAL 3
void QDeclarativeAnchors::bottomChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 3, 0);
}

// SIGNAL 4
void QDeclarativeAnchors::verticalCenterChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 4, 0);
}

// SIGNAL 5
void QDeclarativeAnchors::horizontalCenterChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 5, 0);
}

// SIGNAL 6
void QDeclarativeAnchors::baselineChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 6, 0);
}

// SIGNAL 7
void QDeclarativeAnchors::fillChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 7, 0);
}

// SIGNAL 8
void QDeclarativeAnchors::centerInChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 8, 0);
}

// SIGNAL 9
void QDeclarativeAnchors::leftMarginChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 9, 0);
}

// SIGNAL 10
void QDeclarativeAnchors::rightMarginChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 10, 0);
}

// SIGNAL 11
void QDeclarativeAnchors::topMarginChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 11, 0);
}

// SIGNAL 12
void QDeclarativeAnchors::bottomMarginChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 12, 0);
}

// SIGNAL 13
void QDeclarativeAnchors::marginsChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 13, 0);
}

// SIGNAL 14
void QDeclarativeAnchors::verticalCenterOffsetChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 14, 0);
}

// SIGNAL 15
void QDeclarativeAnchors::horizontalCenterOffsetChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 15, 0);
}

// SIGNAL 16
void QDeclarativeAnchors::baselineOffsetChanged()
{
    QMetaObject::activate(this, &staticMetaObject, 16, 0);
}
QT_END_MOC_NAMESPACE


text:
package org.python.modules.itertools;

import org.python.core.ArgParser;
import org.python.core.Py;
import org.python.core.PyIterator;
import org.python.core.PyObject;
import org.python.core.PyTuple;
import org.python.core.PyType;
import org.python.core.Visitproc;
import org.python.expose.ExposedMethod;
import org.python.expose.ExposedNew;
import org.python.expose.ExposedType;

@ExposedType(name = "itertools.combinations", base = PyObject.class, doc = combinations.combinations_doc)
public class combinations extends PyIterator {

    public static final PyType TYPE = PyType.fromClass(combinations.class);
    private PyIterator iter;

    public static final String combinations_doc =
        "combinations(iterable, r) --> combinations object\n\n" +
        "Return successive r-length combinations of elements in the iterable.\n\n" +
        "combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)";

    public combinations() {
        super();
    }

    public combinations(PyType subType) {
        super(subType);
    }

    public combinations(PyObject iterable, int r) {
        super();
        combinations___init__(iterable, r);
    }

    @ExposedNew
    @ExposedMethod
    final void combinations___init__(PyObject[] args, String[] kwds) {
        if (args.length > 2) {
            throw Py.TypeError(String.format(
                "combinations_with_replacement() takes at most 2 arguments (%d given)", args.length));
        }
        ArgParser ap = new ArgParser("combinations_with_replacement", args, kwds, "iterable", "r");
        PyObject iterable = ap.getPyObject(0);
        int r = ap.getInt(1);
        if (r < 0) {
            throw Py.ValueError("r must be non-negative");
        }
        combinations___init__(iterable, r);
    }

    private void combinations___init__(PyObject iterable, final int r) {
        if (r < 0) throw Py.ValueError("r must be non-negative");
        final PyTuple pool = PyTuple.fromIterable(iterable);
        final int n = pool.__len__();
        final int indices[] = new int[r];
        for (int i = 0; i < r; i++) {
            indices[i] = i;
        }

        iter = new itertools.ItertoolsIterator() {
            boolean firstthru = true;

            @Override
            public PyObject __iternext__() {
                if (r > n) { return null; }
                if (firstthru) {
                    firstthru = false;
                    return itertools.makeIndexedTuple(pool, indices);
                }
                int i;
                for (i = r-1; i >= 0 && indices[i] == i+n-r ; i--);
                if (i < 0) return null;
                indices[i]++;
                for (int j = i+1; j < r; j++) {
                    indices[j] = indices[j-1] + 1;
                }
                return itertools.makeIndexedTuple(pool, indices);
            }
        };
    }

    public PyObject __iternext__() {
        return iter.__iternext__();
    }

    @ExposedMethod
    @Override
    public PyObject next() {
        return doNext(__iternext__());
    }

    /* Traverseproc implementation */
    @Override
    public int traverse(Visitproc visit, Object arg) {
        int retVal = super.traverse(visit, arg);
        if (retVal != 0) {
            return retVal;
        }
        return iter != null ? visit.visit(iter, arg) : 0;
    }

    @Override
    public boolean refersDirectlyTo(PyObject ob) {
        return ob != null && (iter == ob || super.refersDirectlyTo(ob));
    }
}


text:
// This file is automatically generated.

package adila.db;

/*
 * Sony Xperia J1 Compact
 *
 * DEVICE: D5788
 * MODEL: D5788
 */
final class d5788_d5788 {
    public static final String DATA = "Sony|Xperia J1 Compact|";
}


text:
layout: os-repeat-event
title: Josh Cheek how to contribure to open source
event-date: September 21st
location: [34.056446, -118.253927]
location-name: 8th Light Los Angeles
parking: events/parking/8thlight.html
tag-line:
rsvp: http://www.meetup.com/la-fullstack/events/233276393/
image: /img/events/josh-cheek.jpg
published: false
---

Fullstack LA is proud to host [Josh Cheek]{:target="_blank"} to give a talk
about the mechanics of contributing to open source projects.

[Josh Cheek]: https://twitter.com/josh_cheek


text:
require 'rails_helper'

describe GiftsController, type: :controller do
  let(:user) { create(:user) }
  let(:gift) { create(:gift, user: user) }
  let!(:pull_requests) { 2.times.map { create :pull_request, user: user } }

  before do
    allow_any_instance_of(User).to receive(:admin?).and_return(true)
    session[:user_id] = user.id
  end

  describe 'DELETE destroy' do
    it 'removes the gift' do
      delete :destroy, params: {id: gift.date}

      expect(Gift.find_by(id: gift.id)).to be_nil
    end
  end

  describe 'GET new' do
    render_views

    it 'should pre-fill the date when one is passed' do
      date = "#{Tfpullrequests::Application.current_year}-12-03"
      get :new, params: {date: date}
      expect(response.body).to match(/<option selected="selected" value="#{date}">/)
    end
  end
end


text:
package org.locationtech.geomesa.accumulo.tools.ingest

import org.geotools.data.Transaction
import org.geotools.data.shapefile.ShapefileDataStore
import org.geotools.data.store.ReprojectingFeatureCollection
import org.geotools.referencing.CRS
import org.geotools.util.factory.Hints
import org.junit.runner.RunWith
import org.locationtech.geomesa.accumulo.MiniCluster
import org.locationtech.geomesa.convert.Modes
import org.locationtech.geomesa.features.ScalaSimpleFeature
import org.locationtech.geomesa.tools.Command.CommandException
import org.locationtech.geomesa.utils.collection.SelfClosingIterator
import org.locationtech.geomesa.utils.geotools.SimpleFeatureTypes
import org.locationtech.geomesa.utils.io.{PathUtils, WithClose, WithStore}
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner

import java.io.File
import java.nio.file.{Files, Path}
import java.util.concurrent.atomic.AtomicInteger
import java.util.{Collections, Date}

@RunWith(classOf[JUnitRunner])
class ShpIngestTest extends Specification {

  private val sftCounter = new AtomicInteger(0)

  // note: shpfile always puts geom first
  val sft = SimpleFeatureTypes.createType(getClass.getSimpleName, "*geom:Point:srid=4326,age:Integer,dtg:Date")

  val features = Seq(
    ScalaSimpleFeature.create(sft, "1", "POINT(1.0 1.5)", 1, "2011-01-01T00:00:00.000Z"),
    ScalaSimpleFeature.create(sft, "2", "POINT(2.0 2.5)", 2, "2012-01-01T00:00:00.000Z")
  )

  val featuresWithNulls = features ++ Seq(
    ScalaSimpleFeature.create(sft, "3", "POINT(3.0 1.5)", 3, null),
    ScalaSimpleFeature.create(sft, "4", "POINT(4.0 2.5)", 4, "2013-01-01T00:00:00.000Z")
  )

  def createCommand(file: String): AccumuloIngestCommand = {
    val command = new AccumuloIngestCommand()
    command.params.user        = MiniCluster.Users.root.name
    command.params.instance    = MiniCluster.cluster.getInstanceName
    command.params.zookeepers  = MiniCluster.cluster.getZooKeepers
    command.params.password    = MiniCluster.Users.root.password
    command.params.catalog     = s"${MiniCluster.namespace}.${getClass.getSimpleName}${sftCounter.getAndIncrement()}"
    command.params.force       = true
    command.params.files       = Collections.singletonList(new File(dir.toFile, s"$file.shp").getAbsolutePath)
    command.params.compact     = false
    command
  }

  val shpFile = "shpingest"
  val shpFileToReproject = "shpingest32631"
  val shpFileToReproject2 = "shpingest4269"
  val shpFileWithNullDates = "shpingestNullDates"

  var dir: Path = _

  step {
    dir = Files.createTempDirectory("gm-shp-ingest-test")

    def params(name: String) = Map("url" -> new File(dir.toFile, s"$name.shp").toURI.toURL)

    val initialFeatures = WithStore[ShapefileDataStore](params(shpFile)) { store =>
      store.createSchema(sft)
      WithClose(store.getFeatureWriterAppend(Transaction.AUTO_COMMIT)) { writer =>
        features.foreach { feature =>
          val toWrite = writer.next()
          toWrite.setAttributes(feature.getAttributes)
          toWrite.getUserData.put(Hints.USE_PROVIDED_FID, java.lang.Boolean.TRUE)
          toWrite.getUserData.put(Hints.PROVIDED_FID, feature.getID)
          writer.write()
        }
      }
      store.getFeatureSource().getFeatures
    }

    WithStore[ShapefileDataStore](params(shpFileToReproject)) { store =>
      val projectedFeatures = new ReprojectingFeatureCollection(initialFeatures, CRS.decode("EPSG:32631"))
      store.createSchema(projectedFeatures.getSchema)
      WithClose(store.getFeatureWriterAppend(Transaction.AUTO_COMMIT)) { writer =>
        SelfClosingIterator(projectedFeatures.features()).foreach { feature =>
          val toWrite = writer.next()
          toWrite.setAttributes(feature.getAttributes)
          toWrite.getUserData.put(Hints.USE_PROVIDED_FID, java.lang.Boolean.TRUE)
          toWrite.getUserData.put(Hints.PROVIDED_FID, feature.getID)
          writer.write()
        }
      }
    }

    WithStore[ShapefileDataStore](params(shpFileToReproject2)) { store =>
      val projectedFeatures = new ReprojectingFeatureCollection(initialFeatures, CRS.decode("EPSG:4269"))
      store.createSchema(projectedFeatures.getSchema)
      WithClose(store.getFeatureWriterAppend(Transaction.AUTO_COMMIT)) { writer =>
        SelfClosingIterator(projectedFeatures.features()).foreach { feature =>
          val toWrite = writer.next()
          toWrite.setAttributes(feature.getAttributes)
          toWrite.getUserData.put(Hints.USE_PROVIDED_FID, java.lang.Boolean.TRUE)
          toWrite.getUserData.put(Hints.PROVIDED_FID, feature.getID)
          writer.write()
        }
      }
    }

    WithStore[ShapefileDataStore](params(shpFileWithNullDates)) { store =>
      store.createSchema(sft)
      WithClose(store.getFeatureWriterAppend(Transaction.AUTO_COMMIT)) { writer =>
        featuresWithNulls.foreach { feature =>
          val toWrite = writer.next()
          toWrite.setAttributes(feature.getAttributes)
          toWrite.getUserData.put(Hints.USE_PROVIDED_FID, java.lang.Boolean.TRUE)
          toWrite.getUserData.put(Hints.PROVIDED_FID, feature.getID)
          writer.write()
        }
      }
    }
  }

  "ShpIngest" should {

    "should properly ingest a shapefile" in {
      val command = createCommand(shpFile)
      command.execute()

      command.withDataStore { ds =>
        ds.stats.writer.analyze(ds.getSchema(shpFile)) // re-gen stats to invalidate cache

        val fs = ds.getFeatureSource(shpFile)

        SelfClosingIterator(fs.getFeatures.features).toList must haveLength(2)

        val bounds = fs.getBounds
        bounds.getMinX mustEqual 1.0
        bounds.getMaxX mustEqual 2.0
        bounds.getMinY mustEqual 1.5
        bounds.getMaxY mustEqual 2.5

        ds.stats.getMinMax[Date](ds.getSchema(shpFile), "dtg").map(_.tuple) must
            beSome((features.head.getAttribute("dtg"), features.last.getAttribute("dtg"), 2L))
      }
    }

    "should support renaming the feature type" in {
      val command = createCommand(shpFile)
      command.params.featureName = "changed"
      command.execute()

      command.withDataStore { ds =>
        ds.stats.writer.analyze(ds.getSchema("changed")) // re-gen stats to invalidate cache

        val fs = ds.getFeatureSource("changed")

        SelfClosingIterator(fs.getFeatures.features).toList must haveLength(2)

        val bounds = fs.getBounds
        bounds.getMinX mustEqual 1.0
        bounds.getMaxX mustEqual 2.0
        bounds.getMinY mustEqual 1.5
        bounds.getMaxY mustEqual 2.5

        ds.stats.getMinMax[Date](ds.getSchema("changed"), "dtg").map(_.tuple) must
            beSome((features.head.getAttribute("dtg"), features.last.getAttribute("dtg"), 2L))
      }
    }

    "reproject to 4326 automatically on ingest" in {
      val command = createCommand(shpFileToReproject)
      command.execute()

      command.withDataStore { ds =>
        ds.stats.writer.analyze(ds.getSchema(shpFileToReproject)) // re-gen stats to invalidate cache

        val fs = ds.getFeatureSource(shpFileToReproject)

        SelfClosingIterator(fs.getFeatures.features).toList must haveLength(2)

        val bounds = fs.getBounds
        bounds.getMinX must beCloseTo(1.0, 0.0001)
        bounds.getMaxX must beCloseTo(2.0, 0.0001)
        bounds.getMinY must beCloseTo(1.5, 0.0001)
        bounds.getMaxY must beCloseTo(2.5, 0.0001)

        ds.stats.getMinMax[Date](ds.getSchema(shpFileToReproject), "dtg").map(_.tuple) must
          beSome((features.head.getAttribute("dtg"), features.last.getAttribute("dtg"), 2L))
      }
    }

    "reproject to 4326 automatically on ingest with flipped inputs" in {
      val command = createCommand(shpFileToReproject2)
      command.execute()

      command.withDataStore { ds =>
        ds.stats.writer.analyze(ds.getSchema(shpFileToReproject2)) // re-gen stats to invalidate cache

        val fs = ds.getFeatureSource(shpFileToReproject2)

        SelfClosingIterator(fs.getFeatures.features).toList must haveLength(2)

        val bounds = fs.getBounds
        bounds.getMinX must beCloseTo(1.0, 0.0001)
        bounds.getMaxX must beCloseTo(2.0, 0.0001)
        bounds.getMinY must beCloseTo(1.5, 0.0001)
        bounds.getMaxY must beCloseTo(2.5, 0.0001)

        ds.stats.getMinMax[Date](ds.getSchema(shpFileToReproject2), "dtg").map(_.tuple) must
          beSome((features.head.getAttribute("dtg"), features.last.getAttribute("dtg"), 2L))
      }
    }

    "skip records with null dates by default" in {
      val command = createCommand(shpFileWithNullDates)
      command.execute()

      command.withDataStore { ds =>
        ds.stats.writer.analyze(ds.getSchema(shpFileWithNullDates)) // re-gen stats to invalidate cache

        val fs = ds.getFeatureSource(shpFileWithNullDates)

        SelfClosingIterator(fs.getFeatures.features).toList must haveLength(3)

        val bounds = fs.getBounds
        bounds.getMinX mustEqual 1.0
        bounds.getMaxX mustEqual 4.0
        bounds.getMinY mustEqual 1.5
        bounds.getMaxY mustEqual 2.5

        ds.stats.getMinMax[Date](ds.getSchema(shpFileWithNullDates), "dtg").map(_.tuple) must
          beSome((features.head.getAttribute("dtg"), featuresWithNulls.last.getAttribute("dtg"), 3L))
      }
    }

    // In this test, the third record has a null date. Raising an error stops the ingest.
    "raise error on null dates via override" in {
      val command = createCommand(shpFileWithNullDates)
      command.params.featureName = "nullDates2"

      Modes.ErrorMode.systemProperty.threadLocalValue.set("raise-errors")
      try {
        command.execute() must throwA[CommandException]
      } finally {
        Modes.ErrorMode.systemProperty.threadLocalValue.remove()
      }

      command.withDataStore { ds =>
        ds.stats.writer.analyze(ds.getSchema("nullDates2")) // re-gen stats to invalidate cache

        val fs = ds.getFeatureSource("nullDates2")

        SelfClosingIterator(fs.getFeatures.features).toList must haveLength(2)

        val bounds = fs.getBounds
        bounds.getMinX mustEqual 1.0
        bounds.getMaxX mustEqual 2.0
        bounds.getMinY mustEqual 1.5
        bounds.getMaxY mustEqual 2.5

        ds.stats.getMinMax[Date](ds.getSchema("nullDates2"), "dtg").map(_.tuple) must
          beSome((features.head.getAttribute("dtg"), features.last.getAttribute("dtg"), 2L))
      }
    }

    "index no data with null dates with batch parse mode and raise-errors via override" in {
      val command = createCommand(shpFileWithNullDates)
      command.params.featureName = "nullDates4"

      Modes.ErrorMode.systemProperty.threadLocalValue.set("raise-errors")
      Modes.ParseMode.systemProperty.threadLocalValue.set("batch")
      try {
        command.execute() must throwA[CommandException]
      } finally {
        Modes.ErrorMode.systemProperty.threadLocalValue.remove()
        Modes.ParseMode.systemProperty.threadLocalValue.remove()
      }

      command.withDataStore { ds =>
        val fs = ds.getFeatureSource("nullDates4")
        SelfClosingIterator(fs.getFeatures.features).toList must beEmpty
      }
    }
  }

  step {
    if (dir != null) {
      PathUtils.deleteRecursively(dir)
    }
  }
}


text:
<?php
  session_start();
  if ($_SESSION['username']=="") {
    header("location: ../login.php");
    # code...
  }else{
    $usuario=$_SESSION['username'];
  }

 $hoy = date("Y-m-d");
?>
<!DOCTYPE html>

	<link href="../css/icon.css" type="text/css" rel="stylesheet">
	<meta charset="UTF-8">

	<link type="text/css" rel="stylesheet" href="../css/materialize.css"  media="screen,projection"/>
	<link rel="icon" href="../images/favicon.ico" sizes="32x32">
	<link href="../css/estilo.css" type="text/css" rel="stylesheet" media="screen,projection"/>
	<link rel="stylesheet" type="text/css" href="../css/animate.css">
	<title>Eliminar</title>

	<meta name="viewport" content="width=device-width, initial-scale=1"/>

Cerrar sesión

Inicio

<?php echo $usuario; ?>arrow_drop_down

Inicio

<?php echo $usuario; ?>arrow_drop_down

	        	menu

Administrador

				<?php
				/* Para iniciar las sesiones. */
				// Incluimos la conexión.
				require_once("conexion.php");
				// Pasamos el id por $_GET desde la url.
				$id = @$_GET["id"];
				// Seleccionamos la id y pasamos la variable id.
				$ssql = "select * from alta_login where idalta_login=" . $id;
				// Liberamos los datos.
				$rs_libros = mysql_query($ssql);
				// Pasamos los datos de la query a un array con un bucle while.
				while(@$fila = mysql_fetch_assoc($rs_libros)) {
				// Pasamos el id seleccionado a una sesión y las demás filas = campos.
				$_SESSION["idalta_login"]=$id;
				$_SESSION["usuario"]=$fila["usuario"];
				$_SESSION["password"]=$fila["password"];
				}
				// En el formulario pasamos los datos en cada celda.
				?>

				<form action="campo_delete.php" method="post">
				<input type="hidden" name="idalta_login" value="<?php echo  $_SESSION['idalta_login'];?>">

			        	perm_identity
			        	<input id="user" type="text" name="usuario" value="<?php echo $_SESSION['usuario'];?>">
				        Usuario

			        	error
			        	<input id="pass" type="password" name="password" value="<?php echo $_SESSION['password'];?>">
				        Contraseña

					<button class="btn-floating btn waves-effect waves-light red" type="submit" value="Editar" name="action">
			    	delete
			  		</button>

					keyboard_backspaceRegresar

				</form>

    		Hecho por ShowBiz Team©


text:
<?php

namespace Kunstmaan\MenuBundle\Repository;

use Gedmo\Tree\Entity\Repository\NestedTreeRepository;
use Kunstmaan\MenuBundle\Entity\BaseMenuItem;

class MenuItemRepository extends NestedTreeRepository implements MenuItemRepositoryInterface
{

    /**
     * @param string $menuName
     * @param string $locale
     * @return array
     */
    public function getMenuItemsForLanguage($menuName, $locale)
    {
        $query = $this->createQueryBuilder('mi')
            ->select('mi, nt, p')
            ->innerJoin('mi.menu', 'm')
            ->leftJoin('mi.parent', 'p')
            ->leftJoin('mi.nodeTranslation', 'nt')
            ->leftJoin('nt.node', 'n')
            ->orderBy('mi.lft', 'ASC')
            ->where('m.locale = :locale')
            ->setParameter('locale', $locale)
            ->andWhere('m.name = :name')
            ->setParameter('name', $menuName)
            ->andWhere('nt.online = 1 OR mi.type = :url_type')
            ->setParameter('url_type', BaseMenuItem::TYPE_URL_LINK);

        $query = $query->getQuery();

        return $query->getArrayResult();
    }
}


text:
@implementation NWSOrderKeyTransform

#pragma mark - Object life cycle

- (id)init
{
    return [self initWithBegin:0 step:1];
}

- (id)initWithBegin:(NSInteger)begin step:(NSInteger)step
{
    self = [super init];
    if (self) {
        _begin = begin;
        _step = step;
    }
    return self;
}

+ (NWSOrderKeyTransform *)shared
{
    static NWSOrderKeyTransform *result = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        result = [[NWSOrderKeyTransform alloc] init];
    });
    return result;
}

#pragma mark - NWSTransform

- (id)transform:(id)value context:(NWSMappingContext *)context
{
    NSInteger order = context.indexInArray * _step + _begin;
    return @(order);
}

- (id)reverse:(id)value context:(NWSMappingContext *)context
{
    // no need to reverse transform order keys
    return nil;
}

#pragma mark - Logging

- (NSString *)description
{
    return [NSString stringWithFormat:@"<%@:%p>", NSStringFromClass(self.class), self];
}

- (NSString *)about:(NSString *)prefix
{
    return [@"order-key-transform" about:prefix];
}

@end