text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
using Microsoft.Extensions.ProjectModel.Graph;
using NuGet;
using NuGet.Frameworks;

namespace Microsoft.Extensions.ProjectModel.Resolution
{
    public class ProjectDependencyProvider
    {
        public ProjectDescription GetDescription(string name, string path, LockFileTargetLibrary targetLibrary)
        {
            Project project;

            // Can't find a project file with the name so bail
            if (!ProjectReader.TryGetProject(path, out project))
            {
                return new ProjectDescription(name, path);
            }

            return GetDescription(targetLibrary.TargetFramework, project);
        }

        public ProjectDescription GetDescription(NuGetFramework targetFramework, Project project)
        {
            // This never returns null
            var targetFrameworkInfo = project.GetTargetFramework(targetFramework);
            var targetFrameworkDependencies = new List<LibraryRange>(targetFrameworkInfo.Dependencies);

            if (targetFramework != null && targetFramework.IsDesktop())
            {
                targetFrameworkDependencies.Add(new LibraryRange("mscorlib", LibraryType.ReferenceAssembly));

                targetFrameworkDependencies.Add(new LibraryRange("System", LibraryType.ReferenceAssembly));

                if (targetFramework.Version >= new Version(3, 5))
                {
                    targetFrameworkDependencies.Add(new LibraryRange("System.Core", LibraryType.ReferenceAssembly));

                    if (targetFramework.Version >= new Version(4, 0))
                    {
                        targetFrameworkDependencies.Add(new LibraryRange("Microsoft.CSharp", LibraryType.ReferenceAssembly));
                    }
                }
            }

            var dependencies = project.Dependencies.Concat(targetFrameworkDependencies).ToList();

            // Mark the library as unresolved if there were specified frameworks
            // and none of them resolved
            bool unresolved = targetFrameworkInfo.FrameworkName == null;

            return new ProjectDescription(
                new LibraryRange(project.Name, LibraryType.Unspecified),
                project,
                dependencies,
                targetFrameworkInfo,
                !unresolved);
        }
    }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Lindera grandifolia Stapf

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package wint.mvc.form.runtime;

import java.util.Collections;
import java.util.Map;

import wint.lang.utils.MapUtil;
import wint.mvc.flow.InnerFlowData;
import wint.mvc.form.Form;

/**
 * @author pister
 * 2012-2-12 01:58:55
 */
public class InputFormFactory implements FormFactory {

	private InnerFlowData flowData;

	private Map<String, RunTimeForm> resultForms = MapUtil.newHashMap();

	public InputFormFactory(InnerFlowData flowData) {
		super();
		this.flowData = flowData;
	}

	public RunTimeForm getForm(String name) {
		RunTimeForm resultForm = resultForms.get(name);
		if (resultForm != null) {
			return resultForm;
		}
		Form form = flowData.getForm(name);
		return new DefaultRunTimeForm(form);
	}

    public Map<String, RunTimeForm> getForms() {
        return Collections.unmodifiableMap(resultForms);
    }

	public void addResultForm(String name, RunTimeForm runTimeForm) {
		resultForms.put(name, runTimeForm);
	}

    public RunTimeForm getResultForm(String name) {
        return resultForms.get(name);
    }

