text:
<?php

namespace IMT\DataGrid\Filter\Reflection\Doctrine\ORM\Rule;

use IMT\DataGrid\Filter\RuleInterface;

/**
 * This class reflects the `bn` comparison operator as `does not begin with` on
 * Doctrine ORM Expr
 *
 * @author Igor Timoshenko <igor.timoshenko@i.ua>
 */
class BnRuleReflection extends AbstractRuleReflection
{
    /**
     * {@inheritDoc}
     */
    public function doReflect(RuleInterface $rule)
    {
        return $this->queryBuilder->expr()->not(
            $this->queryBuilder->expr()->like(
                $rule->getField(),
                sprintf('?%d', $this->parameterKey)
            )
        );
    }

    /**
     * {@inheritDoc}
     */
    public function setParameterValue($value)
    {
        $this->queryBuilder->setParameter(
            $this->parameterKey,
            sprintf('%s%%', $value)
        );
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.eclipse.php.internal.core.codeassist.strategies;

import org.eclipse.php.core.codeassist.ICompletionContext;
import org.eclipse.php.internal.core.codeassist.ProposalExtraInfo;

public class NamespaceNonFinalClassesStrategy extends NamespaceTypesStrategy {

	public NamespaceNonFinalClassesStrategy(ICompletionContext context) {
		super(context);
	}

	@Override
	protected int getExtraInfo() {
		return ProposalExtraInfo.TYPE_ONLY;
	}
}


text:
import './index-87ddde59.js';
import InputBehavior from './input-2fb848cb.js';

class TextAreaBehavior extends InputBehavior {
  static get params() {
    return {
      tag: 'textarea',
    };
  }
}

export default TextAreaBehavior;


text:
<?php
/**
 * /src/App/Services/Interfaces/Base.php
 *
 * @author  TLe, Tarmo Leppänen <tarmo.leppanen@protacon.com>
 */
namespace App\Services\Interfaces;

/**
 * Interface Base
 *
 * @category    Services
 * @package     App\Services\Interfaces
 * @author      TLe, Tarmo Leppänen <tarmo.leppanen@protacon.com>
 */
interface Base
{
}


text:
<?php

namespace Wind\Models\Relations;

/**
 * 关联user_profile作为主体信息的profile.
 */
trait HasOneUserTrait
{
    public function user()
    {
        return $this->hasOne('Wind\Models\UserModel', 'id', 'user_id')->select('name', 'phone');
    }
}


text:
struct SymbolTableEntry {
    AstNode* node;
    SemanticType type;
    TypeInfo typeinfo;
    std::vector<AstNode*> overloads;
    std::vector<std::pair<TypeInfo,AstNode*>> funcParams;
    std::vector<std::pair<TypeInfo,AstNode*>> funcParamsTypeInfo;
    void* address;
};

struct SymbolTable {
    std::unordered_map<std::string,SymbolTableEntry*> table;
    std::unordered_map<std::string,SymbolTable*> children;
    std::unordered_map<std::string,SymbolTable*> imports;
    SymbolTable* parent = nullptr;
    std::string name = "global";
    unsigned int scope = 0;
};

SymbolTable* addNewScope(SymbolTable* s, std::string name);
SymbolTable* getScope(SymbolTable* s, std::string name);
SymbolTable* getFileScope(SymbolTable* s);

void addVarEntry(SymbolTable* s, const TypeInfo& t, std::string name);
void addVarEntry(SymbolTable* s, SemanticType t, AstNode* n);
void updateVarEntry(SymbolTable* s, SemanticType t, const std::string& name);
void updateVarEntry(SymbolTable* s, const TypeInfo& t, const std::string& name);
void addFuncEntry(SymbolTable* s, SemanticType t, AstNode* n, const std::vector<std::pair<TypeInfo,AstNode*>>& p);
void addFuncEntry(SymbolTable* s, FuncDefNode* n);
std::vector<SymbolTableEntry*> getEntry(SymbolTable* s, const std::string& name);
std::vector<SymbolTableEntry*> getEntry(SymbolTable* s, const std::string& name, const std::string& scope);
SymbolTableEntry* getFirstEntry(SymbolTable* s, const std::string& name);
SymbolTableEntry* getEntryCurrentScope(SymbolTable*s, const std::string& name);
const std::vector<SymbolTableEntry*> getFunctionEntries(SymbolTable* s);
void printTable(SymbolTable* s);
#endif


text:
package org.jivesoftware.smackx.pubsub.form;

import java.util.Collection;
import java.util.Date;

import org.jivesoftware.smackx.pubsub.PresenceState;
import org.jivesoftware.smackx.pubsub.SubscribeOptionFields;
import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.ListMultiFormField;
import org.jivesoftware.smackx.xdata.form.FillableForm;
import org.jivesoftware.smackx.xdata.packet.DataForm;

public class FillableSubscribeForm extends FillableForm implements SubscribeFormReader {

    FillableSubscribeForm(DataForm dataForm) {
        super(dataForm);
    }

    /**
     * Sets whether an entity wants to receive notifications.
     *
     * @param deliverNotifications TODO javadoc me please
     */
    public void setDeliverOn(boolean deliverNotifications) {
        writeBoolean(SubscribeOptionFields.deliver.getFieldName(), deliverNotifications);
    }

    /**
     * Sets whether notifications should be delivered as aggregations or not.
     *
     * @param digestOn true to aggregate, false otherwise
     */
    public void setDigestOn(boolean digestOn) {
        writeBoolean(SubscribeOptionFields.digest.getFieldName(), digestOn);
    }

    /**
     * Sets the minimum number of milliseconds between sending notification digests.
     *
     * @param frequency The frequency in milliseconds
     */
    public void setDigestFrequency(int frequency) {
        write(SubscribeOptionFields.digest_frequency.getFieldName(), frequency);
    }

    /**
     * Sets the time at which the leased subscription will expire, or has expired.
     *
     * @param expire The expiry date
     */
    public void setExpiry(Date expire) {
        write(SubscribeOptionFields.expire.getFieldName(), expire);
    }

    /**
     * Sets whether the entity wants to receive an XMPP message body in
     * addition to the payload format.
     *
     * @param include true to receive the message body, false otherwise
     */
    public void setIncludeBody(boolean include) {
        writeBoolean(SubscribeOptionFields.include_body.getFieldName(), include);
    }

    /**
     * Sets the list of {@link PresenceState} for which an entity wants
     * to receive notifications.
     *
     * @param stateValues The list of states
     */
    public void setShowValues(Collection<PresenceState> stateValues) {
        ListMultiFormField.Builder builder = FormField.listMultiBuilder(SubscribeOptionFields.show_values.getFieldName());
        for (PresenceState state : stateValues) {
            builder.addValue(state.toString());
        }

        write(builder.build());
    }
}


text: echo "DISABLE_OOB=ON" >> $HOME/.sqlnet.ora


text:
<?php

return [
    'alt-album'           => 'album cover of :album by :artist',
    'alt-artist'          => 'photo of :artist',
    'alt-track-cover'     => 'cover of :track by :artist',
    'alt-user-avatar'     => 'avatar of user :user',
    'scrobbled-since'     => 'Scrobbled :scrobbled tracks since July 2006.',
    'not-listening'       => 'Not listening to anything at the moment...',
    'page-description'    => 'An overview of the music that I listened to over the last month.',
    'page-intro'          => 'Below is an overview of the music that I\'ve listened to over the past month. The data is taken from the last.fm API with a open source package that I developed for this purpose.',
    'page-title'          => 'Music that I listen to',
    'title-albums'        => 'Top albums',
    'title-artists'       => 'Top artists',
    'title-now-listening' => 'Now listening',
    'title-user'          => 'User',
];


text:
package nz.co.iswe.android.airplay;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;

import com.fenggit.util.Constants;
import com.fenggit.util.LogManager;

import org.apache.http.conn.util.InetAddressUtils;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.group.ChannelGroup;
import org.jboss.netty.channel.group.ChannelGroupFuture;
import org.jboss.netty.channel.group.DefaultChannelGroup;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.jboss.netty.handler.execution.ExecutionHandler;
import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;

import java.io.IOException;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.jmdns.JmDNS;
import javax.jmdns.ServiceInfo;

import nz.co.iswe.android.airplay.network.NetworkUtils;
import nz.co.iswe.android.airplay.network.raop.RaopRtspPipelineFactory;

/**
 * Android AirPlay Server Implementation
 *
 * @author Rafael Almeida
 *
 */
public class AirPlayServer implements Runnable {

//	private static final Logger LOG = Logger.getLogger(AirPlayServer.class.getName());

	/**
	 * The DACP service type
	 */
//	static final String AIR_REMOTE_CONTROL_SERVICE_TYPE = "_dacp._tcp.local.";
//	static final Map<String, String> AIR_DACP_SERVICE_PROPERTIES = map(
//		"txtvers", "1",
//		"Ver", "131075",
//		"DbId", "63B5E5C0C201542E",
//		"OSsi", "0x1F5"
//	);

	/**
	 * The AirTunes/RAOP service type
	 */
	static final String AIR_TUNES_SERVICE_TYPE = "_raop._tcp.local.";

	/**
	 * The AirTunes/RAOP M-DNS service properties (TXT record)
	 */
	static final Map<String, String> AIRTUNES_SERVICE_PROPERTIES = map(
		"txtvers", "1",
		"tp", "UDP",
		"ch", "2",
		"ss", "16",
		"sr", "44100",
		"pw", "false",
		"sm", "false",
		"sv", "false",
		"ek", "1",
		"et", "0,1",
		"cn", "0,1",
		"vn", "3"
	);
	Context context;
	private static AirPlayServer instance = null;
	public static AirPlayServer getIstance(Context context){
		if(instance == null){
			instance = new AirPlayServer(context);
		}
		return instance;
	}

	/**
	 * Global executor service. Used e.g. to initialize the various netty channel factories
	 */
	protected ExecutorService executorService;

	/**
	 * Channel execution handler. Spreads channel message handling over multiple threads
	 */
	protected ExecutionHandler channelExecutionHandler;

	/**
	 * All open RTSP channels. Used to close all open challens during shutdown.
	 */
	protected ChannelGroup channelGroup;

	/**
	 * JmDNS instances (one per IP address). Used to unregister the mDNS services
	 * during shutdown.
	 */
	protected List<JmDNS> jmDNSInstances;

	/**
	 * The AirTunes/RAOP RTSP port
	 */
	private int rtspPort = 5000; //default value

	private AirPlayServer(Context context){

		this.context = context ;

		//create executor service
		executorService = Executors.newCachedThreadPool();

		//create channel execution handler
		channelExecutionHandler = new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(4, 0, 0));

		//channel group
		channelGroup = new DefaultChannelGroup();

		//list of mDNS services
		jmDNSInstances = new java.util.LinkedList<JmDNS>();
	}

	public int getRtspPort() {
		return rtspPort;
	}

	public void setRtspPort(int rtspPort) {
		this.rtspPort = rtspPort;
	}

	public void run() {
		LogManager.e("start to service loading.... ") ;
		long start = System.currentTimeMillis() ;
		startService();
		LogManager.e("start to service success.... ="+(System.currentTimeMillis()-start)) ;
	}

	@SuppressLint("NewApi")
	private void startService() {
		/* Make sure AirPlay Server shuts down gracefully */
    	Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
			@Override
			public void run() {
				onShutdown();
			}
    	}));

    	LogManager.i("VM Shutdown Hook added sucessfully!");

    	/* Create AirTunes RTSP server */
		final ServerBootstrap airTunesRtspBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(executorService, executorService));
		airTunesRtspBootstrap.setPipelineFactory(new RaopRtspPipelineFactory(context));

		airTunesRtspBootstrap.setOption("reuseAddress", true);
		airTunesRtspBootstrap.setOption("child.tcpNoDelay", true);
		airTunesRtspBootstrap.setOption("child.keepAlive", true);

		try {
			//Caused by: java.net.BindException: bind failed: EADDRINUSE (Address already in use)
			channelGroup.add(airTunesRtspBootstrap.bind(new InetSocketAddress(Inet4Address.getByName("0.0.0.0"), getRtspPort())));
		}
		catch (UnknownHostException e) {
			LogManager.e("Failed to bind RTSP Bootstrap on port: " + getRtspPort()+"||"+Log.getStackTraceString(e));
		}

        LogManager.i("Launched RTSP service on port " + getRtspPort());

        //get Network details
        NetworkUtils networkUtils = NetworkUtils.getInstance();

