text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using System.IO;
using System.Threading;
using Common.Logging;
namespace TranscodeProcessor
{
    /// <summary>
    /// Handle first pass run for multipass transcoding jobs
    /// </summary>
    public class Multipass : Sprite.ISimpleRunnable
    {
        private static ILog log = LogManager.GetCurrentClassLogger();

        protected TranscodeJob job;
        protected string token;
        protected bool complete;
        protected bool failed;
        protected string workingDir;
        protected string dest;

        protected string multiPassOptions;
        protected string multiPassExtension;
        protected string outputFileMultipass;

        public Multipass(TranscodeJob job,string token, string workingDir, string multiPassExtension, string multiPassOptions)
        {
            this.token = token;
            this.job = job;
            this.workingDir = workingDir;
            this.complete = false;
            this.dest = this.job.Download.Destination;

            this.multiPassOptions = multiPassOptions;
            this.multiPassExtension = multiPassExtension;
        }

        public void RunPass()
        {
            try
            {
                // TODO configure this sleep time
                // Make sure we have a file available
                while (!job.DownloadComplete)
                    System.Threading.Thread.Sleep(100);

                // If we were not able to probe the file we cannot proceed
                if (job.Download.ProbeInfo != null)
                {
                    // Multipass options must be provided
                    if (string.IsNullOrEmpty(multiPassOptions))
                    {
                        this.complete = true;
                        this.failed = true;
                        log.Debug("No multi pass options provided");
                        throw new JobFailureException("No multi pass options provided");
                    }

                    string fpsString;
                    int frameRate = 0;
                    // Get the current frame rate for variable replacement
                    // Todo possible look into other variables that could be replaced in
                    foreach (var stream in job.Download.ProbeInfo.streams)
                    {
                        if (stream.codec_type.ToString() == "video")
                        {

                            fpsString = stream.avg_frame_rate.ToString();
                            var d = float.Parse(fpsString.Substring(fpsString.IndexOf("/") + 1));
                            var r = float.Parse(fpsString.Substring(0, fpsString.IndexOf("/")));
                            frameRate = (int)Math.Round(r / d);
                        }
                    }
                    this.multiPassOptions = this.multiPassOptions.Replace("'{{fps}}'", frameRate.ToString());
                    this.multiPassOptions = this.multiPassOptions.Replace("'{{fps2x}}'", (frameRate * 2).ToString());
                    this.multiPassOptions = this.multiPassOptions.Replace("{{fps}}", frameRate.ToString());
                    this.multiPassOptions = this.multiPassOptions.Replace("{{fps2x}}", (frameRate * 2).ToString());
                    var args = buildTranscodingArguments(this.workingDir, this.dest, this.multiPassOptions, "fastpass_" + this.dest + "." + this.multiPassExtension);
                    int status = 0;
                    var fastPassData = FFmpeg.Exec(args, out status);
                    if (status != 0)
                    {
                        this.complete = true;
                        this.failed = true;
                        log.Debug("Failed to perform fast pass of data");
                        throw new JobFailureException("Failed to perform fast pass of data");
                    }
                    this.complete = true;
                }
                else
                {
                    this.complete = true;
                    this.failed = true;
                    log.Debug("Failed to perform fast pass of data missing probe info");
                    throw new JobFailureException("Failed to perform fast pass of data missing probe info");
                }

            }
            catch (Exception ex)
            {
                log.Error("An error occured Download()", ex);
            }
        }

        public string WorkingDirectory
        {
            get { return this.workingDir; }
        }

        public bool IsComplete
        {
            get { return this.complete; }
        }
        internal bool IsFailed
        {
            get { return this.failed; }
        }
        public string Token
        {
            get
            {
                return this.token;
            }
        }
        public string Extension
        {
            get
            {
                return this.multiPassExtension;
            }
        }
        public string MultiPassFile
        {
            get
            {
                return this.outputFileMultipass;
            }
        }

        /// <summary>
        /// Build arguements for transcoder
        /// </summary>
        /// <param name="workingdir">Working directory where input file is located</param>
        /// <param name="filename">Name of file to be transcoded</param>
        /// <param name="args">Transcoding arguments</param>
        /// <param name="outFile">Name of transcoded destination file. This will be placed into workingDir</param>
        /// <returns>Returns a command string for FFMpeg</returns>
        private string buildTranscodingArguments(string workingdir, string filename, string args, string outFile)
        {
            args = args.Trim();
            string outputFile = workingdir + outFile;
            string taskOutput = outputFile;
            this.outputFileMultipass = outputFile + "-multipass";
            args = args.Trim() + " -pass 1"+ " -passlogfile \"" + outputFileMultipass + "\"";

            string command = "-i " + workingdir + filename + " -y " + args + " " + outputFile;

            return command;
        }

