text:
<?php

$ids = array();
$url = 'http://oai.bnf.fr/oai2/OAIHandler?verb=ListRecords&metadataPrefix=oai_dc&set=gallica';

read_oai($url, $ids);

/**** FUNCTIONS ****/
function read_oai ($url, $ids){
	$doc = new DOMDocument();
	if ($doc->load($url) === FALSE){
		return "FAIL";
	} else {
		echo "Processing {$url}\n";
		$service = $doc->getElementsByTagNameNS('http://www.openarchives.org/OAI/2.0/', 'request')->item(0)->nodeValue;
		$xpath = new DOMXpath($doc);
		$xpath->registerNamespace('oai', 'http://www.openarchives.org/OAI/2.0/');
		$xpath->registerNamespace('dc', 'http://purl.org/dc/elements/1.1/');
		$records = $xpath->query("descendant::oai:record[not(oai:header/@status = 'deleted')]");

		foreach ($records as $record){
			$id = $record->getElementsByTagNameNS('http://www.openarchives.org/OAI/2.0/', 'identifier')->item(0)->nodeValue;
			$descriptions = $record->getElementsByTagNameNS('http://purl.org/dc/elements/1.1/', 'description');

			foreach ($descriptions as $desc){
				if (strpos($desc->nodeValue, 'MonnGre') !== FALSE){
					echo "Found {$id}\n";
					$ids[] = $id;
				}
			}
		}

		//look for resumptionToken
		$token = $xpath->query("descendant::oai:resumptionToken");

		if ($token->length > 0){
			echo "Checked " . $token->item(0)->getAttribute('cursor') . " of " . $token->item(0)->getAttribute('completeListSize') . ".\n";
			$url = $service . '?verb=ListRecords&resumptionToken=' . $token->item(0)->nodeValue;
			read_oai($url, $ids);
		}
	}
}

?>


text:
      <input type="checkbox" value="$ctrl.convo.id" ng-click="$ctrl.select($ctrl.convo.id, $event)" ng-checked="$ctrl.selected"/>

    {{$ctrl.convo.emailFrom}}
    {{$ctrl.convo.subject}}
    {{$ctrl.convo.createdAt | date:short }}

redpajama_set_name: RedPajamaGithub


text:
typedef enum  {
    QPresentationModeNormal = 0,
    QPresentationModePopover,
    QPresentationModeNavigationInPopover,
    QPresentationModeModalForm,
    QPresentationModeModalFullScreen,
    QPresentationModeModalPage
} QPresentationMode;

@interface QRootElement : QElement {

@protected
	BOOL _grouped;

    NSString *_title;
    NSMutableArray *_sections;
    NSString *_controllerName;
}

@property(nonatomic, retain) NSString *title;
@property(nonatomic, strong) NSMutableArray *sections;
@property(nonatomic, strong) NSDictionary *sectionTemplate;
@property(assign) BOOL grouped;

@property(nonatomic, retain) NSString *controllerName;

@property(nonatomic, copy) NSString *emptyMessage;
@property(nonatomic) QPresentationMode presentationMode;

@property(nonatomic, strong) NSIndexPath *preselectedElementIndex;

@property(nonatomic, copy) void (^onValueChanged)(QRootElement *);

- (QRootElement *)init;

- (void)addSection:(QSection *)section;

+ (QRootElement *)rootForJSON:(NSString *)jsonFileName withObject:(id)object;

- (QSection *)getSectionForIndex:(NSInteger)index;
- (NSInteger)numberOfSections;

- (QSection *)getVisibleSectionForIndex:(NSInteger)index;
- (NSInteger)visibleNumberOfSections;
- (NSUInteger)getVisibleIndexForSection: (QSection*)section;

- (void)fetchValueIntoObject:(id)obj;

- (void)fetchValueUsingBindingsIntoObject:(id)object;

- (QSection *)sectionWithKey:(NSString *)key;
- (QElement *)elementWithKey:(NSString *)string;

- (QRootElement *)rootWithKey:(NSString *)string;
@end


text:
require 'sippy_cup/media/rtp_payload'

module SippyCup
  class Media
    class PCMUPayload < RTPPayload
      RTP_PAYLOAD_ID = 0x0
      SILENT_BYTE = 0xff.chr
      PTIME = 20 # in milliseconds
      RATE = 8 # in KHz
      attr_accessor :ptime

      def initialize(opts = {})
        super RTP_PAYLOAD_ID
        @ptime = opts[:ptime] || PTIME
        @rate  = opts[:rate]  || RATE
      end

      def media
        SILENT_BYTE * timestamp_interval
      end

      def timestamp_interval
        @rate * @ptime
      end
    end
  end
end


text:
<menu xmlns="http://cthul.org/xml/test/schema/menu">
    <meal price="1">
        <name>Soup</name>
        <description>It's just a soup.</description>
    </meal>
</menu>


text:
package org.scribble.parser.ast.global;

import org.antlr.runtime.tree.CommonTree;
import org.scribble.ast.AstFactoryImpl;
import org.scribble.ast.global.GContinue;
import org.scribble.ast.name.simple.RecVarNode;
import org.scribble.parser.ScribParser;
import org.scribble.parser.ast.name.AntlrSimpleName;

public class AntlrGContinue
{
	public static final int LABEL_CHILD_INDEX = 0;

	public static GContinue parseGContinue(ScribParser parser, CommonTree ct)
	{
		RecVarNode recvar = AntlrSimpleName.toRecVarNode(getRecVarChild(ct));
		return AstFactoryImpl.FACTORY.GContinue(ct, recvar);
	}

	public static final CommonTree getRecVarChild(CommonTree ct)
	{
		return (CommonTree) ct.getChild(LABEL_CHILD_INDEX);
	}
}


text:
cask :v1 => 'mention' do
  version :latest
  sha256 :no_check

  url 'https://en.mention.com/downloads/mac/mention.dmg'
  homepage 'https://en.mention.com/'
  license :unknown    # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder

  app 'Mention.app'
end


text:
package com.jmethods.catatumbo;

import java.util.List;

/**
 * Interface that provides the metadata of the Datastore, such as the namespaces in the Datastore,
 * the various Kinds in a namespace and the Properties of a Kind.
 * <p>
 * Objects of this class may be obtained from the {@link EntityManager} by calling the
 * {@link EntityManager#getDatastoreMetadata()}.
 * </p>
 *
 * @author Sai Pullabhotla
 *
 */
public interface DatastoreMetadata {

  /**
   * Returns all the namespaces in the Datastore. The results will be ordered by name in ascending
   * order. Exercise caution when using this method on a Datastore that has many many namespaces.
   * Use one of the overloaded methods to get a page of namespaces.
   *
   * @return the list of namespaces. The default namespace, if exists, would be returned as an empty
   *         string, typically the first namespace in the returned list.
   * @throws EntityManagerException
   *           if any error occurs while accessing the Datastore.
   */
  List<String> getNamespaces();

  /**
   * Returns the namespaces, up to the specified limit. The returned results will be ordered by name
   * in ascending order.
   *
   * @param limit
   *          the maximum number of namespaces to return. A limit of zero or less is interpreted as
   *          no limit and returns all results.
   * @return the namespaces, up to the specified limit. The default namespace, if exists, would be
   *         returned as an empty string.
   * @throws EntityManagerException
   *           if any error occurs while accessing the Datastore.
   */
  QueryResponse<String> getNamespaces(int limit);

  /**
   * Returns the namespaces, up to the specified limit, from the specified cursor location. The
   * results will be ordered by name in ascending order.
   *
   * @param fromCursor
   *          the cursor location from which the results should start.
   * @param limit
   *          the maximum number of namespaces to return
   * @return the namespaces from the specified cursor location. The default namespace, if exists,
   *         would be returned as an empty string.
   * @throws EntityManagerException
   *           if any error occurs while accessing the Datastore.
   */
  QueryResponse<String> getNamespaces(DatastoreCursor fromCursor, int limit);

  /**
   * Returns the available Kinds from the current namespace, where current namespace is the the
   * namespace set using {@link Tenant} or the namespace with which the {@link EntityManager} was
   * created.
   *
   * @return the Kinds in the current namespace. The returned results will be order by Kind's name
   *         in ascending order.
   * @throws EntityManagerException
   *           if any error occurs while accessing the Datastore.
   */
  List<String> getKinds();

  /**
   * Returns the available Kinds from the current namespace, where current namespace is the the
   * namespace set using {@link Tenant} or the namespace with which the {@link EntityManager} was
   * created.
   *
   * @param excludeSystemKinds
   *          whether or not to exclude System Kinds (e.g. Kinds begin with two underscores).
   *
   * @return the Kinds in the current namespace. The returned results will be order by Kind's name
   *         in ascending order.
   * @throws EntityManagerException
   *           if any error occurs while accessing the Datastore.
   */
  List<String> getKinds(boolean excludeSystemKinds);

  /**
   * Returns the list of Properties in the specified Kind. The returned list only contains indexed
   * properties. If the {@link Tenant} has a namespace set, it will be used. Otherwise, the
   * namespace with which the {@link EntityManager} was created. The returned list is order by
   * property name in ascending order.
   *
   * @param kind
   *          the Kind
   * @return the indexed properties in the given Kind.
   * @throws EntityManagerException
   *           if any error occurs while accessing the Datastore.
   */
  List<DatastoreProperty> getProperties(String kind);

}


text:
require 'find'

module Turks
  class ImageSelect
    DIRECTORY = File.expand_path('../../img', __FILE__)
    def self.random
      Find.find(DIRECTORY).to_a.shuffle!.each do |f|
        # TypeError: no implicit conversion of nil into String
        #if File.file? f && File.extname(f) =~ /(.jpg|.jpeg)/
        if File.file? f
          if File.extname(f) =~ /(.jpg|.jpeg)/
            return f
          end
        end
      end
    end
  end
end


text:
module Auto
  class AutoJournalParam
    attr_reader :auto_journal_type
    attr_reader :user

    def initialize( auto_journal_type, user = nil )
      @auto_journal_type = auto_journal_type.to_i
      @user = user
    end

  end
end


text:
<!doctype html><title>Minimal tQuery Page</title>

	<form action="javascript:void(0)" id='nicknameForm' style='display: inline-block'>
		<input type="text"/>
	</form>


text:
<vector
    android:height="16dp"
    android:width="16dp"
    android:viewportHeight="120"
    android:viewportWidth="120"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#00000000" android:fillType="evenOdd"
        android:pathData="m12,12 l96,96" android:strokeColor="#aaaaaa"
        android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="16"/>
    <path android:fillColor="#00000000" android:fillType="evenOdd"
        android:pathData="M12,108 L108,12" android:strokeColor="#aaaaaa"
        android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="16"/>
</vector>


text:
<?php

/**
 * @see Zend_Validate_Abstract
 */
require_once 'Zend/Validate/Abstract.php';

/**
 * Mock file for testbed
 *
 * @category   Zend
 * @package    Zend_Filter
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class TestNamespace_StringEquals extends Zend_Validate_Abstract
{

    const NOT_EQUALS = 'stringNotEquals';

    /**
     * Array with message templates
     *
     * @var array
     */
    protected $_messageTemplates = array(
        self::NOT_EQUALS => 'Not all strings in the argument are equal'
    );

    /**
     * Defined by Zend_Validate_Interface
     *
     * Returns true if and only if all the elements of the array argument
     * are equal to one another with string comparison.
     *
     * @param  array $value Value to validate
     * @return boolean
     */
    public function isValid($value)
    {
        $this->_setValue($value);

        $initial = (string) current((array) $value);
        foreach ((array) $value as $element) {
            if ((string) $element !== $initial) {
                $this->_error(self::NOT_EQUALS);
                return false;
            }
        }

        return true;
    }

}


text:
package com.buession.velocity.spring;

import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.VelocityException;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ResourceLoaderAware;

import java.io.IOException;

/**
 * @author Yong.Teng
 */
