text:
package com.imkrisna.samsung.nservice;

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

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import android.app.Application;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.util.Log;

/**
 *

 * This class is the main process for {@link com.imkrisna.samsung.nservice} library for android. NSConnection maintain the
 * discovery, connection, and communication protocol with N-Service capable devices. Since the N-Service connection should
 * be only one instance in an android application, This class instance should be implemented in a Singleton pattern
 * or inside the android {@link Application} context.
 *

 *

 * NSConnection class instance will notify all registered {@link NSListener} instance when any N-Service events occurred such as
 * device discovery found, connected/disconnected events, and messaging events. {@link NSListener} instance need to implements
 * abstract/unimplemented methods and registering itself to the NSConnection instance to be able to receive notification
 * from NSConnection.
 *

 *
 * @author I Made Krisna Widhiastra (im.krisna@gmail.com)
 *
 * @version 1.0.1
 *
 * */
public class NSConnection {

	public static final String DEBUG_TAG			= "NSConnection";
	public static final int MAX_LOST_CONN			= 10;

	public static final int CONN_EXCEPTION			= -1;
	public static final int CONN_SUCCESS			= 200;
	public static final int CONN_FAILED_NOT_RUNNING	= 404;
	public static final int CONN_FAILED_CONN_EXIST	= 409;
	public static final int CONN_FAILED_TIMEOUT		= 408;

	public static final int NSERVICE_CONNECT 		= 1000;
	public static final int NSERVICE_DISCONNECT		= 1001;
	public static final int NSERVICE_MESSAGE_SEND	= 2000;
	public static final int NSERVICE_MESSAGE_POLLER	= 2001;

	private Context			context;
	private WifiManager		wifiManager;
	private NSDiscovery		discovery;

	private List<NSListener> 	listener;
	private List<NSDevice>		devices;

	private String appId;
	private String tvAddress;
	private String tvName;

	private boolean connected;
	private int		lostCount;

	/**
	 *
public NSConnection(String applicationId, Context context)

	 *

	 * Constructor for NSConnection class. Since the N-Service connection should
	 * be only one instance in an android application, This class instance should be implemented in a
	 * Singleton pattern or inside the android {@link Application} context.
	 *

	 *

	 * {@code
	 * NSConnection connection = new NSConnection("1234567890", getApplicationContext());
	 * NSConnection connection = new NSConnection("NServiceTest", getApplicationContext());
	 * }
	 *

	 *
	 * @param applicationId - Smart Application Project Name (development) or Samsung Seller Apps ID (operating)
	 * @param context - android {@link Context}. Suggested to use application context when using single instance pattern
	 *
	 * @since 1.0.0
	 *
	 * */
	public NSConnection(String applicationId, Context context) {
		this.context	= context;
		this.appId 		= applicationId;
		this.connected	= false;
		this.lostCount	= 0;

		this.listener 	= new ArrayList<NSListener>();
		this.devices	= new ArrayList<NSDevice>();

		this.discovery		= new NSDiscovery(this);
		this.wifiManager	= (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE);
	}

	/**
	 *
public void searchDevices()

	 *

	 * Commanding the NSConnection instance to perform UPnP SSDP device search for N-Service capable devices. This method
	 * require {@link NSDiscovery} class and {@link org.cybergarage.upnp} library.
	 *

	 *

	 * The search process will be asynchronous and when the N-Serivce capable device found, NSConnection will notify
	 * all {@link NSListener} on the  onDeviceChanged method.
	 *

	 *
	 * @since 1.0.0
	 *
	 * */
	public void searchDevices(){
		if (!this.isWifiConnected()){
			Log.w(NSConnection.DEBUG_TAG + ".searchDevices", "Aborting Search: Wireless Network Not Connected");
			return;
		}

		Thread explorer = new Thread(new NSRunnable(this) {

			@Override
			public void run() {
				long randomId = Math.round(Math.random() * 1000);
				try{
					Log.d(NSConnection.DEBUG_TAG + ".searchDevices", "Explorer #" + String.valueOf(randomId) + " Started!");

					this.executor.clearDevices();
					this.executor.discovery.search();
				}
				catch (Exception e){
					Log.e(NSConnection.DEBUG_TAG + ".searchDevices", "Explorer #" + String.valueOf(randomId) + " Error: " + e.getMessage());
				}
			}
		});
		explorer.setPriority(Thread.MIN_PRIORITY);
		explorer.start();
	}

	/**
	 *
public void startPoller()

	 *

	 * This method will initiate connection polling with paired {@link NSDevice}. Connection polling will maintain
	 * connectivity between android and N-Service device so then the connection will kept alive.
	 *

	 *

	 * This method should not be called by external instance to prevent current connection crashed. If it is needed
	 * to be called by external instance, the {@link NSConnection} instance must be not connected to any device and
	 * the poller process already finished.
	 *

	 *
	 * @since 1.0.0
	 *
	 * */
	public void startPoller(){
		Thread poller = new Thread(new NSRunnable(this) {

			@Override
			public void run() {
				String requestUrl 	= NSConnection.buildRequestUrl(this.executor, NSConnection.NSERVICE_MESSAGE_POLLER);
				HttpClient client	= NSConnection.createHttpClient();
				HttpGet request		= new HttpGet(requestUrl);
				request.setHeader("SLDeviceID", this.executor.getAndroidDeviceId());

				while (this.executor.isConnected()){
					try{
						HttpResponse response 	= client.execute(request);
						int responseCode		= response.getStatusLine().getStatusCode();
						String responsePhrase	= response.getStatusLine().getReasonPhrase();

						Log.d(NSConnection.DEBUG_TAG + ".connect", "Poller From: " + this.executor.getTvAddress());
						Log.d(NSConnection.DEBUG_TAG + ".connect", "-- Poller URL: " + request.getURI().toString());
						Log.d(NSConnection.DEBUG_TAG + ".connect", "-- Response: " + responsePhrase + " (" + String.valueOf(responseCode) + ")");

						switch (responseCode){
							case 200:
								this.executor.setLostCount(0);
								this.executor.notifyMessageReceived(EntityUtils.toString(response.getEntity()));
								break;
							case 408:
								this.executor.setLostCount(0);
								break;
							default:
								this.executor.setLostCount(this.executor.getLostCount() + 1);
								if (this.executor.getLostCount() > NSConnection.MAX_LOST_CONN){
									this.executor.stopPoller();
									this.executor.notifyDisconnected();
								}
								break;
						}
						response.getEntity().consumeContent();
					}
					catch (ClientProtocolException e){
						Log.e(NSConnection.DEBUG_TAG + ".poller", "ClientProtocolException: " + e.getMessage());
					}
					catch (IOException e){
						Log.e(NSConnection.DEBUG_TAG + ".poller", "IOException: " + e.getMessage());
					}
				}
			}
		});
		poller.setPriority(Thread.MIN_PRIORITY);
		poller.start();
	}

	/**
	 *
public void stopPoller()

	 *

	 * This method is used to stop current connection poller. Stopping connection poller will causing message from N-Service
	 * devices cannot be retrieved by {@link NSConnection} and after several seconds, the N-Service device will close the
	 * connection with android device. Closed connection will causing any messaging from and to N-Service device will failed.
	 *

	 *

	 * This method should not be called by external instance, consider using disconnect method to close the connection
	 * cleanly. The disconnect method also will stop the connection poller automatically.
	 *

	 *
	 * @since 1.0.0
	 *
	 * */
	public void stopPoller(){
		this.setConnected(false);
	}

	/**
	 *
public void connect({@link NSDevice} device)

	 *

	 * Attempt connection to N-Service device. The connection is required to perform another {@link NSConnection} method
	 * such as messaging and disconnecting.
	 *

	 *
	 * @since 1.0.1
	 *
	 * */
	public void connect(NSDevice device){
		this.tvName = device.getName();
		this.connect(device.getIP());
	}

	/**
	 *
public void connect(String tvAddres)

	 *

	 * Attempt connection to N-Service device. The connection is required to perform another {@link NSConnection} method
	 * such as messaging and disconnecting.
	 *

	 *
Note:
Connecting using this method did not store TV Device Name,
	 * use connect({@link NSDevice} device) method instead.
	 *

	 *
	 * @param tvAddress - IPv4 Address of N-Service Device
	 *
	 * @since 1.0.0
	 *
	 * */
	public void connect(String tvAddress){
		if (!this.isWifiConnected()) {
			Log.w(NSConnection.DEBUG_TAG + ".connect", "Aborting Connect: Wireless Network Not Connected");
			return;
		}

		this.setTvAddress(tvAddress);
		Thread connector = new Thread(new NSRunnable(this) {

			@Override
			public void run() {
				String requestUrl 	= NSConnection.buildRequestUrl(this.executor, NSConnection.NSERVICE_CONNECT);
				HttpClient client	= NSConnection.createHttpClient();
				HttpPost request	= new HttpPost(requestUrl);
				request.setHeader("SLDeviceID", this.executor.getAndroidDeviceId());
				request.setHeader("DeviceName", this.executor.getAndroidDeviceName());
				request.setHeader("VendorID",	"SEINPSTV");
				request.setHeader("ProductID",	"SMARTAnd");

				try{
					HttpResponse response 	= client.execute(request);
					int responseCode		= response.getStatusLine().getStatusCode();
					String responsePhrase	= response.getStatusLine().getReasonPhrase();

					Log.d(NSConnection.DEBUG_TAG + ".connect", "Connecting to: " + this.executor.getTvAddress());
					Log.d(NSConnection.DEBUG_TAG + ".connect", "-- Connect URL: " + request.getURI().toString());
					Log.d(NSConnection.DEBUG_TAG + ".connect", "-- Response: " + responsePhrase + " (" + String.valueOf(responseCode) + ")");

					switch (responseCode){
						case NSConnection.CONN_SUCCESS:
							this.executor.setConnected(true);
							this.executor.setLostCount(0);
							this.executor.startPoller();
							this.executor.notifyConnected();
							break;
						default:
							this.executor.setConnected(false);
							this.executor.notifyConnectionFailed(responseCode);
							break;
					}
					response.getEntity().consumeContent();
				}
				catch (ClientProtocolException e){
					Log.e(NSConnection.DEBUG_TAG + ".connect", "ClientProtocolException: " + e.getMessage());
					this.executor.notifyConnectionFailed(NSConnection.CONN_EXCEPTION);
				}
				catch (IOException e){
					Log.e(NSConnection.DEBUG_TAG + ".connect", "IOException: " + e.getMessage());
					this.executor.notifyConnectionFailed(NSConnection.CONN_EXCEPTION);
				}
			}
		});
		connector.setPriority(Thread.NORM_PRIORITY);
		connector.start();
	}

