text:
ByteCompressor
==============

Scala abstractions for some compression algorithms.

Beside abstraction layer, this project provide some useful utils for data processing,
like Pipe, ByteBufferBackedInputStream and ByteBufferBackedOutputStream.

License
-------

	Copyright 2013 Lukas Karas, Avast a.s. <karas@avast.com>

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

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

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.

ByteCompressor: Huffman Coding
==============================

Avast fork of https://github.com/nayuki/Huffman-Coding , it ads bytecompressor layer compatibility.

This project is an open-source reference implementation of Huffman coding in Java.
The code is intended to be used for study, and as a solid basis for modification
and extension. As such, it is optimized for clear logic and low complexity,
not speed/memory/performance.

Description
-----------

An overview of the code is given here: [http://nayuki.eigenstate.org/page/huffman-coding-java](http://nayuki.eigenstate.org/page/huffman-coding-java)

License
-------

	(MIT License)

	Copyright © 2013 Nayuki Minase

	Permission is hereby granted, free of charge, to any person obtaining a copy of
	this software and associated documentation files (the "Software"), to deal in
	the Software without restriction, including without limitation the rights to
	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
	the Software, and to permit persons to whom the Software is furnished to do so,
	subject to the following conditions:

	* The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.

	* The Software is provided "as is", without warranty of any kind, express or
	implied, including but not limited to the warranties of merchantability,
	fitness for a particular purpose and noninfringement. In no event shall the
	authors or copyright holders be liable for any claim, damages or other
	liability, whether in an action of contract, tort or otherwise, arising from,
	out of or in connection with the Software or the use or other dealings in the
	Software.

ByteCompressor: jSnappy
=======================

Java impmenentation of compression algorithm Snappy from Google.
This is a Avast a.s. fork of http://code.google.com/p/jsnappy/ ,
it adds bytecompressor layer compatibility.

License
-------

	(Apache 2.0 License)

	Copyright 2011 Tor-Einar Jarnbjo

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

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

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.

ByteCompressor: ZLIB
=======================

Bytecompressor abstraction for Zlib and Gzip compression algorithm from standard Java package java.util.zip.

Both the zlib and gzip formats use the same compressed data format internally, but have different headers
and trailers around the compressed data.


text:
/*
 * Generated from Data.bond (https://github.com/Microsoft/bond)
 */
package com.laytonsmith.core.telemetry.ApplicationInsights;

/**
 * Data contract class Data.
 *
 * @param <TDomain>
 */
public class Data<TDomain extends Domain> extends Base {

	/**
	 * Backing field for property BaseData.
	 */
	private TDomain baseData;

	/**
	 * Gets the BaseData property.
	 *
	 * @return
	 */
	public TDomain getBaseData() {
		return this.baseData;
	}

	/**
	 * Sets the BaseData property.
	 *
	 * @param value
	 */
	public void setBaseData(TDomain value) {
		this.baseData = value;
	}

}

redpajama_set_name: RedPajamaGithub


text:
using namespace std;

#define RIGHT 0
#define LEFT 1
#define UNRELATED 2

#define NEGINF LLONG_MIN

#define UPSTRANDBITS  3
#define DOWNSTRANDBITS 3
#define RELPOSBITS 3

#define UPSTRANDSHIFT 0
#define DOWNSTRANDSHIFT UPSTRANDBITS
#define RELPOSSHIFT UPSTRANDBITS + DOWNSTRANDBITS
#define TOTALSHIFT UPSTRANDBITS + DOWNSTRANDBITS + RELPOSBITS

#define POSITIVE 1
#define NEGATIVE 0
#define CUTOFF 0

#define TRUE 1
#define FALSE 0

#define INF LLONG_MAX
#define MIN LLONG_MIN
#define NAMESIZE 100

struct ltstr {
	bool operator() (const  char* s1, const char* s2) const {
		return strcmp(s1,s2) < 0;
	}
};

typedef map<const char*,long long int ,ltstr> Name;

typedef struct Fragment {
	long long int seq1Start,seq2Start,seq1End,seq2End;
	char strand;
	float score;
	float totalScore;
	struct Fragment *back;
	char deleted;
	char seq1Name[NAMESIZE];
	Name::iterator nameIter;
	char seq2Name[NAMESIZE];
	long long int base;
	long long int getSeq2End(long long int reflectFlag){ return this->seq2End*((reflectFlag == TRUE)?(-1): 1);};
	long long int getSeq2Start(long long int reflectFlag){return this->seq2Start*((reflectFlag == TRUE)?(-1): 1);};
} Fragment;

typedef struct HitLocationList {
	long long int seq1start;
	long long int seq2start;
	long long int seq1end;
	long long int seq2end;
	float score;
	char strand;
	struct HitLocationList *next;
	struct HitLocationList *bkptr;
	float scoreSoFar;
	char seq1Name[NAMESIZE];
	char seq2Name[NAMESIZE];
} hll;

typedef struct Point {
	long long int seq1,seq2;
	Fragment *frag;
} Point;

#endif


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Manage_model extends CI_Model
{
	public function __construct()
	{
		parent::__construct();
	}
	#get all categories
	public function get_categories() {
		 return $this->db->select('cat.*, attr.attribute_name')
						->from("category_entity cat")
						->join("attributes attr", "cat.attribute_id = attr.entity_id", "left")
						->order_by('cat.entity_id', 'desc')
						->get()->result_array();
		}

	public function get_tables() {
		 return $this->db->select('td.*, tc.name as category')
						->from("table_details td")
						->join("table_category tc", "tc.id = td.table_cat_id", "left")
						->order_by('td.id', 'desc')
						->get()->result_array();
		}

	#get all menus
	public function get_menus() {
		 return $this->db->select('menu.*, cat.entity_name')
						->from("menu_entity menu")
						->join("category_entity cat", "menu.category_id = cat.entity_id", "left")
						->order_by('menu.entity_id', 'desc')
						->get()->result_array();
	}

	#get all user_details
	public function get_user_details($id=null) {
		// select u.*, g.name as user_type from users u join users_groups ug on u.id = ug.user_id join groups g on ug.group_id = g.id where active=1
		 if(!empty($id)){
		 	return $this->db->select('u.*, g.name as user_type')
						->from("users u")
						->join("users_groups ug", "u.id = ug.user_id")
						->join("groups g", "ug.group_id = g.id")
						->where("active",1)
						->where('u.id',$id)
						->order_by('u.id')
						->get()->result_array();

		 } else {
		 	return $this->db->select('u.*, g.name as user_type')
						->from("users u")
						->join("users_groups ug", "u.id = ug.user_id")
						->join("groups g", "ug.group_id = g.id")
						->where("active",1)
						->order_by('u.id')
						->get()->result_array();
		 }

	}

}


text:
package org.apache.ignite.internal.processors.cache;

import java.util.function.Supplier;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.TestRecordingCommunicationSpi;
import org.apache.ignite.internal.managers.discovery.CustomMessageWrapper;
import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.spi.communication.CommunicationSpi;
import org.apache.ignite.spi.discovery.DiscoverySpi;
import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryCustomEventMessage;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedMessage;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;

/**
 *
 */
public class ClientSlowDiscoveryAbstractTest extends GridCommonAbstractTest {
    /** Cache name. */
    protected static final String CACHE_NAME = "cache";

    /** Cache configuration. */
    private final CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME)
        .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
        .setReadFromBackup(false)
        .setBackups(1)
        .setAffinity(new RendezvousAffinityFunction(false, 64));

    /** Client mode. */
    protected boolean clientMode;

    /** Communication SPI supplier. */
    protected Supplier<CommunicationSpi> communicationSpiSupplier = TestRecordingCommunicationSpi::new;

    /** Discovery SPI supplier. */
    protected Supplier<DiscoverySpi> discoverySpiSupplier = TcpDiscoverySpi::new;

    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

        cfg.setConsistentId(igniteInstanceName);
        cfg.setCacheConfiguration(ccfg);
        cfg.setCommunicationSpi(communicationSpiSupplier.get());
        cfg.setDiscoverySpi(discoverySpiSupplier.get());
        cfg.setClientMode(clientMode);

        return cfg;
    }

    /**
     *
     */
    static class NodeJoinInterceptingDiscoverySpi extends TcpDiscoverySpi {
        /** Interceptor. */
        protected volatile IgniteInClosure<TcpDiscoveryNodeAddFinishedMessage> interceptor;

        /** {@inheritDoc} */
        @Override protected void startMessageProcess(TcpDiscoveryAbstractMessage msg) {
            if (msg instanceof TcpDiscoveryNodeAddFinishedMessage && interceptor != null)
                interceptor.apply((TcpDiscoveryNodeAddFinishedMessage) msg);
        }
    }

    /**
     *
     */
    static class CustomMessageInterceptingDiscoverySpi extends TcpDiscoverySpi {
        /** Interceptor. */
        protected volatile IgniteInClosure<DiscoveryCustomMessage> interceptor;

        /** {@inheritDoc} */
        @Override protected void startMessageProcess(TcpDiscoveryAbstractMessage msg) {
            if (!(msg instanceof TcpDiscoveryCustomEventMessage))
                return;

            TcpDiscoveryCustomEventMessage cm = (TcpDiscoveryCustomEventMessage)msg;

            DiscoveryCustomMessage delegate;

            try {
                DiscoverySpiCustomMessage custMsg = cm.message(marshaller(),
                    U.resolveClassLoader(ignite().configuration()));

                assertNotNull(custMsg);

                delegate = ((CustomMessageWrapper)custMsg).delegate();
            }
            catch (Throwable throwable) {
                throw new RuntimeException(throwable);
            }

            if (interceptor != null)
                interceptor.apply(delegate);
        }
    }
}


