text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Pakist. J. Bot. 36(1): 217 (2004)

#### Original name
Aplosporella cesatii Sacc.

### Remarks
null

redpajama_set_name: RedPajamaGithub


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

    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>pymatgen.io.xr module — pymatgen 2018.3.14 documentation</title>
    <link rel="stylesheet" href="_static/proBlue.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />

Navigation

          index

          modules |

pymatgen 2018.3.14 documentation »

pymatgen.io.xr module¶

class Xr(structure)[source]¶

Bases: object

Basic object for working with xr files.

<col class="field-name" />
<col class="field-body" />

Parameters:	structure (Structure/IStructure) – Structure object to create the
Xr object.

static from_file(use_cores=True, thresh=0.0001)[source]¶

Reads an xr-formatted file to create an Xr object.

<col class="field-name" />
<col class="field-body" />

Parameters:

filename (str) – name of file to read from.

use_cores (bool) – use core positions and discard shell
positions if set to True (default).  Otherwise,
use shell positions and discard core positions.

thresh (float) – relative threshold for consistency check
between cell parameters (lengths and angles) from
header information and cell vectors, respectively.

Returns:

Xr object corresponding to the input

file.

Return type:
xr (Xr)

static from_string(use_cores=True, thresh=0.0001)[source]¶

Creates an Xr object from a string representation.

<col class="field-name" />
<col class="field-body" />

Parameters:

string (str) – string representation of an Xr object.

use_cores (bool) – use core positions and discard shell
positions if set to True (default).  Otherwise,
use shell positions and discard core positions.

thresh (float) – relative threshold for consistency check
between cell parameters (lengths and angles) from
header information and cell vectors, respectively.

Returns:

Xr object corresponding to the input

string representation.

Return type:
xr (Xr)

write_file(filename)[source]¶

Write out an xr file.

<col class="field-name" />
<col class="field-body" />

Parameters:	filename (str) – name of the file to write to.

This Page

Show Source

Quick search

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

Navigation

          index

          modules |

pymatgen 2018.3.14 documentation »

        © Copyright 2011, Pymatgen Development Team.
      Created using Sphinx 1.7.1.

This page uses
Google Analytics to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.


text:
#ifndef PSPINTRMAN_KERNEL_H
#define PSPINTRMAN_KERNEL_H

#include <pspkerneltypes.h>

/** @defgroup IntrManKern Interrupt Manager Kernel
  * This module contains routines to manage interrupts.
  */

/** @addtogroup IntrManKern Interrupt Manager Kernel */
/*@{*/

#ifdef __cplusplus
extern "C" {
#endif

/**
  * Register an interrupt handler.
  *
  * @param intno - The interrupt number to register.
  * @param no    - The queue number.
  * @param handler - Pointer to the handler.
  * @param arg1    - Unknown (probably a set of flags)
  * @param arg2    - Unknown (probably a common pointer)
  *
  * @return 0 on success.
  */
int sceKernelRegisterIntrHandler(int intno, int no, void *handler, void *arg1, void *arg2);

/**
 * Release an interrupt handler
 *
 * @param intno - The interrupt number to release
 *
 * @return 0 on success
 */
int sceKernelReleaseIntrHandler(int intno);

/**
  * Enable an interrupt.
  *
  * @param intno - Interrupt to enable.
  *
  * @return 0 on success.
  */
int sceKernelEnableIntr(int intno);

/**
  * Disable an interrupt.
  *
  * @param intno - Interrupt to disable.
  *
  * @return 0 on success.
  */
int sceKernelDisableIntr(int intno);

/**
 * Check if we are in an interrupt context or not
 *
 * @return 1 if we are in an interrupt context, else 0
 */
int sceKernelIsIntrContext(void);

#ifdef __cplusplus
}
#endif

/*@}*/

#endif /* PSPINTRMAN_KERNEL_H */


text:
$(document).ready(function(){

	//Mostrar/Ocultar Columna Precios Unitarios y Cantidad
	$("#decoyeso_pedidobundle_presupuestotype_mostrarPreciosUnitarios").bind("change", function(){

		if ($(this).val() == 0) {
			$(".NtdCantidad, .NtdPrecioUnitario, .inputCantidad, .precioUnitario").removeClass("NvisibilityHidden")
		}
		else{
			$(".NtdCantidad, .NtdPrecioUnitario, .inputCantidad, .precioUnitario").addClass("NvisibilityHidden")
		}
	});

	$('#decoyeso_pedidobundle_presupuestotype_mostrarPreciosUnitarios').trigger('change');

	//Operacion CANTIDAD * PRECIO UNIT.
	$(".inputCantidad, .precioUnitario").change(function(index, el) {

		var inputs = new Array();
		inputs['inputCantidad'] = new Array();
		inputs['precioUnitario'] = new Array();

		$(".inputCantidad").each(function(index) {
			if ($(this).val() != "" && $.isNumeric($(this).val()))
				inputs["inputCantidad"][index] = parseFloat($(this).val());
		});
		$(".precioUnitario").each(function(index) {
			if ($(this).val() != "" && $.isNumeric($(this).val()))
				inputs["precioUnitario"][index] = parseFloat($(this).val());
		});

		$(".inputPrecioTotal").each(function(index) {
			if ($.isNumeric(inputs["inputCantidad"][index]) && $.isNumeric(inputs["precioUnitario"][index])) {
				$(this).val(inputs["inputCantidad"][index] * inputs["precioUnitario"][index])
				$(this).change();
			}
		});

	});

	//Sumas de casillas PRECIO TOTAL
	$(".inputPrecioTotal").change(function(){

		var subTotal = 0;
		$(".inputPrecioTotal").each(function() {
			if ($(this).val() != "") {
				if ($.isNumeric($(this).val())) {
					subTotal = subTotal + parseFloat($(this).val());
				}
				else {
					alert ("El valor "+$(this).val()+" no se puede sumar. Por favor reviselo.");
				}
			}
		});
		$("#decoyeso_pedidobundle_presupuestotype_subTotal, #decoyeso_pedidobundle_presupuestotype_total").val(subTotal);

	});

});


text:
using System;
using NetCoreForce.Client.Models;
using NetCoreForce.Client.Attributes;
using Newtonsoft.Json;

namespace NetCoreForce.Models
{
	///
	/// Auth Session
	///<para>SObject Name: AuthSession</para>
	///<para>Custom Object: False</para>
	///
	public class SfAuthSession : SObject
	{
		[JsonIgnore]
		public static string SObjectTypeName
		{
			get { return "AuthSession"; }
		}

		///
		/// Auth Session ID
		/// <para>Name: Id</para>
		/// <para>SF Type: id</para>
		/// <para>Nillable: False</para>
		///
		[JsonProperty(PropertyName = "id")]
		[Updateable(false), Createable(false)]
		public string Id { get; set; }

		///
		/// User ID
		/// <para>Name: UsersId</para>
		/// <para>SF Type: reference</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "usersId")]
		[Updateable(false), Createable(false)]
		public string UsersId { get; set; }

		///
		/// ReferenceTo: User
		/// <para>RelationshipName: Users</para>
		///
		[JsonProperty(PropertyName = "users")]
		[Updateable(false), Createable(false)]
		public SfUser Users { get; set; }

		///
		/// Created
		/// <para>Name: CreatedDate</para>
		/// <para>SF Type: datetime</para>
		/// <para>Nillable: False</para>
		///
		[JsonProperty(PropertyName = "createdDate")]
		[Updateable(false), Createable(false)]
		public DateTimeOffset? CreatedDate { get; set; }

		///
		/// Updated
		/// <para>Name: LastModifiedDate</para>
		/// <para>SF Type: datetime</para>
		/// <para>Nillable: False</para>
		///
		[JsonProperty(PropertyName = "lastModifiedDate")]
		[Updateable(false), Createable(false)]
		public DateTimeOffset? LastModifiedDate { get; set; }

		///
		/// Valid For
		/// <para>Name: NumSecondsValid</para>
		/// <para>SF Type: int</para>
		/// <para>Nillable: False</para>
		///
		[JsonProperty(PropertyName = "numSecondsValid")]
		[Updateable(false), Createable(false)]
		public int? NumSecondsValid { get; set; }

		///
		/// User Type
		/// <para>Name: UserType</para>
		/// <para>SF Type: picklist</para>
		/// <para>Nillable: False</para>
		///
		[JsonProperty(PropertyName = "userType")]
		[Updateable(false), Createable(false)]
		public string UserType { get; set; }

		///
		/// Source IP
		/// <para>Name: SourceIp</para>
		/// <para>SF Type: string</para>
		/// <para>Nillable: False</para>
		///
		[JsonProperty(PropertyName = "sourceIp")]
		[Updateable(false), Createable(false)]
		public string SourceIp { get; set; }

		///
		/// Login
		/// <para>Name: LoginType</para>
		/// <para>SF Type: picklist</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "loginType")]
		[Updateable(false), Createable(false)]
		public string LoginType { get; set; }

		///
		/// Session Type
		/// <para>Name: SessionType</para>
		/// <para>SF Type: picklist</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "sessionType")]
		[Updateable(false), Createable(false)]
		public string SessionType { get; set; }

		///
		/// Session Security Level
		/// <para>Name: SessionSecurityLevel</para>
		/// <para>SF Type: picklist</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "sessionSecurityLevel")]
		[Updateable(false), Createable(false)]
		public string SessionSecurityLevel { get; set; }

		///
		/// Logout URL
		/// <para>Name: LogoutUrl</para>
		/// <para>SF Type: string</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "logoutUrl")]
		[Updateable(false), Createable(false)]
		public string LogoutUrl { get; set; }

		///
		/// Auth Session ID
		/// <para>Name: ParentId</para>
		/// <para>SF Type: reference</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "parentId")]
		[Updateable(false), Createable(false)]
		public string ParentId { get; set; }

		///
		/// Login History ID
		/// <para>Name: LoginHistoryId</para>
		/// <para>SF Type: reference</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "loginHistoryId")]
		[Updateable(false), Createable(false)]
		public string LoginHistoryId { get; set; }

		///
		/// ReferenceTo: LoginHistory
		/// <para>RelationshipName: LoginHistory</para>
		///
		[JsonProperty(PropertyName = "loginHistory")]
		[Updateable(false), Createable(false)]
		public SfLoginHistory LoginHistory { get; set; }