//        String hostName = networkUtils.getHostUtils();
        String hostName = Constants.IKEY_AIRPLAY_SERVER_NMAE;
    	Log.w("hefeng", "servName : " + hostName);

		String hardwareAddressString = networkUtils.getHardwareAddressString();

        try {
            /* Create mDNS responders. */
            synchronized (jmDNSInstances) {
                for (final NetworkInterface iface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
                    if (iface.isLoopback() || iface.isPointToPoint() || !iface.isUp()) {
                        continue;
                    }

                    ArrayList<InetAddress> inets = Collections.list(iface.getInetAddresses());

                    for (final InetAddress addr : inets) {
                        if (!(addr instanceof Inet4Address) && !(addr instanceof Inet6Address)) {
                            continue;
                        }
                        try {
                            /* Create mDNS responder for address */
                            final JmDNS jmDNS = JmDNS.create(addr, hostName + "-jmdns");
                            jmDNSInstances.add(jmDNS);

                            /* Publish RAOP service */
                            final ServiceInfo airTunesServiceInfo = ServiceInfo.create(AIR_TUNES_SERVICE_TYPE,
//					    		hardwareAddressString + "@" + hostName + " (" + iface.getName() + ")",
                                    hardwareAddressString + "@" + hostName, getRtspPort(), 0 /* weight */, 0 /* priority */,
                                    AIRTUNES_SERVICE_PROPERTIES);
                            jmDNS.registerService(airTunesServiceInfo);
                            LogManager.w("Registered AirTunes service '" + airTunesServiceInfo.getName() + "' on " + addr);
                        } catch (final Throwable e) {
                            LogManager.e("Failed to publish service on " + addr + "||" + Log.getStackTraceString(e));
                        }
                    }

                }
            }

        } catch (SocketException e) {
            LogManager.e("Failed register mDNS services" + "||" + Log.getStackTraceString(e));
        }
	}

    public InetAddress getInetAddress() {
        try {
            Enumeration<NetworkInterface> networks;
            Enumeration<InetAddress> inets;
            NetworkInterface network;
            InetAddress inetAddress;

            for (networks = NetworkInterface.getNetworkInterfaces(); networks.hasMoreElements();) {
                network = networks.nextElement();
                for (inets = network.getInetAddresses(); inets.hasMoreElements();) {
                    inetAddress = inets.nextElement();
                    if (!inetAddress.isLoopbackAddress() && InetAddressUtils.isIPv4Address(inetAddress.getHostAddress())) {

                        return inetAddress;
                    }
                }

            }
        } catch (SocketException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }

	//When the app is shutdown
	protected void onShutdown() {
		/* Close channels */
		final ChannelGroupFuture allChannelsClosed = channelGroup.close();

		/* Stop all mDNS responders */
		synchronized(jmDNSInstances) {
			for(final JmDNS jmDNS: jmDNSInstances) {
				try {
					jmDNS.unregisterAllServices();
					LogManager.i("Unregistered all services on " + jmDNS.getInterface());
				}
				catch (final IOException e) {
					LogManager.e("Level.WARNING Failed to unregister some services " +Log.getStackTraceString(e));

				}
			}
		}

		/* Wait for all channels to finish closing */
		allChannelsClosed.awaitUninterruptibly();

		/* Stop the ExecutorService */
		executorService.shutdown();

		/* Release the OrderedMemoryAwareThreadPoolExecutor */
		channelExecutionHandler.releaseExternalResources();

	}

	/**
	 * Map factory. Creates a Map from a list of keys and values
	 *
	 * @param keys_values key1, value1, key2, value2, ...
	 * @return a map mapping key1 to value1, key2 to value2, ...
	 */
	private static Map<String, String> map(final String... keys_values) {
		assert keys_values.length % 2 == 0;
		final Map<String, String> map = new java.util.HashMap<String, String>(keys_values.length / 2);
		for(int i=0; i < keys_values.length; i+=2)
			map.put(keys_values[i], keys_values[i+1]);
		return Collections.unmodifiableMap(map);
	}

	public ChannelHandler getChannelExecutionHandler() {
		return channelExecutionHandler;
	}

	public ChannelGroup getChannelGroup() {
		return channelGroup;
	}

	public ExecutorService getExecutorService() {
		return executorService;
	}

}


text:
Module Name: AzureRM.KeyVault
Module Guid: D48CF693-4125-4D2D-8790-1514F44CE325
Download Help Link: http://go.microsoft.com/fwlink/?linkid=390762
Help Version: 4.0.0.0
Locale: en-US
---

# AzureRM.KeyVault Module
## Description
This topic displays help topics for the Azure Key Vault Cmdlets.

## AzureRM.KeyVault Cmdlets
### [Add-AzureKeyVaultCertificate](Add-AzureKeyVaultCertificate.md)
Adds a certificate to a key vault.

### [Add-AzureKeyVaultCertificateContact](Add-AzureKeyVaultCertificateContact.md)
Adds a contact for certificate notifications.

### [Add-AzureKeyVaultKey](Add-AzureKeyVaultKey.md)
Creates a key in a key vault or imports a key into a key vault.

### [Add-AzureKeyVaultManagedStorageAccount](Add-AzureKeyVaultManagedStorageAccount.md)
Adds an existing storage account to a key vault for automatic management of its storage account keys.

### [Backup-AzureKeyVaultKey](Backup-AzureKeyVaultKey.md)
Backs up a key in a key vault.

### [Backup-AzureKeyVaultSecret](Backup-AzureKeyVaultSecret.md)
Backs up a secret in a key vault.

### [Get-AzureKeyVaultCertificate](Get-AzureKeyVaultCertificate.md)
Gets a certificate from a key vault.

### [Get-AzureKeyVaultCertificateContact](Get-AzureKeyVaultCertificateContact.md)
Gets contacts that are registered for certificate notifications for a key vault.

### [Get-AzureKeyVaultCertificateIssuer](Get-AzureKeyVaultCertificateIssuer.md)
Gets a certificate issuer for a key vault.

### [Get-AzureKeyVaultCertificateOperation](Get-AzureKeyVaultCertificateOperation.md)
Gets the status of a certificate operation.

### [Get-AzureKeyVaultCertificatePolicy](Get-AzureKeyVaultCertificatePolicy.md)
Gets the policy for a certificate in a key vault.

### [Get-AzureKeyVaultKey](Get-AzureKeyVaultKey.md)
Gets Key Vault keys.

### [Get-AzureKeyVaultManagedStorageAccount](Get-AzureKeyVaultManagedStorageAccount.md)
Gets Key Vault managed Azure Storage Accounts.

### [Get-AzureKeyVaultManagedStorageSasDefinition](Get-AzureKeyVaultManagedStorageSasDefinition.md)
Gets Key Vault managed Storage SAS Definitions.

### [Get-AzureKeyVaultSecret](Get-AzureKeyVaultSecret.md)
Gets the secrets in a key vault.

### [Get-AzureRmKeyVault](Get-AzureRmKeyVault.md)
Gets key vaults.

### [Import-AzureKeyVaultCertificate](Import-AzureKeyVaultCertificate.md)
Imports a certificate to a key vault.

### [New-AzureKeyVaultCertificateAdministratorDetails](New-AzureKeyVaultCertificateAdministratorDetails.md)
Creates an in-memory certificate administrator details object.

### [New-AzureKeyVaultCertificateOrganizationDetails](New-AzureKeyVaultCertificateOrganizationDetails.md)
Creates an in-memory certificate organization details object.

### [New-AzureKeyVaultCertificatePolicy](New-AzureKeyVaultCertificatePolicy.md)
Creates an in-memory certificate policy object.

### [New-AzureRmKeyVault](New-AzureRmKeyVault.md)
Creates a key vault.

### [Remove-AzureKeyVaultCertificate](Remove-AzureKeyVaultCertificate.md)
Removes a certificate from a key vault.

### [Remove-AzureKeyVaultCertificateContact](Remove-AzureKeyVaultCertificateContact.md)
Deletes a contact that is registered for certificate notifications from a key vault.

### [Remove-AzureKeyVaultCertificateIssuer](Remove-AzureKeyVaultCertificateIssuer.md)
Deletes a certificate issuer from a key vault.

### [Remove-AzureKeyVaultCertificateOperation](Remove-AzureKeyVaultCertificateOperation.md)
Deletes a certificate operation from a key vault.

### [Remove-AzureKeyVaultKey](Remove-AzureKeyVaultKey.md)
Deletes a key in a key vault.

### [Remove-AzureKeyVaultManagedStorageAccount](Remove-AzureKeyVaultManagedStorageAccount.md)
Removes a Key Vault managed Azure Storage Account and all associated SAS definitions.

### [Remove-AzureKeyVaultManagedStorageSasDefinition](Remove-AzureKeyVaultManagedStorageSasDefinition.md)
Removes a Key Vault managed Azure Storage SAS definitions.

### [Remove-AzureKeyVaultSecret](Remove-AzureKeyVaultSecret.md)
Deletes a secret in a key vault.

### [Remove-AzureRmKeyVault](Remove-AzureRmKeyVault.md)
Deletes a key vault.

### [Remove-AzureRmKeyVaultAccessPolicy](Remove-AzureRmKeyVaultAccessPolicy.md)
Removes all permissions for a user or application from a key vault.

### [Restore-AzureKeyVaultKey](Restore-AzureKeyVaultKey.md)
Creates a key in a key vault from a backed-up key.

### [Restore-AzureKeyVaultSecret](Restore-AzureKeyVaultSecret.md)
Creates a secret in a key vault from a backed-up secret.

### [Set-AzureKeyVaultCertificateAttribute](Set-AzureKeyVaultCertificateAttribute.md)
Modifies editable attributes of a certificate.

### [Set-AzureKeyVaultCertificateIssuer](Set-AzureKeyVaultCertificateIssuer.md)
Sets a certificate issuer in a key vault.

### [Set-AzureKeyVaultCertificatePolicy](Set-AzureKeyVaultCertificatePolicy.md)
Creates or updates the policy for a certificate in a key vault.

### [Set-AzureKeyVaultKeyAttribute](Set-AzureKeyVaultKeyAttribute.md)
Updates the attributes of a key in a key vault.

### [Set-AzureKeyVaultManagedStorageSasDefinition](Set-AzureKeyVaultManagedStorageSasDefinition.md)
Sets a Shared Access Signature (SAS) definition with Key Vault for a given Key Vault managed Azure Storage Account.

### [Set-AzureKeyVaultSecret](Set-AzureKeyVaultSecret.md)
Creates or updates a secret in a key vault.

### [Set-AzureKeyVaultSecretAttribute](Set-AzureKeyVaultSecretAttribute.md)
Updates attributes of a secret in a key vault.

### [Set-AzureRmKeyVaultAccessPolicy](Set-AzureRmKeyVaultAccessPolicy.md)
Grants or modifies existing permissions for a user, application, or security group to perform operations with a key vault.

### [Stop-AzureKeyVaultCertificateOperation](Stop-AzureKeyVaultCertificateOperation.md)
Cancels a certificate operation in key vault.

### [Undo-AzureKeyVaultKeyRemoval](Undo-AzureKeyVaultKeyRemoval.md)
Recovers a deleted key in a key vault into an active state.

### [Undo-AzureKeyVaultSecretRemoval](Undo-AzureKeyVaultSecretRemoval.md)
Recovers a deleted secret in a key vault into an active state.

### [Undo-AzureRmKeyVaultRemoval](Undo-AzureRmKeyVaultRemoval.md)
Recovers a deleted key vault into an active state.

### [Update-AzureKeyVaultManagedStorageAccount](Update-AzureKeyVaultManagedStorageAccount.md)
Update editable attributes of a Key Vault managed Azure Storage Account.

### [Update-AzureKeyVaultManagedStorageAccountKey](Update-AzureKeyVaultManagedStorageAccountKey.md)
Regenerates the storage account key associated with a storage account managed by Key Vault.


text:
layout: index
title: setbackgroundopacity
---

"setbackgroundopacity" is a [boolean](../types/boolean.html) attribute. If set to true, the opacity specified in [backgroundopacity](backgroundopacity.html) will be applied.


text:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "native_client/src/include/portability.h"
#include "native_client/src/include/nacl_macros.h"

#include "native_client/src/trusted/service_runtime/env_cleanser.h"
#include "native_client/src/trusted/service_runtime/env_cleanser_test.h"

/*
 * Everything that starts with this prefix is allowed (but the prefix is
 * stripped away).
*/
#define NACL_ENV_PREFIX "NACLENV_"
#define NACL_ENV_PREFIX_LENGTH 8

void NaClEnvCleanserCtor(struct NaClEnvCleanser *self, int with_whitelist) {
  self->with_whitelist = with_whitelist;
  self->cleansed_environ = (char const **) NULL;
}

/*
 * Environment variables names are from IEEE Std 1003.1-2001, with
 * additional ones from locale(7) from glibc / linux.  The entries
 * must be sorted, in ASCII order, for the bsearch to run correctly.
 */
/* static -- not static for testing */
char const *const kNaClEnvWhitelist[] = {
  "LANG",
  "LC_ADDRESS",
  "LC_ALL",
  "LC_COLLATE",
  "LC_CTYPE",
  "LC_IDENTIFICATION",
  "LC_MEASUREMENT",
  "LC_MESSAGES",
  "LC_MONETARY",
  "LC_NAME",
  "LC_NUMERIC",
  "LC_PAPER",
  "LC_TELEPHONE",
  "LC_TIME",
  "NACLVERBOSITY",
  "NACL_PLUGIN_DEBUG",      /* src/trusted/plugin/srpc/utility.cc */
  "NACL_SRPC_DEBUG",        /* src/shared/srpc/utility.c */
  NULL,
};

/* left arg is key, right arg is table entry */
static int EnvCmp(void const *vleft, void const *vright) {
  char const *left = *(char const *const *) vleft;
  char const *right = *(char const *const *) vright;
  char cleft, cright;

  while ((cleft = *left) == (cright = *right)
         && '\0' != cleft
         && '\0' != cright) {
    ++left;
    ++right;
  }
  if ('=' == cleft && '\0' == cright) {
    return 0;
  }
  return (0xff & cleft) - (0xff & cright);
}

int NaClEnvIsPassThroughVar(char const *env_entry) {
  return strlen(env_entry) > NACL_ENV_PREFIX_LENGTH &&
      0 == strncmp(env_entry, NACL_ENV_PREFIX,
          NACL_ENV_PREFIX_LENGTH);
}

int NaClEnvInWhitelist(char const *env_entry) {
  return NULL != bsearch((void const *) &env_entry,
                         (void const *) kNaClEnvWhitelist,
                         NACL_ARRAY_SIZE(kNaClEnvWhitelist) - 1,  /* NULL */
                         sizeof kNaClEnvWhitelist[0],
                         EnvCmp);
}

/* PRE: sizeof(char *) is a power of 2 */

/*
 * Initializes the object with a filtered environment.
 *
 * May return false on errors, e.g., out-of-memory.
 */
int NaClEnvCleanserInit(struct NaClEnvCleanser *self, char const *const *envp,
    char const * const *extra_env) {
  char const *const *p;
  size_t num_env = 0;
  size_t ptr_bytes = 0;
  const size_t kMaxSize = ~(size_t) 0;
  const size_t ptr_size_mult_overflow_mask = ~(kMaxSize / sizeof *envp);
  char const **ptr_tbl;
  size_t env;

  /*
   * let n be a size_t.  if n & ptr_size_mult_overflow_mask is set,
   * then n*sizeof(void *) will have an arithmetic overflow.
   */

  if (NULL == envp || NULL == *envp) {
    self->cleansed_environ = NULL;
    return 1;
  }
  for (p = envp; NULL != *p; ++p) {
    if (!(self->with_whitelist && NaClEnvInWhitelist(*p)) &&
        !NaClEnvIsPassThroughVar(*p)) {
      continue;
    }
    if (num_env == kMaxSize) {
      /* would overflow */
      return 0;
    }
    ++num_env;
  }

  if (extra_env) {
    for (p = extra_env; NULL != *p; ++p) {
      if (num_env == kMaxSize) {
        /* would overflow */
        return 0;
      }
      ++num_env;
    }
  }

  /* pointer table -- NULL pointer terminated */
  if (0 != ((1 + num_env) & ptr_size_mult_overflow_mask)) {
    return 0;
  }
  ptr_bytes = (1 + num_env) * sizeof(*envp);

  ptr_tbl = (char const **) malloc(ptr_bytes);
  if (NULL == ptr_tbl) {
    return 0;
  }

  /* this assumes no other thread is tweaking envp */
  for (env = 0, p = envp; NULL != *p; ++p) {
    if (NaClEnvIsPassThroughVar(*p)) {
      ptr_tbl[env] = *p + NACL_ENV_PREFIX_LENGTH;
    } else if (self->with_whitelist && NaClEnvInWhitelist(*p)) {
      ptr_tbl[env] = *p;
    } else {
      continue;
    }
    ++env;
  }
  if (extra_env) {
    for (p = extra_env; NULL != *p; ++p) {
      ptr_tbl[env] = *p;
      ++env;
    }
  }
  if (num_env != env) {
    free((void *) ptr_tbl);
    return 0;
  }
  ptr_tbl[env] = NULL;
  self->cleansed_environ = ptr_tbl;

  return 1;
}

char const *const *NaClEnvCleanserEnvironment(struct NaClEnvCleanser *self) {
  return (char const *const *) self->cleansed_environ;
}

void NaClEnvCleanserDtor(struct NaClEnvCleanser *self) {
  free((void *) self->cleansed_environ);
  self->cleansed_environ = NULL;
}


text:
package cn.edu.ruc.dbiir.basic.polymorphism.shape;

/**
 * Created by jelly on 06/04/16.
 */
public class ShapeTest {
    private static ShapeRandomGenerator gen = new ShapeRandomGenerator();

    public static void main(String[] args) {
        Shape[] shapes = new Shape[5];
        for (int i = 0; i < shapes.length; i++) {
            shapes[i] = gen.next();
        }
        for (Shape sp: shapes) {
            sp.draw();
            sp.erase();
        }
    }
}


text:
package com.jt.dao;

import com.jt.bean.Order;

import java.util.List;

/**
 * since 2015/2/26.
 */
public interface OrderDao {

    long add(Order order);

    Order findByOrderNo(String orderNo);

    List<Order> findByUserId(long userId);
}


text:
<snan>Total:</snan> {{$ctrl.movies.length}} |
<snan>Liked:</snan> {{$ctrl.liked}}  |
<snan>Disliked:</snan> {{$ctrl.disliked}} |
<snan>Unspecified:</snan> {{$ctrl.unspecified}}


text:
module DeviseSecurityExtension::Patches
  module PasswordsControllerSecurityQuestion
    extend ActiveSupport::Concern
    included do
      define_method :create do
        # only find via email, not login
        resource = resource_class.find_or_initialize_with_error_by(:email, params[resource_name][:email], :not_found)

        if valid_captcha? params[:captcha] or
           (resource.security_question_answer.present? and resource.security_question_answer == params[:security_question_answer])
          self.resource = resource_class.send_reset_password_instructions(params[resource_name])
          if successfully_sent?(resource)
            respond_with({}, :location => new_session_path(resource_name))
          else
            respond_with(resource)
          end
        else
          flash[:alert] = t('devise.invalid_security_question') if is_navigational_format?
          respond_with({}, :location => new_password_path(resource_name))
        end
      end
    end
  end
end


text:
module Flame
	class Controller
		## Helper class for cookies
		class Cookies
			## Create an instance of Cookies
			## @param request_cookies [Hash{String=>Object}] cookies from request
			## @param response [Flame::Dispatcher::Response, Rack::Response]
			##   response object for cookies setting
			def initialize(request_cookies, response)
				@request_cookies = request_cookies
				@response = response
			end

			## Get request cookies
			## @param key [String, Symbol] name of cookie
			## @return [Object] value of cookie
			def [](key)
				@request_cookies[key.to_s]
			end

			## Set (or delete) cookies for response
			## @param key [String, Symbol] name of cookie
			## @param new_value [Object, Hash, nil] value of cookie or Hash with `:value` and options
			## @example Set new value to `cat` cookie
			##   cookies['cat'] = 'nice cat'
			## @example Set new value to `cat` cookie with `Max-Age` 60 seconds
			##   cookies['cat'] = { value: 'nice cat', max_age: 60 }
			## @example Delete `cat` cookie
			##   cookies['cat'] = nil
			def []=(key, new_value)
				case new_value
				when NilClass
					@response.delete_cookie(key.to_s, path: '/')
				when Hash
					@response.set_cookie(key.to_s, new_value)
				else
					@response.set_cookie(key.to_s, value: new_value, path: '/')
				end
			end
		end
	end
end


text:
package org.apache.shiro.util;

import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.PermissionResolver;
import org.apache.shiro.lang.util.StringUtils;

import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;

/**
 * Utility class to help with String-to-Permission object resolution.
 *
 * @since 0.1
 */
public class PermissionUtils {

    public static Set<Permission> resolveDelimitedPermissions(String s, PermissionResolver permissionResolver) {
        Set<String> permStrings = toPermissionStrings(s);
        return resolvePermissions(permStrings, permissionResolver);
    }

    public static Set<String> toPermissionStrings(String permissionsString) {
        String[] tokens = StringUtils.split(permissionsString);
        if (tokens != null && tokens.length > 0) {
            return new LinkedHashSet<String>(Arrays.asList(tokens));
        }
        return null;
    }

    public static Set<Permission> resolvePermissions(Collection<String> permissionStrings, PermissionResolver permissionResolver) {
        Set<Permission> permissions = new LinkedHashSet<Permission>(permissionStrings.size());
        for (String permissionString : permissionStrings) {
            permissions.add(permissionResolver.resolvePermission(permissionString));
        }
        return permissions;
    }
}


text:
function(doc) {

    // !code lib/alignment.js

    if (doc.doc_type == "resource_data" && doc.resource_data && doc.resource_locator && doc.node_timestamp) {
        var nodeTimestamp = convertDateToSeconds(doc);
        var parser = function (conformsToText) {
            var seen = {};
            for (re in ASNPatterns){
                var stds = conformsToText.match(ASNPatterns[re]);
                for (s in stds) {
                    if (!seen[s]) {

                        emit([stds[s], doc.resource_locator], nodeTimestamp);
                        seen[s] = 1;
                    }
                }
            }
        };

        Alignment.parseDCT_ConformsTo(doc.resource_data, parser);
    }

}


text:
<?php

namespace OCA\Activity\Tests;

abstract class TestCase extends \Test\TestCase {
}


text:
namespace Tiver.Fowl.Core.Attributes
{
    using System;

    [AttributeUsage(AttributeTargets.Class)]
    public sealed class WebDriverTestAttribute : Attribute
    {
    }
}


text:
#import "Mimetypes.h"

const NSString * htmlMimeType = @"text/html";
const NSString * textMimeType = @"text/plain";
const NSString * jpegMimeType = @"image/jpeg";
const NSString * svgMimeType = @"image/svg+xml";

static NSDictionary * mimeTypeFromExtensionDict = nil;

@implementation Mimetypes

+ (void)initialize
{
	if (mimeTypeFromExtensionDict == nil)
	{
		mimeTypeFromExtensionDict = [[NSDictionary alloc] initWithObjectsAndKeys:
									 @"image/png",@"png",@"image/gif",@"gif",
									 jpegMimeType,@"jpg",jpegMimeType,@"jpeg",
									 @"image/x-icon",@"ico",
									 htmlMimeType,@"html",htmlMimeType,@"htm",
									 textMimeType,@"text",textMimeType,@"txt",
									 svgMimeType,@"svgz",svgMimeType,@"svg",
									 @"text/json",@"json",
									 @"text/javascript",@"js",
									 @"text/x-javascript",@"js",
									 @"application/x-javascript",@"js",
									 @"text/css",@"css",
									 @"text/xml",@"xml",
									 @"audio/x-wav",@"wav",
									 @"video/mpeg",@"mov",
									 @"video/mpeg",@"m4v",
									 nil];
	}
}