text:
package org.eclipse.collections.test.bag.mutable.sorted;

import org.eclipse.collections.api.bag.sorted.MutableSortedBag;
import org.eclipse.collections.api.bag.sorted.SortedBag;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.bag.sorted.mutable.TreeBag;
import org.eclipse.collections.impl.block.factory.Comparators;
import org.eclipse.collections.impl.factory.Lists;
import org.eclipse.collections.test.SortedIterableTestCase;
import org.eclipse.collections.test.bag.BagTestCase;
import org.eclipse.collections.test.domain.A;
import org.eclipse.collections.test.domain.B;
import org.eclipse.collections.test.domain.C;
import org.eclipse.collections.test.list.TransformsToListTrait;
import org.junit.Test;

import static org.eclipse.collections.test.IterableTestCase.assertEquals;

// TODO linked bag
public interface SortedBagTestCase extends SortedIterableTestCase, BagTestCase, TransformsToListTrait
{
    @Override
    <T> SortedBag<T> newWith(T... elements);

    @Override
    default <T> SortedBag<T> getExpectedFiltered(T... elements)
    {
        return new TreeBag<>(Comparators.reverseNaturalOrder(), Lists.immutable.with(elements));
    }

    @Override
    default <T> MutableSortedBag<T> newMutableForFilter(T... elements)
    {
        return new TreeBag<>(Comparators.reverseNaturalOrder(), Lists.immutable.with(elements));
    }

    @Override
    @Test
    default void RichIterable_selectInstancesOf()
    {
        // Must test with two classes that are mutually Comparable

        SortedBag<A> numbers = this.newWith(
                new C(4.0), new C(4.0), new C(4.0), new C(4.0),
                new B(3), new B(3), new B(3),
                new C(2.0), new C(2.0),
                new B(1));
        assertEquals(
                this.getExpectedFiltered(new B(3), new B(3), new B(3), new B(1)),
                numbers.selectInstancesOf(B.class));
        assertEquals(
                this.getExpectedFiltered(
                        new C(4.0), new C(4.0), new C(4.0), new C(4.0),
                        new B(3), new B(3), new B(3),
                        new C(2.0), new C(2.0),
                        new B(1)),
                numbers.selectInstancesOf(A.class));
    }

    @Override
    @Test
    default void Bag_sizeDistinct()
    {
        SortedBag<Integer> bag = this.newWith(3, 3, 3, 2, 2, 1);
        assertEquals(3, bag.sizeDistinct());
    }

    @Override
    @Test
    default void Bag_occurrencesOf()
    {
        SortedBag<Integer> bag = this.newWith(3, 3, 3, 2, 2, 1);
        assertEquals(0, bag.occurrencesOf(0));
        assertEquals(1, bag.occurrencesOf(1));
        assertEquals(2, bag.occurrencesOf(2));
        assertEquals(3, bag.occurrencesOf(3));
    }

    @Override
    @Test
    default void Bag_toStringOfItemToCount()
    {
        assertEquals("{}", this.newWith().toStringOfItemToCount());
        assertEquals("{3=3, 2=2, 1=1}", this.newWith(3, 3, 3, 2, 2, 1).toStringOfItemToCount());
    }

    @Test
    default void SortedBag_forEachWith()
    {
        SortedBag<Integer> bag = this.newWith(3, 3, 3, 2, 2, 1);
        MutableList<Integer> result = Lists.mutable.with();
        bag.forEachWith((argument1, argument2) -> {
            result.add(argument1);
            result.add(argument2);
        }, 0);
        assertEquals(Lists.immutable.with(3, 0, 3, 0, 3, 0, 2, 0, 2, 0, 1, 0), result);
    }
}


text:
package generic