public class VelocityEngineFactoryBean extends VelocityEngineFactory implements FactoryBean<VelocityEngine>,
        InitializingBean, ResourceLoaderAware {

    private VelocityEngine velocityEngine;

    @Override
    public VelocityEngine getObject(){
        return velocityEngine;
    }

    @Override
    public Class<? extends VelocityEngine> getObjectType(){
        return VelocityEngine.class;
    }

    @Override
    public boolean isSingleton(){
        return true;
    }

    @Override
    public void afterPropertiesSet() throws IOException, VelocityException{
        this.velocityEngine = createVelocityEngine();
    }

}


text:
using System.Linq;
using IRunes.Data;
using IRunes.Models;

namespace IRunes.Services
{
    public class UserService : IUserService
    {
        private readonly RunesDbContext context;

        public UserService()
        {
            this.context = new RunesDbContext();
        }

        public User CreateUser(User user)
        {
            user = this.context.Users.Add(user).Entity;
            this.context.SaveChanges();

            return user;
        }

        public User GetUserByUsernameAndPassword(string username, string password)
        {
            return this.context.Users.SingleOrDefault(user => (user.Username == username || user.Email == username)
                                                              && user.Password == password);
        }
    }
}


text:
#include "TimeParticleUpdater.hpp"

using namespace crimild;

TimeParticleUpdater::TimeParticleUpdater( void )
{

}

TimeParticleUpdater::~TimeParticleUpdater( void )
{

}

void TimeParticleUpdater::configure( Node *node, ParticleData *particles )
{
	_times = particles->createAttribArray< crimild::Real32 >( ParticleAttrib::TIME );
	assert( _times != nullptr );
}

void TimeParticleUpdater::update( Node *node, double dt, ParticleData *particles )
{
	const auto count = particles->getAliveCount();

	auto ts = _times->getData< crimild::Real32 >();
	assert( ts != nullptr );

	for ( int i = 0; i < count; i++ ) {
		ts[ i ] -= dt;
		if ( ts[ i ] <= 0.0f ) {
			particles->kill( i );
		}
	}
}

void TimeParticleUpdater::encode( coding::Encoder &encoder )
{
	ParticleSystemComponent::ParticleUpdater::encode( encoder );
}

void TimeParticleUpdater::decode( coding::Decoder &decoder )
{
	ParticleSystemComponent::ParticleUpdater::decode( decoder );
}


text:
<?php

namespace Tests;

use ReflectionClass;

class ApplyPaddingTest extends BaseStringSuite
{
    public function __validData(): array
    {
        return [
            ['foo bar', 'foo bar', 0],
            ['  foo bar', 'foo bar', 2],
            ['foo bar  ', 'foo bar', 0, 2],
            ['  foo bar  ', 'foo bar', 2, 2],
        ];
    }

    /**
     * @dataProvider __validData
     */
    public function testStringIsPaddedOnBothSides($expected, $string, $left = 0, $right = 0, $padding = ' '): void
    {
        $utility = $this->utility($string);
        $reflectionClass = new ReflectionClass($utility::class);
        $reflectionMethod = $reflectionClass->getMethod('applyPadding');
        $reflectionMethod->setAccessible(true);
        $this->assertEquals($expected, $reflectionMethod->invokeArgs($utility, [$left, $right, $padding])->value());
    }
}


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.6">
  <compounddef id="structboost_1_1geometry_1_1reverse__dispatch" kind="struct" prot="public">
    <compoundname>boost::geometry::reverse_dispatch</compoundname>
    <basecompoundref prot="public" virt="non-virtual">detail::reverse_dispatch< geometry_id< Geometry1 >::type::value, geometry_id< Geometry2 >::type::value ></basecompoundref>
    <includes local="no">reverse_dispatch.hpp</includes>
    <templateparamlist>
      <param>
        <type>typename Geometry1</type>
      </param>
      <param>
        <type>typename Geometry2</type>
      </param>
    </templateparamlist>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <inheritancegraph>
      <node id="1229">
        detail::reverse_dispatch< geometry_id< Geometry1 >::type::value, geometry_id< Geometry2 >::type::value >
      </node>
      <node id="1228">
        boost::geometry::reverse_dispatch< Geometry1, Geometry2 >
        <link refid="structboost_1_1geometry_1_1reverse__dispatch"/>
        <childnode refid="1229" relation="public-inheritance">
        </childnode>
      </node>
    </inheritancegraph>
    <collaborationgraph>
      <node id="1231">
        detail::reverse_dispatch< geometry_id< Geometry1 >::type::value, geometry_id< Geometry2 >::type::value >
      </node>
      <node id="1230">
        boost::geometry::reverse_dispatch< Geometry1, Geometry2 >
        <link refid="structboost_1_1geometry_1_1reverse__dispatch"/>
        <childnode refid="1231" relation="public-inheritance">
        </childnode>
      </node>
    </collaborationgraph>
    <location file="/home/ubuntu/boost/boost/geometry/core/reverse_dispatch.hpp" line="61" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/core/reverse_dispatch.hpp" bodystart="56" bodyend="61"/>
    <listofallmembers>
    </listofallmembers>
  </compounddef>
</doxygen>


text:
	Thanks http://www.cnblogs.com/TomXu/
	Thanks https://addyosmani.com/resources/essentialjsdesignpatterns/book
	Thanks http://www.ituring.com.cn/book/1632
	Thanks http://www.ruanyifeng.com/


text:
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;


text:
az group create --name azuremolchapter5 --location eastus

# Create a virtual network and subnet
# The virtual network and subnet both create regular IP ranges assigned
# to them, just like an on-premises network
az network vnet create \
    --resource-group azuremolchapter5 \
    --name vnetmol \
    --address-prefix 10.0.0.0/16 \
    --subnet-name websubnet \
    --subnet-prefix 10.0.1.0/24

# Define a unique DNS name
dnsName=azuremol$RANDOM

# Create a public IP address
# This public IP address assigned gets assigned to a web server VM in a
# following step. We also assigned the DNS prefix of `webmol`
az network public-ip create \
    --resource-group azuremolchapter5 \
    --name webpublicip \
    --dns-name $dnsName

# Create a virtual network adapter
# All VMs need a virtual network interace card (vNIC) that connects them to a
# virtual network subnet. We assign the public IP address created in the previos
# step, along with the a static internal IP address of 10.0.1.4
az network nic create \
    --resource-group azuremolchapter5 \
    --name webvnic \
    --vnet-name vnetmol \
    --subnet websubnet \
    --public-ip-address webpublicip \
    --private-ip-address 10.0.1.4

# Create network security group
# A network security group secures and filters both inbound + outbound virtual
# network traffic
az network nsg create \
    --resource-group azuremolchapter5 \
    --name webnsg

# Associate the network security group with your virtual network
# Network security groups can be assigned to a virtual network subnet, as we do
# here, or to an individual vNIC
az network vnet subnet update \
    --resource-group azuremolchapter5 \
    --vnet-name vnetmol \
    --name websubnet \
    --network-security-group webnsg

# Add a network security group rule to allow port 80
# Rules can be applied to inbound or outbound traffic, to a specific protocol or
# port, and for certain IP address ranges or port ranges
az network nsg rule create \
    --resource-group azuremolchapter5 \
    --nsg-name webnsg \
    --name allowhttp \
    --access allow \
    --protocol tcp \
    --direction inbound \
    --priority 100 \
    --source-address-prefix "*" \
    --source-port-range "*" \
    --destination-address-prefix "*" \
    --destination-port-range 80

# Create an additional network security group for remote access
az network nsg create \
    --resource-group azuremolchapter5 \
    --name remotensg

# Create an additional network security group rule to allow SSH connections
# Here, we don't specify the address prefixes, direction, or destinations, as the
# Azure CLI can use smart defaults to populate these for us
az network nsg rule create \
    --resource-group azuremolchapter5 \
    --nsg-name remotensg \
    --name allowssh \
    --protocol tcp \
    --priority 100 \
    --destination-port-range 22 \
    --access allow

# Create an additional virtual network subnet and associate our remote network
# security group. This is a little different to the previous steps where we
# associated a network security group with a virtual network subnet.
az network vnet subnet create \
    --resource-group azuremolchapter5 \
    --vnet-name vnetmol \
    --name remotesubnet \
    --address-prefix 10.0.2.0/24 \
    --network-security-group remotensg

# Create a VM that will act as a web server
# Attach the virtual NIC created in the previous steps
az vm create \
    --resource-group azuremolchapter5 \
    --name webvm \
    --nics webvnic \
    --image ubuntults \
    --size Standard_B1ms \
    --admin-username azuremol \
    --generate-ssh-keys

# Create a VM that will act as our remote connection VM
# Connect the VM to the virtual network subnet for remote connectivity
az vm create \
    --resource-group azuremolchapter5 \
    --name remotevm \
    --vnet-name vnetmol \
    --subnet remotesubnet \
    --nsg remotensg \
    --public-ip-address remotepublicip \
    --image ubuntults \
    --size Standard_B1ms \
    --admin-username azuremol \
    --generate-ssh-keys

# Enable the SSH agent and add our SSH keys
eval $(ssh-agent)
ssh-add

# Obtain the public IP address of the web server VM
remotevmIp=$(az vm show \
    --resource-group azuremolchapter5 \
    --name remotevm \
    --show-details \
    --query publicIps \
    --output tsv)

# SSH to the remote VM, passing through our SSH keys
ssh -A azuremol@$remotevmIp


text:
#include <stdlib.h>
#include "lib/sound/sound_filter.h"
#include "lib/sound/sound_script.h"
#include "lib/sound/sound_system.h"

#define MAX_ADSR_VOL 0x7ffff

void SignalGenerator::Init(int waveType, unsigned freq, int freqVel)
{
	m_waveType = waveType;
	m_freq = freq;
	m_freqVel = freqVel;

	m_phase = 0;
}

void SignalGenerator::GenerateSamples(short *samples, unsigned numSamples)
{
	m_freq += m_freqVel;

	for (int i = 0; i < SOUND_SYNTH_NUM_OUTPUT_SAMPLES; i++)
	{
		m_phase += m_freq;
		m_phase &= 0x3fffff;
		unsigned index = m_phase >> 14;

		int sample;
		switch (m_waveType)
		{
		case Saw:
			sample = g_soundSystem->m_sawLut[index];
			break;
		case Triangle:
			sample = g_soundSystem->m_triangleLut[index];
			break;
		case Square:
			if (index < 128)
				sample = -32767;
			else
				sample = 32767;
			break;
		case Noise:
			sample = (rand() << 1) - 32767;
			break;
		}

		samples[i] = sample;
	}
}

int SignalGenerator::ParseWaveType(char const *s)
{
	if (stricmp(s, "saw") == 0)
		return Saw;
	else if (stricmp(s, "triangle") == 0)
		return Triangle;
	else if (stricmp(s, "square") == 0)
		return Square;
	else if (stricmp(s, "Noise") == 0)
		return Noise;
	return Invalid;
}

// ****************************************************************************

int SoundSynth::ParseModulationType(char const *s)
{
	if (stricmp(s, "Add") == 0)
		return ModulationAdd;
	else if (stricmp(s, "Multiply") == 0)
		return ModulationMultiply;
	return ModulationInvalid;
}

void SoundSynth::Init(SoundScript const *script)
{
	m_sigGen1.Init(script->m_osc1_type, script->m_osc1_freq * 90, script->m_osc1_freq_vel);
	m_sigGen2.Init(script->m_osc2_type, script->m_osc2_freq * 90, script->m_osc2_freq_vel);

	m_sigGenModulation = script->m_modulation;

	m_attackIncrement = script->m_attack_slope;
	m_decayDecrement = script->m_decay_slope;
	m_sustainVolume = script->m_sustain_vol * (0x7ffff/100);
	m_sustainDuration = script->m_sustain_time;
	m_releaseDecrement = script->m_release_slope;

	m_adsrCycle = Attack;
	m_volume = 0;

	m_filterResLowPass = NULL;
	if (script->m_lowpass_freq != 0)
	{
		m_filterLowPassFreq = script->m_lowpass_freq;
		m_filterLowPassFreqVel = script->m_lowpass_freq_vel;
		m_filterLowPassResonance = script->m_lowpass_res;

		m_filterResLowPass = new FilterResLowPass;
		m_filterResLowPass->SetParameters(script->m_lowpass_freq, script->m_lowpass_res);
	}

	m_filterDistortion = new FilterDistortion;
	m_filterDistortion->SetParameters(50.0f);
}

