text:
class SeasonController < ApplicationController
  def index
    @series = Series.find params[:series_id]
    @seasons = @series.seasons.includes([:episodes])
  end

  def show
    @series = Series.find params[:series_id]
    @season = Season.includes([:episodes]).find(params[:id])
    @episodes = @season.episodes
  end
end


text:
package com.baidu.unbiz.olap.util;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

import org.apache.commons.collections.CollectionUtils;

import com.baidu.unbiz.olap.annotation.OlapColumn;
import com.baidu.unbiz.olap.annotation.OlapMergeKey;
import com.baidu.unbiz.olap.codegen.AtomicComputeCache;
import com.baidu.unbiz.olap.common.MethodPair;
import com.baidu.unbiz.olap.constant.CompareType;
import com.baidu.unbiz.olap.constant.OlapConstants;
import com.baidu.unbiz.olap.obj.ItemAble;

/**
 * Olap基础工具类
 *
 * @author wangchongjie
 * @fileName OlapUtils.java
 * @dateTime 2014-1-15 下午3:08:21
 */
public class OlapUtils {

    private static ConcurrentMap<Class<?>, GenerateMethodMapperFutureTask> methodMapperCache =
            new ConcurrentHashMap<Class<?>, GenerateMethodMapperFutureTask>();

    private static class GenerateMethodMapperFutureTask extends FutureTask<Object> {
        public GenerateMethodMapperFutureTask(Callable<Object> callable) {
            super(callable);
        }

        public Object getValue() {
            try {
                return get();
            } catch (InterruptedException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            } catch (ExecutionException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        }
    }

    private static AtomicComputeCache<String, String> atomicComputeKeyColumnCache =
            new AtomicComputeCache<String, String>();

    /**
     * 在methodMap中获取key列
     *
     * @param methodMap
     * @param column
     * @param clazz
     * @return
     * @since 2015-7-28 by wangchongjie
     */
    public static String getKeyColumnInMethodMapper(final Map<String, MethodPair> methodMap, final String column,
            Class<? extends ItemAble> clazz) {

        String keyInCache = clazz.getName() + "-" + column;
        String keyColumn = atomicComputeKeyColumnCache.preGetAlreadyDoneResult(keyInCache);
        if (keyColumn != null) {
            return keyColumn;
        }
        keyColumn = atomicComputeKeyColumnCache.getComputeResult(keyInCache, new Callable<Object>() {
            @Override
            public String call() {
                for (String col : methodMap.keySet()) {
                    if (col.equalsIgnoreCase(column)) {
                        return col;
                    }
                }
                return "";
            }
        });
        return keyColumn;
    }