import (
	"encoding/json"
	"reflect"
	"strconv"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestMarshalTimestampNano(t *testing.T) {
	v := time.Now()
	expected := v.UnixNano()
	ts, err := MarshalTimestampNano(v)
	if err != nil {
		t.Errorf("Not Expected error. error:%s", err.Error())
	}
	if ts.Weak() != expected {
		t.Errorf("actual:%[1]v(%[1]T), expected:%[2]v(%[2]T)", ts.Weak(), expected)
	}
}

func TestMustTimestampNano(t *testing.T) {
	v := time.Now()
	tests := []struct {
		name      string
		args      interface{}
		want      TimestampNano
		wantPanic bool
	}{
		{
			name: "valid",
			args: v,
			want: TimestampNano{
				ValidFlag: true,
				time:      v,
			},
			wantPanic: false,
		},
		{
			name: "panic",
			args: "valid paramenter",
			want: TimestampNano{
				ValidFlag: false,
			},
			wantPanic: true,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if tt.wantPanic {
				p := assert.Panics(t, func() {
					MustTimestampNano(tt.args)
				})
				if !p {
					t.Errorf("MustTimestampNano() panic = %v, want panic %v", p, tt.wantPanic)
				}
				return
			}
			if got := MustTimestampNano(tt.args); got.Weak() != v.UnixNano() {
				t.Errorf("MustTimestampNano() = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestTimestampNanoJsonMarshal(t *testing.T) {
	v := time.Now()
	tn := TimestampNano{
		ValidFlag: true,
		time:      v,
	}
	expected := strconv.FormatInt(v.UnixNano(), 10)
	actual, err := json.Marshal(tn)
	if err != nil {
		t.Errorf("Not Expected error when json.Marshal. error:%v", err.Error())
	}
	if string(actual) != expected {
		t.Errorf("actual:%s, expected:%s", string(actual), expected)
	}
}

func TestTimestampNanoJsonMarshalValidFalse(t *testing.T) {
	tn := TimestampNano{
		ValidFlag: false,
		time:      time.Now(),
	}
	expected := []byte("null")
	actual, err := json.Marshal(tn)
	if err != nil {
		t.Errorf("Not Expected error when json.Marshal. error:%v", err.Error())
	}
	if string(actual) != string(expected) {
		t.Errorf("actual:%v, expected:%v", actual, expected)
	}
}

func TestTimestampNanoJsonUnmarshal(t *testing.T) {
	v := time.Now()
	in, _ := v.MarshalJSON()
	tn := TimestampNano{}
	if err := tn.UnmarshalJSON(in); err != nil {
		t.Errorf("Not Expected error when json.Unmarshal. error:%v", err.Error())
	}
	if !tn.Valid() {
		t.Error("ValidFlag should be TRUE")
	}
	if tn.Int64() != v.UnixNano() {
		t.Errorf("actual:%d, expected:%d", tn.Int64(), v.UnixNano())
	}
}

func TestTimestampNanoJsonUnmarshalNil(t *testing.T) {
	tn := TimestampNano{}
	if err := tn.UnmarshalJSON(nil); err != nil {
		t.Errorf("Not Expected error when json.Unmarshal. error:%v", err.Error())
	}
	if tn.Valid() {
		t.Error("ValidFlag should be FALSE")
	}
	if tn.Int64() != 0 {
		t.Errorf("actual:%d, expected:%d", tn.Int64(), 0)
	}
}

func TestTimestampNanoJsonUnmarshalInvalid(t *testing.T) {
	tn := TimestampNano{}
	if err := tn.UnmarshalJSON([]byte(`"a`)); err == nil {
		t.Errorf("Expected error when json.Unmarshal, but not; %#v", tn)
	}
}

func TestTimestampNanoSetNil(t *testing.T) {
	tn := TimestampNano{}
	err := tn.Set(nil)
	if err != nil {
		t.Errorf("Not Expected error. error:%s", err.Error())
	}
	actual, err := tn.Value()
	if err != nil {
		t.Errorf("This value should return nil. error:%s", err.Error())
	}
	if actual != nil {
		t.Errorf("actual:%d, expected:nil", actual)
	}
}

func TestTimestampNanoSetTime(t *testing.T) {
	v := time.Now()
	expected := v
	tn := TimestampNano{}
	err := tn.Set(v)
	if err != nil {
		t.Errorf("Not Expected error. error:%s", err.Error())
	}
	if tn.Weak() != expected.UnixNano() {
		t.Errorf("actual:%v, expected:%v", tn.Weak(), expected)
	}
}

func TestTimestampNanoSetInt64(t *testing.T) {
	var v int64 = 1367059792
	expected := time.Unix(0, v)
	tn := TimestampNano{}
	err := tn.Set(v)
	if err != nil {
		t.Errorf("Not Expected error. error:%s", err.Error())
	}
	if actual := tn.Weak(); actual != expected.UnixNano() {
		t.Errorf("actual:%v, expected:%v", actual, expected.UnixNano())
	}
}

func TestTimestampNanoSetNumericString(t *testing.T) {
	v := "1467059792"
	tn := TimestampNano{}
	err := tn.Set(v)
	if err == nil {
		t.Errorf("Expected error.")
	}
	if tn.Weak() != nil {
		t.Errorf("This value should return nil. value:%#v", tn.Weak())
	}
}

func TestTimestampNanoSetNonNumericString(t *testing.T) {
	v := "a"
	tn := TimestampNano{}
	err := tn.Set(v)
	if err == nil {
		t.Error("Expected error.")
	}
	if tn.Weak() != nil {
		t.Errorf("This value should return nil. value:%#v", tn.Weak())
	}
}

func TestTimestampNanoSetBool(t *testing.T) {
	v := true
	tn := TimestampNano{}
	err := tn.Set(v)
	if err == nil {
		t.Error("Expected error.")
	}
	if tn.Weak() != nil {
		t.Errorf("This value should return nil. value:%#v", tn.Weak())
	}
}

func TestTimestampNanoInt64(t *testing.T) {
	v := time.Now()
	expected := v.UnixNano()
	tm := TimestampNano{}
	err := tm.Set(v)
	if err != nil {
		t.Error("Not expected error.")
	}
	if tm.Int64() != expected {
		t.Errorf("This value should return %d. value:%d", expected, tm.Int())
	}
}

func TestTimestampNanoInt64Zero(t *testing.T) {
	v := time.Unix(0, 0)
	var expected int64
	tm := TimestampNano{}
	err := tm.Set(v)
	if err != nil {
		t.Error("Not expected error.")
	}
	if tm.Int64() != expected {
		t.Errorf("This value should return %d. value:%d", expected, tm.Int())
	}
}

func TestTimestampNanoInt(t *testing.T) {
	v := time.Now()
	expected := int(v.UnixNano())
	tm := TimestampNano{}
	err := tm.Set(v)
	if err != nil {
		t.Error("Not expected error.")
	}
	if tm.Int() != expected {
		t.Errorf("This value should return %d. value:%d", expected, tm.Int())
	}
}

func TestTimestampNanoString(t *testing.T) {
	v := time.Now()
	expected := strconv.FormatInt(v.UnixNano(), 10)
	tm := TimestampNano{}
	err := tm.Set(v)
	if err != nil {
		t.Error("Not expected error.")
	}
	if tm.String() != expected {
		t.Errorf("This value should return %s. value:%s", expected, tm.String())
	}
}

func TestTimestampNano_Time(t *testing.T) {
	now := time.Now()

	type fields struct {
		ValidFlag ValidFlag
		time      time.Time
	}
	tests := []struct {
		name   string
		fields fields
		want   time.Time
	}{
		{
			name: "now",
			fields: fields{
				ValidFlag: true,
				time:      now,
			},
			want: now,
		},
		{
			name: "invalid",
			fields: fields{
				ValidFlag: false,
				time:      now,
			},
			want: time.Unix(0, 0),
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			v := TimestampNano{
				ValidFlag: tt.fields.ValidFlag,
				time:      tt.fields.time,
			}
			if got := v.Time(); !reflect.DeepEqual(got, tt.want) {
				t.Errorf("TimestampNano.Time() = %v, want %v", got, tt.want)
			}
		})
	}
}


text:
package org.openbaton.catalogue.mano.common.monitoring;

/** Created by mob on 26.10.15. */
public enum FaultType {

  //Compute faults
  COMPUTE,
  COMPUTE_HOGS,
  COMPUTE_HOGS_CPU,
  COMPUTE_HOGS_MEMORY,
  COMPUTE_CRASH,
  COMPUTE_CODE_CORRUPTION,
  COMPUTE_DATA_CORRUPTION,

  //IO faults
  IO,

  IO_NETWORK_FRAME_RECEIVE,
  IO_NETWORK_FRAME_RECEIVE_CORRUPTION,
  IO_NETWORK_FRAME_RECEIVE_DROP,
  IO_NETWORK_FRAME_RECEIVE_DELAY,
  IO_NETWORK_FRAME_TRANSMIT,
  IO_NETWORK_FRAME_TRANSMIT_CORRUPTION,
  IO_NETWORK_FRAME_TRANSMIT_DROP,
  IO_NETWORK_FRAME_TRANSMIT_DELAY,

  IO_STORAGE_BLOCK_READS_CORRUPTION,
  IO_STORAGE_BLOCK_READS_DROP,
  IO_STORAGE_BLOCK_READS_DELAY,
  IO_STORAGE_BLOCK_WRITE_CORRUPTION,
  IO_STORAGE_BLOCK_WRITE_DROP,
  IO_STORAGE_BLOCK_WRITE_DELAY,

  //SERVICE FAULT
  VNF_NOT_AVAILABLE
}


text:
<?php

namespace tests\Dudulina\CodeGeneration\Command\AggregateCommandValidatorDetectorTest;

use Dudulina\Command;
use Dudulina\CodeGeneration\Command\AggregateCommandValidatorDetector;

class AggregateCommandValidatorDetectorTest extends \PHPUnit_Framework_TestCase
{

    public function testAccepted()
    {

        $commandClass = new \ReflectionClass(Command1::class);
        $validatorClass = new \ReflectionClass(SomeValidValidator::class);

        $sut = new AggregateCommandValidatorDetector();

        $this->assertTrue($sut->isMessageClass($commandClass));

        $this->assertTrue($sut->isMethodAccepted($validatorClass->getMethods()[0]));
    }

    public function testNotAccepted()
    {

        $commandClass = new \ReflectionClass(\stdClass::class);
        $validatorClass = new \ReflectionClass(SomeInvalidValidator::class);

        $sut = new AggregateCommandValidatorDetector();

        $this->assertFalse($sut->isMessageClass($commandClass));

        $this->assertFalse($sut->isMethodAccepted($validatorClass->getMethods()[0]));
    }
}

class SomeValidValidator
{
    public function validateCommand1(Command1 $command)
    {

    }
}

class Command1 implements Command
{

    public function getAggregateId()
    {
        // TODO: Implement getAggregateId() method.
    }
}

class SomeInvalidValidator
{
    public function doCommand1(Command1 $command)
    {

    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Platygrapha rimata Nyl.

### Remarks
null


text:
define(['jquery', 'underscore', 'backbone', 'helpers/util', 'views/comps/loader'], function($, _, Backbone, Utils, LoaderView) {
    var BaseView = Backbone.View.extend({
        reset: function() {
            var view = this,
                $container = view.$container || view.$el;

            if ($container) {
                $container.empty();
                if ($container.hasClass('loading')) {
                    view.setLoading();
                }
            }

            if (_.isFunction(view.preRender)) {
                view.preRender();
            }

            return view;
        },
        set: function(type, enable, cfg) {
            var view = this,
                $container = view.$container || view.$el,
                typeView = view[type] || new LoaderView(cfg);

            if (!_.isBoolean(enable)) {
                enable = true;
            }

            if (enable) {
                $container.addClass('loading');
                $container.addClass(cfg && cfg.loadingCls);
                view.addContent(typeView);
                view[type] = typeView;
            } else {
                $container.removeClass('loading');
                $container.removeClass(typeView.loadingCls);
                typeView = typeView.remove();
                view[type] = null;
            }

            return view;
        },
        setLoading: function(enable, cfg) {
            var view = this;

            view.set('loading', enable, cfg);
        },
        setError: function(enable, cfg){
            var view= this;

            view.set('error', enable, _.extend(cfg || {}, {
                type : 'error'
            }));

            return view;
        },
        addContent: function(content){
            var view= this,
                $container = view.$container || view.$el;

            Utils.addContent($container, content);

            return view;
        },
        loadContent: function(content, cfg){
            var view = this;

            if(!cfg){
                view.reset();
            }

            view.addContent(content);

            return view;
        }
    });

    return BaseView;
});


text:
<?php

Prado::using('System.Data.SqlMap.TSqlMapGateway');
Prado::using('System.Data.SqlMap.DataMapper.TSqlMapException');
Prado::using('System.Data.SqlMap.DataMapper.TSqlMapTypeHandlerRegistry');
Prado::using('System.Data.SqlMap.DataMapper.TSqlMapCache');
Prado::using('System.Data.SqlMap.Configuration.TSqlMapStatement');
Prado::using('System.Data.SqlMap.Configuration.*');
Prado::using('System.Data.SqlMap.DataMapper.*');
Prado::using('System.Data.SqlMap.Statements.*');
Prado::using('System.Caching.TCache');

/**
 * TSqlMapManager class holds the sqlmap configuation result maps, statements
 * parameter maps and a type handler factory.
 *
 * Use {@link SqlMapGateway getSqlMapGateway()} property to obtain the gateway
 * instance used for querying statements defined in the SqlMap configuration files.
 *
 * <code>
 * $conn = new TDbConnection($dsn,$dbuser,$dbpass);
 * $manager = new TSqlMapManager($conn);
 * $manager->configureXml('mydb-sqlmap.xml');
 * $sqlmap = $manager->getSqlMapGateway();
 * $result = $sqlmap->queryForObject('Products');
 * </code>
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @version $Id$
 * @package System.Data.SqlMap
 * @since 3.1
 */
class TSqlMapManager extends TComponent
{
	private $_mappedStatements;
	private $_resultMaps;
	private $_parameterMaps;
	private $_typeHandlers;
	private $_cacheModels;

	private $_connection;
	private $_gateway;
	private $_cacheDependencies;

	/**
	 * Constructor, create a new SqlMap manager.
	 * @param TDbConnection database connection
	 * @param string configuration file.
	 */
	public function __construct($connection=null)
	{
		$this->_connection=$connection;

		$this->_mappedStatements=new TMap;
		$this->_resultMaps=new TMap;
		$this->_parameterMaps=new TMap;
		$this->_cacheModels=new TMap;
	}

	/**
	 * @param TDbConnection default database connection
	 */
	public function setDbConnection($conn)
	{
		$this->_connection=$conn;
	}

	/**
	 * @return TDbConnection default database connection
	 */
	public function getDbConnection()
	{
		return $this->_connection;
	}

	/**
	 * @return TTypeHandlerFactory The TypeHandlerFactory
	 */
	public function getTypeHandlers()
	{
		if($this->_typeHandlers===null)
			$this->_typeHandlers= new TSqlMapTypeHandlerRegistry();
		return $this->_typeHandlers;
	}

	/**
	 * @return TSqlMapGateway SqlMap gateway.
	 */
	public function getSqlmapGateway()
	{
		if($this->_gateway===null)
			$this->_gateway=$this->createSqlMapGateway();
		return $this->_gateway;
	}

	/**
	 * Loads and parses the SqlMap configuration file.
	 * @param string xml configuration file.
	 */
	public function configureXml($file)
	{
		$config = new TSqlMapXmlConfiguration($this);
		$config->configure($file);
	}

	/**
	 * @return TChainedCacheDependency
	 * @since 3.1.5
	 */
	public function getCacheDependencies()
	{
		if($this->_cacheDependencies === null)
			$this->_cacheDependencies=new TChainedCacheDependency();

		return $this->_cacheDependencies;
	}

	/**
	 * Configures the current TSqlMapManager using the given xml configuration file
	 * defined in {@link ConfigFile setConfigFile()}.
	 * @return TSqlMapGateway create and configure a new TSqlMapGateway.
	 */
	protected function createSqlMapGateway()
	{
		return new TSqlMapGateway($this);
	}

	/**
	 * @return TMap mapped statements collection.
	 */
	public function getMappedStatements()
	{
		return $this->_mappedStatements;
	}

	/**
	 * Gets a MappedStatement by name.
	 * @param string The name of the statement.
	 * @return IMappedStatement The MappedStatement
	 * @throws TSqlMapUndefinedException
	 */
	public function getMappedStatement($name)
	{
		if($this->_mappedStatements->contains($name) == false)
			throw new TSqlMapUndefinedException('sqlmap_contains_no_statement', $name);
		return $this->_mappedStatements[$name];
	}

	/**
	 * Adds a (named) MappedStatement.
	 * @param string The key name
	 * @param IMappedStatement The statement to add
	 * @throws TSqlMapDuplicateException
	 */
	public function addMappedStatement(IMappedStatement $statement)
	{
		$key = $statement->getID();
		if($this->_mappedStatements->contains($key) == true)
			throw new TSqlMapDuplicateException('sqlmap_already_contains_statement', $key);
		$this->_mappedStatements->add($key, $statement);
	}

	/**
	 * @return TMap result maps collection.
	 */
	public function getResultMaps()
	{
		return $this->_resultMaps;
	}

	/**
	 * Gets a named result map
	 * @param string result name.
	 * @return TResultMap the result map.
	 * @throws TSqlMapUndefinedException
	 */
	public function getResultMap($name)
	{
		if($this->_resultMaps->contains($name) == false)
			throw new TSqlMapUndefinedException('sqlmap_contains_no_result_map', $name);
		return $this->_resultMaps[$name];
	}

	/**
	 * @param TResultMap add a new result map to this SQLMap
	 * @throws TSqlMapDuplicateException
	 */
	public function addResultMap(TResultMap $result)
	{
		$key = $result->getID();
		if($this->_resultMaps->contains($key) == true)
			throw new TSqlMapDuplicateException('sqlmap_already_contains_result_map', $key);
		$this->_resultMaps->add($key, $result);
	}

	/**
	 * @return TMap parameter maps collection.
	 */
	public function getParameterMaps()
	{
		return $this->_parameterMaps;
	}

	/**
	 * @param string parameter map ID name.
	 * @return TParameterMap the parameter with given ID.
	 * @throws TSqlMapUndefinedException
	 */
	public function getParameterMap($name)
	{
		if($this->_parameterMaps->contains($name) == false)
			throw new TSqlMapUndefinedException('sqlmap_contains_no_parameter_map', $name);
		return $this->_parameterMaps[$name];
	}

	/**
	 * @param TParameterMap add a new parameter map to this SQLMap.
	 * @throws TSqlMapDuplicateException
	 */
	public function addParameterMap(TParameterMap $parameter)
	{
		$key = $parameter->getID();
		if($this->_parameterMaps->contains($key) == true)
			throw new TSqlMapDuplicateException('sqlmap_already_contains_parameter_map', $key);
		$this->_parameterMaps->add($key, $parameter);
	}

	/**
	 * Adds a named cache.
	 * @param TSqlMapCacheModel the cache to add.
	 * @throws TSqlMapConfigurationException
	 */
	public function addCacheModel(TSqlMapCacheModel $cacheModel)
	{
		if($this->_cacheModels->contains($cacheModel->getID()))
			throw new TSqlMapConfigurationException('sqlmap_cache_model_already_exists', $cacheModel->getID());
		else
			$this->_cacheModels->add($cacheModel->getID(), $cacheModel);
	}

	/**
	 * Gets a cache by name
	 * @param string the name of the cache to get.
	 * @return TSqlMapCacheModel the cache object.
	 * @throws TSqlMapConfigurationException
	 */
	public function getCacheModel($name)
	{
		if(!$this->_cacheModels->contains($name))
			throw new TSqlMapConfigurationException('sqlmap_unable_to_find_cache_model', $name);
		return $this->_cacheModels[$name];
	}

	/**
	 * Flushes all cached objects that belong to this SqlMap
	 */
	public function flushCacheModels()
	{
		foreach($this->_cacheModels as $cache)
			$cache->flush();
	}
}


text:
package.path = "../?.lua;" .. package.path

local control_port = arg[1] or CONTROL_PORT or 'CNCB1'
local data_port    = arg[2] or DATA_PORT or 'CNCB0'

local rs232     = require "rs232"
local ztimer    = require "lzmq.timer"
local utils     = require "utils"
local TEST_CASE = require "lunit".TEST_CASE

local out       = io.stderr
local started   = ztimer.monotonic():start()
local monotonic = ztimer.monotonic()

local pcall, error, type, table, ipairs, print = pcall, error, type, table, ipairs, print
local RUN = utils.RUN
local IT, CMD, PASS = utils.IT, utils.CMD, utils.PASS
local nreturn, is_equal = utils.nreturn, utils.is_equal
local fmt = string.format

local function is_timed_out(elapsed, timeout)
  if elapsed >= timeout then return true end
  if (timeout - elapsed) < 100 then return true end
  return false, string.format("timeout expected (%d - %d) but got %d", timeout - 100, timeout, elapsed)
end

local function open_port(name)
  local p, e = rs232.port(name)
  local ok, e = p:open()

  if not ok then
    print(string.format("can't open serial port '%s', error: '%s'",
        name, tostring(e)))
    os.exit(-1)
  end

  print(string.format("OK, port open with values '%s'", e))
  return p
end

local control, data
local sep     = '\n'

local function printf(...)
  io.stderr:write(string.format(...))
end

local function remote(...)
  local s = string.format(...)
  s = string.gsub(s, "\n", ";")
  s = string.gsub(s, "%s+", " ")
  s = string.gsub(s, "^%s*", "")
  s = s .. sep
  local n, err = control:write(s)
  assert(n, tostring(err))
  assert(#s == n, "Write error. Written: " .. tostring(n))
  local d, e = control:read(1, 30000)
  assert(d, tostring(e))
  assert(not e, tostring(e))
  assert(#d == 1)
  assert(d == sep, "Read error. Got " .. string.byte(d))
end

local function reconnect()
  remote[[
    data:in_queue_clear()
    while true do d = data:read(1024, 100)
      if not d or #d == 0 then break end
    end
  ]]
  data:in_queue_clear()
  while true do d = data:read(1024, 100)
    if not d or #d == 0 then break end
  end
end

local ENABLE = true

local _ENV = TEST_CASE'echo'                if ENABLE or true then
local it = IT(_ENV or _M)

function setup()
  reconnect()
end

local function test_echo(len)
  local s = ('a'):rep(len)

  remote([[
    s = data:read(%d, 5000, 1)
    if s then data:write(s) end
  ]], len)

  local ret = assert(data:write(s))
  if type(ret) == 'number' then
    assert_equal(len, ret)
  else
    assert_equal(data, ret)
  end

  local s1 = assert_string(data:read(len, 5000, true))
  assert_equal(len, #s1)
end

local function test(len)
  it(fmt("%d bytes", len), function()
    test_echo(len)
  end)
end

test(128)
test(256)
test(1024)

end

local _ENV = TEST_CASE'read timeout forced' if ENABLE then
local it = IT(_ENV or _M)

function setup()
  reconnect()
end

local function test_read_timeout_forced(len, tm, sl)
  remote([[
      str = string.rep('a', %d)
      data:write(str)
      print('server: sleeping for %dms')
      ztimer.sleep(%d)
      print('server: woke up')
      data:write(str)
  ]], len, sl, sl)

  monotonic:start()

  local d, e = assert_string(data:read(2*len, tm, true))

  local elapsed = monotonic:stop()

  assert(#d > 0)

  if #d ~= 2 * len then
    assert_true(is_timed_out(elapsed, tm))
  end
end

local function test(len, tm, sl)
  it(fmt("%d bytes, %dms total timeout, %dms pause", len, tm, sl), function()
    test_read_timeout_forced(len, tm, sl)
  end)
end

test(1024, 2000, 3000)
test(1024, 3000, 2000)
test(2048, 2000, 3000)
test(2048, 3000, 2000)

end

local _ENV = TEST_CASE'read some'           if ENABLE then
local it = IT(_ENV or _M)

function setup()
  reconnect()
end

local function test_read_some(len, tm, sl)
  remote([[
      str = string.rep('a', %d)
      print('server: sleeping for %dms')
      ztimer.sleep(%d)
      print('server: woke up')
      data:write(str)
  ]], len, sl, sl)

  monotonic:start()

  local d = assert_string(data:read(len, tm))

  local elapsed = monotonic:stop()

  if #d < len then
    assert_true(is_timed_out(elapsed, tm))
  end
end

local function test(len, tm, sl)
  it(fmt("%d bytes, %dms total timeout, %dms pause", len, tm, sl), function()
    test_read_some(len, tm, sl)
  end)
end

test(1024, 2000, 3000)
test(1024, 3000, 2000)

end

local _ENV = TEST_CASE'read all'            if ENABLE then
local it = IT(_ENV or _M)

function setup()
  reconnect()
end

local function test_read_all(len, sl)
  remote([[
      str = string.rep('a', %d)
      print('server: sleeping for %dms')
      ztimer.sleep(%d)
      data:write(str)
      print('server: sleeping for %dms')
      ztimer.sleep(%d)
      print('server: woke up')
      data:write(str)
  ]], len, sl, sl, sl, sl)

  monotonic:start()

  local d = assert_string(data:read(len * 2))

  local elapsed = monotonic:stop()

  assert_true(#d > 0, 'no data')
  assert_true(#d <= len, fmt("wait too long %d, readed %d", elapsed, #d))
end

local function test(len, sl)
  it(fmt("%d bytes, %dms pause", len, sl), function()
    test_read_all(len, sl)
  end)
end

test(64,   2000)
test(128,  2000)
test(512,  2000)
test(1024, 2000)

end

local _ENV = TEST_CASE'input queue'         if ENABLE then
local it = IT(_ENV or _M)

function setup()
  reconnect()
end

local function test_queue_in(len)
  local l = assert_number(data:in_queue())
  assert_equal(0, l, 'should be emty')

  remote([[
    s = ('a'):rep(%d)
    data:write(s)
  ]], len)

  ztimer.sleep(2000)

  l = assert_number(data:in_queue())
  assert_equal(len, l)

  local d = assert_string(data:read(1, 0))
  assert_equal(1, #d)

  l = assert_number(data:in_queue())
  assert_equal(len-1, l)

  assert(data:in_queue_clear())

  l = assert_number(data:in_queue())
  assert_equal(0, l, 'should be emty')
end

local function test(len)
  it(fmt("%d bytes", len), function()
    test_queue_in(len)
  end)
end

test(16)
test(128)
test(256)
test(1024)

end

control = open_port(control_port)
data    = open_port(data_port)

RUN(function()
  printf("\n")
  printf("--------------------------------------------------\n")
  printf("-- testing done in %.2fs\n", started:stop()/1000)
  printf("--------------------------------------------------\n")
  remote("ztimer.sleep(500);os.exit()")
end)


text:
package api

import (
	"net/http"
	"reflect"
	"strings"

	"github.com/bigokro/gruff-server/gruff"
	"github.com/google/uuid"
	"github.com/labstack/echo"
)

func GetClaim(c echo.Context) error {
	ctx := ServerContext(c)
	db := ctx.Database

	id, err := uuid.Parse(c.Param("id"))
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewNotFoundError(err.Error()))
	}

	claim := gruff.Claim{}

	db = db.Preload("Links")
	db = db.Preload("Contexts")
	db = db.Preload("Values")
	db = db.Preload("Tags")
	db = db.Where("id = ?", id)
	err = db.First(&claim).Error
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
	}

	proArgs := []gruff.Argument{}
	db = ctx.Database
	db = db.Preload("Claim")
	db = db.Where("type = ?", gruff.ARGUMENT_TYPE_PRO_TRUTH)
	db = db.Where("target_claim_id = ?", id)
	db = db.Scopes(gruff.OrderByBestArgument)
	err = db.Find(&proArgs).Error
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
	}
	claim.ProTruth = proArgs

	conArgs := []gruff.Argument{}
	db = ctx.Database
	db = db.Preload("Claim")
	db = db.Where("type = ?", gruff.ARGUMENT_TYPE_CON_TRUTH)
	db = db.Where("target_claim_id = ?", id)
	db = db.Scopes(gruff.OrderByBestArgument)
	err = db.Find(&conArgs).Error
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
	}
	claim.ConTruth = conArgs

	return c.JSON(http.StatusOK, claim)
}

func ListTopClaims(c echo.Context) error {
	ctx := ServerContext(c)
	db := ctx.Database

	claims := []gruff.Claim{}

	db = BasicJoins(ctx, c, db)
	db = db.Where("0 = (SELECT COUNT(*) FROM arguments WHERE claim_id = claims.id)")
	db = BasicPaging(ctx, c, db)

	err := db.Find(&claims).Error
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
	}

	if ctx.Payload["ct"] != nil {
		ctx.Payload["results"] = claims
		return c.JSON(http.StatusOK, ctx.Payload)
	}

	return c.JSON(http.StatusOK, claims)
}

func SetScore(c echo.Context) error {
	ctx := ServerContext(c)
	db := ctx.Database

	id, err := uuid.Parse(c.Param("id"))
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewNotFoundError(err.Error()))
	}

	user := ctx.UserContext
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewUnauthorizedError(err.Error()))
	}

	paths := strings.Split(c.Path(), "/")
	scoreType := paths[len(paths)-1]

	var claim bool
	var target, item interface{}

	switch scoreType {
	case "truth":
		claim = true
		target = &gruff.Claim{}
		item = &gruff.ClaimOpinion{UserID: user.ID, ClaimID: id}
	case "strength":
		claim = false
		target = &gruff.Argument{}
		item = &gruff.ArgumentOpinion{UserID: user.ID, ArgumentID: id}
	default:
		return AddGruffError(ctx, c, gruff.NewNotFoundError(err.Error()))
	}

	err = db.Where("id = ?", id).First(target).Error
	if err != nil {
		return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
	}

	data := map[string]interface{}{}
	if err := c.Bind(&data); err != nil {
		return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
	}
	var score float64
	if val, ok := data["score"]; ok {
		score = val.(float64)
	}

	status := http.StatusCreated
	db = ctx.Database
	db = db.Where("user_id = ?", user.ID)
	if claim {
		db = db.Where("claim_id = ?", id)
	} else {
		db = db.Where("argument_id = ?", id)
	}
	if err := db.First(item).Error; err != nil {
		setScore(item, scoreType, score)
		db = ctx.Database
		err = db.Create(item).Error
		if err != nil {
			return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
		}
	} else {
		setScore(item, scoreType, score)
		db = ctx.Database
		err = db.Save(item).Error
		if err != nil {
			return AddGruffError(ctx, c, gruff.NewServerError(err.Error()))
		}
		status = http.StatusAccepted
	}

	switch scoreType {
	case "truth":
		target.(*gruff.Claim).UpdateTruth(ServerContext(c))
	case "strength":
		target.(*gruff.Argument).UpdateStrength(ServerContext(c))
	}

	return c.JSON(status, item)
}

func setScore(item interface{}, field string, score float64) {
	v := reflect.ValueOf(item)
	if v.Kind() == reflect.Ptr {
		v = reflect.ValueOf(item).Elem()
	}
	f := v.FieldByName(strings.Title(field))
	f.Set(reflect.ValueOf(score))
}


text:
An AFOAuth1Client subclass for easily authenticating with LinkedIn.

## Instructions

Register your application to [launch from a custom URL scheme](http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html), and use that with the path `/success` as your callback URL.

Here's how it all looks together:

``` objective-c
AFLinkedInOAuth1Client *linkedinClient = [[AFLinkedInOAuth1Client alloc] initWithBaseURL:[NSURL URLWithString:@"https://api.linkedin.com/"]
                                                                     key:@"KEY"
                                                                  secret:@"SECRET"];

[linkedinClient authorizeUsingOAuthWithRequestTokenPath:@"uas/oauth/requestToken"
                                  userAuthorizationPath:@"uas/oauth/authorize"
                                            callbackURL:[NSURL URLWithString:@"x-yourscheme://success"]
                                        accessTokenPath:@"uas/oauth/accessToken"
                                           accessMethod:@"POST"
                                                success:^(AFOAuth1Token *accessToken) {
                                                    NSLog(@"Success: %@", accessToken);
                                                } failure:^(NSError *error) {
                                                    NSLog(@"Error: %@", error);
                                                }];
```

## Details for LinkedIn

Two problems occur from the base AFOAuth1Client implementation, onlined on [this page](http://developer.linkedin.com/documents/common-issues-oauth-authentication).

* Content-Type needs to be text/xml.   Don't think thats in the OAuth spec...
* "Properly handling oauth_token_secret"

## Contact

PJ Gray

- http://github.com/pj4533
- http://twitter.com/pj4533
- pj@pj4533.com

## License

AFLinkedInOAuth1Client is available under the MIT license. See the LICENSE file for more info.


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class FixTeamspeakForeignKeys extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::disableForeignKeyConstraints();

        Schema::table('teamspeak_channel_group_permission', function (Blueprint $table) {
            $table->dropForeign('teamspeak_channel_group_permission_channelgroup_id_foreign');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('teamspeak_channel_group_permission', function (Blueprint $table) {
            $table->foreign('channelgroup_id')->references('id')->on('teamspeak_group')->onDelete('cascade');
        });
    }
}


text: Implementacion del problema conocido como el Mundo de la Aspiradora en el lenguaje Ada.


text:
SWANDIR=${CURDIR}/../../../build-root/build-vpp-native/external/sswan
# location of config.h
CONFIGH=$(SWANDIR)/config.h
# default install prefix: /usr/local or /usr
PREFIX=/usr
# location of the installed strongSwan libraries
SWANLIBS=$(PREFIX)/lib/ipsec/
# location of the strongSwan plugins
SWANPLUGINS=$(PREFIX)/lib/ipsec/plugins
# location of the strongSwan archive
SWANARCHIVE=${CURDIR}/../../../build/external/downloads
# default install configuration files:
PREFIX_SYS_CONF=/etc
# target location of the plugin config snippet: $(PREFIX)/etc/strongswan.d/charon/ or /etc/strongswan.d/charon/
PLUGINCONF=$(PREFIX_SYS_CONF)/strongswan.d/charon/
# location of the  VPP libraries
VPPLIBS=$(CURDIR)/../../../build-root/install-vpp-native/vpp/lib/x86_64-linux-gnu
# the directory to the VPP sources
VPPDIR=../../../build-root/install-vpp-native/vpp/include

TARGET=libstrongswan-kernel-vpp.so

# tested only with 5.9.5 and 5.9.6 version of strongSwan
VERSION_SSWAN=5.9.6

CFLAGS=-O2 -g -Wall -Wextra -fpic

CFLAGS_I=-include $(CONFIGH) \
	-I$(SWANDIR)/src/libstrongswan \
	-I$(SWANDIR)/src/libcharon

LDFLAGS= -lvppinfra \
	-lvlibmemoryclient \
	-lvlibapi \
	-lsvm \
	-lvppapiclient

VERSION_VPP=$(shell (dpkg -s vpp | grep Version) | grep -Po '(?<=Version: )\d\d.\d\d')

# check if VPP is installed
ifneq ($(shell test "$(shell ldconfig -p | grep vppinfra.so | awk 'NR==1{print $$1;}')" && echo "yes"), yes)
# check if VPPDIR exists
ifeq ($(shell test -d $(VPPDIR) && echo "yes"), yes)
	CFLAGS_I += -I$(VPPDIR)
endif
# check if VPPLIBS exists
ifeq ($(shell test -d $(VPPLIBS) && echo "yes"), yes)
	LDFLAGS += -L$(VPPLIBS)
	LDFLAGS += -Wl,-rpath=$(VPPLIBS)
endif
endif

SOURCES=$(wildcard *.c)
OBJECTS=$(SOURCES:.c=.o)

all: pull-swan $(TARGET)

pull-swan:
	@if [ -d "${SWANDIR}" ]; then \
	  rm -rf ${SWANDIR} ; \
	fi
	@if ! [ -f "${SWANARCHIVE}/strongswan-${VERSION_SSWAN}.tar.gz" ]; then \
	  curl -o ${SWANARCHIVE}/strongswan-${VERSION_SSWAN}.tar.gz -LO https://github.com/strongswan/strongswan/archive/${VERSION_SSWAN}.tar.gz; \
	fi
	@if ! [ -d "${CURDIR}/../../../build-root/build-vpp-native/external/" ]; then \
	  mkdir ${CURDIR}/../../../build-root/build-vpp-native/external; \
	fi
	tar -zxof ${SWANARCHIVE}/strongswan-${VERSION_SSWAN}.tar.gz -C ${CURDIR}/../../../build-root/build-vpp-native/external/
	mv ${CURDIR}/../../../build-root/build-vpp-native/external/strongswan-${VERSION_SSWAN} ${SWANDIR}
	cd ${SWANDIR} && ./autogen.sh
	cd ${SWANDIR} && ./configure --prefix=${PREFIX} --sysconfdir=${PREFIX_SYS_CONF} --enable-libipsec --enable-systemd --enable-swanctl --disable-gmp --enable-openssl
	cd ${SWANDIR} && make -j$(nproc)
#	cd ${SWANDIR} && sudo make install

# check if VPP is installed
ifneq ($(shell test "$(shell ldconfig -p | grep vppinfra.so | awk 'NR==1{print $$1;}')" && echo "yes"), yes)
	$(info INFO: Not found installed VPP - checking if locally VPP exists)
# check if VPPDIR exists
ifneq ($(shell test -d $(VPPDIR) && echo "yes"), yes)
	$(error ERROR: Not found installed VPP and locally VPP - please install or build)
else
# check if VPPLIBS exists
ifneq ($(shell test -d $(VPPLIBS) && echo "yes"), yes)
	$(error ERROR: directory $(VPPLIBS) - doesn't exists, please compile VPP before build this)
else
	$(info INFO: Found locally VPP)
endif
endif
else
	$(info INFO: Found installed VPP in version: $(VERSION_VPP))
endif

$(TARGET): $(OBJECTS)
	gcc $(CFLAGS) -shared -DPIC $(OBJECTS) $(LDFLAGS) -Wl,-soname -Wl,$(TARGET) -o $@
	cp $(TARGET) ${SWANDIR}

%.o: %.c
	gcc $(CFLAGS) $(CFLAGS_I) -c $< -o $@ $(LDFLAGS)

install:
	cp $(TARGET) $(SWANPLUGINS)/$(TARGET)
	cp kernel-vpp.conf $(PLUGINCONF)

clean:
	rm -f *.so *.o

.PHONY: clean install all


text:
var webpack = require("webpack");

module.exports = exports = Object.create(require("./webpack.config.js"));
exports.plugins = exports.plugins = [
  new webpack.optimize.UglifyJsPlugin()
];
exports.output = Object.create(exports.output);
exports.output.filename = exports.output.filename.replace(/\.js$/, ".min.js");


text:
var easyimg = require('easyimage'),
    path = require('path'),
    jsonfile = require('jsonfile'),
    util = require('util'),
    fs = require('fs'),
    cheerio = require("cheerio");

var httpHelper = require("./httpHelper");

var downloadsPath = path.join(__dirname, 'data');
var booksPath = path.join(__dirname, 'books');

var bookDetails = function(urls, callback){
  if(!urls.length){
    callback();
    return;
  }
  console.log('>>> remaining books length: '+urls.length);
  var bookURL = urls.pop();//remove, and get the last one...
  httpHelper.get(bookURL, 30000, function(err, data){
    var $ = cheerio.load(data);
    var article = $('td[align=center].shanglan');
    //FIX, remove the width so display rightly in ionic, @2015/09/19
    article.find('table[width=600]').removeAttr('width');
    article.find('img').remove();//delete image for content display elegant;

    // var rawImgURL = article.find('img').attr('src');
    // if(rawImgURL){
    //   var rawImgPath = rawImgURL.split('/');
    //   var imgName = rawImgPath[rawImgPath.length-1];
    //   article.find('img').attr('src', 'books/thumbnails/'+imgName);//replace remote url to local
    // }

    var bookPath = bookURL.split('/');
    var bookPage = bookPath[bookPath.length-1];
    fs.writeFile(booksPath+'/'+bookPage, article.html(), function (err) {
      if (err) throw err ;
      console.log("File Saved: "+bookPage); //文件被保存
    }) ;

    bookDetails(urls, callback);//continue downloading book..
  }, 'gb2312');
};

var file = downloadsPath+'/2.json';
jsonfile.readFile(file, function(err, obj) {
  var thumbObjs = JSON.parse(obj);
  var urls = [];
  for(var i in thumbObjs){
    urls.push(thumbObjs[i]['href']);
  }

  // bookDetails(['http://www.yhcqw.com/Mall/jptj/2010-12/2/yh2742_151.html'], function(){
  bookDetails(urls, function(){
    console.log('>>> all book details downloaded!');
  });
})


text:
<!DOCTYPE html>

<link rel="stylesheet" href="webjars/bootstrap/3.3.5/css/bootstrap.css">

Getting started

An overview of Bootstrap, how to download and use, basic
				templates and examples, and more.

CSS

					<button type="button" class="btn btn-default">Default</button>
					<button type="button" class="btn btn-primary">Primary</button>
					<button type="button" class="btn btn-success">Success</button>
					<button type="button" class="btn btn-info">Info</button>
					<button type="button" class="btn btn-warning">Warning</button>
					<button type="button" class="btn btn-danger">Danger</button>
					<button type="button" class="btn btn-link">Link</button>

Form

				<form class="form-horizontal">

						Email

							<input type="email" class="form-control" id="inputEmail3"
								placeholder="Email">

						Password

							<input type="password" class="form-control" id="inputPassword3"
								placeholder="Password">

								 <input type="checkbox"> Remember me

							<button type="submit" class="btn btn-default">Sign in</button>

				</form>

Components

							#
							First Name
							Last Name
							Username

							1
							Mark
							Otto
							@mdo

							2
							Jacob
							Thornton
							@fat

							3
							Larry
							the Bird
							@twitter

Javascript

							<button class="navbar-toggle collapsed" type="button"
								data-toggle="collapse"
								data-target=".bs-example-js-navbar-collapse">
								Toggle navigation
							</button>
							Project Name

 Dropdown

Action

Another action

Something else here

Separated link

 Dropdown

Action

Another action

Something else here

Separated link

 Dropdown

Action

Another action

Something else here

Separated link

					<button type="button" class="btn btn-primary" data-toggle="modal"
						data-target=".bs-example-modal-lg">Large modal</button>

								<button type="button" class="close" data-dismiss="modal"
									aria-label="Close">
									X
								</button>

Large modal

...

Icons

					<button type="button" class="btn btn-default">

					</button>
					<button type="button" class="btn btn-default">

					</button>
					<button type="button" class="btn btn-default">

					</button>
					<button type="button" class="btn btn-default">

					</button>
					<button type="button" class="btn btn-default">

					</button>
					<button type="button" class="btn btn-default">

					</button>
					<button type="button" class="btn btn-default">

					</button>
					<button type="button" class="btn btn-default">

					</button>


text:
'use strict';

import { localize } from 'vs/nls';
import { basename } from 'vs/base/common/paths';
import { IDisposable, dispose, Disposable, combinedDisposable } from 'vs/base/common/lifecycle';
import { filterEvent, anyEvent as anyEvent } from 'vs/base/common/event';
import { VIEWLET_ID } from 'vs/workbench/parts/scm/common/scm';
import { ISCMService, ISCMRepository } from 'vs/workbench/services/scm/common/scm';
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar';

export class StatusUpdater implements IWorkbenchContribution {

	private badgeDisposable: IDisposable = Disposable.None;
	private disposables: IDisposable[] = [];

	constructor(
		@ISCMService private scmService: ISCMService,
		@IActivityService private activityService: IActivityService
	) {
		this.scmService.onDidAddRepository(this.onDidAddRepository, this, this.disposables);
		this.render();
	}

	private onDidAddRepository(repository: ISCMRepository): void {
		const provider = repository.provider;
		const onDidChange = anyEvent(provider.onDidChange, provider.onDidChangeResources);
		const changeDisposable = onDidChange(() => this.render());

		const onDidRemove = filterEvent(this.scmService.onDidRemoveRepository, e => e === repository);
		const removeDisposable = onDidRemove(() => {
			disposable.dispose();
			this.disposables = this.disposables.filter(d => d !== removeDisposable);
			this.render();
		});

		const disposable = combinedDisposable([changeDisposable, removeDisposable]);
		this.disposables.push(disposable);
	}

	private render(): void {
		this.badgeDisposable.dispose();

		const count = this.scmService.repositories.reduce((r, repository) => {
			if (typeof repository.provider.count === 'number') {
				return r + repository.provider.count;
			} else {
				return r + repository.provider.groups.elements.reduce<number>((r, g) => r + g.elements.length, 0);
			}
		}, 0);

		if (count > 0) {
			const badge = new NumberBadge(count, num => localize('scmPendingChangesBadge', '{0} pending changes', num));
			this.badgeDisposable = this.activityService.showActivity(VIEWLET_ID, badge, 'scm-viewlet-label');
		} else {
			this.badgeDisposable = Disposable.None;
		}
	}

	dispose(): void {
		this.badgeDisposable.dispose();
		this.disposables = dispose(this.disposables);
	}
}

export class StatusBarController implements IWorkbenchContribution {

	private statusBarDisposable: IDisposable = Disposable.None;
	private focusDisposable: IDisposable = Disposable.None;
	private focusedRepository: ISCMRepository | undefined = undefined;
	private focusedProviderContextKey: IContextKey<string | undefined>;
	private disposables: IDisposable[] = [];

	constructor(
		@ISCMService private scmService: ISCMService,
		@IStatusbarService private statusbarService: IStatusbarService,
		@IContextKeyService contextKeyService: IContextKeyService
	) {
		this.focusedProviderContextKey = contextKeyService.createKey<string | undefined>('scmProvider', void 0);
		this.scmService.onDidAddRepository(this.onDidAddRepository, this, this.disposables);

		if (this.scmService.repositories.length > 0) {
			this.onDidFocusRepository(this.scmService.repositories[0]);
		}
	}

	private onDidAddRepository(repository: ISCMRepository): void {
		const changeDisposable = repository.onDidFocus(() => this.onDidFocusRepository(repository));
		const onDidRemove = filterEvent(this.scmService.onDidRemoveRepository, e => e === repository);
		const removeDisposable = onDidRemove(() => {
			disposable.dispose();
			this.disposables = this.disposables.filter(d => d !== removeDisposable);

			if (this.scmService.repositories.length === 0) {
				this.focusedProviderContextKey.set(undefined);
			} else if (this.focusedRepository === repository) {
				this.scmService.repositories[0].focus();
			}
		});

		const disposable = combinedDisposable([changeDisposable, removeDisposable]);
		this.disposables.push(disposable);

		if (this.scmService.repositories.length === 1) {
			this.onDidFocusRepository(repository);
		}
	}

	private onDidFocusRepository(repository: ISCMRepository): void {
		if (this.focusedRepository !== repository) {
			this.focusedRepository = repository;
			this.focusedProviderContextKey.set(repository.provider.id);
		}

		this.focusDisposable.dispose();
		this.focusDisposable = repository.provider.onDidChange(() => this.render(repository));
		this.render(repository);
	}

	private render(repository: ISCMRepository): void {
		this.statusBarDisposable.dispose();

		const commands = repository.provider.statusBarCommands || [];
		const label = repository.provider.rootUri
			? `${basename(repository.provider.rootUri.fsPath)} (${repository.provider.label})`
			: repository.provider.label;

		const disposables = commands.map(c => this.statusbarService.addEntry({
			text: c.title,
			tooltip: `${label} - ${c.tooltip}`,
			command: c.id,
			arguments: c.arguments
		}, MainThreadStatusBarAlignment.LEFT, 10000));

		this.statusBarDisposable = combinedDisposable(disposables);
	}

	dispose(): void {
		this.focusDisposable.dispose();
		this.statusBarDisposable.dispose();
		this.disposables = dispose(this.disposables);
	}
}


text:
//
//  MTKObserver.h
//  Block Key-Value Observing
//
//  Created by Martin Kiss on 28.9.12.
//  Copyright (c) 2012 iMartin Kiss. All rights reserved.
//

#import <Foundation/Foundation.h>

#pragma mark Block Typedefs

typedef void(^MTKBlockGeneric)      (__weak id self,                            id newVal);
typedef void(^MTKBlockChange)       (__weak id self,                    id old, id newVal);
typedef void(^MTKBlockChangeMany)   (__weak id self, NSString *keyPath, id old, id newVal);
typedef void(^MTKBlockInsert)       (__weak id self,                            id newVal, NSIndexSet *indexes);
typedef void(^MTKBlockRemove)       (__weak id self,                    id old,         NSIndexSet *indexes);
typedef void(^MTKBlockReplace)      (__weak id self,                    id old, id newVal, NSIndexSet *indexes);

typedef void(^MTKBlockForeignChange)    (__weak id self, __weak id object,                      id old, id newVal);
typedef void(^MTKBlockForeignChangeMany)(__weak id self, __weak id object, NSString *keyPath,   id old, id newVal);

typedef void(^MTKBlockNotify)       (__weak id self, NSNotification *notification);

/**
 This is private class. This is the object that holds observation blocks and observes given property using standatd KVO.
 For multiple observations of the same key-path (and object) only one observer is used.
 */
@interface MTKObserver : NSObject

#pragma mark Initialization
/// Do not use. Observation target will be nil, so any calls to it will have no effect.
- (id)init;
/// Designated initializer.
- (id)initWithTarget:(NSObject *)target keyPath:(NSString *)keyPath owner:(id)owner;

#pragma mark Ownership
/// Object that 'owns' all blocks in this observer. This object was the caller of observation method.
@property (nonatomic, readonly, assign) id owner;

#pragma mark Attaching
/// Attached means, that this object really observes the key-path it was initialized with. Set it to add/remove this observer.
@property (nonatomic, readwrite, assign) BOOL attached;
/// Convenience method to set `attached` to YES.
- (void)attach;
/// Convenience method to set `attached` to NO.
- (void)detach;

#pragma mark Blocks
/// Add block to be executed on key-path setting of simple property or relationship.
- (void)addSettingObservationBlock:(MTKBlockChange)block;
/// Add block to be executed on key-path relationship insertion.
- (void)addInsertionObservationBlock:(MTKBlockInsert)block;
/// Append block to be executed on key-path relationship removal.
- (void)addRemovalObservationBlock:(MTKBlockRemove)block;
/// Add block to be executed on key-path relationship replacement.
- (void)addReplacementObservationBlock:(MTKBlockReplace)block;

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns="http://datacite.org/schema/kernel-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
<identifier identifierType="DOI"></identifier>
<creators>
<creator><creatorName>Robert Rodriguez</creatorName></creator>
</creators>
<titles>
<title>NEXUS Chest CT</title>
</titles>
<publisher>University of California, San Francisco</publisher>
<publicationYear>2015</publicationYear>
<subjects>
<subject>Chest CT</subject>
<subject> trauma</subject>
</subjects>
<contributors>
<contributor contributorType="ResearchGroup"><contributorName>UCSF</contributorName></contributor>
</contributors>
<resourceType resourceTypeGeneral="Dataset">Dataset</resourceType>
<descriptions>
<description descriptionType="Abstract"></description>
<description descriptionType="Methods"></description>
</descriptions>
</resource>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Page Header</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="css/normalize.css" rel="stylesheet">
    <link href="css/container.css" rel="stylesheet">
    <link href="css/grid.css" rel="stylesheet">
    <link href="css/typography.css" rel="stylesheet">
    <link href="css/page-header.css" rel="stylesheet">

Page Header

Example page header Subtext for header


text:
export EXTRA_LIBS="-lncurses ${NACL_CLI_MAIN_LIB}"

if [ "${NACL_LIBC}" = "newlib" ]; then
  EXTRA_CONFIGURE_ARGS="--enable-tiny"
  NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
  export EXTRA_LIBS+=" -lglibc-compat"
fi

PatchStep() {
  DefaultPatchStep
  cp ${START_DIR}/nano_pepper.c ${SRC_DIR}/src/
}

PublishStep() {
  MakeDir ${PUBLISH_DIR}

  # TODO(sbc): avoid duplicating the install step here.
  DESTDIR=${PUBLISH_DIR}/nanotar
  MAKEFLAGS="prefix="
  DefaultInstallStep

  ChangeDir ${PUBLISH_DIR}/nanotar
  local exe="../nano_${NACL_ARCH}${NACL_EXEEXT}"
  cp bin/nano${NACL_EXEEXT} ${exe}
  if [ "${NACL_ARCH}" = "pnacl" ]; then
    LogExecute ${PNACLFINALIZE} ${exe}
  fi
  rm -rf bin
  rm -rf share/man
  tar cf ${PUBLISH_DIR}/nano.tar .
  rm -rf ${PUBLISH_DIR}/nanotar
  cd ${PUBLISH_DIR}
  LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
      nano_*${NACL_EXEEXT} \
      -s . \
      -o nano.nmf
  LogExecute python ${TOOLS_DIR}/create_term.py nano.nmf

  InstallNaClTerm ${PUBLISH_DIR}

  GenerateManifest ${START_DIR}/manifest.json ${PUBLISH_DIR}
  LogExecute cp ${START_DIR}/icon_16.png ${PUBLISH_DIR}
  LogExecute cp ${START_DIR}/icon_48.png ${PUBLISH_DIR}
  LogExecute cp ${START_DIR}/icon_128.png ${PUBLISH_DIR}
  ChangeDir ${PUBLISH_DIR}
  CreateWebStoreZip nano-${VERSION}.zip .
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>de.cismet</groupId>
        <artifactId>cismet-parent</artifactId>
        <version>2.1</version>
    </parent>

    <groupId>de.cismet.tools</groupId>
    <artifactId>sq-belle</artifactId>
    <version>2.1-SNAPSHOT</version>
    <packaging>nbm</packaging>

    <name>SQ-Belle</name>
    <description>The missing Netbeans code formatter for x-sql.</description>

    <developers>
        <developer>
            <id>helllth</id>
            <name>Thorsten Hell</name>
            <email>th@cismet.de</email>
            <organization>cismet GmbH</organization>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:https://github.com/cismet/sq-belle.git</connection>
        <developerConnection>scm:git:git@github.com:cismet/sq-belle.git</developerConnection>
        <url>https://github.com/cismet/sq-belle</url>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <netbeans.version>RELEASE802</netbeans.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.5.6-Final</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-api-annotations-common</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-editor-indent</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-options-api</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-util</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-util-lookup</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-awt</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-autoupdate-services</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>cismet-repo</id>
            <url>https://repo.cismet.de/repo</url>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
                <updatePolicy>daily</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
                <updatePolicy>interval:60</updatePolicy>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>cismet-repo</id>
            <url>https://repo.cismet.de/repo</url>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
                <updatePolicy>daily</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
                <updatePolicy>interval:60</updatePolicy>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <version>3.13.2</version>
                <extensions>true</extensions>
                <configuration>
                    <author>Thorsten Hell @ cismet GmbH</author>
                    <moduleType>normal</moduleType>
                    <distributionUrl>https://cismet.github.io/sq-belle/updatecenter/</distributionUrl>
                    <licenseName>BSD</licenseName>
                    <licenseFile>${basedir}/LICENSE</licenseFile>
                    <homePageUrl>https://cismet.github.io/sq-belle</homePageUrl>
                    <keystore>${de.cismet.keystore.path}</keystore>
                    <keystorealias>cismet</keystorealias>
                    <keystorepassword>${de.cismet.keystore.pass}</keystorepassword>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <!-- to have the jar plugin pickup the nbm generated manifest -->
                    <useDefaultManifestFile>true</useDefaultManifestFile>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <preparationGoals>clean install</preparationGoals>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <goals>deploy nbm:autoupdate</goals>
                    <!-- jalopy compile interferes with the release plugin so it must be deactivated -->
                    <arguments>-Djalopy.skip=true</arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>