	/**
	 *
public void disconnect()

	 *

	 * Disconnecting the current connection with N-Service device. This method should be called only when there is a
	 * connected N-Service device.
	 *

	 *
	 * @since 1.0.0
	 *
	 * */
	public void disconnect(){
		if (!this.isConnected()) {
			Log.w(NSConnection.DEBUG_TAG + ".disconnect", "Aborting Disconnect: Wireless Network Not Connected");
			return;
		}

		this.stopPoller();
		Thread disconnector = new Thread(new NSRunnable(this) {

			@Override
			public void run() {
				String requestUrl 	= NSConnection.buildRequestUrl(this.executor, NSConnection.NSERVICE_DISCONNECT);
				HttpClient client	= NSConnection.createHttpClient();
				HttpPost request	= new HttpPost(requestUrl);
				request.setHeader("SLDeviceID", this.executor.getAndroidDeviceId());

				try{
					HttpResponse response 	= client.execute(request);
					int responseCode		= response.getStatusLine().getStatusCode();
					String responsePhrase	= response.getStatusLine().getReasonPhrase();

					Log.d(NSConnection.DEBUG_TAG + ".disconnect", "Disconnecting from: " + this.executor.getTvAddress());
					Log.d(NSConnection.DEBUG_TAG + ".disconnect", "-- Disconnect URL: " + request.getURI().toString());
					Log.d(NSConnection.DEBUG_TAG + ".disconnect", "-- Response: " + responsePhrase + " (" + String.valueOf(responseCode) + ")");

					if (responseCode == 200){
						this.executor.setLostCount(0);
						this.executor.setConnected(false);
						this.executor.notifyDisconnected();
					}
					response.getEntity().consumeContent();
				}
				catch (ClientProtocolException e){
					Log.e(NSConnection.DEBUG_TAG + ".disconnect", "ClientProtocolException: " + e.getMessage());
				}
				catch (IOException e){
					Log.e(NSConnection.DEBUG_TAG + ".disconnect", "IOException: " + e.getMessage());
				}
			}
		});
		disconnector.setPriority(Thread.MIN_PRIORITY);
		disconnector.start();
	}

	/**
	 *
public void sendMessage(Object object)

	 *

	 * Serialize the Java object to String using {@link Gson} library and send the message to N-Service device. This
	 * method require {@link Gson} library to works. The connection should be established before calling this function.
	 *

	 *
	 * @param object - Object to be serialized to JSON String using {@link Gson} library
	 *
	 * @since 1.0.0
	 *
	 * */
	public void sendMessage(Object object){
		Gson gson = new GsonBuilder().serializeNulls().create();
		this.sendMessage(gson.toJson(object));
	}

	/**
	 *
public void sendMessage(String message)

	 *

	 * Sending String message to N-Service device. The connection should be established before calling this function.
	 *

	 *
	 * @param message - String to be sent to N-Service device
	 *
	 * @since 1.0.0
	 *
	 * */
	public void sendMessage(final String message){
		if (!this.isConnected()) {
			Log.w(NSConnection.DEBUG_TAG + ".sendMessage", "Aborting Send Message: Wireless Network Not Connected");
			return;
		}

		Thread messager = new Thread(new NSRunnable(this) {

			@Override
			public void run() {
				String requestUrl 	= NSConnection.buildRequestUrl(this.executor, NSConnection.NSERVICE_MESSAGE_SEND);
				HttpClient client	= NSConnection.createHttpClient();
				HttpPost request	= new HttpPost(requestUrl);
				request.setHeader("SLDeviceID", this.executor.getAndroidDeviceId());

				try{
					request.setEntity(new StringEntity(message));

					HttpResponse response 	= client.execute(request);
					int responseCode		= response.getStatusLine().getStatusCode();
					String responsePhrase	= response.getStatusLine().getReasonPhrase();

					Log.d(NSConnection.DEBUG_TAG + ".sendMessage", "Sending Message To: " + this.executor.getTvAddress());
					Log.d(NSConnection.DEBUG_TAG + ".sendMessage", "-- Sending Message URL: " + request.getURI().toString());
					Log.d(NSConnection.DEBUG_TAG + ".sendMessage", "-- Response: " + responsePhrase + " (" + String.valueOf(responseCode) + ")");

					if (responseCode == 200){
						this.executor.notifyMessageSent();
					}
					else{
						this.executor.notifyMessageSendFailed(responseCode);
					}

					response.getEntity().consumeContent();
				}
				catch (UnsupportedEncodingException e){
					Log.e(NSConnection.DEBUG_TAG + ".sendMessage", "UnsupportedEncodingException: " + e.getMessage());
					this.executor.notifyMessageSendFailed(NSConnection.CONN_EXCEPTION);
				}
				catch (ClientProtocolException e){
					Log.e(NSConnection.DEBUG_TAG + ".sendMessage", "ClientProtocolException: " + e.getMessage());
					this.executor.notifyMessageSendFailed(NSConnection.CONN_EXCEPTION);
				}
				catch (IOException e){
					Log.e(NSConnection.DEBUG_TAG + ".sendMessage", "IOException: " + e.getMessage());
					this.executor.notifyMessageSendFailed(NSConnection.CONN_EXCEPTION);
				}
			}
		});
		messager.setPriority(Thread.MIN_PRIORITY);
		messager.start();
	}

	/**
	 *
public String getAppId()

	 *
	 * @return application id of N-Service Application
	 *
	 * @since 1.0.0
	 *
	 * */
	public String getAppId(){
		return this.appId;
	}

	/**
	 *
public void setTvAddress(String tvAddress)

	 *
	 * @param tvAddress - IPv4 Address of N-Service Device
	 *
	 * @since 1.0.0
	 *
	 * */
	public void setTvAddress(String tvAddress){
		this.tvAddress = tvAddress;
	}

	/**
	 *
public String getTvAddress()

	 *
	 * @return N-Service Device IPv4 Address
	 *
	 * @since 1.0.0
	 *
	 * */
	public String getTvAddress(){
		return this.tvAddress;
	}

	/**
	 *
public String getTvName()

	 *
	 * @return TV Device Friendly Name
	 *
	 * @since 1.0.1
	 *
	 * */
	public String getTvName(){
		return this.tvName;
	}

	/**
	 *
public boolean isWifiConnected()

	 *
	 * @return true - android wifi connected
false - android wifi disconnected/invalid
	 *
	 * @since 1.0.0
	 *
	 * */
	public boolean isWifiConnected(){
		String ssid = this.wifiManager.getConnectionInfo().getSSID();
		if (ssid == null || ssid.contains("unknown") || ssid.isEmpty() || ssid.equals("0x")) return false;
		else return true;
	}

	/**
	 *
public String getWifiSSID()

	 *
	 * Retrieving currently connected Wireless Network SSID, This method may returning:
	 * [null, "*unknown*", "0x", etc] when Android is in Invalid Wireless Connection state.
	 *
	 * @return Connected Wireless Network SSID
	 *
	 * @since 1.0.1
	 *
	 * */
	public String getWifiSSID(){
		return this.wifiManager.getConnectionInfo().getSSID();
	}

	/**
	 *
public String getAndroidDeviceId()

	 *
	 * @return Device ID for N-Service framework identifier based on android wireless card MAC Address
	 *
	 * @since 1.0.0
	 *
	 * */
	public String getAndroidDeviceId(){
		if (this.isWifiConnected()){
			return this.wifiManager.getConnectionInfo().getMacAddress().replace(":", "");
		}
		else{
			return null;
		}
	}

	/**
	 *
public String getAndroidDeviceName()

	 *
	 * @return Android Device Friendly Name / Device Model (ex: GT-I9300)
	 *
	 * @since 1.0.0
	 *
	 * */
	public String getAndroidDeviceName(){
		return android.os.Build.MODEL;
	}

	/**
	 *
public boolean isConnected()

	 *
	 * @return true - NSConnection connected with N-Service Device
false - Not Connected
	 *
	 * @since 1.0.0
	 *
	 * */
	public boolean isConnected() {
		return connected;
	}

	public void setConnected(boolean connected) {
		this.connected = connected;
	}

	public int getLostCount() {
		return lostCount;
	}

	public void setLostCount(int lostCount) {
		this.lostCount = lostCount;
	}

	/**
	 *
public void clearDevices()

	 *

	 * Clear all found {@link NSDevice} in the networks.
	 *

	 *
	 * @since 1.0.0
	 *
	 * */
	public void clearDevices(){
		this.devices.clear();
	}

	public void addDevice(NSDevice device){
		this.devices.add(device);
		this.notifyDeviceChanged();
	}

	/**
	 *
public void setSingleListener({@link NSListener} listener)

	 *

	 * Remove all other listeners and made specified listener as single events listener for NSConnection.
	 *

	 *
	 * @param listener - Single listener for NSConnection events
	 *
	 * @since 1.0.0
	 *
	 * */
	public void setSingleListener(NSListener listener){
		this.listener.clear();
		this.listener.add(listener);
	}

	/**
	 *
public void registerListener({@link NSListener} listener)

	 *

	 * Registering new listener that subscribe to NSConnection events. All listener registered will receive same events
	 * from NSConnection.
	 *

	 *
	 * @param listener - new listener subscribed to NSConnection events.
	 *
	 * @since 1.0.0
	 *
	 * */
	public void registerListener(NSListener listener){
		this.listener.add(listener);
	}

	/**
	 *
public void deleteListener({@link NSListener} listener)

	 *
	 * @param listener - listener to be unsubsribed from events
	 *
	 * @since 1.0.0
	 *
	 * */
	public void deleteListener(NSListener listener){
		this.deleteListener(listener.getTag());
	}

	public void deleteListener(String tag){
		NSListener temp = this.getListener(tag);
		if (temp != null){
			this.listener.remove(temp);
		}
	}

	public boolean isListening(NSListener listener){
		return this.isListening(listener.getTag());
	}

	public boolean isListening(String tag){
		if (this.getListener(tag) == null) return false;
		else return true;
	}

	private NSListener getListener(String tag){
		for (NSListener i : this.listener){
			if (i.getTag().equals(tag)){
				return i;
			}
		}
		return null;
	}

	private void notifyDeviceChanged(){
		for (NSListener listener : this.listener){
			listener.onDeviceChanged(this.devices);
		}
	}

	private void notifyConnected(){
		for (NSListener listener : this.listener){
			listener.onConnected();
		}
	}

	private void notifyConnectionFailed(int code){
		for (NSListener listener : this.listener){
			listener.onConnectionFailed(code);
		}
	}

	private void notifyDisconnected(){
		for (NSListener listener : this.listener){
			listener.onDisconnected();
		}
	}

	private void notifyMessageSent(){
		for (NSListener listener : this.listener){
			listener.onMessageSent();
		}
	}

	private void notifyMessageSendFailed(int code){
		for (NSListener listener : this.listener){
			listener.onMessageSendFailed(code);
		}
	}

	private void notifyMessageReceived(String message){
		for (NSListener listener : this.listener){
			listener.onMessageReceived(message);
		}
	}

	public void notifyWifiChange(){
		for (NSListener listener : this.listener){
			listener.onWifiChanged();
		}
	}

	public void dispose(){
		this.discovery.dispose();
	}

	public static String buildRequestUrl(NSConnection connection, int requestType){
		return NSConnection.buildRequestUrl(connection.getTvAddress(), connection.getAppId(), requestType, connection.getAndroidDeviceId());
	}

	public static String buildRequestUrl(String tvIpAddress, String appId, int requestType, String deviceId){
		String baseUrl = "http://" + tvIpAddress + "/ws/app/" + appId;

		switch (requestType){
			case NSConnection.NSERVICE_CONNECT:
				baseUrl += "/connect";
				break;
			case NSConnection.NSERVICE_DISCONNECT:
				baseUrl += "/disconnect";
				break;
			case NSConnection.NSERVICE_MESSAGE_SEND:
				baseUrl += "/queue";
				break;
			case NSConnection.NSERVICE_MESSAGE_POLLER:
				baseUrl += "/queue/device/" + deviceId;
				break;
			default:
				baseUrl = null;
				break;
		}

		return baseUrl;
	}

