text:
package co.edu.usbcali.utilities;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.sql.Blob;

import javax.sql.rowset.serial.SerialBlob;
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
import javax.faces.application.FacesMessage;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIInput;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import co.edu.usbcali.exceptions.ZMessManager;

/**
 * JSF utilities.
 */
@SuppressWarnings("deprecation")
public class FacesUtils {
	/**
	 * Get servlet context.
	 *
	 * @return the servlet context
	 */
	public static ServletContext getServletContext() {
		return (ServletContext) FacesContext.getCurrentInstance()
				.getExternalContext().getContext();
	}

	public static ExternalContext getExternalContext() {
		FacesContext fc = FacesContext.getCurrentInstance();
		return fc.getExternalContext();
	}

	public static HttpSession getHttpSession(boolean create) {
		return (HttpSession) FacesContext.getCurrentInstance()
				.getExternalContext().getSession(create);
	}

	public static void refresh() {
		FacesContext context = FacesContext.getCurrentInstance();
		Application application = context.getApplication();
		ViewHandler viewHandler = application.getViewHandler();
		UIViewRoot viewRoot = viewHandler.createView(context, context
				.getViewRoot().getViewId());
		context.setViewRoot(viewRoot);

	}

	/**
	 * Get managed bean based on the bean name.
	 *
	 * @param beanName
	 *            the bean name
	 * @return the managed bean associated with the bean name
	 */
	public static Object getManagedBean(String beanName) {

		// return
		// getValueBinding(getJsfEl(beanName)).getValue(FacesContext.getCurrentInstance());
		// ReportBean reportBean =
		// (ReportBean)facesContext.getApplication().getVariableResolver().resolveVariable(facesContext,
		// "reportBean");
		return FacesContext.getCurrentInstance().getApplication()
				.getVariableResolver().resolveVariable(
						FacesContext.getCurrentInstance(), beanName);
	}

	public static Object getManagedBeanFromSession(String beanName) {
		return FacesContext.getCurrentInstance().getExternalContext()
				.getSessionMap().get(beanName);
	}

	/**
	 * Remove the managed bean based on the bean name.
	 *
	 * @param beanName
	 *            the bean name of the managed bean to be removed
	 */
	public static void resetManagedBean(String beanName) {
		getValueBinding(getJsfEl(beanName)).setValue(
				FacesContext.getCurrentInstance(), null);
	}

	/**
	 * Store the managed bean inside the session scope.
	 *
	 * @param beanName
	 *            the name of the managed bean to be stored
	 * @param managedBean
	 *            the managed bean to be stored
	 */
	public static void setManagedBeanInSession(String beanName,
			Object managedBean) {
		FacesContext.getCurrentInstance().getExternalContext().getSessionMap()
				.put(beanName, managedBean);
	}

	/**
	 * Get parameter value from request scope.
	 *
	 * @param name
	 *            the name of the parameter
	 * @return the parameter value
	 */
	public static String getRequestParameter(String name) {
		return (String) FacesContext.getCurrentInstance().getExternalContext()
				.getRequestParameterMap().get(name);
	}

	/**
	 * Add information message.
	 *
	 * @param msg
	 *            the information message
	 */
	public static void addInfoMessage(String msg) {
		addInfoMessage(null, msg);
	}

