text:
"""
The place for common used functions

__author__ = "Alex Xiao <http://www.alexxiao.me/>"
__date__ = "2018-03-03"
__version__ = "0.2"

    Version:
        0.1 (1/7/2017): implemented run_thread, run_thread, search_paragraph
        0.2 (3/3/2018): moved date related function to datetime, added retry
        0.3 (25/4/2019): encrypt/ decrypt

Functions List:

    get_ngrok_url - return ngrok information
    get_public_ip -  return current machine's public ip
    retry - [decorator] to try to run function x time
    search_paragraph - [generator] return paragraph between start/end keywords

"""
from functools import wraps
from .exception import MaxRetryReached
from .log import trace_error
import ax.datetime as ax_datetime
import threading
import time
from requests import get
import inspect
import sys
import importlib
import uuid
import os
from cryptography.fernet import Fernet

# the fernet for encrypt/ decrypt
_fernet = Fernet(os.getenv('TOBY_ENCRYPT_KEY') or Fernet.generate_key().decode()).encode()

def encrypt(value):
    """
    Encrypt the input value
    :param value: input value
    :return: encrypted output
    """
    return _fernet.encrypt(value.encode() if type(value) != bytes else value)

def decrypt(value, output_decode_flag=True):
    """
    Decrypt
    :param value: the encrypted value
    :param output_decode_flag: default to True; the flag of if to decode output
    :return: the decrypted output
    """
    o = _fernet.decrypt(value)
    return o.decode() if output_decode_flag else o

def get_uuid():
    return uuid.uuid4().hex

def list_functions(module):
    """
    List top-level function name & function
    :param module: the module
    :return: dict of all functions
    """
    return dict(inspect.getmembers(module, inspect.isfunction))

def load_standard_functions():
    """
    Commonly used functions for safe eval
    :return:
    """
    funcs = {'len': len, 'filter': filter}
    funcs = {**list_functions(ax_datetime), **funcs}
    return funcs

standard_functions = load_standard_functions()

def safe_eval(expression, variables={}, standard_functions=standard_functions):
    """
    Safe eval, only allow give functions/ expression
    :param expression: the expression for eval
    :param variables: all variables to be used in the eval
    :param standard_functions: list of standard functions, default to common functions
    :return: expressioneval result
    """
    params = {**variables, **standard_functions}
    params['__builtins__'] = {}
    return eval(expression, params)

def load_module(module, logger=None, force_reload=True):
    """
    Load/ Import module
    :param module: Module full name e.g. ax.datetime
    :param logger: [optional] for logging info
    :param force_reload: [Default to True] flag to control if reload existing module
    :return: the module
    """
    if module in sys.modules:
        if force_reload:
            if logger:
                logger.info('Existing module, reloading ' + module)
            return importlib.reload(sys.modules[module])
        else:
            if logger:
                logger.info('Use existing module' + module)
            return sys.modules[module]
    else:
        logger.info('New module, loading ' + module)
    return importlib.import_module(module)

def load_function(module, func, logger=None, force_reload=True):
    """
    Load/ Import function
    :param module: Module full name e.g. ax.datetime
    :param func: the function of the module
    :param logger: [optional] for logging info
    :param force_reload: [Default to True] flag to control if reload existing module
    :return: the function
    """
    mod = load_module(module, logger=logger, force_reload=force_reload)
    if logger:
        logger.info('Getting function '+func)
    return mod.__dict__[func]

def retry(max_retry_times, logger=None, retry_interval=1.0, pass_retry_param_name=None):
    """
    Retry the function for certain, if still fail, raise MaxRetryReached Exception
    :param max_retry_times: how many times of retry
    :param [optional] logger: the logger to catch exceptions
    :param [optional] retry_interval: how many seconds to sleep before next retry
    :param [optional] pass_retry_param_name: the parameter name to pass into function
    :return:
    """
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            cnt = 0
            while cnt < max_retry_times:
                cnt += 1
                try:
                    if pass_retry_param_name:
                        kwargs[pass_retry_param_name] = cnt
                    return func(*args, **kwargs)
                except:
                    if logger:
                        trace_error(logger)
                        logger.warning('Retry ' + func.__name__ + ' ' + str(cnt) + ' time(s)')
                        # print(cnt)
                    if cnt >= max_retry_times:
                        # Reach max Retry
                        if logger:
                            logger.error('Retry ' + func.__name__ + str(cnt) + ' reached max times')
                        raise MaxRetryReached(func.__name__, cnt)
                    time.sleep(retry_interval)
        return wrapper
    return decorator

def run_thread(fun, *args, **kwargs):
    """
    Run function as background as thread

    :param fun: the function
    :param args: position args
    :param kwargs: key word args
        set_daemon_flg :[optional, default to false] if run thread in daemon mode
    :return: the thread instance
    """
    th = threading.Thread(target=fun, args=args, kwargs=kwargs)
    th.setDaemon(kwargs.get('set_daemon_flg', False))
    th.start()
    return th