	public static DefaultHttpClient createHttpClient(){
		return new DefaultHttpClient(null, new DefaultHttpClient().getParams());
	}

	abstract class NSRunnable implements Runnable {

		protected NSConnection executor;

		public NSRunnable(NSConnection executor){
			this.executor = executor;
		}
	}
}


text:
<html>
<script>
document.write(new Date().getTime());
</script>
</html>

redpajama_set_name: RedPajamaGithub


text:
package backupschedulecontroller

import (
	"k8s.io/apimachinery/pkg/runtime/schema"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/handler"
	"sigs.k8s.io/controller-runtime/pkg/manager"
	"sigs.k8s.io/controller-runtime/pkg/source"

	commonctl "github.com/GoogleCloudPlatform/elcarro-oracle-operator/common/controllers"
	v1alpha1 "github.com/GoogleCloudPlatform/elcarro-oracle-operator/oracle/api/v1alpha1"
	"github.com/GoogleCloudPlatform/elcarro-oracle-operator/oracle/controllers/cronanythingcontroller"
)

var backupKind = schema.GroupVersion{Group: "oracle.db.anthosapis.com", Version: "v1alpha1"}.WithKind("Backup")

type BackupScheduleReconciler struct {
	*commonctl.BackupScheduleReconciler
}

// +kubebuilder:rbac:groups=oracle.db.anthosapis.com,resources=backupschedules,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=oracle.db.anthosapis.com,resources=backupschedules/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=oracle.db.anthosapis.com,resources=cronanythings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=oracle.db.anthosapis.com,resources=backups,verbs=list;delete

// NewBackupScheduleReconciler returns a BackupScheduleReconciler object.
func NewBackupScheduleReconciler(mgr manager.Manager, realBackupScheduleControl *RealBackupScheduleControl, realCronAnythingControl *cronanythingcontroller.RealCronAnythingControl, realBackupControl *RealBackupControl) *BackupScheduleReconciler {
	b := commonctl.NewBackupScheduleReconciler(mgr, realBackupScheduleControl, realCronAnythingControl, realBackupControl)

	return &BackupScheduleReconciler{
		BackupScheduleReconciler: b,
	}
}

// SetupWithManager configures the reconciler.
func (r *BackupScheduleReconciler) SetupWithManager(mgr ctrl.Manager) error {
	return ctrl.NewControllerManagedBy(mgr).
		For(&v1alpha1.BackupSchedule{}).
		Watches(&source.Kind{Type: &v1alpha1.CronAnything{}},
			&handler.EnqueueRequestForOwner{OwnerType: &v1alpha1.BackupSchedule{}, IsController: true}).
		Complete(r)
}


text:
__author__ = 'yangtianhang'
import types

def behavior(state, event):
    def _behavior(method):
        method.__fsm_state__ = state
        method.__fsm_event__ = event
        return method

    return _behavior

def stateful(init_state, ext_states=None):
    if init_state is None:
        raise FsmException('init state cannot be None.')
    if ext_states is None:
        ext_states = []

    def _stateful(cls):
        def _init_valid_states(cls, init_state, ext_states):
            cls.__valid_states__ = set()
            cls.__valid_states__.add(init_state)
            if hasattr(ext_states, '__iter__'):
                for ext_state in ext_states:
                    cls.__valid_states__.add(ext_state)
            else:
                cls.__valid_states__.add(ext_states)

        def _set_behaviors(cls, behavior):
            states = _get_iterable_attr_(behavior, '__fsm_state__')
            events = _get_iterable_attr_(behavior, '__fsm_event__')

            if states and events:
                _set_explicit_behaviors(cls, states, events, behavior)
            elif states and not events:
                _set_states_default_behaviors(cls, states, behavior)
            elif not states and events:
                _set_events_default_behaviors(cls, events, behavior)
            else:
                _set_default_behaviors(cls, behavior)

        def _set_explicit_behaviors(cls, states, events, explicit_behavior):
            for state in states:
                cls.__valid_states__.add(state)
                if state not in cls.__explicit_behaviors__:
                    cls.__explicit_behaviors__[state] = dict()
                _add_event(cls.__explicit_behaviors__[state], events, explicit_behavior)

        def _set_states_default_behaviors(cls, states, states_default_behavior):
            for state in states:
                cls.__valid_states__.add(state)
                if state in cls.__states_default_behaviors__:
                    raise FsmException('duplicate state(' + str(state) + ') default behavior)')
                else:
                    cls.__states_default_behaviors__[state] = states_default_behavior

        def _set_events_default_behaviors(cls, events, events_default_behavior):
            for event in events:
                if event in cls.__events_default_behaviors__:
                    raise FsmException('duplicate event(' + str(event) + ') default behavior)')
                else:
                    cls.__events_default_behaviors__[event] = events_default_behavior

        def _set_default_behaviors(cls, default_behavior):
            if cls.__default_behavior__ is None:
                cls.__default_behavior__ = default_behavior
            else:
                raise FsmException('duplicate default behavior')

        def _add_event(state, events, behavior):
            for event in events:
                if event in state:
                    raise FsmException('duplicate event(' + event + ') of state(' + state + ')')
                state[event] = behavior

        def _get_iterable_attr_(behavior, item):
            attr = getattr(behavior, item)
            if attr is None:
                return None
            if not hasattr(attr, '__iter__'):
                attr = [attr]
            return attr

        def _switch(self, state):
            _check_state(state)
            self.__state__ = state

        def _state(self):
            return self.__state__

        def _event(self):
            return self.__event__

        def _check_state(state):
            if state not in cls.__valid_states__:
                if state:
                    raise FsmException('invalid state: ' + str(state))
                else:
                    raise FsmException('invalid state: None')

        def _get_behavior(self, cls, event):
            state_behaviors = cls.__explicit_behaviors__.get(self.__state__, None)
            if state_behaviors:
                behavior = state_behaviors.get(event, None)
                if behavior:
                    return behavior

            behavior = cls.__states_default_behaviors__.get(self.__state__, None)
            if behavior:
                return behavior

            behavior = cls.__events_default_behaviors__.get(event, None)
            if behavior:
                return behavior

            return cls.__default_behavior__

        def _handle(self, event, *args, **kwargs):
            self.__event__ = event
            behavior = _get_behavior(self, cls, event)
            if not behavior:
                raise FsmException("there's no behavior to handle event(" + str(event) + ") of state(" + str(self.__state__) + ")")
            return behavior(self, *args, **kwargs)

        cls.__explicit_behaviors__ = dict()
        cls.__states_default_behaviors__ = dict()
        cls.__events_default_behaviors__ = dict()
        cls.__default_behavior__ = None

        _init_valid_states(cls, init_state, ext_states)
        behaviors = [behavior for behavior in cls.__dict__.values() if isinstance(behavior, types.FunctionType) and '__fsm_state__' in dir(behavior)]
        for behavior in behaviors:
            _set_behaviors(cls, behavior)

        _check_state(init_state)

        cls.__state__ = init_state
        cls.switch = _switch
        cls.state = _state
        cls.handle = _handle
        cls.event = _event

        return cls

    return _stateful

class FsmException(Exception):
    def __init__(self, message):
        super(FsmException, self).__init__(message)


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Boost.Locale: boost::locale::generic_codecvt< CharType, CodecvtImpl, CharSize > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Boost.Locale

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Examples

Class List

Class Hierarchy

Class Members

boost::locale::generic_codecvt< CharType, CodecvtImpl, CharSize > Class Template Reference

Geneneric generic codecvt facet, various stateless encodings to UTF-16 and UTF-32 using wchar_t, char32_t and char16_t.
 More...

#include <boost/locale/generic_codecvt.hpp>

Detailed Description

template<typename CharType, typename CodecvtImpl, int CharSize = sizeof(CharType)>

class boost::locale::generic_codecvt< CharType, CodecvtImpl, CharSize >

Geneneric generic codecvt facet, various stateless encodings to UTF-16 and UTF-32 using wchar_t, char32_t and char16_t.

Implementations should dervide from this class defining itself as CodecvtImpl and provide following members

state_type - a type of special object that allows to store intermediate cached data, for example iconv_t descriptor

state_type initial_state(generic_codecvt_base::initial_convertion_state direction) const - member function that creates initial state

int max_encoding_length() const - a maximal length that one Unicode code point is represented, for UTF-8 for example it is 4 from ISO-8859-1 it is 1

utf::code_point to_unicode(state_type &state,char const *&begin,char const *end) - extract first code point from the text in range [begin,end), in case of success begin would point to the next character sequence to be encoded to next code point, in case of incomplete sequence - utf::incomplete shell be returned, and in case of invalid input sequence utf::illegal shell be returned and begin would remain unmodified

utf::code_point from_unicode(state_type &state,utf::code_point u,char *begin,char const *end) - convert a unicode code point u into a character seqnece at [begin,end). Return the length of the sequence in case of success, utf::incomplete in case of not enough room to encode the code point of utf::illegal in case conversion can not be performed

For example implementaion of codecvt for latin1/ISO-8859-1 character set

template<typename CharType>

class latin1_codecvt :boost::locale::generic_codecvt<CharType,latin1_codecvt<CharType> >

{

public:

    /* Standard codecvt constructor */

    latin1_codecvt(size_t refs = 0) : boost::locale::generic_codecvt<CharType,latin1_codecvt<CharType> >(refs)

    {

    }

    /* State is unused but required by generic_codecvt */

    struct state_type {};

    state_type initial_state(generic_codecvt_base::initial_convertion_state /*unused*/) const

    {

        return state_type();

    }

    int max_encoding_length() const

    {

        return 1;

    }

    boost::locale::utf::code_point to_unicode(state_type &,char const *&begin,char const *end) const

    {

       if(begin == end)

          return boost::locale::utf::incomplete;

       return *begin++;

    }

    boost::locale::utf::code_point from_unicode(state_type &,boost::locale::utf::code_point u,char *begin,char const *end) const

    {

       if(u >= 256)

          return boost::locale::utf::illegal;

       if(begin == end)

          return boost::locale::utf::incomplete;

       *begin = u;

       return 1;

    }

};

When external tools used for encoding conversion, the state_type is useful to save objects used for conversions. For example, icu::UConverter can be saved in such a state for an efficient use:

template<typename CharType>

class icu_codecvt :boost::locale::generic_codecvt<CharType,icu_codecvt<CharType> >

{

public:

    /* Standard codecvt constructor */

    icu_codecvt(std::string const &name,refs = 0) :

        boost::locale::generic_codecvt<CharType,latin1_codecvt<CharType> >(refs)

    { ... }

    /* State is unused but required by generic_codecvt */

    struct std::unique_ptr<UConverter,void (*)(UConverter*)> state_type;

    state_type &&initial_state(generic_codecvt_base::initial_convertion_state /*unused*/) const