    /**
     * 生成 MethodMapper
     *
     * @param clazz
     * @return Map<String, MethodPair>
     * @since 2015-7-28 by wangchongjie
     */
    @SuppressWarnings("unchecked")
    public static Map<String, MethodPair> generateMethodMapper(final Class<?> clazz) {
        if (methodMapperCache.containsKey(clazz)) {
            return (Map<String, MethodPair>) methodMapperCache.get(clazz).getValue();
        } else {
            GenerateMethodMapperFutureTask task = new GenerateMethodMapperFutureTask(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    return generate(clazz);
                }
            });
            GenerateMethodMapperFutureTask old = methodMapperCache.putIfAbsent(clazz, task);
            if (old == null) {
                task.run();
            } else {
                task = old;
            }
            return (Map<String, MethodPair>) task.getValue();
        }
    }

    /**
     * 生成MethodPair
     *
     * @param entityClass
     * @return Map<String, MethodPair>
     * @since 2015-7-28 by wangchongjie
     */
    private static Map<String, MethodPair> generate(Class<?> entityClass) {

        // 获取该实体类的解析结果
        Set<Field> fields = ClassUtils.getAllFiled(entityClass);
        Set<Method> methods = ClassUtils.getAllMethod(entityClass);
        Map<String, Method> gsetterMap = ClassUtils.filter2Map(methods);

        Map<String, MethodPair> methodMap = new HashMap<String, MethodPair>();

        // 循环处理所有字段,过滤出该类加载为对象时需要调用的setter方法map
        for (Field f : fields) {
            // 静态字段则自动pass
            if (Modifier.isStatic(f.getModifiers())) {
                continue;
            }
            // 不做关联加载的工作
            Class<?> fType = f.getType();
            if (fType.getName().startsWith("com.baidu.") || Collection.class.isAssignableFrom(fType) || fType.isArray()) {
                continue;
            }
            // 字段名字
            String name = f.getName();
            String upperName = name.substring(0, 1).toUpperCase() + name.substring(1);
            // 其他字段获取field,getter,setter
            String setter = "set" + upperName;
            Method set = gsetterMap.get(setter);

            String getter = "get" + upperName;
            Method get = gsetterMap.get(getter);
            if (get == null) {
                get = gsetterMap.get("is" + upperName);
            }
            if (get == null || set == null) {
                continue;
            }
            // 获取字段的注解,如果没有,则从getter或者setter上获取注解
            OlapColumn column = OlapUtils.getColumnAnnotation(f, set, get);

            // 如果数据库映射字段不为空,则按照映射关系设置字段
            if (column == null) {
                methodMap.put(name, new MethodPair(set, get));
            } else if (column.value().equals(OlapConstants.COLUMN.IGNORE)) {
            } else if (StringUtils.isEmpty(column.alias())) {
                methodMap.put(column.value(), new MethodPair(set, get));
            } else {
                methodMap.put(column.alias(), new MethodPair(set, get));
            }
        }
        return methodMap;
    }

    public static Method getAfterAssembleMethod(Class<? extends ItemAble> entityClass) {

        for (Method method : entityClass.getMethods()) {
            if (method.getName().equalsIgnoreCase("afterAssemble")) {
                return method;
            }
        }
        assert false;
        return null; // 不会执行到此处
    }

    /**
     * 获取某个字段的annotation,从继承链最下面获取
     *
     * @param f
     * @param set
     * @param get
     * @return
     */
    public static OlapColumn getColumnAnnotation(Field f, Method set, Method get) {

        // 三个地方都有可能出现column
        OlapColumn column = f.getAnnotation(OlapColumn.class);
        OlapColumn gColumn = get.getAnnotation(OlapColumn.class);
        OlapColumn sColumn = set.getAnnotation(OlapColumn.class);

        // 预先获取出get与set所在的类
        Class<?> sClass = set.getDeclaringClass();
        Class<?> gClass = get.getDeclaringClass();

        // 如果get上定义了annotation,且get定义的地方是子类
        if (gColumn != null && !gClass.isAssignableFrom(sClass)) {
            return gColumn;
        }

        // 如果是set上定义的annotation,且set方法不在父类中定义
        if (sColumn != null && !sClass.isAssignableFrom(gClass)) {
            return sColumn;
        }

        return column;
    }

    private static ConcurrentMap<Class<? extends ItemAble>, FetchAnnotationColumnFutureTask> olapAnnotationColumnCache =
            new ConcurrentHashMap<Class<? extends ItemAble>, FetchAnnotationColumnFutureTask>();

    /**
     * 获取olap表merge的key字段
     *
     * @param clazz
     * @return 2014-8-26 下午1:33:56 created by wangchongjie
     */
    public static List<String> getOlapMergeKeyColumns(final Class<? extends ItemAble> clazz) {
        return getAnnotationColumns(clazz, OlapMergeKey.class);
    }

    /**
     * 获取olap表merge的value字段
     *
     * @param clazz
     * @return 2014-11-18 下午5:47:20 created by wangchongjie
     */
    public static List<String> getOlapMergeValColumns(final Class<? extends ItemAble> clazz) {
        List<String> keyList = getAnnotationColumns(clazz, OlapMergeKey.class);
        List<String> allList = getAnnotationColumns(clazz, OlapColumn.class);
        if (CollectionUtils.isEmpty(allList)) {
            return null;
        }
        List<String> valList = new ArrayList<String>(allList);
        valList.removeAll(keyList);
        return valList;
    }

    @SuppressWarnings("unchecked")
    public static List<String> getAnnotationColumns(final Class<? extends ItemAble> clazz,
            Class<? extends Annotation> annotType) {
        if (olapAnnotationColumnCache.containsKey(clazz)) {
            Map<Class<? extends Annotation>, List<String>> columnsMap =
                    (Map<Class<? extends Annotation>, List<String>>) olapAnnotationColumnCache.get(clazz).getValue();
            return columnsMap.get(annotType);
        } else {
            FetchAnnotationColumnFutureTask task = new FetchAnnotationColumnFutureTask(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    return getAnnotationColumnsInternal(clazz);
                }
            });
            FetchAnnotationColumnFutureTask old = olapAnnotationColumnCache.putIfAbsent(clazz, task);
            if (old == null) {
                task.run();
            } else {
                task = old;
            }
            Map<Class<? extends Annotation>, List<String>> columnsMap =
                    (Map<Class<? extends Annotation>, List<String>>) task.getValue();
            return columnsMap.get(annotType);
        }
    }

    /**
     * 获取注解列的任务
     *
     * @author wangchongjie
     * @fileName OlapUtils.java
     * @dateTime 2015-7-28 下午6:00:07
     */
    private static class FetchAnnotationColumnFutureTask extends FutureTask<Object> {
        public FetchAnnotationColumnFutureTask(Callable<Object> callable) {
            super(callable);
        }

        public Object getValue() {
            try {
                return get();
            } catch (InterruptedException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            } catch (ExecutionException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        }
    }

    /**
     * 获取注解列
     *
     * @param entityClass
     * @return
     * @since 2015-7-28 by wangchongjie
     */
    private static Map<Class<? extends Annotation>, List<String>> getAnnotationColumnsInternal(
            Class<? extends ItemAble> entityClass) {

        // 获取该实体类的解析结果
        Set<Field> fields = ClassUtils.getAllFiled(entityClass);
        Map<Class<? extends Annotation>, List<String>> columnsMap =
                new HashMap<Class<? extends Annotation>, List<String>>();

        // 循环处理所有字段,过滤出该类加载为对象时需要调用的setter方法map
        for (Field f : fields) {
            // 静态字段则自动pass
            if (Modifier.isStatic(f.getModifiers())) {
                continue;
            }
            Annotation[] annots = f.getAnnotations();
            // 无注解则pass
            if (ArrayUtils.isArrayEmpty(annots)) {
                continue;
            }
            // 非olap列则pass
            OlapColumn olapColumn = f.getAnnotation(OlapColumn.class);
            String columnName = f.getName();
            if (null != olapColumn) {
                columnName = olapColumn.value();
            }
            for (Annotation annot : annots) {
                List<String> columns = columnsMap.get(annot.annotationType());
                if (columns == null) {
                    columns = new ArrayList<String>();
                    columnsMap.put(annot.annotationType(), columns);
                }
                columns.add(columnName);
            }
        }
        return columnsMap;
    }

    private static AtomicComputeCache<String, Map<String, String>> atomicComputeAlaisColsCache =
            new AtomicComputeCache<String, Map<String, String>>();

    /**
     * 获取反向别名字典
     *
     * @param clazz
     * @return 别名alais->原始名称 2014-12-22 下午6:12:30 created by wangchongjie
     */
    public static Map<String, String> getReverseAlaisColumnDict(final Class<? extends ItemAble> clazz) {
        String keyInCache = clazz.getName();
        Map<String, String> alaisCol = atomicComputeAlaisColsCache.preGetAlreadyDoneResult(keyInCache);
        if (alaisCol != null) {
            return alaisCol;
        }
        alaisCol = atomicComputeAlaisColsCache.getComputeResult(keyInCache, new Callable<Object>() {
            @Override
            public Map<String, String> call() {
                return getAlaisColsInternal(clazz);
            }
        });
        return alaisCol;
    }

    /**
     * 填充别名字典
     *
     * @param aliasCol
     * @param clazz
     * @param aliasColDict
     * @param reverseAliasColDict
     * @since 2015-7-28 by wangchongjie
     */
    public static void fillAliasColumnDict(String[] aliasCol, Class<? extends ItemAble> clazz,
            Map<String, String> aliasColDict, Map<String, String> reverseAliasColDict) {
        if (ArrayUtils.isArrayEmpty(aliasCol) || (aliasColDict == null && reverseAliasColDict == null)) {
            return;
        }
        Map<String, String> reverseAlaisColMap = OlapUtils.getReverseAlaisColumnDict(clazz);
        String oriColName;
        for (String alias : aliasCol) {
            oriColName = reverseAlaisColMap.get(alias);
            if (!StringUtils.isEmpty(oriColName)) {
                if (aliasColDict != null) {
                    aliasColDict.put(oriColName, alias);
                }
                if (reverseAliasColDict != null) {
                    reverseAliasColDict.put(alias, oriColName);
                }
            }
        }
    }

    private static Map<String, String> getAlaisColsInternal(Class<? extends ItemAble> entityClass) {

        // 获取该实体类的解析结果
        Set<Field> fields = ClassUtils.getAllFiled(entityClass);
        Map<String, String> alaisColMap = new HashMap<String, String>();

        // 循环处理所有字段,过滤出该类加载为对象时需要调用的setter方法map
        for (Field f : fields) {
            // 静态字段则自动pass
            if (Modifier.isStatic(f.getModifiers())) {
                continue;
            }
            Annotation[] annots = f.getAnnotations();
            // 无注解则pass
            if (ArrayUtils.isArrayEmpty(annots)) {
                continue;
            }
            // 非olap列则pass
            OlapColumn olapColumn = f.getAnnotation(OlapColumn.class);
            if (null == olapColumn || StringUtils.isEmpty(olapColumn.alias())) {
                continue;
            }
            alaisColMap.put(olapColumn.alias(), olapColumn.value());
        }
        return alaisColMap;
    }

    /**
     * 数值范围过滤
     *
     * @param filters
     * @param columnName
     * @param minId
     * @param maxId
     * @since 2015-7-28 by wangchongjie
     */
    public static <T extends Number> void makeNumberRangeFilter(List<String> filters, String columnName, T minId,
            T maxId) {
        if (minId != null && maxId != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(columnName);
            sb.append(" between ");
            sb.append(minId);
            sb.append(" and ");
            sb.append(maxId);
            filters.add(sb.toString());
        }
    }

    /**
     * 数值范围过滤
     *
     * @param filters
     * @param columnName
     * @param id
     * @param op
     * @since 2015-7-28 by wangchongjie
     */
    public static <T extends Number> void makeNumberRangeFilter(List<String> filters, String columnName, T id,
            CompareType op) {
        if (id != null && op != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(columnName);
            sb.append(op.val());
            sb.append(id);
            filters.add(sb.toString());
        }
    }

    /**
     * 数值过滤
     *
     * @param filters
     * @param columnName
     * @param id
     * @since 2015-7-28 by wangchongjie
     */
    public static <T extends Number> void makeNumberFilter(List<String> filters, String columnName, T id) {
        if (id != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(columnName);
            sb.append('=');
            sb.append(id);
            filters.add(sb.toString());
        }
    }

    /**
     * 数值过滤
     *
     * @param filters
     * @param columnName
     * @param ids
     * @since 2015-7-28 by wangchongjie
     */
    public static void makeNumberFilter(List<String> filters, String columnName, Collection<? extends Number> ids) {
        if (!CollectionUtils.isEmpty(ids)) {
            StringBuffer sb = new StringBuffer();
            sb.append(columnName);
            if (ids.size() == 1) {
                sb.append('=');
                sb.append(ids.iterator().next());
                filters.add(sb.toString());
            } else {
                sb.append(" in (");
                sb.append(concatNumber(ids));
                sb.append(')');
                filters.add(sb.toString());
            }
        }
    }

    /**
     * 数值等值过滤
     * @param filters
     * @param columnName
     * @param id
     * @since 2015-7-28 by wangchongjie
     */
    public static void makeNumberEqualFilter(List<String> filters, String columnName, Number id) {
        makeNumberEqualFilter(filters, columnName, id, true);
    }

    /**
     * 数值不等值过滤
     *
     * @param filters
     * @param columnName
     * @param id
     * @since 2015-7-28 by wangchongjie
     */
    public static void makeNumberNotEqualFilter(List<String> filters, String columnName, Number id) {
        makeNumberEqualFilter(filters, columnName, id, false);
    }

    /**
     * 数据等值过滤
     *
     * @param filters
     * @param columnName
     * @param id
     * @param isEqual
     * @since 2015-7-28 by wangchongjie
     */
    private static void makeNumberEqualFilter(List<String> filters, String columnName, Number id, boolean isEqual) {
        if (id != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(columnName);
            if (isEqual) {
                sb.append('=');
                sb.append(id);
                filters.add(sb.toString());
            } else {
                sb.append("!=");
                sb.append(id);
                filters.add(sb.toString());
            }
        }
    }

    /**
     * 数值拼接成逗号分隔的字符串
     *
     * @param keys
     * @return
     * @since 2015-7-28 by wangchongjie
     */
    public static String concatNumber(Collection<? extends Number> keys) {
        StringBuffer res = new StringBuffer();
        for (Number key : keys) {
            res.append(key);
            res.append(',');
        }
        res.deleteCharAt(res.length() - 1);

        return res.toString();
    }
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Shared.Utilities
{
    internal static class BitArrayUtilities
    {
        private const string SerializationFormat = "0";

        public static void WriteTo(this BitArray bitArray, ObjectWriter writer)
        {
            // Our serialization format doesn't round-trip bit arrays of non-byte lengths
            Contract.ThrowIfTrue(bitArray.Length % 8 != 0);

            writer.WriteString(SerializationFormat);
            writer.WriteInt32(bitArray.Length / 8);

            // This will hold the byte that we will write out after we process every 8 bits. This is
            // LSB, so we push bits into it from the MSB.
            byte b = 0;

            for (var i = 0; i < bitArray.Length; i++)
            {
                if (bitArray[i])
                {
                    b = (byte)(0x80 | b >> 1);
                }
                else
                {
                    b >>= 1;
                }

                if ((i + 1) % 8 == 0)
                {
                    // End of a byte, write out the byte
                    writer.WriteByte(b);
                }
            }
        }

        public static BitArray ReadFrom(this ObjectReader reader)
        {
            var version = reader.ReadString();
            if (!string.Equals(version, SerializationFormat, StringComparison.Ordinal))
            {
                return null;
            }

            // TODO: find a way to use pool
            var length = reader.ReadInt32();
            var bytes = new byte[length];

            for (var i = 0; i < bytes.Length; i++)
            {
                bytes[i] = reader.ReadByte();
            }

            return new BitArray(bytes);
        }
    }
}


text:
using huys::UCOM::UComPtr;

IDBInitialize *g_pDBInitialize;

HRESULT InitComEntironment()
{
    HRESULT hres;
    hres =  CoInitializeEx(NULL,COINIT_MULTITHREADED);
    if (FAILED(hres))
        return hres;
    return S_OK;
}

HRESULT CreateSession()
{
    UComPtr<IDBCreateSession> pSession;

    HRESULT hResult = g_pDBInitialize->QueryInterface( IID_IDBCreateSession, ( void**)&pSession );
    if( FAILED( hResult ) )
    {
        return hResult;
    }

    hResult = pSession->CreateSession( NULL, IID_IOpenRowset, ( IUnknown** )&m_pIOpenRowset );
    if( FAILED( hResult ) )
    {
        return hResult;
    }
    return S_OK;
}

int _tmain()
{
    WCHAR szInitStr[1024];
    UINT uTimeout = 15U;
    swprintf( szInitStr,
              L"Provider=SQLOLEDB;Data Source=%s;Initial Catalog=%s;UserId=%s;Password=%s;Connect Timeout=%u",
              pszServerName,
              pszDataSource,
              pszUserName,
              pszPassword,
              uTimeout );
    UComPtr<IDataInitialize> pIDataInitialize;
    //
    HRESULT hResult = ::CoCreateInstance( CLSID_MSDAINITIALIZE, NULL,
        CLSCTX_INPROC_SERVER, IID_IDataInitialize, ( void** )&pIDataInitialize );

    if( FAILED( hResult ) )
        return hResult;
    //
    hResult = pIDataInitialize->GetDataSource( NULL, CLSCTX_INPROC_SERVER,
        (LPCOLESTR)szInitStr, IID_IDBInitialize, ( IUnknown** )&m_pDBInitialize);
    if( FAILED( hResult ) )
        return hResult;
    //
    hResult = m_pDBInitialize->Initialize();
    if( FAILED( hResult ) )
        return hResult;

    return 0;
}

#if 0

#define INITGUID
#define DBINITCONSTANTS
#define INC_OLE2

#include <windows.h>

#include <ole2ver.h>
#include <cguid.h>
#include <oledb.h>
#include <oledberr.h>

#include <stdio.h>

DEFINE_GUID(CLSID_SampProv, 0xE8CCCB79L,0x7C36,0x101B,0xAC,0x3A,0x00,0xAA,0x00,0x44,0x77,0x3D);

void abc( BYTE p )
{
    FILE *fp = fopen("z.txt", "a+");
    fprintf(fp, "%c", p);
    fclose(fp);
}

void abc1( char *p )
{
    FILE *fp=fopen("z.txt","a+");
    fprintf(fp,"%s",p);
    fclose(fp);
}

IDBInitialize* pIDBInitialize;IDBCreateSession *pIDBCreateSession;
DBID dbcolid;
IOpenRowset* pIOpenRowset;
IAccessor *pIAccessor;
HACCESSOR hAccessor;
DBBINDING rgBind;
BYTE* pRowData;
IRowset* pIRowset;
ULONG cRowsObtained,iRow;
HROW rghRows[100],*pRows=&rghRows[0];
char aa[200];

int main()
{
    OleInitialize( NULL );
    CoCreateInstance(CLSID_SampProv, 0, CLSCTX_INPROC_SERVER, IID_IDBInitialize,
           (void **)&pIDBInitialize);
    pIDBInitialize->Initialize();
    pIDBInitialize->QueryInterface(IID_IDBCreateSession, (void**)&pIDBCreateSession);
    pIDBCreateSession->CreateSession(0, IID_IOpenRowset, (IUnknown**)&pIOpenRowset);
    dbcolid.eKind = DBKIND_NAME;
    dbcolid.uName.pwszName = L"z.csv";
    pIOpenRowset->OpenRowset(0, &dbcolid, 0, IID_IRowset, 0, 0, (IUnknown**)&pIRowset);
    rgBind.dwPart = DBPART_VALUE|DBPART_LENGTH|DBPART_STATUS;
    rgBind.eParamIO = DBPARAMIO_NOTPARAM;
    rgBind.iOrdinal = 1;
    rgBind.wType = DBTYPE_STR;
    rgBind.obValue = 8;
    rgBind.obLength = 0;
    rgBind.obStatus = 4;
    rgBind.cbMaxLen = 7;
    pIRowset->QueryInterface( IID_IAccessor, (void**)&pIAccessor );
    pIAccessor->CreateAccessor(DBACCESSOR_ROWDATA, 1, &rgBind, 0, &hAccessor,0);
    pRowData = (BYTE *) malloc(1000);
    pIRowset->GetNextRows(NULL, 0, 100, &cRowsObtained, &pRows);
    for ( iRow=0; iRow < cRowsObtained; iRow++ )
    {
        pIRowset->GetData(rghRows[iRow], hAccessor, pRowData );
        for ( int j =0 ;j<=4;j++)
            abc(pRowData [j+8]);
            abc('\n');
        }
    }
}