	/**
	 * Add information message to a specific client.
	 *
	 * @param clientId
	 *            the client id
	 * @param msg
	 *            the information message
	 */
	public static void addInfoMessage(String clientId, String msg) {
		FacesContext.getCurrentInstance().addMessage(clientId,
				new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg));
	}

	/**
	 * Add error message.
	 *
	 * @param msg
	 *            the error message
	 */
	public static void addErrorMessage(String msg) {
		addErrorMessage(null, msg);
	}

	/**
	 * Add error message to a specific client.
	 *
	 * @param clientId
	 *            the client id
	 * @param msg
	 *            the error message
	 */
	public static void addErrorMessage(String clientId, String msg) {
		FacesContext.getCurrentInstance().addMessage(clientId,
				new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg));
	}

	private static Application getApplication() {
		ApplicationFactory appFactory = (ApplicationFactory) FactoryFinder
				.getFactory(FactoryFinder.APPLICATION_FACTORY);
		return appFactory.getApplication();
	}

	private static ValueBinding getValueBinding(String el) {
		return getApplication().createValueBinding(el);
	}

	@SuppressWarnings("unused")
	private static HttpServletRequest getServletRequest() {
		return (HttpServletRequest) FacesContext.getCurrentInstance()
				.getExternalContext().getRequest();
	}

	@SuppressWarnings("unused")
	private static Object getElValue(String el) {
		return getValueBinding(el).getValue(FacesContext.getCurrentInstance());
	}

	private static String getJsfEl(String value) {
		return "#{" + value + "}";
	}

	/**
	 *
	 * @return
	 */
	public static HttpSession getSession() {
		return (HttpSession) FacesContext.getCurrentInstance()
				.getExternalContext().getSession(true);
	}

	/**
	 *
	 * @param o
	 *            Put an object in session
	 */
	public static void putinSession(String name, Object o) {
		HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
				.getExternalContext().getSession(true);
		session.setAttribute(name, o);
	}

	/**
	 *
	 * @param name
	 * @return object from session
	 */

	public static Object getfromSession(String name) {
		HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
				.getExternalContext().getSession(false);
		return session.getAttribute(name);
	}

	/**
	 *
	 * @return
	 */

	public static HttpServletRequest getRequest() {
		return (HttpServletRequest) FacesContext.getCurrentInstance()
				.getExternalContext().getRequest();
	}

	/**
	 *
	 * @param name
	 * @param o
	 */
	public static void putinRequest(String name, Object o) {
		HttpServletRequest request = (HttpServletRequest) FacesContext
				.getCurrentInstance().getExternalContext().getRequest();
		request.setAttribute(name, o);
	}

	/**
	 *
	 * @param name
	 * @return object from request
	 */

	public static Object getfromRequest(String name) {
		HttpServletRequest request = (HttpServletRequest) FacesContext
				.getCurrentInstance().getExternalContext().getRequest();
		return request.getAttribute(name);
	}

	public static Long checkLong(Object input) throws ZMessManager {
		if (input == null) {
			return null;
		}
		UIInput inputValue = (UIInput) input;
		if (inputValue.getValue() == null) {
			return null;
		}
		if ((inputValue.getValue()).equals("")) {
			return null;
		}
		try {
			return new Long(inputValue.getValue().toString());
		} catch (Exception e) {
			throw new ZMessManager().new NotValidFieldException(inputValue
					.getId());
		}

	}

	public static String checkString(Object input) throws ZMessManager {
		if (input == null) {
			return null;
		}
		UIInput inputValue = (UIInput) input;
		if (inputValue.getValue() == null) {
			return null;
		}
		if ((inputValue.getValue()).equals("")) {
			return null;
		}
		try {
			return new String(inputValue.getValue().toString());
		} catch (Exception e) {
			throw new ZMessManager().new NotValidFieldException(inputValue
					.getId());
		}

	}

	public static Integer checkInteger(Object input) throws ZMessManager {
		if (input == null) {
			return null;
		}
		UIInput inputValue = (UIInput) input;
		if (inputValue.getValue() == null) {
			return null;
		}
		if ((inputValue.getValue()).equals("")) {
			return null;
		}
		try {
			return new Integer(inputValue.getValue().toString());
		} catch (Exception e) {
			throw new ZMessManager().new NotValidFieldException(inputValue
					.getId());
		}
	}

 public static Double checkDouble(Object input) throws ZMessManager {
        if (input == null) {
            return null;
        }

        UIInput inputValue = (UIInput) input;

        if (inputValue.getValue() == null) {
            return null;
        }

        if ((inputValue.getValue()).equals("")) {
            return null;
        }

        try {
            return new Double(inputValue.getValue().toString());
        } catch (Exception e) {
            throw new ZMessManager().new NotValidFieldException(inputValue.getId());
        }
    }

    public static Float checkFloat(Object input) throws ZMessManager {
        if (input == null) {
            return null;
        }

        UIInput inputValue = (UIInput) input;

        if (inputValue.getValue() == null) {
            return null;
        }

        if ((inputValue.getValue()).equals("")) {
            return null;
        }

        try {
            return new Float(inputValue.getValue().toString());
        } catch (Exception e) {
            throw new ZMessManager().new NotValidFieldException(inputValue.getId());
        }
    }

	public static Date checkDate(Object input) throws ZMessManager {
		if (input == null) {
			return null;
		}
		UIInput inputValue = (UIInput) input;
		if (inputValue.getValue() == null) {
			return null;
		}
		if ((inputValue.getValue()).equals("")) {
			return null;
		}
		try {
			return (Date) inputValue.getValue();
		} catch (Exception e) {
			throw new ZMessManager().new NotValidFieldException(inputValue
					.getId());
		}

	}

	public static BigInteger checkBigInteger(Object input) throws ZMessManager {
		if (input == null) {
			return null;
		}
		UIInput inputValue = (UIInput) input;
		if (inputValue.getValue() == null) {
			return null;
		}
		if ((inputValue.getValue()).equals("")) {
			return null;
		}
		try {
			return new BigInteger(inputValue.getValue().toString());
		} catch (Exception e) {
			throw new ZMessManager().new NotValidFieldException(inputValue
					.getId());
		}

	}

	public static BigDecimal checkBigDecimal(Object input) throws ZMessManager {
		if (input == null) {
			return null;
		}
		UIInput inputValue = (UIInput) input;
		if (inputValue.getValue() == null) {
			return null;
		}
		if ((inputValue.getValue()).equals("")) {
			return null;
		}
		try {
			return new BigDecimal(inputValue.getValue().toString());
		} catch (Exception e) {
			throw new ZMessManager().new NotValidFieldException(inputValue
					.getId());
		}
	}

	public static Blob checkBlob(Object input){

		Blob blob = null;
		byte[] bytesFile = null;

		if (input == null) {
			return null;
		}
		UIInput inputValue = (UIInput) input;
		if (inputValue.getValue() == null) {
			return null;
		}
		if ((inputValue.getValue()).equals("")) {
			return null;
		}
		try {
			bytesFile=((String)inputValue.getValue()).getBytes();
			blob=new SerialBlob(bytesFile);
		} catch (Exception e) {
			throw new ZMessManager().new NotValidFieldException(inputValue.getId());
		}
		return blob;

	}
}