		///
		/// Login Geo Data ID
		/// <para>Name: LoginGeoId</para>
		/// <para>SF Type: reference</para>
		/// <para>Nillable: True</para>
		///
		[JsonProperty(PropertyName = "loginGeoId")]
		[Updateable(false), Createable(false)]
		public string LoginGeoId { get; set; }

		///
		/// ReferenceTo: LoginGeo
		/// <para>RelationshipName: LoginGeo</para>
		///
		[JsonProperty(PropertyName = "loginGeo")]
		[Updateable(false), Createable(false)]
		public SfLoginGeo LoginGeo { get; set; }

		///
		/// Current Session
		/// <para>Name: IsCurrent</para>
		/// <para>SF Type: boolean</para>
		/// <para>Nillable: False</para>
		///
		[JsonProperty(PropertyName = "isCurrent")]
		[Updateable(false), Createable(false)]
		public bool? IsCurrent { get; set; }

	}
}


text:
#ifndef ASF_H
#define ASF_H

/*
 * This file includes all API header files for the selected drivers from ASF.
 * Note: There might be duplicate includes required by more than one driver.
 *
 * The file is automatically generated and will be re-written when
 * running the ASF driver selector tool. Any changes will be discarded.
 */

// From module: Compiler abstraction layer and code utilities
#include <compiler.h>
#include <status_codes.h>

// From module: EVK1101
#include <led.h>

// From module: FLASHC - Flash Controller
#include <flashc.h>

// From module: GPIO - General-Purpose Input/Output
#include <gpio.h>

// From module: Generic board support
#include <board.h>

// From module: Interrupt management - UC3 implementation
#include <interrupt.h>

// From module: Memory Control Access Interface
#include <ctrl_access.h>

// From module: PM Power Manager- UC3 A0/A1/A3/A4/B0/B1 implementation
#include <power_clocks_lib.h>
#include <sleep.h>

// From module: Part identification macros
#include <parts.h>

// From module: SPI - Serial Peripheral Interface
#include <spi.h>

// From module: SPI - UC3 implementation
#include <spi_master.h>
#include <spi_master.h>

// From module: Sleep manager - UC3 implementation
#include <sleepmgr.h>
#include <uc3/sleepmgr.h>

// From module: System Clock Control - UC3 B0 implementation
#include <sysclk.h>

// From module: USART - Universal Synchronous/Asynchronous Receiver/Transmitter
#include <usart.h>

// From module: USB CDC Protocol
#include <usb_protocol_cdc.h>

// From module: USB Device CDC (Composite Device)
#include <udi_cdc.h>

// From module: USB Device MSC (Composite Device)
#include <udi_msc.h>

// From module: USB Device Stack Core (Common API)
#include <udc.h>
#include <udd.h>

// From module: USB MSC Protocol
#include <usb_protocol_msc.h>

#endif // ASF_H


text:
<?php

namespace PhpExtended\Ldap;

/**
 * LdapException class file.
 *
 * This exception does nothing special but helps differenciate with generic
 * exceptions given by other libraries.
 *
 * @author Anastaszor
 */
class LdapException extends \Exception
{
	// does nothing more than simple Exception
}


text:
NewAVR examples
==================

These are projects that use Atmel Studio 7 and/or MPLAB X.

|        Name         | Description                                                |
|---------------------|------------------------------------------------------------|
| AS7 | Atmel Studio projects.|
| MPLAB | MPLAB X projects.|
| NewAVR.rtf | Start up notes. (.rtf file).|
| Building Your ... | Notes on developing a non-OS system. (.rtf file).|


text:
package replicant;

/**
 * An enum describing the state of the runtime.
 */
public enum RuntimeState
{
  /**
   * The service is not yet connected or has been disconnected
   */
  DISCONNECTED,
  /**
   * The service has started connecting but connection has not completed.
   */
  CONNECTING,
  /**
   * The service is connected.
   */
  CONNECTED,
  /**
   * The service has started disconnecting but disconnection has not completed.
   */
  DISCONNECTING,
  /**
   * The service is in error state. This error may occur during connection, disconnection or in normal operation.
   */
  ERROR
}


text:
package org.jivesoftware.openfire.http;

import java.net.InetAddress;
import java.util.List;
import java.util.Map;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
import org.eclipse.jetty.util.log.Log;
import org.jivesoftware.openfire.SessionManager;
import org.jivesoftware.openfire.StreamID;
import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.util.JiveConstants;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.TaskEngine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Manages sessions for all users connecting to Openfire using the HTTP binding protocal,
 * XEP-0124.
 */
public class HttpSessionManager {

	private static final Logger Log = LoggerFactory.getLogger(HttpSessionManager.class);

    private SessionManager sessionManager;
    private Map<String, HttpSession> sessionMap = new ConcurrentHashMap<String, HttpSession>(
    		JiveGlobals.getIntProperty("xmpp.httpbind.session.initial.count", 16));
    private TimerTask inactivityTask;
    private ThreadPoolExecutor sendPacketPool;
    private SessionListener sessionListener = new SessionListener() {
        public void connectionOpened(HttpSession session, HttpConnection connection) {
        }

        public void connectionClosed(HttpSession session, HttpConnection connection) {
        }

        public void sessionClosed(HttpSession session) {
            sessionMap.remove(session.getStreamID().getID());
        }
    };

    /**
     * Creates a new HttpSessionManager instance.
     */
    public HttpSessionManager() {
        this.sessionManager = SessionManager.getInstance();

        // Configure a pooled executor to handle async routing for incoming packets
        // with a default size of 16 threads ("xmpp.httpbind.worker.threads"); also
        // uses an unbounded task queue and configurable keep-alive (default: 60 secs)

        // Note: server supports up to 254 client threads by default (@see HttpBindManager)
        // BOSH installations expecting heavy loads may want to allocate additional threads
        // to this worker pool to ensure timely delivery of inbound packets

        int poolSize = JiveGlobals.getIntProperty("xmpp.httpbind.worker.threads",
				// use deprecated property as default (shared with ConnectionManagerImpl)
				JiveGlobals.getIntProperty("xmpp.client.processing.threads", 16));
        int keepAlive = JiveGlobals.getIntProperty("xmpp.httpbind.worker.timeout", 60);

        sendPacketPool = new ThreadPoolExecutor(poolSize, poolSize, keepAlive, TimeUnit.SECONDS,
			new LinkedBlockingQueue<Runnable>(), // unbounded task queue
	        new ThreadFactory() { // custom thread factory for BOSH workers
	            final AtomicInteger counter = new AtomicInteger(1);
	            public Thread newThread(Runnable runnable) {
	                Thread thread = new Thread(Thread.currentThread().getThreadGroup(), runnable,
	                                    "httpbind-worker-" + counter.getAndIncrement());
	                thread.setDaemon(true);
	                return thread;
	            }
	    	});
    }

    /**
     * Starts the services used by the HttpSessionManager.
     */
    public void start() {
        inactivityTask = new HttpSessionReaper();
        TaskEngine.getInstance().schedule(inactivityTask, 30 * JiveConstants.SECOND,
                30 * JiveConstants.SECOND);
        sendPacketPool.prestartCoreThread();
    }

    /**
     * Stops any services and cleans up any resources used by the HttpSessionManager.
     */
    public void stop() {
        inactivityTask.cancel();
        for (HttpSession session : sessionMap.values()) {
            session.close();
        }
        sessionMap.clear();
        sendPacketPool.shutdown();
    }

    /**
     * Returns the session related to a stream id.
     *
     * @param streamID the stream id to retrieve the session.
     * @return the session related to the provided stream id.
     */
    public HttpSession getSession(String streamID) {
        return sessionMap.get(streamID);
    }

    /**
     * Creates an HTTP binding session which will allow a user to exchange packets with Openfire.
     *
     * @param address the internet address that was used to bind to Wildfie.
     * @param rootNode the body element that was sent containing the request for a new session.
     * @param connection the HTTP connection object which abstracts the individual connections to
     * Openfire over the HTTP binding protocol. The initial session creation response is returned to
     * this connection.
     * @return the created HTTP session.
     *
     * @throws UnauthorizedException if the Openfire server is currently in an uninitialized state.
     * Either shutting down or starting up.
     * @throws HttpBindException when there is an internal server error related to the creation of
     * the initial session creation response.
     */
    public HttpSession createSession(InetAddress address, Element rootNode,
                                     HttpConnection connection)
            throws UnauthorizedException, HttpBindException {
        // TODO Check if IP address is allowed to connect to the server

        // Default language is English ("en").
        String language = rootNode.attributeValue("xml:lang");
        if (language == null || "".equals(language)) {
            language = "en";
        }

        int wait = getIntAttribute(rootNode.attributeValue("wait"), 60);
        int hold = getIntAttribute(rootNode.attributeValue("hold"), 1);

        String version = rootNode.attributeValue("ver");
        if (version == null || "".equals(version)) {
        	version = "1.5";
        }

        HttpSession session = createSession(connection.getRequestId(), address, connection);
        session.setWait(Math.min(wait, getMaxWait()));
        session.setHold(hold);
        session.setSecure(connection.isSecure());
        session.setMaxPollingInterval(getPollingInterval());
        session.setMaxRequests(getMaxRequests());
        session.setMaxPause(getMaxPause());

        if(session.isPollingSession()) {
        	session.setDefaultInactivityTimeout(getPollingInactivityTimeout());
        }
        else {
        	session.setDefaultInactivityTimeout(getInactivityTimeout());
        }
    	session.resetInactivityTimeout();

        // Store language and version information in the connection.
        session.setLanguage(language);

        String [] versionString = version.split("\\.");
        session.setMajorVersion(Integer.parseInt(versionString[0]));
        session.setMinorVersion(Integer.parseInt(versionString[1]));

        try {
            connection.deliverBody(createSessionCreationResponse(session));
        }
        catch (HttpConnectionClosedException e) {
            /* This won't happen here. */
        }
        catch (DocumentException e) {
            Log.error("Error creating document", e);
            throw new HttpBindException("Internal server error",
                    BoshBindingError.internalServerError);
        }
        return session;
    }