def search_paragraph(orig_str, begin, end=None, strip=False):
    """
    The generator function to return all information that in between start/end key words

    Input:
        orig_str: the string to be searched
        begin: the keyword for beginning (exclusive)
        end [Optional]: the keyword for the end (exclusive), if not defined, get all the info before next begin
        strip [Optional]: default to False, which will not strip info if empty

    Output:
        List of all result (yield)
    """
    first = orig_str.find(begin)
    for patt in orig_str[first:].split(begin):
        if strip:
            patt = patt.strip()
        if not end:
            if len(patt) > 0:
                yield patt
        else:
            end_pos = patt.find(end)
            if end_pos > 0 or (strip == False and end_pos == 0):
                yield patt[:end_pos]

def get_public_ip():
    """
        Return the public ip of the requested machine

        Input: N/A

        Output: IP V4 string xxx.xxx.xxx.xxx
    """
    ip = get('https://api.ipify.org').text
    return ip


text:
using System;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using CSF.Reflection;
using CSF.Specifications;

namespace Agiil.ObjectMaps
{
    public class ProfileTypesProvider : IGetsTypes
    {
        readonly IGetsTypes exportedTypesProvider;

        public IReadOnlyCollection<Type> GetTypes()
        {
            return exportedTypesProvider.GetTypes()
                .Where(GetProfilesSpec())
                .ToList();
        }

        ISpecificationExpression<Type> GetProfilesSpec()
        {
            return new IsConcreteClassSpecification()
                .And(new DerivesFromSpecification(typeof(Profile)));
        }