text:
from numpy.distutils.misc_util import Configuration

MAXVOL_SRC = [
    'maxvol.f90',
    'maxvol.pyf',
]

def configuration(parent_package='', top_path=None):
    config = Configuration('maxvol', parent_package, top_path)
    config.add_extension('maxvol', sources=MAXVOL_SRC)
    return config

if __name__ == '__main__':
    print('This is the wrong setup.py to run')

redpajama_set_name: RedPajamaGithub


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

	module("Weaving introductions");

	(function() {

		var executionCount = 0;

		testAop('introductions without method overriding', ['introduction'], {target: String, method: 'divide' }, function() {
			expect(3);
			try
			{
				"test".divide();
				executionCount++;
			}
			catch (e)
			{
				if (executionCount != 1)
					return "Introduction failed";
			}
			return "OK";
		} );

	})();

	(function() {

		testAop('introductions with method overriding', ['introduction'], {target: String, method: 'indexOf' }, function() {
			expect(3);
			var result = null;
			result = "test".indexOf('s');
			if (result == 'introduction method executed')
				return 2;
			else
				return result;
		} );

	})();

});


text:
set -e

RootDir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
RootDir=$(sed 's@^/\([a-z]\{1\}\)@\1:@' <<< $RootDir)

# OTHER SCRIPTS
source "$RootDir/timing.sh"

# PROJECT DIRECTORIES
SourceDir="$RootDir/src"
LibDir="$RootDir/lib"
IncludeDir="$RootDir/include"
BuildDir="$RootDir/build"

TimerBegin
cmake -H"$SourceDir" -B"$BuildDir" -G"Visual Studio 15 2017 Win64"
cmake --build "$BuildDir" -- -nologo
TimerEnd

$BuildDir/Debug/BlockGame.exe

exit 0

#################################################################################
# The remainder of this script is from before I had a CMake build setup and was #
# building from the command line; it's just here for posterity.                 #
#################################################################################

# GLOBAL BUILD VARIABLES

DebugMode=1
PlatformEntry="win32_main"
GameEntry="blockgame_main"

# COMPILER FLAGS