    /**
     * Returns the maximum length of a temporary session pause (in seconds) that the client MAY
     * request.
     *
     * @return the maximum length of a temporary session pause (in seconds) that the client MAY
     *         request.
     */
    public int getMaxPause() {
        return JiveGlobals.getIntProperty("xmpp.httpbind.client.maxpause", 300);
    }

    /**
     * Returns the longest time (in seconds) that Openfire is allowed to wait before responding to
     * any request during the session. This enables the client to prevent its TCP connection from
     * expiring due to inactivity, as well as to limit the delay before it discovers any network
     * failure.
     *
     * @return the longest time (in seconds) that Openfire is allowed to wait before responding to
     *         any request during the session.
     */
    public int getMaxWait() {
        return JiveGlobals.getIntProperty("xmpp.httpbind.client.requests.wait",
                Integer.MAX_VALUE);
    }

    /**
     * Openfire SHOULD include two additional attributes in the session creation response element,
     * specifying the shortest allowable polling interval and the longest allowable inactivity
     * period (both in seconds). Communication of these parameters enables the client to engage in
     * appropriate behavior (e.g., not sending empty request elements more often than desired, and
     * ensuring that the periods with no requests pending are never too long).
     *
     * @return the maximum allowable period over which a client can send empty requests to the
     *         server.
     */
    public int getPollingInterval() {
        return JiveGlobals.getIntProperty("xmpp.httpbind.client.requests.polling", 5);
    }

    /**
     * Openfire MAY limit the number of simultaneous requests the client makes with the 'requests'
     * attribute. The RECOMMENDED value is "2". Servers that only support polling behavior MUST
     * prevent clients from making simultaneous requests by setting the 'requests' attribute to a
     * value of "1" (however, polling is NOT RECOMMENDED). In any case, clients MUST NOT make more
     * simultaneous requests than specified by the Openfire.
     *
     * @return the number of simultaneous requests allowable.
     */
    public int getMaxRequests() {
        return JiveGlobals.getIntProperty("xmpp.httpbind.client.requests.max", 2);
    }

    /**
     * Seconds a session has to be idle to be closed. Default is 30. Sending stanzas to the
     * client is not considered as activity. We are only considering the connection active when the
     * client sends some data or hearbeats (i.e. whitespaces) to the server. The reason for this is
     * that sending data will fail if the connection is closed. And if the thread is blocked while
     * sending data (because the socket is closed) then the clean up thread will close the socket
     * anyway.
     *
     * @return Seconds a session has to be idle to be closed.
     */
    public int getInactivityTimeout() {
        return JiveGlobals.getIntProperty("xmpp.httpbind.client.idle", 30);
    }

    /**
     * Seconds a polling session has to be idle to be closed. Default is 60. Sending stanzas to the
     * client is not considered as activity. We are only considering the connection active when the
     * client sends some data or hearbeats (i.e. whitespaces) to the server. The reason for this is
     * that sending data will fail if the connection is closed. And if the thread is blocked while
     * sending data (because the socket is closed) then the clean up thread will close the socket
     * anyway.
     *
     * @return Seconds a polling session has to be idle to be closed.
     */
    public int getPollingInactivityTimeout() {
        return JiveGlobals.getIntProperty("xmpp.httpbind.client.idle.polling", 60);
    }

    /**
     * Forwards a client request, which is related to a session, to the server. A connection is
     * created and queued up in the provided session. When a connection reaches the top of a queue
     * any pending packets bound for the client will be forwarded to the client through the
     * connection.
     *
     * @param rid the unique, sequential, requestID sent from the client.
     * @param session the HTTP session of the client that made the request.
     * @param isSecure true if the request was made over a secure channel, HTTPS, and false if it
     * was not.
     * @param rootNode the XML body of the request.
     * @return the created HTTP connection.
     *
     * @throws HttpBindException for several reasons: if the encoding inside of an auth packet is
     * not recognized by the server, or if the packet type is not recognized.
     * @throws HttpConnectionClosedException if the session is no longer available.
     */
    public HttpConnection forwardRequest(long rid, HttpSession session, boolean isSecure,
                                         Element rootNode) throws HttpBindException,
            HttpConnectionClosedException
    {
        //noinspection unchecked
        List<Element> elements = rootNode.elements();
    	boolean isPoll = (elements.size() == 0);
    	if ("terminate".equals(rootNode.attributeValue("type")))
    		isPoll = false;
    	else if ("true".equals(rootNode.attributeValue(new QName("restart", rootNode.getNamespaceForPrefix("xmpp")))))
    		isPoll = false;
    	else if (rootNode.attributeValue("pause") != null)
    		isPoll = false;
        HttpConnection connection = session.createConnection(rid, elements, isSecure, isPoll);
        if (elements.size() > 0) {
            // creates the runnable to forward the packets
            new HttpPacketSender(session).init();
        }
        return connection;
    }

    private HttpSession createSession(long rid, InetAddress address, HttpConnection connection) throws UnauthorizedException {
        // Create a ClientSession for this user.
        StreamID streamID = SessionManager.getInstance().nextStreamID();
        // Send to the server that a new client session has been created
        HttpSession session = sessionManager.createClientHttpSession(rid, address, streamID, connection);
        // Register that the new session is associated with the specified stream ID
        sessionMap.put(streamID.getID(), session);
        session.addSessionCloseListener(sessionListener);
        return session;
    }

    private static int getIntAttribute(String value, int defaultValue) {
        if (value == null || "".equals(value.trim())) {
            return defaultValue;
        }
        try {
            return Integer.valueOf(value);
        }
        catch (Exception ex) {
            return defaultValue;
        }
    }

    private double getDoubleAttribute(String doubleValue, double defaultValue) {
        if (doubleValue == null || "".equals(doubleValue.trim())) {
            return defaultValue;
        }
        try {
            return Double.parseDouble(doubleValue);
        }
        catch (Exception ex) {
            return defaultValue;
        }
    }

    private String createSessionCreationResponse(HttpSession session) throws DocumentException {
        Element response = DocumentHelper.createElement("body");
        response.addNamespace("", "http://jabber.org/protocol/httpbind");
        response.addNamespace("stream", "http://etherx.jabber.org/streams");
        response.addAttribute("authid", session.getStreamID().getID());
        response.addAttribute("sid", session.getStreamID().getID());
        response.addAttribute("secure", Boolean.TRUE.toString());
        response.addAttribute("requests", String.valueOf(session.getMaxRequests()));
        response.addAttribute("inactivity", String.valueOf(session.getInactivityTimeout()));
        response.addAttribute("polling", String.valueOf(session.getMaxPollingInterval()));
        response.addAttribute("wait", String.valueOf(session.getWait()));
        if ((session.getMajorVersion() == 1 && session.getMinorVersion() >= 6) ||
        	session.getMajorVersion() > 1) {
            response.addAttribute("hold", String.valueOf(session.getHold()));
            response.addAttribute("ack", String.valueOf(session.getLastAcknowledged()));
            response.addAttribute("maxpause", String.valueOf(session.getMaxPause()));
            response.addAttribute("ver", String.valueOf(session.getMajorVersion())
            		+ "." + String.valueOf(session.getMinorVersion()));
        }

        Element features = response.addElement("stream:features");
        for (Element feature : session.getAvailableStreamFeaturesElements()) {
            features.add(feature);
        }

        return response.asXML();
    }

    private class HttpSessionReaper extends TimerTask {

        @Override
		public void run() {
            long currentTime = System.currentTimeMillis();
            for (HttpSession session : sessionMap.values()) {
                long lastActive = currentTime - session.getLastActivity();
                if (Log.isDebugEnabled()) {
                	Log.debug("Session was last active " + lastActive + " ms ago: " + session.getAddress());
                }
                if (lastActive > session.getInactivityTimeout() * JiveConstants.SECOND) {
                	Log.info("Closing idle session: " + session.getAddress());
                    session.close();
                }
            }
        }
    }

    /**
     * A runner that guarantees that the packets per a session will be sent and
     * processed in the order in which they were received.
     */
    private class HttpPacketSender implements Runnable {
        private HttpSession session;

        HttpPacketSender(HttpSession session) {
            this.session = session;
        }

        public void run() {
            session.sendPendingPackets();
        }

        private void init() {
            sendPacketPool.execute(this);
        }
    }
}


text:
package cn.edu.nju.pasalab.db.cache;

import cn.edu.nju.pasalab.db.BasicKVDatabaseClient;
import org.caffinitas.ohc.*;
import it.unimi.dsi.fastutil.ints.IntArrayList;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.ByteBuffer;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicLong;
import java.util.logging.Logger;

/**
 * Created by wzk on 18-4-28.
 */
public class CachedClient extends BasicKVDatabaseClient {

    static public final String CONF_CACHE_CAPACITY = "cache.capacity.in.byte"; // in byte
    static public final String DEFAULT_CACHE_CAPACITY = "8,388,608"; // 8 MB by default
    static public final String CONF_CACHE_STATS_FILE_PATH = "cache.stats.file.path"; // store cache stats
    static public final String DEFAULT_CACHE_STATS_FILE_PATH = "/tmp/cache.stats";
    static public final String CONF_CACHE_CONCURRENCY = "cache.concurrency";
    static public final String DEFAULT_CACHE_CONCURRENCY = "4";
    static public final String CONF_CACHE_HASHTABLE_SIZE_PER_SEGMENT = "cache.hashtable.size.per.segment";
    static public final String DEFAULT_CACHE_HASHTABLE_SIZE_PER_SEGMENT = "8192";
    static public final String CONF_DB_BACKEND_CLASS_NAME = "cache.db.backend.class.name"; // required, no default!

    private static Thread cacheStatsReportThread = null;

    private BasicKVDatabaseClient db;
    private OHCache<byte[], byte[]> cache;
    private long cacheCapacityInBytes = 1;
    private String statsFilePath;
    private int concurrency; // = segment_count in the OHC cache.
    private int hashTableSizePerSegment;
    private String dbClassName;
    private AtomicLong queryCount = new AtomicLong(0L);
    private AtomicLong hitCount = new AtomicLong(0L);
    private Logger logger = Logger.getLogger(this.getClass().getName());