        public override string ToString()
        {
            return "Complete: " + complete;
        }

        /// <summary>
        /// Invoked method from Sprite
        /// </summary>
        /// <returns>Return invoked instance of Multipass class</returns>
        public object Handle()
        {
            RunPass();
            return this;
        }

        public object Handle(object resource)
        {
            throw new NotImplementedException();
        }
    }
}


text:
package gov.hhs.onc.sdcct.fhir;

import gov.hhs.onc.sdcct.beans.ContentTypeBean;
import gov.hhs.onc.sdcct.net.mime.SdcctMediaTypes;
import gov.hhs.onc.sdcct.transform.content.SdcctContentType;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.springframework.http.MediaType;

public enum FhirFormatType implements ContentTypeBean {
    JSON(SdcctContentType.JSON, SdcctMediaTypes.APP_JSON_FHIR, SdcctMediaTypes.APP_JSON_FHIR_UTF8, SdcctMediaTypes.JSON_SUBTYPE),
    XML(SdcctContentType.XML, SdcctMediaTypes.APP_XML_FHIR, SdcctMediaTypes.APP_XML_FHIR_UTF8, SdcctMediaTypes.XML_SUBTYPE, MediaType.TEXT_XML_VALUE);

    private final Set<MediaType> compatMediaTypes;
    private final SdcctContentType contentType;
    private final MediaType mediaType;
    private final MediaType encMediaType;
    private final Set<String> queryParamValues;

    private FhirFormatType(SdcctContentType contentType, MediaType mediaType, MediaType encMediaType, String ... queryParamValues) {
        this.compatMediaTypes = Collections.singleton((this.mediaType = mediaType));
        this.encMediaType = encMediaType;
        this.queryParamValues =
            Stream.concat(Stream.<String>builder().add(this.mediaType.toString()).add((this.contentType = contentType).getMediaType().toString()).build(),
                Stream.of(queryParamValues)).collect(Collectors.toCollection(LinkedHashSet::new));
    }

    @Override
    public Set<MediaType> getCompatibleMediaTypes() {
        return this.compatMediaTypes;
    }

    public SdcctContentType getContentType() {
        return this.contentType;
    }

    public MediaType getEncodedMediaType() {
        return this.encMediaType;
    }

    @Override
    public MediaType getMediaType() {
        return this.mediaType;
    }

    public Set<String> getQueryParamValues() {
        return this.queryParamValues;
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var sharedSteps = module.exports = function() {
  this.World = require('../support/world').World;
  var should = this.should;

  var getIndex = function(index) {
    if (index == 'first') {
      return 1;
    } else if (index == 'second') {
      return 2;
    } else if (index == 'third') {
      return 3;
    } else if (index == 'fourth') {
      return 4;
    }
  }

  this.When(/^I have satisfied the required fields$/, function(next) {
    var my = this;

    // arbitrarily click the first background, first text color and define point position
    my.client
      .click('#acf-wtm_background_color .color-swatcher a:first-child')
      .click('#acf-wtm_font_color .color-swatcher a:first-child')
      .setValue('#acf-wtm_coord_percents input', '{"x_percent":"0.323","y_percent":"0.102"}', function(err) {
        my.expect(err).to.be.null;
      })
      .call(next);
  });

  this.When(/^I click on the (first|second|third|fourth) color swatch of "([^"]*)"$/, function(index, selector, next) {
    this.client
      .click(selector+' :nth-child('+getIndex(index)+')')
      .call(next);
  });

  this.Then(/"([^"]*)" should contain "([^"]*)"$/, function (selector, value, next) {
    var my = this;

    my.client.getText(selector, function(err, text) {
      my.expect(err).to.be.null;
      text.should.equal(value);
    }).call(next);
  });

  this.Then(/value of "([^"]*)" should be "([^"]*)"$/, function (selector, value, next) {
    var my = this;

    my.client.getValue(selector, function(err, myValue) {
      my.expect(err).to.be.null;
      myValue.should.equal(value);
    }).call(next);
  });

  this.Then(/value of "([^"]*)" should be '([^']*)'$/, function (selector, value, next) {
    var my = this;

    my.client.getValue(selector, function(err, myValue) {
      my.expect(err).to.be.null;
      myValue.should.equal(value);
    }).call(next);
  });

  this.Then(/^the (first|second|third|fourth) color swatch of "([^"]*)" should have the class "([^"]*)"$/, function (index, selector, expectedClass, next) {
    var my = this;

    my.client.getAttribute(selector+' :nth-child('+getIndex(index)+')', 'class', function(err, observedClass) {
      my.expect(err).to.be.null;
      observedClass.should.equal(expectedClass);
    }).call(next);
  });

};