#endif


text:
#include <aws/resource-groups/model/QueryErrorCode.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace ResourceGroups
  {
    namespace Model
    {
      namespace QueryErrorCodeMapper
      {

        static const int CLOUDFORMATION_STACK_INACTIVE_HASH = HashingUtils::HashString("CLOUDFORMATION_STACK_INACTIVE");
        static const int CLOUDFORMATION_STACK_NOT_EXISTING_HASH = HashingUtils::HashString("CLOUDFORMATION_STACK_NOT_EXISTING");

        QueryErrorCode GetQueryErrorCodeForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == CLOUDFORMATION_STACK_INACTIVE_HASH)
          {
            return QueryErrorCode::CLOUDFORMATION_STACK_INACTIVE;
          }
          else if (hashCode == CLOUDFORMATION_STACK_NOT_EXISTING_HASH)
          {
            return QueryErrorCode::CLOUDFORMATION_STACK_NOT_EXISTING;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<QueryErrorCode>(hashCode);
          }

          return QueryErrorCode::NOT_SET;
        }

        Aws::String GetNameForQueryErrorCode(QueryErrorCode enumValue)
        {
          switch(enumValue)
          {
          case QueryErrorCode::CLOUDFORMATION_STACK_INACTIVE:
            return "CLOUDFORMATION_STACK_INACTIVE";
          case QueryErrorCode::CLOUDFORMATION_STACK_NOT_EXISTING:
            return "CLOUDFORMATION_STACK_NOT_EXISTING";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace QueryErrorCodeMapper
    } // namespace Model
  } // namespace ResourceGroups
} // namespace Aws


text:
using Dynamic.Ampla.AmplaData2008;
using Dynamic.Ampla.Modules.Production;
using Dynamic.Ampla.WebServices.Simple.AmplaData2008;
using Microsoft.CSharp.RuntimeBinder;
using NUnit.Framework;

namespace Dynamic.Ampla
{
    [TestFixture]
    public class DynamicViewPointUnitTests : TestFixture
    {
        private const string location = "Enterprise.Site.Area.Production";
        private const string module = "Production";

        private int id;

        protected override void OnSetUp()
        {
            base.OnSetUp();
            SimpleDataWebServiceClient client = new SimpleDataWebServiceClient(module, location)
                {
                    GetViewFunc = ProductionViews.StandardView
                };

            id = client.AddExistingRecord(ProductionRecords.NewRecord());
            DataWebServiceFactory.Factory = () => client;
        }

        protected override void OnTearDown()
        {
            base.OnTearDown();
            DataWebServiceFactory.Factory = null;
        }

        [Test]
        public void FindNamedArgument()
        {
            DynamicViewPoint viewPoint = new DynamicViewPoint(location, module);

            dynamic point = viewPoint;
            dynamic result = point.Find(Id: id);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Id, Is.EqualTo(id));
            Assert.That(result.Location, Is.EqualTo(location));
        }

        [Test]
        public void FindById()
        {
            DynamicViewPoint viewPoint = new DynamicViewPoint(location, module);

            dynamic point = viewPoint;
            dynamic result = point.FindById(id);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Id, Is.EqualTo(id));
            Assert.That(result.Location, Is.EqualTo(location));
        }

        [Test]
        public void Find()
        {
            DynamicViewPoint viewPoint = new DynamicViewPoint(location, module);

            dynamic point = viewPoint;
            dynamic result = point.Find(id);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Id, Is.EqualTo(id));
            Assert.That(result.Location, Is.EqualTo(location));
        }

        [Test]
        public void FindWithSetId()
        {
            DynamicViewPoint viewPoint = new DynamicViewPoint(location, module);

            dynamic point = viewPoint;

            Assert.Throws<RuntimeBinderException>(()=>point.Find(SetId: id));
        }

        [Test]
        public void FindByWithNamedAndPositional()
        {
            DynamicViewPoint viewPoint = new DynamicViewPoint(location, module);

            dynamic point = viewPoint;

            Assert.Throws<RuntimeBinderException>(() => point.Find(id, Id: 200));
        }
    }
}


text:
Converts Shapefiles to Esri Json

## Usage

```bash
./bin/app -i some_file.shp -o some_esri.json
```


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

{% block title %}GitHub rate limit reached - Grip{% endblock %}

{%- block styles -%}

{%- endblock -%}

{%- block scripts -%}

{%- endblock -%}

{%- block page -%}

GitHub Rate Limit Reached

        The GitHub API rate limit
        {% if is_authenticated %} for basic auth {% endif %}
        has been reached for the hour.

      {% if is_authenticated %}

          Sorry for the inconvenience.

      {% endif %}

    {% if not is_authenticated %}

What?

          GitHub imposes a limit of 60 requests/hour when using their API without authentication.

Why?

          This prevents people from anonymously abusing GitHub's system.

          As for Grip, it's built to appear as close to GitHub as possible. Using
          GitHub's API allows Grip to immediately and accurately reflect any updates
          from GitHub, without the delay of busy maintainers or requiring you to upgrade.

Ok, fine. Where do I go from here?

          Until the offline renderer is complete, you can run Grip using

          the --user and --pass arguments to use basic auth,

          giving you 5,000 requests/hour. Run grip -h for details.

          I do apologize for the inconvenience. If you need help, or have ideas on improving this
          experience, please reach out joe@joeyespo.com

    {% endif %}

{%- endblock -%}


text:
import time
import RPi.GPIO as GPIO
from allthingstalk import Device, BooleanAsset, Client, Asset

# Parameters used to authorize and identify your device
# Get them on maker.allthingstalk.com
DEVICE_TOKEN = '<DEVICE_TOKEN>'
DEVICE_ID = '<DEVICE_ID>'

class LedActuator(Device):
    led = BooleanAsset(kind=Asset.ACTUATOR)

# Authorize and connect your device with the Cloud
client = Client(DEVICE_TOKEN)
device = LedActuator(client=client, id=DEVICE_ID)

# LED is connected to GPIO4
led_pin = 4

# Led's pin needs to be in OUTPUT mode
GPIO.setmode(GPIO.BCM)
GPIO.setup(led_pin, GPIO.OUT)

@LedActuator.command.led
def on_led(device, value, at):
    # Turn led On or Off depending on the received Command
    GPIO.output(led_pin, value)

    # Send value to the cloud to reflect physical state of the led
    device.led = value

    print('Led state updated to %s.' % value)

while True:
    print('Waiting for actuation...')
    time.sleep(5)


text:
<?php

/// $Id $