        public ProfileTypesProvider()
        {
            exportedTypesProvider = new ExportedMappingTypesProvider();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
const SerialPort = require('serialport');
const util = require('util');
//process.env['DEBUG']="onair";
var debug = require('debug')('onair');

// SerialPort.list(function (err, ports) {
// 	ports.forEach(function(_info) { console.log(util.inspect(_info)); });
// });

var OnAirSign = function(serial) {

	var self = this;
	var port = null;
	var options = { baudRate: 9600 };
	var closeRequested = false;
	var re =  new RegExp(serial);
	var key = "serialNumber";
	var on = false;
	var heartbeat = Date.now();
	var isOpened = false;
	var no_callback = function(err) {
		if(err) debug(err);
	}

	/**
	* Do we currently have an open connection to the pedal?
	*/
	this.getIsOpened = function() {
		return isOpened;
	}

	// ---------------------------
	this.toggle = function(callback) {
		if(on) this.off(callback);
		else this.on(callback);
	}

	// ---------------------------
	this.on = function(callback) {
		callback = callback || no_callback;
		if(!port) return callback("no port");
		on = true;
		debug("on")
		port.write("1", "utf8", callback);
	}

	// ---------------------------
	this.off = function(callback) {
		callback = callback || no_callback;
		if(!port) return callback("no port");
		on = false;
		debug("off")
		port.write("0", "utf8", callback);
	}

	// ---------------------------
	this.close = function(callback) {
		callback = callback || no_callback;
		closeRequested = true;
		debug("closing");
		if(port) port.close();
		callback();
	}

	var on_open = function() {
		isOpened = true;
		debug("opened");
	}

	var on_error = function(err) {
		debug('error opening port: ', err.message);
		port = null;
	}

	var on_data = function(buf) {
		var data = buf.toString('utf8');
		//debug("data", data);
		if(data==".") heartbeat = Date.now();
	}

	var on_close = function(data) {
		debug("on_close");
		isOpened = false;
		port = null;
	}

	var stay_connected = function() {
		if(closeRequested) return;

		if(port==null)  {
			debug("port closed. attemping to open")

			SerialPort.list().then((ports) => {
				var comName = null;
				ports.forEach(function(_info) {
					if(_info[key] && _info[key].match(re))
						comName = _info.comName
				});
				if(comName==null)
					return debug("no port found");

				debug("opening", comName);

				port = new SerialPort(comName, options);
				port.on('open', on_open);
				port.on('error', on_error);
				port.on('data', on_data);
				port.on('close', on_close);
			})
		} else {
			var elapsed = Date.now() - heartbeat;
			if(elapsed > 5000) {
				debug("lost heartbeat signal. resetting")
				port = null;
			}
		}

		if(!closeRequested) setTimeout( stay_connected, 1000 );
	};

	stay_connected();
}

module.exports = new OnAirSign("85438333935351A02251");


text:
using content::BrowserThread;

namespace {

bool SortActionsByTime(const scoped_refptr<extensions::Action> a,
                       const scoped_refptr<extensions::Action> b) {
  return a->time() > b->time();
}

}  // namespace

namespace extensions {

ActivityDatabase::ActivityDatabase()
    : testing_clock_(NULL),
      initialized_(false) {
}

ActivityDatabase::~ActivityDatabase() {
  Close();  // Safe to call Close() even if Open() never happened.
}

void ActivityDatabase::SetErrorDelegate(sql::ErrorDelegate* error_delegate) {
  db_.set_error_delegate(error_delegate);
}

void ActivityDatabase::Init(const base::FilePath& db_name) {
  db_.set_page_size(4096);
  db_.set_cache_size(32);

  if (!db_.Open(db_name)) {
    LOG(ERROR) << db_.GetErrorMessage();
    return LogInitFailure();
  }

  // Wrap the initialization in a transaction so that the db doesn't
  // get corrupted if init fails/crashes.
  sql::Transaction committer(&db_);
  if (!committer.Begin())
    return LogInitFailure();

#if defined(OS_MACOSX)
  // Exclude the database from backups.
  base::mac::SetFileBackupExclusion(db_name);
#endif

  db_.Preload();

  // Create the DOMAction database.
  if (!DOMAction::InitializeTable(&db_))
    return LogInitFailure();

  // Create the APIAction database.
  if (!APIAction::InitializeTable(&db_))
    return LogInitFailure();

  // Create the BlockedAction database.
  if (!BlockedAction::InitializeTable(&db_))
    return LogInitFailure();

  sql::InitStatus stat = committer.Commit() ? sql::INIT_OK : sql::INIT_FAILURE;
  if (stat == sql::INIT_OK)
    initialized_ = true;
  else
    return LogInitFailure();
}

void ActivityDatabase::LogInitFailure() {
  LOG(ERROR) << "Couldn't initialize the activity log database.";
}

void ActivityDatabase::RecordAction(scoped_refptr<Action> action) {
  if (initialized_)
    action->Record(&db_);
}

scoped_ptr<std::vector<scoped_refptr<Action> > > ActivityDatabase::GetActions(
    const std::string& extension_id, const int days_ago) {
  DCHECK_GE(days_ago, 0);
  scoped_ptr<std::vector<scoped_refptr<Action> > >
      actions(new std::vector<scoped_refptr<Action> >());
  if (!initialized_)
    return actions.Pass();
  // Compute the time bounds for that day.
  base::Time morning_midnight = testing_clock_ ?
      testing_clock_->Now().LocalMidnight() :
      base::Time::Now().LocalMidnight();
  int64 early_bound = 0;
  int64 late_bound = 0;
  if (days_ago == 0) {
      early_bound = morning_midnight.ToInternalValue();
      late_bound = base::Time::Max().ToInternalValue();
  } else {
      base::Time early_time = morning_midnight -
          base::TimeDelta::FromDays(days_ago);
      base::Time late_time = morning_midnight -
          base::TimeDelta::FromDays(days_ago-1);
      early_bound = early_time.ToInternalValue();
      late_bound = late_time.ToInternalValue();
  }
  // Get the DOMActions.
  std::string dom_str = base::StringPrintf("SELECT * FROM %s "
                                           "WHERE extension_id=? AND "
                                           "time>? AND time<=?",
                                           DOMAction::kTableName);
  sql::Statement dom_statement(db_.GetCachedStatement(SQL_FROM_HERE,
                                                      dom_str.c_str()));
  dom_statement.BindString(0, extension_id);
  dom_statement.BindInt64(1, early_bound);
  dom_statement.BindInt64(2, late_bound);
  while (dom_statement.Step()) {
    scoped_refptr<DOMAction> action = new DOMAction(dom_statement);
    actions->push_back(action);
  }
  // Get the APIActions.
  std::string api_str = base::StringPrintf("SELECT * FROM %s "
                                           "WHERE extension_id=? AND "
                                           "time>? AND time<=?",
                                            APIAction::kTableName);
  sql::Statement api_statement(db_.GetCachedStatement(SQL_FROM_HERE,
                                                      api_str.c_str()));
  api_statement.BindString(0, extension_id);
  api_statement.BindInt64(1, early_bound);
  api_statement.BindInt64(2, late_bound);
  while (api_statement.Step()) {
    scoped_refptr<APIAction> action = new APIAction(api_statement);
    actions->push_back(action);
  }
  // Get the BlockedActions.
  std::string blocked_str = base::StringPrintf("SELECT * FROM %s "
                                               "WHERE extension_id=? AND "
                                               "time>? AND time<=?",
                                               BlockedAction::kTableName);
  sql::Statement blocked_statement(db_.GetCachedStatement(SQL_FROM_HERE,
                                                          blocked_str.c_str()));
  blocked_statement.BindString(0, extension_id);
  blocked_statement.BindInt64(1, early_bound);
  blocked_statement.BindInt64(2, late_bound);
  while (blocked_statement.Step()) {
    scoped_refptr<BlockedAction> action = new BlockedAction(blocked_statement);
    actions->push_back(action);
  }
  // Sort by time (from newest to oldest).
  std::sort(actions->begin(), actions->end(), SortActionsByTime);
  return actions.Pass();
}

void ActivityDatabase::BeginTransaction() {
  db_.BeginTransaction();
}

void ActivityDatabase::CommitTransaction() {
  db_.CommitTransaction();
}

void ActivityDatabase::RollbackTransaction() {
  db_.RollbackTransaction();
}

bool ActivityDatabase::Raze() {
  return db_.Raze();
}

void ActivityDatabase::Close() {
  db_.Close();
}

void ActivityDatabase::KillDatabase() {
  db_.RazeAndClose();
}

void ActivityDatabase::SetClockForTesting(base::Clock* clock) {
  testing_clock_ = clock;
}

}  // namespace extensions


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">

    <statusListener class="ch.qos.logback.core.status.NopStatusListener" />

    <property name="ROOT_LEVEL" value="INFO" />

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>%-25(%d{yyyy-MMM-dd HH:mm:ss} [%-10.10thread]) [%-5level] - %msg \(%logger\)%n</Pattern>
        </layout>
    </appender>

    <appender name="ASYNC_STDOUT" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="STDOUT"/>
    </appender>

    <logger name="com.buildria.mocking" level="DEBUG" />

    <root level="${ROOT_LEVEL}">
        <appender-ref ref="ASYNC_STDOUT"/>
    </root>

</configuration>


text:
.class public Landroid/provider/SettingsStringUtil$SettingStringHelper;
.super Ljava/lang/Object;
.source "SettingsStringUtil.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/provider/SettingsStringUtil;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "SettingStringHelper"
.end annotation

# instance fields
.field private final mContentResolver:Landroid/content/ContentResolver;

.field private final mSettingName:Ljava/lang/String;

.field private final mUserId:I

# direct methods
.method public constructor <init>(Landroid/content/ContentResolver;Ljava/lang/String;I)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mContentResolver:Landroid/content/ContentResolver;

    iput p3, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mUserId:I

    iput-object p2, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mSettingName:Ljava/lang/String;

    return-void
.end method

# virtual methods
.method public modify(Ljava/util/function/Function;)Z
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/function/Function",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)Z"
        }
    .end annotation