+ (NSString *)extensionForMimeType:(NSString *)mimetype
{
	[Mimetypes initialize];
	for (NSString *key in mimeTypeFromExtensionDict)
	{
		NSString *value = [mimeTypeFromExtensionDict objectForKey:key];
		if ([value isEqualToString:mimetype])
		{
			return key;
		}
	}
	return @"bin";
}

+ (NSString *)mimeTypeForExtension:(NSString *)ext
{
	[Mimetypes initialize];
	NSString *result=[mimeTypeFromExtensionDict objectForKey:[ext pathExtension]];
	if (result == nil){
		result = @"application/octet-stream";
	}
	return result;
}

@end


text:
package org.apache.ivory.converter;

import junit.framework.Assert;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.ivory.Tag;
import org.apache.ivory.entity.ClusterHelper;
import org.apache.ivory.entity.EntityUtil;
import org.apache.ivory.entity.FeedHelper;
import org.apache.ivory.entity.store.ConfigurationStore;
import org.apache.ivory.entity.v0.EntityType;
import org.apache.ivory.entity.v0.Frequency;
import org.apache.ivory.entity.v0.SchemaHelper;
import org.apache.ivory.entity.v0.cluster.Cluster;
import org.apache.ivory.entity.v0.cluster.Interfacetype;
import org.apache.ivory.entity.v0.feed.Feed;
import org.apache.ivory.entity.v0.feed.LocationType;
import org.apache.ivory.entity.v0.process.Process;
import org.apache.ivory.entity.v0.process.Validity;
import org.apache.ivory.oozie.bundle.BUNDLEAPP;
import org.apache.ivory.oozie.coordinator.CONFIGURATION.Property;
import org.apache.ivory.oozie.coordinator.COORDINATORAPP;
import org.apache.ivory.oozie.coordinator.SYNCDATASET;
import org.apache.ivory.oozie.workflow.ACTION;
import org.apache.ivory.oozie.workflow.DECISION;
import org.apache.ivory.oozie.workflow.WORKFLOWAPP;
import org.apache.ivory.util.ApplicationProperties;
import org.apache.ivory.util.StartupProperties;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStreamReader;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

public class OozieProcessMapperTest extends AbstractTestBase{

    private String hdfsUrl;

    @BeforeClass
    public void setUpDFS() throws Exception {
        Configuration conf = new Configuration();
        new MiniDFSCluster(conf , 1, true, null);
        hdfsUrl = conf.get("fs.default.name");
    }

    @BeforeMethod
    public void setUp() throws Exception {
        super.setup();

        ConfigurationStore store = ConfigurationStore.get();
        Cluster cluster = store.get(EntityType.CLUSTER, "corp");
        ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(hdfsUrl);

        Process process = store.get(EntityType.PROCESS, "clicksummary");
        Path wfpath = new Path(process.getWorkflow().getPath());
        assert new Path(hdfsUrl).getFileSystem(new Configuration()).mkdirs(wfpath);
    }

    public void testDefCoordMap(Process process, COORDINATORAPP coord) throws Exception {
        assertEquals("IVORY_PROCESS_DEFAULT_" + process.getName(), coord.getName());
        Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
        assertEquals(SchemaHelper.formatDateUTC(processValidity.getStart()), coord.getStart());
        assertEquals(SchemaHelper.formatDateUTC(processValidity.getEnd()), coord.getEnd());
        assertEquals("${coord:"+process.getFrequency().toString()+"}", coord.getFrequency());
        assertEquals(process.getTimezone().getID(), coord.getTimezone());

        assertEquals(process.getParallel()+"", coord.getControls().getConcurrency());
        assertEquals(process.getOrder().name(), coord.getControls().getExecution());

        assertEquals(process.getInputs().getInputs().get(0).getName(), coord.getInputEvents().getDataIn().get(0).getName());
        assertEquals(process.getInputs().getInputs().get(0).getName(), coord.getInputEvents().getDataIn().get(0).getDataset());
        assertEquals("${"+process.getInputs().getInputs().get(0).getStart()+"}", coord.getInputEvents().getDataIn().get(0).getStartInstance());
        assertEquals("${"+process.getInputs().getInputs().get(0).getEnd()+"}", coord.getInputEvents().getDataIn().get(0).getEndInstance());

        assertEquals(process.getInputs().getInputs().get(1).getName(), coord.getInputEvents().getDataIn().get(1).getName());
        assertEquals(process.getInputs().getInputs().get(1).getName(), coord.getInputEvents().getDataIn().get(1).getDataset());
        assertEquals("${"+process.getInputs().getInputs().get(1).getStart()+"}", coord.getInputEvents().getDataIn().get(1).getStartInstance());
        assertEquals("${" + process.getInputs().getInputs().get(1).getEnd()+"}", coord.getInputEvents().getDataIn().get(1).getEndInstance());

        assertEquals(process.getOutputs().getOutputs().get(0).getName()+"stats", coord.getOutputEvents().getDataOut().get(1).getName());
        assertEquals(process.getOutputs().getOutputs().get(0).getName()+"meta", coord.getOutputEvents().getDataOut().get(2).getName());
        assertEquals(process.getOutputs().getOutputs().get(0).getName()+"tmp", coord.getOutputEvents().getDataOut().get(3).getName());

        assertEquals(process.getOutputs().getOutputs().get(0).getName(), coord.getOutputEvents().getDataOut().get(0).getName());
        assertEquals("${"+process.getOutputs().getOutputs().get(0).getInstance()+"}", coord.getOutputEvents().getDataOut().get(0).getInstance());
        assertEquals(process.getOutputs().getOutputs().get(0).getName(), coord.getOutputEvents().getDataOut().get(0).getDataset());

        assertEquals(6, coord.getDatasets().getDatasetOrAsyncDataset().size());

        ConfigurationStore store = ConfigurationStore.get();
        Feed feed = store.get(EntityType.FEED, process.getInputs().getInputs().get(0).getFeed());
        SYNCDATASET ds = (SYNCDATASET) coord.getDatasets().getDatasetOrAsyncDataset().get(0);
        assertEquals(SchemaHelper.formatDateUTC(feed.getClusters().getClusters().get(0).getValidity().getStart()), ds.getInitialInstance());
        assertEquals(feed.getTimezone().getID(), ds.getTimezone());
        assertEquals("${coord:"+feed.getFrequency().toString()+"}", ds.getFrequency());
        assertEquals("", ds.getDoneFlag());
        assertEquals(ds.getUriTemplate(),"${nameNode}" + FeedHelper.getLocation(feed, LocationType.DATA,feed.getClusters().getClusters().get(0).getName()).getPath());
        for(Property prop:coord.getAction().getWorkflow().getConfiguration().getProperty()){
        	if(prop.getName().equals("mapred.job.priority")){
        		assertEquals(prop.getValue(), "LOW");
        		break;
        	}
        }
    }

    @Test
    public void testBundle() throws Exception {
        Process process = ConfigurationStore.get().get(EntityType.PROCESS, "clicksummary");
        Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER, "corp");
        OozieProcessMapper mapper = new OozieProcessMapper(process);
        Path bundlePath = new Path("/", EntityUtil.getStagingPath(process));
        mapper.map(cluster, bundlePath);

        FileSystem fs = new Path(hdfsUrl).getFileSystem(new Configuration());
        assertTrue(fs.exists(bundlePath));

        BUNDLEAPP bundle = getBundle(fs, bundlePath);
        assertEquals(EntityUtil.getWorkflowName(process).toString(), bundle.getName());
        assertEquals(1, bundle.getCoordinator().size());
        assertEquals(EntityUtil.getWorkflowName(Tag.DEFAULT,process).toString(), bundle.getCoordinator().get(0).getName());
        String coordPath = bundle.getCoordinator().get(0).getAppPath().replace("${nameNode}", "");

        COORDINATORAPP coord = getCoordinator(fs, new Path(coordPath));
        testDefCoordMap(process, coord);
        assertEquals(coord.getControls().getThrottle(), "12");
        assertEquals(coord.getControls().getTimeout(), "360");

        String wfPath = coord.getAction().getWorkflow().getAppPath().replace("${nameNode}", "");
        WORKFLOWAPP parentWorkflow = getParentWorkflow(fs, new Path(wfPath));
        testParentWorkflow(process,parentWorkflow);
    }

    @Test
    public void testBundle1() throws Exception {
        Process process = ConfigurationStore.get().get(EntityType.PROCESS, "clicksummary");
        Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER, "corp");
        process.setFrequency(Frequency.fromString("minutes(1)"));
        process.setTimeout(Frequency.fromString("minutes(15)"));
        OozieProcessMapper mapper = new OozieProcessMapper(process);
        Path bundlePath = new Path("/", EntityUtil.getStagingPath(process));
        mapper.map(cluster, bundlePath);

        FileSystem fs = new Path(hdfsUrl).getFileSystem(new Configuration());
        assertTrue(fs.exists(bundlePath));

        BUNDLEAPP bundle = getBundle(fs, bundlePath);
        assertEquals(EntityUtil.getWorkflowName(process).toString(), bundle.getName());
        assertEquals(1, bundle.getCoordinator().size());
        assertEquals(EntityUtil.getWorkflowName(Tag.DEFAULT,process).toString(), bundle.getCoordinator().get(0).getName());
        String coordPath = bundle.getCoordinator().get(0).getAppPath().replace("${nameNode}", "");

        COORDINATORAPP coord = getCoordinator(fs, new Path(coordPath));
        testDefCoordMap(process, coord);
        assertEquals(coord.getControls().getThrottle(), "30");
        assertEquals(coord.getControls().getTimeout(), "15");

        String wfPath = coord.getAction().getWorkflow().getAppPath().replace("${nameNode}", "");
        WORKFLOWAPP parentWorkflow = getParentWorkflow(fs, new Path(wfPath));
        testParentWorkflow(process,parentWorkflow);
    }

    public void testParentWorkflow(Process process, WORKFLOWAPP parentWorkflow){
    		Assert.assertEquals(EntityUtil.getWorkflowName(Tag.DEFAULT,process).toString(), parentWorkflow.getName());
    		Assert.assertEquals("should-record", ((DECISION) parentWorkflow.getDecisionOrForkOrJoin().get(0)).getName());
    		Assert.assertEquals("recordsize", ((ACTION) parentWorkflow.getDecisionOrForkOrJoin().get(1)).getName());
    		Assert.assertEquals("user-workflow", ((ACTION) parentWorkflow.getDecisionOrForkOrJoin().get(2)).getName());
    		Assert.assertEquals("succeeded-post-processing", ((ACTION) parentWorkflow.getDecisionOrForkOrJoin().get(3)).getName());
    		Assert.assertEquals("failed-post-processing", ((ACTION) parentWorkflow.getDecisionOrForkOrJoin().get(4)).getName());
    }

    private COORDINATORAPP getCoordinator(FileSystem fs, Path path) throws Exception {
        String bundleStr = readFile(fs, path);

        Unmarshaller unmarshaller = JAXBContext.newInstance(COORDINATORAPP.class).createUnmarshaller();
        SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
        Schema schema = schemaFactory.newSchema(this.getClass().getResource("/oozie-coordinator-0.3.xsd"));
        unmarshaller.setSchema(schema);
        JAXBElement<COORDINATORAPP> jaxbBundle = unmarshaller.unmarshal(new StreamSource(new ByteArrayInputStream(bundleStr.trim().getBytes())), COORDINATORAPP.class);
        return jaxbBundle.getValue();
    }

    private WORKFLOWAPP getParentWorkflow(FileSystem fs, Path path) throws Exception {
        String workflow = readFile(fs, new Path(path, "workflow.xml"));

        Unmarshaller unmarshaller = JAXBContext.newInstance(WORKFLOWAPP.class).createUnmarshaller();
        SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
        Schema schema = schemaFactory.newSchema(this.getClass().getResource("/oozie-workflow-0.3.xsd"));
        unmarshaller.setSchema(schema);
        JAXBElement<WORKFLOWAPP> jaxbWorkflow = unmarshaller.unmarshal(new StreamSource(new ByteArrayInputStream(workflow.trim().getBytes())), WORKFLOWAPP.class);
        return jaxbWorkflow.getValue();
    }

    private BUNDLEAPP getBundle(FileSystem fs, Path path) throws Exception {
        String bundleStr = readFile(fs, new Path(path, "bundle.xml"));

        Unmarshaller unmarshaller = JAXBContext.newInstance(BUNDLEAPP.class).createUnmarshaller();
        SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
        Schema schema = schemaFactory.newSchema(this.getClass().getResource("/oozie-bundle-0.1.xsd"));
        unmarshaller.setSchema(schema);
        JAXBElement<BUNDLEAPP> jaxbBundle = unmarshaller.unmarshal(new StreamSource(new ByteArrayInputStream(bundleStr.trim().getBytes())), BUNDLEAPP.class);
        return jaxbBundle.getValue();
    }

    private String readFile(FileSystem fs, Path path) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(fs.open(path)));
        String line;
        StringBuffer contents = new StringBuffer();
        while((line=reader.readLine()) != null) {
            contents.append(line);
        }
        return contents.toString();
    }

    @AfterClass
    public void cleanup() throws Exception{
        super.cleanup();
    }
}


