text:
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

# Apache NiFi - MiNiFi - C++ C2 Readme.

This readme defines the Command and control configuration options that work with Apache NiFi. All
options defined are located in minifi.properties.

## Table of Contents

- [Description](#description)
- [Configuration](#configuration)
  - [Base Options](#base-options)
  - [Metrics](#metrics)
  - [Protocols](#protocols)
  - [Triggers](#triggers)
  - [UpdatePolicies](#updatepolicies)
 - [Documentation](#documentation)

## Description

Apache NiFi MiNiFi C++ can communicates with a C2 Server via a number of protocols. These protocols
deliver a C2 response the server, expecting requests in a heartbeat response. The protocol transforms
the C2 messages into a protocol specific representation. The internal representation is an AST therefore
you must define the root classes, which configure the classes that branch from the root. You can define
arbitrary nodes and sub-trees, but this isn't necessary and only advantageous for custom C2 servers. That
will be explained in greater detail in the metrics section.

## Configuration

### Base Options
For more more insight into the API used within the C2 agent, please visit:
https://cwiki.apache.org/confluence/display/MINIFI/C2+Design+Proposal

Release 0.6.0: Please note that all c2 properties now exist as `nifi.c2.*`. If your configuration properties
files contain the former naming convention of `c2.*`, we will continue to support that as
an alternate key, but you are encouraged to switch your configuration options as soon as possible.

Note: In release 0.8.0 there is a configuration option to minimize the heartbeat payload size by excluding agent manifest.
For that, add "nifi.c2.full.heartbeat"=false property.
With this change, heartbeat with agent manifest included is sent only for the first time then falls back to sending
light weight heartbeat. If for some reason the C2 server does not receive the first full heartbeat, the manifest can
be requested via C2 DESCRIBE manifest command.

	#in minifi.properties

	# Disable/Enable C2
	nifi.c2.enable=true

	# specify classes for the AST response
	nifi.c2.root.classes=DeviceInfoNode,AgentInformation,FlowInformation

	# specify C2 protocol -- default is CoapProtocol if not specified
	#nifi.c2.agent.protocol.class=CoapProtocol
	# may also use MQTT or REST
	# nifi.c2.agent.protocol.class=MQTTC2Protocol
	nifi.c2.agent.protocol.class=RESTSender

	# control c2 heartbeat interval in millisecocnds
	nifi.c2.agent.heartbeat.period=250

	# enable reporter classes
	nifi.c2.agent.heartbeat.reporter.class=RESTReciver

	# specify the rest URIs if using RESTSender
	nifi.c2.rest.url=http://<your-c2-server>/<c2-api-path>/c2-protocol/heartbeat
	nifi.c2.rest.url.ack=http://<your-c2-server>/<c2-api-path>/c2-protocol/acknowledge
	nifi.c2.flow.base.url=http://<your-c2-server>/<c2-api-path>/c2-protocol/

	# c2 agent identifier -- must be defined to run agent
	nifi.c2.agent.identifier=<your identifier>

	# c2 agent class -- must be defined to run agent
	nifi.c2.agent.class=<your agent class>

	# configure SSL Context service for REST Protocol
	#nifi.c2.rest.ssl.context.service

### Metrics

Command and Control metrics can be used to send metrics through the heartbeat or via the DESCRIBE
operation. Since responses are formed in an AST, metrics can be formed as a sub tree. Metrics classes
are defined apriori and may reference a metrics class specific to a processor. The following example describes
a configuration of an agent

	# in minifi.properties

	nifi.c2.root.class.definitions=metrics
	nifi.c2.root.class.definitions.metrics.name=metrics
	nifi.c2.root.class.definitions.metrics.metrics=typedmetrics,processorMetrics
	nifi.c2.root.class.definitions.metrics.metrics.typedmetrics.name=RuntimeMetrics
	nifi.c2.root.class.definitions.metrics.metrics.typedmetrics.classes=ProcessMetrics,SystemInformation
	nifi.c2.root.class.definitions.metrics.metrics.processorMetrics.name=ProcessorMetrics
	nifi.c2.root.class.definitions.metrics.metrics.processorMetrics.classes=GetFileMetrics

This example shows a metrics sub tree defined by the option 'nifi.c2.root.class.definitions'.

This is a comma separated list of all sub trees. In the example, above, only one sub tree exists: metrics.

The options below metrics define the sub-trees within metrics: typedmetrics and processorMetrics. Each of these has a name.
The classes sub option will define the metrics classes that are placed within this sub-tree. For the RESTProtocol, the above
configuration produces the following JSON:

	"metrics": {
        "ProcessorMetrics": {
            "GetFileMetrics": {
                "AcceptedFiles": 22,
                "InputBytes": 61755,
                "OnTriggerInvocations": 1
            }
        },
        "RuntimeMetrics": {
            "ProcessMetrics": {
                "CpuMetrics": {
                    "involcs": 1
                },
                "MemoryMetrics": {
                    "maxrss": 145804
                }
            },
            "systeminfo": {
                "systemInfo": {
                    "machinearch": "x86_64",
                    "physicalMem": 67361411072,
                    "vCores": 12
                },
                "identifier": "identifier"
            }
        }
    }

### Protocols

The default protocol is a RESTFul service; however, there is an MQTT protocol with a translation to use the
RESTFul C2 server and a CoAP Protocol implementation. The CoAP protocol requires that COAP be enabled either
through the bootstrap or the cmake flag -DENABLE_COAP=ON .

Once configured, COAP uses a controller service within the flow OR minifi properties entries: nifi.c2.agent.coap.host and nifi.c2.agent.coap.port.
Note that with CoAP, the payload will be significantly smaller, paring down metrics that are sent in each heartbeat. This will be useful for
constrained environments.

	nifi.c2.agent.coap.host=hostname
	nifi.c2.agent.coap.port=<port number>

If you wish to use the Controller service you made add a controller service named CoapConnectorService with the properties in the example config
below. Note that Max Queue Size is the only non-required property:

	Controller Services:
	- id: 94491a38-015a-1000-0000-000000000001
	  name: coapservice
	  class: CoapConnectorService
	  Properties:
	    Remote Server: server
	    Remote Port: port
	    Max Queue Size: 1000

As defined, above, MQTTC2Protocol can be used for the agent protocol class. If you wish to communicate with a RESTFul C2 server,
you may use the ConvertBase, ConvertHeartBeat, ConvertJSONAack, and ConvertUpdate classes on an agent to perform the translation.
State is not kept with an intermediate agent other than the broker. The broker is not embedded with the agent to simplify the agent.

An example configuration, below, defines an agent that receives and forward MQTT C2 requests to a C2 server. Additionally, this agent
will forward responses and updates to the heartbeating agents.

	MiNiFi Config Version: 3
	Flow Controller:
	  name: GetFile
	Core Properties:
	  flow controller graceful shutdown period: 10 sec
	  flow service write delay interval: 500 ms
	  administrative yield duration: 30 sec
	  bored yield duration: 10 millis
	  max concurrent threads: 1
	  variable registry properties: ''
	FlowFile Repository:
	  partitions: 256
	  checkpoint interval: 2 mins
	  always sync: false
	  Swap:
	    threshold: 20000
	    in period: 5 sec
	    in threads: 1
	    out period: 5 sec
	    out threads: 4
	Content Repository:
	  content claim max appendable size: 10 MB
	  content claim max flow files: 100
	  always sync: false
	Provenance Repository:
	  provenance rollover time: 1 min
	Component Status Repository:
	  buffer size: 1440
	  snapshot frequency: 1 min
	Security Properties:
	  keystore: ''
	  keystore type: ''
	  keystore password: ''
	  key password: ''
	  truststore: ''
	  truststore type: ''
	  truststore password: ''
	  ssl protocol: ''
	  Sensitive Props:
	    key:
	    algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
	    provider: BC
	Processors:
	- id: 24493a28-015a-1000-0000-000000000000
	  name: convert
	  class: org.apache.nifi.processors.standard.ConvertHeartBeat
	  max concurrent tasks: 1
	  scheduling strategy: TIMER_DRIVEN
	  scheduling period: 10 msec
	  penalization period: 30 sec
	  yield period: 2 sec
	  run duration nanos: 10 msec
	  auto-terminated relationships list:
	  Properties:
	    MQTT Controller Service: mqttservice
	    Listening Topic: heartbeats
	- id: 24493a28-015a-1000-0000-000000000006
	  name: convertJSON
	  class: org.apache.nifi.processors.standard.ConvertJSONAck
	  max concurrent tasks: 1
	  scheduling strategy: TIMER_DRIVEN
	  scheduling period: 10 msec
	  penalization period: 30 sec
	  yield period: 1 sec
	  run duration nanos: 10 msec
	  auto-terminated relationships list:
	  - success
	  Properties:
	    MQTT Controller Service: mqttservice
	- id: 24493a28-015a-1000-0000-000000000007
	  name: convertupdate
	  class: org.apache.nifi.processors.standard.ConvertUpdate
	  max concurrent tasks: 1
	  scheduling strategy: TIMER_DRIVEN
	  scheduling period: 10 msec
	  penalization period: 30 sec
	  yield period: 1 sec
	  run duration nanos: 10 msec
	  auto-terminated relationships list:
	  - success
	  Properties:
	    MQTT Controller Service: mqttservice
	    Listening Topic: updates
	- id: 24493a28-015a-1000-0000-000000000021
	  name: httpheartbeat
	  class: org.apache.nifi.processors.standard.InvokeHTTP
	  max concurrent tasks: 1
	  scheduling strategy: TIMER_DRIVEN
	  scheduling period: 10 msec
	  penalization period: 30 sec
	  yield period: 1 sec
	  run duration nanos: 10 msec
	  auto-terminated relationships list:
	  Properties:
	    HTTP Method: POST
	    Remote URL: http://localhost:10080/minifi-c2-api/c2-protocol/heartbeat
	    Content-type: application/json
	- id: 24493a28-015a-1000-0000-000000000022
	  name: log
	  class: org.apache.nifi.processors.standard.LogAttribute
	  max concurrent tasks: 1
	  scheduling strategy: TIMER_DRIVEN
	  scheduling period: 100 msec
	  penalization period: 30 sec
	  yield period: 1 sec
	  run duration nanos: 1 msec
	  auto-terminated relationships list:
	  - success
	  Properties:
	Controller Services:
	- id: 94491a38-015a-1000-0000-000000000001
	  name: mqttservice
	  class: MQTTContextService
	  Properties:
	    Broker URI: localhost:1883
	    Client ID: hiblajl
	    Quality of Service: 2
	Process Groups: []
	Input Ports: []
	Output Ports: []
	Funnels: []
	Connections:
	- id: 1d09c015-015d-1000-0000-000000000000
	  name: convert/success/httpheartbeat
	  source id: 24493a28-015a-1000-0000-000000000000
	  source relationship name: success
	  destination id: 24493a28-015a-1000-0000-000000000021
	  max work queue size: 10000
	  max work queue data size: 1 GB
	  flowfile expiration: 0 sec
	  queue prioritizer class: org.apache.nifi.prioritizer.FirstInFirstOutPrioritizer
	- id: 1d09c015-015d-1000-0000-000000000002
	  name: httpheartbeat/success/convertJSON
	  source id: 24493a28-015a-1000-0000-000000000021
	  source relationship name: success
	  destination id: 24493a28-015a-1000-0000-000000000006
	  max work queue size: 10000
	  max work queue data size: 1 GB
	  flowfile expiration: 0 sec
	  queue prioritizer class: org.apache.nifi.prioritizer.FirstInFirstOutPrioritizer
	Remote Process Groups: []
	NiFi Properties Overrides: {}

### UpdatePolicies

Updates to MiNiFi C++ properties can be controlled through an UpdatePolicyControllerService named
C2UpdatePolicy. The service supports several configuration options. They are defined in the following example:

	Controller Services:
	- id: 94491a38-015a-1000-0000-000000000001
	  name: C2UpdatePolicy
	  class: UpdatePolicyControllerService
	  Properties:
	    # true enables all properties to be updated.
	    Allow All Properties: true
	    # allowed properties are those which can be updated
	    Allowed Properties:
	             Property_1:true
	             Property_2:true
	    Disallowed Properties:
	    		 Property_3:true
	             Property_4:true

### Triggers

  C2 Triggers can be activated to perform some C2 activity via a local event. Currently only FileUpdateTrigger exists, which monitors
  for C2 File triggers to update the flow configuration. Classes can be defined as a comma separated list of classes to load via the option
  nifi.c2.agent.trigger.classes

#### C2 File triggers

C2 updates can be triggered with updates to a flow configuration file. It doesn't have to be the same base configuration file. It
will be copied into place. A new property, nifi.c2.file.watch, can be placed into minifi.properties to monitor. If the update time
changes while the agent is running, it will be copied into place of the file defined by nifi.flow.configuration.file. The agent
will then be restarted with the new flow configuration. If a failure occurs in reading that file or it is an invalid YAML file, the
update process will be halted.

    in minifi.properties to activate the file update trigger specify

	# specifying a trigger
	nifi.c2.agent.trigger.classes=FileUpdateTrigger
	nifi.c2.file.watch=<full path of file to monitor>

## Documentation

Type descriptions ( class descriptions entered in PROCESSORS.md ) can be automatically placed within C2 by building cmake with
the following flag:

	cmake -DBOOTSTRAP=ON ..

	You can then run ./extensions/bootstrap/bstrp --inputc2docs <PROCESSORS.md> --outputc2docs ../libminifi/include/agent/agent_docs.h

 When cmake is instantiated with this, a build will re-generate the type descriptions from PROCESSORS.md. Once this is finished
 you may re-build the project with the following command from the build directory, running the build as you normally would:

	cmake -DBOOTSTRAP= ..


text:
package com.englishtown.vertx.guice;

import com.englishtown.vertx.jersey.inject.VertxPostResponseProcessor;
import com.englishtown.vertx.jersey.inject.VertxRequestProcessor;
import com.englishtown.vertx.jersey.inject.VertxResponseProcessor;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.binder.AnnotatedBindingBuilder;
import com.google.inject.binder.ScopedBindingBuilder;
import jersey.repackaged.com.google.common.collect.Sets;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;

public class GuiceJerseyBinderTest {

    GuiceJerseyBinder binder;

    @Mock
    Binder builder;
    @Mock
    AnnotatedBindingBuilder annotatedBindingBuilder;

    @Rule
    public final MockitoRule mockitoRule = MockitoJUnit.rule();

    @Before
    @SuppressWarnings("unchecked")
    public void setUp() throws Exception {

        when(builder.skipSources(Matchers.<Class[]>anyVararg())).thenReturn(builder);
        when(builder.bind((Class<?>) any(Class.class))).thenReturn(annotatedBindingBuilder);
        when(annotatedBindingBuilder.to(any(Class.class))).thenReturn(mock(ScopedBindingBuilder.class));

        binder = new GuiceJerseyBinder();
    }

    @Test
    public void testConfigure() throws Exception {

        binder.configure(builder);

        // 9 types are explicitly bound
        verify(builder, times(9)).bind((Class<?>) any(Class.class));

        // 11 multi-bindings are installed
        verify(builder, times(11)).install(any(Module.class));

    }

    @Test
    public void testProviders() throws Exception {

        List<?> list;

        list = binder.provideVertxRequestProcessorList(Sets.newHashSet(mock(VertxRequestProcessor.class), mock(VertxRequestProcessor.class)));
        assertEquals(2, list.size());

        list = binder.provideVertxResponseProcessorList(Sets.newHashSet(mock(VertxResponseProcessor.class), mock(VertxResponseProcessor.class)));
        assertEquals(2, list.size());

        list = binder.provideVertxPostResponseProcessorList(Sets.newHashSet(mock(VertxPostResponseProcessor.class), mock(VertxPostResponseProcessor.class)));
        assertEquals(2, list.size());

    }

}

redpajama_set_name: RedPajamaGithub


text:
//
//  palsay.c
//  oxyale
//
//  Created by Jesse Riddle on 7/21/15.
//  Copyright (c) 2015 Riddle Software. All rights reserved.
//

#include <oxlcom.h>
#include <palsay.h>

void
OXLDumpPalSayMsg(const OXLPalSayMsg *sayMsg)
{
    OXLLogDebug("sayMsg->palMsg.id = 0x%x\n", sayMsg->palMsg.id);
    OXLLogDebug("sayMsg->palMsg.len = %d\n", sayMsg->palMsg.len);
    OXLLogDebug("sayMsg->palMsg.ref = 0x%x\n", sayMsg->palMsg.ref);
    OXLLogDebug("sayMsg->len = %d\n", sayMsg->len);
    OXLLogDebug("sayMsg->msg = %s\n", sayMsg->msg);
}

void
OXLInitPalSayMsg(OXLPalSayMsg *sayMsg, OXLPalClient *client, const char *plainText)
{
    /* oxl_say_t *say_msg = (oxl_say_t *)&buf.base; */
    char cipherText[PAL_CRYPTO_CIPHERTEXT_SZ_CAP];
    OXLPalCryptoEncrypt(client->crypto, plainText, cipherText);
    OXLLogDebug("plainText: \"%s\"\ncipherText: \"%s\"\n", plainText, cipherText);
    uint16_t z = (uint16_t)strnlen(cipherText, PAL_CRYPTO_CIPHERTEXT_SZ_CAP);

    OXLPalSayMsg initPalSayMsg = { .palMsg.id = PAL_TX_SAY_MSG,
                                   .palMsg.len = z + 3,
                                   .palMsg.ref = client->user.id,
                                   .len = z };

    memcpy((OXLPalSayMsg *)sayMsg, &initPalSayMsg, sizeof(*sayMsg));
    /* memcpy((char *)&sayMsg->msg, cipherText, z); */
    strlcpy((char *)&sayMsg->msg, cipherText, PAL_CRYPTO_CIPHERTEXT_SZ_CAP);
}

OXLPalSayMsg *
OXLCreatePalSayMsg(OXLPalClient *client, const char *plainText)
{
    OXLPalSayMsg *sayMsg = malloc(sizeof(*sayMsg));
    OXLInitPalSayMsg(sayMsg, client, plainText);
    return sayMsg;
}


text:
<?php
declare(strict_types=1);
namespace bluefin\base\listener;
use closure;
interface listener
{
	public function before(string $method, closure $callback):bool;
	public function after(string $method, closure $callback):bool;
	public function __call(string $method, array $args);
}


text:
using System;

namespace ScSyncr.Console
{
    public interface IOutputWriter : IDisposable
    {
        void Write(string message, params object[] args);
    }
}


text:
package com.evolveum.midpoint.web.component.util;

import com.evolveum.midpoint.web.page.PageBase;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.StringResourceModel;

/**
 * @author lazyman
 */
@Deprecated
public abstract class BasePanel<T> extends Panel {

    private IModel<T> model;
    private boolean initialized;

    public BasePanel(String id, IModel<T> model) {
        super(id);

        this.model = model;
    }

    @Override
    protected void onBeforeRender() {
        super.onBeforeRender();

        if (initialized) {
            return;
        }
        initLayout();
        initialized = true;
    }

    protected IModel<T> getModel() {
        return model;
    }

    public String getString(String resourceKey, Object... objects) {
        return createStringResource(resourceKey, objects).getString();
    }

    public StringResourceModel createStringResource(String resourceKey, Object... objects) {
        return new StringResourceModel(resourceKey, this, null, resourceKey, objects);
    }

    public StringResourceModel createStringResource(Enum e) {
        String resourceKey = e.getDeclaringClass().getSimpleName() + "." + e.name();
        return createStringResource(resourceKey);
    }

    public PageBase getPageBase() {
        return (PageBase) getPage();
    }

    protected void initLayout() {
    }

    protected String createComponentPath(String... components) {
        return StringUtils.join(components, ":");
    }
}


text:
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.analytics</groupId>
  <artifactId>analytics-data-snapshot</artifactId>
  <packaging>jar</packaging>
  <name>Google Analytics Data Snapshot Samples</name>
  <url>https://github.com/googleapis/java-analytics-data</url>

  <!--
    The parent pom defines common style checks and testing strategies for our samples.
    Removing or replacing it should not affect the execution of the samples in anyway.
  -->
  <parent>
    <groupId>com.google.cloud.samples</groupId>
    <artifactId>shared-configuration</artifactId>
    <version>1.2.0</version>
  </parent>

  <properties>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>libraries-bom</artifactId>
        <version>26.1.4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- {x-version-update-start:google-analytics-data:current} -->
    <dependency>
      <groupId>com.google.analytics</groupId>
      <artifactId>google-analytics-data</artifactId>
      <version>0.14.10-SNAPSHOT</version>
    </dependency>
    <!-- {x-version-update-end} -->
    <dependency>
      <groupId>com.google.auth</groupId>
      <artifactId>google-auth-library-oauth2-http</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>1.1.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- compile and run all snippet tests -->
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>add-snippets-source</id>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>../snippets/src/main/java</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-snippets-tests</id>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>../snippets/src/test/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>


text:
#import "NSObject.h"

@class CALayer;

@interface StackElement : NSObject
{
    CALayer *_itemLayer;
    int _currentState;
    int _nextState;
    int _targetState;
    int _previousState;
    id <StackElementDelegate> _delegate;
    id _item;
    long long _orientation;
}

@property(nonatomic) long long orientation; // @synthesize orientation=_orientation;
@property(readonly, nonatomic) int previousState; // @synthesize previousState=_previousState;
@property(readonly, nonatomic) id item; // @synthesize item=_item;
@property(nonatomic) id <StackElementDelegate> delegate; // @synthesize delegate=_delegate;
- (struct CGAffineTransform)onStackTransform;
- (struct CGAffineTransform)offscreenTransform;
- (struct CGAffineTransform)_affineTransformWithTranslation:(struct CGSize)arg1;
- (struct CGAffineTransform)fullsizeTransform;
- (void)fadeInUnderneathStack:(BOOL)arg1;
- (void)fadeOutUnderneathStack:(BOOL)arg1;
- (void)moveOutFromStack:(BOOL)arg1;
- (void)moveIntoStack:(BOOL)arg1;
- (void)hide:(BOOL)arg1;
- (void)animationDidStop:(id)arg1 finished:(id)arg2 context:(void *)arg3;
- (void)commitAnimation;
- (void)beginAnimationToState:(int)arg1 withDuration:(double)arg2 beginsFromCurrentState:(BOOL)arg3 didStopSelector:(SEL)arg4 context:(void *)arg5 animated:(BOOL)arg6;
- (id)_operationNameWithState:(int)arg1;
- (void)removeLayer;
@property(readonly, nonatomic) CALayer *layer;
@property(readonly, nonatomic) double stackIndex;
@property(readonly, nonatomic) BOOL isAnimating;
@property(nonatomic) int targetState;
@property(nonatomic) int currentState;
@property(readonly, nonatomic, getter=isVisible) BOOL visible;
- (void)setNextState:(int)arg1 animated:(BOOL)arg2;
- (void)setNextState:(int)arg1;
@property(readonly, nonatomic) int nextState;
- (int)state;
- (id)description;
- (void)dealloc;
- (id)initWithItem:(id)arg1 state:(int)arg2;

@end


text:
namespace SoftwareKobo.ViewModels
{
    public interface INavigable
    {
        void Activate(object parameter);

        void Deactivate(object parameter);
    }
}


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Queries_model
 *
 * @author Pradipta
 */
class Queries_model extends CI_Model{

    public function __construct() {
        parent::__construct();
        $this->load->database();
    }

    public function get_technicians_by_store(){
        $sql= "select t.tname,s.sadd from technician t,store s
            where t.sname=s.sname and s.sname='stonebriar'";
        $query=$this->db->query($sql);

        return $query->result();
    }
      public function get_quantity_by_store(){
        $sql= "SELECT p.sname, SUM( quantity ) AS squantity FROM phone p INNER JOIN iphone6 i6 ON p.imei = i6.imei GROUP BY p.sname HAVING p.sname = 'knox' ORDER BY p.sname";
        $query=$this->db->query($sql);

        return $query->result();
    }
}


text:
.PHONY: tinytypes testing meta jackson jersey

all: jackson jersey

jackson: meta
	$(MAKE) -C $@ -f ../component.mk

jersey: meta
	$(MAKE) -C $@ -f ../component.mk

meta: testing
	$(MAKE) -C $@ -f ../component.mk

testing: tinytypes
	$(MAKE) -C $@ -f ../component.mk

tinytypes:
	$(MAKE) -C $@ -f ../component.mk


text:
{% extends "base.html" %}

{% block content %}
<form action="/problemes/" method="post">
{% csrf_token %}
{% for error in form.non_field_errors %}

{{ error }}

{% endfor %}

    Email:
    {% for error in form.sender.errors %}

{{ error }}

    {% endfor %}
    <input type="email" class="form-control" id="id_sender" name="sender" placeholder="El meu email és..." value="{{ form.sender.data|default:"" }}">

    Problema:
    {% for error in form.subject.errors %}

{{ error }}

    {% endfor %}
    <input type="text" class="form-control" id="id_subject" name="subject" placeholder="Tinc problemes amb..." value="{{ form.subject.data|default:"" }}">

    Descripció:
    {% for error in form.message.errors %}

{{ error }}

    {% endfor %}
    <textarea id="id_message" name="message" class="form-control" rows="4">{{ form.message.data|default:"" }}</textarea>

    <button type="submit" class="btn btn-lg btn-danger">Envia </button>

</form>
{% endblock %}


text:
<?php
$new_password = array(
	'name'	=> 'new_password',
	'id'	=> 'new_password',
	'maxlength'	=> $this->config->item('password_max_length', 'tank_auth'),
	'size'	=> 30,
        'class' => 'form-control',
        'placeholder' => 'New password'
);
$confirm_new_password = array(
	'name'	=> 'confirm_new_password',
	'id'	=> 'confirm_new_password',
	'maxlength'	=> $this->config->item('password_max_length', 'tank_auth'),
	'size' 	=> 30,
        'class' => 'form-control',
        'placeholder' => 'Confirm new password'
);
?>
<?php echo form_open($this->uri->uri_string()); ?>

		<?php echo form_password($new_password); ?>

                <?php echo form_error($new_password['name']); ?><?php echo isset($errors[$new_password['name']])?$errors[$new_password['name']]:''; ?>

		<?php echo form_password($confirm_new_password); ?>

                <?php echo form_error($confirm_new_password['name']); ?><?php echo isset($errors[$confirm_new_password['name']])?$errors[$confirm_new_password['name']]:''; ?>

<?php echo form_submit('change', 'Change Password','class = "btn btn-primary btn-block btn-flat"'); ?>
<?php echo form_close(); ?>


text:
package io.debezium.examples.hikr.rest.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.debezium.examples.hikr.model.Hike;
import io.debezium.examples.hikr.model.Person;
import io.debezium.examples.hikr.model.Trip;

public class ExternalTripWithHikes {

	private long id;
	private String name;
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date startDate;
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date endDate;
	private double price;
	private Person organizer;
	private Set<ExternalHikeSummary> availableHikes;

	public ExternalTripWithHikes() {
	}

	public ExternalTripWithHikes(Trip trip) {
		this.id = trip.id;
		this.name = trip.tripName;
		this.startDate = trip.startDate;
		this.endDate = trip.endDate;
		this.price = trip.price;
		this.organizer = trip.organizer;
		this.availableHikes = new HashSet<>( trip.availableHikes.size() );
		for ( Hike hike : trip.availableHikes ) {
			this.availableHikes.add( new ExternalHikeSummary( hike ) );
		}
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public Person getOrganizer() {
		return organizer;
	}

	public void setOrganizer(Person organizer) {
		this.organizer = organizer;
	}

	public Set<ExternalHikeSummary> getAvailableHikes() {
		return availableHikes;
	}

	public void setAvailableHikes(Set<ExternalHikeSummary> availableHikes) {
		this.availableHikes = availableHikes;
	}

	@Override
	public String toString() {
		return "TripDescription [id=" + id + ", name=" + name + "]";
	}

}


text:
import User from '../models/Users';

const userController = {

  list: (request, response, next) => {
    User.find({}).exec()
    .then(Users => {
      return response.json(Users);
    })
    .catch(err => {
      return next(err);
    });
  },

  show: (request, response, next) => {
    User.findById(request.params.id).exec()
    .then(Users => {
      return response.json(Users);
    })
    .catch(err => {
      return next(err);
    });
  },

  remove: (request, response, next) => {
    User.findByIdAndRemove(request.params.id).exec()
    .then(Users => {
      return response.json(Users);
    })
    .catch(err => {
      return next(err);
    });
  },

  create: (request, response, next) => {
    const user = new User(request.body);

    user.save()
    .then(storedUser => {
      return response.json(storedUser);
    })
    .catch(err => {
      return next(err);
    });
  },

  update: (request, response, next) => {
    User.findById(request.params.id).exec()
      .then(user => {
        user.albumName = request.body.albumName || user.albumName;
        user.lastName = request.body.lastName || user.lastName;
        user.userName = request.body.userName || user.userName;
        user.interests = request.body.interests || user.interests;
        user.userName = request.body.userName || user.userName;

        return user.save();
      })
      .then(changedUser => {
        return response.json(changedUser);
      })
      .catch(err => {
        return next(err);
      });
  }

};

export default userController;


text:
package boofcv.alg.feature.associate;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author Peter Abeles
 */
public class TestHammingTable16 {

	@Test
	public void exhaustive() {
		HammingTable16 alg = new HammingTable16();

		for( int i = 0; i < 256; i++ ) {
			for( int j = 0; j < 256; j++ ) {
				int expected = TestDescriptorDistance.hamming(i,j);
				int found = alg.lookup((short)i,(short)j);

				assertEquals(expected,found);
			}
		}

		int expected = TestDescriptorDistance.hamming(65533,62003);
		int found = alg.lookup((short)65533,(short)62003);
		assertEquals(expected,found);
	}
}


text:
/**
 * Created by saravanan on 5/31/2017.
 */
export * from './profile.component';


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

namespace BrightstarDB.Storage.BTreeStore
{
    internal class ObjectLocationContainer : IStorable
    {
        private readonly List<ObjectIdOffsetEntry> _objectIdOffsetIndex;

        public bool IsModified { get; set; }

        public IEnumerable<ObjectIdOffsetEntry> ObjectOffsets
        {
            get { return _objectIdOffsetIndex; }
        }

        public ObjectLocationContainer()
        {
            _objectIdOffsetIndex = new List<ObjectIdOffsetEntry>(1000);
        }

        public void SetObjectOffset(ulong objectId, ulong offset, ulong type, ulong version)
        {
            var entry = new ObjectIdOffsetEntry(objectId, offset, type, version);
            var loc = _objectIdOffsetIndex.BinarySearch(entry);
            if (loc < 0)
            {
                // doesn't exist
                _objectIdOffsetIndex.Insert(~loc, entry);
            } else
            {
                _objectIdOffsetIndex[loc] = entry;
            }
            IsModified = true;
        }

        public ulong GetObjectOffset(ulong objectId)
        {
            var testTuple = new ObjectIdOffsetEntry(objectId, 0, 0, 0);
            var loc = _objectIdOffsetIndex.BinarySearch(testTuple);
            if (loc < 0)
            {
                throw new BrightstarInternalException("No offset for object id " + objectId);
            }
            return _objectIdOffsetIndex[loc].Offset;
        }

        internal struct ObjectIdOffsetEntry : IComparable
        {
            public ulong ObjectId;
            public ulong Offset;
            public ulong Type;
            public ulong Version;

            public ObjectIdOffsetEntry(ulong objectId, ulong offset, ulong type, ulong version)
            {
                ObjectId = objectId;
                Offset = offset;
                Type = type;
                Version = version;
            }

            public int CompareTo(object obj)
            {
                var entry = (ObjectIdOffsetEntry) obj;
                return ObjectId.CompareTo(entry.ObjectId);
            }

            public override bool Equals(object obj)
            {
                var entry = (ObjectIdOffsetEntry) obj;
                return ObjectId == entry.ObjectId;
            }

            public override int GetHashCode()
            {
                return ObjectId.GetHashCode();
            }
        }

        public int Save(BinaryWriter dataStream, ulong offset = 0ul)
        {
            // write number of elements
            var count = SerializationUtils.WriteVarint(dataStream, (ulong)_objectIdOffsetIndex.Count);
            foreach (var o in _objectIdOffsetIndex)
            {
                count += SerializationUtils.WriteVarint(dataStream, o.ObjectId);
                count += SerializationUtils.WriteVarint(dataStream, o.Offset);
                count += SerializationUtils.WriteVarint(dataStream, o.Type);
                count += SerializationUtils.WriteVarint(dataStream, o.Version);
            }
            return count;
        }

        public void Read(BinaryReader dataStream)
        {
            var count = (int)SerializationUtils.ReadVarint(dataStream);
            for (int i=0;i < count; i++)
            {
                var objectId = SerializationUtils.ReadVarint(dataStream);
                var offset = SerializationUtils.ReadVarint(dataStream);
                var type = SerializationUtils.ReadVarint(dataStream);
                var version = SerializationUtils.ReadVarint(dataStream);
                var entry = new ObjectIdOffsetEntry(objectId, offset, type, version);
                _objectIdOffsetIndex.Add(entry);
            }
        }

        public void DeleteObjectOffset(ulong objectId)
        {
            var entry = new ObjectIdOffsetEntry(objectId, 0, 0, 0);
            var loc = _objectIdOffsetIndex.BinarySearch(entry);
            if (loc < 0) return;
            _objectIdOffsetIndex.RemoveAt(loc);
            IsModified = true;
        }
    }
}


text:
using BizHawk.Common;

namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
{
	public sealed class LatchedPort
	{
		public int Direction;
		public int Latch;

		public LatchedPort()
		{
			Direction = 0x00;
			Latch = 0x00;
		}

		// data works like this in these types of systems:
		//
		//  directionA  directionB  result
		//  0           0           1
		//  1           0           latchA
		//  0           1           latchB
		//  1           1           latchA && latchB
		//
		// however because this uses transistor logic, there are cases where wired-ands
		// cause the pull-up resistors not to be enough to keep the bus bit set to 1 when
		// both the direction and latch are 1 (the keyboard and joystick port 2 can do this.)
		// the class does not handle this case as it must be handled differently in every occurrence.
		public int ReadInput(int bus)
		{
			return (Latch & Direction) | ((Direction ^ 0xFF) & bus);
		}

		public int ReadOutput()
		{
			return (Latch & Direction) | (Direction ^ 0xFF);
		}

		public void SyncState(Serializer ser)
		{
			ser.Sync(nameof(Direction), ref Direction);
			ser.Sync(nameof(Latch), ref Latch);
		}
	}

	public sealed class LatchedBooleanPort
	{
		public bool Direction;
		public bool Latch;

		public LatchedBooleanPort()
		{
			Direction = false;
			Latch = false;
		}

		//  data    dir     bus     out
		//  0       0       0       0
		//  0       0       1       1

		//  0       1       0       0
		//  0       1       1       0

		//  1       0       0       0
		//  1       0       1       1

		//  1       1       0       1
		//  1       1       1       1

		public bool ReadInput(bool bus)
		{
			return (Direction && Latch) || (!Direction && bus);
		}

		public bool ReadOutput()
		{
			return Latch || !Direction;
		}

		public void SyncState(Serializer ser)
		{
			ser.Sync(nameof(Direction), ref Direction);
			ser.Sync(nameof(Latch), ref Latch);
		}
	}
}


text:
OptionIdExtension is an extension add-on for Vaadin 7 that allows you to specify
HTML DOM-level IDs for OptionGroup items. This makes it easier to target specific
options using Vaadin TestBench 3.

## Online demo

Try the add-on demo at <TODO>

## Download release

No official releases as of yet.

## Building and running demo

clone this repository

    mvn clean install
    cd demo
    mvn jetty:run

To see the demo, navigate to http://localhost:8080/

## Development with Eclipse IDE

For further development of this add-on, the following tool-chain is recommended:
 - Eclipse IDE
 - m2e wtp plug-in (install it from Eclipse Marketplace)
 - Vaadin Eclipse plug-in (install it from Eclipse Marketplace)
 - JRebel Eclipse plug-in (install it from Eclipse Marketplace)
 - Chrome browser

### Importing project

Choose File > Import... > Existing Maven Projects

Note that Eclipse may give "Plugin execution not covered by lifecycle configuration" errors for pom.xml. Use "Permanently mark goal resources in pom.xml as ignored in Eclipse build" quick-fix to mark these errors as permanently ignored in your project. Do not worry, the project still works fine.

### Debugging server-side

If you have not already compiled the widgetset, do it now by running vaadin:install Maven target for OptionIdExtension-root project.

If you have a JRebel license, it makes on the fly code changes faster. Just add JRebel nature to your OptionIdExtension-demo project by clicking project with right mouse button and choosing JRebel > Add JRebel Nature

To debug project and make code modifications on the fly in the server-side, right-click the OptionIdExtension-demo project and choose Debug As > Debug on Server. Navigate to http://localhost:8080/OptionIdExtension-demo/ to see the application.

### Debugging client-side

The most common way of debugging and making changes to the client-side code is dev-mode. To create debug configuration for it, open OptionIdExtension-demo project properties and click "Create Development Mode Launch" button on the Vaadin tab. Right-click newly added "GWT development mode for OptionIdExtension-demo.launch" and choose Debug As > Debug Configurations... Open up Classpath tab for the development mode configuration and choose User Entries. Click Advanced... and select Add Folders. Choose Java and Resources under OptionIdExtension/src/main and click ok. Now you are ready to start debugging the client-side code by clicking debug. Click Launch Default Browser button in the GWT Development Mode in the launched application. Now you can modify and breakpoints to client-side classes and see changes by reloading the web page.

Another way of debugging client-side is superdev mode. To enable it, uncomment devModeRedirectEnabled line from the end of DemoWidgetSet.gwt.xml located under OptionIdExtension-demo resources folder and compile the widgetset once by running vaadin:compile Maven target for OptionIdExtension-demo. Refresh OptionIdExtension-demo project resources by right clicking the project and choosing Refresh. Click "Create SuperDevMode Launch" button on the Vaadin tab of the OptionIdExtension-demo project properties panel to create superder mode code server launch configuration and modify the class path as instructed above. After starting the code server by running SuperDevMode launch as Java application, you can navigate to http://localhost:8080/OptionIdExtension-demo/?superdevmode. Now all code changes you do to your client side will get compiled as soon as you reload the web page. You can also access Java-sources and set breakpoints inside Chrome if you enable source maps from inspector settings.

## Release notes

### Version 1.0-SNAPSHOT
- ...
- ...

## Roadmap

This component is developed as a hobby with no public roadmap or any guarantees of upcoming releases. That said, the following features are planned for upcoming releases:
- ...
- ...

## Issue tracking

The issues for this add-on are tracked on its github.com page. All bug reports and feature requests are appreciated.

## Contributions

Contributions are welcome, but there are no guarantees that they are accepted as such. Process for contributing is the following:
- Fork this project
- Create an issue to this project about the contribution (bug or feature) if there is no such issue about it already. Try to keep the scope minimal.
- Develop and test the fix or functionality carefully. Only include minimum amount of code needed to fix the issue.
- Refer to the fixed issue in commit
- Send a pull request for the original project
- Comment on the original issue that you have implemented a fix for it

## License & Author

Add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt.

OptionIdExtension is written by Jonatan Kronqvist

# Developer Guide

## Getting started

Here is a simple example on how to try out the add-on component:

<...>

For a more comprehensive example, see src/test/java/org/vaadin/template/demo/DemoUI.java

## Features

### Feature A

<...>

### Feature B

<...>

### Feature C

<...>

## API

OptionIdExtension JavaDoc is available online at <...>


text:
.. EN-Revision: none
.. _zend.mail.adding-recipients:

Добавление получателей
======================

Получатели могут быть добавлены тремя способами:

   - ``addTo()``: Добавляет получателя в почтовое сообщение через
     заголовок "To"

   - ``addCc()``: Добавляет получателя в сообщение через заголовок "Cc"

   - ``addBcc()``: Добавляет получателя в сообщение, он не будет виден
     в заголовке

``getRecipients()`` возвращает список получателей. ``clearRecipients()`` очищает
список.

.. note::

   **Дополнительный параметр**

   ``addTo()`` и ``addCc()`` принимают второй необязательный параметр,
   который используется как имя получателя в заголовке. В этом
   параметре двойные кавычки заменяются на одинарные, а угловые
   скобки на квадратные.


text:
require 'rails_helper'

describe Alert do
  let(:article) { create(:article) }
  let(:course) { create(:course) }
  let(:revision) { create(:revision) }
  let(:user) { create(:user) }

  describe 'abstract parent class' do
    it 'raises errors for required template methods' do
      alert = Alert.new
      expect { alert.main_subject }.to raise_error(NotImplementedError)
      expect { alert.url }.to raise_error(NotImplementedError)
    end
  end

  describe 'types' do
    it 'all implement #main_subject' do
      Alert::ALERT_TYPES.each do |type|
        Alert.create(type: type,
                     article_id: article.id,
                     course_id: course.id,
                     revision_id: revision.id,
                     user_id: user.id)
        expect(Alert.last.main_subject).to be_a(String)
      end
    end

    it 'all implement #url' do
      Alert::ALERT_TYPES.each do |type|
        Alert.create(type: type,
                     article_id: article.id,
                     course_id: course.id,
                     revision_id: revision.id,
                     user_id: user.id)
        expect(Alert.last.url).to be_a(String)
      end
    end
  end
end


text:
using System.IO;

using Oxide.Core;
using Oxide.Core.Extensions;
using Oxide.Core.Plugins.Watchers;

namespace Oxide.Plugins
{
    /// <summary>
    /// The extension class that represents this extension
    /// </summary>
    public class CSharpExtension : Extension
    {
        /// <summary>
        /// Gets the name of this extension
        /// </summary>
        public override string Name => "CSharp";

        /// <summary>
        /// Gets the version of this extension
        /// </summary>
        public override VersionNumber Version => new VersionNumber(1, 0, 0);

        /// <summary>
        /// Gets the author of this extension
        /// </summary>
        public override string Author => "Oxide Team";

        public FSWatcher Watcher { get; private set; }

        // The .cs plugin loader
        private CSharpPluginLoader loader;

        /// <summary>
        /// Initializes a new instance of the CSharpExtension class
        /// </summary>
        /// <param name="manager"></param>
        public CSharpExtension(ExtensionManager manager) : base(manager)
        {
        }

        /// <summary>
        /// Loads this extension
        /// </summary>
        public override void Load()
        {
            // Register our loader
            loader = new CSharpPluginLoader(this);
            Manager.RegisterPluginLoader(loader);

            // Register engine frame callback
            Interface.Oxide.OnFrame(OnFrame);

            Cleanup.Add(Path.Combine(Interface.Oxide.RootDirectory, "mono-2.0.dll"));
            Cleanup.Add(Path.Combine(Interface.Oxide.RootDirectory, "msvcr120.dll"));
        }

        /// <summary>
        /// Loads plugin watchers used by this extension
        /// </summary>
        /// <param name="pluginDirectory"></param>
        public override void LoadPluginWatchers(string pluginDirectory)
        {
            // Register the watcher
            Watcher = new FSWatcher(pluginDirectory, "*.cs");
            Manager.RegisterPluginChangeWatcher(Watcher);
        }

        /// <summary>
        /// Called when all other extensions have been loaded
        /// </summary>
        public override void OnModLoad() => loader.OnModLoaded();

        public override void OnShutdown()
        {
            base.OnShutdown();
            loader.OnShutdown();
        }

        /// <summary>
        /// Called by engine every server frame
        /// </summary>
        private void OnFrame(float delta)
        {
            var args = new object[] { delta };
            foreach (var kv in loader.LoadedPlugins)
            {
                var plugin = kv.Value as CSharpPlugin;
                if (plugin != null && plugin.HookedOnFrame) plugin.CallHook("OnFrame", args);
            }
        }
    }
}


text:
layout: page
title: "MUSC 4103: Introduction to Student Teaching Statistics"
comments: true
description: "blanks"
keywords: "MUSC,4103,CU,Boulder"
---

#### GRADE AND WORKLOAD STATISTICS

**Percent withdrawn**: 0.0%

**Percent incomplete**: 0.0%

**Average grade** (4.0 scale): 3.59

**Standard deviation in grades** (4.0 scale): 0.27

**Average workload** (raw): 3.52

**Standard deviation in workload** (raw): 0.49

#### COURSE AND INSTRUCTOR RATINGS/INFORMATION

**Average course rating** (6 point scale): 4.87

**Standard deviation in course rating** (6 point scale): 1.01

**Average instructor rating** (6 point scale): 5.24

**Standard deviation in instructor rating** (6 point scale): 0.97

**Instructors**: Margaret Berg, Bryan David Koerner, Lisa Martin, Peter Miksza, Steven Parker, Stephanie Faith Prichard, Joshua Russell, Susan Williamson

#### GENERAL CLASS INFORMATION

**Years provided**: Fall 2006, Fall 2007, Fall 2009, Fall 2011, Fall 2012, Fall 2013, Fall 2014, Fall 2015, Fall 2016

**Credits**: 1

**RAP/Honors class?** Neither

**Number of Sections**: 9

**Department**: MUSC

**College**: College of Music

**Level**: Upper

**Activity**: LEC - Lecture


text:
This project provides a minimal common framework for servers using the Bifrost (BAPS3) protocol.

**NOTE: This is not yet suitable for production use!**

## Usage

Launching a TCP Bifrost server that responds to `read` and `quit`:

```go
import (                                                                                "github.com/UniversityRadioYork/baps3-go"
        "github.com/UniversityRadioYork/bifrost-server/request"
        "github.com/UniversityRadioYork/bifrost-server/tcpserver"
)

func main() {
        // ...

        tcpserver.Serve(request.Map{
                baps3.RqRead: func(b, r chan<- *baps3.Message, s []string) (bool, error) { return handleRead(b, r, t, s) },
                baps3.RqQuit: func(_, _ chan<- *baps3.Message, _ []string) (bool, error) { return true, nil },
        }, "server-name 0.1", "localhost:1234")
}
```

Better usage instructions to come later.

## Licence

MIT licence; see `LICENSE`.

## Contribution

All pull requests welcome.  Please use `go fmt`.


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/asset/v1/asset_service.proto

namespace Google\Cloud\Asset\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy].
 *
 * Generated from protobuf message google.cloud.asset.v1.AnalyzeIamPolicyResponse
 */
class AnalyzeIamPolicyResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The main analysis that matches the original request.
     *
     * Generated from protobuf field .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis main_analysis = 1;
     */
    private $main_analysis = null;
    /**
     * The service account impersonation analysis if
     * [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is
     * enabled.
     *
     * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis service_account_impersonation_analysis = 2;
     */
    private $service_account_impersonation_analysis;
    /**
     * Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and
     * [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to
     * answer the query in the request.
     *
     * Generated from protobuf field bool fully_explored = 3;
     */
    private $fully_explored = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis $main_analysis
     *           The main analysis that matches the original request.
     *     @type array<\Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis>|\Google\Protobuf\Internal\RepeatedField $service_account_impersonation_analysis
     *           The service account impersonation analysis if
     *           [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is
     *           enabled.
     *     @type bool $fully_explored
     *           Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and
     *           [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to
     *           answer the query in the request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce();
        parent::__construct($data);
    }

    /**
     * The main analysis that matches the original request.
     *
     * Generated from protobuf field .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis main_analysis = 1;
     * @return \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis|null
     */
    public function getMainAnalysis()
    {
        return $this->main_analysis;
    }

    public function hasMainAnalysis()
    {
        return isset($this->main_analysis);
    }

    public function clearMainAnalysis()
    {
        unset($this->main_analysis);
    }

    /**
     * The main analysis that matches the original request.
     *
     * Generated from protobuf field .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis main_analysis = 1;
     * @param \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis $var
     * @return $this
     */
    public function setMainAnalysis($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis::class);
        $this->main_analysis = $var;

        return $this;
    }

    /**
     * The service account impersonation analysis if
     * [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is
     * enabled.
     *
     * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis service_account_impersonation_analysis = 2;
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getServiceAccountImpersonationAnalysis()
    {
        return $this->service_account_impersonation_analysis;
    }

    /**
     * The service account impersonation analysis if
     * [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is
     * enabled.
     *
     * Generated from protobuf field repeated .google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis service_account_impersonation_analysis = 2;
     * @param array<\Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setServiceAccountImpersonationAnalysis($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\AnalyzeIamPolicyResponse\IamPolicyAnalysis::class);
        $this->service_account_impersonation_analysis = $arr;

        return $this;
    }

    /**
     * Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and
     * [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to
     * answer the query in the request.
     *
     * Generated from protobuf field bool fully_explored = 3;
     * @return bool
     */
    public function getFullyExplored()
    {
        return $this->fully_explored;
    }

    /**
     * Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and
     * [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to
     * answer the query in the request.
     *
     * Generated from protobuf field bool fully_explored = 3;
     * @param bool $var
     * @return $this
     */
    public function setFullyExplored($var)
    {
        GPBUtil::checkBool($var);
        $this->fully_explored = $var;

        return $this;
    }

}


text:
package aws

import (
	"log"
	"regexp"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/iam"
)

// diffTags takes our tags locally and the ones remotely and returns
// the set of tags that must be created, and the set of tags that must
// be destroyed.
func diffTagsIAM(oldTags, newTags []*iam.Tag) ([]*iam.Tag, []*iam.Tag) {
	// First, we're creating everything we have
	create := make(map[string]interface{})
	for _, t := range newTags {
		create[aws.StringValue(t.Key)] = aws.StringValue(t.Value)
	}

	// Build the list of what to remove
	var remove []*iam.Tag
	for _, t := range oldTags {
		old, ok := create[aws.StringValue(t.Key)]
		if !ok || old != aws.StringValue(t.Value) {
			// Delete it!
			remove = append(remove, t)
		} else if ok {
			delete(create, aws.StringValue(t.Key))
		}
	}

	return tagsFromMapIAM(create), remove
}

// tagsFromMapIAM returns the tags for the given map of data for IAM.
func tagsFromMapIAM(m map[string]interface{}) []*iam.Tag {
	result := make([]*iam.Tag, 0, len(m))
	for k, v := range m {
		t := &iam.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredIAM(t) {
			result = append(result, t)
		}
	}

	return result
}

// tagsToMapIAM turns the list of IAM tags into a map.
func tagsToMapIAM(ts []*iam.Tag) map[string]string {
	result := make(map[string]string)
	for _, t := range ts {
		if !tagIgnoredIAM(t) {
			result[aws.StringValue(t.Key)] = aws.StringValue(t.Value)
		}
	}

	return result
}

// compare a tag against a list of strings and checks if it should
// be ignored or not
func tagIgnoredIAM(t *iam.Tag) bool {
	filter := []string{"^aws:"}
	for _, v := range filter {
		log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key)
		if r, _ := regexp.MatchString(v, *t.Key); r == true {
			log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value)
			return true
		}
	}
	return false
}

// tagKeysIam returns the keys for the list of IAM tags
func tagKeysIam(ts []*iam.Tag) []*string {
	result := make([]*string, 0, len(ts))
	for _, t := range ts {
		result = append(result, t.Key)
	}
	return result
}


text:
package names.unprotectednames;

import dataObjects.Name;
import dataObjects.UnprotectedName;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by Vasia on 11/01/2015.
 */
public interface AccountUnprotectedNamesService {
    List<Name> getUnprotectedNames(int accountId) throws SQLException, InstantiationException, IllegalAccessException;
    UnprotectedName createUnprotectedName(UnprotectedName unprotectedName) throws SQLException, InstantiationException, IllegalAccessException;
}


text:
layout: page
weight: 0
title: SendGrid for New Relic
group: partners
navigation:
  show: true
seo:
  title:  SendGrid for New Relic
---

Access your email statistics via the New Relic Dashboard.

![]({{root_url}}/images/new_relic.png)

In less than 5 minutes your statistics should be sent to your New Relic Dashboard. We send statistics to New Relic every 5 minutes for users with the setting enabled.

* * * * *

## 	Settings

Settings may be changed through:

-   [SendGrid UI](https://app.sendgrid.com/settings/partners) (on an account wide basis)

If you would like get your statistics in the New Relic Dashboard, you need to provide us your New Relic license key.

This can be found by accessing the SendGrid's Plugin page on New Relic or from the Account Settings Page.

![]({{root_url}}/images/newrelic-settings.png)

In the New Relic settings you can enable the statistics for your subusers.

<call-out type="warning">

You will receive statistics only for 100 subusers

</call-out>

After you have entered your settings and saved them, enable the app.

* * * * *

## 	New Relic Dashboard

Go on New Relic site and there you will find the SendGrid extension on the left menu. After clicking on 'SendGrid' extension, a SendGrid instance will be displayed and if you activated the subuser options beneath the statistics of the primary account will be the statistics for subusers.

![]({{root_url}}/images/newrelic-dashboard1.png)

Click on one of the instances and there you will see the statistics in 3 categories: Deliveries, Engagement, and Compliance. Also on the right side you can see metrics in percentages.

![]({{root_url}}/images/newrelic-dashboard2.png)


text:
$packageName = 'csvfileview'
$url = 'http://www.nirsoft.net/utils/csvfileview.zip'
$checksum = 'c7df082a21c8975a1b4799b06eb0005524962271'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"

Install-ChocolateyZipPackage -PackageName "$packageName" `
                             -Url "$url" `
                             -UnzipLocation "$toolsDir" `
                             -Checksum "$checksum" `
                             -ChecksumType "$checksumType"

Set-Content -Path ("$installFile.gui") `
            -Value $null


text:
class DestinyDevice
	def self.test
		puts "Test OK"
	end
	def self.new_connection(api_key, oauth_access_token=nil)
		Connection.new(api_key, oauth_access_token)
	end
end

require 'destiny_device/connection'


text:
#ifndef M2M_CONNECTION_HANDLER_H__
#define M2M_CONNECTION_HANDLER_H__

#include "mbed-client/m2mconnectionobserver.h"
#include "mbed-client/m2mconfig.h"
#include "mbed-client/m2minterface.h"
#include "nsdl-c/sn_nsdl.h"

class M2MConnectionSecurity;
class M2MConnectionHandlerPimpl;

/**
 * \brief M2MConnectionHandler.
 * This class handles the socket connection for the LWM2M Client.
 */

class M2MConnectionHandler {
public:

    /**
     * @enum ConnectionError
     * This enum defines an error that can come from
     * socket read and write operation.
     */
    typedef enum {
        CONNECTION_ERROR_WANTS_READ = -1000,
        CONNECTION_ERROR_WANTS_WRITE = -1001,
        ERROR_NONE = 0,
        SSL_CONNECTION_ERROR,
        SOCKET_READ_ERROR,
        SOCKET_SEND_ERROR,
        SOCKET_ABORT,
        DNS_RESOLVING_ERROR,
        SSL_HANDSHAKE_ERROR
    }ConnectionError;

public:

    /**
    * \brief Constructor
    */
    M2MConnectionHandler(M2MConnectionObserver &observer,
                         M2MConnectionSecurity* sec,
                         M2MInterface::BindingMode mode,
                         M2MInterface::NetworkStack stack);

    /**
    * \brief Destructor
    */
    ~M2MConnectionHandler();

    /**
    * \brief This binds the socket connection.
    * \param listen_port Port to be listened to for an incoming connection.
    * \return True if successful, else false.
    */
    bool bind_connection(const uint16_t listen_port);

    /**
    * \brief This resolves the server address. Output is
    * returned through a callback.
    * \param String The server address.
    * \param uint16_t The server port.
    * \param ServerType The server type to be resolved.
    * \param security The M2MSecurity object that determines which
    * type of secure connection will be used by the socket.
    * \return True if address is valid, else false.
    */
    bool resolve_server_address(const String& server_address,
                                const uint16_t server_port,
                                M2MConnectionObserver::ServerType server_type,
                                const M2MSecurity* security);

    /**
    * \brief Sends data to the connected server.
    * \param data_ptr The data to be sent.
    * \param data_len The length of data to be sent.
    * \param address_ptr The address structure to which the data needs to be sent.
    * \return True if data is sent successfully, else false.
    */
    bool send_data(uint8_t *data_ptr,
                           uint16_t data_len,
                           sn_nsdl_addr_s *address_ptr);

    /**
    * \brief Listens to the incoming data from a remote server.
    * \return True if successful, else false.
    */
    bool start_listening_for_data();

    /**
    * \brief Stops listening to the incoming data.
    */
    void stop_listening();

    /**
     * \brief Sends directly to the socket. This is used by
     * security classes to send the data after it has been encrypted.
     * \param buf Buffer to send.
     * \param len The length of the buffer.
     * \return Number of bytes sent or -1 if failed.
     */
    int send_to_socket(const unsigned char *buf, size_t len);

    /**
     * \brief Receives directly from the socket. This
     * is used by the security classes to receive raw data to be decrypted.
     * \param buf Buffer to send.
     * \param len The length of the buffer.
     * \return Number of bytes read or -1 if failed.
     */
    int receive_from_socket(unsigned char *buf, size_t len);

    /**
    * \brief Closes the open connection.
    */
    void close_connection();

    /**
    * \brief Error handling for DTLS connectivity.
    * \param error Error code from the TLS library.
    */
    void handle_connection_error(int error);

    /**
     * \brief Sets the network interface handler that is used by client to connect
     * to a network over IP..
     * \param handler A network interface handler that is used by client to connect.
     *  This API is optional but provides a mechanism for different platforms to
     * manage usage of underlying network interface by client.
     */
    void set_platform_network_handler(void *handler = NULL);

    /**
    * \brief Claims mutex to prevent thread clashes
    * in multithreaded environment.
    */
    void claim_mutex();

    /**
    * \brief Releases mutex to prevent thread clashes
    * in multithreaded environment.
    */
    void release_mutex();

private:

    M2MConnectionObserver                       &_observer;
    M2MConnectionHandlerPimpl                   *_private_impl;

friend class Test_M2MConnectionHandler;
friend class Test_M2MConnectionHandler_mbed;
friend class Test_M2MConnectionHandler_linux;
friend class M2MConnection_TestObserver;
};

#endif //M2M_CONNECTION_HANDLER_H__


text:
from gpio import GPIO
import time

pin = GPIO("P8_12")
pin.pinMode("OUT")

while True:
	pin.digitalWrite("HIGH")
	time.sleep(5)
	pin.digitalWrite("LOW")
	time.sleep(5)


text:
drop database if exists practise;

create database practise;

use practise;

grant select, insert, update, delete on practise.* to 'lzg'@'localhost' identified by '123456';

create table users (
    `id` bigint(50) not null auto_increment,
    `email` varchar(50) not null,
    `passwd` varchar(50) not null,
    `admin` bool not null,
    `name` varchar(50) not null,
    `image` varchar(500) not null default '',
    `created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP,
    unique key `idx_email` (`email`),
    key `idx_created_at` (`created_at`),
    primary key (`id`)
) engine=innodb default charset=utf8;

create table blogs (
    `id` bigint(50) not null auto_increment,
    `user_id` varchar(50) not null,
    `user_name` varchar(50) not null,
    `user_image` varchar(500) not null default '',
    `name` varchar(50) not null,
    `summary` varchar(200) not null,
    `content` mediumtext not null,
    `created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP,
    key `idx_created_at` (`created_at`),
    primary key (`id`)
) engine=innodb default charset=utf8;

create table comments (
    `id` bigint(50) not null auto_increment,
    `blog_id` varchar(50) not null,
    `user_id` varchar(50) not null,
    `user_name` varchar(50) not null,
    `user_image` varchar(500) not null default '',
    `content` mediumtext not null,
    `created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP,
    key `idx_created_at` (`created_at`),
    primary key (`id`)
) engine=innodb default charset=utf8;


text:
package org.jboss.resteasy.test.nextgen.wadl.resources.form;

import org.jboss.resteasy.annotations.Form;

import javax.ws.rs.POST;
import javax.ws.rs.Path;

/**
 * @author Weinan Li
 */
@Path("/form")
public class FormResource {

    @Path("/foo")
    @POST
    public String foo(@Form FooForm foo) {
        return foo.getFoo() + foo.getBar();
    }

    @Path("/list")
    @POST
    public String list(@Form ListForm list) {
        return list.getFooForms().toString();
    }
}


text:
ALTER TABLE accounts ALTER COLUMN plan SET NOT NULL;
ALTER TABLE accounts ALTER COLUMN plan SET DEFAULT 'free';

-- +goose Down
ALTER TABLE accounts ALTER COLUMN plan DROP DEFAULT;
ALTER TABLE accounts ALTER COLUMN plan DROP NOT NULL;


text:
namespace Planex.Web.Tests.Services
{
    using System.Data.Entity;
    using System.Linq;

    using NUnit.Framework;

    using Planex.Data.Models;
    using Planex.Services.Skills;

    [TestFixture]
    public class SkillServiceTest
    {
        private ISkillService skills;

        [OneTimeSetUp]
        public void Init()
        {
            this.skills = new SkillService(new DbContext("test"), new RepositoryMock<Skill, int>());
        }

        [Test]
        public void AddSkillsShouldWorkProperly()
        {
            this.skills.Add(new Skill());
            Assert.AreEqual(1, this.skills.GetAll().Count());

            this.skills.Add(new Skill());
            Assert.AreEqual(2, this.skills.GetAll().Count());
        }

        [Test]
        public void DeleteSkillsShouldWorkProperly()
        {
            this.skills.Delete(0);
            Assert.AreEqual(1, this.skills.GetAll().Count());
        }
    }
}


text:
package com.highsens.game;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

public class PlayersData {
	private static JSONArray playersArray = new JSONArray();
	private static String projectDirectory = System.getProperty("user.dir");
	private static String separator = System.getProperty("file.separator");
	private static PlayersData instance = null;
	private static JSONParser parser = new JSONParser();

	protected PlayersData(){
		try{
			playersArray = (JSONArray)parser.parse(new FileReader(projectDirectory + separator
		            + "players.json"));
		} catch (Exception e){
			e.printStackTrace();
		}
	}

	public static PlayersData getInstance(){
		if(instance == null){
			instance = new PlayersData();
	    }
		return instance;
	}

	public static JSONArray getPlayerArray(){
		return playersArray;
	}

	public void setPlayerArray(JSONArray ja){
		playersArray = ja;
	}

	public static void addCurrentPlayerToJSON(){
		JSONObject playerJSONObj = new JSONObject();
		playerJSONObj.put("gameCash", CurrentPlayer.getGameCash());
		playerJSONObj.put("name", CurrentPlayer.getName());
		playersArray.add(playerJSONObj);
		savePlayers();
	}

	public static void savePlayers(){
		try {
			FileWriter file = new FileWriter(projectDirectory + separator
		            + "players.json");
			file.write(playersArray.toJSONString());
			file.flush();
			file.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static boolean isRegistered(String name){
		for(int i = 0; i < playersArray.size(); i++){
			if(name.compareTo(((JSONObject)playersArray.get(i)).get("name").toString())==0){
				return true;
			}
		}
		return false;
	}
}


text:
import React from 'react';
// Get the Formatic component.
import Formatic from 'formatic';

// Create some fields.
const fields = [
  {
    type: 'single-line-string',
    key: 'firstName',
    label: 'First Name',
  },
  {
    type: 'single-line-string',
    key: 'lastName',
    label: 'Last Name',
  },
];

class App extends React.Component {
  state = { firstName: 'Joe', lastName: 'Foo' };

  onChange = newValue => {
    this.setState(newValue);
  };

  render() {
    return (
      <Formatic fields={fields} onChange={this.onChange} value={this.state} />
    );
  }
}

React.render(<App />, document.getElementById('some-element'));


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

<title>Server Load Estimation</title>

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

<link href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css">

<link rel="stylesheet" href="css/style.css" />

        The following text describes the current configuration in JSON format.

        Copy and save it so you can import it later.

        <textarea id="dialog-export-textarea" style="width:100%;height:190px">
        </textarea>

        Paste your configuration file in the following text area

        <textarea id="dialog-import-textarea" style="width:100%;height:190px">
        </textarea>

Server Load Estimator

            Helping you estimate your server requirements

            Created by M.H.Serans

            Source code available on GitHub

            Distributed under the GPLv3 license

Configuration

Report

Help

                Export
                Import

Demographic Data

            Add Population

Website Statistics

            Visit Duration (minutes):<input type="text" name="avd" id="avd" />
            Pages per visit:<input type="text" name="ppv" id="ppv" />
            Hits per page:<input type="text" name="hpp" id="hpp" />

Web Servers

            Number of Web Servers:
            <input type="text" name="nservers" id="nservers" />

            <input type="checkbox" name="useCDN" id="useCDN" onChange="javascript:$('#cdn_setup').toggle('fast');" />
            Use CDN

                Requests served by:

Web Servers 0%

CDN 0%

Databse Server

            Queries per Page:<input type="text" name="qpp" id="qpp" />

Notes

            <textarea id="notes" style="height:3em;width:100%"></textarea>

            Generate Report

                        Concurrent Users
                        Page Views
                        Server Hits
                        DB Queries

                        Peak
                        -
                        -
                        -
                        -

                        Min
                        -
                        -
                        -
                        -

                        Daily
                        -
                        -
                        -
                        -

                        Monthly
                        -
                        -
                        -
                        -

            back

Configuration

Report

FAQs


text:
[Kafka Connect](http://kafka.apache.org/documentation.html#connect) is a system for moving data into and out of Kafka. All Debezium connectors adhere to the Kafka Connector API for _source connectors_, and each monitors a specific kind of database management system for changing data, and then forwards those changes directly into Kafka topics organized by server, database, and table. This image defines a runnable Kafka Connect service preconfigured with all Debezium connectors. The service has a RESTful API for managing connector instances -- simply start up a container, configure a connector for each data source you want to monitor, and let Debezium monitor those sources for changes and forward them to the appropriate Kafka topics.

# What is Debezium?

Debezium is a distributed platform that turns your existing databases into event streams, so applications can quickly react to each row-level change in the databases. Debezium is built on top of Kafka and provides Kafka Connect compatible connectors that monitor specific database management systems. Debezium records the history of data changes in Kafka logs, so your application can be stopped and restarted at any time and can easily consume all of the events it missed while it was not running, ensuring that all events are processed correctly and completely.

Running Debezium involves Zookeeper, Kafka, and services that run Debezium's connectors. For simple evaluation and experimentation, all services can all be run on a single host machine, using the recipe outlined below. Production environments, however, require properly running and networking multiple instances of each service to provide the performance, reliability, replication, and fault tolerance. This can be done with a platform like [OpenShift](https://www.openshift.com) that manages multiple Docker containers running on multiple hosts and machines. But running Kafka in a Docker container has limitations, so for scenarios where very high throughput is required, you should run Kafka on dedicated hardware as explained in the [Kafka documentation](http://kafka.apache.org/documentation.html).

# How to use this image

This image can be used in several different ways. All require an already-running Zookeeper service, which is either running locally via the container named `zookeeper` or with OpenShift running as a service named `zookeeper`. Also required are already-running Kafka brokers, which are either running locally via the container named `kafka` or with OpenShift running as a service named `kafka`.

## Start a Kafka Connect service instance

When running a cluster of one or more Kafka Connect service instances, several important parameters must be defined using environment variables. Please see the section below for the list of these required environment variables and acceptable values.

Starting an instance of Kafka Connect using this image is simple:

    $ docker run -it --name connect -p 8083:8083 -e GROUP_ID=1 -e CONFIG_STORAGE_TOPIC=my-connect-configs -e OFFSET_STORAGE_TOPIC=my-connect-offsets -e ADVERTISED_HOST_NAME=$(echo $DOCKER_HOST | cut -f3  -d'/' | cut -f1 -d':') --link zookeeper:zookeeper --link kafka:kafka debezium/connect

This command uses this image and starts a new container named `connect`, which runs in the foreground and attaches the console so that it display the service's output and error messages. It exposes its REST API on port 8083, which is mapped to the same port number on the local host. It uses Zookeeper in the container (or service) named `zookeeper` and Kafka brokers in the container (or service) named `kafka`. This command sets the three required environment variables, though you should replace their values with more meaningful values for your environment.

To start the container in _detached_ mode, simply replace the `-it` option with `-d`. No service output will not be sent to your console, but it can be read at any time using the `docker logs` command. For example, the following command will display the output and keep following the output:

    $ docker logs --follow --name connect

## Start a shell in a running container

If you are already running a container with a Kafka Connect service, you can use this image to connect to that container and obtain a command line shell:

    $ docker exec -it connect bash

where `connect` is the name of your existing container. The shell will be set up with all environment variables exactly like when starting the service in the container. Therefore, links to other containers and additional environment variables may be specified and will be reflected in the shell's exported variables.

# Environment variables

The Debezium Kafka image uses several environment variables when running a Kafka broker using this image.
Please also see [the documentation](http://kafka.apache.org/documentation/#connect_running) of Kafka Connect to learn more about the specific settings.

### `GROUP_ID`

This environment variable is required when running the Kafka Connect service. Set this to an ID that uniquely identifies the Kafka Connect cluster the service and its workers belong to.

### `CONFIG_STORAGE_TOPIC`

This environment variable is required when running the Kafka Connect service. Set this to the name of the Kafka topic where the Kafka Connect services in the group store connector configurations. The topic must have a single partition and be highly replicated (e.g., 3x or more).

### `OFFSET_STORAGE_TOPIC`

This environment variable is required when running the Kafka Connect service. Set this to the name of the Kafka topic where the Kafka Connect services in the group store connector offsets. The topic must have a large number of partitions (e.g., 25 or 50), be highly replicated (e.g., 3x or more) and should be configured for compaction.

### `BOOTSTRAP_SERVERS`

This environment variable is an advanced setting, used only when Kafka is not running in a linkable container or service. Set this to a list of host/port pairs to use for establishing the *initial* connection to the Kafka cluster. Once a connection is established to one of these brokers, the service will then discover and make use of all Kafka brokers in the cluster, regardless of which servers are specified here for bootstrapping. The list should be in the form `host1:port1,host2:port2,...`. We recommend that you include more than one broker in this list, in case one of those is down.

### `HOST_NAME`

This environment variable is an advanced setting. Set this to the hostname that the the REST API will bind to. Defaults to the hostname of the container.

### `ADVERTISED_HOST_NAME`

This environment variable is an advanced setting. Set this to the hostname that will be given out to other workers to connect with. Defaults to the hostname of the container.

### `ADVERTISED_PORT`

This environment variable is an advanced setting. Set this to the port that will be given out to other workers to connect with.

### `KEY_CONVERTER`

This environment variable is an advanced setting. Set this to the fully-qualified name of the Java class that implements Kafka Connect's `Converter` class, used to convert the connector's keys to the form stored in Kafka. Defaults to `org.apache.kafka.connect.json.JsonConverter`.

### `VALUE_CONVERTER`

This environment variable is an advanced setting. Set this to the fully-qualified name of the Java class that implements Kafka Connect's `Converter` class, used to convert the connector's values to the form stored in Kafka. Defaults to `org.apache.kafka.connect.json.JsonConverter`.

### `INTERNAL_KEY_CONVERTER`

This environment variable is an advanced setting. Set this to the fully-qualified name of the Java class that implements Kafka Connect's `Converter` class, used to convert the connector offset and configuration keys to the form stored in Kafka. Defaults to `org.apache.kafka.connect.json.JsonConverter`.

### `INTERNAL_VALUE_CONVERTER`

This environment variable is an advanced setting. Set this to the fully-qualified name of the Java class that implements Kafka Connect's `Converter` class, used to convert the connector offset and configuration values to the form stored in Kafka. Defaults to `org.apache.kafka.connect.json.JsonConverter`.

### `OFFSET_FLUSH_INTERVAL_MS`

This environment variable is an advanced setting. Set this to the number of milliseconds defining the interval at which the service will periodically try committing offsets for tasks. The default is `60000`, or 60 seconds.

### `OFFSET_FLUSH_TIMEOUT_MS`

This environment variable is an advanced setting. Set this to the maximum time in milliseconds to wait for records to flush and partition offset data to be committed to offset storage before cancelling the process and restoring the offset data to be committed in a future attempt. The default is `5000`, or 5 seconds.

### `SHUTDOWN_TIMEOUT`

This environment variable is an advanced setting. Set this to the number of milliseconds to wait for tasks to shutdown gracefully while the connectors complete all processing, record any final data, and clean up resources. This is the total amount of time, not per task. All task have shutdown triggered, then they are waited on sequentially. The default is `10000`, or 10 seconds.

### `HEAP_OPTS`

This environment variable is recommended. Use this to set the JVM options for the Kafka broker. By default a value of '-Xmx1G -Xms1G' is used, meaning that each Kafka broker uses 1GB of memory. Using too little memory may cause performance problems, while using too much may prevent the broker from starting properly given the memory available on the machine. Obviously the container must be able to use the amount of memory defined by this environment variable.

### `LOG_LEVEL`

This environment variable is optional. Use this to set the level of detail for Kafka's application log written to STDOUT and STDERR. Valid values are `INFO` (default), `WARN`, `ERROR`, `DEBUG`, or `TRACE`."

### `ENABLE_APICURIO_CONVERTERS`

This environment variable is optional. Use this to enable [Apicur.io](https://www.apicur.io/) converters with
Apicurio Schema Registry by setting `ENABLE_APICURIO_CONVERTERS=true` as container env var. Valid values are `false` to disable (default) or `true` to enable Apicurio converters.

### `ENABLE_DEBEZIUM_SCRIPTING`

This environment variable is optional.
Use this to enable Debezium features that use scripting languages like Message Filtering or Content-based Routing SMT by setting `ENABLE_DEBEZIUM_SCRIPTING=true` as container env var.
Valid values are `false` to disable (default) or `true` to enable scripting.

### Others

Environment variables that start with `CONNECT_` will be used to update the Kafka Connect worker configuration file. Each environment variable name will be mapped to a configuration property name by:

1. removing the `CONNECT_` prefix;
2. lowercasing all characters; and
3. converting all '_' characters to '.' characters

For example, the environment variable `CONNECT_HEARTBEAT_INTERVAL_MS` is converted to the `heartbeat.interval.ms` property. The container will then update the Kafka Connect worker configuration file to include the property's name and value.

The value of the environment variable may not contain a '\@' character.

# Ports

Containers created using this image will expose port 8083, which is the standard port bound to by the Kafka Connect service.  You can use standard Docker options to map this to a different port on the host that runs the container.

# Storing data

The Kafka Connect service run by this image stores no data in the container, but it does produce logs. The only way to keep these files is to use volumes that map specific directories inside the container to the local file system (or to OpenShift persistent volumes).

### Log files

Although this image will send Kafka Connect service log output to standard output so it is visible as Docker logs, this image also configures the Kafka Connect service to write out more logs to a data volume at `/kafka/logs`. All logs are rotated daily.

### Configuration

This image defines a data volume at `/kafka/config` where the broker's configuration files are stored. Note that these configuration files are always modified based upon the environment variables and linked containers. The best use of this data volume is to be able to see the configuration files used by Kafka, although with some care it is possible to supply custom configuration files that will be adapted and used upon startup.

# Oracle Connector

If you want to use the Oracle connector it is necessary to add dependencies that are not part of the image due to licensing restrictions. In this case you should create a new image derived from this one and bake-in Oracle Instant Client JAR files.

The files in question are available as [oracle Instant Client for Linux](http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html). Please follow [an example](https://github.com/debezium/debezium-examples/blob/main/tutorial/debezium-with-oracle-jdbc/Dockerfile) so see how the resulting image should be structured.


text:
function fetchRoutingTree
%
% Routines for pulling the routing tree info from the mote network.  This
% sets up a timer to periodically poll the network for new data.
%


text:
package test.org.apache.spark.sql.sources.v2;

import java.io.IOException;
import java.util.List;

import org.apache.spark.sql.catalyst.expressions.UnsafeRow;
import org.apache.spark.sql.sources.v2.DataSourceV2;
import org.apache.spark.sql.sources.v2.DataSourceV2Options;
import org.apache.spark.sql.sources.v2.ReadSupport;
import org.apache.spark.sql.sources.v2.reader.*;
import org.apache.spark.sql.types.StructType;

public class JavaUnsafeRowDataSourceV2 implements DataSourceV2, ReadSupport {

  class Reader implements DataSourceV2Reader, SupportsScanUnsafeRow {
    private final StructType schema = new StructType().add("i", "int").add("j", "int");

    @Override
    public StructType readSchema() {
      return schema;
    }

    @Override
    public List<ReadTask<UnsafeRow>> createUnsafeRowReadTasks() {
      return java.util.Arrays.asList(
        new JavaUnsafeRowReadTask(0, 5),
        new JavaUnsafeRowReadTask(5, 10));
    }
  }

  static class JavaUnsafeRowReadTask implements ReadTask<UnsafeRow>, DataReader<UnsafeRow> {
    private int start;
    private int end;
    private UnsafeRow row;

    JavaUnsafeRowReadTask(int start, int end) {
      this.start = start;
      this.end = end;
      this.row = new UnsafeRow(2);
      row.pointTo(new byte[8 * 3], 8 * 3);
    }

    @Override
    public DataReader<UnsafeRow> createReader() {
      return new JavaUnsafeRowReadTask(start - 1, end);
    }

    @Override
    public boolean next() {
      start += 1;
      return start < end;
    }

    @Override
    public UnsafeRow get() {
      row.setInt(0, start);
      row.setInt(1, -start);
      return row;
    }

    @Override
    public void close() throws IOException {

    }
  }

  @Override
  public DataSourceV2Reader createReader(DataSourceV2Options options) {
    return new Reader();
  }
}


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

<title>C-Index</title>
<meta name="date" content="2016-11-27">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I L M N P Q R S T U V W

C

camera - Variable in class game.MainGame

camera - Variable in class game.MenuScreens.GameOverMenu

camera - Variable in class game.MenuScreens.MainMenu

camera - Variable in class game.MenuScreens.PauseMenu

checkCollisions() - Method in class game.MainGame

All collisions are placed here

checkGameOver() - Method in class game.MainGame

Check if Player has lost by loosing all Player.life.

checkGamePause() - Method in class game.MainGame

Check if game entered pause MainGame.gameState by user pressing escape key.

checkGameState() - Method in class game.MainGame

All game state checks are located here

checkGameWon() - Method in class game.MainGame

Check if Player has won by collecting 999990 points.

collided() - Method in class game.FireBall

Returns if fireball has collided with something.

collision - Variable in class game.FireBall

create() - Method in class game.BlueSky

Analogue to instantiation.

createUi() - Method in class game.MenuScreens.GameOverMenu

Loads all the assets for the menu and sets their position in the game world.

createUi() - Method in class game.MenuScreens.MainMenu

Loads all the assets for the menu and sets their position in the game world.

createUi() - Method in class game.MenuScreens.PauseMenu

Loads all the assets for the menu and sets their position in the game world.

A B C D E F G H I L M N P Q R S T U V W

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
@interface SearchViewController : UIViewController<UISearchBarDelegate>

@end


text:
#include <aws/AWSMigrationHub/model/CreateProgressUpdateStreamResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::MigrationHub::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

CreateProgressUpdateStreamResult::CreateProgressUpdateStreamResult()
{
}

CreateProgressUpdateStreamResult::CreateProgressUpdateStreamResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

CreateProgressUpdateStreamResult& CreateProgressUpdateStreamResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  AWS_UNREFERENCED_PARAM(result);

  return *this;
}


text:
<component name="libraryTable">
  <library name="SBT: org.hamcrest:hamcrest-core:1.3:jar">
    <CLASSES>
      <root url="jar://${symbol_dollar}USER_HOME${symbol_dollar}/.ivy2/cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.3.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://${symbol_dollar}USER_HOME${symbol_dollar}/.ivy2/cache/org.hamcrest/hamcrest-core/docs/hamcrest-core-1.3-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://${symbol_dollar}USER_HOME${symbol_dollar}/.ivy2/cache/org.hamcrest/hamcrest-core/srcs/hamcrest-core-1.3-sources.jar!/" />
    </SOURCES>
  </library>
</component>