function OutputFlags()
{
    echo -n " -Fe:$BuildDir/$1 "        # Create a .exe file
    echo -n " -Fo:$BuildDir/$1 "        # Create a .obj file
    echo -n " -Fd:$BuildDir/$1 "        # Create a .pdb file
}
WarningsFlags=(
    "-WX"                               # Treat warnings as errors
    "-W4"                               # Enable warnings up to 'informational' level
    "-wd4100"                           # Disable 'unreferenced formal parameter'
    "-wd4189"                           # Disable 'unreferenced local variable'
    "-wd4505"                           # Disable 'unreferenced local function'
    "-wd4201"                           # Allow 'nameless struct/union'
    "-wd4458"                           # Allow parameters to elide class members
    "-wd4723"                           # Disable 'potential divide by 0'
)
OptimisationFlags=(
    "-fp:fast"                          # Enable fast floating point (sacrifices accuracy)
    "-fp:except-"                       # Disable floating point exceptions
    "-GR-"                              # Disable runtime type information
    "-Oi"                               # Generate intrinsic functions
    "-MTd"                              # Use a static multithreaded runtime library
    "-EHsc"                             # Disable async exceptions, and "extern C" may throw
)
CompilerDefines=(
    "-DDEBUG_MODE=$DebugMode"           # Preprocessor #define DEBUG_MODE
    "-D_CRT_SECURE_NO_WARNINGS=1"
)
IncludeFlags=(
    "-I$IncludeDir"
)
MiscFlags=(
    "-nologo"                           # Disable the MSVC logo
    "-Gm-"                              # Disable minimal rebuild, i.e. force full rebuild
)
DebugFlags=(
    "-Zo"                               # Output enhanced debug info
    "-FC"                               # Output full source file paths
    "-Z7"                               # Produce a .obj with full debug symbols
)
if [ $DebugMode ]; then
    DebugFlags+=("-Od")                 # Disable optimisations
else
    DebugFlags+=("-O2")                 # Enable optimisations
fi

CompilerFlags="${WarningsFlags[@]} ${OptimisationFlags[@]} ${CompilerDefines[@]}
               ${IncludeFlags[@]} ${MiscFlags[@]} ${DebugFlags[@]}"

# LINKER FLAGS

LinkerOptimisations=(
    "-incremental:no"                   # Disable incremental linking
    "-opt:ref"                          # Remove functions and data that aren't referenced
    "-subsystem:windows,5.02"           # Create a Windows app (no console), min version 5.1
)
LinkerCommonLibs=(
    "$LibDir/glew/glew32s.lib"          # GLEW static library
)
LinkerFlags="${LinkerOptimisations[@]} ${LinkerCommonLibs[@]}"

# CLEAN BUILD