text:
package io.airlift.discovery.client;

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import io.airlift.node.NodeInfo;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;

import java.util.Map;
import java.util.UUID;

public class ServiceDescriptor
{
    private final UUID id;
    private final String nodeId;
    private final String type;
    private final String pool;
    private final String location;
    private final ServiceState state;
    private final Map<String, String> properties;

    @JsonCreator
    public ServiceDescriptor(
            @JsonProperty("id") UUID id,
            @JsonProperty("nodeId") String nodeId,
            @JsonProperty("type") String type,
            @JsonProperty("pool") String pool,
            @JsonProperty("location") String location,
            @JsonProperty("state") ServiceState state,
            @JsonProperty("properties") Map<String, String> properties)
    {
        Preconditions.checkNotNull(properties, "properties is null");

        this.id = id;
        this.nodeId = nodeId;
        this.type = type;
        this.pool = pool;
        this.location = location;
        this.state = state;
        this.properties = ImmutableMap.copyOf(properties);
    }

    @JsonProperty
    public UUID getId()
    {
        return id;
    }

    @JsonProperty
    public String getNodeId()
    {
        return nodeId;
    }

    @JsonProperty
    public String getType()
    {
        return type;
    }

    @JsonProperty
    public String getPool()
    {
        return pool;
    }

    @JsonProperty
    public String getLocation()
    {
        return location;
    }

    @JsonProperty
    public ServiceState getState()
    {
        return state;
    }

    @JsonProperty
    public Map<String, String> getProperties()
    {
        return properties;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ServiceDescriptor that = (ServiceDescriptor) o;

        if (!id.equals(that.id)) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode()
    {
        return id.hashCode();
    }

    @Override
    public String toString()
    {
        return Objects.toStringHelper(this)
                .add("id", id)
                .add("nodeId", nodeId)
                .add("type", type)
                .add("pool", pool)
                .add("location", location)
                .add("state", state)
                .add("properties", properties)
                .toString();
    }

    public static ServiceDescriptorBuilder serviceDescriptor(String type)
    {
        Preconditions.checkNotNull(type, "type is null");
        return new ServiceDescriptorBuilder(type);
    }

    public static class ServiceDescriptorBuilder
    {
        private UUID id = UUID.randomUUID();
        private String nodeId;
        private final String type;
        private String pool = ServiceSelectorConfig.DEFAULT_POOL;
        private String location;
        private ServiceState state;

        private final ImmutableMap.Builder<String, String> properties = ImmutableMap.builder();

        private ServiceDescriptorBuilder(String type)
        {
            this.type = type;
        }

        public ServiceDescriptorBuilder setId(UUID id)
        {
            Preconditions.checkNotNull(id, "id is null");
            this.id = id;
            return this;
        }

        public ServiceDescriptorBuilder setNodeInfo(NodeInfo nodeInfo)
        {
            Preconditions.checkNotNull(nodeInfo, "nodeInfo is null");
            this.nodeId = nodeInfo.getNodeId();
            this.pool = nodeInfo.getPool();
            return this;
        }

        public ServiceDescriptorBuilder setNodeId(String nodeId)
        {
            Preconditions.checkNotNull(nodeId, "nodeId is null");
            this.nodeId = nodeId;
            return this;
        }

        public ServiceDescriptorBuilder setPool(String pool)
        {
            Preconditions.checkNotNull(pool, "pool is null");
            this.pool = pool;
            return this;
        }

        public ServiceDescriptorBuilder setLocation(String location)
        {
            Preconditions.checkNotNull(location, "location is null");
            this.location = location;
            return this;
        }

        public ServiceDescriptorBuilder setState(ServiceState state)
        {
            Preconditions.checkNotNull(state, "state is null");
            this.state = state;
            return this;
        }

        public ServiceDescriptorBuilder addProperty(String key, String value)
        {
            Preconditions.checkNotNull(key, "key is null");
            Preconditions.checkNotNull(value, "value is null");
            properties.put(key, value);
            return this;
        }

        public ServiceDescriptorBuilder addProperties(Map<String, String> properties)
        {
            Preconditions.checkNotNull(properties, "properties is null");
            this.properties.putAll(properties);
            return this;
        }

        public ServiceDescriptor build()
        {
            return new ServiceDescriptor(id, nodeId, type, pool, location, state, properties.build());
        }
    }
}


text:
Home

Tentang Kami

Tentang Kami

Persada Holiday merupakan perusahaan bergerak dalam bidang travel agent yang menyediakan layanan tiket maskapai penerbangan, laut, dan darat. Kami menyediakan paket perjalanan & open trip yang disesuaikan oleh budget traveler, dengan destinasi wisata domestik. Kami juga menyediakan paket perjalanan keluarga, bulan madu, dan outing perusahaan.

Luasnya kerja sama kami dengan lokal agent dan wholesaler, menandakan semakin berkembangnya perusahaan ini dalam menangani paket liburan. Nikmati paket liburan yang kami sediakan, buat paket liburan yang anda inginkan, kami akan membuat liburan traveler menjadi momen berharga. Member Of
                ASITA (Association of the Indonesian tours & travel agencies) adalah asosiasi yang ada di Indonesia untuk perusahaan dalam bidang tour dan travel.

Visi