bool SoundSynth::GenerateSamples()
{
	m_sigGen1.GenerateSamples(m_outputSamples, SOUND_SYNTH_NUM_OUTPUT_SAMPLES);

	if (m_sigGen2.m_freq != 0)
	{
		m_sigGen2.GenerateSamples(m_outputSamples2, SOUND_SYNTH_NUM_OUTPUT_SAMPLES);

		if (m_sigGenModulation == ModulationMultiply)
		{
			for (int i = 0; i < SOUND_SYNTH_NUM_OUTPUT_SAMPLES; i++)
			{
				int sample = m_outputSamples[i] * abs(m_outputSamples2[i]);
				sample /= 32768;
				m_outputSamples[i] = sample;
			}
		}
		else
		{
			for (int i = 0; i < SOUND_SYNTH_NUM_OUTPUT_SAMPLES; i++)
			{
				int sample = m_outputSamples[i] + m_outputSamples2[i];
				sample /= 2;
				m_outputSamples[i] = sample;
			}
		}
	}

	for (int i = 0; i < SOUND_SYNTH_NUM_OUTPUT_SAMPLES; i++)
	{
		switch (m_adsrCycle)
		{
		case Attack:
			m_volume += m_attackIncrement;
			if (m_volume > MAX_ADSR_VOL)
			{
				m_adsrCycle = Decay;
				m_volume = MAX_ADSR_VOL;
			}
			break;
		case Decay:
			m_volume -= m_decayDecrement;
			if (m_volume < m_sustainVolume)
			{
				m_adsrCycle = Sustain;
				m_volume = m_sustainVolume;
				m_sustainSamplesRemaining = m_sustainDuration;
			}
			break;
		case Sustain:
			if (m_sustainSamplesRemaining == 0)
				m_adsrCycle = Release;
			else
				m_sustainSamplesRemaining--;
			break;
		case Release:
			if (m_volume < m_releaseDecrement)
				m_adsrCycle = Complete;
			else
				m_volume -= m_releaseDecrement;
			break;
		}

		unsigned sample = m_outputSamples[i];
 		sample *= (m_volume >> 3);
 		sample >>= 16;
		m_outputSamples[i] = sample;
	}

	if (m_filterResLowPass)
	{
		if (m_filterLowPassFreqVel)
		{
			m_filterLowPassFreq += m_filterLowPassFreqVel;
			m_filterResLowPass->SetParameters(m_filterLowPassFreq, m_filterLowPassResonance);
		}

		m_filterResLowPass->ProcessSamples(m_outputSamples, SOUND_SYNTH_NUM_OUTPUT_SAMPLES);
	}

	if (m_filterDistortion)
	{
		m_filterDistortion->ProcessSamples(m_outputSamples, SOUND_SYNTH_NUM_OUTPUT_SAMPLES);
	}

	return m_adsrCycle != Complete;
}


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityBerserkersGizmos;

[ExecuteInEditMode]
public class Box2DColliderCasting : MonoBehaviour
{

	[SerializeField]Collider2D myCollider2D;
	[SerializeField]Vector3 direction;
	[SerializeField]float distance = 1;
	[SerializeField]bool ignoreSiblingsColliders = false;
	// remember to always initialize this array!!!
	RaycastHit2D[] hitByCollider2DCast = new RaycastHit2D[11];
	[Space (55)][Header ("Results:")]
	[SerializeField]int hitColliderCount;

	void Update ()
	{
		hitColliderCount = myCollider2D.Cast (direction: direction, results: hitByCollider2DCast, distance: distance, ignoreSiblingColliders: ignoreSiblingsColliders);
	}

	void OnDrawGizmos ()
	{
		GizmosForPhysics2D.DrawCollider2D_Cast (collider: myCollider2D, direction: direction, distance: distance, ignoreSiblingColliders: ignoreSiblingsColliders);
	}
}


text:
date: '2019-06-28 08:54 +0100'
thumbnail-image: /img/20190617_105525 (Custom).jpg
layout: default
published: true
title: GREAT gets a tour behind the scenes
summary: >-
  The GREAT Project goes behind the scenes at an industry-leading logistics
  company.
---
![20190617_105525 (Custom) (1).jpg]({{site.baseurl}}/img/20190617_105525 (Custom) (1).jpg)

Recently, the GREAT Project headed over to Eddie Stobart to find out more about the national logistics company.

Eddie Stobart is an industry-leading logistics business that provides end-to-end transport and logistics to organisations all across the UK and Europe.

Alongside our partners, Business in the Community, 11 participants from the project were able to take part in a behind-the-scenes visit with Eddie Stobart at Bardon in Coalville.

Participants were able to learn more about the site, one of the largest in Europe, its history and the roles available for those interested. They also heard from current employees about the possibility of progression within the company and the support provided for, amongst others, those with mental health needs.

It was a wide-ranging and fascinating visit – with a chance to see the warehouses in operation - and several of participants expressed an interest in applying for roles within the company.


text:
<!DOCTYPE html>

<title>Bobo</title>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="styles/style.css">

Bobo Studio

Quality Design Solutions

Home/

Services/

Portfolio/

Blog/

Contact

At Bobo Studio we specialize in providing high quality solutions to difficult problems. Whether you need assistance with a new website, help developing an online marketing campaign, or simply some support & guidance, we are here to help you through each stage of the process.

Featured Projects

Copyright © Domain Name - All Rights Reserved | Design By Chris Creed


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/ct_white">

    <ScrollView
        android:layout_alignParentTop="true"
        android:layout_above="@+id/cancel_order"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <include
                layout="@layout/ct_service_part_little"
                android:id="@+id/ct_service_info_v"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@color/ct_divider"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="30dp"
                android:gravity="center"
                android:layout_marginBottom="10dp"
                android:textSize="19sp"
                android:textColor="@color/ct_black"
                android:text="@string/cancel_order_msg" />
            <TextView
                android:id="@+id/cancel_tips"
                android:layout_gravity="center_horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/content"
                android:layout_marginLeft="@dimen/ct_width_padding"
                android:layout_marginRight="@dimen/ct_width_padding"
                android:layout_marginTop="10dp"
                android:lineSpacingExtra="2dp"
                android:text="@string/ct_message_cancel"
                android:textColor="@color/ct_7c"
                android:textSize="@dimen/ct_ts_5" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:textSize="19sp"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="10dp"
                android:textColor="@color/ct_black"
                android:text="@string/cancel_reason_msg" />

            <EditText
                android:id="@+id/content"
                android:layout_width="match_parent"
                android:layout_height="100dp"
                android:layout_below="@+id/order_contact"
                android:layout_marginLeft="@dimen/ct_width_padding"
                android:layout_marginRight="@dimen/ct_width_padding"
                android:layout_marginTop="10dp"
                android:maxLength="1000"
                android:background="@drawable/ct_comment_bg"
                android:gravity="top|left"
                android:hint="@string/ct_order_cancel_reason"
                android:padding="10dp"
                android:layout_marginBottom="10dp"
                android:textColor="@color/ct_content"
                android:textColorHint="@color/ct_gray"
                android:textSize="@dimen/ct_ts_4" />
        </LinearLayout>
    </ScrollView>

    <Button

        android:id="@+id/cancel_order"
        style="@style/ctMainBackgroundRecButton"
        android:layout_alignParentBottom="true"
        android:background="@drawable/select_blue_corner"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:text="@string/ct_order_cancel_confir" />
</RelativeLayout>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>class Edge( [parent = QGraphicsLineItem] ) — SmartPower 0.1 documentação</title>

    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="SmartPower 0.1 documentação" href="index.html" />
    <link rel="up" title="Arquivo graphics.py" href="graphics.html" />
    <link rel="prev" title="class DashedLine([parent = QGraphicsLineItem])" href="DashedLine.html" />

Navegação

          índice

          anterior |

SmartPower 0.1 documentação »

Arquivo graphics.py »

class Edge( [parent = QGraphicsLineItem] )¶

Parâmetro: parent - QtGui.QGraphicsLineItem

Classe que implementa o objeto Edge que liga dois objetos Node um ao outro.

Métodos¶

get_fraction(pos)

update_position()

set_color(color)

boundingRect()

paint(painter, option, widget)

mousePressEvent(mouse_event)

contestMenuEvent(event)

__init__(w1, w2, edge_menu)¶

Parâmetros:

w1, w2 - QtGui.QGraphicsRectItem.Node

edge_menu - QtGui.QGraphicsLineItem

Metodo inicial (construtor) da classe Edge. Recebe como parâmetros os objetos Node Inicial e Final. Define o objeto QtCore.QLineF que define a linha que representa o objeto QtGui.QGraphicsLineItem

get_fraction(pos)¶

Parâmetro: pos -

Descriçao...

update_position()¶

<tt class="docutils literal">Retorna a nova posição do objeto</tt> ...............

set_color(color)¶

Parâmetro: color - QtGui.QColor

Descriçao....

boundingRect()¶

Descriçao...

paint(painter, option, widget)¶

Parâmetros:

painter -

option -

widget -

Descriçao....

mousePressEvent(mouse_event)¶

Parâmetro: mouse_event -

contestMenuEvent(event)¶

Parâmetro: - event

Tabela de Conteúdo

class Edge( [parent = QGraphicsLineItem] )

Métodos

__init__(w1, w2, edge_menu)

get_fraction(pos)

update_position()

set_color(color)

boundingRect()

paint(painter, option, widget)

mousePressEvent(mouse_event)

contestMenuEvent(event)

Tópico anterior

class DashedLine([parent = QGraphicsLineItem])

Esta Página

Exibir Fonte

Pesquisa rápida

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Ir" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Digite os termos da busca ou o nome de um módulo, classe ou função.

Navegação

          índice

          anterior |

SmartPower 0.1 documentação »

Arquivo graphics.py »

        © Copyright 2015, Watson.
      Criado usando Sphinx 1.2.2.


text:
""" @Imports """
from django.test.testcases import TestCase
from cuescience_cart.tests.support.support import TestSupport

class TestCheckoutWizard(TestCase):
    def setUp(self):
        self.test_support = TestSupport(self)

    def test(self):
        """
         The code in this method is generated from: /cuescience-shop/shop/tests/views/checkout_wizard/test_checkout_wizard.natspec
         Never change this method or any contents of this file, all local changes will we overwritten.
        """


text:
from django.contrib import admin
from .models import ProxyPage

class ProxyPageAdmin(admin.ModelAdmin):
    list_display = ('path', 'proxy')
    list_filter = ('site',)
    search_fields = ('path', 'proxy')
    radio_fields = {'site': admin.VERTICAL}

admin.site.register(ProxyPage, ProxyPageAdmin)


text:
package com.ksyun.media.shortvideo.demo.adapter;

import com.ksyun.media.shortvideo.demo.R;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.List;

/**
 * transition type adapter
 */

public class TransitionTypeAdapter extends RecyclerView.Adapter<TransitionTypeAdapter.MyViewHolder> {
    private Context mContext;
    private List<String> mData;
    private MyViewHolder mPreHolder;
    private MyViewHolder mFirstHolder;
    private int mPreIndex = 0;
    private OnItemClickListener mListener;

    public interface OnItemClickListener {
        void onClick(int curIndex, int preIndex);
    }

    public void setOnItemClickListener(OnItemClickListener listener) {
        this.mListener = listener;
    }