    {

        UErrorCode err = U_ZERO_ERROR;

        state_type ptr(ucnv_safeClone(converter_,0,0,&err,ucnv_close);

        return std::move(ptr);

    }

    boost::locale::utf::code_point to_unicode(state_type &ptr,char const *&begin,char const *end) const

    {

        UErrorCode err = U_ZERO_ERROR;

        boost::locale::utf::code_point cp = ucnv_getNextUChar(ptr.get(),&begin,end,&err);

        ...

    }

    ...

};

The documentation for this class was generated from the following file:

boost/locale/generic_codecvt.hpp

© Copyright 2009-2012 Artyom Beilis,  Distributed under the Boost Software License, Version 1.0.


text:
class Gitmine::CLI
  def self.run
    case ARGV[0]
    when "log"
      list
    when "branch", "br"
      branch
    when "checkout", "co"
      checkout
    when "delete", "del"
      delete
    when "for_deploy", "reviewed"
      reviewed
    when "open"
      open
    when "status"
      status
    else
      puts <<-EOS
Usage:
gitmine branch BRANCH_NAME
  Create a new branch, push to origin, add github links to gitmine ticket
  Example: gitmine branch 1234-my-branch

gitmine checkout ISSUE_ID
  Checkout remote/local branch starting with ISSUE_ID
  Example: gitmine checkout 1234

gitmine reviewed ISSUE_ID
  Merge the branch to master, delete remote branch, update redmine issue status
  Example: gitmine reviewed 1234

gitmine delete ISSUE_ID
  Delete remote branch starting with ISSUE_ID
  Example: gitmine delete 1234

gitmine status
  Show status of the current branch's issue

gitmine open
  Open current branch's issue in web browser

gitmine log
  Displays latest 10 commits and the status of their associated Redmine tickets
EOS
    end
  end

  def self.list
    Gitmine.list
  end

  def self.branch
    Gitmine.branch(ARGV[1])
  end

  def self.checkout
    Gitmine.checkout(ARGV[1])
  end

  def self.delete
    Gitmine.delete(ARGV[1])
  end

  def self.reviewed
    Gitmine.reviewed(ARGV[1])
  end

  def self.open
    Gitmine.open
  end

  def self.status
    Gitmine.status
  end
end


text:
<meta charset="UTF-8">
<title>AutoAdapters.addEnumClass - biomedicus-uima</title>
<link rel="stylesheet" href="../../../style.css">

biomedicus-uima / edu.umn.biomedicus.uima.labels / AutoAdapters / addEnumClass

addEnumClass

fun addEnumClass(clazz: Class<*>): Unit


text:
namespace caffe2 {
namespace db {

class ProtoDBCursor : public Cursor {
 public:
  explicit ProtoDBCursor(const TensorProtos* proto)
    : proto_(proto), iter_(0) {}
  ~ProtoDBCursor() {}

  void Seek(const string& str) override {
    CAFFE_THROW("ProtoDB is not designed to support seeking.");
  }

  void SeekToFirst() override { iter_ = 0; }
  void Next() override { ++iter_; }
  string key() override { return proto_->protos(iter_).name(); }
  string value() override { return proto_->protos(iter_).SerializeAsString(); }
  bool Valid() override { return iter_ < proto_->protos_size(); }

 private:
  const TensorProtos* proto_;
  int iter_;
};

class ProtoDBTransaction : public Transaction {
 public:
  explicit ProtoDBTransaction(TensorProtos* proto)
      : proto_(proto), existing_names_() {
    for (const auto& tensor : proto_->protos()) {
      existing_names_.insert(tensor.name());
    }
  }
  ~ProtoDBTransaction() { Commit(); }
  void Put(const string& key, const string& value) override {
    if (existing_names_.count(key)) {
      CAFFE_THROW("An item with key ", key, " already exists.");
    }
    auto* tensor = proto_->add_protos();
    CAFFE_ENFORCE(
        tensor->ParseFromString(value),
        "Cannot parse content from the value string.");
    CAFFE_ENFORCE(
        tensor->name() == key,
        "Passed in key ",
        key,
        " does not equal to the tensor name ",
        tensor->name());
  }
  // Commit does nothing. The protocol buffer will be written at destruction
  // of ProtoDB.
  void Commit() override {}

 private:
  TensorProtos* proto_;
  std::unordered_set<string> existing_names_;

  DISABLE_COPY_AND_ASSIGN(ProtoDBTransaction);
};

class ProtoDB : public DB {
 public:
  ProtoDB(const string& source, Mode mode)
      : DB(source, mode), proto_(), source_(source) {
    if (mode == READ || mode == WRITE) {
      // Read the current protobuffer.
      CAFFE_ENFORCE(
          ReadProtoFromFile(source, &proto_), "Cannot read protobuffer.");
    }
    LOG(INFO) << "Opened protodb " << source;
  }
  ~ProtoDB() { Close(); }

  void Close() override {
    if (mode_ == NEW || mode_ == WRITE) {
      WriteProtoToBinaryFile(proto_, source_);
    }
  }

  unique_ptr<Cursor> NewCursor() override {
    return make_unique<ProtoDBCursor>(&proto_);
  }
  unique_ptr<Transaction> NewTransaction() override {
    return make_unique<ProtoDBTransaction>(&proto_);
  }

 private:
  TensorProtos proto_;
  string source_;
};

REGISTER_CAFFE2_DB(ProtoDB, ProtoDB);
// For lazy-minded, one can also call with lower-case name.
REGISTER_CAFFE2_DB(protodb, ProtoDB);

}  // namespace db
}  // namespace caffe2


text:
package example.node.messages.extension;

import core.message.MessagePayload;
import example.node.modules.TypeModule;
import example.node.utils.NodeConstants;

/**
 * Created by siberis on 11/9/2016.
 */
public class ExtensionNotAllowedForType extends MessagePayload {
    private String id;

    public ExtensionNotAllowedForType() {
    }

    public ExtensionNotAllowedForType(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    @Override
    public String getComputeTopic() {
        return NodeConstants.NODE_TOPIC;
    }

    @Override
    public Long getTypeId() {
        return TypeModule.EXTENSION_NOT_ALLOWED;
    }
}


text:
class Parent {
public:
  void DoSomething() { return; };
  int i;
};

class Child : public Parent {
public:
};

class User {
public:
  void DoAnyThing(void (Parent::*)(void)) { return; }
  void DoAThing(void (Child::*)(void)) { return; }
  void DoAThing(int Child::*) { return; }
};

int main()
{
  User a;

  a.DoAnyThing(&Child::DoSomething);
  a.DoAThing(&Child::DoSomething);
  a.DoAThing(&Parent::DoSomething);
  a.DoAThing(&Parent::i);
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/retail/v2/search_service.proto

namespace Google\Cloud\Retail\V2\SearchRequest\BoostSpec;

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

/**
 * Boost applies to products which match a condition.
 *
 * Generated from protobuf message google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec
 */
class ConditionBoostSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * An expression which specifies a boost condition. The syntax and
     * supported fields are the same as a filter expression. See
     * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
     * detail syntax and limitations.
     * Examples:
     * * To boost products with product ID "product_1" or "product_2", and
     * color
     *   "Red" or "Blue":
     *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
     *     ANY("Red","Blue"))
     *
     * Generated from protobuf field string condition = 1;
     */
    private $condition = '';
    /**
     * Strength of the condition boost, which should be in [-1, 1]. Negative
     * boost means demotion. Default is 0.0.
     * Setting to 1.0 gives the item a big promotion. However, it does not
     * necessarily mean that the boosted item will be the top result at all
     * times, nor that other items will be excluded. Results could still be
     * shown even when none of them matches the condition. And results that
     * are significantly more relevant to the search query can still trump
     * your heavily favored but irrelevant items.
     * Setting to -1.0 gives the item a big demotion. However, results that
     * are deeply relevant might still be shown. The item will have an
     * upstream battle to get a fairly high ranking, but it is not blocked out
     * completely.
     * Setting to 0.0 means no boost applied. The boosting condition is
     * ignored.
     *
     * Generated from protobuf field float boost = 2;
     */
    private $boost = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $condition
     *           An expression which specifies a boost condition. The syntax and
     *           supported fields are the same as a filter expression. See
     *           [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
     *           detail syntax and limitations.
     *           Examples:
     *           * To boost products with product ID "product_1" or "product_2", and
     *           color
     *             "Red" or "Blue":
     *               * (id: ANY("product_1", "product_2")) AND (colorFamilies:
     *               ANY("Red","Blue"))
     *     @type float $boost
     *           Strength of the condition boost, which should be in [-1, 1]. Negative
     *           boost means demotion. Default is 0.0.
     *           Setting to 1.0 gives the item a big promotion. However, it does not
     *           necessarily mean that the boosted item will be the top result at all
     *           times, nor that other items will be excluded. Results could still be
     *           shown even when none of them matches the condition. And results that
     *           are significantly more relevant to the search query can still trump
     *           your heavily favored but irrelevant items.
     *           Setting to -1.0 gives the item a big demotion. However, results that
     *           are deeply relevant might still be shown. The item will have an
     *           upstream battle to get a fairly high ranking, but it is not blocked out
     *           completely.
     *           Setting to 0.0 means no boost applied. The boosting condition is
     *           ignored.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce();
        parent::__construct($data);
    }

    /**
     * An expression which specifies a boost condition. The syntax and
     * supported fields are the same as a filter expression. See
     * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
     * detail syntax and limitations.
     * Examples:
     * * To boost products with product ID "product_1" or "product_2", and
     * color
     *   "Red" or "Blue":
     *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
     *     ANY("Red","Blue"))
     *
     * Generated from protobuf field string condition = 1;
     * @return string
     */
    public function getCondition()
    {
        return $this->condition;
    }

    /**
     * An expression which specifies a boost condition. The syntax and
     * supported fields are the same as a filter expression. See
     * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
     * detail syntax and limitations.
     * Examples:
     * * To boost products with product ID "product_1" or "product_2", and
     * color
     *   "Red" or "Blue":
     *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
     *     ANY("Red","Blue"))
     *
     * Generated from protobuf field string condition = 1;
     * @param string $var
     * @return $this
     */
    public function setCondition($var)
    {
        GPBUtil::checkString($var, True);
        $this->condition = $var;

        return $this;
    }

    /**
     * Strength of the condition boost, which should be in [-1, 1]. Negative
     * boost means demotion. Default is 0.0.
     * Setting to 1.0 gives the item a big promotion. However, it does not
     * necessarily mean that the boosted item will be the top result at all
     * times, nor that other items will be excluded. Results could still be
     * shown even when none of them matches the condition. And results that
     * are significantly more relevant to the search query can still trump
     * your heavily favored but irrelevant items.
     * Setting to -1.0 gives the item a big demotion. However, results that
     * are deeply relevant might still be shown. The item will have an
     * upstream battle to get a fairly high ranking, but it is not blocked out
     * completely.
     * Setting to 0.0 means no boost applied. The boosting condition is
     * ignored.
     *
     * Generated from protobuf field float boost = 2;
     * @return float
     */
    public function getBoost()
    {
        return $this->boost;
    }

    /**
     * Strength of the condition boost, which should be in [-1, 1]. Negative
     * boost means demotion. Default is 0.0.
     * Setting to 1.0 gives the item a big promotion. However, it does not
     * necessarily mean that the boosted item will be the top result at all
     * times, nor that other items will be excluded. Results could still be
     * shown even when none of them matches the condition. And results that
     * are significantly more relevant to the search query can still trump
     * your heavily favored but irrelevant items.
     * Setting to -1.0 gives the item a big demotion. However, results that
     * are deeply relevant might still be shown. The item will have an
     * upstream battle to get a fairly high ranking, but it is not blocked out
     * completely.
     * Setting to 0.0 means no boost applied. The boosting condition is
     * ignored.
     *
     * Generated from protobuf field float boost = 2;
     * @param float $var
     * @return $this
     */
    public function setBoost($var)
    {
        GPBUtil::checkFloat($var);
        $this->boost = $var;

        return $this;
    }

}


text:
<bill session="110" type="s" number="2485" updated="2009-01-09T17:02:13-05:00">
	<status><introduced date="1197608400" datetime="2007-12-14"/></status>