                    Menjadi mitra bagi seluruh masyarakat Indonesia dalam memberikan produk jasa layanan perjalanan yang kreatif, inovatif, solutif dan konsisten.

Misi

Menyediakan jasa perjalanan domestik dan internasional tour yang aman, nyaman dan tetap mengutamakan nilai-nilai agama.

Menjadi perusahaan yang memberikan dampak yang baik bagi masyarakat sekitar.


text:
<error>
    <prefix>BS.SFTP</prefix>

    <code>
        <id>1000</id>
        <description>Unable to reconnect to sftp backup storage</description>
    </code>
</error>


text:
package org.wso2.developerstudio.eclipse.artifact.registry.provider;

import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

import org.eclipse.core.resources.IProject;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.PlatformUI;
import org.wso2.developerstudio.eclipse.general.project.artifact.bean.RegistryCollection;
import org.wso2.developerstudio.eclipse.general.project.artifact.bean.RegistryDump;
import org.wso2.developerstudio.eclipse.general.project.artifact.bean.RegistryElement;
import org.wso2.developerstudio.eclipse.general.project.artifact.bean.RegistryItem;
import org.wso2.developerstudio.eclipse.platform.core.utils.SWTResourceManager;

public class NavigatorNode {

	public String getPath() {
    	return path;
    }

	public void setPath(String path) {
    	this.path = path;
    }

	public Image getGetImage() {
		RegistryElement item = getData();
		if (null != item) {
			if (item instanceof RegistryItem) {
				String filename = ((RegistryItem) item).getFile();
				if (filename.lastIndexOf(".") != -1) {
					filename = "file" + filename.substring(filename.lastIndexOf("."));

					/*return PlatformUI.getWorkbench().getEditorRegistry().getImageDescriptor(filename)
					                 .createImage();*/
					return SWTResourceManager.getImage(this.getClass(), "/icons/resource.png");
				}
			}
		}
		return SWTResourceManager.getImage(this.getClass(), "/icons/registry_nav.png");
	}

	public Object[] getChildren() {
		List<RegistryElement> items = getContent();
		Map<String,NavigatorNode> node = new HashMap<String,NavigatorNode>();
		for (RegistryElement item : items) {
	        String path = item.getPath().replaceAll("^" + Pattern.quote(getPath()),"");
	        path = path.replaceAll("^" + Pattern.quote("/"),"");
	        String prefix = getPath() + (getPath().equals("/")?"":"/");
	        if(!"".equals(path)){
	        	if(path.indexOf("/")!=-1){
	        		path = prefix + path.substring(0, path.indexOf("/"));
	        	} else{
	        		path = prefix + path.substring(0, path.length());
	        	}
	        	if(node.containsKey(path)){
	        		node.get(path).getContent().add(item);
	        	} else{
	        		NavigatorNode navigatorNode = new NavigatorNode();
	        		navigatorNode.setContent(new ArrayList<RegistryElement>());
	        		navigatorNode.getContent().add(item);
	        		navigatorNode.setPath(path);
	        		navigatorNode.setProject(getProject());
	        		node.put(path, navigatorNode);
	        	}
	        } else{
	    		 String name ="";
		    	  if(item instanceof RegistryItem){
		    		  name = ((RegistryItem)item).getFile();
		    		  NavigatorNode navigatorNode = new NavigatorNode();
		        	  navigatorNode.setContent(new ArrayList<RegistryElement>());
		        	  navigatorNode.setPath(prefix+name);
		        	  navigatorNode.setProject(getProject());
		        	  navigatorNode.setData(item);
		        	  node.put(prefix+name, navigatorNode);
		    	  } else if(item instanceof RegistryDump){
		    		  name = ((RegistryDump)item).getFile();
		    		  NavigatorNode navigatorNode = new NavigatorNode();
		        	  navigatorNode.setContent(new ArrayList<RegistryElement>());
		        	  navigatorNode.setPath(prefix+name);
		        	  navigatorNode.setProject(getProject());
		        	  navigatorNode.setData(item);
		        	  node.put(prefix+name, navigatorNode);
		    	  }else{
		    		  RegistryCollection collection = (RegistryCollection)item;
		    		  File dir = getProject().getFolder(collection.getDirectory()).getLocation().toFile();
		    		  if(dir.exists()){
		    			  node.putAll(createNodes(dir, prefix+name));
		    		  }
		    	  }
	        }
        }
    	return node.values().toArray(new NavigatorNode[]{});

    }