    /**
     * @param key
     * @return the value. Return null if the key does not exist.
     * @throws Exception
     */
    @Override
    public byte[] get(byte[] key) throws Exception {
        assert cache != null;
        this.queryCount.getAndAdd(1L);
        byte[] result = cache.get(key);
        if (result == null) {
            result = db.get(key);
            if (result != null) {
                cache.put(key, result);
            }
        } else {
            this.hitCount.getAndAdd(1L);
        }
        return result;
    }

    @Override
    public byte[][] getAll(byte keys[][]) throws Exception{
        byte[][] results = new byte[keys.length][];
        IntArrayList queryKeysIDs = new IntArrayList();
        long localQueryCount = 0L;
        long localHitCount = 0L;

        for (int i = 0; i < keys.length; i++) {
            localQueryCount++;
            byte[] result = cache.get(keys[i]);
            if (result == null) {
                queryKeysIDs.add(i);
            } else {
                results[i] = result;
                localHitCount++;
            }
        }
        this.queryCount.addAndGet(localQueryCount);
        this.hitCount.addAndGet(localHitCount);
        byte[][] queryKeys = new byte[queryKeysIDs.size()][];
        for (int i = 0; i < queryKeysIDs.size(); i++) {
            queryKeys[i] = keys[queryKeysIDs.getInt(i)];
        }
        byte[][] queryResults = db.getAll(queryKeys);
        for (int i = 0; i < queryKeysIDs.size(); i++) {
            int kID = queryKeysIDs.getInt(i);
            results[kID] = queryResults[i];
            if (queryResults[i] != null) {
                cache.put(queryKeys[i], queryResults[i]);
            }

        }
        return results;
    }

    @Override
    public void put(byte[] key, byte[] value) throws Exception {
        db.put(key, value);
    }

    @Override
    public void putAll(byte[][] keys, byte[][] values) throws Exception {
        db.putAll(keys, values);
    }

    /**
     * Close the database connections.
     */
    @Override
    public void close() throws Exception {
        cache.clear();
        cache.close();
        db.close();
        cacheStatsReportThread.interrupt();
    }

    /**
     * Clear the contents in the database
     */
    @Override
    public void clearDB() throws Exception {
        cache.clear();
        db.clearDB();
    }

    @Override
    public void createDB() throws Exception {
        db.createDB();
    }

    private void loadConfigurations(Properties conf) throws IOException {
        String capacityString = conf.getProperty(CONF_CACHE_CAPACITY, DEFAULT_CACHE_CAPACITY);
        this.cacheCapacityInBytes = Long.valueOf(capacityString);
        this.statsFilePath = conf.getProperty(CONF_CACHE_STATS_FILE_PATH, DEFAULT_CACHE_STATS_FILE_PATH);
        this.concurrency = Integer.parseInt(conf.getProperty(CONF_CACHE_CONCURRENCY, DEFAULT_CACHE_CONCURRENCY));
        this.hashTableSizePerSegment = Integer.parseInt(
                conf.getProperty(CONF_CACHE_HASHTABLE_SIZE_PER_SEGMENT,
                        DEFAULT_CACHE_HASHTABLE_SIZE_PER_SEGMENT));
        this.dbClassName = conf.getProperty(CONF_DB_BACKEND_CLASS_NAME);
        long totalHashTableSize = hashTableSizePerSegment * concurrency * 8; // according to the equation
        String configurationInfo = String.format("Get configurations: %s.\n"
                + "Set cache capacity: %d bytes.\n"
                + "# Segments: %d.\n"
                + "Total hash table size: %d bytes.",
                conf, this.cacheCapacityInBytes, this.concurrency, totalHashTableSize);
        logger.info(configurationInfo);
    }

    /**
     * Connect to the underlying database
     *
     * @param conf Database connection-related configurations
     * @throws Exception database connection exception
     */
    @Override
    public void connect(Properties conf) throws Exception {
        loadConfigurations(conf);
        // Connect database
        logger.info("Database backend:" + dbClassName);
        Class dbClass = Class.forName(dbClassName);
        this.db = (BasicKVDatabaseClient) dbClass.newInstance();
        db.connect(conf);
        // create the cache
        OHCacheBuilder<byte[], byte[]> builder = OHCacheBuilder.<byte[], byte[]>newBuilder()
                .keySerializer(new ByteArraySerializer())
                .valueSerializer(new ByteArraySerializer())
                .segmentCount(concurrency)
                .hashTableSize(hashTableSizePerSegment)
                .capacity(cacheCapacityInBytes)
                .throwOOME(true);
        this.cache = builder.build();
        cacheStatsReportThread = new Thread(new CacheStatsReportRunnable(2));
        cacheStatsReportThread.setDaemon(true);
        cacheStatsReportThread.setName("Cache Stats Reporter");
        cacheStatsReportThread.start();

    }

    private class ByteArraySerializer implements CacheSerializer<byte[]> {

        @Override
        public void serialize(byte[] bytes, ByteBuffer byteBuffer) {
            byteBuffer.put(bytes);
        }

        @Override
        public byte[] deserialize(ByteBuffer byteBuffer) {
            byte[] array = new byte[byteBuffer.remaining()];
            byteBuffer.get(array, 0, array.length);
            return array;
        }

        @Override
        public int serializedSize(byte[] bytes) {
            return bytes.length;
        }
    }

    private class CacheStatsReportRunnable implements Runnable {

        private long sleepTimeInSecond = 2;

        public CacheStatsReportRunnable() {
        }

        public CacheStatsReportRunnable(long sleepTimeInSecond) {
            this.sleepTimeInSecond = sleepTimeInSecond;
        }