///////////////////////////////////////////////////////////////////////////
//                                                                       //
// NOTICE OF COPYRIGHT                                                   //
//                                                                       //
// ADOdb  - Database Abstraction Library for PHP                         //
//          http://adodb.sourceforge.net/                                //
//                                                                       //
// Copyright (C) 2000-2007 John Lim (jlim\@natsoft.com.my)               //
//          All rights reserved.                                         //
//          Released under both BSD license and LGPL library license.    //
//          Whenever there is any discrepancy between the two licenses,  //
//          the BSD license will take precedence                         //
//                                                                       //
// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
//          http://moodle.com                                            //
//                                                                       //
// Copyright (C) 2001-3001 Martin Dougiamas        http://dougiamas.com  //
//           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
//                                                                       //
// This program is free software; you can redistribute it and/or modify  //
// it under the terms of the GNU General Public License as published by  //
// the Free Software Foundation; either version 2 of the License, or     //
// (at your option) any later version.                                   //
//                                                                       //
// This program is distributed in the hope that it will be useful,       //
// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
// GNU General Public License for more details:                          //
//                                                                       //
//          http://www.gnu.org/copyleft/gpl.html                         //
//                                                                       //
///////////////////////////////////////////////////////////////////////////

/**
*  MSSQL Driver with auto-prepended "N" for correct unicode storage
*  of SQL literal strings. Intended to be used with MSSQL drivers that
*  are sending UCS-2 data to MSSQL (FreeTDS and ODBTP) in order to get
*  true cross-db compatibility from the application point of view.
*/

// security - hide paths
if (!defined('ADODB_DIR')) die();

// one useful constant
if (!defined('SINGLEQUOTE')) define('SINGLEQUOTE', "'");

include_once(ADODB_DIR.'/drivers/adodb-mssql.inc.php');

class ADODB_mssql_n extends ADODB_mssql {
	var $databaseType = "mssql_n";

	function __construct()
	{
        parent::__construct();
	}

	function _query($sql,$inputarr)
	{
        $sql = $this->_appendN($sql);
		return ADODB_mssql::_query($sql,$inputarr);
	}

    /**
     * This function will intercept all the literals used in the SQL, prepending the "N" char to them
     * in order to allow mssql to store properly data sent in the correct UCS-2 encoding (by freeTDS
     * and ODBTP) keeping SQL compatibility at ADOdb level (instead of hacking every project to add
     * the "N" notation when working against MSSQL.
     *
     * Note that this hack only must be used if ALL the char-based columns in your DB are of type nchar,
     * nvarchar and ntext
     */
    function _appendN($sql) {

        $result = $sql;

    /// Check we have some single quote in the query. Exit ok.
        if (strpos($sql, SINGLEQUOTE) === false) {
            return $sql;
        }

    /// Check we haven't an odd number of single quotes (this can cause problems below
    /// and should be considered one wrong SQL). Exit with debug info.
        if ((substr_count($sql, SINGLEQUOTE) & 1)) {
            if ($this->debug) {
                ADOConnection::outp("{$this->databaseType} internal transformation: not converted. Wrong number of quotes (odd)");
            }
            return $sql;
        }

    /// Check we haven't any backslash + single quote combination. It should mean wrong
    /// backslashes use (bad magic_quotes_sybase?). Exit with debug info.
        $regexp = '/(\\\\' . SINGLEQUOTE . '[^' . SINGLEQUOTE . '])/';
        if (preg_match($regexp, $sql)) {
            if ($this->debug) {
                ADOConnection::outp("{$this->databaseType} internal transformation: not converted. Found bad use of backslash + single quote");
            }
            return $sql;
        }

    /// Remove pairs of single-quotes
        $pairs = array();
        $regexp = '/(' . SINGLEQUOTE . SINGLEQUOTE . ')/';
        preg_match_all($regexp, $result, $list_of_pairs);
        if ($list_of_pairs) {
            foreach (array_unique($list_of_pairs[0]) as $key=>$value) {
                $pairs['<@#@#@PAIR-'.$key.'@#@#@>'] = $value;
            }
            if (!empty($pairs)) {
                $result = str_replace($pairs, array_keys($pairs), $result);
            }
        }

    /// Remove the rest of literals present in the query
        $literals = array();
        $regexp = '/(N?' . SINGLEQUOTE . '.*?' . SINGLEQUOTE . ')/is';
        preg_match_all($regexp, $result, $list_of_literals);
        if ($list_of_literals) {
            foreach (array_unique($list_of_literals[0]) as $key=>$value) {
                $literals['<#@#@#LITERAL-'.$key.'#@#@#>'] = $value;
            }
            if (!empty($literals)) {
                $result = str_replace($literals, array_keys($literals), $result);
            }
        }

    /// Analyse literals to prepend the N char to them if their contents aren't numeric
        if (!empty($literals)) {
            foreach ($literals as $key=>$value) {
                if (!is_numeric(trim($value, SINGLEQUOTE))) {
                /// Non numeric string, prepend our dear N
                    $literals[$key] = 'N' . trim($value, 'N'); //Trimming potentially existing previous "N"
                }
            }
        }

    /// Re-apply literals to the text
        if (!empty($literals)) {
            $result = str_replace(array_keys($literals), $literals, $result);
        }

    /// Re-apply pairs of single-quotes to the text
        if (!empty($pairs)) {
            $result = str_replace(array_keys($pairs), $pairs, $result);
        }

    /// Print transformation if debug = on
        if ($result != $sql && $this->debug) {
            ADOConnection::outp("{$this->databaseType} internal transformation:
{$sql}
to
{$result}");
        }

        return $result;
    }
}

class ADORecordset_mssql_n extends ADORecordset_mssql {
	var $databaseType = "mssql_n";
	function __construct($id,$mode=false)
	{
		parent::__construct($id,$mode);
	}
}
?>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Jabberwocky.Core.Utils.Reflection;
using Jabberwocky.DependencyInjection.Scanning;
using Jabberwocky.Glass.Autofac.Pipelines.PipelineArgs;
using Jabberwocky.Glass.Autofac.Pipelines.Processors;

namespace Jabberwocky.Glass.Autofac.Pipelines.RegisterAutofacDependencies.Base
{
	public abstract class BaseConfiguredAssemblyProcessor : IProcessor<RegisterAutofacDependenciesPipelineArgs>
	{
		// WebHostAssemblyScanner is required to remain thread-safe when used within a processor like this
		protected static readonly WebHostAssemblyScanner AssemblyScanner = new WebHostAssemblyScanner();

		protected HashSet<string> ConfiguredAssemblies = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);

		public bool IncludeScanAssemblies { get; set; } = true;

		public abstract void Process(RegisterAutofacDependenciesPipelineArgs args);

		public virtual void AddAssembly(string assemblyName)
		{
			string[] matchingAssemblies = assemblyName.Contains("*") ? AssemblyScanner.FindMatchingAssemblyNames($"{assemblyName}.dll") : new [] { assemblyName };
			foreach (string assembly in matchingAssemblies)
			{
				ConfiguredAssemblies.Add(assembly);
			}
		}

		protected virtual string[] GetConfiguredAssemblies(RegisterAutofacDependenciesPipelineArgs args)
		{
			return (IncludeScanAssemblies
				? args.ScanAssemblies.Concat(ConfiguredAssemblies)
				: ConfiguredAssemblies)
					.Distinct(StringComparer.InvariantCultureIgnoreCase)
					.ToArray();
		}

		protected virtual Assembly[] LoadAssemblies(IEnumerable<string> assemblyNames)
		{
			return assemblyNames.Select(TryLoad).Where(a => a != null).ToArray();
		}

		protected Assembly TryLoad(string assemblyName)
		{
			return AssemblyManager.LoadAssemblySafe(assemblyName);
		}
	}
}


text:
#include <stdint.h>

// options to control how Micro Python is built

#define MICROPY_ALLOC_PATH_MAX      (128)
#define MICROPY_EMIT_X64            (0)
#define MICROPY_EMIT_THUMB          (0)
#define MICROPY_EMIT_INLINE_THUMB   (0)
#define MICROPY_MEM_STATS           (0)
#define MICROPY_DEBUG_PRINTERS      (0)
#define MICROPY_ENABLE_GC           (1)
#define MICROPY_STACK_CHECK         (0)
#define MICROPY_REPL_EVENT_DRIVEN   (1)
#define MICROPY_HELPER_REPL         (1)
#define MICROPY_HELPER_LEXER_UNIX   (0)
#define MICROPY_ENABLE_SOURCE_LINE  (1)
#define MICROPY_MODULE_WEAK_LINKS   (1)
#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_BUILTINS_SET     (1)
#define MICROPY_PY_BUILTINS_SLICE   (1)
#define MICROPY_PY_BUILTINS_PROPERTY (1)
#define MICROPY_PY___FILE__         (0)
#define MICROPY_PY_GC               (1)
#define MICROPY_PY_ARRAY            (1)
#define MICROPY_PY_COLLECTIONS      (1)
#define MICROPY_PY_MATH             (0)
#define MICROPY_PY_CMATH            (0)
#define MICROPY_PY_IO               (1)
#define MICROPY_PY_STRUCT           (1)
#define MICROPY_PY_SYS              (1)
#define MICROPY_PY_SYS_EXIT         (1)
#define MICROPY_PY_SYS_STDFILES     (1)
#define MICROPY_CPYTHON_COMPAT      (0)
#define MICROPY_LONGINT_IMPL        (MICROPY_LONGINT_IMPL_LONGLONG)
#define MICROPY_FLOAT_IMPL          (MICROPY_FLOAT_IMPL_NONE)
#define MICROPY_ERROR_REPORTING     (MICROPY_ERROR_REPORTING_TERSE)
#define MICROPY_MODULE_FROZEN       (1)

// type definitions for the specific machine

#define BYTES_PER_WORD (4)

#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p)))

#define UINT_FMT "%u"
#define INT_FMT "%d"

typedef int32_t mp_int_t; // must be pointer size
typedef uint32_t mp_uint_t; // must be pointer size
typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
typedef long mp_off_t;

void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len);
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)

// extra built in names to add to the global namespace
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#define MICROPY_PORT_BUILTINS \
    { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },

// extra built in modules to add to the list of known ones
extern const struct _mp_obj_module_t pyb_module;
extern const struct _mp_obj_module_t esp_module;
extern const struct _mp_obj_module_t network_module;
extern const struct _mp_obj_module_t utime_module;
extern const struct _mp_obj_module_t uos_module;

#define MICROPY_PORT_BUILTIN_MODULES \
    { MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \
    { MP_OBJ_NEW_QSTR(MP_QSTR_esp), (mp_obj_t)&esp_module }, \
    { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&network_module }, \
    { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&utime_module }, \
    { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&uos_module }, \

#define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \
    { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&utime_module }, \
    { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&uos_module }, \

#define MP_STATE_PORT MP_STATE_VM

#define MICROPY_PORT_ROOT_POINTERS \
    const char *readline_hist[8]; \
    \
    /* Singleton instance of scan callback, meaning that there can
       be only one concurrent AP scan. */ \
    mp_obj_t scan_cb_obj; \

// We need to provide a declaration/definition of alloca()
#include <alloca.h>

// board specifics

#define MICROPY_HAL_H "esp_mphal.h"
#define MICROPY_HW_BOARD_NAME "ESP module"
#define MICROPY_HW_MCU_NAME "ESP8266"
#define MICROPY_PY_SYS_PLATFORM "ESP8266"


text:
#define DT_DRV_COMPAT st_stts751

#include <zephyr/kernel.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/logging/log.h>

#include "stts751.h"

LOG_MODULE_DECLARE(STTS751, CONFIG_SENSOR_LOG_LEVEL);

/**
 * stts751_enable_int - enable selected int pin to generate interrupt
 */
static int stts751_enable_int(const struct device *dev, int enable)
{
	struct stts751_data *stts751 = dev->data;
	uint8_t en = (enable) ? 0 : 1;

	return stts751_pin_event_route_set(stts751->ctx, en);
}

/**
 * stts751_trigger_set - link external trigger to event data ready
 */
int stts751_trigger_set(const struct device *dev,
			  const struct sensor_trigger *trig,
			  sensor_trigger_handler_t handler)
{
	struct stts751_data *stts751 = dev->data;
	const struct stts751_config *config = dev->config;

	if (!config->int_gpio.port) {
		return -ENOTSUP;
	}

	if (trig->chan == SENSOR_CHAN_ALL) {
		stts751->thsld_handler = handler;
		if (handler) {
			return stts751_enable_int(dev, 1);
		} else {
			return stts751_enable_int(dev, 0);
		}
	}

	return -ENOTSUP;
}

/**
 * stts751_handle_interrupt - handle the thsld event
 * read data and call handler if registered any
 */
static void stts751_handle_interrupt(const struct device *dev)
{
	struct stts751_data *stts751 = dev->data;
	const struct stts751_config *cfg = dev->config;
	struct sensor_trigger thsld_trigger = {
		.type = SENSOR_TRIG_THRESHOLD,
	};
	stts751_status_t status;

	stts751_status_reg_get(stts751->ctx, &status);

	if (stts751->thsld_handler != NULL &&
	    (status.t_high || status.t_low)) {
		stts751->thsld_handler(dev, &thsld_trigger);
	}

	gpio_pin_interrupt_configure_dt(&cfg->int_gpio, GPIO_INT_EDGE_TO_ACTIVE);
}

static void stts751_gpio_callback(const struct device *dev,
				  struct gpio_callback *cb, uint32_t pins)
{
	struct stts751_data *stts751 =
		CONTAINER_OF(cb, struct stts751_data, gpio_cb);
	const struct stts751_config *cfg = stts751->dev->config;

	ARG_UNUSED(pins);

	gpio_pin_interrupt_configure_dt(&cfg->int_gpio, GPIO_INT_DISABLE);

#if defined(CONFIG_STTS751_TRIGGER_OWN_THREAD)
	k_sem_give(&stts751->gpio_sem);
#elif defined(CONFIG_STTS751_TRIGGER_GLOBAL_THREAD)
	k_work_submit(&stts751->work);
#endif /* CONFIG_STTS751_TRIGGER_OWN_THREAD */
}

#ifdef CONFIG_STTS751_TRIGGER_OWN_THREAD
static void stts751_thread(struct stts751_data *stts751)
{
	while (1) {
		k_sem_take(&stts751->gpio_sem, K_FOREVER);
		stts751_handle_interrupt(stts751->dev);
	}
}
#endif /* CONFIG_STTS751_TRIGGER_OWN_THREAD */

#ifdef CONFIG_STTS751_TRIGGER_GLOBAL_THREAD
static void stts751_work_cb(struct k_work *work)
{
	struct stts751_data *stts751 =
		CONTAINER_OF(work, struct stts751_data, work);

	stts751_handle_interrupt(stts751->dev);
}
#endif /* CONFIG_STTS751_TRIGGER_GLOBAL_THREAD */

int stts751_init_interrupt(const struct device *dev)
{
	struct stts751_data *stts751 = dev->data;
	const struct stts751_config *cfg = dev->config;
	int ret;

	if (!device_is_ready(cfg->int_gpio.port)) {
		LOG_ERR("GPIO device not ready");
		return -ENODEV;
	}

#if defined(CONFIG_STTS751_TRIGGER_OWN_THREAD)
	k_sem_init(&stts751->gpio_sem, 0, K_SEM_MAX_LIMIT);

	k_thread_create(&stts751->thread, stts751->thread_stack,
			CONFIG_STTS751_THREAD_STACK_SIZE,
			(k_thread_entry_t)stts751_thread, stts751,
			NULL, NULL, K_PRIO_COOP(CONFIG_STTS751_THREAD_PRIORITY),
			0, K_NO_WAIT);
#elif defined(CONFIG_STTS751_TRIGGER_GLOBAL_THREAD)
	stts751->work.handler = stts751_work_cb;
#endif /* CONFIG_STTS751_TRIGGER_OWN_THREAD */

	ret = gpio_pin_configure_dt(&cfg->int_gpio, GPIO_INPUT);
	if (ret < 0) {
		LOG_DBG("Could not configure gpio");
		return ret;
	}

	gpio_init_callback(&stts751->gpio_cb, stts751_gpio_callback, BIT(cfg->int_gpio.pin));

	if (gpio_add_callback(cfg->int_gpio.port, &stts751->gpio_cb) < 0) {
		LOG_DBG("Could not set gpio callback");
		return -EIO;
	}

	/* Enable interrupt on high temperature */
	float temp_hi = (float) CONFIG_STTS751_TEMP_HI_THRESHOLD;
	float temp_lo = (float) CONFIG_STTS751_TEMP_LO_THRESHOLD;

	stts751_high_temperature_threshold_set(stts751->ctx,
					stts751_from_celsius_to_lsb(temp_hi));

	stts751_low_temperature_threshold_set(stts751->ctx,
					stts751_from_celsius_to_lsb(temp_lo));

	return gpio_pin_interrupt_configure_dt(&cfg->int_gpio, GPIO_INT_EDGE_TO_ACTIVE);
}


text:
package org.mp4parser.muxer;

import org.mp4parser.support.Logger;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.WritableByteChannel;

import static org.mp4parser.tools.CastUtils.l2i;

public class FileDataSourceViaHeapImpl implements DataSource {
    private static Logger LOG = Logger.getLogger(FileDataSourceViaHeapImpl.class);
    FileChannel fc;
    String filename;

    public FileDataSourceViaHeapImpl(File f) throws FileNotFoundException {
        this.fc = new FileInputStream(f).getChannel();
        this.filename = f.getName();
    }

    public FileDataSourceViaHeapImpl(String f) throws FileNotFoundException {
        File file = new File(f);
        this.fc = new FileInputStream(file).getChannel();
        this.filename = file.getName();
    }

    public FileDataSourceViaHeapImpl(FileChannel fc) {
        this.fc = fc;
        this.filename = "unknown";
    }

    public FileDataSourceViaHeapImpl(FileChannel fc, String filename) {
        this.fc = fc;
        this.filename = filename;
    }

    public synchronized int read(ByteBuffer byteBuffer) throws IOException {
        return fc.read(byteBuffer);
    }

    public synchronized long size() throws IOException {
        return fc.size();
    }

    public synchronized long position() throws IOException {
        return fc.position();
    }

    public synchronized void position(long nuPos) throws IOException {
        fc.position(nuPos);
    }

    public synchronized long transferTo(long startPosition, long count, WritableByteChannel sink) throws IOException {
        return fc.transferTo(startPosition, count, sink);
    }

    public synchronized ByteBuffer map(long startPosition, long size) throws IOException {
        ByteBuffer bb = ByteBuffer.allocate(l2i(size));
        fc.read(bb, startPosition);
        return (ByteBuffer) bb.rewind();
    }

    public void close() throws IOException {
        fc.close();
    }

    @Override
    public String toString() {
        return filename;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 317865 $ -->

<refentry xml:id="mysqlnduhconnection.listmethod" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>MysqlndUhConnection::listMethod</refname>
  <refpurpose>Wrapper for assorted list commands</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>void</type><methodname>MysqlndUhConnection::listMethod</methodname>
   <methodparam><type>mysqlnd_connection</type><parameter>connection</parameter></methodparam>
   <methodparam><type>string</type><parameter>query</parameter></methodparam>
   <methodparam><type>string</type><parameter>achtung_wild</parameter></methodparam>
   <methodparam><type>string</type><parameter>par1</parameter></methodparam>
  </methodsynopsis>
  <para>
   Wrapper for assorted list commands.
  </para>

  &warn.undocumented.func;

 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>connection</parameter></term>
    <listitem>
     <para>
      Mysqlnd connection handle. Do not modify!
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>query</parameter></term>
    <listitem>
     <para>
      SHOW command to be executed.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>achtung_wild</parameter></term>
    <listitem>
     <para>

     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>par1</parameter></term>
    <listitem>
     <para>

     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>

  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   TODO
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>MysqlndUhConnection::listMethod</function> example</title>
        <programlisting role="php">
<![CDATA[
<?php
class proxy extends MysqlndUhConnection {
 public function listMethod($res, $query, $pattern, $par1) {
  printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
  $ret = parent::listMethod($res, $query, $pattern, $par1);
  printf("%s returns %s\n", __METHOD__, var_export($ret, true));
  return $ret;
 }
}
mysqlnd_uh_set_connection_proxy(new proxy());

$mysql = mysql_connect("localhost", "root", "");
$res = mysql_list_dbs($mysql);
printf("num_rows = %d\n", mysql_num_rows($res));
while ($row = mysql_fetch_assoc($res))
 var_dump($row);
?>
]]>
    </programlisting>
    &example.outputs;
    <screen>
<![CDATA[
proxy::listMethod(array (
  0 => NULL,
  1 => 'SHOW DATABASES',
  2 => '',
  3 => '',
))
proxy::listMethod returns NULL
num_rows = 6
array(1) {
  ["Database"]=>
  string(18) "information_schema"
}
array(1) {
  ["Database"]=>
  string(5) "mysql"
}
array(1) {
  ["Database"]=>
  string(8) "oxid_new"
}
array(1) {
  ["Database"]=>
  string(7) "phptest"
}
array(1) {
  ["Database"]=>
  string(7) "pushphp"
}
array(1) {
  ["Database"]=>
  string(4) "test"
}
]]>
    </screen>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member>
     <function>mysqlnd_uh_set_connection_proxy</function>
    </member>
    <member>
     <function>mysql_list_dbs</function>
    </member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
package org.lwjgl.util.harfbuzz;

import javax.annotation.*;

import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;

/**
 *
Type

 *
 *

 * hb_bool_t (*{@link #invoke}) (
 *     hb_font_t *font,
 *     void *font_data,
 *     hb_codepoint_t glyph,
 *     hb_position_t *x,
 *     hb_position_t *y,
 *     void *user_data
 * )

 */
public abstract class hb_font_get_glyph_origin_func_t extends Callback implements hb_font_get_glyph_origin_func_tI {

    /**
     * Creates a {@code hb_font_get_glyph_origin_func_t} instance from the specified function pointer.
     *
     * @return the new {@code hb_font_get_glyph_origin_func_t}
     */
    public static hb_font_get_glyph_origin_func_t create(long functionPointer) {
        hb_font_get_glyph_origin_func_tI instance = Callback.get(functionPointer);
        return instance instanceof hb_font_get_glyph_origin_func_t
            ? (hb_font_get_glyph_origin_func_t)instance
            : new Container(functionPointer, instance);
    }

    /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
    @Nullable
    public static hb_font_get_glyph_origin_func_t createSafe(long functionPointer) {
        return functionPointer == NULL ? null : create(functionPointer);
    }

    /** Creates a {@code hb_font_get_glyph_origin_func_t} instance that delegates to the specified {@code hb_font_get_glyph_origin_func_tI} instance. */
    public static hb_font_get_glyph_origin_func_t create(hb_font_get_glyph_origin_func_tI instance) {
        return instance instanceof hb_font_get_glyph_origin_func_t
            ? (hb_font_get_glyph_origin_func_t)instance
            : new Container(instance.address(), instance);
    }

    protected hb_font_get_glyph_origin_func_t() {
        super(CIF);
    }

    hb_font_get_glyph_origin_func_t(long functionPointer) {
        super(functionPointer);
    }

    private static final class Container extends hb_font_get_glyph_origin_func_t {

        private final hb_font_get_glyph_origin_func_tI delegate;

        Container(long functionPointer, hb_font_get_glyph_origin_func_tI delegate) {
            super(functionPointer);
            this.delegate = delegate;
        }

        @Override
        public int invoke(long font, long font_data, int glyph, long x, long y, long user_data) {
            return delegate.invoke(font, font_data, glyph, x, y, user_data);
        }

    }

}


text:
package com.intellij.codeInsight.actions;

import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.SelectionModel;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.arrangement.Rearranger;
import com.intellij.psi.codeStyle.arrangement.engine.ArrangementEngine;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class RearrangeCodeProcessor extends AbstractLayoutCodeProcessor {

  public static final String COMMAND_NAME = "Rearrange code";
  public static final String PROGRESS_TEXT = "Rearranging code...";

  @Nullable private SelectionModel mySelectionModel;

  public RearrangeCodeProcessor(@NotNull AbstractLayoutCodeProcessor previousProcessor) {
    super(previousProcessor, COMMAND_NAME, PROGRESS_TEXT);
  }

  public RearrangeCodeProcessor(@NotNull AbstractLayoutCodeProcessor previousProcessor, @NotNull SelectionModel selectionModel) {
    super(previousProcessor, COMMAND_NAME, PROGRESS_TEXT);
    mySelectionModel = selectionModel;
  }

  public RearrangeCodeProcessor(@NotNull Project project,
                                @NotNull PsiFile file,
                                @Nullable SelectionModel selectionModel) {
    super(project, file, PROGRESS_TEXT, COMMAND_NAME, false);
    mySelectionModel = selectionModel;
  }

  public RearrangeCodeProcessor(@NotNull Project project,
                                @NotNull PsiFile[] files,
                                @NotNull String commandName,
                                @Nullable Runnable postRunnable) {
    super(project, files, PROGRESS_TEXT, commandName, postRunnable, false);
  }

  @NotNull
  @Override
  protected FutureTask<Boolean> prepareTask(@NotNull final PsiFile file, final boolean processChangedTextOnly) {
    return new FutureTask<Boolean>(new Callable<Boolean>() {
      @Override
      public Boolean call() throws Exception {
        Collection<TextRange> ranges = processChangedTextOnly ? FormatChangedTextUtil.getChangedTextRanges(myProject, file)
                                                              : getRangesToFormat(file);

        RearrangeCommand rearranger = new RearrangeCommand(myProject, file, COMMAND_NAME, ranges);
        if (rearranger.couldRearrange()) {
          rearranger.run();
        }
        return true;
      }
    });
  }

  public Collection<TextRange> getRangesToFormat(@NotNull PsiFile file) {
    final List<TextRange> ranges = new SmartList<TextRange>();
    if (mySelectionModel != null && mySelectionModel.hasSelection()) {
      ranges.add(TextRange.create(mySelectionModel.getSelectionStart(), mySelectionModel.getSelectionEnd()));
    }
    else {
      ranges.add(TextRange.create(0, file.getTextLength()));
    }
    return ranges;
  }
}

class RearrangeCommand {
  @NotNull private PsiFile myFile;
  @NotNull private String myCommandName;
  @NotNull private Project myProject;
  private Document myDocument;
  private Runnable myCommand;
  private final Collection<TextRange> myRanges;

  RearrangeCommand(@NotNull Project project, @NotNull PsiFile file, @NotNull String commandName, @NotNull Collection<TextRange> ranges) {
    myProject = project;
    myFile = file;
    myRanges = ranges;
    myCommandName = commandName;
    myDocument = PsiDocumentManager.getInstance(project).getDocument(file);
  }

  boolean couldRearrange() {
    return myDocument != null && Rearranger.EXTENSION.forLanguage(myFile.getLanguage()) != null;
  }

  void run() {
    assert myDocument != null;
    prepare();
    try {
      CommandProcessor.getInstance().executeCommand(myProject, myCommand, myCommandName, null);
    }
    finally {
      PsiDocumentManager.getInstance(myProject).commitDocument(myDocument);
    }
  }

  private void prepare() {
    final ArrangementEngine engine = ServiceManager.getService(myProject, ArrangementEngine.class);
    myCommand = new Runnable() {
      @Override
      public void run() {
        engine.arrange(myFile, myRanges);
      }
    };
    PsiDocumentManager.getInstance(myProject).doPostponedOperationsAndUnblockDocument(myDocument);
  }
}


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

<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
edu.berkeley.nlp.lm.cache Class Hierarchy
</TITLE>

<META NAME="date" CONTENT="2014-12-06">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Hierarchy For Package edu.berkeley.nlp.lm.cache

Package Hierarchies:
All Packages

Class Hierarchy

java.lang.Object

edu.berkeley.nlp.lm.AbstractNgramLanguageModel<W> (implements edu.berkeley.nlp.lm.NgramLanguageModel<W>, java.io.Serializable)

edu.berkeley.nlp.lm.AbstractArrayEncodedNgramLanguageModel<W> (implements edu.berkeley.nlp.lm.ArrayEncodedNgramLanguageModel<W>, java.io.Serializable)

edu.berkeley.nlp.lm.cache.ArrayEncodedCachingLmWrapper<W>

edu.berkeley.nlp.lm.AbstractContextEncodedNgramLanguageModel<W> (implements edu.berkeley.nlp.lm.ContextEncodedNgramLanguageModel<W>, java.io.Serializable)

edu.berkeley.nlp.lm.cache.ContextEncodedCachingLmWrapper<T>

edu.berkeley.nlp.lm.cache.ArrayEncodedDirectMappedLmCache (implements edu.berkeley.nlp.lm.cache.ArrayEncodedLmCache)

edu.berkeley.nlp.lm.cache.ContextEncodedDirectMappedLmCache (implements edu.berkeley.nlp.lm.cache.ContextEncodedLmCache)

Interface Hierarchy

java.io.Serializable

edu.berkeley.nlp.lm.cache.ArrayEncodedLmCache
edu.berkeley.nlp.lm.cache.ContextEncodedLmCache

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
Object.defineProperty(exports,"__esModule",{value:true});

var _graphqlRelay=require('graphql-relay');
var _graphql=require('graphql');

var _Agent=require('../model/Agent');var _Agent2=_interopRequireDefault(_Agent);
var _NodeInterface=require('../../../../units/urb-base-server/graphql/NodeInterface');var _NodeInterface2=_interopRequireDefault(_NodeInterface);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}exports.default=

new _graphql.GraphQLObjectType({
name:'Agent',

interfaces:[_NodeInterface2.default],

isTypeOf:function isTypeOf(object){return object instanceof _Agent2.default;},

fields:{
id:(0,_graphqlRelay.globalIdField)(function(obj){return obj.UserId;}),
FirstName:{
type:_graphql.GraphQLString,
resolve:function resolve(obj){
return obj.FirstName;
}},

LastName:{type:_graphql.GraphQLString,resolve:function resolve(obj){return obj.LastName;}},
UserId:{type:_graphql.GraphQLString,resolve:function resolve(obj){return obj.UserId;}}}});
//# sourceMappingURL=AgentType.js.map


text:
#ifndef _CRAM_STATS_H_
#define _CRAM_STATS_H_

#ifdef __cplusplus
extern "C" {
#endif

cram_stats *cram_stats_create(void);
void cram_stats_add(cram_stats *st, int32_t val);
void cram_stats_del(cram_stats *st, int32_t val);
void cram_stats_dump(cram_stats *st);
void cram_stats_free(cram_stats *st);

/*
 * Computes entropy from integer frequencies for various encoding methods and
 * picks the best encoding.
 *
 * FIXME: we could reuse some of the code here for the actual encoding
 * parameters too. Eg the best 'k' for SUBEXP or the code lengths for huffman.
 *
 * Returns the best codec to use.
 */
enum cram_encoding cram_stats_encoding(cram_fd *fd, cram_stats *st);

#ifdef __cplusplus
}
#endif

#endif


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee18e23d365">
<name type="corporate">
 <namePart>United States Government Publishing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">publisher</roleTerm>
  <roleTerm type="code" authority="marcrelator">pbl</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Eastern District of California</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2015-12-15</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2015-12-14</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226</identifier>
<identifier type="local">P0b002ee18e23d365</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2015-12-15</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2015-12-15</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-caed-2_14-cr-00226</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-caed-2_14-cr-00226</accessId>
 <courtType>District</courtType>
 <courtCode>caed</courtCode>
 <courtCircuit>9th</courtCircuit>
 <courtState>California</courtState>
 <courtSortOrder>2061</courtSortOrder>
 <caseNumber>2:14-cr-00226</caseNumber>
 <caseOffice>Sacramento</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="George" fullName="George Hristovski" lastName="Hristovski" role="Defendant"></party>
 <party fullName="USA" lastName="USA" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>USA v. Hristovski</title>
 <partNumber>2:14-cr-00226</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">2:14-cr-00226;14-226</identifier>
<name type="corporate">
 <namePart>United States District Court Eastern District of California</namePart>
 <namePart>9th Circuit</namePart>
 <namePart>Sacramento</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>George Hristovski</displayForm>
 <namePart type="family">Hristovski</namePart>
 <namePart type="given">George</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>USA</displayForm>
 <namePart type="family">USA</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-caed-2_14-cr-00226</accessId>
 <courtType>District</courtType>
 <courtCode>caed</courtCode>
 <courtCircuit>9th</courtCircuit>
 <courtState>California</courtState>
 <courtSortOrder>2061</courtSortOrder>
 <caseNumber>2:14-cr-00226</caseNumber>
 <caseOffice>Sacramento</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="George" fullName="George Hristovski" lastName="Hristovski" role="Defendant"></party>
 <party fullName="USA" lastName="USA" role="Plaintiff"></party>
 <state>California</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-0" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-0/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>DETENTION ORDER as to George Hristovski signed by Magistrate Judge Dale A. Drozd on 8/5/2014. (Zignago, K.)[2:14-mj-00166-DAD]</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2014-08-05</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-0.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae81</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-0</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2014-08-05</dateIssued>
  <docketText>DETENTION ORDER as to George Hristovski signed by Magistrate Judge Dale A. Drozd on 8/5/2014. (Zignago, K.)[2:14-mj-00166-DAD]</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-1" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-1/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>STIPULATION and ORDER signed by Judge John A. Mendez on 10/2/14 ORDERING the Status Conference RESET to 11/18/14 at 09:30 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 10/2/14 Stop: 11/18/14. (Becknal, R)</subTitle>
  <partNumber>1</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2014-10-02</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-1.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae7f</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-1</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_1.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-1/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-1.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-1</accessId>
  <sequenceNumber>1</sequenceNumber>
  <dateIssued>2014-10-02</dateIssued>
  <docketText>STIPULATION and ORDER signed by Judge John A. Mendez on 10/2/14 ORDERING the Status Conference RESET to 11/18/14 at 09:30 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 10/2/14 Stop: 11/18/14. (Becknal, R)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-2" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-2/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>ORDER signed by Judge John A. Mendez on November 17, 2014 as to defendant George Hristovski re 13. The Status Conference set for 11/18/2014 is CONTINUED TO 1/6/2015 at 09:30 AM in Courtroom 6 (JAM) before Judge John A. Mendez. **Excludable started as to George Hristovski: Excludable T4 Start: 11/17/2014 Stop: 01/06/2015. (Rivas, A)</subTitle>
  <partNumber>2</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2014-11-17</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-2.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae7b</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-2</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_2.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-2/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-2.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-2</accessId>
  <sequenceNumber>2</sequenceNumber>
  <dateIssued>2014-11-17</dateIssued>
  <docketText>ORDER signed by Judge John A. Mendez on November 17, 2014 as to defendant George Hristovski re 13. The Status Conference set for 11/18/2014 is CONTINUED TO 1/6/2015 at 09:30 AM in Courtroom 6 (JAM) before Judge John A. Mendez. **Excludable started as to George Hristovski: Excludable T4 Start: 11/17/2014 Stop: 01/06/2015. (Rivas, A)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-3" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-3/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>ORDER APPONTING COUNSEL signed by Magistrate Judge Carolyn K. Delaney on 12/4/2014 ORDERING attorney Michael L. Chastaine is appointed effective 12/3/2014 for George Hristovski. (Zignago, K.)</subTitle>
  <partNumber>3</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2014-12-04</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-3.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae80</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-3</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_3.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-3/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-3.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-3</accessId>
  <sequenceNumber>3</sequenceNumber>
  <dateIssued>2014-12-04</dateIssued>
  <docketText>ORDER APPONTING COUNSEL signed by Magistrate Judge Carolyn K. Delaney on 12/4/2014 ORDERING attorney Michael L. Chastaine is appointed effective 12/3/2014 for George Hristovski. (Zignago, K.)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-4" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-4/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>STIPULATION and ORDER signed by Judge John A. Mendez on 1/2/15 as to George Hristovski: Status Conference RESET for 3/10/2015 at 09:30 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started: T-4 Start: 1/6/15 Stop: 3/10/15. (Kaminski, H)</subTitle>
  <partNumber>4</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2015-01-05</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-4.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae7c</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-4</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_4.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-4/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-4.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-4</accessId>
  <sequenceNumber>4</sequenceNumber>
  <dateIssued>2015-01-05</dateIssued>
  <docketText>STIPULATION and ORDER signed by Judge John A. Mendez on 1/2/15 as to George Hristovski: Status Conference RESET for 3/10/2015 at 09:30 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started: T-4 Start: 1/6/15 Stop: 3/10/15. (Kaminski, H)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-5" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-5/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>STIPULATION and ORDER as to George Hristovski signed by Judge John A. Mendez on 5/4/2015 ORDERING that the Status Conference is CONTINUED to 6/16/2015 at 09:15 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 5/5/2015 Stop: 6/16/2015. (Zignago, K.)</subTitle>
  <partNumber>5</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2015-05-04</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-5.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae7e</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-5</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_5.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-5/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-5.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-5</accessId>
  <sequenceNumber>5</sequenceNumber>
  <dateIssued>2015-05-04</dateIssued>
  <docketText>STIPULATION and ORDER as to George Hristovski signed by Judge John A. Mendez on 5/4/2015 ORDERING that the Status Conference is CONTINUED to 6/16/2015 at 09:15 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 5/5/2015 Stop: 6/16/2015. (Zignago, K.)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-6" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-6/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>STIPULATION and ORDER as to George Hristovski signed by Judge John A. Mendez on 11/12/2015 ORDERING that the Status Conference is CONTINUED to 12/15/2015 at 09:15 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 11/17/2015 Stop: 12/15/2015. (Zignago, K.)</subTitle>
  <partNumber>6</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2015-11-13</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-6.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae7a</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-6</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_6.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-6/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-6.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-6</accessId>
  <sequenceNumber>6</sequenceNumber>
  <dateIssued>2015-11-13</dateIssued>
  <docketText>STIPULATION and ORDER as to George Hristovski signed by Judge John A. Mendez on 11/12/2015 ORDERING that the Status Conference is CONTINUED to 12/15/2015 at 09:15 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 11/17/2015 Stop: 12/15/2015. (Zignago, K.)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-2_14-cr-00226-7" xlink:href="https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-7/mods.xml">
 <titleInfo>
  <title>USA v. Hristovski</title>
  <subTitle>STIPULATION and ORDER as to George Hristovski signed by Judge John A. Mendez on 12/11/2015 ORDERING that the Status Conference is CONTINUED to 1/12/2016 at 09:15 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 12/15/2015 Stop: 1/12/2016. (Zignago, K.)</subTitle>
  <partNumber>7</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2015-12-14</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-7.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e24ae7d</identifier>
</relatedItem>
 <identifier type="uri">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-7</identifier>
 <identifier type="former granule identifier">caed-2_14-cr-00226_7.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">https://www.gpo.gov/fdsys/granule/USCOURTS-caed-2_14-cr-00226/USCOURTS-caed-2_14-cr-00226-7/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">https://www.gpo.gov/fdsys/pkg/USCOURTS-caed-2_14-cr-00226/pdf/USCOURTS-caed-2_14-cr-00226-7.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:14-cr-00226; USA v. Hristovski; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-2_14-cr-00226-7</accessId>
  <sequenceNumber>7</sequenceNumber>
  <dateIssued>2015-12-14</dateIssued>
  <docketText>STIPULATION and ORDER as to George Hristovski signed by Judge John A. Mendez on 12/11/2015 ORDERING that the Status Conference is CONTINUED to 1/12/2016 at 09:15 AM in Courtroom 6 (JAM) before Judge John A. Mendez. Excludable started as to George Hristovski: T4 Start: 12/15/2015 Stop: 1/12/2016. (Zignago, K.)</docketText>
</extension>
</relatedItem>
</mods>


text:
function Cell_Ouput=Standard_Normalize_By_Column(Cell_Input)
% the input cell has 2 elements, label and feature vector. Normalize
% vectors by column

N=size(Cell_Input,1);
Feature_Dimension=size(Cell_Input{1,2},2);
Feature_Matrix=zeros(N,Feature_Dimension);
for i=1:N
    Feature_Matrix(i,:)=Cell_Input{i,2};
end

Cell_Ouput=cell(N,2);

Mean=mean(Feature_Matrix);
Std=std(Feature_Matrix);
for i=1:N
    for j=1:Feature_Dimension
        if Feature_Matrix(i,j)~=0
            Feature_Matrix(i,j)=(Feature_Matrix(i,j)-Mean(j))/Std(j);
        end
    end
    Cell_Ouput{i,1}=Cell_Input{i,1};
    Cell_Ouput{i,2}=Feature_Matrix(i,:);
end


text:
package ch.qos.logback.classic.joran.action;

import org.xml.sax.Attributes;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.net.SocketAppender;
import ch.qos.logback.core.joran.action.Action;
import ch.qos.logback.core.joran.spi.ActionException;
import ch.qos.logback.core.joran.spi.InterpretationContext;

public class ConsolePluginAction extends Action {

  private static final String PORT_ATTR = "port";
  private static final Integer DEFAULT_PORT = 4321;

  @Override
  public void begin(InterpretationContext ec, String name, Attributes attributes)
      throws ActionException {
    String portStr = attributes.getValue(PORT_ATTR);
    Integer port = null;

    if (portStr == null) {
      port = DEFAULT_PORT;
    } else {
      try {
        port = Integer.valueOf(portStr);
      } catch (NumberFormatException ex) {
        addError("Port " + portStr
            + " in ConsolePlugin config is not a correct number");
      }
    }

    LoggerContext lc = (LoggerContext)ec.getContext();
    SocketAppender appender = new SocketAppender();
    appender.setContext(lc);
    appender.setIncludeCallerData(true);
    appender.setRemoteHost("localhost");
    appender.setPort(port.intValue());
    appender.start();
    Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
    root.addAppender(appender);

    addInfo("Sending LoggingEvents to the plugin using port " + port);
  }

  @Override
  public void end(InterpretationContext ec, String name) throws ActionException {

  }
}


text:
package uk.nhs.hdn.crds.registry.domain.metadata;

import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import uk.nhs.hdn.common.naming.Description;
import uk.nhs.hdn.common.serialisers.separatedValues.SeparatedValueSerialiser;
import uk.nhs.hdn.crds.registry.domain.identifiers.*;

import java.util.UUID;

import static java.util.Locale.UK;
import static uk.nhs.hdn.crds.registry.domain.metadata.ProviderMetadataRecord.csvSerialiserForProviderMetadataRecords;
import static uk.nhs.hdn.crds.registry.domain.metadata.ProviderMetadataRecord.tsvSerialiserForProviderMetadataRecords;
import static uk.nhs.hdn.crds.registry.domain.metadata.RepositoryMetadataRecord.csvSerialiserForRepositoryMetadataRecords;
import static uk.nhs.hdn.crds.registry.domain.metadata.RepositoryMetadataRecord.tsvSerialiserForRepositoryMetadataRecords;
import static uk.nhs.hdn.crds.registry.domain.metadata.StuffMetadataRecord.csvSerialiserForStuffMetadataRecords;
import static uk.nhs.hdn.crds.registry.domain.metadata.StuffMetadataRecord.tsvSerialiserForStuffMetadataRecords;

public enum IdentifierConstructor implements Description
{
	provider("Provider Identifier UUID")
	{
		@NotNull
		@Override
		public Identifier construct(@NonNls @NotNull final UUID uuid)
		{
			return new ProviderIdentifier(uuid);
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser tsvSerialiser()
		{
			return tsvSerialiserForProviderMetadataRecords();
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser csvSerialiser(final boolean writeHeaderLine)
		{
			return csvSerialiserForProviderMetadataRecords(writeHeaderLine);
		}
	},
	repository("Repository Identifier UUID")
	{
		@NotNull
		@Override
		public Identifier construct(@NonNls @NotNull final UUID uuid)
		{
			return new RepositoryIdentifier(uuid);
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser tsvSerialiser()
		{
			return tsvSerialiserForRepositoryMetadataRecords();
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser csvSerialiser(final boolean writeHeaderLine)
		{
			return csvSerialiserForRepositoryMetadataRecords(writeHeaderLine);
		}
	},
	stuff("Stuff Identifier UUID")
	{
		@NotNull
		@Override
		public Identifier construct(@NonNls @NotNull final UUID uuid)
		{
			return new StuffIdentifier(uuid);
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser tsvSerialiser()
		{
			return tsvSerialiserForStuffMetadataRecords();
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser csvSerialiser(final boolean writeHeaderLine)
		{
			return csvSerialiserForStuffMetadataRecords(writeHeaderLine);
		}
	},
	stuff_event("Stuff Event Identifier UUID")
	{
		@NotNull
		@Override
		public Identifier construct(@NonNls @NotNull final UUID uuid)
		{
			return new StuffEventIdentifier(uuid);
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser tsvSerialiser()
		{
			throw new UnsupportedOperationException();
		}

		@NotNull
		@Override
		public SeparatedValueSerialiser csvSerialiser(final boolean writeHeaderLine)
		{
			throw new UnsupportedOperationException();
		}
	}
	;

	@NotNull private final String description;

	IdentifierConstructor(@NotNull @NonNls final String description)
	{
		this.description = description;
	}

	@NotNull
	public Identifier construct(@NonNls @NotNull final String uuid)
	{
		return construct(UUID.fromString(uuid));
	}

	@NotNull
	public String restName()
	{
		return name().toLowerCase(UK);
	}

	@NotNull
	public abstract Identifier construct(@NotNull final UUID uuid);

	@NotNull
	public abstract SeparatedValueSerialiser tsvSerialiser();

	@NotNull
	public abstract SeparatedValueSerialiser csvSerialiser(final boolean writeHeaderLine);

	@NotNull
	@Override
	public String description()
	{
		return description;
	}
}


text:
package com.tqmars.cardrecycle.application.base;

/**
 * Created by jjh on 1/15/17.
 */
public abstract class BaseDto {

    public abstract Result validate();

    public static class Result{
        private String msg;
        private boolean success;

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public boolean isSuccess() {
            return success;
        }

        public void setSuccess(boolean success) {
            this.success = success;
        }
    }

}


text:
/*
    Calculate surface area of the house to be painted
 */
package surfacearea;
import java.util.Scanner;

/**
 *
 * @author whitehat
 */
public class SurfaceArea {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // set the values front and sides
        double front_length, front_height, side_length, side_height;
        double all_area, pain_free_area, coverage_area;

        // Ask user for inputs
        Scanner in = new Scanner(System.in);
        // Coverage Area of 1 gallon of pain
        System.out.println("Enter front length: ");
        front_length = in.nextDouble();
        System.out.println("Enter front height: ");
        front_height = in.nextDouble();
        System.out.println("Enter side_length: ");
        side_length = in.nextDouble();
        System.out.println("Enter side height: ");
        side_height = in.nextDouble();

        all_area = (front_length * front_height * 2) +
                   (side_length * side_height * 2);

        System.out.print(args);
        System.out.printf("The total area coverage is: %5.2f", all_area);

    }

}

/*
Expressions:
- add, concatenate, *, /, % (modular/remainder)
area = Math.PI * radius * radius
c = Math.sqrt(a*a + b*b)
- boolean - true/false

Desisions:
- Relational operators: <, <=, >, >=, ==, !=
- Logical operators: &&, ||, if, else:
    >> if (outsideTemp < 32) {System.out.println("")} else {System.out.println()}
*/


text:
package istc.bigdawg.executor;

import istc.bigdawg.query.ConnectionInfo;

public class IslandQueryResult implements QueryResult {

	private ConnectionInfo ci;

	public IslandQueryResult(ConnectionInfo ci) {
		this.ci = ci;
	}

	@Override
	public String toPrettyString() {
		return "Island Result placeholder; connection info: "+ci.toSimpleString();
	}

	@Override
	public ConnectionInfo getConnectionInfo() {
		return ci;
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

		<title>
			HTTP Code: 422: Unprocessable Entity
		</title>
		<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" type="text/css">

					HTTP Code

About

					<form class="navbar-form navbar-left" action="/go">
						<input type="text" name="code" class="form-control col-lg-8" placeholder="search codes (e.g. 203)">
					</form>

Fork on GitHub

Sponsored by Bluetoo

422: Unprocessable Entity

   The 422 (Unprocessable Entity) status code means the server
   understands the content type of the request entity (hence a
   415(Unsupported Media Type) status code is inappropriate), and the
   syntax of the request entity is correct (thus a 400 (Bad Request)
   status code is inappropriate) but was unable to process the contained
   instructions.  For example, this error condition may occur if an XML
   request body contains well-formed (i.e., syntactically correct), but
   semantically erroneous, XML instructions.

Quick Reference

With cURL:

~$ curl http://httpcode.info/422

Shell Command

~$ http 422

Add this to your shell's .rc file:

function http(){
    curl http://httpcode.info/$1;
}

Copyright (c) 2014 Thaddeus Ternes. Powered by the Yeti theme.


text:
<?php

namespace Page\Store;

use Page\PageTrait;
use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

class Success extends Page
{
    use PageTrait;

    protected $path = '/checkout/onepage/success';

    protected $elements = [
        'create-account-btn' => ['css' => 'input[type="submit"]'],
    ];

    /**
     * @return bool
     */
    public function createAccountButtonIsVisible()
    {
        $createAccount = $this->getElementWithWait('create-account-btn', 30000);
        return ($createAccount !== null) && $createAccount->isVisible();
    }

    /**
     * @throws \Exception
     */
    public function clickCreateAccount()
    {
        if (!$this->createAccountButtonIsVisible()) {
            throw new \Exception('Create account button is not existent or visible');
        }

        $this->getElement('create-account-btn')->click();
        $this->waitForAjaxRequestsToComplete();
    }
}