	private Map<String,NavigatorNode> createNodes(File dir,String basePath){
		Map<String,NavigatorNode> nodes = new HashMap<String,NavigatorNode>();
		String[] files = dir.list(new FilenameFilter() {

			public boolean accept(File dir, String name) {
				return !name.equals(".meta");
			}
		});
		for(String filename : files){
			File resource = new File(dir,filename);
			String resourcePath = resource.toString().replaceAll("^" + Pattern.quote(getProject().getLocation().toOSString() + File.separator) ,"");
			if(resource.isDirectory()){
				RegistryCollection collection = new RegistryCollection();
				collection.setPath(basePath + resource.getName());
				collection.setDirectory(resourcePath);
				NavigatorNode navigatorNode = new NavigatorNode();
        		navigatorNode.setContent(new ArrayList<RegistryElement>());
        		navigatorNode.getContent().add(collection);
        		navigatorNode.setPath(basePath + resource.getName());
        		navigatorNode.setProject(getProject());
        		nodes.put(basePath + resource.getName(), navigatorNode);
			} else {
				RegistryItem item = new RegistryItem();
				item.setFile(resourcePath);
				item.setPath(basePath);
				NavigatorNode navigatorNode = new NavigatorNode();
				navigatorNode.setContent(new ArrayList<RegistryElement>());
				navigatorNode.setPath(basePath + resource.getName());
				navigatorNode.setProject(getProject());
				navigatorNode.setData(item);
				nodes.put(basePath + resource.getName(), navigatorNode);
			}
		}
		return nodes;
	}

	public String getText() {
		int index = getPath().lastIndexOf("/");
		if (index == -1 || isRoot() || index == getPath().length()) {
			return path;
		} else {
			return getPath().substring(index + 1);
		}
	}

	public void setRoot(boolean root) {
	    this.root = root;
    }
	public boolean isRoot() {
	    return root;
    }

	public boolean hasChildren() {
	    return getChildren().length!=0;
    }

	public void setContent(List<RegistryElement> content) {
	    this.content = content;
    }
	public List<RegistryElement> getContent() {
	    return content;
    }

	public RegistryElement getData() {
    	return data;
    }
	public void setData(RegistryElement data) {
    	this.data = data;
    }

	public void setProject(IProject project) {
	    this.project = project;
    }

	public IProject getProject() {
	    return project;
    }

	private String path;
	private List<RegistryElement> content;
	private boolean root;
	private RegistryElement data;
	private IProject project;

}


text:
package org.jtwig.render.node.renderer;

import org.jtwig.model.tree.OverrideBlockNode;
import org.jtwig.render.RenderRequest;
import org.jtwig.render.context.model.BlockContext;
import org.jtwig.renderable.Renderable;
import org.jtwig.renderable.impl.EmptyRenderable;
import org.jtwig.resource.reference.ResourceReference;
import org.junit.Test;

import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.*;

public class OverrideBlockNodeRenderTest {
    private final OverrideBlockNodeRender underTest = new OverrideBlockNodeRender();

    @Test
    public void render() throws Exception {
        RenderRequest request = mock(RenderRequest.class, RETURNS_DEEP_STUBS);
        BlockContext blockContext = mock(BlockContext.class);
        OverrideBlockNode blockNode = mock(OverrideBlockNode.class);
        ResourceReference resourceReference = mock(ResourceReference.class);

        when(request.getRenderContext().getCurrent(ResourceReference.class)).thenReturn(resourceReference);
        when(request.getRenderContext().getCurrent(BlockContext.class)).thenReturn(blockContext);

        Renderable result = underTest.render(request, blockNode);

        assertSame(EmptyRenderable.instance(), result);
    }
}