    public TransitionTypeAdapter(Context context, List<String> data) {
        super();
        mContext = context;
        mData = data;
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.transtion_type_item, parent, false);
        MyViewHolder holder = new MyViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(final MyViewHolder holder, final int position) {
        if (position == 0) {
            mFirstHolder = holder;
        }
        holder.setIsRecyclable(false);
        holder.title.setText(mData.get(position));
        if (mPreIndex == position) {
            mPreHolder = holder;
            holder.setActivated(true);
        }
        holder.title.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mPreHolder != null && position != mPreHolder.getPosition()) {
                    mPreHolder.setActivated(false);
                }

                holder.setActivated(true);

                if (mListener != null) {
                    mListener.onClick(position, mPreIndex);
                }

                mPreHolder = holder;
                mPreIndex = position;
            }
        });
    }

    @Override
    public int getItemCount() {
        return mData.size();
    }

    public void clear() {
        if (mPreHolder != null) {
            mPreHolder.setActivated(false);
        }

        if (mFirstHolder != null) {
            mPreHolder = mFirstHolder;
            mPreIndex = 0;
        }
    }

    public void selectView(RecyclerView.ViewHolder holder, int index) {
        if (holder instanceof MyViewHolder) {
            MyViewHolder viewHolder = (MyViewHolder) holder;
            if (mPreHolder != null) {
                mPreHolder.setActivated(false);
            }
            viewHolder.setActivated(true);

            mPreHolder = viewHolder;
            mPreIndex = index;
        }
    }

    class MyViewHolder extends RecyclerView.ViewHolder {
        TextView title;

        public MyViewHolder(View view) {
            super(view);
            title = view.findViewById(R.id.type_title);
        }

        public void setActivated(boolean active) {
            if (active) {
                title.setActivated(true);
            } else {
                title.setActivated(false);
            }
        }
    }
}


text:
//--------propiedad de Austral-Robotics.com, realizado por felipe castro nieny, fcastro@austral-robotics.com / 29-10-2015
//--------Modificado por Pablo Liberna, pliberona@austral-robotics.com / 29-10-2015

#define _CRT_SECURE_NO_DEPRECATE//Ignora error C4996 "fopen"

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
#include <stdio.h>
#include <cv.h>
#include <iostream>
#include <fstream>
#include <time.h>
#include <windows.h>
#include <conio.h>
#include <sstream>
#include <string>

using namespace cv;
using namespace std;

GUID uuid;//Direccion MAC
ofstream myfile;//Crea archivo txt

int distanciareco = 0, estado = 0, posX = 0, posY = 0, iLastX = -1, iLastY = -1, areaMenor = 500, areaMayor = 2e3;
char centrotxt[50], centrotxtmm[50], centro[50], distancia[50], text[255], mac_addr[18];
char cantcontornos[50];

		vector<vector<Point> > contours;
		vector<Vec4i> hierarchy;
		vector<Point> approx;

int lowerH = 0, lowerS = 0, lowerV = 107;
int upperH = 90, upperS = 256, upperV = 256;
int Vertice1_x = 58, Vertice2_x = 280, Vertice3_x = 80, Vertice1_y = 43, Vertice2_y = 40, Vertice3_y = 105;  //Vértices triángulo ROI
bool flipCamara = false;
bool flipParameters = false;
bool flipFile = false;

namespace{

	void DireccionMAC(GUID uuid, char mac_addr[18])
	{

		CoCreateGuid(&uuid);
		sprintf(mac_addr, "%02X:%02X:%02X:%02X:%02X:%02X",
			uuid.Data4[2], uuid.Data4[3], uuid.Data4[4],
			uuid.Data4[5], uuid.Data4[6], uuid.Data4[7]);
	}

	void ventanayTrackbar()
	{
		namedWindow("AntesDeEqualizar");
		namedWindow("DespuesDeEqualizar");
		namedWindow("HSV");
		namedWindow("THRESH");
		//namedWindow("calcHist Demo", CV_WINDOW_AUTOSIZE);

		moveWindow("AntesDeEqualizar", 0, 460);
		moveWindow("DespuesDeEqualizar", 0, 320);
		moveWindow("HSV", 680, 460);
		moveWindow("THRESH", 1020, 460);
		//moveWindow("calcHist Demo", 700, 400);
	}

	const string currentDateTime()//FUNCION 1: TIMESTAMP
	{
		time_t     now = time(0);
		struct tm  tstruct;
		char       buf[80];
		tstruct = *localtime(&now);
		strftime(buf, sizeof(buf), "%Y-%m-%d %X", &tstruct);
		return buf;
	}

	Mat graficarHistograma(Mat& src)
	{    /// Separate the image in 3 places ( B, G and R )
		vector<Mat> bgr_planes;
		split(src, bgr_planes);

		/// Establish the number of bins
		int histSize = 256;

		/// Set the ranges ( for B,G,R) )
		float range[] = { 0, 256 };
		const float* histRange = { range };

		bool uniform = true; bool accumulate = false;

		Mat b_hist, g_hist, r_hist;

		/// Compute the histograms:
		calcHist(&bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate);
		calcHist(&bgr_planes[1], 1, 0, Mat(), g_hist, 1, &histSize, &histRange, uniform, accumulate);
		calcHist(&bgr_planes[2], 1, 0, Mat(), r_hist, 1, &histSize, &histRange, uniform, accumulate);

		// Draw the histograms for B, G and R
		int hist_w = 512; int hist_h = 200;
		int bin_w = cvRound((double)hist_w / histSize);

		Mat histImage(hist_h, hist_w, CV_8UC3, Scalar(0, 0, 0));

		/// Normalize the result to [ 0, histImage.rows ]
		normalize(b_hist, b_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat());
		normalize(g_hist, g_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat());
		normalize(r_hist, r_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat());

		/// Draw for each channel
		for (int i = 1; i < histSize; i++)
		{
			line(histImage, Point(bin_w*(i - 1), hist_h - cvRound(b_hist.at<float>(i - 1))),
				Point(bin_w*(i), hist_h - cvRound(b_hist.at<float>(i))),
				Scalar(255, 0, 0), 2, 8, 0);
			line(histImage, Point(bin_w*(i - 1), hist_h - cvRound(g_hist.at<float>(i - 1))),
				Point(bin_w*(i), hist_h - cvRound(g_hist.at<float>(i))),
				Scalar(0, 255, 0), 2, 8, 0);
			line(histImage, Point(bin_w*(i - 1), hist_h - cvRound(r_hist.at<float>(i - 1))),
				Point(bin_w*(i), hist_h - cvRound(r_hist.at<float>(i))),
				Scalar(0, 0, 255), 2, 8, 0);
		}
		/// Display
		imshow("calcHist Demo", histImage);

		return histImage;
	}

	Mat equalizarHistograma(const Mat& inputImage)//FUNCION 4: EQUALIZACION HISTOGRAMA
	{
		if (inputImage.channels() >= 3)
		{
			Mat ycrcb;

			cvtColor(inputImage, ycrcb, CV_BGR2YCrCb);

			vector<Mat> channels;
			split(ycrcb, channels);

			equalizeHist(channels[0], channels[0]);

			Mat result;
			merge(channels, ycrcb);

			cvtColor(ycrcb, result, CV_YCrCb2BGR);
			imshow("DespuesDeEqualizar", inputImage);
			return result;
		}
		return Mat();
	}

	Mat agregarROI(Mat& frame)
	{
		Point poly_points1[1][3];//POLIGONO 1
		//NOTA: Definir coordenadas en sentido horario
		//Según sentido ubicación aristas del polígono
		poly_points1[0][0] = Point(Vertice1_x, Vertice1_y);
		poly_points1[0][1] = Point(Vertice2_x, Vertice2_y);
		poly_points1[0][2] = Point(Vertice3_x, Vertice3_y);
		const Point* ppt1[1] = { poly_points1[0] };
		int npt1[] = { 3 };

		Point poly_points2[1][4];//POLIGONO 2
		poly_points2[0][0] = Point(0, 0);
		poly_points2[0][1] = Point(0, 57);
		poly_points2[0][2] = Point(320, 57);
		poly_points2[0][3] = Point(320, 0);
		const Point* ppt2[1] = { poly_points2[0] };
		int npt2[] = { 4 };

		Point poly_points3[1][4];//POLIGONO 3
		poly_points3[0][0] = Point(0, 0);
		poly_points3[0][1] = Point(0, 280);
		poly_points3[0][2] = Point(20, 280);
		poly_points3[0][3] = Point(20, 0);
		const Point* ppt3[1] = { poly_points3[0] };
		int npt3[] = { 4 };

		Point poly_points4[1][4];//POLIGONO 4
		poly_points4[0][0] = Point(0, 150);
		poly_points4[0][1] = Point(0, 250);
		poly_points4[0][2] = Point(320, 250);
		poly_points4[0][3] = Point(320, 150);
		const Point* ppt4[1] = { poly_points4[0] };
		int npt4[] = { 4 };

		Point poly_points5[1][4];//POLIGONO 5
		poly_points5[0][0] = Point(300, 0);
		poly_points5[0][1] = Point(300, 280);
		poly_points5[0][2] = Point(320, 280);
		poly_points5[0][3] = Point(320, 0);
		const Point* ppt5[1] = { poly_points5[0] };
		int npt5[] = { 4 };

		fillPoly(frame, ppt1, npt1, 1, Scalar(0, 0, 0), 8); //Dibuja triangulo negro N.1
		fillPoly(frame, ppt2, npt2, 1, Scalar(0, 0, 0), 8); //Dibuja poligono negro N.2
		fillPoly(frame, ppt3, npt3, 1, Scalar(0, 0, 0), 8); //Dibuja poligono negro N.3
		fillPoly(frame, ppt4, npt4, 1, Scalar(0, 0, 0), 8); //Dibuja poligono negro N.4
		fillPoly(frame, ppt5, npt5, 1, Scalar(0, 0, 0), 8); //Dibuja poligono negro N.5
		return frame;
	}

	Mat GetThresholdedImage(Mat& imgHSV)//This function threshold the HSV image and create a binary image
	{

		//IplImage* imgThresh = cvCreateImage(cvGetSize(imgHSV), IPL_DEPTH_8U, 1);
		Mat imgThresh = Mat(imgHSV.size(), CV_8UC1);
		inRange(imgHSV, Scalar(lowerH, lowerS, lowerV), Scalar(upperH, upperS, upperV), imgThresh);
		cv::imshow("HSV", imgHSV);
		return imgThresh;
	}

	Mat operacionCierre(const Mat& imgThresh){

		int erosion_elem = 0;
		int erosion_size = 1;
		int erosion_type;

		if (erosion_elem == 0){ erosion_type = MORPH_RECT; }
		else if (erosion_elem == 1){ erosion_type = MORPH_CROSS; }
		else if (erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; }

		Mat elementErode = getStructuringElement(erosion_type,
			Size(2 * erosion_size + 1, 2 * erosion_size + 1),
			Point(erosion_size, erosion_size));
		erode(imgThresh, imgThresh, elementErode);
		erode(imgThresh, imgThresh, elementErode);

		int dilation_elem = 0;
		int dilation_size = 1;
		int dilation_type;

		if (dilation_elem == 0){ dilation_type = MORPH_RECT; }
		else if (dilation_elem == 1){ dilation_type = MORPH_CROSS; }
		else if (dilation_elem == 2) { dilation_type = MORPH_ELLIPSE; }

		Mat elementDilation = getStructuringElement(dilation_type,
			Size(2 * dilation_size + 1, 2 * dilation_size + 1),
			Point(dilation_size, dilation_size));

		dilate(imgThresh, imgThresh, elementDilation);
		dilate(imgThresh, imgThresh, elementDilation);
		GaussianBlur(imgThresh, imgThresh, Size(3, 3), 0, 0);
		cv::imshow("THRESH", imgThresh);
		return Mat();
	}

	void MyFilledCircle(Mat img, Point2f center)
	{
		int thickness = 1;
		int lineType = 8;
		int w = 600.0;

		circle(img,
			center,
			w / 32.0,
			Scalar(0, 0, 255),
			thickness,
			lineType);
	}

}