text:
def create_admin
  @admin = FactoryGirl.create :user
  @admin.update_attributes({:role_ids => [Role.create({:name => "super_admin"}).id]})
  Role.create(:name => "admin")
end

def create_user h
 u = FactoryGirl.create(:user, email: h[:email], published: h[:status] == "published", full_name: h[:full_name])
 u.add_role(:admin)
end

def find_user email
  @user = User.find_by_email(email)
end

def delete_user email
  @user = find_user(email)
  @user.destroy unless @user.nil?
end

def log_in
  create_admin
  visit "/auth/login"
  fill_in "user_email", :with => @admin.email
  fill_in "user_password", :with => @admin.password
  click_button "Sign In"
end

### CREATE USER ###

Given(/^I am an admin and I am logged in$/) do
  log_in
  page.should_not have_button "Sign In"
end

Given(/^I am at New user page$/) do
  visit new_user_path
end

When(/^I create with valid user data$/) do
  fill_in "user[full_name]", :with => "JACK"
  fill_in "user_email", :with => "user@example.com"
  select "Admin", :from => "user[role]"
  click_button "Create"
end

Then(/^I should see a list of users contains user just created$/) do
  page.should have_link "Create New User"
  User.count.should eq(2)
end

When(/^I create with invalid email$/) do
  fill_in "user[full_name]", :with => "JACK"
  fill_in "user_email", :with => @admin.email
  click_button "Create"
end

Then(/^I should see an invalid email message$/) do
  page.should have_content "Email has already been taken"
end

### DELETE USER ###

Given(/^a following user record$/) do |table|
  table.hashes.each do |h|
    create_user h
  end
end

Given(/^I am logged in$/) do
 log_in
end

Given(/^I am at User list page$/) do
  visit users_path
end

Given(/^I see a list of users looks like$/) do |table|
  page.should have_content "user@example.com"
end

When(/^I click on a trash icon of line in users list to delete JACK$/) do
  click_link "btn-delete-#{find_user('user@example.com').id}"
end

Then(/^I should not see user just deleted$/) do
  page.should_not have_content("user@example.com")
end

Given(/^JACK has one solution$/) do
  user = find_user('user@example.com')
  solution = FactoryGirl.create :solution
  user.solutions << solution
  click_link "btn-delete-#{user.id}"
end

Then(/^I should see cannot delete message$/) do
   page.should have_content("Cannot delete user")
end

### UPDATE USER ###

When(/^I click pencil icon on line of user list$/) do
  click_link "btn-edit-#{find_user('user@example.com').id}"
end

Then(/^I should see user profile page$/) do
  page.should have_content "User Profile"
  page.should have_content "Update"
end

When(/^I update user with valid data$/) do
  fill_in "user_full_name", :with => "I AM TESTING"
  click_button "Update"
end

Then(/^I should see a update successfully message$/) do
  page.should have_content "User has been updated successfully."
  page.should have_content "I AM TESTING"
end

When(/^I update user with invalid karma$/) do
  fill_in "user_karma", :with => "acb"
  click_button "Update"
end

Then(/^I should see a invalid karma message$/) do
  page.should have_content "Karma must be from 0 to 5000."
end

### TOOGLE USER'S STATUS ###
When(/^I click on a tick icon of line in users list to publish JACK$/) do
  click_link "btn-status-#{find_user('user@example.com').id}"
end

Then(/^I should not see publish successfully message$/) do
  page.should have_content I18n.t("users.published_successfully")
end

When(/^I click on a tick icon of line in users list to unpublish ADMIN$/) do
  click_link "btn-status-#{find_user('admin@example.com').id}"
end

Then(/^I should see unpublish successfully message$/) do
  page.should have_content I18n.t("users.unpublished_successfully")
end


text:
require 'spec_helper'

describe Hangman::Guesser do
  let(:word)              { 'lorem' }
  let(:max_wrong_guesses) { 5 }
  let(:dictionary)        { Hangman::Dictionary.read_file(Fixtures::WORDS) }

  subject {
    Hangman::Guesser.new(
      word: word,
      max_wrong_guesses: max_wrong_guesses,
      dictionary: dictionary
    )
  }

  it { assert_instance_of Hangman::Game, subject.game }
  it { assert_instance_of Hangman::Strategies::LetterFrequency, subject.strategy }
  it { assert_equal 1, subject.guess! }

  describe 'when word is not in dictionary' do
    let(:word) { 'lorems' }

    it { assert_instance_of Hangman::Strategies::EnglishPopularity, subject.strategy }
  end
end


text:
<?php
/**
 * ClearCommand.php
 */

namespace Pails\Console\Commands\View;

use Pails\Console\Command;

class ClearCommand extends Command
{
    protected $name = 'view:clear';

    protected $description = '清空视图缓存';

    public function handle()
    {
        $res = $this->viewCache->flush();
        if ($res) {
            $this->info('缓存已经清空');
        } else {
            $this->info('缓存清理失败,请手工查看。');
        }
    }
}


text:
"""Constants used by OpsDroid."""
import os

from appdirs import user_config_dir, user_data_dir, user_log_dir

import opsdroid
from opsdroid import __version__  # noqa # pylint: disable=unused-import

NAME = "opsdroid"
MODULE_ROOT = os.path.dirname(os.path.abspath(opsdroid.__file__))
DEFAULT_GIT_URL = "https://github.com/opsdroid/"
MODULES_DIRECTORY = "opsdroid_modules"
DEFAULT_ROOT_PATH = user_data_dir(NAME)
DEFAULT_LOG_FILENAME = os.path.join(user_log_dir(NAME, appauthor=False), "output.log")
DEFAULT_MODULES_PATH = user_data_dir(NAME, MODULES_DIRECTORY)
DEFAULT_MODULE_DEPS_PATH = os.path.join(
    user_data_dir(NAME, MODULES_DIRECTORY), "site-packages"
)
DEFAULT_CONFIG_PATH = os.path.join(
    user_config_dir(NAME, appauthor=False), "configuration.yaml"
)
DEFAULT_CONFIG_LOCATIONS = [
    "configuration.yaml",
    DEFAULT_CONFIG_PATH,
    "/etc/opsdroid/configuration.yaml",
]
DEFAULT_MODULE_BRANCH = "master"
DEFAULT_LANGUAGE = "en"
LOCALE_DIR = os.path.join(MODULE_ROOT, "locale")
EXAMPLE_CONFIG_FILE = os.path.join(
    os.path.dirname(os.path.abspath(__file__)),
    "configuration/example_configuration.yaml",
)
REGEX_PARSE_SCORE_FACTOR = 0.6

RASANLU_DEFAULT_URL = "http://localhost:5000"
RASANLU_DEFAULT_MODELS_PATH = "models"
RASANLU_DEFAULT_TRAIN_MODEL = True

LUISAI_DEFAULT_URL = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/"

WITAI_DEFAULT_VERSION = "20170307"
WITAI_API_ENDPOINT = "https://api.wit.ai/message?"

SAPCAI_API_ENDPOINT = "https://api.cai.tools.sap/v2/request"

WATSON_API_ENDPOINT = "https://{gateway}.watsonplatform.net/assistant/api"
WATSON_API_VERSION = "2019-02-28"
ENV_VAR_REGEX = r"^\"?\${?(?=\_?[A-Z])([A-Z-_]+)}?\"?$"

TWITCH_OAUTH_ENDPOINT = "https://id.twitch.tv/oauth2/token"
TWITCH_WEBHOOK_ENDPOINT = "https://api.twitch.tv/helix/webhooks/hub"
TWITCH_API_ENDPOINT = "https://api.twitch.tv/helix"
TWITCH_IRC_MESSAGE_REGEX = r"@.*;id=(?P<message_id>.*);m.*user-id=(?P<user_id>.*);user-type=.*:(?P<user>.*?)!.*PRIVMSG[^:]*:(?P<message>.*)"
TWITCH_JSON = os.path.join(DEFAULT_ROOT_PATH, "twitch.json")
GITLAB_API_ENDPOINT = "https://gitlab.com/api/v4"
EXCLUDED_CONFIG_KEYS = [
    "loader",
    "submodule_search_locations",
    "is_builtin",
    "password",
    "token",
    "appkey",
    "consumer_secret",
    "oauth_token_secret",
    "client-secret",
    "verify-token",
    "page-access-token",
    "webhook-token",
    "app-token",
]


text: """Package providing models and mixins pertaining to reddit listings."""


text:
jutility-common
===============

Common functionality used by the different modules (includes data types and other utils).


text:
      Admin Home

Create New Employee

View Employee by ID

View All Employee

 Logout

      Employee ID
      Employee Name
      Email ID
      Password
      Role
      Company

      {{employee.id}}
      {{employee.name}}
      {{employee.email}}
      {{employee.password}}
      {{employee.role}}
      {{employee.company}}


text:
'use strict';

var chalk   = require('chalk');
var crypto  = require('crypto');
var fs      = require('fs-extra');
var glob    = require('glob');
var path    = require('path');
var keygen  = require('ssh-keygen');
var request = require('request');
var yeoman  = require('yeoman-generator');
var util    = require('util');