	<introduced date="1197608400" datetime="2007-12-14"/>
	<titles>
		<title type="short" as="introduced">Physical Therapist Student Loan Repayment Eligibility Act of 2007</title>
		<title type="official" as="introduced">A bill to amend the Public Health Service Act to provide for the participation of physical therapists in the National Health Service Corps Loan Repayment Program, and for other purposes.</title>
	</titles>
	<sponsor id="412244"/>
	<cosponsors>
		<cosponsor id="300009" joined="2008-02-11"/>
		<cosponsor id="300025" joined="2008-04-01"/>
		<cosponsor id="400064" joined="2007-12-14"/>
		<cosponsor id="300024" joined="2008-01-22"/>
		<cosponsor id="300038" joined="2008-04-24"/>
		<cosponsor id="300007" joined="2008-04-04"/>
		<cosponsor id="400432" joined="2008-04-15"/>
		<cosponsor id="400050" joined="2007-12-14"/>
		<cosponsor id="300091" joined="2008-03-03"/>
		<cosponsor id="412248" joined="2008-04-03"/>
		<cosponsor id="300058" joined="2007-12-14"/>
	</cosponsors>
	<actions>
		<action date="1197608400" datetime="2007-12-14"><text>Sponsor introductory remarks on measure. (CR S15652-15653)</text></action>
		<action date="1197608400" datetime="2007-12-14"><text>Read twice and referred to the Committee on Health, Education, Labor, and Pensions.</text><reference label="text of measure as introduced" ref="CR S15653"/></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>