	public void removeResultForm(String name) {
		resultForms.remove(name);
	}

}


text:
layout: post
title: PostgreSQL References
categories: [database]
tags: [sql, db]
description: the collection of PostgreSQL relate articles.
---

## Administration

* [Backup and Restore](http://www.postgresql.org/docs/8.1/static/backup.html)
* Logging
  * [How to log all sql statements in Postgresql running](http://www.rhyous.com/2010/09/10/how-to-log-all-sql-statements-in-postgresql-running-on-freebsd/)

## Use Cases

* [Uber Engineering Moving from Postgres to MySQL](https://www.infoq.com/news/2016/08/Uber-Engineering-Postgres-MySQL) [1](https://eng.uber.com/mysql-migration/)


text:
/**
 * Configs file for bundling
 * @author NHN. FE Development Lab <dl_javascript@nhn.com>
 */

'use strict';

var path = require('path');
var pkg = require('./package.json');
var webpack = require('webpack');
var MiniCssExtractPlugin = require('mini-css-extract-plugin');
var TerserPlugin = require('terser-webpack-plugin');
var OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');

function getOptimization(isMinified) {
  if (isMinified) {
    return {
      minimizer: [
        new TerserPlugin({
          cache: true,
          parallel: true,
          sourceMap: false,
          extractComments: false
        }),
        new OptimizeCSSAssetsPlugin()
      ]
    };
  }

  return {
    minimize: false
  };
}

module.exports = function(env, argv) {
  var isProduction = argv.mode === 'production';
  var isMinified = !!argv.minify;
  var FILENAME = pkg.name + (isMinified ? '.min' : '');
  var BANNER = [
    'TOAST UI Pagination',
    '@version ' + pkg.version,
    '@author ' + pkg.author,
    '@license ' + pkg.license
  ].join('\n');

  return {
    mode: 'development',
    entry: './src/js/index.js',
    output: {
      library: ['tui', 'Pagination'],
      libraryTarget: 'umd',
      path: path.resolve(__dirname, 'dist'),
      publicPath: 'dist',
      filename: FILENAME + '.js'
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /(test|node_modules)/,
          loader: 'eslint-loader',
          enforce: 'pre',
          options: {
            failOnError: isProduction
          }
        },
        {
          test: /\.css$/,
          use: [MiniCssExtractPlugin.loader, 'css-loader']
        },
        {
          test: /\.png$/,
          loader: 'url-loader'
        }
      ]
    },
    plugins: [
      new webpack.BannerPlugin(BANNER),
      new MiniCssExtractPlugin({ filename: FILENAME + '.css' })
    ],
    optimization: getOptimization(isMinified),
    devServer: {
      historyApiFallback: false,
      progress: true,
      host: '0.0.0.0',
      disableHostCheck: true
    }
  };
};


text:
function [ varargout ] = computeObsAvoidCtFeat( varargin )
    % Author     : Giovanni Sutanto
    % Date       : September 07, 2016

    point_obstacles_cart_position_local = varargin{1};
    loa_feat_param                      = varargin{2};
    endeff_state                        = varargin{3};
    tau                                 = varargin{4};
    N_loa_feat_rows_per_point           = varargin{5};
    N_loa_feat_cols_per_point           = varargin{6};
    loa_feat_methods                    = varargin{7};
    px                                  = varargin{8};
    pv                                  = varargin{9};
    cart_coord_dmp_baseline_params      = varargin{10};
    if (nargout > 1)
        debugging_X_and_Ct_mode       	= 2;
        sub_X_per_obs_point_cell      	= varargin{11};
        traj_point_idx                  = varargin{12};
    else
        debugging_X_and_Ct_mode        	= 0;
    end

    % total number of obstacle points:
    nP                  = size(point_obstacles_cart_position_local, 1);

    % an obstacle point (coordinate):
    o3                  = zeros(3,1);

    obs_state           = cell(3,1);

    sub_X_per_traj_point= zeros(N_loa_feat_rows_per_point, ...
                                N_loa_feat_cols_per_point);

    % gsutanto note: currently did NOT support multiple loa_feat_methods (iscell(loa_feat_methods) == 1)
    if (loa_feat_methods == 7)  % using Neural Network
        goal_position_local     = cart_coord_dmp_baseline_params.mean_goal_local;
        sub_X_per_traj_point    = computeNNObstAvoidCtFeat( loa_feat_param, endeff_state, point_obstacles_cart_position_local, tau, px, pv, goal_position_local );
    else
        for p = 1:nP
            o3(:,1)         = point_obstacles_cart_position_local(p,:)';                  % sphere obstacle center

            obs_state{1,1} 	= o3;           % obstacle position
            obs_state{2,1}	= zeros(3,1);	% obstacle velocity
            obs_state{3,1} 	= zeros(3,1);   % obstacle acceleration

            loa_feat_matrix_per_point   = (1.0/nP) * computeObsAvoidCtFeatPerPoint( loa_feat_param, endeff_state, obs_state, tau, loa_feat_methods, px, pv );
            if (strcmp(loa_feat_param.feat_constraint_mode, '_UNCONSTRAINED_') == 1)
                % when '_UNCONSTRAINED_', the feature set is
                % actually a row vector:
                loa_feat_matrix_per_point   = reshape(loa_feat_matrix_per_point.', 1, (size(loa_feat_matrix_per_point,1)*size(loa_feat_matrix_per_point,2)));
            end

            sub_X_per_traj_point  = sub_X_per_traj_point + loa_feat_matrix_per_point;
            if (debugging_X_and_Ct_mode == 2)
                sub_X_per_obs_point_cell{p,1}(traj_point_idx,:,:)= loa_feat_matrix_per_point;
            end
        end
    end

    varargout(1)   	= {sub_X_per_traj_point};
    if (debugging_X_and_Ct_mode == 2)
        varargout(2)= {sub_X_per_obs_point_cell};
    end
end


text:
namespace mx
{
    namespace core
    {
        VirtualInstrument::VirtualInstrument()
        :myVirtualLibrary( makeVirtualLibrary() )
        ,myHasVirtualLibrary( false )
        ,myVirtualName( makeVirtualName() )
        ,myHasVirtualName( false )
        {}

        bool VirtualInstrument::hasAttributes() const
        {
            return false;
        }

        std::ostream& VirtualInstrument::streamAttributes( std::ostream& os ) const
        {
            return os;
        }

        std::ostream& VirtualInstrument::streamName( std::ostream& os ) const
        {
            os << "virtual-instrument";
            return os;
        }

        bool VirtualInstrument::hasContents() const
        {
            return myHasVirtualLibrary || myHasVirtualName;
        }

        std::ostream& VirtualInstrument::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const
        {
            if ( myHasVirtualLibrary )
            {
                os << std::endl;
                myVirtualLibrary->toStream( os, indentLevel+1 );
            }
            if ( myHasVirtualName )
            {
                os << std::endl;
                myVirtualName->toStream( os, indentLevel+1 );
            }
            isOneLineOnly = ! hasContents();
            if ( ! isOneLineOnly )
            {
                os << std::endl;
            }
            return os;
        }

        VirtualLibraryPtr VirtualInstrument::getVirtualLibrary() const
        {
            return myVirtualLibrary;
        }

        void VirtualInstrument::setVirtualLibrary( const VirtualLibraryPtr& value )
        {
            if( value )
            {
                myVirtualLibrary = value;
            }
        }

        bool VirtualInstrument::getHasVirtualLibrary() const
        {
            return myHasVirtualLibrary;
        }

        void VirtualInstrument::setHasVirtualLibrary( const bool value )
        {
            myHasVirtualLibrary = value;
        }

        VirtualNamePtr VirtualInstrument::getVirtualName() const
        {
            return myVirtualName;
        }

        void VirtualInstrument::setVirtualName( const VirtualNamePtr& value )
        {
            if( value )
            {
                myVirtualName = value;
            }
        }

        bool VirtualInstrument::getHasVirtualName() const
        {
            return myHasVirtualName;
        }

        void VirtualInstrument::setHasVirtualName( const bool value )
        {
            myHasVirtualName = value;
        }

        bool VirtualInstrument::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement )
        {
            bool isSuccess = true;

            auto endIter = xelement.end();
            for( auto it = xelement.begin(); it != endIter; ++it )
            {
                if ( importElement( message, *it, isSuccess, *myVirtualLibrary, myHasVirtualLibrary ) ) { continue; }
                if ( importElement( message, *it, isSuccess, *myVirtualName, myHasVirtualName ) ) { continue; }
            }

            MX_RETURN_IS_SUCCESS;
        }

    }
}