var WordpressGenerator = yeoman.generators.Base.extend({
  init: function() {
    this.pkg      = JSON.parse(this.readFileAsString(path.join(__dirname, '../../package.json')));
    this.prompts  = [];

    this.option('dev', {
      desc: 'Dev-mode for localized development of the generator',
      defaults: false,
    });

    this.on('end', function() {
      this.installDependencies({
        bower:        true,
        npm:          false,
        skipInstall:  this.options['skip-install'],
        skipMessage:  true,
        callback:     function() {
          this.log.write();
          this.log.ok('All done! Run ' + chalk.yellow('vagrant up') + ' to get started!');
        }.bind(this)
      });
    });

    this.sourceRoot(path.join(__dirname, 'templates'));
  },

  welcome: function() {
    var message = this.readFileAsString(path.join(__dirname, 'welcome.txt'));

    message = message.replace(/./g, function(match) {
      return /\w/.test(match) ? chalk.yellow(match) : chalk.cyan(match);
    });

    this.log.writeln(message);
  },

  checkDeps: function() {
    if(process.env.CI) {
      return true;
    }

    var done    = this.async();
    var deps    = ['sshpass', 'bundler', 'ansible', 'bower', 'npm'];
    var missing = [];
    var exited  = function(dependency, err) {
      deps.pop();

      if (err) { missing.push(dependency); }

      if (!deps.length) {
        if (missing.length) {
          err = new Error('Missing prerequisites');
          this.log.error('Could not find dependencies:' + chalk.red("\n\t- "+missing.join("\n\t- ")) );
        }
        done(err);
      }
    }

    this.log.info('Checking for installed prerequisites...');
    deps.forEach(function (dependency) {
      this.emit('dependencyCheck'+dependency);

      this
        .spawnCommand('which', [dependency], {cwd: this.env.cwd, env: process.env})
        .on('error', exited.bind(this, dependency))
        .on('exit', this.emit.bind(this, 'dependencyCheck'+dependency+':end'))
        .on('exit', exited.bind(this, dependency))
      ;
    }.bind(this));
  },

  promptForPrivate: function() {
    var bowerFile = path.join(this.env.cwd, 'bower.json');
    var choices   = [
      {
        name: 'Private',
        value:  true,
      },
      {
        name:  'Public',
        value:  false,
      },
    ];
    var existing = function() {
      try {
        var bower = JSON.parse(this.readFileAsString(bowerFile));

        return !bower.private;
      } catch(e) {};
    }.bind(this);

    if(existing()) {
      choices.reverse();
    }

    this.prompts.push({
      type:     'list',
      name:     'private',
      message:  'This repository is',
      choices:  choices,
    });
  },

  promptForSsl: function() {
    var defaultSsl = true;

    try {
      var provisionYml = this.readFileAsString(path.join(this.env.cwd, 'lib', 'ansible', 'provision.yml'));
      defaultSsl = !!provisionYml.match(/^\s*-\s+pound/m);
    } catch(e) {};

    var choices  = [
      {
        name:   'Yes, HTTPS (SSL)',
        value:  true,
      },
      {
        name:   'No, HTTP-only',
        value:  false,
      },
    ];

    if(!defaultSsl) {
      choices.reverse();
    }

    this.prompts.push({
      type:     'list',
      name:     'ssl',
      message:  'Will this site serve HTTPS (SSL) traffic?',
      choices:  choices
    });

    if(glob.sync('lib/ansible/files/ssl/*.pem').length) {
      this.prompts.push({
        type:     'list',
        name:     'sslOverwrite',
        message:  'Overwrite existing SSL certificates?',
        when:     function (props) {
          return props.ssl;
        },
        choices:  [
          {
            name:   'Do not overwrite',
            value:  false,
          },
          {
            name:   'Overwrite',
            value:  true,
          },
        ]
      });
    }
  },

  promptForSSHOverwrite: function() {
    if(glob.sync('lib/ansible/files/ssh/id_rsa*').length) {
      this.prompts.push({
        type:     'list',
        name:     'sshOverwrite',
        message:  'Overwrite existing SSH keys?',
        choices:  [
          {
            name:   'Do not overwrite',
            value:  false,
          },
          {
            name:   'Overwrite',
            value:  true,
          },
        ]
      });
    }
  },

  promptForName: function() {
    var existing = function() {
      try {
        var bower = JSON.parse(this.readFileAsString(path.join(this.env.cwd, 'bower.json')));

        return bower.name;
      } catch(e) {};
    }.bind(this);

    this.prompts.push({
      required: true,
      type:     'text',
      name:     'name',
      message:  'Repository name (e.g. MySite)',
      default:  function() {
        return existing() || path.basename(this.env.cwd);
      }.bind(this)
    });
  },

  promptForDomain: function() {
    var existing = function() {
      try {
        var match = this.readFileAsString(path.join(this.env.cwd, 'Vagrantfile'))
          .match(/box.vm.hostname[ ]*=[ ]*"local.([^"]+)"/);

        return match[1];
      } catch(e) {};
    }.bind(this);

    this.prompts.push({
      required: true,
      type:     'text',
      name:     'domain',
      message:  'Domain name (e.g. mysite.com)',
      default:  function () {
        return existing() || path.basename(this.env.cwd).toLowerCase();
      }.bind(this),
      validate: function(input) {
        if (/^[\w-]+\.\w+(?:\.\w{2,3})?$/.test(input)) {
          return true;
        } else if (!input) {
          return "Domain is required";
        }

        return chalk.yellow(input) + ' does not appear to be a domain';
      }
    });
  },

  promptForWww: function() {
    var choices = [
      {
        name:   'No, just the domain',
        value:  false,
      },
      {
        name:   'Yes, www is preferred',
        value:  true,
      },
    ];
    var existing = function() {
      try {
        var match = this.readFileAsString(path.join(this.env.cwd, 'lib', 'ansible', 'group_vars', 'all'))
          .match(/www[ ]*:[ ]*(true)/i);

        return match[1];
      } catch(e) {};
    }.bind(this);

    if(existing()) {
      choices.reverse();
    }

    this.prompts.push({
      required: true,
      type:     'list',
      name:     'www',
      message:  'Should this site enforce a www subdomain in production? (e.g. www.mysite.com)',
      choices:  choices
    });
  },

  promptForNewrelic: function() {
    var existing = function() {
      try {
        var match = this.readFileAsString(path.join(this.env.cwd, 'lib', 'ansible', 'group_vars', 'all'))
          .match(/newrelic[ ]*:[ ]*(?:'|")?([^'"\s]+)/i);

        return match[1];
      } catch(e) {};
    }.bind(this);

    this.prompts.push({
      required: true,
      type:     'text',
      name:     'newrelic',
      message:  'New Relic license key (leave blank to disable)',
      default:  function () {
        return existing() || '';
      }.bind(this)
    });
  },

  promptForDatadog: function() {
    var existing = function() {
      try {
        var match = this.readFileAsString(path.join(this.env.cwd, 'lib', 'ansible', 'group_vars', 'all'))
          .match(/datadog_api_key[ ]*:[ ]*(?:'|")?([^'"\s]+)/i);

        return match[1];
      } catch(e) {};
    }.bind(this);

    this.prompts.push({
      required: true,
      type:     'text',
      name:     'datadog',
      message:  'Datadog license key (leave blank to disable)',
      default:  function () {
        return existing() || '';
      }.bind(this)
    });
  },

  promptForRoles: function() {
    try {
      var provisionYml = this.readFileAsString(path.join(this.env.cwd, 'lib', 'ansible', 'provision.yml'));

      WordpressGenerator.roles.forEach(function (role, index) {
        var regex = new RegExp('^\\s*-\\s+' + role.value.split(' ')[0], 'm');

        if (!regex.exec(provisionYml)) {
          WordpressGenerator.roles[index].checked = false;
        }
      });
    } catch(e) {};

    this.prompts.push({
      required: true,
      type:     'checkbox',
      name:     'roles',
      message:  'Optional features',
      choices:  WordpressGenerator.roles,
    });
  },

  promptForWordPress: function() {
    var existing = function() {
      try {
        var file    = this.readFileAsString(path.join(this.env.cwd, 'web', 'wp', 'wp-includes', 'version.php'));
        var version = file.match(/\$wp_version\s=\s['"]([^'"]+)/);

        if (version.length) {
          return version[1];
        }
      } catch(e) {}
    }.bind(this);

    var done = this.async();

    WordpressGenerator.latest('wordpress', 'wordpress', function(err, tag) {
      this.prompts.push({
        type:     'text',
        name:     'wordpress',
        message:  'WordPress version',
        default:  function() {
          return existing() || tag || '4.7';
        }
      });

      done();
    }.bind(this));
  },

  promptForAutoUpdate: function() {
    var choices  = [
      {
        name:   'No',
        value:  false,
      },
      {
        name:   'Yes, but only minor releases (eg, 4.6.1 => 4.6.3)',
        value:  'minor',
      },
      {
        name:   'Yes, including major releases (eg, 4.6.1 => 4.7.1)',
        value:  'major',
      },
    ];

    var existing = function() {
      try {
        var match = this.readFileAsString(path.join(this.env.cwd, 'lib', 'ansible', 'group_vars', 'all'))
          .match(/wordpress__autoupdate[ ]*:[ ]*(?:'|")?(minor|major)/i);
        return match[1];
      } catch(e) {};
    }.bind(this);

    var majority = existing();
    if (majority == 'major') {
      choices[0] = choices.splice(2, 1, choices[0])[0];
    } else if (majority == 'minor') {
      choices.push(choices.shift());
    }

    this.prompts.push({
      required: true,
      type:     'list',
      name:     'wp_autoupdate',
      message:  'Autuomatically apply (and commit to git) WordPress updates, including plugins and themes?',
      choices:  choices
    });
  },

  promptForTablePrefix: function() {
    var existing = function() {
      try {
        var config = this.readFileAsString(path.join(this.env.cwd, 'web', 'wp-config.php'));
        var prefix = config.match(/\$table_prefix\s*=\s*['"]([^'"]+)/);

        if (prefix.length) {
          return prefix[1];
        }
      } catch(e) {}
    }.bind(this);

    this.prompts.push({
      type:     'text',
      name:     'prefix',
      message:  'WordPress table prefix',
      default:  function() {
        return existing() || 'wp_';
      }
    });
  },

  promptForDatabase: function() {
    var done      = this.async();
    var existing  = function(constant) {
      try {
        var config = this.readFileAsString(path.join(this.env.cwd, 'web', 'wp-config.php'));
        var regex   = new RegExp(constant + '[\'"],\\s*[\\w:(]*[\'"]([^\'"]+)');
        var matches = regex.exec(config);

        return matches && matches[1];
      } catch(e) {}
    }.bind(this);

    crypto.randomBytes(12, function(err, buffer) {
      this.prompts.push({
        type:     'text',
        name:     'DB_NAME',
        message:  'Database name',
        default:  function() { return existing('DB_NAME') || 'wordpress'; }
      });

      this.prompts.push({
        type:     'text',
        name:     'DB_USER',
        message:  'Database user',
        default:  function() { return existing('DB_USER') || 'wordpress'; }
      });

      this.prompts.push({
        type:     'text',
        name:     'DB_PASSWORD',
        message:  'Database password',
        default:  function() { return existing('DB_PASSWORD') || buffer.toString('base64'); }
      });

      this.prompts.push({
        type:     'text',
        name:     'DB_HOST',
        message:  'Database host',
        default:  function() { return existing('DB_HOST') || '127.0.0.1'; }
      });

      done();
    }.bind(this));
  },

  promptForIp: function() {
    // Private IP blocks
    var blocks = [
      ['192.168.0.0', '192.168.255.255'],
      ['172.16.0.0',  '172.31.255.255'],
      ['10.0.0.0',    '10.255.255.255']
    ];

    // Long IP ranges
    var ranges = blocks.map(function(block) {
      return block.map(function(ip) {
        var parts = ip.split('.');

        return parts[0] << 24 | parts[1] << 16 | parts[2] << 8 | parts[3] >>> 0;
      });
    });

    // Randomize IP addresses
    var ips = ranges.map(function(range) {
      return Math.random() * (range[1] - range[0]) + range[0];
    }).map(function(ip) {
      return [
        (ip & (0xff << 24)) >>> 24,
        (ip & (0xff << 16)) >>> 16,
        (ip & (0xff << 8)) >>> 8,
        (ip & (0xff << 0)) >>> 0
      ].join('.');
    });

    try {
      var vagrant = this.readFileAsString('Vagrantfile').match(/ip:\s['"]([\d\.]+)['"]/);

      if (vagrant.length) {
        ips.unshift(vagrant[1]);
      }
    } catch(e) {}

    this.prompts.push({
      required: true,
      type:     'list',
      name:     'ip',
      message:  'Vagrant IP',
      pattern:  /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
      choices:  ips
    });
  },

  ask: function() {
    var done = this.async();

    this.prompt(this.prompts, function(props) {
      this.props = props;

      done();
    }.bind(this));
  },

  prepareReadme: function() {
    try {
      this.readmeFile = this.readFileAsString(path.join(this.env.cwd, 'README.md'));
      this.readmeFile = this.readmeFile
        .replace(/^(?:\[[^\]\r\n]+\]){1,2}(?:\([^\)\r\n]+\))?[\r\n]+=+[\r\n]+> Powered by \[(?:Genesis|Evolution)[^\r\n]+[\r\n]+/i, '')
        .replace(/[\r\n]\[[^\]\r\n]+\]:\s*http[^\r\n]+[\r\n]+\[(?:genesis|evolution)-wordpress\]:\s*http[^\r\n]+[\r\n]*$/i, '')
      ;
    } catch(e) {
      this.readmeFile = '';
    }
  },

  prepareHtaccess: function() {
    try {
      this.htaccessFile = this.readFileAsString(path.join(this.env.cwd, 'web', '.htaccess'));
      this.htaccessFile = this.htaccessFile.replace(/# BEGIN Evolution WordPress(?:.|[\r\n]+)+?# END Evolution WordPress[\r\n]*/i, '').trim();

      this.htaccessWpBlock = !!this.htaccessFile.match(/# BEGIN WordPress(?:.|[\r\n]+)+?# END WordPress[\r\n]*/i);
    } catch(e) {
      this.htaccessFile = '';
      this.htaccessWpBlock = false;
    }
  },

  prepareGitignore: function () {
    try {
      this.gitignoreFile = this.readFileAsString(path.join(this.env.cwd, '.gitignore'));
      this.gitignoreFile = this.gitignoreFile.match(/[\r\n]+# Generated file, don't edit above this line[\r\n]*([\S\s]*?)[\r\n]*$/i)[1];
    } catch(e) {
      this.gitignoreFile = '';
    }
  },

  prepareRoles: function() {
    this.props.roles = WordpressGenerator.roles.map(function(role) {
      role.checked = !!~this.props.roles.indexOf(role.value);

      return role;
    }.bind(this));
  },

  prepareSalts: function() {
    var done = this.async();

    request('https://api.wordpress.org/secret-key/1.1/salt/', function(err, response, salts) {
      if (err) {
        throw err;
      }

      this.props.salts = salts;
      done();
    }.bind(this));
  },

  prepareSshKeys: function() {
    if (typeof(this.props.sshOverwrite) !== 'undefined' && this.props.sshOverwrite !== true) {
      this.log.skip('SSH keys exist, skipping keygen...');
      return false;
    }

    var done      = this.async();
    var location  = path.join(this.env.cwd, 'lib', 'ansible', 'files', 'ssh', 'id_rsa');

    this.log.info('Creating SSH keys...');

    this.mkdir(path.dirname(location));

    keygen({
      location: location,
      comment:  'deploy@' + this.props.domain,
      read: false
    }, done);
  },

  prepareTemplates: function() {
    this.templates = this.expandFiles('**/*', {
      cwd: this.sourceRoot(),
    });
  },

  ready: function() {
    this.log.write('\n');
    this.log.info(chalk.green('Here we go!'));
  },

  symlinkEvolutionWordPress: function() {
    if (!this.options.dev) {
      return false;
    }

    this.log.info(chalk.green('Symlinking local Evolution WordPress as dependency...'));

    var srcpath = '../../../wordpress';
    var dstpath = path.join(this.env.cwd, 'bower_components', 'evolution-wordpress');

    this.mkdir(path.dirname(dstpath));

    fs.symlinkSync(srcpath, dstpath);
  },

  /**
   * Specify project dependencies (e.g. WordPress, Evolution, etc.) via `bower.json`
   */
  copyBower: function() {
    this.template('bower.json', 'bower.json');
    this.template('_bowerrc', '.bowerrc');
  },

  /**
   * Install project dependencies (e.g. WordPress, Evolution) for later usage by the generator
   */
  runBower: function() {
    var done = this.async();

    this.log.info(chalk.green('Installing project dependencies...'));

    this.bowerInstall(null, null, done);
  },

  /**
   * Bower's `postInstall` can only be ran after all other dependencies have been installed
   */
  copyBowerrc: function() {
    this.template('_bowerrc', '.bowerrc');
  },

  prepareWpConfig: function() {
    this.wpConfigFile = this.readFileAsString(path.join(this.env.cwd, 'web', 'wp', 'wp-config-sample.php'));
  },

  scaffold: function() {
    this.log.info(chalk.green('Scaffolding...'));

    this.templates.forEach(function(file) {
      this.template(file, file.replace(/(^|\/)_/, '$1.'));
    }.bind(this));
  },

  generateSslCert: function() {
    if (!this.props.ssl) {
      return false;
    }

    if (typeof(this.props.sslOverwrite) !== 'undefined' && this.props.sslOverwrite !== true) {
      this.log.skip('SSL certificates exist, skipping creation...');
      return false;
    }

    var done      = this.async();
    var location  = path.join(this.env.cwd, 'lib', 'ansible', 'files', 'ssl');
    var stages    = ['local', 'staging', 'production'];
    var exited    = function (err) {
      stages.pop();

      if (err || !stages.length) {
        done(err);
      }
    };

    this.log.info('Creating self-signed SSL certificate...');

    this.mkdir(path.dirname(location));

    stages.forEach(function (stage) {
      this.emit('sslInstall'+stage);

      var cert = path.join(location, stage + '.' + this.props.domain + '.pem');
      var cfg  = path.join(location, stage + '.cfg');

      this
        .spawnCommand('openssl', [
          'req',
          '-x509',
          '-nodes',
          '-days',
          '365',
          '-newkey',
          'rsa:2048',
          '-keyout',
          cert,
          '-out',
          cert,
          '-config',
          cfg
        ], {
          cwd: this.env.cwd,
        })
        .on('error', exited)
        .on('exit', this.emit.bind(this, 'sslInstall'+stage+':end'))
        .on('exit', function (err) {
          if (err === 127) {
            this.log.error('Could not generate SSL certificate for '+stage);
          }

          exited(err);
        }.bind(this))
      ;
    }.bind(this));
  },

  symlinkBowerComponents: function() {
    var bowerPath = path.join(this.env.cwd, 'web', 'bower_components');

    if (fs.existsSync(bowerPath)) {
      this.log.info(chalk.yellow('Removing `bower_components` symlink from `web`...'));

      fs.unlinkSync(bowerPath);
    }

    this.log.info(chalk.green('Symlinking `bower_components` into `web`...'));

    fs.symlinkSync('../bower_components', bowerPath);
  },

  fixPermissions: function() {
    fs.chmodSync(path.join(this.env.cwd, 'lib', 'ansible', 'files', 'ssh', 'id_rsa'), '600');
  },

  installGems: function() {
    var done      = this.async();
    var installer = 'bundle';

    this.log.info(chalk.green('Installing Gems...'));

    this.emit(installer + 'Install');

    this
      .spawnCommand(installer, ['install'], done)
      .on('error', done)
      .on('exit', this.emit.bind(this, installer + 'Install:end'))
      .on('exit', function (err) {
        if (err === 127) {
          this.log.error('Could not run bundler. Please install with `sudo ' + installer + ' install`.');
        }

        done(err);
      }.bind(this))
    ;
  },
});

WordpressGenerator.roles = [
  {
    name:     'apache-prefork - Dynamic Apache performance tuning',
    value:    'apache-prefork    # (Optional) Dynamic Apache performance tuning',
    checked:  true,
  },
  {
    name:     'php-hardened   - Security-minded restrictions on PHP userland',
    value:    'php-hardened      # (Optional) Security-minded restrictions on PHP userland',
    checked:  true,
  },
  {
    name:     'varnish        - High-performance reverse-proxy cache',
    value:    'varnish           # (Optional) High-performance reverse-proxy cache',
    checked:  true,
  },
  {
    name:     'mail           - Ability to send e-mails from the server (i.e. PHP)',
    value:    'mail              # (Optional) Ability to send e-mails from the server (i.e. PHP)',
    checked:  true,
  },
  {
    name:     'firewall       - Simple intrusion protection via Fail2ban + iptables',
    value:    'firewall          # (Optional) Simple intrusion protection via Fail2ban + iptables',
    checked:  true,
  },
  {
    name:     'debug          - Tools to monitor processes & debug when on the server',
    value:    'debug             # (Optional) Tools to monitor processes & debug when on the server',
    checked:  true,
  },
  {
    name:     'awstats        - HTTP log analyzer',
    value:    'awstats           # (Optional) HTTP log analyzer',
    checked:  true,
  },
  {
    name:     'snapshots      - Recurring interval backups',
    value:    'snapshots         # (Optional) Recurring interval backups',
    checked:  true,
  },
];

WordpressGenerator.latest = function(username, repo, fn) {
  request({
    url: 'https://api.github.com/repos/' + username + '/' + repo + '/git/refs/tags/',
    headers: { 'user-agent': 'https://github.com/request/request' }
  }, function (err, res, body) {
    if(!(/^200/).test(res.headers.status))
      return fn(new Error(res.headers.status));

    try {
      var fuzzyver = /^\s*v?(\d+)\.(\d+)(?:\.(\d+))?\s*$/;
      var tags = JSON.parse(body)
        .map(function(item){
          return item.ref.split('/').pop();
        })
        .filter(RegExp.prototype.test.bind(fuzzyver))
        .sort(function (a, b) {
          var ma = a.match(fuzzyver);
          var mb = b.match(fuzzyver);

          if (ma[1] == mb[1]) {
            if (ma[2] == mb[2]) {
              ma[3] = ma[3] || '0';
              mb[3] = mb[3] || '0';
              if (ma[3] == mb[3])
                return 0;
              else if (parseInt(ma[3]) > parseInt(mb[3]))
                return 1;
              else
                return -1;
            }
            else if (parseInt(ma[2]) > parseInt(mb[2]))
              return 1;
            else
              return -1;
          }
          else if (parseInt(ma[1]) > parseInt(mb[1]))
            return 1;
          else
            return -1;
        });
    } catch (e) {
      return fn(e);
    }

    fn(null, tags.pop());
  });
};

module.exports = WordpressGenerator;


text:
import tkinter as tk
import constants

from matplotlib.backends.backend_tkagg import (
    FigureCanvasTkAgg,
    NavigationToolbar2TkAgg
)
import matplotlib.pyplot as plt
import numpy as np

class plotGUI(tk.Frame):
    def __init__(self, parent):
        const = constants.plotWindow

        frame = tk.Frame(parent, bg=const.background,
                         width=const.width, height=const.height)

        canvas = tk.Canvas(frame, bg=const.background,
                           width=const.width, height=const.height)

        # Not sure if it is safe enough ie. valid for all screens?
        pixelOverInche = 80
        fig = plt.Figure(figsize=(frame.winfo_reqwidth() / pixelOverInche,
                                  frame.winfo_reqheight() / pixelOverInche))

        plotCanvas = FigureCanvasTkAgg(fig, master=canvas)
        # We might need to make the toolbar smaller in future
        toolbar = NavigationToolbar2TkAgg(plotCanvas, canvas)
        toolbar.update()
        plotCanvas._tkcanvas.pack()

        x = np.arange(0, 2 * np.pi, 0.01)
        ax = fig.add_subplot(211)
        line, = ax.plot(x, np.sin(x))
        ax = fig.add_subplot(212)
        line, = ax.plot(x, np.cos(x))

        canvas.grid()
        frame.grid(row=const.rowOrder, column=const.colOrder,
                   sticky=const.sticky)


text:
// This file contains routines in common to both the qmgmt client
// and the qmgmt server (i.e. the schedd).

#include "condor_common.h"
#include "condor_daemon_core.h"
#include "dedicated_scheduler.h"
#include "scheduler.h"
#include "condor_qmgr.h"
#include "MyString.h"

int
SetAttributeInt(int cl, int pr, const char *name, int val, SetAttributeFlags_t flags )
{
	char buf[100];
	int rval;

	snprintf(buf,100,"%d",val);
	rval = SetAttribute(cl,pr,name,buf,flags);
	return(rval);
}

int
SetAttributeFloat(int cl, int pr, const char *name, float val, SetAttributeFlags_t flags )
{
	char buf[100];
	int rval;

	snprintf(buf,100,"%f",val);
	rval = SetAttribute(cl,pr,name,buf,flags);
	return(rval);
}

int
SetAttributeString(int cl, int pr, const char *name, const char *val, SetAttributeFlags_t flags )
{
	MyString buf;
	std::string escape_buf;
	int rval;

	val = EscapeAdStringValue(val,escape_buf);

	buf += '"';
	buf +=  val;
	buf += '"';
	rval = SetAttribute(cl,pr,name,buf.Value(),flags);
	return(rval);
}

int
SetAttributeIntByConstraint(const char *con, const char *name, int val, SetAttributeFlags_t flags)
{
	char buf[100];
	int rval;

	snprintf(buf,100,"%d",val);
	rval = SetAttributeByConstraint(con,name,buf, flags);
	return(rval);
}

int
SetAttributeFloatByConstraint(const char *con, const char *name, float val, SetAttributeFlags_t flags)
{
	char buf[100];
	int rval;

	snprintf(buf,100,"%f",val);
	rval = SetAttributeByConstraint(con,name,buf, flags);
	return(rval);
}

int
SetAttributeStringByConstraint(const char *con, const char *name,
							 const char *val,
							 SetAttributeFlags_t flags)
{
	MyString buf;
	std::string escape_buf;
	int rval;

	val = EscapeAdStringValue(val,escape_buf);

	buf += '"';
	buf +=  val;
	buf += '"';
	rval = SetAttributeByConstraint(con,name,buf.Value(), flags);
	return(rval);
}


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.9.1"/>
<title>LDAPLibrary: LDAPLibrary.LdapConfigRepository Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

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

LDAPLibrary
    3.3

Library that wrap the S.DS.P Microsoft libraries and provide a better interface and management for all the LDAP infrastructures

Main Page

Related Pages

Packages

Classes

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

Public Member Functions |
List of all members

LDAPLibrary.LdapConfigRepository Class Reference

Repository for all the configuration and input of the library. Created at startup. Also Check the validity of the Parameters and, in case, throw an ArgumentNullException, with specific messages.
 More...

Inheritance diagram for LDAPLibrary.LdapConfigRepository:

  <map id="LDAPLibrary.LdapConfigRepository_map" name="LDAPLibrary.LdapConfigRepository_map">
<area href="interface_l_d_a_p_library_1_1_interfarces_1_1_i_ldap_config_repository.html" alt="LDAPLibrary.Interfarces.ILdapConfigRepository" shape="rect" coords="0,0,283,24"/>
</map>

Public Member Functions

ILdapUser 	GetAdminUser ()

string 	GetServer ()

string 	GetSearchBaseDn ()

AuthType 	GetAuthType ()

bool 	GetSecureSocketLayerFlag ()

bool 	GetTransportSocketLayerFlag ()

bool 	GetClientCertificateFlag ()

string 	GetClientCertificatePath ()

LoggerType 	GetWriteLogFlag ()

string 	GetLogPath ()

string 	GetUserObjectClass ()

string 	GetMatchFieldName ()

LDAPAdminMode 	GetAdminMode ()

void 	BasicLdapConfig (ILdapUser adminUser, LDAPAdminMode adminMode, string server, string searchBaseDn, AuthType authType, LoggerType loggerType, string logPath)

 	Check the validity of parameters Set the basic Ldap Configuration from parameters Set the others to the standard values  More...

void 	AdditionalLdapConfig (bool secureSocketLayerFlag, bool transportSocketLayerFlag, bool clientCertificateFlag, string clientCertificatePath, string userObjectClass, string matchFieldUsername)

 	Check the validity of the parameters Set addiitonal configuration form the parameters  More...

Detailed Description

Repository for all the configuration and input of the library. Created at startup. Also Check the validity of the Parameters and, in case, throw an ArgumentNullException, with specific messages.

Member Function Documentation

          void LDAPLibrary.LdapConfigRepository.AdditionalLdapConfig
          (
          bool
          secureSocketLayerFlag,

          bool
          transportSocketLayerFlag,

          bool
          clientCertificateFlag,

          string
          clientCertificatePath,

          string
          userObjectClass,

          string
          matchFieldUsername

          )

Check the validity of the parameters Set addiitonal configuration form the parameters

Parameters

secureSocketLayerFlag

transportSocketLayerFlag

clientCertificateFlag

clientCertificatePath	Path of the certificate file

userObjectClass	Object class that rapresent an user

matchFieldUsername	Attribute that rapresent the username

Implements LDAPLibrary.Interfarces.ILdapConfigRepository.

          void LDAPLibrary.LdapConfigRepository.BasicLdapConfig
          (
          ILdapUser
          adminUser,

          LDAPAdminMode
          adminMode,

          string
          server,

          string
          searchBaseDn,

          AuthType
          authType,

          LoggerType
          loggerType,

          string
          logPath

          )

Check the validity of parameters Set the basic Ldap Configuration from parameters Set the others to the standard values

Parameters

adminUser	Admin User

adminMode	Library Admin Mode

server	Server URL

searchBaseDn	Root Search Node

authType

loggerType

logPath	Path of the log file

Implements LDAPLibrary.Interfarces.ILdapConfigRepository.

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

LDAPLibrary/LdapConfigRepository.cs

LDAPLibrary

LdapConfigRepository

Generated on Thu Dec 3 2015 14:53:29 for LDAPLibrary by

     1.8.9.1


text:
var manageCategoriesTable;

$(document).ready(function() {
	// active top navbar categories
	$('#navCategories').addClass('active');

	manageCategoriesTable = $('#manageCategoriesTable').DataTable({
		'ajax' : 'php_action/fetchCategories.php',
		'order': []
	}); // manage categories Data Table

	// on click on submit categories form modal
	$('#addCategoriesModalBtn').unbind('click').bind('click', function() {
		// reset the form text
		$("#submitCategoriesForm")[0].reset();
		// remove the error text
		$(".text-danger").remove();
		// remove the form error
		$('.form-group').removeClass('has-error').removeClass('has-success');

		// submit categories form function
		$("#submitCategoriesForm").unbind('submit').bind('submit', function() {

			var categoriesName = $("#categoriesName").val();
			var categoriesStatus = $("#categoriesStatus").val();

			if(categoriesName == "") {
				$("#categoriesName").after('
Brand Name field is required
');
				$('#categoriesName').closest('.form-group').addClass('has-error');
			} else {
				// remov error text field
				$("#categoriesName").find('.text-danger').remove();
				// success out for form
				$("#categoriesName").closest('.form-group').addClass('has-success');
			}

			if(categoriesStatus == "") {
				$("#categoriesStatus").after('
Brand Name field is required
');
				$('#categoriesStatus').closest('.form-group').addClass('has-error');
			} else {
				// remov error text field
				$("#categoriesStatus").find('.text-danger').remove();
				// success out for form
				$("#categoriesStatus").closest('.form-group').addClass('has-success');
			}

			if(categoriesName && categoriesStatus) {
				var form = $(this);
				// button loading
				$("#createCategoriesBtn").button('loading');

				$.ajax({
					url : form.attr('action'),
					type: form.attr('method'),
					data: form.serialize(),
					dataType: 'json',
					success:function(response) {
						// button loading
						$("#createCategoriesBtn").button('reset');

						if(response.success == true) {
							// reload the manage member table
							manageCategoriesTable.ajax.reload(null, false);

	  	  			// reset the form text
							$("#submitCategoriesForm")[0].reset();
							// remove the error text
							$(".text-danger").remove();
							// remove the form error
							$('.form-group').removeClass('has-error').removeClass('has-success');

	  	  			$('#add-categories-messages').html('
'+
	            '<button type="button" class="close" data-dismiss="alert">×</button>'+
	            ' '+ response.messages +
		          '
');

	  	  			$(".alert-success").delay(500).show(10, function() {
								$(this).delay(3000).hide(10, function() {
									$(this).remove();
								});
							}); // /.alert
						}  // if

					} // /success
				}); // /ajax
			} // if

			return false;
		}); // submit categories form function
	}); // /on click on submit categories form modal

}); // /document

// edit categories function
function editCategories(categoriesId = null) {
	if(categoriesId) {
		// remove the added categories id
		$('#editCategoriesId').remove();
		// reset the form text
		$("#editCategoriesForm")[0].reset();
		// reset the form text-error
		$(".text-danger").remove();
		// reset the form group errro
		$('.form-group').removeClass('has-error').removeClass('has-success');

		// edit categories messages
		$("#edit-categories-messages").html("");
		// modal spinner
		$('.modal-loading').removeClass('div-hide');
		// modal result
		$('.edit-categories-result').addClass('div-hide');
		//modal footer
		$(".editCategoriesFooter").addClass('div-hide');

		$.ajax({
			url: 'php_action/fetchSelectedCategories.php',
			type: 'post',
			data: {categoriesId: categoriesId},
			dataType: 'json',
			success:function(response) {

				// modal spinner
				$('.modal-loading').addClass('div-hide');
				// modal result
				$('.edit-categories-result').removeClass('div-hide');
				//modal footer
				$(".editCategoriesFooter").removeClass('div-hide');

				// set the categories name
				$("#editCategoriesName").val(response.categories_name);
				// set the categories status
				$("#editCategoriesStatus").val(response.categories_active);
				// add the categories id
				$(".editCategoriesFooter").after('<input type="hidden" name="editCategoriesId" id="editCategoriesId" value="'+response.categories_id+'" />');

				// submit of edit categories form
				$("#editCategoriesForm").unbind('submit').bind('submit', function() {
					var categoriesName = $("#editCategoriesName").val();
					var categoriesStatus = $("#editCategoriesStatus").val();

					if(categoriesName == "") {
						$("#editCategoriesName").after('
Brand Name field is required
');
						$('#editCategoriesName').closest('.form-group').addClass('has-error');
					} else {
						// remov error text field
						$("#editCategoriesName").find('.text-danger').remove();
						// success out for form
						$("#editCategoriesName").closest('.form-group').addClass('has-success');
					}

					if(categoriesStatus == "") {
						$("#editCategoriesStatus").after('
Brand Name field is required
');
						$('#editCategoriesStatus').closest('.form-group').addClass('has-error');
					} else {
						// remov error text field
						$("#editCategoriesStatus").find('.text-danger').remove();
						// success out for form
						$("#editCategoriesStatus").closest('.form-group').addClass('has-success');
					}

					if(categoriesName && categoriesStatus) {
						var form = $(this);
						// button loading
						$("#editCategoriesBtn").button('loading');

						$.ajax({
							url : form.attr('action'),
							type: form.attr('method'),
							data: form.serialize(),
							dataType: 'json',
							success:function(response) {
								// button loading
								$("#editCategoriesBtn").button('reset');

								if(response.success == true) {
									// reload the manage member table
									manageCategoriesTable.ajax.reload(null, false);

									// remove the error text
									$(".text-danger").remove();
									// remove the form error
									$('.form-group').removeClass('has-error').removeClass('has-success');

			  	  			$('#edit-categories-messages').html('
'+
			            '<button type="button" class="close" data-dismiss="alert">×</button>'+
			            ' '+ response.messages +
				          '
');

			  	  			$(".alert-success").delay(500).show(10, function() {
										$(this).delay(3000).hide(10, function() {
											$(this).remove();
										});
									}); // /.alert
								}  // if

							} // /success
						}); // /ajax
					} // if

					return false;
				}); // /submit of edit categories form

			} // /success
		}); // /fetch the selected categories data

	} else {
		alert('Oops!! Refresh the page');
	}
} // /edit categories function

// remove categories function
function removeCategories(categoriesId = null) {

	$.ajax({
		url: 'php_action/fetchSelectedCategories.php',
		type: 'post',
		data: {categoriesId: categoriesId},
		dataType: 'json',
		success:function(response) {

			// remove categories btn clicked to remove the categories function
			$("#removeCategoriesBtn").unbind('click').bind('click', function() {
				// remove categories btn
				$("#removeCategoriesBtn").button('loading');

				$.ajax({
					url: 'php_action/removeCategories.php',
					type: 'post',
					data: {categoriesId: categoriesId},
					dataType: 'json',
					success:function(response) {
						if(response.success == true) {
 							// remove categories btn
							$("#removeCategoriesBtn").button('reset');
							// close the modal
							$("#removeCategoriesModal").modal('hide');
							// update the manage categories table
							manageCategoriesTable.ajax.reload(null, false);
							// udpate the messages
							$('.remove-messages').html('
'+
	            '<button type="button" class="close" data-dismiss="alert">×</button>'+
	            ' '+ response.messages +
		          '
');

	  	  			$(".alert-success").delay(500).show(10, function() {
								$(this).delay(3000).hide(10, function() {
									$(this).remove();
								});
							}); // /.alert
 						} else {
 							// close the modal
							$("#removeCategoriesModal").modal('hide');

 							// udpate the messages
							$('.remove-messages').html('
'+
	            '<button type="button" class="close" data-dismiss="alert">×</button>'+
	            ' '+ response.messages +
		          '
');

	  	  			$(".alert-success").delay(500).show(10, function() {
								$(this).delay(3000).hide(10, function() {
									$(this).remove();
								});
							}); // /.alert
 						} // /else

					} // /success function
				}); // /ajax function request server to remove the categories data
			}); // /remove categories btn clicked to remove the categories function

		} // /response
	}); // /ajax function to fetch the categories data
} // remove categories function


text:
.. meta::
    :author: Cask Data, Inc.
    :copyright: Copyright © 2014 Cask Data, Inc.

======================================================
CDAP Examples, Guides, and Tutorials Table of Contents
======================================================

.. toctree::
   :maxdepth: 3

   Introduction </index>
   Examples </examples/index>
   How-To Guides </how-to-guides/index>
   Tutorials </tutorials/index>
   Apps and Packs </apps-packs>


text:
module.exports = {
  // --------------------------------------------------------------
  // Middleware folder.
  // --------------------------------------------------------------
  //
  // System will try to load middleware in this folder,
  // and execute them.
  //
  // --------------------------------------------------------------
  folder: 'middlewares',
};