	12/14/2007--Introduced.
Physical Therapist Student Loan Repayment Eligibility Act of 2007 - Amends the Public Health Service Act to: (1) include physical therapy within the definition of "primary health services"; and (2) make physical therapists eligible for the National Health Service Corps Loan Repayment Program (to assure an adequate supply of physical therapists among other health professionals).

</bill>


text:
%w{dovecot-core dovecot-imapd dovecot-pop3d}.each do |p|
  package "#{p}" do
    action :install
  end
end

cookbook_file '/etc/dovecot/dovecot.conf' do
  source 'dovecot.conf'
  mode 0644
end


text:
<!-- TITLE/ -->

# spine-route

<!-- /TITLE -->

<!-- BADGES/ -->

[![Build Status](http://img.shields.io/travis-ci/bevry/spine-route.png?branch=master)](http://travis-ci.org/bevry/spine-route "Check this project's build status on TravisCI")
[![NPM version](http://badge.fury.io/js/spine-route.png)](https://npmjs.org/package/spine-route "View this project on NPM")
[![Dependency Status](https://david-dm.org/bevry/spine-route.png?theme=shields.io)](https://david-dm.org/bevry/spine-route)
[![Development Dependency Status](https://david-dm.org/bevry/spine-route/dev-status.png?theme=shields.io)](https://david-dm.org/bevry/spine-route#info=devDependencies)<br/>
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")
[![BitCoin donate button](http://img.shields.io/bitcoin/donate.png?color=yellow)](https://coinbase.com/checkouts/9ef59f5479eec1d97d63382c9ebcb93a "Donate once-off to this project using BitCoin")
[![Wishlist browse button](http://img.shields.io/wishlist/browse.png?color=yellow)](http://amzn.com/w/2F8TXKSNAFG4V "Buy an item on our wishlist for us")

<!-- /BADGES -->

<!-- DESCRIPTION/ -->

The minimistic router from Spine, extracted microjs style.

<!-- /DESCRIPTION -->

<!-- INSTALL/ -->

## Install

### [NPM](http://npmjs.org/)
- Use: `require('spine-route')`
- Install: `npm install --save spine-route`

### [Browserify](http://browserify.org/)
- Use: `require('spine-route')`
- Install: `npm install --save spine-route`
- CDN URL: `//wzrd.in/bundle/spine-route@1.0.1`

### [Ender](http://ender.jit.su/)
- Use: `require('spine-route')`
- Install: `ender add spine-route`

<!-- /INSTALL -->

## Usage

This is the [Routing](http://spinejs.com/docs/routing) component of the [Spine](http://spinejs.com/) MVC framework extracted into its own module, microjs style.

For complete documentation, and usage, see the [relevant spine documentation](http://spinejs.com/docs/routing).

``` coffeescript
# Define our Application
class App
	constructor: ->
		# Import the router
		Route = require('spine-route').Route

		# Bind routes to our application methods
		routes =
			'/': 'routeApp'
			'/site/:siteId/': 'routeApp'
			'/site/:siteId/:fileCollectionId': 'routeApp'
			'/site/:siteId/:fileCollectionId/*filePath': 'routeApp'
		for own key,value of routes
			Route.add(key, @[value].bind(@))

		# Start the routing
		Route.setup()

	routeApp: (opts) ->
		{siteId, fileCollectionId, filePath} = opts

# Create our application
app = new App()
```

<!-- HISTORY/ -->

## History
[Discover the change history by heading on over to the `HISTORY.md` file.](https://github.com/bevry/spine-route/blob/master/HISTORY.md#files)

<!-- /HISTORY -->

<!-- CONTRIBUTE/ -->

## Contribute

[Discover how you can contribute by heading on over to the `CONTRIBUTING.md` file.](https://github.com/bevry/spine-route/blob/master/CONTRIBUTING.md#files)

<!-- /CONTRIBUTE -->

<!-- BACKERS/ -->

## Backers

### Maintainers

These amazing people are maintaining this project:

- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)

### Sponsors

No sponsors yet! Will you be the first?

[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")
[![BitCoin donate button](http://img.shields.io/bitcoin/donate.png?color=yellow)](https://coinbase.com/checkouts/9ef59f5479eec1d97d63382c9ebcb93a "Donate once-off to this project using BitCoin")
[![Wishlist browse button](http://img.shields.io/wishlist/browse.png?color=yellow)](http://amzn.com/w/2F8TXKSNAFG4V "Buy an item on our wishlist for us")

### Contributors

These amazing people have contributed code to this project:

- [Benjamin Lupton](https://github.com/balupton) <b@lupton.cc> — [view contributions](https://github.com/bevry/spine-route/commits?author=balupton)
- [Zearin](https://github.com/Zearin) — [view contributions](https://github.com/bevry/spine-route/commits?author=Zearin)

[Become a contributor!](https://github.com/bevry/spine-route/blob/master/CONTRIBUTING.md#files)

<!-- /BACKERS -->

<!-- LICENSE/ -->

## License

Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/)

Copyright © 2013+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me)

<!-- /LICENSE -->

This work is based off prior work by [Alex MacCaw](http://alexmaccaw.com/) and the [Spine](http://spinejs.com/) team, [view their license here](https://github.com/spine/spine/blob/master/LICENSE).


text:
"""
Sizun - Software Quality Inspection
MIT License
(C) 2015 David Rieger
"""

from subprocess import Popen, PIPE
from flask import current_app as app

class ExternalExecutor():

    def exe(commandlist, resultdelimiter=None, instream=None):
        """
        Executes an external executable witht the
        command and parameters given in commandlist

        Returns a list of all lines from stdout
        """

        app.logger.debug("command is :: {}".format(" ".join(commandlist)))

        try:
            _proc = Popen(commandlist, stdout=PIPE, stderr=PIPE, stdin=instream)
        except FileNotFoundError:
            raise ExternalDependencyError("Executable \"{}\" not found. Is it installed?".format(commandlist[0]))

        if _proc.returncode is not (0 or None):
            raise ExternalExecutionError("Failed to execute \"{}\"".format(" ".join(commandlist)),
                                         returncode=_agproc.returncode,
                                         stderr=_agproc.stderr.read().decode("utf-8"))

        _boutput = _proc.stdout

        if resultdelimiter:
            return [l.decode("utf-8").split(resultdelimiter) for l in _boutput.readlines()]
        else:
            return [l.decode("utf-8").rstrip("\n").strip() for l in _boutput.readlines()]


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE gsa-template
  PUBLIC '-//Art Technology Group, Inc.//DTD General SQL Adapter//EN'
  'http://www.atg.com/dtds/gsa/gsa_1.0.dtd'>

<gsa-template>

    <name>User Repository</name>
    <author>Tomas Rodriguez</author>

  <item-descriptor name="user">

      <property name="firstName" data-type="string" />
      <property name="lastName" data-type="string" />
      <property name="sex" data-type="string" />
      <property name="birthDate" data-type="timestamp" />
      <property name="lastModifiedDate" data-type="timestamp" />
      <property name="points" data-type="int" />
      <property name="rating" data-type="double" />
      <property name="billingAddress" item-type="contactInfo" />
      <property name="type" data-type="enumerated">
        <attribute name="useCodeForValue" value="false" />
        <option value="premium" code="0" />
        <option value="standard" code="1" />
        <option value="professional" code="2" />
      </property>

      <property name="addresses" data-type="map" component-item-type="contactInfo" />

      <property name="children" data-type="list" component-item-type="child"/>

      <property name="favoriteNumbers" data-type="list" component-data-type="int"/>

    <property name="derivedFirstName" data-type="string" writable="false">
      <derivation>
        <expression>firstName</expression>
      </derivation>
    </property>
  </item-descriptor>

  <item-descriptor name="contactInfo">

      <property name="address1" data-type="string" />
      <property name="address2" data-type="string" />
      <property name="address3" data-type="string" />
      <property name="telephoneNumber" data-type="string" />
      <property name="postalCode" data-type="string" />
      <property name="city" data-type="string" />
      <property name="country" data-type="string" />

  </item-descriptor>

  <item-descriptor name="child">

      <property name="name" data-type="string" />
      <property name="age" data-type="int" />

  </item-descriptor>
</gsa-template>


text:
using Specify.Mocks;

namespace Specify.Tests.Mocks
{
    public class MoqMockFactoryTests : MockFactoryTestsFor<MoqMockFactory>
    {
        protected override string AssemblyName => "Moq";
        protected override string TypeName => "Moq.Mock`1";
        protected override IMockFactory CreateSut(IFileSystem fileSystem)
        {
            return new MoqMockFactory(fileSystem);
        }
    }
}


text:
from django.conf import settings
from django.db.models.signals import post_save

from toucan.issues.signals import issue_created_signal
from .handlers import issue_created
from .models import Profile

def create_user_profile(**kwargs):
    user = kwargs['instance']
    Profile.objects.get_or_create(user=user)

post_save.connect(create_user_profile, sender=settings.AUTH_USER_MODEL)

issue_created_signal.connect(issue_created)


text:
<?xml version="1.0" encoding="utf-8"?>
<form>
	<fieldset addfieldpath="/administrator/components/com_templates/models/fields" />
	<field
		name="client_id"
		type="list"
		filtermode="selector"
		onchange="jQuery('#filter_search, select[id^=filter_], #list_fullordering').val('');this.form.submit();"
		>
		<option value="0">JSITE</option>
		<option value="1">JADMINISTRATOR</option>
	</field>
	<fields name="filter">
		<field
			name="search"
			type="text"
			label="JSEARCH_FILTER"
			description="COM_TEMPLATES_STYLES_FILTER_SEARCH_DESC"
			hint="JSEARCH_FILTER"
			noresults="COM_TEMPLATES_MSG_MANAGE_NO_STYLES"
		/>
		<field
			name="menuitem"
			type="menuitem"
			label="COM_TEMPLATES_OPTION_SELECT_PAGE"
			disable="separator,alias,heading,url"
			showon="client_id:0"
			onchange="this.form.submit();"
			>
			<option	value="">COM_TEMPLATES_OPTION_SELECT_PAGE</option>
			<option	value="-1">COM_TEMPLATES_OPTION_NONE</option>
		</field>
		<field
			name="template"
			type="templatename"
			onchange="this.form.submit();"
			>
			<option value="">JOPTION_SELECT_TEMPLATE</option>
		</field>
	</fields>
	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="JGLOBAL_SORT_BY"
			description="JGLOBAL_SORT_BY"
			onchange="this.form.submit();"
			default="a.template ASC"
			>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.title ASC">COM_TEMPLATES_HEADING_STYLE_ASC</option>
			<option value="a.title DESC">COM_TEMPLATES_HEADING_STYLE_DESC</option>
			<option value="a.home ASC">COM_TEMPLATES_HEADING_DEFAULT_ASC</option>
			<option value="a.home DESC">COM_TEMPLATES_HEADING_DEFAULT_DESC</option>
			<option value="a.template ASC">COM_TEMPLATES_HEADING_TEMPLATE_ASC</option>
			<option value="a.template DESC">COM_TEMPLATES_HEADING_TEMPLATE_DESC</option>
			<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
		</field>
		<field
			name="limit"
			type="limitbox"
			label="JGLOBAL_LIMIT"
			description="JGLOBAL_LIMIT"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
    </fields>
</form>


text:
<nav class="breadcrumb fox-breadcrumb">
    <template ngFor let-item let-end="last" [ngForOf]="model">
        <a [href]="item.url || '#'" class="breadcrumb-item fox-breadcrumb__link" (click)="itemClick($event, item)" [ngClass]="{'disabled':item.disabled, 'active':item.active}">
            {{ item.label }}
        </a>
    </template>
</nav>


text:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/DevicesListItemLayoutStyle">
    <TextView
        android:id="@+id/deviceListName"
        style="@style/ListHeaderStyle" />
    <LinearLayout
        style="@style/LayoutWidthMatchParent">
        <ImageView
            android:id="@+id/deviceListIcon"
            style="@style/ListIconStyle"
            android:contentDescription="@string/device_icon" />
        <TextView
            android:id="@+id/deviceListDescript"
            style="@style/ListTextStyle" />
    </LinearLayout>
</LinearLayout>


text:
namespace tigl
{
class CTiglUIDManager;
class CTiglUIDObject;
class CCPACSProfiles;

namespace generated
{
    class CPACSProfileGeometry;

    // This class is used in:
    // CPACSProfiles

    /// @brief wingAirfoilsType
    ///
    /// WingAirfoils type, containing wing airfoil geometries.
    /// See profileGeometryType for further documentation
    ///
    class CPACSWingAirfoils
    {
    public:
        TIGL_EXPORT CPACSWingAirfoils(CCPACSProfiles* parent, CTiglUIDManager* uidMgr);

        TIGL_EXPORT virtual ~CPACSWingAirfoils();

        TIGL_EXPORT CCPACSProfiles* GetParent();

        TIGL_EXPORT const CCPACSProfiles* GetParent() const;

        TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent();
        TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const;

        TIGL_EXPORT CTiglUIDManager& GetUIDManager();
        TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const;

        TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath);
        TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const;

        TIGL_EXPORT virtual const std::vector<std::unique_ptr<CPACSProfileGeometry>>& GetWingAirfoils() const;
        TIGL_EXPORT virtual std::vector<std::unique_ptr<CPACSProfileGeometry>>& GetWingAirfoils();

        TIGL_EXPORT virtual CPACSProfileGeometry& AddWingAirfoil();
        TIGL_EXPORT virtual void RemoveWingAirfoil(CPACSProfileGeometry& ref);

    protected:
        CCPACSProfiles* m_parent;

        CTiglUIDManager* m_uidMgr;

        std::vector<std::unique_ptr<CPACSProfileGeometry>> m_wingAirfoils;

    private:
        CPACSWingAirfoils(const CPACSWingAirfoils&) = delete;
        CPACSWingAirfoils& operator=(const CPACSWingAirfoils&) = delete;

        CPACSWingAirfoils(CPACSWingAirfoils&&) = delete;
        CPACSWingAirfoils& operator=(CPACSWingAirfoils&&) = delete;
    };
} // namespace generated

// CPACSWingAirfoils is customized, use type CCPACSWingProfiles directly

// Aliases in tigl namespace
using CCPACSProfileGeometry = generated::CPACSProfileGeometry;
} // namespace tigl


text:
USE [StayHomewithoutPer];

GO

SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

GO

BEGIN TRANSACTION;
GO
SELECT *
  FROM Fil;
GO
COMMIT TRANSACTION;
GO


text:
{% extends "reports/reports.html" %}
            {% block pageheader %}

RESPOND TO {{ topic.title }}

            {% endblock pageheader %}

    {% block searchform %}
    {% endblock searchform %}

{% block content %}
<form action="{% url 'reply' topic.id %}" method="POST">
    {% csrf_token %}
                    {% if form.non_field_errors %}
                        {% for error in form.non_field_errors %}

                                {{ error }}

                        {% endfor %}
                    {% endif %}
                    {% for fld in form %}

                          {% if fld.errors %}

                                {{ fld.errors }}

                          {% endif %}
                          {{ fld.label }}

                          {{ fld }}

                    {% endfor %}
    <input type="submit" value="Submit" class="btn btn-primary btn-lg" />
</form>
{% endblock content %}


text:
const styleBenchmarkLocations = require('./style-benchmark-locations.json');

module.exports = {
  styleBenchmarkLocations
};


text:
/*global require:true*/
/*global module:true*/
(function(){
	"use strict";

	var fs = require( 'fs-extra' );
	var path = require( 'path' );
	var Handlebars = require( 'handlebars' );
	var SvgURIEncoder = require( './svg-uri-encoder' );
	var PngURIEncoder = require( './png-uri-encoder' );

	function DirectoryEncoder( input, output, options ){
		this.input = input;
		this.output = output;
		this.options = options || {};

		this.prefix = this.options.prefix || ".icon-";

		this.options.pngfolder = this.options.pngfolder || "";

		this.customselectors = this.options.customselectors || {};
		this.template = this._loadTemplate( this.options.template );
	}

	DirectoryEncoder.encoders = {
		svg: SvgURIEncoder,
		png: PngURIEncoder
	};

	DirectoryEncoder.prototype.encode = function() {
		var self = this, seen = {};

		// remove the file if it's there
		if( fs.existsSync(this.output) ) {
			fs.unlinkSync( this.output );
		}

		if( !fs.existsSync(path.dirname( this.output )) ){
			fs.mkdirpSync( path.dirname( this.output ) );
		}

		// append each selector
		fs.readdirSync( this.input ).forEach(function( file ) {
			var css, datauri, stats,
				filepath = path.join( self.input, file ),
				extension = path.extname( file );

			if( extension === ".svg" || extension === ".png" ) {
				if( fs.lstatSync( filepath ).isFile() ) {
					self._checkName(seen, file.replace( extension, '' ));

					stats = self._stats( filepath );
					datauri = self._datauri( filepath );

					css = self._css( file.replace( extension, '' ), datauri, stats );

					fs.appendFileSync( self.output, css + "\n\n" );
				}
			}
		});
	};
	DirectoryEncoder.prototype._css = function( name, datauri, stats ) {
		var self = this, width, height;

		if( stats ){
			width = stats.width;
			height = stats.height;
		}
		this.customselectors = this.customselectors || {};
		this.prefix = this.prefix || ".icon-";

		if( this.customselectors[ "*" ] ){
			this.customselectors[ name ] = this.customselectors[ name ] || [];
			var selectors = this.customselectors[ "*" ];
			selectors.forEach( function( el ){
				var s = name.replace( new RegExp( "(" + name + ")" ), el );
				if( self.customselectors[ name ].indexOf( s ) === -1 ) {
					self.customselectors[ name ].push( s );
				}
			});
		}

		var data = {
			prefix: this.prefix,
			name: name,
			datauri: datauri,
			width: width,
			height: height,
			customselectors: this.customselectors[ name ]
		}, css = "";

		if( this.template ){
			css = this.template( data );
		} else {
			for( var i in data.customselectors ){
				if( data.customselectors.hasOwnProperty( i ) ){
					css += data.customselectors[i] + ",\n";
				}
			}
			css += this.prefix + name +
				" { background-image: url('" +
				datauri +
				"'); background-repeat: no-repeat; }";
		}

		return css;
	};

	DirectoryEncoder.prototype._stats = function( file ){
		var encoder, extension = path.extname( file );

		if( typeof DirectoryEncoder.encoders[extension.replace(".", "")] === "undefined" ){
			throw new Error( "Encoder does not recognize file type: " + file );
		}

		encoder = new DirectoryEncoder.encoders[extension.replace(".", "")]( file );

		return encoder.stats();
	};

	DirectoryEncoder.prototype._datauri = function( file ) {
		var encoder, extension = path.extname( file );

		if( typeof DirectoryEncoder.encoders[extension.replace(".", "")] === "undefined" ){
			throw new Error( "Encoder does not recognize file type: " + file );
		}

		encoder = new DirectoryEncoder.encoders[extension.replace(".", "")]( file );

		// TODO passthrough of options is generally a code smell
		return encoder.encode( this.options );
	};

	DirectoryEncoder.prototype._checkName = function( seen, name ) {
		if( seen[name] ){
			throw new Error("Two files with the same name: `" + name + "` exist in the input directory");
		}

		seen[name] = true;
	};

	DirectoryEncoder.prototype._loadTemplate = function( templateFile ) {
		var tmpl;

		if( templateFile && fs.existsSync( templateFile ) && fs.lstatSync( templateFile ).isFile() ){
			var source = fs.readFileSync( templateFile ).toString( 'utf-8' );
			tmpl = Handlebars.compile(source);
		} else {
			tmpl = false;
		}

		return tmpl;
	};

	module.exports = DirectoryEncoder;
}());


text:
/* Generated By:JJTree: Do not edit this line. ASTPrimaryExpression.java */

package net.sourceforge.pmd.ast;

public class ASTPrimaryExpression extends SimpleJavaTypeNode {
    public ASTPrimaryExpression(int id) {
        super(id);
    }

    public ASTPrimaryExpression(JavaParser p, int id) {
        super(p, id);
    }

    /**
     * Accept the visitor. *
     */
    public Object jjtAccept(JavaParserVisitor visitor, Object data) {
        return visitor.visit(this, data);
    }

}


text:
require 'rails_helper'

module Commontator
  RSpec.describe SubscriptionsMailer, type: :mailer do
    before(:each) do
      setup_mailer_spec
      @user2 = DummyUser.create
      @thread.subscribe(@user)
      @thread.subscribe(@user2)
      @comment = Comment.new
      @comment.thread = @thread
      @comment.creator = @user
      @comment.body = 'Something'
      @comment.save!
      @recipients = @thread.subscribers.reject{|s| s == @user}
    end

    it 'must create deliverable mail' do
      mail = SubscriptionsMailer.comment_created(@comment, @recipients)
      expect(mail.to).to eq I18n.t('commontator.email.undisclosed_recipients')
      expect(mail.cc).to be_nil
      expect(mail.bcc.size).to eq 1
      expect(mail.bcc).to include(@user2.email)
      expect(mail.subject).not_to be_empty
      expect(mail.body).not_to be_empty
      expect(mail.deliver_now).to eq mail
    end
  end
end


text:
/**
	@overview
	@author Michael Mathews <micmath@gmail.com>
	@license Apache License 2.0 - See file 'LICENSE.md' in this project.
 */

var _synonyms = {},
    _definitions = {},
    _namespaces = [];

function _TagDefinition(title, etc) {
    etc = etc || {};

    this.title = dictionary.normalise(title);

    for (var p in etc) {
        if (etc.hasOwnProperty(p)) {
            this[p] = etc[p];
        }
    }
}

_TagDefinition.prototype.synonym = function(synonymName) {
    _synonyms[synonymName.toLowerCase()] = this.title;
    return this; // chainable
};

/** @exports jsdoc/tag/dictionary */
var dictionary = {
    /** @function */
    defineTag: function(title, opts) {
        _definitions[title] = new _TagDefinition(title, opts);

        if (opts.isNamespace) {
            _namespaces.push(title);
        }

        return _definitions[title];
    },

    /** @function */
    lookUp: function(title) {
        title = dictionary.normalise(title);

        if ( _definitions.hasOwnProperty(title) ) {
           return _definitions[title];
        }

        return false;
    },

    /** @function */
    isNamespace: function(kind) {
        return ( ~ _namespaces.indexOf(kind) );
    },

    /** @function */
    normalise: function(title) {
        canonicalName = title.toLowerCase();

        if ( _synonyms.hasOwnProperty(canonicalName) ) {
            return _synonyms[canonicalName];
        }

        return canonicalName;
    }
};

require('jsdoc/tag/dictionary/definitions').defineTags(dictionary);

for (var prop in dictionary) {
    if (dictionary.hasOwnProperty(prop)) {
        exports[prop] = dictionary[prop];
    }
}


text:
A quick and easy file and development web server.

## Installation

To start using Quickserve, install Go and run `go get`:

```
$ go get github.com/shivakar/quickserve
```

This will install the `quickserve` command line utility into  `$GOPATH/bin`.

Make sure you have `$GOPATH/bin` added to your `$PATH` environment variable.

## Features

* Serve one or more directories
* Serve at a particular prefix
* Basic Authentication
* Serve over HTTPS (default)
* Handle (log) POST requests for quick debugging
* gzip and deflate (zlib) compression via the Accept-Encoding header

## Usage

To serve a directory using Quickserve:

```
cd <directory>
quickserve
```

Available options:

```
Usage of quickserve:
  -auth
        Enable Basic Authentication
  -certFile string
        Certificate file for TLS server.
        Implies '-tls' option.
        Also needs matching KeyFile from '-keyFile' option.
  -interface string
        Interface to serve on (default "127.0.0.1")
  -keyFile string
        Private key file for TLS server.
        Implies '-tls' option.
        Also needs matching Certificate file from '-certFile' option.
  -markdown
        Render Markdown files (default true)
  -password string
        Password for Basic Authentication (default "qspassword")
  -port string
        Port to serve on (default "8080")
  -prefix string
        Absolute path to serve on (default "/")
  -tls
        Start TLS server.
        Uses files provided with '-certFile' and '-keyFile' options
        to start the server. If no files are provided, generates an
        in-memory keypair for the server. (default true)
  -username string
        Username for Basic Authentication (default "qsuser")
  -version
        Show Version Information
```

## License

Quickserve is licensed under a MIT license.


text:
module Experian
  class Request
    attr_reader :xml

    def initialize(options = {})
      @options = options
      @xml = build_request
    end

    def build_request
      xml = Builder::XmlMarkup.new(:indent => 2)
      xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
      yield xml if block_given?
      xml.target!
    end

    def body
      xml
    end

    def headers
      { "Content-Type" => "text/xml" }
    end
  end
end


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.common.engine.impl.cmd;

import org.flowable.common.engine.api.FlowableObjectNotFoundException;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.common.engine.impl.persistence.entity.PropertyEntity;
import org.flowable.common.engine.impl.persistence.entity.PropertyEntityManager;

/**
 * @author Filip Hrisafov
 */
public class ReleaseLockCmd implements Command<Void> {

    protected String lockName;
    protected String engineType;

    public ReleaseLockCmd(String lockName, String engineType) {
        this.lockName = lockName;
        this.engineType = engineType;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        PropertyEntityManager propertyEntityManager = commandContext.getEngineConfigurations().get(engineType).getPropertyEntityManager();
        PropertyEntity property = propertyEntityManager.findById(lockName);
        if (property != null) {
            propertyEntityManager.delete(property);
            return null;
        } else {
            throw new FlowableObjectNotFoundException("Lock with name " + lockName + " does not exist");
        }
    }
}


text: from playbulbcandle import PlayBulbCandle


text:
'use strict';

var Protocol = require('azure-iot-device-amqp').Amqp;
// Uncomment one of these transports and then change it in fromConnectionString to test other transports
// var Protocol = require('azure-iot-device-amqp-ws').AmqpWs;
// var Protocol = require('azure-iot-device-http').Http;
// var Protocol = require('azure-iot-device-mqtt').Mqtt;
var Client = require('azure-iot-device').Client;
var Message = require('azure-iot-device').Message;

// String containing Hostname, Device Id & Device Key in the following formats:
//  "HostName=<iothub_host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>"
var connectionString = '[IoT device connection string]';

// fromConnectionString must specify a transport constructor, coming from any transport package.
var client = Client.fromConnectionString(connectionString, Protocol);

var connectCallback = function (err) {
  if (err) {
    console.error('Could not connect: ' + err.message);
  } else {
    console.log('Client connected');
    client.on('message', function (msg) {
      console.log('Id: ' + msg.messageId + ' Body: ' + msg.data);
      client.complete(msg, printResultFor('completed'));
      // reject and abandon follow the same pattern.
      // /!\ reject and abandon are not available with MQTT
    });

    // Create a message and send it to the IoT Hub every second
    var sendInterval = setInterval(function () {
      var windSpeed = 10 + (Math.random() * 4); // range: [10, 14]
      var data = JSON.stringify({ deviceId: 'myFirstDevice', windSpeed: windSpeed });
      var message = new Message(data);
      console.log('Sending message: ' + message.getData());
      client.sendEvent(message, printResultFor('send'));
    }, 2000);

    client.on('error', function (err) {
      console.error(err.message);
    });

    client.on('disconnect', function () {
      clearInterval(sendInterval);
      client.removeAllListeners();
      client.open(connectCallback);
    });
  }
};

client.open(connectCallback);

// Helper function to print results in the console
function printResultFor(op) {
  return function printResult(err, res) {
    if (err) console.log(op + ' error: ' + err.toString());
    if (res) console.log(op + ' status: ' + res.constructor.name);
  };
}


text:
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace PInvoke
{
    using System;
    using System.Runtime.InteropServices;

#pragma warning disable SA1300 // Naming matches .h file
#pragma warning disable SA1303 // Const field names must begin with upper-case letter
#pragma warning disable SA1623 // Docs match Microsoft published text.

    /// <content>
    /// Contains the <see cref="MENUBARINFO"/> nested type.
    /// </content>
    public partial class User32
    {
        /// <summary>
        /// Contains menu bar information.
        /// </summary>
        public struct MENUBARINFO
        {
            /// <summary>
            /// The size of the structure, in bytes. The caller must set this to sizeof(MENUBARINFO).
            /// </summary>
            public int cbSize;

            /// <summary>
            /// The coordinates of the menu bar, popup menu, or menu item.
            /// </summary>
            public RECT rcBar;

            /// <summary>
            /// A handle to the menu bar or popup menu.
            /// </summary>
            public IntPtr hMenu;

            /// <summary>
            /// A handle to the submenu.
            /// </summary>
            public IntPtr hwndMenu;

            private const int fFocusedMask = 1 << 0;

            private const int fBarFocusedMask = 1 << 1;

            /// <summary>
            /// The integer sized location where <see cref="fBarFocused"/> and <see cref="fFocused"/> are stored as bit flags.
            /// </summary>
            private int flags;

            /// <summary>
            /// If the menu bar or popup menu has the focus, this member is TRUE. Otherwise, the member is FALSE.
            /// </summary>
            public bool fBarFocused
            {
                get => (this.flags & fBarFocusedMask) == fBarFocusedMask;
                set
                {
                    if (value)
                    {
                        this.flags |= fBarFocusedMask;
                    }
                    else
                    {
                        this.flags &= ~fBarFocusedMask;
                    }
                }
            }

            /// <summary>
            /// If the menu item has the focus, this member is TRUE. Otherwise, the member is FALSE.
            /// </summary>
            public bool fFocused
            {
                get => (this.flags & fFocusedMask) == fFocusedMask;
                set
                {
                    if (value)
                    {
                        this.flags |= fFocusedMask;
                    }
                    else
                    {
                        this.flags &= ~fFocusedMask;
                    }
                }
            }

            /// <summary>
            /// Initializes a new instance of the <see cref="MENUBARINFO"/> struct
            /// with the <see cref="cbSize"/> preset as required.
            /// </summary>
            /// <returns>The newly initialized instance.</returns>
            public static MENUBARINFO Create()
            {
                var result = default(MENUBARINFO);
                result.cbSize = Marshal.SizeOf(result);
                return result;
            }
        }
    }
}


text:
import Ember from 'ember';
import FormItemMixin from '../../mixin/form-item';
import ComponentParent from '../../mixin/component-parent';

/**
 * RadioButtonGroup Component
 ```html
    {{#io-radio-button-group}}
  	{{/io-radio-button-group}}
 ```
 */

export default Ember.Component.extend(ComponentParent, FormItemMixin, {
	/**
	 * [tagName description]
	 */
	tagName: 'div',
	attributeBindings: ['disabled', 'onClick', 'role'],
	classNames: 'io-btn-group input-custom io-radio-btn-group',
	value: null,
	checked: null,
	_checkedChange: function() {
		if (!this.get('required')) {
			return;
		}
		Ember.run.later(()=> {
			const checked = this.get('checked');
			let children = this.get('children');
			let checkedChild = children.any((child)=>{
				if (child.get('value') === checked) {
					return child;
				} else {
					return null;
				}
			});

			let value = null;
			if (checkedChild) {
				value = checkedChild.get('value');
			}

			this.set('value', value);

			setTimeout(() => {
				this.$().trigger('input.bs.validator');
			}, 100);
		});
	}.observes('checked').on('init')
});


text:
  Empuré est
       un village
       géographiquement positionné dans le département de Charente en Poitou-Charentes. Elle totalisait 117 habitants en 2008.

Le parc d'habitations, à Empuré, était réparti en 2011 en un appartements et 71 maisons soit
 un marché plutôt équilibré.

À coté de Empuré sont situées les communes de
Longré localisée à 5 km, 219 habitants,
Villefagnan située à 2 km, 1 037 habitants,
La Forêt-de-Tessé située à 6 km, 201 habitants,
Brettes à 2 km, 189 habitants,
Souvigné localisée à 5 km, 244 habitants,
Paizay-Naudouin-Embourie localisée à 4 km, 405 habitants,
 entre autres. De plus, Empuré est située à seulement 26 km de Melle.

Si vous pensez venir habiter à Empuré, vous pourrez facilement trouver une maison à vendre.


text:
@interface SneakyButton(Extension)
+(id) button;
+(id) buttonWithRect:(CGRect)rect;

@end

@interface SneakyButtonSkinnedBase(Extension)
+(id) skinnedButton;

@end

@interface SneakyJoystick(Extension)
+(id) joystickWithRect:(CGRect)rect;

@end
@interface SneakyJoystickSkinnedBase(Extension)
+(id) skinnedJoystick;
@end


text:
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
// 'use strict'; The fib example works best without the usual strict mode

console.info('Default JS fibonacci function:');

function fib2(n) {
  if (n < 2) {
    return n;
  }

  return fib2(n - 1) + fib2(n - 2);
};

console.log(fib2(0));// 0
console.log(fib2(1));// 1
console.log(fib2(2));// 1
console.log(fib2(11));// 89
console.log(fib2(17));// 1597

// Ruby Fibonacci for easy comparison (in ruby.js too)
// def fib(n)
//   if (n < 2)
//     return n
//   end

//   fib(n - 1) + fib(n - 2)
// end

// puts fib 0
// puts fib 1
// puts fib 2
// puts fib 11
// puts fib 17

console.info('\nMade to look like Ruby:');

// Symbols can be used as literal values. To reassign with the global, this must set globally with
// no prefix. i.e. this is not strict mode compliant
fib = Symbol('fib');

const puts = {};

function def(name, callback) {
  // This will always be in the format Symbol('string') for all strings
  const symbolString = String(name).slice(7, -1);

  // Make the given function accessible anywhere
  global[symbolString] = callback;

  // The ... take all the arguments and put them into the variable beside them
  puts[symbolString] = function(...args) {
    const result = callback.apply(this, args);
    console.log(result);
  };
};

def(fib, (n) => {
  if (n < 2) {
    return n
  }

  return fib(n - 1) + fib(n - 2)
})

puts. fib(0)
puts. fib(1)
puts. fib(2)
puts. fib(11)
puts. fib(17)


text:
/* This source file is part of the Tomviz project, https://tomviz.org/.
   It is released under the 3-Clause BSD License, see "LICENSE". */

#ifndef tomvizOperatorProxyBase_h
#define tomvizOperatorProxyBase_h

#include <string>

class vtkImageData;

namespace tomviz {

/** Pure virtual base class providing a proxy to the operator class. */
class OperatorProxyBase
{
public:
  OperatorProxyBase(void*) {}
  virtual ~OperatorProxyBase() = default;

  virtual bool canceled() = 0;

  virtual bool completed() = 0;

  virtual void setTotalProgressSteps(int progress) = 0;

  virtual int totalProgressSteps() = 0;

  virtual void setProgressStep(int progress) = 0;

  virtual int progressStep() = 0;

  virtual void setProgressMessage(const std::string& message) = 0;

  virtual std::string progressMessage() = 0;

  virtual void setProgressData(vtkImageData* object) = 0;
};

class OperatorProxyBaseFactory
{
public:
  virtual ~OperatorProxyBaseFactory() = default;
  virtual OperatorProxyBase* create(void* o) = 0;
};

} // namespace tomviz

#endif


text:
<?php

namespace Fuel\Core;

/**
 * Yaml Config file parser
 */
class Config_Yml extends \Config_File {
	protected $ext = '.yml';

	/**
	 * Loads in the given file and parses it.
	 *
	 * @param string $file
	 *        	File to load
	 * @return array
	 */
	protected function load_file($file) {
		$contents = $this->parse_vars ( file_get_contents ( $file ) );
		return \Format::forge ( $contents, 'yaml' )->to_array ();
	}

	/**
	 * Returns the formatted config file contents.
	 *
	 * @param array $content
	 *        	config array
	 * @return string formatted config file contents
	 */
	protected function export_format($contents) {
		if (! function_exists ( 'spyc_load' )) {
			import ( 'spyc/spyc', 'vendor' );
		}

		$this->prep_vars ( $contents );
		return \Spyc::YAMLDump ( $contents );
	}
}


text:
require "cutest"
require_relative "../lib/shareprogress"

# Monkeypath the communication with ShareProgress
module ShareProgress
  module Button
    def self.request(method, payload)
      return {
        "success"=>true,
        "response"=>[{
          "id"=>12136,
          "page_url"=>"http://sumofus.org/",
          "page_title"=>"My Email button name",
          "button_template"=>"sp_em_large",
          "share_button_html"=>"

",
          "found_snippet"=>false,
          "is_active"=>false,
          "variants"=>{
            "facebook"=>[{
              "id"=>48542,
              "facebook_title"=>"SumOfUs",
              "facebook_description"=>"SumOfUs is a global movement of "\
                "consumers, investors, and workers all around the world, standing "\
                "together to hold corporations accountable for their actions and "\
                "forge a new, sustainable and just path for our global economy. "\
                "It's not going to be fast or easy. B",
              "facebook_thumbnail"=>"http://sumofus.org/wp-content/themes/"\
                "pgm/img/default-facebook.jpg"}],
            "email"=>[{
              "id"=>48539,
                "email_subject"=>"Email subject 1!",
                "email_body"=>"Email body 1 {LINK}"}, {
              "id"=>48540,
                "email_subject"=>"Email subject 2!",
                "email_body"=>"Email body 2 {LINK}"}, {
              "id"=>48541,
                "email_subject"=>"Email subject 3!",
                "email_body"=>"Email body 3 {LINK}"}],
            "twitter"=>[{
              "id"=>48543,
              "twitter_message"=>"SumOfUs {LINK}"}]},
          "advanced_options"=>{
            "automatic_traffic_routing"=>true,
            "buttons_optimize_actions"=>true,
            "customize_params"=>{
              "param"=>"param_to_use",
              "e"=>"email_source",
              "f"=>"facebook_source",
              "t"=>"twitter_source",
              "o"=>"dark_social_source"},
            "id_pass"=>{
              "id"=>"id",
              "passed"=>"referrer_id"}}}],
        "message"=>nil
      }
    end
  end
end

setup do
  {
    "key" => "123456",
    "page_url" => "http://sumofus.org/",
    "page_title" => "My Email button name",
    "auto_fill" => true,
    "button_template" => "sp_em_large",
    "variants" => {
      "email" => [
        {"email_subject" => "Email subject 1!",
          "email_body" => "Email body 1 {LINK}"},
        {"email_subject" => "Email subject 2!",
          "email_body" => "Email body 2 {LINK}"},
        {"email_subject" => "Email subject 3!",
          "email_body" => "Email body 3 {LINK}"}
      ]
    },
    "advanced_options" => {
      "automatic_traffic_routing" => true,
      "buttons_optimize_actions" => true,
      "customize_params" => {
        "param" => "param_to_use",
        "e" => "email_source",
        "f" => "facebook_source",
        "t" => "twitter_source",
        "o" => "dark_social_source"
      },
      "id_pass" => {
        "id" => "id",
        "passed" => "referrer_id"
      }
    }
  }
end

scope do
  # all
  test "create email button successfully" do |data|
    result = ShareProgress::Button.create(data)

    expected_result = {
      "id"=>12136,
      "page_url"=>"http://sumofus.org/",
      "page_title"=>"My Email button name",
      "button_template"=>"sp_em_large",
      "share_button_html"=>"

",
      "found_snippet"=>false,
      "is_active"=>false,
      "variants"=>{
        "facebook"=>[{
          "id"=>48542,
            "facebook_title"=>"SumOfUs",
            "facebook_description"=>"SumOfUs is a global movement of "\
            "consumers, investors, and workers all around the world, "\
            "standing together to hold corporations accountable for their "\
            "actions and forge a new, sustainable and just path for our "\
            "global economy. It's not going to be fast or easy. B",
            "facebook_thumbnail"=>"http://sumofus.org/wp-content/themes/pgm/"\
            "img/default-facebook.jpg"}],
        "email"=>[{
          "id"=>48539,
            "email_subject"=>"Email subject 1!",
            "email_body"=>"Email body 1 {LINK}"}, {
          "id"=>48540,
            "email_subject"=>"Email subject 2!",
            "email_body"=>"Email body 2 {LINK}"}, {
          "id"=>48541,
            "email_subject"=>"Email subject 3!",
            "email_body"=>"Email body 3 {LINK}"}],
        "twitter"=>[{
          "id"=>48543,
          "twitter_message"=>"SumOfUs {LINK}"}]},
      "advanced_options"=>{
        "automatic_traffic_routing"=>true,
        "buttons_optimize_actions"=>true,
        "customize_params"=>{
          "param"=>"param_to_use",
          "e"=>"email_source",
          "f"=>"facebook_source",
          "t"=>"twitter_source",
          "o"=>"dark_social_source"},
        "id_pass"=>{
          "id"=>"id",
          "passed"=>"referrer_id"}}
      }

    assert result == expected_result
  end

  test "create email button with wrong button_template" do |data|
    data["button_template"] = "sp_tw_large"

    result = ShareProgress::Button.create(data)

    expected_result = {:button_template=>[:not_valid]}

    assert result == expected_result
  end

  test "create email button with nil email_subject" do |data|
    data["variants"]["email"][0]["email_subject"] = nil

    result = ShareProgress::Button.create(data)

    expected_result = {:email_subject=>[:nil]}

    assert result == expected_result
  end

  test "create email button with empty email_subject" do |data|
    data["variants"]["email"][0]["email_subject"] = ""

    result = ShareProgress::Button.create(data)

    expected_result = {:email_subject=>[:empty]}

    assert result == expected_result
  end

  test "create email button with nil email_body" do |data|
    data["variants"]["email"][0]["email_body"] = nil

    result = ShareProgress::Button.create(data)

    expected_result = {:email_body=>[:nil]}

    assert result == expected_result
  end

  test "create email button with empty email_body" do |data|
    data["variants"]["email"][0]["email_body"] = ""

    result = ShareProgress::Button.create(data)

    expected_result = {:email_body=>[:empty]}

    assert result == expected_result
  end

  test "create email button with {LINK} not included in email_body" do |data|
    data["variants"]["email"][0]["email_body"] = "This is a content with no link"

    result = ShareProgress::Button.create(data)

    expected_result = {:email_body=>[:link_not_included]}

    assert result == expected_result
  end
end


text:
const parseIsSsrByDefault = (): boolean =>
  !(typeof window !== 'undefined' && window.document && window.document.createElement && window.setTimeout);

export interface GlobalConfig {
  isSsr?: boolean;
}

export type GlobalConfigKeys = 'isSsr';

export const Global = {
  isSsr: parseIsSsrByDefault(),

  get: (key: 'isSsr') => {
    return Global[key];
  },

  set: (key: GlobalConfigKeys | GlobalConfig, value?: any) => {
    if (typeof key === 'string') {
      Global[key] = value;
    } else {
      const keys = Object.keys(key);

      if (keys && keys.length) {
        keys.forEach((k: GlobalConfigKeys) => {
          Global[k] = key[k];
        });
      }
    }
  },
};