        private void writeStatsToFile() {
            try {
                PrintWriter writer = new PrintWriter(new File(statsFilePath));
                long missCount = queryCount.get() - hitCount.get();
                writer.println(String.format("CacheStats{hitCount=%d, missCount=%d, }", hitCount.get(), missCount));
                writer.close();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        @Override
        public void run() {
            while (true) {
                writeStatsToFile();
                try {
                    Thread.sleep(sleepTimeInSecond * 1000, 0);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}


text:
#include <stdlib.h>
#include "pocl_cl.h"
#include "pocl_image_util.h"
#include "pocl_util.h"
#include "utlist.h"
#include <stdlib.h>
#include <string.h>

CL_API_ENTRY void * CL_API_CALL
POname(clEnqueueMapImage)(cl_command_queue   command_queue,
                          cl_mem             image,
                          cl_bool            blocking_map,
                          cl_map_flags       map_flags,
                          const size_t *     origin,
                          const size_t *     region,
                          size_t *           image_row_pitch,
                          size_t *           image_slice_pitch,
                          cl_uint            num_events_in_wait_list,
                          const cl_event *   event_wait_list,
                          cl_event *         event,
                          cl_int *           errcode_ret )
CL_API_SUFFIX__VERSION_1_0
{
  cl_int errcode = CL_SUCCESS;
  cl_int mapping_result = CL_FAILED;
  cl_device_id device;
  _cl_command_node *cmd = NULL;
  unsigned i;
  mem_mapping_t *mapping_info = NULL;
  void *retval = NULL;
  /* need to release the memobject before returning? */
  int must_release = 0;

  POCL_GOTO_ERROR_COND((command_queue == NULL), CL_INVALID_COMMAND_QUEUE);

  device = command_queue->device;

  POCL_GOTO_ERROR_ON((command_queue->context != image->context),
    CL_INVALID_CONTEXT, "image and command_queue are not from the same context\n");

  POCL_GOTO_ERROR_COND((image == NULL), CL_INVALID_MEM_OBJECT);

  if (IS_IMAGE1D_BUFFER (image))
    {
      IMAGE1D_ORIG_REG_TO_BYTES (image, origin, region)
      return POname (clEnqueueMapBuffer) (
          command_queue, image,
          blocking_map, map_flags,
          i1d_origin[0], i1d_region[0],
          num_events_in_wait_list, event_wait_list, event,
          errcode_ret);
    }

  POCL_GOTO_ERROR_ON ((!image->is_image), CL_INVALID_MEM_OBJECT,
                      "image argument is not an image\n");

  POCL_GOTO_ON_UNSUPPORTED_IMAGE (image, command_queue->device);

  errcode = pocl_check_event_wait_list (command_queue, num_events_in_wait_list,
                                        event_wait_list);
  if (errcode != CL_SUCCESS)
    goto ERROR;

  POCL_GOTO_ERROR_COND((image_row_pitch == NULL), CL_INVALID_VALUE);

  errcode = pocl_check_image_origin_region(image, origin, region);
  if (errcode != CL_SUCCESS)
    goto ERROR;

  POCL_GOTO_ERROR_ON((image_slice_pitch == NULL &&
      (image->type == CL_MEM_OBJECT_IMAGE3D ||
       image->type == CL_MEM_OBJECT_IMAGE1D_ARRAY ||
       image->type == CL_MEM_OBJECT_IMAGE2D_ARRAY)), CL_INVALID_VALUE,
       "For a 3D image, 1D, and 2D image array, "
       "image_slice_pitch must be a non-NULL value\n");

  POCL_CHECK_DEV_IN_CMDQ;

  POname (clRetainMemObject) (image);
  must_release = 1;

  mapping_info = (mem_mapping_t*) calloc (1, sizeof (mem_mapping_t));
  POCL_GOTO_ERROR_COND ((mapping_info == NULL), CL_OUT_OF_HOST_MEMORY);

  *image_row_pitch = image->image_row_pitch;
  if (image_slice_pitch)
    *image_slice_pitch = image->image_slice_pitch;

  mapping_info->host_ptr = NULL;
  mapping_info->map_flags = map_flags;
  mapping_info->origin[0] = origin[0];
  mapping_info->origin[1] = origin[1];
  mapping_info->origin[2] = origin[2];
  mapping_info->region[0] = region[0];
  mapping_info->region[1] = region[1];
  mapping_info->region[2] = region[2];
  mapping_info->row_pitch = image->image_row_pitch;
  mapping_info->slice_pitch = image->image_slice_pitch;

  size_t px = image->image_elem_size * image->image_channels;
  mapping_info->offset = origin[2] * mapping_info->slice_pitch
                         + origin[1] * mapping_info->row_pitch
                         + origin[0] * px;

  /* CL_INVALID_OPERATION if buffer has been created with
   * CL_MEM_HOST_WRITE_ONLY
   * or CL_MEM_HOST_NO_ACCESS and CL_MAP_READ is set in map_flags or
   *
   * if buffer has been created with CL_MEM_HOST_READ_ONL or
   * CL_MEM_HOST_NO_ACCESS
   * and CL_MAP_WRITE or CL_MAP_WRITE_INVALIDATE_REGION is set in map_flags.
   */

  POCL_GOTO_ERROR_COND (
      ((map_flags & CL_MAP_READ)
       && (image->flags & (CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS))),
      CL_INVALID_OPERATION);

  POCL_GOTO_ERROR_COND (
      ((map_flags & CL_MAP_WRITE)
       && (image->flags & (CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_NO_ACCESS))),
      CL_INVALID_OPERATION);

  if (image->flags & CL_MEM_USE_HOST_PTR)
    {
      /* In this case it should use the given host_ptr + offset as
         the mapping area in the host memory. */
      assert (image->mem_host_ptr != NULL);
      mapping_info->host_ptr
          = (char *)image->mem_host_ptr + mapping_info->offset;
    }
  else
    {
      /* The first call to the device driver's map mem tells where
         the mapping will be stored in the host memory.
         When return value (mapping_info->host_ptr) is non-NULL, the
         buffer will be mapped there (assumed it will succeed).  */
      mapping_info->host_ptr = NULL;
      mapping_result = device->ops->map_image
        (device->data,
         &image->device_ptrs[device->dev_id],
         image,
         mapping_info);
    }

  retval = mapping_info->host_ptr;
  POCL_GOTO_ERROR_ON ((retval == NULL), CL_MAP_FAILURE, "device map failed\n");

  errcode = pocl_create_command (&cmd, command_queue, CL_COMMAND_MAP_IMAGE,
                                 event, num_events_in_wait_list,
                                 event_wait_list, 1, &image);
  if (errcode != CL_SUCCESS)
    goto ERROR;

  cmd->command.map.mem_id = &image->device_ptrs[device->dev_id];
  cmd->command.map.mapping = mapping_info;

  POCL_MSG_PRINT_MEMORY ("Image %p, Mapping: host_ptr %p offset %zu\n", image,
                         mapping_info->host_ptr, mapping_info->offset);

  POCL_LOCK_OBJ (image);
  DL_APPEND (image->mappings, mapping_info);
  image->owning_device = device;
  POCL_UNLOCK_OBJ (image);

  pocl_command_enqueue(command_queue, cmd);

  if (blocking_map)
    {
      POname(clFinish) (command_queue);
    }
  if (errcode_ret)
    *errcode_ret = errcode;

  return retval;

ERROR:
  if (must_release)
    POname (clReleaseMemObject) (image);
  if (mapping_result == CL_SUCCESS)
    device->ops->unmap_image (device->data,
                              &image->device_ptrs[device->dev_id],
                              image,
                              mapping_info);
  POCL_MEM_FREE(mapping_info);
  POCL_MEM_FREE (cmd);
  if (errcode_ret)
    *errcode_ret = errcode;

  return NULL;
}
POsym(clEnqueueMapImage)


text:
namespace Nancy
{
    using System;

    /// <summary>
    /// Exception that is thrown when an unhandled exception occurred during
    /// the execution of the current request.
    /// </summary>
    public class RequestExecutionException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RequestExecutionException"/>, with
        /// the specified <paramref name="innerException"/>.
        /// </summary>
        /// <param name="innerException"></param>
        public RequestExecutionException(Exception innerException)
            : base("Oh noes!", innerException)
        {
        }
    }
}


text:
#import <Foundation/Foundation.h>

@class WebView;

@interface AppleScriptController : NSObject
{
    WebView *webView;
}
- (id)initWithWebView:(WebView *)view;
@end


text: This cookbook installs "glusterfs"


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Django MongoDB Engine [Part 1] - George Theofilis</title>

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <meta name="description" content="">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Django MongoDB Engine [Part 1]">
    <meta name="twitter:description" content="">

    <meta property="og:type" content="article">
    <meta property="og:title" content="Django MongoDB Engine [Part 1]">
    <meta property="og:description" content="">

    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon">

    <link rel="stylesheet" type="text/css" href="//blog.george-theofilis.com/themes/uno/assets/css/uno.css?v=1.0.0" />

    <link rel="canonical" href="http://blog.george-theofilis.com/2015/02/20/Django-Mongo-D-B-Engine-Part-1.html" />

    <meta property="og:site_name" content="George Theofilis" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Django MongoDB Engine [Part 1]" />
    <meta property="og:description" content="1. Installation Django MongoDB Engine depends on Django-nonrel, a fork of Django that adds support for non-relational databases. djangotoolbox, a bunch of utilities for non-relational Django applications and backends. It's highly recommended (although not required) to use a virt..." />
    <meta property="og:url" content="http://blog.george-theofilis.com/2015/02/20/Django-Mongo-D-B-Engine-Part-1.html" />
    <meta property="article:published_time" content="2015-02-19T22:00:00.000Z" />
    <meta property="article:modified_time" content="2016-02-07T19:38:36.643Z" />
    <meta property="article:tag" content="python" />
    <meta property="article:tag" content="mongo" />
    <meta property="article:tag" content="django" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Django MongoDB Engine [Part 1]" />
    <meta name="twitter:description" content="1. Installation Django MongoDB Engine depends on Django-nonrel, a fork of Django that adds support for non-relational databases. djangotoolbox, a bunch of utilities for non-relational Django applications and backends. It's highly recommended (although not required) to use a virt..." />
    <meta name="twitter:url" content="http://blog.george-theofilis.com/2015/02/20/Django-Mongo-D-B-Engine-Part-1.html" />

    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="George Theofilis" href="http://blog.george-theofilis.com/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

George Theofilis

Blog

                      Facebook

                      Twitter

                      Google-plus

                      Github

                      Instagram

                      LinkedIn

                      Email

        <time datetime="20 Feb 2015" class="post-meta__date date">20 Feb 2015</time> • on python, mongo, django
         by Theofilis George-Nektarios

Django MongoDB Engine [Part 1]

1. Installation

Django MongoDB Engine depends on

Django-nonrel, a fork of Django that adds support for non-relational databases.

djangotoolbox, a bunch of utilities for non-relational Django applications and backends.

It's highly recommended (although not required) to use a virtualenv for your project to not mess up other Django setups.

1.1. virtualenv

virtualenv is a tool to create isolated Python environments.

If not already installed, grab a copy from the Cheeseshop:

pip install virtualenv

To set up a virtual environment for your project, use

virtualenv myproject

To join the environment, use (in Bash):

source myproject/bin/activate

1.2. Django-nonrel

Django fork with support for NoSQL databases

pip install git+https://github.com/django-nonrel/django@nonrel-1.7

1.3. djangotoolbox

Djangotoolbox provides a common API for running Django on non-relational/NoSQL databases.

pip install git+https://github.com/django-nonrel/djangotoolbox

The djangotoolbox.admin module provides admin overrides for making django.contrib.auth work correctly in the admin UI. Simply add 'djangotoolbox' to INSTALLED_APPS after django.contrib.admin.

This will disable features that require JOINs. If you still need permission handling you should use the nonrel permission backend.

1.3.1. django-permission-backend-nonrel

A Django authentication backend that supports Django’s user and group permissions on Django-Nonrel.

Get the code from Github:

git clone https://github.com/django-nonrel/django-permission-backend-nonrel.git

add permission_backend_nonrel.backends.NonrelPermissionBackend to your AUTHENTICATION_BACKENDS and permission_backend_nonrel to your INSTALLED_APPS

settings.py:

AUTHENTICATION_BACKENDS = (
    ...
    'permission_backend_nonrel.backends.NonrelPermissionBackend',
)

INSTALLED_APPS = (
    ...
    'permission_backend_nonrel',
)

It’s important to put 'permission_backend_nonrel after djangotoolbox, because permission_backend_nonrel.admin replaces djangotoolbox’s User admin site.

Permission and groups can be assigned and modified via Django’s admin interface:

Django-nonrel admin with user_permissions and groups

Django-gaeauth admin interface with user_permissions and groups

Now you should be able to use all the standard Django permission methods and decorators, like user.has_perm('foo') and so on.

1.4. Django MongoDB Engine

You should use the latest Git
revision.

pip install git+https://github.com/django-nonrel/mongodb-engine

2. Configuration

Database setup is easy (see also the Django database setup docs):

DATABASES = {
   'default' : {
      'ENGINE' : 'django_mongodb_engine',
      'NAME' : 'my_database'
   }
}

Django MongoDB Engine also takes into account the HOST, PORT, USER, PASSWORD and OPTIONS settings.

Possible values of OPTIONS are described in the settings reference.

    Please enable JavaScript to view the comments powered by Disqus.
    comments powered by Disqus

                © 2016. All rights reserved.
                Uno theme by Dale-Anthony
                Proudly published with Hubpress


text:
namespace Zyborg.Vault.Model
{
    public class ErrorResponse
    {
        public string[] Errors
        { get; set; }
    }
}


text:
import { Component, OnInit, ElementRef, AfterViewInit, Input, Output, EventEmitter, OnDestroy } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Observable, Subject } from 'rxjs';
import { withLatestFrom, map, takeUntil } from 'rxjs/operators';

import { POPUP_CONSTANT } from 'app/core/components/application-name-issue-popup/application-name-issue-popup.component';
import { DynamicPopup, TranslateReplaceService, NewUrlStateNotificationService } from 'app/shared/services';
import { UrlPathId } from 'app/shared/models';

@Component({
    selector: 'pp-application-name-issue-popup-container',
    templateUrl: './application-name-issue-popup-container.component.html',
    styleUrls: ['./application-name-issue-popup-container.component.css']
})
export class ApplicationNameIssuePopupContainerComponent implements OnInit, OnDestroy, AfterViewInit, DynamicPopup {
    @Input() data: {[key: string]: string};
    @Input() coord: ICoordinate;
    @Output() outCreated = new EventEmitter<ICoordinate>();
    @Output() outClose = new EventEmitter<void>();

    private unsubscribe = new Subject<void>();

    data$: Observable<{[key: string]: any}>;

    constructor(
        private elementRef: ElementRef,
        private newUrlStateNotificationService: NewUrlStateNotificationService,
        private translateService: TranslateService,
        private translateReplaceService: TranslateReplaceService,
    ) {}

    ngOnInit() {
        const urlApplicationName$ = this.newUrlStateNotificationService.onUrlStateChange$.pipe(
            takeUntil(this.unsubscribe),
            map((urlService: NewUrlStateNotificationService) => {
                return urlService.getPathValue(UrlPathId.APPLICATION).getApplicationName();
            })
        );

        this.data$ = this.translateService.get('INSPECTOR.APPLICAITION_NAME_ISSUE').pipe(
            withLatestFrom(urlApplicationName$),
            map(([message, urlAppName]: [{[key: string]: any}, string]) => {
                const { agentId, applicationName } = this.data;

                return {
                    prevAppName: urlAppName,
                    currAppName: applicationName,
                    message: {
                        ISSUE_MESSAGE: this.translateReplaceService.replace(message['ISSUE_MESSAGE'], urlAppName, applicationName),
                        ISSUE_CAUSES: [
                            this.translateReplaceService.replace(message['ISSUE_CAUSES'][0], urlAppName, applicationName),
                            this.translateReplaceService.replace(message['ISSUE_CAUSES'][1], agentId, applicationName)
                        ],
                        ISSUE_SOLUTIONS: [
                            this.translateReplaceService.replace(message['ISSUE_SOLUTIONS'][0], urlAppName, agentId),
                            message['ISSUE_SOLUTIONS'][1]
                        ]
                    }
                };
            })
        );
    }

    ngAfterViewInit() {
        this.outCreated.emit({
            coordX: this.coord.coordX - (this.elementRef.nativeElement.offsetWidth / 2),
            coordY: this.coord.coordY + POPUP_CONSTANT.SPACE_FROM_BUTTON + POPUP_CONSTANT.TOOLTIP_TRIANGLE_HEIGHT
        });
    }

    ngOnDestroy() {
        this.unsubscribe.next();
        this.unsubscribe.complete();
    }

    onInputChange(): void {
        this.outClose.emit();
    }

    onClickOutside(): void {
        this.outClose.emit();
    }
}


text:
This plugin provides event log based simple metrics.

## Installation

```
  script/plugin install git://github.com/ss/simple_metrics_engine.git
```

## Testing

```
  rake test
  rake sme:coverage
  script/server
  point your browser to http://localhost:3000/coverage/
```

## Verification

```
  rake sme:generate_dummy_data
  script/server
  point your browser to http://localhost:3000/sme
```

## Usage

Configure the plugin.

in *config/initializers/simple_metrics_engine.rb*

```ruby
  Sme.configure do |config|
    # only allow admins to access metrics
    config.permission_check { redirect_to login_path and return false unless current_user.admin? }

    # (Optional) Metrics will be rolled up into 15-minute periods starting every hour on the hour.
    config.rollup_window = 15.minutes
  end

  # add user details to event hash
  def add_user_info(event_hash)
    event_hash[:user_id] ||= current_user.id
    event_hash
  end

  Sme.wrap!(method(:add_user_info))
```

Modify your User controller to log a visits and conversions.

in *app/controller/users_controller.rb*:
```ruby
  class UsersController < ApplicationController

    def index
      log_visitation
      ...
    end

    def create
      ...
      log_conversion if @user.valid?
    end

  private

    def log_visitation
      Sme.log('user|visit')
      Sme.log("user|visit|#{country}")
    end

    def log_conversion
      Sme.log('user|conversion', metrics_notes)
      Sme.log("user|conversion|#{country}")
    end

    def metrics_notes
      {
        :ab_test_button_text => ab_test_button_text,
        :foo => 'bar',
      }
    end

  end # class UsersController
```

Alternatively, you can use an after_create filter to your User model:

in *app/models/user.rb*:
```ruby
  class User < ActiveRecord::Base

    after_create :log_conversion

    def log_conversion_event
      Sme.log('user|conversion', :user_id => id)
    end

  end # class User
```

Create a cron job that runs the *sme:rollup_logs* rake task:

```cron
HOME=<rails root>
0/15 * * * * rake sme:rollup_logs >> $HOME/log/sme_rollup_logs.log 2>&1
```


text:
Security Component - ACL (Access Control List)
==============================================

Security provides an infrastructure for sophisticated authorization systems,
which makes it possible to easily separate the actual authorization logic from
so called user providers that hold the users credentials. It is inspired by
the Java Spring framework.

Resources
---------

Documentation:

https://github.com/symfony/acl-bundle/blob/main/src/Resources/doc/index.rst

Tests
-----

You can run the unit tests with the following command:

    $ cd path/to/Symfony/Component/Security/Acl/
    $ composer.phar install --dev
    $ phpunit


text:
This style guide aims to provide consistent conventions across all Formed products and applications.

## Table of Contents
1. [Spacing](#spacing)
2. [Blocks](#blocks)
3. [Semicolons](#semicolons)
4. [Strings](#strings)
5. [Functions](#functions)
6. [Objects](#objects)
7. [Arrays](#arrays)
8. [Classes & Constructors](#constructors)
9. [Variables](#variables)
10. [Comparison Operators](#comparison)
11. [Naming Conventions](#naming)
12. [ECMAScript compatibility](#ecmascript)
13. [Credit & Attribution](#credit)
14. [License](#license)

## 1. Spacing

- Use spaces over tabs and two (2) spaces of indentation.
  ```javascript
  // Bad spacing.
  function foo() {
  ....const name1;
  .const name2;
  }

  // Good spacing.
  function foo() {
  ..const name;
  }
  ```
- Keep line length to a maximum 80 columns. Exceptions:
  - the line contains a comment with a long URL;
  - the line contains a regex literal;
- Strip all end-of-line whitespace.
- `{}` always have one space before the opening and closing brace.
  ```javascript
  // Bad examples.
  function foo(){
    const name;
  }

  if (condition){
   foo();
  }

  // Good examples.
  function foo() {
    const name;
  }

  if (condition) {
    foo();
  }
  ```
- Any `,` and `;` must not have preceding space.
  ```javascript
  // Bad example.
  const numbers = [1 , 2, 3] ;

  // Good exmple.
  const nubers = [1, 2, 3];
  ```
- Any `:` after a property name in an object literal must not have a preceding space and a single space after.
  ```javascript
  // Bad example.
  const obj = {
    foo : 'value'
  };

  // Good example.
  const obj = {
    foo: 'value'
  };
  ```
- The `?` and `:` in a ternary operator must have space on both sides.
  ```javascript
  // Bad example.
  const ternary = condtion? value1:value2;

  // Good example.
  const ternary = condition ? value1 : value2;
  ```
- No extra whitespace in empty constructs, e.g. `{}`, `[]`, `fn()`.
  ```javascript
  // Bad example.
  const arr = [ ];
  const obj = { };
  foo( );

  // Good example.
  const arr = [];
  const obj = {};
  foo();
  ```
- **Object declarations** should span multiple lines with one propery per line.
  - Exception: Object does not exceed the maximum line length of 80 characters.
    - Single line object declaration needs to obey `{}` spacing rule.
  ```javascript
  // Bad multi-line declaration example.
  const location = {
    address: 'market street', city: 'philadelphia' };

  // Bad single line declaration example.
  const name = {first: 'christopher'};

  // Good single line declaration example.
  const name = { first: 'christopher' };

  // Good multi-line declaration example.
  const location = {
    address: 'maket street',
    city: 'philadelphia'
  };
  ```
- **Array declarations** should be single line; unless it exceeds the max line length.  Then seperate each item in array on separte line.
  - `[]` Should have no space after opening `[` and no preceding space before `]`.
  - Single line declarations should have one spacing after each item in array except for last item.
  - Multi-line declarations should have closing `]` on its own line.
  - Spacing rules for `,` apply here as well.
  ```javascript
  // Bad examples.
  const numbers = [ 1, 2, 3 ];
  const cities = ['atlanta','boston','los angeles','new york','philadelphia','san francisco'];

  // Good examples.
  const numbers = [1, 2, 3];
  const letters = [
    'atlanta',
    'boston',
    'los angeles',
    'new york',
    'philadelphia',
    'san francisco'
  ];
  ```
- **Function calls** should be single line unless it exceeds maximum line length, or it helps in readability.
  - Should be no space immediately after opening `(` or preceding a closing `)`.
  - All arguments should be preceded by a space; unless first argument.
  ```javascript
  // Bad examples.
  fn(arg1,arg2,arg3);
  fn(arg1 ,arg2 ,arg3);

  // Good Examples.
  fn(arg1, arg2, arg3);

  fn(
    function success() {
      return 'successful';
    },
    function error() {
      return 'error';
    }
  );
  ```
- Leave one line of whitespace at end-of-file.
[back to top](#top)

## 2. Blocks

- All multi-line blocks should use braces.
  ```javascript
  // Bad example.
  if (condition)
    return true;

  if (condition)
    return true;
  else
    return false;

  // Good examples.
  if (condition) {
    return true;
  }

  if (condition) return true;
  ```
- Multi-line blocks with `if` and `else` should have the `else` placed on a new line immmediately after the closing `if` brace.
  ```javascript
  // Bad example.
  if (condition) {
    return true;
  } else {
    return false;
  }

  // Good example.
  if (condition) {
    return true;
  }
  else {
   return false;
  }
  ```
[back to top](#top)

## 3. Semicolons

Always use semicolons.  Don't rely on automatic Semicolon Insertion (ASI).

```javascript
// Bad examples.
const name = 'christopher'

(function foo() {
  return true
}())

// Good examples.
const name = 'christopher';

(function foo() {
  return true;
}());
```
[back to top](#top)

## 4. Strings

- Use single-quotes for string literals.
- It is okay to use double quotes inside a string literal.
  ```javascript
  // Bad example.
  const str = "lorem ipsum";

  // Good example.
  const str = 'lorem ipsum';
  const doubleQuote = 'lorem "ipsum"';
  ```
- Use string concantenation for strings that exceed max line length.
- Always opt-in for template strings over concatentation when inserting dynamic values.
  ```javascript
  // Bad example.
  function sayName(name) {
    return 'Hi my name is ' + name '.';
  }

  // Good example.
  function sayName(name) {
    return 'Hi my name is ${name}.';
  }
  ```
- Use of `eval()` on a string is strictly prohibited.

[back to top](#top)

## 5. Functions

- Prefer function declarations over function expresssions.
  - Avoid creating anonymous functions.
  ```javascript
  // Bad example.
  const fn = function () {
  };

  const controller = {
    get: function (req, res, next) {
    },

    post: function (req, res, next) {
    }
  };

  // Good example.
  const controller = {
    get: function get(req, res, next) {
    },

    post: function post(req, res, next) {
    }
  };

  function fn() {
  }
  ```
- Wrap immediatly invoked function expression in parentheses.
  ```javascript
  // Bad example.
  (function () {
  })();

  // Good example.
  (function() {
  }());
  ```
- Naming a parameter `arguments` is strictly prohibited.
  ```javascript
  // Bad example.
  function bad(arguments) {
  }

  // Good example.
  function good(args) {
  }
  ```
- Declaring functions in non-function blocks is prohibited. e.g `if`, `else`, `while`, etc.
- Using the Function constructor to create a new function is prohibited.
- Use the arrow function syntax to avoid creating anonymous function expressions.
  ```javascript
  // Bad example.
  [1, 2, 3].map(function (num) {
    return num * num;
  });

  // Good example.
  [1, 2, 3].map(num => num * num);
  ```

[back to top](#top)

## 6. Object

- Creating objects should be done using the shorthand `{}` syntax.
  ```javascript
  // Bad example.
  const obj = new Object();

  // Good example.
  const obj = {};
  ```
- Use object method shorthand (when available).
  ```javascript
  // Bad example.
  const obj = {
    myMethod: function () {}
  };

  // Good example.
  const obj = {
    myMethod() {}
  };
  ```
- Use property value shortand (when available).
  ```javascript
  const city = 'philadelphia';
  const state = 'pennsylvania';

  // Bad example.
  const address = {
    city: city,
    state: state
  };

  // Good example.
  const address = {
    city,
    state
  };
  ```
- Place shorthand properties at the beginning of object declaration.
  ```javascript
  const city = 'philadelphia';
  const state = 'pennsylvania';

  // Bad example.
  const address = {
    street: 'market',
    city,
    state,
    country: 'united states'
  };

  // Good example.
  const address = {
    city,
    state,
    street: 'market',
    country: 'united states'
  };
  ```

[back to top](#top)

## 7. Arrays

- Creating arrays should be done using the shorthand `[]` syntax.
  ```javascript
  // Bad example;
  const arr = new Array();

  // Good example.
  const arr = [];
  ```
- Use `Array.push` to add items to an array rather than direct assignment.
  ```javascript
  const arr = [];

  // Bad example.
  arr[arr.length] = 'foobar';

  // Good example.
  arr.push('foobar');
  ```

[back to top](#top)

## 8. Classes & Constructors

- When available opt for `class` over existing prototype-based inheritance.
  ```javascript
  // Bad example.
  function Shape(size) {
    this.size = size;
  };

  Shape.prototype.getSize = function () {
    return this.size;
  };

  // Good example.
  class Shape {
    constructor(size) {
      this.size = size;
    }

    getSize() {
      return this.size;
    }
  }
  ```
- Sub classing (or inheritance) should be executed with `extends`.

  ```javascript
  // Good example.
  class Square extends Shape {
    setSize(size) {
      this.size = size;
      return this;
    }
  }
  ```
- Always return `this` for methods that implicity return.
  > Why? Will allow for method chaining.

  ```javascript
  // Bad example
  class Shape {
    constructor(size) {
      this.size = size;
    }

    getSize() {
      return this.size;
    }

    setSize(size) {
      this.size = size;
    }
  }

  // Good example.
  class Shape {
    constructor(size) {
      this.size = size;
    }

    getSize() {
      return this.size;
    }

    setSize(size) {
      this.size = size;
      return this;
    }
  }

  const square = new Shape(50);

  square
    .setSize(100)
    .getSize();
 ```
[back to top](#top)

## 9. Variables

- Use `const` as opposed to `var` when declaring variables and variables are not reassigend.
  > The **const declaration** creates a read-only reference to a value.  It does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned. - MDN

  ```javascript
  // Bad example.
  var foo = 'foo';
  bar = 'bar';

  // Good example.
  const foo = 'foo';
  const bar = 'bar';
  ```
- Use `let` for block scoping and variable reassignment.
  > The let statement declares a block scope local variable, optionally initializing it to a value. - MDN

  ```javascript
  // Bad example.
  for (var i = 0; i < 10; i++) {}

  // Good exmpale.
  for (let i = 0; i < 10; i++) {}
  ```
- Use one `const` and `let` declaration per line.

  ```javascript
  // Bad example.
  const foo = 'foo',
    bar = 'bar';

  // Good example.
  const foo = 'foo';
  const bar = 'bar';
  ```
- Sort `const`s and `let`s.

  ```javascript
  // Bad example.
  const foo = 'foo';
  let baz = 'baz';
  const bar = 'bar';

  // Good example
  const foo = 'foo';
  const bar = 'bar';
  let baz = 'baz';
  ```
[back to top](#top)

## 10. Comparison Operators

- Prefer`===` and `!==` over `==` and `!==`, unless the test requires loose type evaluation.

  > The equality `==` and inequality `!==` operators will convert the operands if they are **not of the same type**.

  ```javascript
  // Examples of equality.
  3 == 3 // true
  3 == '3' // true

  // Examples of strict equality.
  3 === 3 // true
  3 === '3' // false
  ```
- JavaScript has an inherent Boolean value, generally referred to as *truthy* or *falsy* values.

  *Falsy values of JavaScript*

  Value | Type
  ------|-----
  0 | Number
  NaN (not a number | Number
  '' (empty string) | String
  false | Boolean
  null | Object
  undefined | Undefined

- Don't over do it.

  ```Javascript
  // Evaluating on an empty string.
  // Bad example.
  if (string !== '') {}

  // Good example.
  if (string)

  // Evaluating that an array has length.
  // Bad example.
  if (array.length > 0) {}

  // Good example.
  if (array.length) {}
  ```
- Ternaries should be single line.
  - Use a multi-line ternary only when max line length will be exceeded.
  - Try to avoid nested ternaries.

[back to top](#top)

## 11. Naming Conventions

- Use camelCase for objects, properties, instances, and function names.

  ```javascript
  // Bad example.
  const first_name = 'christopher';

  // Good example.
  const firstName = 'christopher';
  ```
- Use PascalCase for class or constructor names.

  ```javascript
  // Bad example.
  function shape(size) {
    this.size = size;
  }

  const square = new shape(50);

  // Good example.
  class Shape {
    constructor(size) {
      this.size = size;
    }
  }

  const square = new Shape(50);
  ```
- All function expressions should be named with a double underscore `__` prepended and appended to name.
- Prefer hard-binding over caching references to `this`.
  ```javascript
  // Bad example.
  function foo() {
    const self = this;

    return function () {
      return self;
    };
  }

  // Good Example.
  function foo() {
    return () => this;
  }
  ```
- If scenario requires to store a reference to `this`, assign to a `const` declaration named `self`.

[back to top](#top)

## 12. ECMAScript compatibility

- Refer to [kangax's compatibility tables](http://kangax.github.io/compat-table/es5/) for available features.

## 13. Credit & Attribution

The following resources were heavily influenced in the creation of this style guide:

- [Airbnb JavaScript Style Guide() {](https://github.com/airbnb/javascript)
- [Principles of Writing Consistent, Idiomatic JavaScript](https://github.com/rwaldron/idiomatic.js)
- [jQuery JavaScript Style Guide](https://contribute.jquery.org/style-guide/js/#equality)

[back to top](#top)

## 14. License

- [license](https://github.com/formed-solutions/javascript-conventions/blob/master/LICENSE)

[back to top](#top)


text:
<!DOCTYPE html>

	<title>

            Greg pullman Insurance -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

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

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      Greg pullman Insurance

Legal/Operating Name:

Greg pullman Insurance

http://pullmanwealth.com

gregpullmaninsurance@gmail.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   203-101 Klahanie Dr.

                    PORT MOODY,

                    British Columbia

                  V3H 5K3

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   203-101 Klahanie Dr.

                    PORT MOODY,

                    British Columbia

                  V3H 5K3

                         </address>

Tel.:
		      (778) 355-1156

Tel.:
			      (800) 663-5008

Fax:

Company Profile

            If you're searching for an affordable Port Moody, BC, insurance company, the highly experienced staff at Greg Pullman is waiting to address your concerns with proactive and practical advice. We understand that coverage could provide you with valuable financial protection, so we'll quickly respond to your calls.

Our attentive and detail-oriented staff believes in offering unbiased advice. We understand that it may be difficult to manoeuvre within the insurance markets, so we'll discuss your goals and locate policies that are appropriate for your situation. We can offer you access to a variety of policies in a single location, and you can contact us for:

Critical illness insurance

Long-term care insurance

Mortgage insurance

Registered retirement savings and planning

When you contact Greg Pullman today, you could be taking one step closer to financial security. We're here to make the process of gaining coverage an easy one. Our helpful staff will address your financial concerns and work to locate the ideal policy. Call us when you're looking for an affordable Port Moody, BC, insurance plan that's tailored to your requirements.

				Full profile

				Full profile

				Contact information

                greg
                PULLMAN

                  Title:

                Owner

                    Area of Responsibility:

                    Finance/Accounting.

                  Telephone:

                (778) 355-1156

                    Email:

                  gregpullmaninsurance@gmail.com

  top of page

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				524210 - Insurance Agencies and Brokerages

            Alternate Industries (NAICS):

            524299 - All Other Insurance Related Activities

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Service Name:

                            Life Insurance / Disability Insurance/Retirement Savings Planning/Mortgage Insurance/Critical Illness Insurance/Group Health Insurance/Segregated Fund

                            Our attentive and detail-oriented staff believes in offering unbiased advice. We understand that it may be difficult to manoeuvre within the insurance markets, so we'll discuss your goals and locate policies that are appropriate for your situation. We can offer you access to a variety of policies in a single location, and you can contact us for:

Critical illness insurance

Long-term care insurance

Mortgage insurance

Registered retirement savings and planning

  top of page

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                greg
                PULLMAN

                  Title:

                Owner

                    Area of Responsibility:

                    Finance/Accounting.

                  Telephone:

                (778) 355-1156

                    Email:

                  gregpullmaninsurance@gmail.com

				Description

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				524210 - Insurance Agencies and Brokerages

            Alternate Industries (NAICS):

            524299 - All Other Insurance Related Activities

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            Life Insurance / Disability Insurance/Retirement Savings Planning/Mortgage Insurance/Critical Illness Insurance/Group Health Insurance/Segregated Fund

                            Our attentive and detail-oriented staff believes in offering unbiased advice. We understand that it may be difficult to manoeuvre within the insurance markets, so we'll discuss your goals and locate policies that are appropriate for your situation. We can offer you access to a variety of policies in a single location, and you can contact us for:

Critical illness insurance

Long-term care insurance

Mortgage insurance

Registered retirement savings and planning

    Last Update Date 2014-08-11

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
namespace cobalt {
namespace math {

Vector2d ToFlooredVector2d(const Vector2dF& vector2d) {
  int x = ToFlooredInt(vector2d.x());
  int y = ToFlooredInt(vector2d.y());
  return Vector2d(x, y);
}

Vector2d ToCeiledVector2d(const Vector2dF& vector2d) {
  int x = ToCeiledInt(vector2d.x());
  int y = ToCeiledInt(vector2d.y());
  return Vector2d(x, y);
}

Vector2d ToRoundedVector2d(const Vector2dF& vector2d) {
  int x = ToRoundedInt(vector2d.x());
  int y = ToRoundedInt(vector2d.y());
  return Vector2d(x, y);
}

}  // namespace math
}  // namespace cobalt


text:
using System;
using System.Data;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;

namespace ServiceStack.OrmLite.Dapper
{
    /// <summary>
    /// Represents the key aspects of a sql operation
    /// </summary>
    public struct CommandDefinition
    {
        internal static CommandDefinition ForCallback(object parameters)
        {
            if (parameters is DynamicParameters)
            {
                return new CommandDefinition(parameters);
            }
            else
            {
                return default(CommandDefinition);
            }
        }

        internal void OnCompleted()
        {
            (Parameters as SqlMapper.IParameterCallbacks)?.OnCompleted();
        }

        /// <summary>
        /// The command (sql or a stored-procedure name) to execute
        /// </summary>
        public string CommandText { get; }

        /// <summary>
        /// The parameters associated with the command
        /// </summary>
        public object Parameters { get; }

        /// <summary>
        /// The active transaction for the command
        /// </summary>
        public IDbTransaction Transaction { get; }

        /// <summary>
        /// The effective timeout for the command
        /// </summary>
        public int? CommandTimeout { get; }

        /// <summary>
        /// The type of command that the command-text represents
        /// </summary>
        public CommandType? CommandType { get; }

        /// <summary>
        /// Should data be buffered before returning?
        /// </summary>
        public bool Buffered => (Flags & CommandFlags.Buffered) != 0;

        /// <summary>
        /// Should the plan for this query be cached?
        /// </summary>
        internal bool AddToCache => (Flags & CommandFlags.NoCache) == 0;

        /// <summary>
        /// Additional state flags against this command
        /// </summary>
        public CommandFlags Flags { get; }

        /// <summary>
        /// Can async queries be pipelined?
        /// </summary>
        public bool Pipelined => (Flags & CommandFlags.Pipelined) != 0;

        /// <summary>
        /// Initialize the command definition
        /// </summary>
        /// <param name="commandText">The text for this command.</param>
        /// <param name="parameters">The parameters for this command.</param>
        /// <param name="transaction">The transaction for this command to participate in.</param>
        /// <param name="commandTimeout">The timeout (in seconds) for this command.</param>
        /// <param name="commandType">The <see cref="CommandType"/> for this command.</param>
        /// <param name="flags">The behavior flags for this command.</param>
        /// <param name="cancellationToken">The cancellation token for this command.</param>
        public CommandDefinition(string commandText, object parameters = null, IDbTransaction transaction = null, int? commandTimeout = null,
                                 CommandType? commandType = null, CommandFlags flags = CommandFlags.Buffered
                                 , CancellationToken cancellationToken = default(CancellationToken)
            )
        {
            CommandText = commandText;
            Parameters = parameters;
            Transaction = transaction;
            CommandTimeout = commandTimeout;
            CommandType = commandType;
            Flags = flags;
            CancellationToken = cancellationToken;
        }

        private CommandDefinition(object parameters) : this()
        {
            Parameters = parameters;
        }

        /// <summary>
        /// For asynchronous operations, the cancellation-token
        /// </summary>
        public CancellationToken CancellationToken { get; }

        internal IDbCommand SetupCommand(IDbConnection cnn, Action<IDbCommand, object> paramReader)
        {
            var cmd = cnn.CreateCommand();
            var init = GetInit(cmd.GetType());
            init?.Invoke(cmd);
            if (Transaction != null)
                cmd.Transaction = Transaction;
            cmd.CommandText = CommandText;
            if (CommandTimeout.HasValue)
            {
                cmd.CommandTimeout = CommandTimeout.Value;
            }
            else if (SqlMapper.Settings.CommandTimeout.HasValue)
            {
                cmd.CommandTimeout = SqlMapper.Settings.CommandTimeout.Value;
            }
            if (CommandType.HasValue)
                cmd.CommandType = CommandType.Value;
            paramReader?.Invoke(cmd, Parameters);
            return cmd;
        }

        private static SqlMapper.Link<Type, Action<IDbCommand>> commandInitCache;

        private static Action<IDbCommand> GetInit(Type commandType)
        {
            if (commandType == null)
                return null; // GIGO
            if (SqlMapper.Link<Type, Action<IDbCommand>>.TryGet(commandInitCache, commandType, out Action<IDbCommand> action))
            {
                return action;
            }
            var bindByName = GetBasicPropertySetter(commandType, "BindByName", typeof(bool));
            var initialLongFetchSize = GetBasicPropertySetter(commandType, "InitialLONGFetchSize", typeof(int));

            action = null;
            if (bindByName != null || initialLongFetchSize != null)
            {
                var method = new DynamicMethod(commandType.Name + "_init", null, new Type[] { typeof(IDbCommand) });
                var il = method.GetILGenerator();

                if (bindByName != null)
                {
                    // .BindByName = true
                    il.Emit(OpCodes.Ldarg_0);
                    il.Emit(OpCodes.Castclass, commandType);
                    il.Emit(OpCodes.Ldc_I4_1);
                    il.EmitCall(OpCodes.Callvirt, bindByName, null);
                }
                if (initialLongFetchSize != null)
                {
                    // .InitialLONGFetchSize = -1
                    il.Emit(OpCodes.Ldarg_0);
                    il.Emit(OpCodes.Castclass, commandType);
                    il.Emit(OpCodes.Ldc_I4_M1);
                    il.EmitCall(OpCodes.Callvirt, initialLongFetchSize, null);
                }
                il.Emit(OpCodes.Ret);
                action = (Action<IDbCommand>)method.CreateDelegate(typeof(Action<IDbCommand>));
            }
            // cache it
            SqlMapper.Link<Type, Action<IDbCommand>>.TryAdd(ref commandInitCache, commandType, ref action);
            return action;
        }

        private static MethodInfo GetBasicPropertySetter(Type declaringType, string name, Type expectedType)
        {
            var prop = declaringType.GetProperty(name, BindingFlags.Public | BindingFlags.Instance);
            if (prop?.CanWrite == true && prop.PropertyType == expectedType && prop.GetIndexParameters().Length == 0)
            {
                return prop.GetSetMethod();
            }
            return null;
        }
    }
}


text:
package org.ebaysf.ostara.upgrade.paths

import org.ebaysf.ostara.upgrade.PomReport
import org.apache.maven.model.Model
import org.apache.maven.model.Parent

case class PlatformVersion(version:String)

trait PlatformVersionManager {
  var versions:Seq[PlatformVersion] = Seq()

  def parseVersion(ver:String):PlatformVersion
  def processPlatformVersion(raptorPlatformVersion: String, parentVersion:PlatformVersion): String
  def upgradePaths(raptorSourceVersion:PlatformVersion, raptorTargetVersion:PlatformVersion, parent:Parent, crtReport:PomReport):Array[UpgradeStep]
}

class DummyPlatformVersionManager extends PlatformVersionManager {
  val dummyPlatformVersion = PlatformVersion("0.1")

  def parseVersion(ver:String):PlatformVersion = dummyPlatformVersion
  def processPlatformVersion(raptorPlatformVersion: String, parentVersion:PlatformVersion): String = "0.1"
  def upgradePaths(raptorSourceVersion:PlatformVersion, raptorTargetVersion:PlatformVersion, parent:Parent, crtReport:PomReport):Array[UpgradeStep] = Array()

}


text:
@interface PortraitNavigationController : UINavigationController

@end


text:
'use strict';

const app = require('koa')();
const router = require('koa-router')();

router
  .get('/ranges', function *(next) {
    this.body = Process.enumerateRangesSync({
      protection: '---',
      coalesce: true
    });
  })
  .get('/modules', function *(next) {
    this.body = Process.enumerateModulesSync();
  })
  .get('/modules/:name', function *(next) {
    try {
      this.body = Process.getModuleByName(this.params.name);
    } catch (e) {
      this.status = 404;
      this.body = e.message;
    }
  })
  .get('/modules/:name/exports', function *(next) {
    this.body = Module.enumerateExportsSync(this.params.name);
  })
  .get('/modules/:name/imports', function *(next) {
    this.body = Module.enumerateImportsSync(this.params.name);
  })
  .get('/objc/classes', function *(next) {
    if (ObjC.available) {
      this.body = Object.keys(ObjC.classes);
    } else {
      this.status = 404;
      this.body = 'Objective-C runtime not available in this process';
    }
  })
  .get('/threads', function *(next) {
    this.body = Process.enumerateThreadsSync();
  });

app
  .use(router.routes())
  .use(router.allowedMethods())
  .listen(1337);