    invoke-virtual {p0}, Landroid/provider/SettingsStringUtil$SettingStringHelper;->read()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Ljava/util/function/Function;->apply(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {p0, v0}, Landroid/provider/SettingsStringUtil$SettingStringHelper;->write(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public read()Ljava/lang/String;
    .locals 3

    iget-object v0, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mContentResolver:Landroid/content/ContentResolver;

    iget-object v1, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mSettingName:Ljava/lang/String;

    iget v2, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mUserId:I

    invoke-static {v0, v1, v2}, Landroid/provider/Settings$Secure;->getStringForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public write(Ljava/lang/String;)Z
    .locals 3

    iget-object v0, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mContentResolver:Landroid/content/ContentResolver;

    iget-object v1, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mSettingName:Ljava/lang/String;

    iget v2, p0, Landroid/provider/SettingsStringUtil$SettingStringHelper;->mUserId:I

    invoke-static {v0, v1, p1, v2}, Landroid/provider/Settings$Secure;->putStringForUser(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;I)Z

    move-result v0

    return v0
.end method


text:
#include <X11/Xfuncproto.h>

_XFUNCPROTOBEGIN

void _XEditResCheckMessages
(
 Widget			w,
 XtPointer		data,
 XEvent			*event,
 Boolean		*cont
);

_XFUNCPROTOEND


text:
        {{ nameModel }}
        Hide


text:
'use strict';

var _ = require('lodash');
var extend = require('deep-extend');
var stormpath = require('stormpath');
var uuid = require('uuid');

var forms = require('../forms');
var helpers = require('../helpers');
var oauth = require('../oauth');
var loginWithOAuthProvider = require('../helpers/login-with-oauth-provider');

/**
 * This controller logs in an existing user.  If there are any errors, an
 * error page is rendered.  If the process succeeds, the user will be logged in
 * and redirected.
 *
 * @method
 *
 * @param {Object} req - The http request.
 * @param {Object} res - The http response.
 */
module.exports = function (req, res) {
  var accepts = req.accepts(['html', 'json']);
  var application = req.app.get('stormpathApplication');
  var authenticator = stormpath.OAuthPasswordGrantRequestAuthenticator(application);
  var config = req.app.get('stormpathConfig');
  var logger = req.app.get('stormpathLogger');
  var nextUri = req.query.next;
  var formActionUri = (config.web.login.uri + (nextUri ? ('?next=' + nextUri) : ''));
  var view = req.app.get('stormpathConfig').web.login.view;
  var oauthStateToken = null;
  var providerData = req.body && req.body.providerData;

  function renderForm(form, options) {
    if (options === undefined) {
      options = {};
    }

    var hasSocialProviders = _.any(config.socialProviders, function (socialProvider) {
      return socialProvider.enabled;
    });

    extend(options, {
      form: form,
      formActionUri: formActionUri,
      oauthStateToken: oauthStateToken,
      hasSocialProviders: hasSocialProviders
    });

    helpers.render(req, res, view, options);
  }

  if (req.user && config.web.login.enabled) {
    var url = nextUri || config.web.login.nextUri;
    return res.redirect(302, url);
  }

  res.locals.status = req.query.status;

  if (req.method === 'POST' && accepts === 'json') {
    if (providerData) {
      // Social Login
      var options = {
        providerData: {
          providerId: providerData.providerId,
          accessToken: providerData.accessToken,
          code: providerData.code
        }
      };

      return loginWithOAuthProvider(options, req, res);
    }

    authenticator.authenticate({
      username: req.body.username || uuid(),
      password: req.body.password || uuid()
    }, function (err, passwordGrantAuthenticationResult) {
      if (err) {
        return res.status(400).json({ error: err.userMessage || err.message });
      }

      passwordGrantAuthenticationResult.getAccount(function (err, account) {
        if (err) {
          logger.info('After successfully authenticating user ' + account.email + ', we were unable to retrieve the account details from Stormpath.');
          return res.status(400).json({ error: err.userMessage || err.message });
        }

        helpers.loginResponder(passwordGrantAuthenticationResult, account, req, res);
      });
    });
  } else if (accepts === 'html') {
    if (config.web.spaRoot) {
      return res.sendFile(config.web.spaRoot);
    }

    oauthStateToken = oauth.common.resolveStateToken(req, res);
    helpers.setTempCookie(res, 'oauthRedirectUri', req.originalUrl);

    forms.loginForm.handle(req, {
      // If we get here, it means the user is submitting a login request, so we
      // should attempt to log the user into their account.
      success: function (form) {
        authenticator.authenticate({
          username: form.data.login,
          password: form.data.password
        }, function (err, passwordGrantAuthenticationResult) {
          if (err) {
            logger.info('User attempted to authenticated via the login page, but supplied invalid credentials.');
            return renderForm(form, { error: err.userMessage });
          }

          passwordGrantAuthenticationResult.getAccount(function (err, account) {
            if (err) {
              logger.info('After successfully authenticating user ' + account.email + ', we were unable to retrieve the account details from Stormpath.');
              return renderForm(form, { error: err.userMessage });
            }

            helpers.loginResponder(passwordGrantAuthenticationResult, account, req, res);
          });
        });
      },
      // If we get here, it means the user didn't supply required form fields.
      error: function (form) {
        // Special case: if the user is being redirected to this page for the
        // first time, don't display any error.
        if (form.data && !form.data.login && !form.data.password) {
          return renderForm(form);
        }

        renderForm(form, { formErrors: helpers.collectFormErrors(form) });
      },
      // If we get here, it means the user is doing a simple GET request, so we
      // should just render the login template.
      empty: function (form) {
        renderForm(form);
      }
    });
  }
};


text:
package com.vinitello.packet;

import com.google.inject.ImplementedBy;
import com.vinitello.packet.base.BasePacketService;

@ImplementedBy(BasePacketService.class)
public interface IPacketService extends IPacketBuilder, IPacketParser {

	public boolean registerBuilder(Class<? extends IPacketBuilder> builder);
	public boolean registerParser(Class<? extends IPacketParser> parser);

}


text:
namespace Unmanagedpp
{

	template <typename T>
	public ref class UnmanagedObject
	{
	private:
		T* obj;
	public:

		UnmanagedObject(const T& obj) : obj(new T(obj))
		{

		}

		UnmanagedObject() : obj(new T)
		{

		}

		UnmanagedObject(const UnmanagedObject<T>% other) : obj(new T(*other))
		{
		}

		~UnmanagedObject()
		{
			(*this).!UnmanagedObject();
		}

		!UnmanagedObject()
		{
			delete obj;
		}

		void Reset(const T& newObj)
		{
			*obj = newObj;
		}

		property T& Obj
		{
			T& get()
			{
				return *obj;
			}
		}

		UnmanagedObject<T>% operator=(UnmanagedObject<T>% rhs)
		{
			Reset(*rhs);
			return *this;
		}

		UnmanagedObject<T>% operator=(const T& rhs)
		{
			Reset(rhs);
			return *this;
		}

		T operator->()
		{
			return *obj;
		}

		static T& operator*(UnmanagedObject<T>% rhs)
		{
			return *rhs.obj;
		}
		static const T& operator*(const UnmanagedObject<T>% rhs)
		{
			return *rhs.obj;
		}
	};

	namespace stl
	{
		template <typename T>
		using SharedPtr = UnmanagedObject<std::shared_ptr<T>>;

		template <typename T>
		using UniquePtr = UnmanagedObject<std::unique_ptr<T>>;
	}
}


text:
namespace NPOI.HSSF.UserModel
{
    using System;

    ///
    /// Contains raw Excel error codes (as defined in OOO's excelfileformat.pdf (2.5.6)
    /// @author  Michael Harhen
    ///
    public class HSSFErrorConstants
    {
        private HSSFErrorConstants()
        {
            // no instances of this class
        }

        /** #NULL!  - Intersection of two cell ranges is empty */
        public const int ERROR_NULL = 0x00;
        /** #DIV/0! - Division by zero */
        public const int ERROR_DIV_0 = 0x07;
        /** #VALUE! - Wrong type of operand */
        public const int ERROR_VALUE = 0x0F;
        /** #REF! - Illegal or deleted cell reference */
        public const int ERROR_REF = 0x17;
        /** #NAME? - Wrong function or range name */
        public const int ERROR_NAME = 0x1D;
        /** #NUM! - Value range overflow */
        public const int ERROR_NUM = 0x24;
        /** #N/A - Argument or function not available */
        public const int ERROR_NA = 0x2A;

        ///
        /// Gets standard Excel error literal for the specified error code.
        /// @throws ArgumentException if the specified error code is not one of the 7
        /// standard error codes
        ///
        /// <param name="errorCode">The error code.</param>
        /// <returns></returns>
        public static String GetText(int errorCode)
        {
            if (errorCode == ERROR_NULL)
            {
                return "#NULL!";
            }else if(errorCode == ERROR_DIV_0)
            {
                return "#DIV/0!";
            }else if(errorCode == ERROR_VALUE)
            {
                return "#VALUE!";
            }else if(errorCode == ERROR_REF)
            {
                return "#REF!";
            }else if(errorCode == ERROR_NAME)
            {
                return "#NAME?";
            }else if(errorCode == ERROR_NUM)
            {
                return "#NUM!";
            }
            else if (errorCode == ERROR_NA)
            {
                return "#N/A";
            }
            throw new ArgumentException("Bad error code (" + errorCode + ")");
        }

        ///
        /// Determines whether [is valid code] [the specified error code].
        ///
        /// <param name="errorCode">The error code.</param>
        /// <returns>
        /// 	<c>true</c> if the specified error code is a standard Excel error code.; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsValidCode(int errorCode)
        {
            // This method exists because it would be bad to force clients to catch
            // ArgumentException if there were potential for passing an invalid error code.

            if (errorCode == ERROR_NULL
                || errorCode == ERROR_DIV_0
                || errorCode == ERROR_VALUE
                || errorCode == ERROR_REF
                || errorCode == ERROR_NAME
                || errorCode == ERROR_NUM
                || errorCode == ERROR_NA
                )
                {
                    return true;
                }

            return false;
        }
    }
}


text:
0.8.3 (unreleased)
------------------

- Nothing changed yet.

0.8.2 (2021-01-08)
------------------

- Allow supplying multiple role ARNs in COPY and UNLOAD commands. This allows
  the first role to assume other roles as explained
  `here <https://docs.aws.amazon.com/redshift/latest/mgmt/authorizing-redshift-service.html#authorizing-redshift-service-chaining-roles>`_.

0.8.1 (2020-07-15)
------------------

- Support AWS partitions for role-based access control in COPY and UNLOAD
  commands. This allows these commands to be used, e.g. in GovCloud.

0.8.0 (2020-06-30)
------------------

- Add option to drop materialized view with CASCADE
  (`Pull #204 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/204>`_)
- Fix invalid SQLAlchemy version comparison
  (`Pull #206 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/206>`_)

0.7.9 (2020-05-29)
------------------

- Fix for supporting SQLAlchemy 1.3.11+
  (`Issue #195 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/195>`_)

0.7.8 (2020-05-27)
------------------

- Added support for materialized views
  (`Issue #202 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/202>`_)
- Fix reflection of unique constraints
  (`Issue #199 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/199>`_)
- Support for altering column comments in Alembic migrations
  (`Issue #191 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/191>`_)

0.7.7 (2020-02-02)
------------------

- Import Iterable from collections.abc for Python 3.9 compatibility
  (`Issue #189 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/189>`_)
- Add support for Parquet format in ``UNLOAD`` command
  (`Issue #187 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/187>`_)

0.7.6 (2020-01-17)
------------------

- Fix unhashable type error for sortkey reflection in SQLAlchemy >= 1.3.11
  (`Issue #180 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/180>`_)
- Expose supported types for import from the dialect
  (`Issue #181 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/181>`_)
- Reflect column comments
  (`Issue #186 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/186>`_)

0.7.5 (2019-10-09)
------------------

- Extend psycopg2 package version check to also support psycopg2-binary and psycopg2cffi
  (`Issue #178 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/178>`_)

0.7.4 (2019-10-08)
------------------

- Drop hard dependency on psycopg2 but require package to be present on runtime
  (`Issue #165 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/165>`_)
- Switch from info to keyword arguments on columns for ``SQLAlchemy >= 1.3.0``
  (`Issue #161 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/161>`_)
- Add support for column info on redshift late binding views
  (`Issue #159 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/159>`_)
- Add support for ``MAXFILESIZE`` argument to ``UNLOAD``.
  (`Issue #123 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/123>`_)
- Add support for the `CREATE LIBRARY`_ command.
  (`Issue #124 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/124>`_)
- Add support for the `ALTER TABLE APPEND`_ command.
  (`Issue #162 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/162>`_)
- Add support for the ``CSV`` format to `UnloadFromSelect`.
  (`Issue #169 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/169>`_)
- Update the list of reserved words (adds "az64" and "language")
  (`Issue #176 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/176>`_)

.. _CREATE LIBRARY: https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_LIBRARY.html
.. _ALTER TABLE APPEND: https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE_APPEND.html

0.7.3 (2019-01-16)
------------------

- Add support for ``REGION`` argument to ``COPY`` and ``UNLOAD`` commands.
  (`Issue #90 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/90>`_)

0.7.2 (2018-12-11)
------------------

- Update tests to adapt to changes in Redshift and SQLAlchemy
  (`Issue #140 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/140>`_)
- Add `header` option to `UnloadFromSelect` command
  (`Issue #156 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/156>`_)
- Add support for Parquet and ORC file formats in the COPY command
  (`Issue #151 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/150>`_)
- Add official support for Python 3.7
  (`Issue #153 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/153>`_)
- Avoid manipulating search path in table metadata fetch by using system tables
  directly (`Issue #147 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/147>`_)

0.7.1 (2018-01-17)
------------------

- Fix incompatibility of reflection code with SQLAlchemy 1.2.0+
  (`Issue #138 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/138>`_)

0.7.0 (2017-10-03)
------------------

- Do not enumerate `search_path` with external schemas (`Issue #120
  <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/120>`_)
- Return constraint name from get_pk_constraint and get_foreign_keys
- Use Enums for Format, Compression and Encoding.
  Deprecate string parameters for these parameter types
  (`Issue #133 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/133>`_)
- Update included certificate with the `transitional ACM cert bundle
  <https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-transitioning-to-acm-certs.html>`_
  (`Issue #130 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/130>`_)

0.6.0 (2017-05-04)
------------------

- Support role-based access control in COPY and UNLOAD commands
  (`Issue #88 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/88>`_)
- Increase max_identifier_length to 127 characters
  (`Issue #96 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/96>`_)
- Fix a bug where table names containing a period caused an error on reflection
  (`Issue #97 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/97>`_)
- Performance improvement for reflection by caching table constraint info
  (`Issue #101 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/101>`_)
- Support BZIP2 compression in COPY command
  (`Issue #110 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/110>`_)
- Allow tests to tolerate new default column encodings in Redshift
  (`Issue #114 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/114>`_)
- Pull in set of reserved words from Redshift docs
  (`Issue #94 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/94>` _)

0.5.0 (2016-04-21)
------------------

- Support reflecting tables with foriegn keys to tables in non-public schemas
  (`Issue #70 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/70>`_)
- Fix a bug where DISTKEY and SORTKEY could not be used on column names containing
  spaces or commas. This is a breaking behavioral change for a command like
  `__table_args__ = {'redshift_sortkey': ('foo, bar')}`. Previously, this would sort
  on the columns named `foo` and `bar`. Now, it sorts on the column named `foo, bar`.
  (`Issue #74 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/74>`_)

0.4.0 (2015-11-17)
------------------

- Change the name of the package to `sqlalchemy_redshift` to match the naming
  convention for other dialects; the `redshift_sqlalchemy` package now emits
  a `DeprecationWarning` and references `sqlalchemy_redshift`.
  The `redshift_sqlalchemy` compatibility package will be removed
  in a future release.
  (`Issue #58 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/58>`_)
- Fix a bug where reflected tables could have incorrect column order for some
  `CREATE TABLE` statements, particularly for columns with an `IDENTITY`
  constraint.
  (`Issue #60 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/60>`_)
- Fix a bug where reflecting a table could raise a ``NoSuchTableError``
  in cases where its schema is not on the current ``search_path``
  (`Issue #64 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/64>`_)
- Add python 3.5 to the list of versions for integration tests.
  (`Issue #61 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/61>`_)

0.3.1 (2015-10-08)
------------------

- Fix breakages to CopyCommand introduced in 0.3.0:
  Thanks `solackerman <https://github.com/solackerman>`_.
  (`Issue #53 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/53>`_)

  - When `format` is omitted, no `FORMAT AS ...` is appended to the query. This
    makes the default the same as a normal redshift query.
  - fix STATUPDATE as a COPY parameter

0.3.0 (2015-09-29)
------------------

- Fix view support to be more in line with SQLAlchemy standards.
  `get_view_definition` output no longer includes a trailing semicolon and
  views no longer raise an exception when reflected as `Table` objects.
  (`Issue #46 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/46>`_)
- Rename RedShiftDDLCompiler to RedshiftDDLCompiler.
  (`Issue #43 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/43>`_)
- Update commands
  (`Issue #52 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/52>`_)

  - Expose optional TRUNCATECOLUMNS in CopyCommand.
  - Add all other COPY parameters to CopyCommand.
  - Move commands to their own module.
  - Support inserts into ordered columns in CopyCommand.

0.2.0 (2015-09-04)
------------------

- Use SYSDATE instead of NOW().
  Thanks `bouk <https://github.com/bouk>`_.
  (`Issue #15 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/15>`_)
- Default to SSL with hardcoded AWS Redshift CA.
  (`Issue #20 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/20>`_)
- Refactor of CopyCommand including support for specifying format and
  compression type. (`Issue #21 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/21>`_)
- Explicitly require SQLAlchemy >= 0.9.2 for 'dialect_options'.
  (`Issue #13 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/13>`_)
- Refactor of UnloadFromSelect including support for specifying all documented
  redshift options.
  (`Issue #27 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/27>`_)
- Fix unicode issue with SORTKEY on python 2.
  (`Issue #34 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/34>`_)
- Add support for Redshift ``DELETE`` statements that refer other tables in
  the ``WHERE`` clause.
  Thanks `haleemur <https://github.com/haleemur>`_.
  (`Issue #35 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/35>`_)
- Raise ``NoSuchTableError`` when trying to reflect a table that doesn't exist.
  (`Issue #38 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/38>`_)

0.1.2 (2015-08-11)
------------------

- Register postgresql.visit_rename_table for redshift's
  alembic RenameTable.
  Thanks `bouk <https://github.com/bouk>`_.
  (`Issue #7 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/7>`_)

0.1.1 (2015-05-20)
------------------

- Register RedshiftImpl as an alembic 3rd party dialect.

0.1.0 (2015-05-11)
------------------

- First version of sqlalchemy-redshift that can be installed from PyPI


text:
layout: page
title: Galloway 40th Anniversary
date: 2016-05-24
author: Karen Peters
tags: weekly links, java
status: published
summary: Donec tempor odio ante, sed fringilla sapien facilisis in.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 07/10/2019
  endDate: 07/15/2019
  ctyhocn: FWADPHX
  groupCode: G4A
published: true
---
Mauris volutpat congue lacus, eget pulvinar nisl finibus ac. Nam at faucibus leo, vel porta libero. Sed at facilisis lectus. Cras vel tortor sit amet lorem scelerisque laoreet. Sed egestas aliquam placerat. Suspendisse hendrerit, dui eget aliquet porta, dolor eros mollis quam, vehicula efficitur est lorem quis urna. Nullam convallis semper velit ac lobortis. Maecenas ornare vulputate magna at fringilla. Morbi metus odio, gravida id odio ac, luctus eleifend purus. Nulla eget auctor eros, sed vulputate eros. Donec rutrum pulvinar justo, eu egestas quam porta ut. Nullam tincidunt vehicula urna, in accumsan dolor maximus quis.

* Cras ultrices dolor sit amet purus venenatis, vel porta magna blandit
* Praesent at elit vitae arcu fermentum blandit sed a massa
* Phasellus at augue ut mi tristique maximus ac vel leo
* Etiam maximus urna vel nisl maximus, at imperdiet tortor semper.

Maecenas posuere ut elit eget tincidunt. Suspendisse elit velit, efficitur non ultrices a, accumsan auctor lorem. Fusce vestibulum at libero sit amet mollis. Cras tellus tortor, vestibulum vestibulum arcu eu, mattis rhoncus nisl. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam eu est leo. Aenean et nisi augue.
Donec tincidunt neque enim, eget scelerisque neque rhoncus non. Morbi rutrum finibus nisl at pretium. Morbi sed nisl non tellus faucibus vulputate sed nec diam. Praesent ante purus, rhoncus semper tempor ut, vulputate vitae metus. Nam faucibus turpis at elit dictum tempus. Donec ut pulvinar elit. Mauris diam magna, posuere nec interdum non, elementum ac nunc. Cras ut sollicitudin turpis, a interdum nisl. Mauris quis diam augue. Phasellus sed arcu metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris pretium augue purus, quis pulvinar libero mattis at. Ut ut ultrices metus. Morbi leo ex, tempus sed viverra a, consectetur et nulla.