if [ "$1" == "--clean" ]; then
    echo "Cleaning up..."
    rm -f $BuildDir/*.exe
    rm -f $BuildDir/*.dll
    rm -f $BuildDir/*.obj
    rm -f $BuildDir/*.lib
    rm -f $BuildDir/*.pdb
    rm -f $BuildDir/*.exp
    exit 0;
fi

# COMPILATION

TimerBegin
echo "Entering directory $RootDir"
pushd $RootDir > /dev/null

if [ ! -d $BuildDir ]; then
    mkdir $BuildDir
fi

echo -e "\nCompiling game DLL..."
find $BuildDir -type f -name "$GameEntry-*.pdb" -exec rm {} \;
cl $CompilerFlags $(OutputFlags $GameEntry) "$SourceDir/blockgame/$GameEntry.cpp" -LD          \
   -link $LinkerFlags -PDB:"$BuildDir/$GameEntry-$RANDOM.pdb"

echo -e "\nCompiling platform code..."
cl $CompilerFlags $(OutputFlags $PlatformEntry) "$SourceDir/$PlatformEntry.cpp"      \
   -DGAME_DLL_FILENAME=\"$GameEntry.dll\"                                            \
   -link $LinkerFlags "gdi32.lib" "user32.lib" "winmm.lib" "opengl32.lib"

echo -e "\nLeaving directory $RootDir"
popd > /dev/null
TimerEnd


text:
module XmlEvent (xmlEvent, XmlEvent(..)) where

import Data.Pipe
import Data.Word8
import qualified Data.ByteString as BS

import Lexer
import Papillon

xmlEvent :: Monad m => Pipe BS.ByteString (Maybe XmlEvent) m ()
xmlEvent = sepTag =$= convert parseXmlEvent =$= filterP (maybe True notEmpty)

notEmpty :: XmlEvent -> Bool
notEmpty (XECharData cd) = not $ BS.all isSpace cd
notEmpty _ = True

convert :: Monad m => (a -> b) -> Pipe a b m ()
convert f = await >>= maybe (return ()) (\x -> yield (f x) >> convert f)

filterP :: Monad m => (a -> Bool) -> Pipe a a m ()
filterP p = await >>=
	maybe (return ()) (\x -> (if p x then yield x else return ()) >> filterP p)


text:
The file appender writes log events to a file. It supports an optional maximum file size, and will keep a configurable
number of backups.
When using the file appender, you should also call [logger.shutdown()](/getting-started.md) when your application terminates,
to ensure that any remaining asynchronous writes have finished.
Although the file appender uses the [streamroller](https://github.com/nomiddlename/streamroller) library, this is included as a dependency of ts-log-debug so you do not
need to include it yourself.

## Configuration

- **type** - `file`
- **filename - string** - the path of the file where you want your logs written.
- **maxLogSize - integer** (optional) - the maximum size (in bytes) for the log file. If not specified, then no log rolling will happen.
- **backups - integer** (optional, default value = 5) - the number of old log files to keep during log rolling.
- **layout** - (optional, defaults to basic layout) - see [layouts](/layouts/readme.md)

Any other configuration parameters will be passed to the underlying [streamroller](https://github.com/nomiddlename/streamroller)
implementation (see also node.js core file streams):

- **encoding** - string (default "utf-8")
- **mode** - integer (default 0644)
- **flags** - string (default 'a')
- **compress** - boolean (default false) - compress the backup files during rolling (backup files will have .gz extension)

## Example

```typescript
import {Logger} from "@tsed/logger";

const logger = new Logger("loggerName");

logger.appenders.set("everything", {
    type: 'file',
    filename: 'all-the-logs.log'
});

logger.debug('I will be logged in all-the-logs.log');
```

This example will result in a single log file (all-the-logs.log) containing the log messages.

## Example with log rolling (and compressed backups)

```typescript
import {Logger} from "@tsed/logger";

const logger = new Logger("loggerName");

logger.appenders.set("everything", {
    type: 'file',
    filename: 'all-the-logs.log',
    maxLogSize: 10485760,
    backups: 3,
    compress: true
});
```

This will result in one current log file (`all-the-logs.log`). When that reaches 10Mb in size, it will be renamed and
compressed to `all-the-logs.log.1.gz and a` new file opened called `all-the-logs.log`.
When `all-the-logs.log` reaches 10Mb again, then all-the-logs.log.1.gz will be renamed to
`all-the-logs.log.2.gz`, and so on.

## Example with date rolling

```typescript
import { Logger } from 'ts-log-debug';
export const logger = new Logger('Log Example');

logger.appenders
.set('file', {
  type: 'file',
  filename: `${__dirname}/../logs/myfile.log`,
  pattern: '.yyyy-MM-dd'
});``
``


text:
namespace SolRIA.SaftAnalyser.Views
{
	/// <summary>
	/// Interaction logic for SaftHeader.xaml
	/// </summary>
	public partial class SaftHeader : PageBase
	{
		public SaftHeader()
		{
			InitializeComponent();
		}
	}
}


text:
function [B,x0,U] = irocon_i(irocon_file)
% [B,x0,U] = irocon_i(irocon_file)
%   initialisation of model irocon
%   B   Model size
%   x0  default initial state
%   U   measuerement list
%
% Stimela, 2004

% © Kim van Schagen,

U = st_Varia('LongNames'); % default with long Names

% Get Model parameter file for parameter specific sizes
irocon_fileEcht = chckFile(irocon_file);
P = st_getPdata(irocon_fileEcht, 'irocon');

% Parameters in P can now be used to determine B and x0

%%% MODEL-SPECIFIC => %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fill B and x0

% initialisation
B.CStates=5*(P.NumCel);        % number of continous states
B.DStates=0;        % number of discrete states
B.Setpoints=1;      % number of extra setpoints
B.Measurements= 5*(P.NumCel);  % number of extra measurements
B.Direct=1;         % direct feedthrough (yes=1, no=0);
B.SampleTime=0;     % SampleTime for discrete states (-1 = inherited)

x0=[zeros((P.NumCel),1); zeros((P.NumCel),1); 0.3*ones(1*(P.NumCel),1);3*ones(1*(P.NumCel),1); -1*ones(1*(P.NumCel),1)] ;              % collumn vector with the same length as B_CStates +

%%% <= MODEL-SPECIFIC  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


text:
package nodes

import (
	"testing"

	"github.com/gonum/graph/topo"

	appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
	"github.com/openshift/origin/pkg/apps/apis/apps/test"
	osgraph "github.com/openshift/origin/pkg/oc/lib/graph/genericgraph"
	kubetypes "github.com/openshift/origin/pkg/oc/lib/graph/kubegraph/nodes"
)

func TestDCPodTemplateSpecNode(t *testing.T) {
	g := osgraph.New()

	dc := &appsapi.DeploymentConfig{}
	dc.Namespace = "ns"
	dc.Name = "foo"
	dc.Spec.Template = test.OkPodTemplate()

	_ = EnsureDeploymentConfigNode(g, dc)

	edges := g.Edges()
	if len(edges) != 2 {
		t.Errorf("expected 2 edges, got %d", len(edges))
		return
	}
	for i := range edges {
		if !g.EdgeKinds(edges[i]).Has(osgraph.ContainsEdgeKind) {
			t.Errorf("expected %v, got %v", osgraph.ContainsEdgeKind, g.EdgeKinds(edges[i]))
			return
		}
	}

	nodes := g.Nodes()
	if len(nodes) != 3 {
		t.Errorf("expected 3 nodes, got %d", len(nodes))
		return
	}
	sorted, err := topo.Sort(g)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
		return
	}
	// Just to be sure
	if len(sorted) != 3 {
		t.Errorf("expected 3 nodes, got %d", len(sorted))
		return
	}
	if _, ok := sorted[0].(*DeploymentConfigNode); !ok {
		t.Errorf("expected first node to be a DeploymentConfigNode")
		return
	}
	if _, ok := sorted[1].(*kubetypes.PodTemplateSpecNode); !ok {
		t.Errorf("expected second node to be a PodTemplateSpecNode")
		return
	}
	if _, ok := sorted[2].(*kubetypes.PodSpecNode); !ok {
		t.Errorf("expected third node to be a PodSpecNode")
	}
}


text:
using AutoMapper;
using Advertise.DomainClasses.Entities.Companies;
using Advertise.ViewModel.Models.Companies ;
namespace Advertise.Mapping.Profiles.Companies
{
    class CompanyQuestionProfile : Profile
    {
        public CompanyQuestionProfile()
        {

            CreateMap<CompanyQuestion, CompanyQuestionCreateViewModel>()
                .ProjectUsing(src => new CompanyQuestionCreateViewModel
                {
                    Body  = src.Body,
                    IsApproved  = src.IsApproved,
                    Title =src.Title
                });
            CreateMap<CompanyQuestionCreateViewModel, CompanyQuestion>()
               .ForMember(dest => dest.IsApproved , opts => opts.MapFrom(src => src.IsApproved ))
               .ForMember(dest => dest.Title , opts => opts.MapFrom(src => src.Title ))
               .ForMember(dest => dest.Body , opts => opts.MapFrom(src => src.Body ))
               .ForAllOtherMembers(opt => opt.Ignore());

            CreateMap<CompanyQuestion, CompanyQuestionEditViewModel>()
                .ProjectUsing(src => new CompanyQuestionEditViewModel
                {
                    Body = src.Body,
                    IsApproved = src.IsApproved,
                    Title = src.Title,
                    Id = src.Id
                });
            CreateMap<CompanyQuestionEditViewModel, CompanyQuestion>()
               .ForMember(dest => dest.IsApproved, opts => opts.MapFrom(src => src.IsApproved))
               .ForMember(dest => dest.Title, opts => opts.MapFrom(src => src.Title))
               .ForMember(dest => dest.Body, opts => opts.MapFrom(src => src.Body))
               .ForAllOtherMembers(opt => opt.Ignore());

            CreateMap<CompanyQuestion, CompanyQuestionDetailViewModel>()
               .ProjectUsing(src => new CompanyQuestionDetailViewModel
               {
                   Body = src.Body,
                   IsApproved = src.IsApproved,
                   Title = src.Title,
                   Id = src.Id
               });
            CreateMap<CompanyQuestionDetailViewModel, CompanyQuestion>()
              .ForMember(dest => dest.IsApproved, opts => opts.MapFrom(src => src.IsApproved))
               .ForMember(dest => dest.Title, opts => opts.MapFrom(src => src.Title))
               .ForMember(dest => dest.Body, opts => opts.MapFrom(src => src.Body))
               .ForAllOtherMembers(opt => opt.Ignore());

            CreateMap<CompanyQuestion, CompanyQuestionDeleteViewModel>()
              .ProjectUsing(src => new CompanyQuestionDeleteViewModel
              {
                  Body = src.Body,
                  IsApproved = src.IsApproved,
                  Title = src.Title,
                  Id = src.Id
              });
            CreateMap<CompanyQuestionDeleteViewModel, CompanyQuestion>()
               .ForMember(dest => dest.IsApproved, opts => opts.MapFrom(src => src.IsApproved))
               .ForMember(dest => dest.Title, opts => opts.MapFrom(src => src.Title))
               .ForMember(dest => dest.Body, opts => opts.MapFrom(src => src.Body))
               .ForAllOtherMembers(opt => opt.Ignore());

        }
    }
}


text:
namespace Aspose.Tasks.Examples.CSharp
{
    using System;
    using NUnit.Framework;
    using Saving;

    [TestFixture]
    public class ExProjectDisplayOptions : ApiExampleBase
    {
        [Test]
        public void WorkWithProjectDisplayOptions()
        {
            try
            {
                // ExStart:ProjectDisplayOptionsUsage
                // ExFor: ProjectDisplayOptions
                // ExFor: ProjectDisplayOptions.#ctor
                // ExFor: ProjectDisplayOptions.AddSpaceBeforeLabel
                // ExFor: ProjectDisplayOptions.MinuteLabel
                // ExFor: ProjectDisplayOptions.HourLabel
                // ExFor: ProjectDisplayOptions.DayLabel
                // ExFor: ProjectDisplayOptions.WeekLabel
                // ExFor: ProjectDisplayOptions.MonthLabel
                // ExFor: ProjectDisplayOptions.YearLabel
                // ExFor: ProjectDisplayOptions.ShowProjectSummaryTask
                // ExFor: ProjectDisplayOptions.ShowTaskScheduleWarnings
                // ExFor: ProjectDisplayOptions.ShowTaskScheduleSuggestions
                // ExFor: ProjectDisplayOptions.UnderlineHyperlinks
                // ExSummary: Shows how to use project's display options.
                var project = new Project(DataDir + "EstimatedMilestoneTasks.mpp");

                // Set a value indicating whether to show warnings when Project identifies a possible scheduling conflict with a manually scheduled task.
                // This option is available for Project 2010 version and later.
                project.DisplayOptions.ShowTaskScheduleWarnings = false;

                // a value indicating whether to add a space before the number value and the time abbreviation (1 wk as opposed to 1wk)
                project.DisplayOptions.AddSpaceBeforeLabel = true;

                // set how the minute label is displayed
                project.DisplayOptions.MinuteLabel = MinuteLabelDisplay.Min;

                // set how the hour label is displayed
                project.DisplayOptions.HourLabel = HourLabelDisplay.Hr;

                // set how the day label is displayed
                project.DisplayOptions.DayLabel = DayLabelDisplay.Dy;

                // set how the week label is displayed
                project.DisplayOptions.WeekLabel = WeekLabelDisplay.Week;

                // set how the month label is displayed
                project.DisplayOptions.MonthLabel = MonthLabelDisplay.Mon;

                // set how the year label is displayed
                project.DisplayOptions.YearLabel = YearLabelDisplay.Year;

                // set a value indicating whether to display summary information about an entire project on a single row with its own summary task bar at the top of the Gantt Chart view.
                project.DisplayOptions.ShowProjectSummaryTask = true;

                // set a value indicating whether to show suggestions when Project identifies a possible scheduling conflict with a manually scheduled task.
                project.DisplayOptions.ShowTaskScheduleSuggestions = true;

                // set a value indicating whether to underline hyperlinks.
                project.DisplayOptions.UnderlineHyperlinks = true;

                project.Save(OutDir + "WorkWithProjectDisplayOptions.mpp", SaveFileFormat.Mpp);

                // ExEnd:ProjectDisplayOptionsUsage
            }
            catch (NotSupportedException ex)
            {
                Console.WriteLine(
                    ex.Message
                    + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http://www.aspose.com/purchase/default.aspx.");
            }
        }
    }
}