int main(int argc, char** argv){
	Mat frame;
	Mat imgHSV = Mat(frame.size(), CV_8UC3);
	DireccionMAC(uuid, mac_addr);

	cout << "Bienvenido a Raton Vision Software, de Austral Robotics.-" << endl;
	Sleep(1000);
	cout << "Seguridad: Inserte la clave del software" << endl;

	string clave;
	getline(cin, clave);
	string ClaveReal = "arcimis2016";
	if (clave == ClaveReal)
	{
		cout << "Producto activado! Puede continuar" << endl;
	}
	else{
		cout << "Clave incorrecta! El software se cierra..." << endl;
		Sleep(1000);
		return -1;
	}

	MENU:

	cout << "Favor ingresar el numero de camara que desea ver (1-16):" << endl;
	string NumeroCamara;
	getline(cin, NumeroCamara);
	cout << "Se analizara la camara No."+ NumeroCamara << endl;
	Sleep(1000);
	cout << "Creando archivo de registro txt..." << endl;
	Sleep(1000);
	string BasePath = "C:\\RatonVision-v1.4\\";
	LPCWSTR LPCWSTRBasePath = L"C:\\RatonVision-v1.4\\";

	string TimeStamp = currentDateTime();

	string Año = TimeStamp.substr(0, 4);
	string Mes = TimeStamp.substr(5, 2);
	string Dia = TimeStamp.substr(8, 2);
	string Hora = TimeStamp.substr(11, 2);
	string Minuto = TimeStamp.substr(14, 2);
	string Archivo = "C"+NumeroCamara+"-"+Año+Mes+Dia+"-"+Hora+Minuto+".txt";

	string RutaCompleta = BasePath + Archivo;
	myfile.open(RutaCompleta);
	cout << "Directorio actual: " + RutaCompleta << endl;
	cout << "Listo! Los datos se guardaran en el archivo " + Archivo << endl;
	cout << "Ubicado en la carpeta " + BasePath << endl;
	//Sleep(1000);
	cout << "El programa comienza en breve..." << endl;

	std::string arg = argv[1];
	VideoCapture capture(arg);

	/*
	const string videoStreamAddress = "rtsp://192.168.1.70:554/user=admin&password=&channel="+NumeroCamara+"&stream=0.sdp?";
	VideoCapture capture(videoStreamAddress);
	if (!capture.open(videoStreamAddress)) {
		cout << "Error opening video stream or file" << endl;
		return -1;
	}
	else { cout << "Acceso correcto a DVR y streaming camara"<< endl; }
	*/

	ventanayTrackbar();

	Mat imageMenu;
	string MenuNum = "Menu Camara N." + NumeroCamara;
	string CamaraNum = "Camara N." + NumeroCamara;
	string ParametrosNum = "Parametros Camara N." + NumeroCamara;
	imageMenu = imread("Menu.png", CV_LOAD_IMAGE_COLOR);   // Read the file

	namedWindow(MenuNum, WINDOW_AUTOSIZE);// Create a window for display.

	imshow(MenuNum, imageMenu);                   // Show our image inside it.

	while(1) {

		int key = waitKey(10);

		if ((char)key == 27) //Si presiona tecla ESC "Cierra Programa y volver al Menú principal"
		{
			break;
		}
		if ((char)key == 99) //Si presiona tecla c "Abre Cámara/Cierra Cámara"
		{
			flipCamara = !flipCamara;
		}
		if ((char)key == 112) //Si presiona tecla p "Despliega/esconde menú de parámetros"
		{
			if (flipParameters == 1){
				cout << "Mostrar Parametros camara N." << NumeroCamara << endl;
				namedWindow(ParametrosNum);
				moveWindow(ParametrosNum, 0, 0);
				createTrackbar("Hmin", ParametrosNum, &lowerH, 180, NULL);
				createTrackbar("Hmax", ParametrosNum, &upperH, 180, NULL);

				createTrackbar("Smin", ParametrosNum, &lowerS, 256, NULL);
				createTrackbar("Smax", ParametrosNum, &upperS, 256, NULL);

				createTrackbar("Vmin", ParametrosNum, &lowerV, 256, NULL);
				createTrackbar("Vmax", ParametrosNum, &upperV, 256, NULL);

				createTrackbar("AreaMin", ParametrosNum, &areaMenor, 4e3, NULL);
				createTrackbar("AreaMax", ParametrosNum, &areaMayor, 4e4, NULL);

				createTrackbar("Vertice1x", ParametrosNum, &Vertice1_x, 300, NULL);
				createTrackbar("Vertice2x", ParametrosNum, &Vertice2_x, 300, NULL);
				createTrackbar("Vertice3x", ParametrosNum, &Vertice3_x, 300, NULL);

				createTrackbar("Vertice1y", ParametrosNum, &Vertice1_y, 300, NULL);
				createTrackbar("Vertice2y", ParametrosNum, &Vertice2_y, 300, NULL);
				createTrackbar("Vertice3y", ParametrosNum, &Vertice3_y, 300, NULL);

			}
			else
			{
				destroyWindow(ParametrosNum);
			}
			flipParameters = !flipParameters;
		}
		if ((char)key == 102) //Si presiona tecla f "Despliega/esconde Directorio de registro"
		{
			if (flipFile == 1){
				cout << "Abrir carpeta de registro" << endl;
				ShellExecute(NULL, NULL, LPCWSTRBasePath, NULL, NULL, SW_SHOWNOACTIVATE);
			}
			else{
				cout << "Esconder carpeta de registro" << endl;
				ShellExecute(NULL, NULL, LPCWSTRBasePath, NULL, NULL, SW_MINIMIZE);
			}
			flipFile = !flipFile;
		}

		capture >> frame;
		//Sleep(100);
		if (frame.empty())
			break;

		bool bSuccess = capture.read(frame); // read a new frame from video
		if (!bSuccess) //if not success, break loop
		{
			cout << "Cannot read the frame from video file" << endl;
		}
		frame = frame.clone();
		imshow("AntesDeEqualizar", frame);
		equalizarHistograma(frame);
		graficarHistograma(frame);
		agregarROI(frame);
		GaussianBlur(frame, frame, Size(3, 3), 0, 0);
		cvtColor(frame, imgHSV, CV_BGR2HSV);
		Mat imgThresh = GetThresholdedImage(imgHSV);
		operacionCierre(imgThresh);

		findContours(imgThresh, contours, hierarchy, CV_RETR_LIST, CV_CHAIN_APPROX_NONE);

		//myfile << currentDateTime() << centrotxt << estado << centrotxtmm << " " << mac_addr << "\n";
		if (contours.size() == 0)
			continue;//Si no hay ratón, dejará de hacer lo que está más abajo

		//Calcula moment solamente del ratón = contours[0]
		Moments oMoments = moments(contours[0]);
		double dM01 = oMoments.m01;
		double dM10 = oMoments.m10;
		double dArea = oMoments.m00;

		//Calcula centro de masa ratón

		int posX = dM10 / dArea;
		int posY = dM01 / dArea;

		//Calcula variación de movimiento entre frames
		int deltaX = abs(iLastX - posX);
		int deltaY = abs(iLastY - posY);

		//Guarda datos de posicion en distintos formatos (Point y Char)
		Point xy = Point(posX, posY);
		sprintf(centro, " %d %d ", posX, posY);
		sprintf(centrotxt, " %d %d %d ", posX, posY, distanciareco);

		//Calcula area ratón
		double area = contourArea(contours[0]);
		if (area < areaMenor || areaMayor < area) continue;//Filta areas muy pequeñas y muy grandes

		putText(frame, centro, xy, FONT_HERSHEY_SIMPLEX, 0.5, (0, 143, 255));
		drawContours(frame, contours, 0, CV_RGB(255, 0, 0), 2, 8, hierarchy, 0);

		//if (deltaX >= 9 && deltaY >= 5)
		//Registra solo cambios considerables de movimiento
		if (deltaX >= 7 && deltaY >= 5)
		{
			//cout << "distanciareco= " << distanciareco << endl;
			distanciareco += sqrt(((iLastX - posX)*(iLastX - posX)) + ((iLastY - posY)*(iLastY - posY)));

		}
		if (deltaX > 20 && deltaY > 15)
		{
			cout << "Se agitó al ratón!!!" << endl;
		}
		iLastX = posX;
		iLastY = posY;

		CvFont font, fontbig;
		cvInitFont(&font, CV_FONT_HERSHEY_COMPLEX, .6, .6, 0, 1.5, CV_AA);
		cvInitFont(&fontbig, CV_FONT_HERSHEY_COMPLEX, 3, .6, 0, 3, CV_AA);

		Point cvpoint = Point(posX, posY);
		putText(frame, CamaraNum, Point(20, 30), FONT_HERSHEY_SIMPLEX, 0.6, (0, 242, 255), 2);
		sprintf(distancia, "Distancia=%d", distanciareco);
		putText(frame, distancia, Point(180, 200), FONT_HERSHEY_SIMPLEX, 0.5, (0, 142, 255));

		//putText(frame, centro, cvpoint, FONT_HERSHEY_SIMPLEX, 0.5, (0, 143, 255));
		line(frame, cvPoint(0, 105), cvPoint(320, 105), cvScalar(0, 143, 255), 1.5); //---linea de parado/caminando

		if (posY < 105)
		{
			putText(frame, "parado", cvPoint(30, 200), FONT_HERSHEY_SIMPLEX, 0.5, (0, 142, 255));
			estado = 1;
		}
		else
		{
			putText(frame, "NO parado", cvPoint(30, 200), FONT_HERSHEY_SIMPLEX, 0.5, (0, 142, 255));
			estado = 0;
		}

		//Dibuja target sobre raton
		MyFilledCircle(frame, xy);
		line(frame, cvPoint(posX - 30, posY), cvPoint(posX + 30, posY), cvScalar(0, 255, 103), 1.5);
		line(frame, cvPoint(posX, posY - 30), cvPoint(posX, posY + 30), cvScalar(0, 255, 103), 1.5);

		if (flipCamara == true){
			namedWindow(CamaraNum);
			imshow(CamaraNum, frame);//Muestra el resultado final
		}
		else{
			destroyWindow(CamaraNum);
		}

		void displayOverlay(const string& THRESH, const string& text, int delayms = 1000);
		//Escribe las variables en un txt
		//myfile << currentDateTime() << centrotxt << estado << centrotxtmm << " " << mac_addr << "\n";
		//cout << centrotxt << " " << estado << " " << endl;

	}

	myfile.close();
	cvDestroyAllWindows();
	cout << "Cerrando RatonVision-v1.4..." << endl;
	Sleep(1000);
	cout << "Gracias por utilizar RatonVision-v1.4" << endl;
	Sleep(800);
	cout << "No olvide visitar www.austral-robotics.com" << endl;
	Sleep(800);
	cout << "Volviendo al Menu Principal" << endl;
	Sleep(800);
	cout << " " << endl;
	cout << " " << endl;
	goto MENU;
	return 0;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace Mail.Library
{
	public static class CollectionExtension
	{
		///
		/// Select unique string elements.
		/// Similar to IEnumerable<T>.Distinct() but incase sensitive.
		/// Last element will be chosen if found duplicates.
		///
		/// <typeparam name="T"></typeparam>
		/// <param name="collection">Collection to be processed</param>
		/// <param name="keySelector">Key to be unique</param>
		/// <returns></returns>
		public static IEnumerable<T> Unique<T>(this IEnumerable<T> collection, Func<T, string> keySelector) where T : class
		{
			if (collection == null) throw new ArgumentNullException(nameof(collection));
			return collection
				   .Where(element => !string.IsNullOrWhiteSpace(keySelector(element)))
				   .GroupBy(element => keySelector(element).Trim().ToLower())
				   .Select(element => element.Last());
		}

		///
		/// Select unique string elements.
		/// Similar to IEnumerable<T>.Distinct() but incase sensitive.
		/// Last element will be chosen if found duplicates.
		///
		/// <returns>Unique elements</returns>
		public static IEnumerable<string> Unique(this IEnumerable<string> collection)
		{
			if (collection == null) throw new ArgumentNullException(nameof(collection));
			return collection
				   .Where(element => !string.IsNullOrWhiteSpace(element))
				   .GroupBy(element => element.Trim().ToLower())
				   .Select(element => element.Last());
		}
	}
}


text:
MCIR_ROOT = File.expand_path("..", __FILE__)
require "#{MCIR_ROOT}/lib/mcir"

Mcir::Core.dispatch do |mcir|
  # loads all classes in the action folder
  mcir.register_action_classes
end


text:
from __future__ import unicode_literals

from django.db import models, migrations
import mozillians.funfacts.models

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='FunFact',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255)),
                ('published', models.BooleanField(default=False, choices=[(True, b'Published'), (False, b'Unpublished')])),
                ('public_text', models.TextField()),
                ('number', models.TextField(max_length=1000, validators=[mozillians.funfacts.models._validate_query])),
                ('divisor', models.TextField(blank=True, max_length=1000, null=True, validators=[mozillians.funfacts.models._validate_query])),
            ],
            options={
                'ordering': ['created'],
            },
            bases=(models.Model,),
        ),
    ]


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Stopwatch.ViewModel
{
    using Model;
    using System.ComponentModel;
    using System.Windows.Threading;

    class StopwatchViewModel : INotifyPropertyChanged
    {
        private StopwatchModel _stopwatchModel = new StopwatchModel();

        private DispatcherTimer _timer = new DispatcherTimer();

        public bool Running { get { return _stopwatchModel.Running; } }

        public StopwatchViewModel()
        {
            _timer.Interval = TimeSpan.FromMilliseconds(50);
            _timer.Tick += TimerTick;
            _timer.Start();
            Start();

            _stopwatchModel.LapTimeUpdated += LapTimeUpdatedEventHandler;
        }

        public void Start()
        {
            _stopwatchModel.Start();
        }

        public void Stop()
        {
            _stopwatchModel.Stop();
        }

        public void Lap()
        {
            _stopwatchModel.Lap();
        }

        public void Reset()
        {
            bool running = Running;
            _stopwatchModel.Reset();
            if (running)
                _stopwatchModel.Start();
        }

        int _lastHours;
        int _lastMinutes;
        decimal _lastSeconds;
        bool _lastRunning;
        void TimerTick(object sender, object e)
        {
            if (_lastRunning != Running)
            {
                _lastRunning = Running;
                OnPropertyChanged("Running");
            }
            if (_lastHours != Hours)
            {
                _lastHours = Hours;
                OnPropertyChanged("Hours");
            }
            if (_lastMinutes != Minutes)
            {
                _lastMinutes = Minutes;
                OnPropertyChanged("Minutes");
            }
            if (_lastSeconds != Seconds)
            {
                _lastSeconds = Seconds;
                OnPropertyChanged("Seconds");
            }
        }

        public int Hours
        {
            get { return _stopwatchModel.Elapsed.HasValue ? _stopwatchModel.Elapsed.Value.Hours : 0; }
        }

        public int Minutes
        {
            get { return _stopwatchModel.Elapsed.HasValue ? _stopwatchModel.Elapsed.Value.Minutes : 0; }
        }

        public decimal Seconds
        {
            get
            {
                if (_stopwatchModel.Elapsed.HasValue)
                {
                    return (decimal)_stopwatchModel.Elapsed.Value.Seconds
                        + (_stopwatchModel.Elapsed.Value.Milliseconds * .001M);
                }
                else
                    return 0.0M;
            }
        }

        public int LapHours
        {
            get { return _stopwatchModel.LapTime.HasValue ? _stopwatchModel.LapTime.Value.Hours : 0; }
        }

        public int LapMinutes
        {
            get { return _stopwatchModel.LapTime.HasValue ? _stopwatchModel.LapTime.Value.Minutes : 0; }
        }

        public decimal LapSeconds
        {
            get
            {
                if (_stopwatchModel.LapTime.HasValue)
                {
                    return (decimal)_stopwatchModel.LapTime.Value.Seconds
                        + (_stopwatchModel.LapTime.Value.Milliseconds * .001M);
                }
                else
                    return 0.0M;
            }
        }

        int _lastLapHours;
        int _lastLapMinutes;
        decimal _lastLapSeconds;
        private void LapTimeUpdatedEventHandler(object sender, LapEventArgs e)
        {
            if (_lastLapHours != LapHours)
            {
                _lastLapHours = LapHours;
                OnPropertyChanged("LapHours");
            }
            if (_lastLapMinutes != LapMinutes)
            {
                _lastLapMinutes = LapMinutes;
                OnPropertyChanged("LapMinutes");
            }
            if (_lastLapSeconds != LapSeconds)
            {
                _lastLapSeconds = LapSeconds;
                OnPropertyChanged("LapSeconds");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler propertyChanged = PropertyChanged;
            if (propertyChanged != null)
                propertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}


text:
#ifndef BSL_GOT_TYPES
#define BSL_GOT_TYPES

#include "Configure.h"

/************************************/
/* 8 bit char                       */
/************************************/

#if(SIZEOF_CHAR==1)
  typedef signed char BSL_CHAR8;
  typedef unsigned char BSL_UCHAR8;
#else
#  error SIZEOF_CHAR must be 1!
#endif

/************************************/
/* 16 bit int                       */
/************************************/

#if(SIZEOF_SHORT==2)
  typedef signed short BSL_INT16;
  typedef unsigned short BSL_UINT16;
#else
#if(SIZEOF_INT==2)
  typedef signed int BSL_INT16;
  typedef unsigned int BSL_UINT16;
#else
#  error Neither SIZEOF_SHORT nor SIZEOF_INT is 2!
#endif
#endif

/************************************/
/* 32 bit int                       */
/************************************/

#if(SIZEOF_LONG==4)
  typedef signed long BSL_INT32;
  typedef unsigned long BSL_UINT32;
#else
#if(SIZEOF_INT==4)
  typedef signed int BSL_INT32;
  typedef unsigned int BSL_UINT32;
#else
#  error Neither SIZEOF_LONG nor SIZEOF_INT is 4!
#endif
#endif

/************************************/
/* 64 bit int                       */
/************************************/
#ifndef DESIGN_TIME
#if(SIZEOF_LONG==8)
  typedef signed long BSL_INT64;
  typedef unsigned long BSL_UINT64;
#else
#if(SIZEOF_LONG_LONG==8)
  typedef signed long long BSL_INT64;
  typedef unsigned long long BSL_UINT64;
#else
#  error Neither SIZEOF_LONG nor SIZEOF_LONG_LONG is 8!
#endif
#endif
#endif

/************************************/
/* 32 bit float                     */
/************************************/

#if(SIZEOF_FLOAT==4)
  typedef float BSL_FLOAT32;
#else
#  error SIZEOF_FLOAT must be 4!
#endif

/************************************/
/* 64 bit float                     */
/************************************/

#if(SIZEOF_DOUBLE==8)
  typedef double BSL_FLOAT64;
#else
#  error SIZEOF_DOUBLE must be 8!
#endif

#endif


text:
/*
 * Support and FAQ: visit Atmel Support
 */

#ifndef _UDI_MSC_CONF_H_
#define _UDI_MSC_CONF_H_

/**
 * \addtogroup udi_msc_group_single_desc
 * @{
 */

//! Control endpoint size
#define  USB_DEVICE_EP_CTRL_SIZE       64

//! Endpoint numbers used by MSC interface
#define  UDI_MSC_EP_IN                 (1 | USB_EP_DIR_IN)
#define  UDI_MSC_EP_OUT                (2 | USB_EP_DIR_OUT)

//! Interface number is 0 because it is the unique interface
#define  UDI_MSC_IFACE_NUMBER          0

/**
 * \name UDD Configuration
 */
//@{
//! 2 endpoints used by MSC interface
#undef USB_DEVICE_MAX_EP    // undefine this definition in header file
#define  USB_DEVICE_MAX_EP             2
//@}

//@}

#include "udi_msc.h"

#endif // _UDI_MSC_CONF_H_


text:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
	<ModelRootPath
		path="models/3d_tree/"
	/>

	<TextureRootPath
		path="textures/3d_tree/"
	/>

	<!-- TRUNK (x4095) -->
	<InstancedTriangleMesh
		index="0"
		maxNumElements="121"
		type="1"
		modelPath="trunk.obj"
	>
		<Material type="1">
			<Attribute name="tex0" value="trunk.png" />
            <Attribute name="uvScale0" value="(1,4)" />
		</Material>
	</InstancedTriangleMesh>

	<!-- LEAF (x6144)-->
	<InstancedTriangleMesh
		index="1"
		maxNumElements="162"
		type="1"
		modelPath="leaf.obj"
	>
		<Material type="1">
			<Attribute name="tex0" value="leaf.png" />
		</Material>
	</InstancedTriangleMesh>

</Configuration>


text:
require 'active_record'
require 'fileutils'
require 'logger'

config_file = File.open( File.join( File.dirname(__FILE__), 'config.yml') )
ActiveRecord::Base.establish_connection( YAML::load( config_file )['development'] )

log_file = File.join( File.dirname(__FILE__), 'log', 'database.log' )
FileUtils.mkdir_p File.dirname(log_file)
ActiveRecord::Base.logger = Logger.new( File.open log_file , 'w')

require File.dirname(__FILE__) + '/models/father.rb'
require File.dirname(__FILE__) + '/models/child.rb'
require File.dirname(__FILE__) + '/models/boss.rb'
require File.dirname(__FILE__) + '/models/toy.rb'


text:
using BlockTypes;
using Pandaros.Settlers.Jobs;
using Pipliz.JSON;
using Recipes;
using System.Collections.Generic;

namespace Pandaros.Settlers.Items
{
    [ModLoader.ModManager]
    public static class EarthStone
    {
        public static ItemTypesServer.ItemTypeRaw Item { get; private set; }

        [ModLoader.ModCallback(ModLoader.EModCallbackType.AfterItemTypesDefined, GameLoader.NAMESPACE + ".Items.EarthStone.Register")]
        public static void Register()
        {
            var aether = new InventoryItem(Elementium.Item.ItemIndex, 2);
            var torch  = new InventoryItem(ColonyBuiltIn.ItemTypes.STONEBRICKS.Name, 50);

            var recipe = new Recipe(Item.name,
                                    new List<InventoryItem> {aether, torch},
                                    new ItemTypes.ItemTypeDrops(Item.ItemIndex, 1),
                                    6);

            ServerManager.RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }

        [ModLoader.ModCallback(ModLoader.EModCallbackType.AddItemTypes,
            GameLoader.NAMESPACE + ".Items.EarthStone.Add")]
        [ModLoader.ModCallbackDependsOn("pipliz.blocknpcs.addlittypes")]
        public static void Add(Dictionary<string, ItemTypesServer.ItemTypeRaw> items)
        {
            var name = GameLoader.NAMESPACE + ".EarthStone";
            var node = new JSONNode();
            node["icon"]        = new JSONNode(GameLoader.ICON_PATH + "Earthstone.png");
            node["isPlaceable"] = new JSONNode(false);

            var categories = new JSONNode(NodeType.Array);
            categories.AddToArray(new JSONNode("ingredient"));
            categories.AddToArray(new JSONNode("magic"));
            categories.AddToArray(new JSONNode("stone"));
            node.SetAs("categories", categories);

            Item = new ItemTypesServer.ItemTypeRaw(name, node);
            items.Add(name, Item);
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycol. Res. 99(5): 519 (1995)

#### Original name
Helicoönites Kalgutkar & Sigler

### Remarks
null


text:
// define the namespaces
jmaki.namespace("jmaki.widgets.yahoo.geocoder");

/**
 * Yahoo Geocoder Widget
 *      This widget lets you find geocordinates using the XMLHttpProxy using
 *      the Yahoo Geocoder service
 *
 * @author Greg Murray
 *          (original author)
 * @author Ahmad M. Zawawi <ahmad.zawawi@gmail.com>
 *          (Updated to new yahoo jmaki widget standard)
* @constructor
 * @see http://developer.yahoo.com/maps/rest/V1/geocode.html
 */
jmaki.widgets.yahoo.geocoder.Widget = function(wargs) {

    var topic = "/yahoo/geocoder";
    var uuid = wargs.uuid;
    var self = this;

    // we run on the xhp now
    var service = jmaki.xhp;

    //overide topic name if needed
    if (wargs.args && wargs.args.topic) {
        topic = wargs.args.topic;
        jmaki.log("Yahoo geocoder: widget uses deprecated topic. Use publish instead.");
    }

    if (wargs.publish) topic = wargs.publish;

    var location;

    /**
     */
    this.getCoordinates = function() {
        location = encodeURIComponent(document.getElementById(uuid + "_location").value);
        var encodedLocation = encodeURIComponent("location=" + location);
        var url = service + "?id=yahoogeocoder&urlparams=" + encodedLocation;
        jmaki.doAjax({url: url, callback: function(req) { var _req=req; postProcess(_req);}});
    }

    /**
     */
    function postProcess(req) {
        if (req.readyState == 4) {
            if (req.status == 200) {
                var v = {success:false};
                if(req.responseText.length > 0) {
                    var response = eval("(" + req.responseText + ")");
                    var coordinates = response.coordinates;
                    v = {success:true,results:coordinates};

                    //for compatibility (deprecated): we leave this one for a while
                    jmaki.publish(topic, coordinates);
                }
                //the new format is here (as in v)
                //with status flag sent
                jmaki.publish(topic + "/onGeocode", {id: uuid, value:v} )
            }
        }

    }

}


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

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.wso2.carbon</groupId>
        <artifactId>bam-data-agents-features</artifactId>
        <version>4.3.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>bam-mediation-data-agent-feature</artifactId>
    <packaging>pom</packaging>
    <name>WSO2 Carbon - BAM Mediation Data Agent Feature Aggregator Module</name>
    <url>http://wso2.org</url>

    <modules>
        <module>org.wso2.carbon.bam.mediation.agent.server.feature/4.2.0</module>
        <module>org.wso2.carbon.bam.mediation.agent.ui.feature/4.2.0</module>
        <module>org.wso2.carbon.bam.mediation.agent.feature/4.2.0</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!--<dependency>
                <groupId>org.wso2.carbon</groupId>
                <artifactId>org.wso2.carbon.bam.activity.mediation.data.publisher</artifactId>
                <version>${wso2carbon.version.bam.data.publisher.activity.mediation}</version>
            </dependency>
            <dependency>
                <groupId>org.wso2.carbon</groupId>
                <artifactId>org.wso2.carbon.bam.activity.mediation.data.publisher.ui</artifactId>
                <version>${wso2carbon.version.bam.data.publisher.activity.mediation.ui}</version>
            </dependency>
            <dependency>
                <groupId>org.wso2.carbon</groupId>
                <artifactId>org.wso2.carbon.bam.activity.mediation.data.publisher.stub</artifactId>
                <version>${org.wso2.carbon.bam.data.publisher.activity.mediation.stub}</version>
            </dependency>-->
            <dependency>
                <groupId>org.wso2.carbon</groupId>
                <artifactId>org.wso2.carbon.bam.mediationstats.data.publisher</artifactId>
                <version>${wso2carbon.version.bam.data.publisher.mediationstats}</version>
            </dependency>
            <dependency>
                <groupId>org.wso2.carbon</groupId>
                <artifactId>org.wso2.carbon.bam.mediationstats.data.publisher.ui</artifactId>
                <version>${wso2carbon.version.bam.data.publisher.mediationstats.ui}</version>
            </dependency>
            <dependency>
                <groupId>org.wso2.carbon</groupId>
                <artifactId>org.wso2.carbon.bam.mediationstats.data.publisher.stub</artifactId>
                <version>${org.wso2.carbon.bam.data.publisher.mediationstats.stub}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <properties>
        <wso2carbon.version.servicestats>${wso2carbon.version}</wso2carbon.version.servicestats>
        <wso2carbon.version.bam.data.publisher.mediationstats>${wso2carbon.version} </wso2carbon.version.bam.data.publisher.mediationstats>
        <wso2carbon.version.bam.data.publisher.mediationstats.ui>${wso2carbon.version} </wso2carbon.version.bam.data.publisher.mediationstats.ui>
        <org.wso2.carbon.bam.data.publisher.mediationstats.stub>${wso2carbon.version} </org.wso2.carbon.bam.data.publisher.mediationstats.stub>
        <!--wso2carbon.version.bam.data.publisher.activity.mediation>${wso2carbon.version}</wso2carbon.version.bam.data.publisher.activity.mediation>
        <wso2carbon.version.bam.data.publisher.activity.mediation.ui>${wso2carbon.version}</wso2carbon.version.bam.data.publisher.activity.mediation.ui>
        <org.wso2.carbon.bam.data.publisher.activity.mediation.stub>${wso2carbon.version}</org.wso2.carbon.bam.data.publisher.activity.mediation.stub-->
    </properties>
</project>


text:
package org.kuali.rice.core.impl.config.module;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.xml.DOMConfigurator;
import org.kuali.rice.core.api.config.property.Config;
import org.kuali.rice.core.api.config.property.ConfigContext;
import org.kuali.rice.core.api.lifecycle.BaseLifecycle;
import org.springframework.util.Log4jConfigurer;
import org.springframework.util.ResourceUtils;
import org.w3c.dom.Document;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.ByteArrayInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/**
 * Lifecycle implementation that initializes and shuts down Log4J logging
 */
class Log4jLifeCycle extends BaseLifecycle {

    private static final String LOG4J_FILE_NOT_FOUND = "log4j settings file not found at location: ";

	/**
     * Convenience constant representing a minute in milliseconds
     */
    private static final int MINUTE = 60 * 1000;

    /**
     * Location of default/automatic Log4J configuration properties, in Spring ResourceUtils resource/url syntax
     */
    private static final String AUTOMATIC_LOGGING_CONFIG_URL = "classpath:org/kuali/rice/core/logging/default-log4j.properties";

    /**
     * Default settings reload interval to use in the case that the settings are reloadable (i.e. they originate from a file)
     */
    private static final int DEFAULT_RELOAD_INTERVAL = 5 * MINUTE; // 5 minutes

    /**
     * Non-static and non-final so that it can be reset after configuration is read
     */
    private Logger log = Logger.getLogger(getClass());

    @Override
	public void start() throws Exception {
        // obtain the root workflow config
		Config config = ConfigContext.getCurrentContextConfig();

        boolean log4jFileExists = checkPropertiesFileExists(config.getProperty(Config.LOG4J_SETTINGS_PATH));

        // first check for in-line xml configuration
		String log4jconfig = config.getProperty(Config.LOG4J_SETTINGS_XML);
		if (log4jconfig != null) {
			try {
				DocumentBuilder b = DocumentBuilderFactory.newInstance().newDocumentBuilder();
				Document doc = b.parse(new ByteArrayInputStream(log4jconfig.getBytes()));
				DOMConfigurator.configure(doc.getDocumentElement());
				// now get the reconfigured log instance
				log = Logger.getLogger(getClass());
			} catch (Exception e) {
				log.error("Error parsing Log4J configuration settings: " + log4jconfig, e);
			}
        // next check for in-line properties configuration
		} else if ((log4jconfig = config.getProperty(Config.LOG4J_SETTINGS_PROPS)) != null) {
			Properties p = new Properties(config.getProperties());
			try {
				p.load(new ByteArrayInputStream(log4jconfig.getBytes()));
				PropertyConfigurator.configure(p);
				log = Logger.getLogger(getClass());
			} catch (IOException ioe) {
				log.error("Error loading Log4J configuration settings: " + log4jconfig, ioe);
			}
        // check for an external file location specification
		} else if (log4jFileExists) {
			log.info("Configuring Log4J logging.");
			log4jconfig = config.getProperty(Config.LOG4J_SETTINGS_PATH);

            int reloadInterval = DEFAULT_RELOAD_INTERVAL;

            String log4jReloadInterval = config.getProperty(Config.LOG4J_SETTINGS_RELOADINTERVAL_MINS);
			if (log4jReloadInterval != null) {
				try {
                    reloadInterval = Integer.parseInt(log4jReloadInterval) * MINUTE;
				} catch (NumberFormatException nfe) {
					log.warn("Invalid reload interval: " + log4jReloadInterval + ", using default: " + DEFAULT_RELOAD_INTERVAL + " milliseconds");
				}
			}
            Log4jConfigurer.initLogging(log4jconfig, reloadInterval);
			log = Logger.getLogger(getClass());
		} else {
            Log4jConfigurer.initLogging(AUTOMATIC_LOGGING_CONFIG_URL);
            log = Logger.getLogger(getClass());
		}
		super.start();
	}

    /**
	 * Checks if the passed in file exists.
	 *
	 * @param log4jSettingsPath the file
	 * @return true if exists
	 */
	private boolean checkPropertiesFileExists(String log4jSettingsPath) {
		if (StringUtils.isBlank(log4jSettingsPath)) {
			return false;
		}

		boolean exists;

		try {
			exists = ResourceUtils.getFile(log4jSettingsPath).exists();
		} catch (FileNotFoundException e) {
			exists = false;
		}

		if (!exists) {
			System.out.println(LOG4J_FILE_NOT_FOUND + log4jSettingsPath);
		}

		return exists;
	}

}


text:
$(function(){
	$('#addUserToList').on('click', addUser);
	$('#submit_group').on('click', createGroup);
});

var users = [];
function createGroup() {
	var group_name = $('#GroupName_id').val();
	var usersToAdd = JSON.stringify(users);
	if (group_name =="")
	{
		swal("Missing Group Name!", "please enter a name for your group", "info");
		return;
	}

	$.ajax({
		url:'/newGroup',
		type:'GET',
		dataType:'json',
			data:{GroupName_id:group_name, Users:usersToAdd},
			success:function(data, status, xhr) {
				if (data.status == 'exists')
				{
					swal("Group Exists!", "you already has a group with this name", "info");
					return;
				}
				else
				{
					if (data == null)
						return;
					var dom = document.getElementById('allGroups');
					var gid = data[1];
					var names = data[0];
					$( "#allGroups" ).empty();
					for (i = 0; i < data.length; ++i)
						dom.insertAdjacentHTML('beforeend','
' + names[i][1] + '

');
					$("#GroupName_id" ).val("");
					if (gid != null)
						window.location.replace("listPage?gid="+gid);
					return;
				}
			},
			error:function(xhr, status, error) {
				swal({
					title: "Error!",
					text: "Something Went Wrong!",
					type: "error",
					confirmButtonText: "OK"
				});
				console.error(xhr, status, error);
			}
		});
	}

function addUser()
{
	var user_name = $('#selectUser').val();
	var i;
	if (user_name == "")
	{
		swal("Missing User!", "please enter the user you want to add to the group", "info");
		return;
	}
	for (i=0; i<users.length; i++)
		if (user_name == users[i])
		{
			swal("User Exists!", "user is already exists in group", "info");
			return;
		}
	users.push(user_name);
	var dom = document.getElementById('users_list');
	i = users.length-1;
	dom.insertAdjacentHTML('beforeend',''+ users[i] + '	'
		+'
')
	$( "#selectUser" ).val("");
}

function deleteFromList(index) {
	users.splice(index,1);
	var dom = document.getElementById('users_list');
	$("#users_list").empty();
	dom.insertAdjacentHTML('beforeend','<col width="300px" /><col width="30px" />

');
	for (i = 0; i < users.length; ++i)
	{
		dom.insertAdjacentHTML('beforeend',''+ users[i] + '	'
			+'
')
	}
}


text:
A chaincode needs to be packaged before it can be installed on your peers.
This example uses the `peer lifecycle chaincode package` command to package
a Golang chaincode.

  * Use the `--label` flag to provide a chaincode package label of `myccv1`
    that your organization will use to identify the package.

    ```
    peer lifecycle chaincode package mycc.tar.gz --path github.com/hyperledger/fabric-samples/chaincode/abstore/go/ --lang golang --label myccv1
    ```

### peer lifecycle chaincode install example

After the chaincode is packaged, you can use the `peer chaincode install` command
to install the chaincode on your peers.

  * Install the `mycc.tar.gz ` package on `peer0.org1.example.com:7051` (the
    peer defined by `--peerAddresses`).

    ```
    peer lifecycle chaincode install mycc.tar.gz --peerAddresses peer0.org1.example.com:7051
    ```
    If successful, the command will return the package identifier. The
    package ID is the package label combined with a hash of the chaincode
    package taken by the peer.
    ```
    2019-03-13 13:48:53.691 UTC [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payload:"\nEmycc:ebd89878c2bbccf62f68c36072626359376aa83c36435a058d453e8dbfd894cc" >
    2019-03-13 13:48:53.691 UTC [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: mycc:a7ca45a7cc85f1d89c905b775920361ed089a364e12a9b6d55ba75c965ddd6a9
    ```

### peer lifecycle chaincode queryinstalled example

You need to use the chaincode package identifier to approve a chaincode
definition for your organization. You can find the package ID for the
chaincodes you have installed by using the
`peer lifecycle chaincode queryinstalled` command:

```
peer lifecycle chaincode queryinstalled --peerAddresses peer0.org1.example.com:7051
```

A successful command will return the package ID associated with the
package label.

```
Get installed chaincodes on peer:
Package ID: myccv1:a7ca45a7cc85f1d89c905b775920361ed089a364e12a9b6d55ba75c965ddd6a9, Label: myccv1
```

### peer lifecycle chaincode getinstalledpackage example

You can retrieve an installed chaincode package from a peer using the
`peer lifecycle chaincode getinstalledpackage` command. Use the package
identifier returned by `queryinstalled`.

  * Use the `--package-id` flag to pass in the chaincode package identifier. Use
  the `--output-directory` flag to specify where to write the chaincode package.
  If the output directory is not specified, the chaincode package will be written
  in the current directory.

  ```
  peer lifecycle chaincode getinstalledpackage --package-id myccv1:a7ca45a7cc85f1d89c905b775920361ed089a364e12a9b6d55ba75c965ddd6a9 --output-directory /tmp --peerAddresses peer0.org1.example.com:7051
  ```

### peer lifecycle chaincode approveformyorg example

Once the chaincode package has been installed on your peers, you can approve
a chaincode definition for your organization. The chaincode definition includes
the important parameters of chaincode governance, including the chaincode name,
version and the endorsement policy.

Here is an example of the `peer lifecycle chaincode approveformyorg` command,
which approves the definition of a chaincode  named `mycc` at version `1.0` on
channel `mychannel`.

  * Use the `--package-id` flag to pass in the chaincode package identifier. Use
    the `--signature-policy` flag to define an endorsement policy for the chaincode.
    Use the `init-required` flag to request the execution of the `Init`
    function to initialize the chaincode.

    ```
    export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    peer lifecycle chaincode approveformyorg  -o orderer.example.com:7050 --tls --cafile $ORDERER_CA --channelID mychannel --name mycc --version 1.0 --init-required --package-id myccv1:a7ca45a7cc85f1d89c905b775920361ed089a364e12a9b6d55ba75c965ddd6a9 --sequence 1 --signature-policy "AND ('Org1MSP.peer','Org2MSP.peer')"

    2019-03-18 16:04:09.046 UTC [cli.lifecycle.chaincode] InitCmdFactory -> INFO 001 Retrieved channel (mychannel) orderer endpoint: orderer.example.com:7050
    2019-03-18 16:04:11.253 UTC [chaincodeCmd] ClientWait -> INFO 002 txid [efba188ca77889cc1c328fc98e0bb12d3ad0abcda3f84da3714471c7c1e6c13c] committed with status (VALID) at peer0.org1.example.com:7051
    ```

  * You can also use the `--channel-config-policy` flag use a policy inside
    the channel configuration as the chaincode endorsement policy. The default
    endorsement policy is `Channel/Application/Endorsement`

    ```
    export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    peer lifecycle chaincode approveformyorg -o orderer.example.com:7050 --tls --cafile $ORDERER_CA --channelID mychannel --name mycc --version 1.0 --init-required --package-id myccv1:a7ca45a7cc85f1d89c905b775920361ed089a364e12a9b6d55ba75c965ddd6a9 --sequence 1 --channel-config-policy Channel/Application/Admins

    2019-03-18 16:04:09.046 UTC [cli.lifecycle.chaincode] InitCmdFactory -> INFO 001 Retrieved channel (mychannel) orderer endpoint: orderer.example.com:7050
    2019-03-18 16:04:11.253 UTC [chaincodeCmd] ClientWait -> INFO 002 txid [efba188ca77889cc1c328fc98e0bb12d3ad0abcda3f84da3714471c7c1e6c13c] committed with status (VALID) at peer0.org1.example.com:7051
    ```

### peer lifecycle chaincode checkcommitreadiness example

You can check whether a chaincode definition is ready to be committed using the
`peer lifecycle chaincode checkcommitreadiness` command, which will return
successfully if a subsequent commit of the definition is expected to succeed. It
also outputs which organizations have approved the chaincode definition. If an
organization has approved the chaincode definition specified in the command, the
command will return a value of true. You can use this command to learn whether enough
channel members have approved a chaincode definition to meet the
`Application/Channel/Endorsement` policy (a majority by default) before the
definition can be committed to a channel.

  * Here is an example of the `peer lifecycle chaincode checkcommitreadiness` command,
    which checks a chaincode named `mycc` at version `1.0` on channel `mychannel`.

    ```
    export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID mychannel --tls --cafile $ORDERER_CA --name mycc --version 1.0 --init-required --sequence 1
    ```

    If successful, the command will return the organizations that have approved
    the chaincode definition.

    ```
    Chaincode definition for chaincode 'mycc', version '1.0', sequence '1' on channel
    'mychannel' approval status by org:
    Org1MSP: true
    Org2MSP: true
    ```

  * You can also use the `--output` flag to have the CLI format the output as
    JSON.

    ```
    export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID mychannel --tls --cafile $ORDERER_CA --name mycc --version 1.0 --init-required --sequence 1 --output json
    ```

    If successful, the command will return a JSON map that shows if an organization
    has approved the chaincode definition.

    ```
    {
       "Approvals": {
          "Org1MSP": true,
          "Org2MSP": true
       }
    }
    ```

### peer lifecycle chaincode commit example

Once a sufficient number of organizations approve a chaincode definition for
their organizations (a majority by default), one organization can commit the
definition the channel using the `peer lifecycle chaincode commit` command:

  * This command needs to target the peers of other organizations on the channel
    to collect their organization endorsement for the definition.

    ```
    export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID mychannel --name mycc --version 1.0 --sequence 1 --init-required --tls --cafile $ORDERER_CA --peerAddresses peer0.org1.example.com:7051 --peerAddresses peer0.org2.example.com:9051

    2019-03-18 16:14:27.258 UTC [chaincodeCmd] ClientWait -> INFO 001 txid [b6f657a14689b27d69a50f39590b3949906b5a426f9d7f0dcee557f775e17882] committed with status (VALID) at peer0.org2.example.com:9051
    2019-03-18 16:14:27.321 UTC [chaincodeCmd] ClientWait -> INFO 002 txid [b6f657a14689b27d69a50f39590b3949906b5a426f9d7f0dcee557f775e17882] committed with status (VALID) at peer0.org1.example.com:7051
    ```

### peer lifecycle chaincode querycommitted example

You can query the chaincode definitions that have been committed to a channel by
using the `peer lifecycle chaincode querycommitted` command. You can use this
command to query the current definition sequence number before upgrading a
chaincode.

  * You need to supply the chaincode name and channel name in order to query a
    specific chaincode definition and the organizations that have approved it.

    ```
    export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    peer lifecycle chaincode querycommitted -o orderer.example.com:7050 --channelID mychannel --name mycc --tls --cafile $ORDERER_CA --peerAddresses peer0.org1.example.com:7051

    Committed chaincode definition for chaincode 'mycc' on channel 'mychannel':
    Version: 1, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc
    Approvals: [Org1MSP: true, Org2MSP: true]
    ```

  * You can also specify just the channel name in order to query all chaincode
  definitions on that channel.

    ```
    export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    peer lifecycle chaincode querycommitted -o orderer.example.com:7050 --channelID mychannel --tls --cafile $ORDERER_CA --peerAddresses peer0.org1.example.com:7051

    Committed chaincode definitions on channel 'mychannel':
    Name: mycc, Version: 1, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc
    Name: yourcc, Version: 2, Sequence: 3, Endorsement Plugin: escc, Validation Plugin: vscc
    ```

This work is licensed under a Creative Commons Attribution 4.0 International License.


text:
import inspect

class Signature(object):
    def __init__(self, argtypes, optionals):
        super(Signature, self).__init__()
        self.argtypes = argtypes
        self.optionals = optionals

class SignatureException(Exception):
    pass

class MissingArgumentType(SignatureException):
    pass

class UnknownArgumentsException(SignatureException):
    pass

def get_function_signature(func, argtypes):
    argtypes = dict(argtypes)
    argspec = inspect.getargspec(func)
    untyped = set(argspec.args) - set(argtypes)
    if untyped:
        raise MissingArgumentType("The following arguments have no type: {}".format(", ".join(sorted(untyped))))
    unknown = set(argtypes) - set(argspec.args)
    if unknown:
        raise UnknownArgumentsException("The following arguments aren't real arguments")
    optionals = set(argspec.args[-len(argspec.defaults or ()):])
    return Signature(argtypes, optionals)


text:
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Infrastructure.Persistence.Dtos;

namespace Umbraco.Cms.Infrastructure.Persistence.Mappers;

[MapperFor(typeof(ServerRegistration))]
[MapperFor(typeof(IServerRegistration))]
internal sealed class ServerRegistrationMapper : BaseMapper
{
    public ServerRegistrationMapper(Lazy<ISqlContext> sqlContext, MapperConfigurationStore maps)
        : base(sqlContext, maps)
    {
    }

    protected override void DefineMaps()
    {
        DefineMap<ServerRegistration, ServerRegistrationDto>(
            nameof(ServerRegistration.Id),
            nameof(ServerRegistrationDto.Id));
        DefineMap<ServerRegistration, ServerRegistrationDto>(
            nameof(ServerRegistration.IsActive),
            nameof(ServerRegistrationDto.IsActive));
        DefineMap<ServerRegistration, ServerRegistrationDto>(
            nameof(ServerRegistration.IsSchedulingPublisher),
            nameof(ServerRegistrationDto.IsSchedulingPublisher));
        DefineMap<ServerRegistration, ServerRegistrationDto>(
            nameof(ServerRegistration.ServerAddress),
            nameof(ServerRegistrationDto.ServerAddress));
        DefineMap<ServerRegistration, ServerRegistrationDto>(
            nameof(ServerRegistration.CreateDate),
            nameof(ServerRegistrationDto.DateRegistered));
        DefineMap<ServerRegistration, ServerRegistrationDto>(
            nameof(ServerRegistration.UpdateDate),
            nameof(ServerRegistrationDto.DateAccessed));
        DefineMap<ServerRegistration, ServerRegistrationDto>(
            nameof(ServerRegistration.ServerIdentity),
            nameof(ServerRegistrationDto.ServerIdentity));
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cbn.Lib.Logging
{
    public class ConsoleLogger : LoggerBase
    {
        public override void Write(LogLevel level, object msg)
        {
            Console.WriteLine($"[{level}] {msg}");
        }
    }
}