text:
package io.github.ibuildthecloud.gdapi.util;

import static io.github.ibuildthecloud.gdapi.model.Schema.Method.*;

import io.github.ibuildthecloud.gdapi.condition.Condition;
import io.github.ibuildthecloud.gdapi.condition.ConditionType;
import io.github.ibuildthecloud.gdapi.request.ApiRequest;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import javax.servlet.http.HttpServletRequest;

public class RequestUtils {

    public static boolean isBrowser(HttpServletRequest request, boolean checkAccepts) {
        String accepts = request.getHeader("Accept");
        String userAgent = request.getHeader("User-Agent");

        if (accepts == null || !checkAccepts) {
            accepts = "*/*";
        }

        accepts = accepts.toLowerCase();

        // User agent has Mozilla and browser accepts */*
        return (userAgent != null && userAgent.toLowerCase().indexOf("mozilla") != -1 && accepts.indexOf("*/*") != -1);
    }

    public static boolean isReadMethod(String method) {
        return !isWriteMethod(method);
    }

    public static boolean isWriteMethod(String method) {
        return POST.isMethod(method) || PUT.isMethod(method) || DELETE.isMethod(method);
    }

    public static boolean mayHaveBody(String method) {
        return POST.isMethod(method) || PUT.isMethod(method);
    }

    public static String getSingularStringValue(String key, Map<String, Object> params) {
        Object obj = params.get(key);
        Object singleObj = makeSingular(obj);
        return Objects.toString(singleObj, null);
    }

    public static String getConditionValue(String key, Map<Object, Object> params) {
        Object value = params.get(key);
        if (value == null) {
            return null;
        }

        value = makeSingular(value);
        if (value instanceof Condition) {
            return Objects.toString(((Condition) value).getValue(), null);
        }

        return Objects.toString(value, null);
    }

    public static Object makeSingular(Object input) {
        if (input instanceof List) {
            List<?> list = (List<?>)input;
            return list.size() == 0 ? null : list.get(0);
        }

        if (input instanceof String[]) {
            String[] array = (String[])input;
            return array.length == 0 ? null : array[0];
        }

        return input;
    }

    public static Object makeSingularIfCan(Object input) {
        if (input instanceof List) {
            List<?> list = (List<?>)input;
            if (list.size() == 1)
                return makeSingularIfCan(list.get(0));
            if (list.size() == 0)
                return null;
        }

        if (input instanceof String[]) {
            String[] array = (String[])input;
            if (array.length == 1) {
                return makeSingularIfCan(array[0]);
            }
            if (array.length == 0) {
                return null;
            }
            return Arrays.asList(array);
        }

        if (input instanceof Condition && ((Condition)input).getConditionType() == ConditionType.EQ) {
            return makeSingularIfCan(((Condition)input).getValue());
        }

        return input;
    }

    public static String makeSingularStringIfCan(Object input) {
        Object result = makeSingularIfCan(input);
        return result == null ? null : result.toString();
    }

    public static boolean hasBeenHandled(ApiRequest request) {
        if (request.isCommitted() || request.getResponseObject() != null) {
            return true;
        }

        return false;

    }

    public static List<?> toList(Object obj) {
        if (obj instanceof List) {
            return (List<?>)obj;
        } else if (obj == null) {
            return Collections.emptyList();
        } else {
            return Arrays.asList(obj);
        }
    }

    @SuppressWarnings("unchecked")
    public static <K, V> Map<K, V> toMap(Object obj) {
        if (obj == null) {
            return new HashMap<>();
        }

        if (obj instanceof Map) {
            return (Map<K, V>)obj;
        } else {
            return new HashMap<>();
        }
    }

}


text:
import core from 'comindware/core';
import CanvasView from 'demoPage/views/CanvasView';

export default function() {
    const model = new Backbone.Model({
        membersValue: [ 'user.1' ]
    });

    return new CanvasView({
        view: new core.form.editors.MembersBubbleEditor({
            model,
            key: 'membersValue',
            maxQuantitySelected: 7,
            autocommit: true
        }),
        presentation: '[ {{#each membersValue}}\'{{this}}\'{{#unless @last}}, {{/unless}}{{/each}} ]'
    });
}

redpajama_set_name: RedPajamaGithub


text:
        {{ star.name | limitTo: 16 }}

Forks: {{ star.forks_count }}

            {{ star.description }}

        {{ star.stargazers_count }} Stars


text:
namespace DocSharp.Generators
{
    public enum GeneratorKind
    {
        HTML
    }
}


text:
require 'rails_helper'

RSpec.describe Novel, type: :model do
  it { should belong_to(:novel_source) }

  it { should have_many(:comments).dependent(:destroy) }
  it { should have_many(:novel_archives).dependent(:destroy) }
  it { should have_many(:novel_episodes).dependent(:destroy) }

  it { should validate_presence_of(:title) }
  it { should validate_presence_of(:author) }
  it { should validate_presence_of(:uri) }
  it { should validate_presence_of(:episode_count) }
end


text:
import pytest
from functools import partial
import skitai

@pytest.fixture
def launch ():
    return partial (skitai.test_client, port = 30371, silent = False)


text:
package com.swayzetrain.inventory.api.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.swayzetrain.inventory.api.model.UserRolePostRequest;
import com.swayzetrain.inventory.common.model.Role;
import com.swayzetrain.inventory.common.model.User;
import com.swayzetrain.inventory.common.repository.RoleRepository;
import com.swayzetrain.inventory.common.repository.UserRepository;

@Service
public class ApiCommonService {

	@Autowired
	private UserRepository userRepository;

	@Autowired
	private RoleRepository roleRepository;

	public boolean convertUsernameToUserId(UserRolePostRequest userRolePostRequest) {

		if (null == userRolePostRequest.getUserid()) {

			if (null == userRolePostRequest.getUsername()) {

				return false;

			}

			User user = userRepository.findByUsername(userRolePostRequest.getUsername());
			userRolePostRequest.setUserid(user.getUserid());

		}

		return true;
	}

	public boolean convertRoleNameToRoleId(UserRolePostRequest userRolePostRequest) {

		if (null == userRolePostRequest.getRoleid()) {

			if (null == userRolePostRequest.getRolename()) {

				return false;

			}

			Role role = roleRepository.findByRolename(userRolePostRequest.getRolename());
			userRolePostRequest.setRoleid(role.getRoleid());

		}

		return true;
	}

}


text:
#pragma once

#include "mockutils/type_utils.hpp"
#include "fakeit/Xaction.hpp"

namespace fakeit {

// For use in Spy(...) phrases
    template<typename R, typename ... arglist>
    struct SpyingContext : Xaction {
        virtual void appendAction(Action<R, arglist...> *action) = 0;

        virtual std::function<R(arglist&...)> getOriginalMethod() = 0;
    };
}


text:
@interface NSURL (KSPathUtilities)

#pragma mark Scheme
- (NSURL *)ks_URLWithScheme:(NSString *)scheme;

#pragma mark Host
- (NSURL *)ks_hostURL;
- (NSArray *)ks_domains;
- (BOOL)ks_hasNetworkLocation; // checks for a host with 2+ domains
- (NSURL *)ks_URLWithHost:(NSString *)host; // swaps out host for a new one

#pragma mark Paths

+ (NSURL *)ks_URLWithPath:(NSString *)path relativeToURL:(NSURL *)baseURL isDirectory:(BOOL)isDirectory;

+ (NSString *)ks_fileURLStringWithPath:(NSString *)path;

- (BOOL)ks_hasDirectoryPath;
- (NSURL *)ks_URLByAppendingPathComponent:(NSString *)pathComponent isDirectory:(BOOL)isDirectory;

- (BOOL)ks_isSubpathOfURL:(NSURL *)aURL;

#pragma mark Paths - Pre-Snowy compatibility

// If you're targeting 10.6+, these methods are provided by Foundation, so we just #define them for compatibility
#if !(defined MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
- (NSString *)ks_lastPathComponent;
- (NSString *)ks_pathExtension;
- (NSURL *)ks_URLByAppendingPathExtension:(NSString *)pathExtension;
- (NSURL *)ks_URLByDeletingLastPathComponent;
- (NSURL *)ks_URLByDeletingPathExtension;
#else
#define ks_lastPathComponent lastPathComponent
#define ks_pathExtension pathExtension
#define ks_URLByAppendingPathExtension URLByAppendingPathExtension
#define ks_URLByDeletingLastPathComponent URLByDeletingLastPathComponent
#define ks_URLByDeletingPathExtension URLByDeletingPathExtension
#endif

#pragma mark RFC 1808
- (BOOL)ks_canBeDecomposed;

#pragma mark Comparison
- (BOOL)ks_isEqualToURL:(NSURL *)URL;   // For file: URLs, checks path equality
- (BOOL)ks_isEqualExceptFragmentToURL:(NSURL *)anotherURL;

#pragma mark Relative URLs
// These methods return nil if the receiver can't be reached by a relative string. In practice, to my knowledge that only happens for a URL from an empty string (@"")
- (NSString *)ks_stringRelativeToURL:(NSURL *)URL;
- (NSURL *)ks_URLRelativeToURL:(NSURL *)URL;

#pragma mark Security-Scoped Bookmarks
// Automatically:
// * stops access to the resource at the end of the block, even if an exception is thrown
// * runs the block pre-10.7.3. On those older OS releases, the value of 'started' is undefined
- (void)ks_accessSecurityScopedResourceUsingBlock:(void (^)(BOOL started))block;

#pragma mark Components
- (NSURL *)ks_URLByReplacingComponent:(CFURLComponentType)component withString:(NSString *)string;

@end

#pragma mark -

@interface NSString (KSURLUtilities)

// Cocoa equivalent of the full CoreFoundation API
- (NSString *)ks_stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)encoding
                             charactersToLeaveUnescaped:(NSString *)unescapedCharacters
                          legalURLCharactersToBeEscaped:(NSString *)legalCharactersToEscape;

// For escaping anything where you want a / character left intact. But do NOT use on a full URL, because it will escape the & characters
- (NSString *)ks_stringByAddingPercentEscapesWithSpacesAsPlusCharacters:(BOOL)encodeSpacesAsPlusCharacters;
- (NSString *)ks_stringByAddingPercentEscapesWithSpacesAsPlusCharacters:(BOOL)encodeSpacesAsPlusCharacters escape:(NSString *)toEscape;

- (NSString *)ks_URLDirectoryPath;

@end


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

<title>PackageRelationshipTypes (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.poi.openxml4j.opc

Interface PackageRelationshipTypes

public interface PackageRelationshipTypes

Relationship types.

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
CORE_DOCUMENT

Core document relationship type.

static java.lang.String
CORE_PROPERTIES

Core properties relationship type.

static java.lang.String
CORE_PROPERTIES_ECMA376

Core properties relationship type as defiend in ECMA 376.

static java.lang.String
CUSTOM_PROPERTIES

Custom properties relationship type.

static java.lang.String
CUSTOM_XML

Custom XML relationship type.

static java.lang.String
DIGITAL_SIGNATURE

Digital signature relationship type.

static java.lang.String
DIGITAL_SIGNATURE_CERTIFICATE

Digital signature certificate relationship type.

static java.lang.String
DIGITAL_SIGNATURE_ORIGIN

Digital signature origin relationship type.

static java.lang.String
EXTENDED_PROPERTIES

Extended properties relationship type.

static java.lang.String
EXTERNAL_LINK_PATH

External Link to another Document

static java.lang.String
HYPERLINK_PART

Hyperlink type.

static java.lang.String
IMAGE_PART

Image type.

static java.lang.String
STRICT_CORE_DOCUMENT

Core document relationship type for strict ooxml.

static java.lang.String
STRICT_EXTENDED_PROPERTIES

Extended properties relationship type for strict ooxml.

static java.lang.String
STYLE_PART

Style type.

static java.lang.String
THUMBNAIL

Thumbnail relationship type.

static java.lang.String
VISIO_CORE_DOCUMENT

Visio 2010 VSDX equivalent of package CORE_DOCUMENT

Field Detail

CORE_PROPERTIES

static final java.lang.String CORE_PROPERTIES

Core properties relationship type.

  The standard specifies a source relations ship for the Core File Properties part as follows:
  http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties.

   Office uses the following source relationship for the Core File Properties part:
   http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties.

 See 2.1.33 Part 1 Section 15.2.11.1, Core File Properties Part in [MS-OE376].pdf

See Also:

Constant Field Values

CORE_PROPERTIES_ECMA376

static final java.lang.String CORE_PROPERTIES_ECMA376

Core properties relationship type as defiend in ECMA 376.

See Also:

Constant Field Values

DIGITAL_SIGNATURE

static final java.lang.String DIGITAL_SIGNATURE

Digital signature relationship type.

See Also:

Constant Field Values

DIGITAL_SIGNATURE_CERTIFICATE

static final java.lang.String DIGITAL_SIGNATURE_CERTIFICATE

Digital signature certificate relationship type.

See Also:

Constant Field Values

DIGITAL_SIGNATURE_ORIGIN

static final java.lang.String DIGITAL_SIGNATURE_ORIGIN

Digital signature origin relationship type.

See Also:

Constant Field Values

THUMBNAIL

static final java.lang.String THUMBNAIL

Thumbnail relationship type.

See Also:

Constant Field Values

EXTENDED_PROPERTIES

static final java.lang.String EXTENDED_PROPERTIES

Extended properties relationship type.

See Also:

Constant Field Values

STRICT_EXTENDED_PROPERTIES

static final java.lang.String STRICT_EXTENDED_PROPERTIES

Extended properties relationship type for strict ooxml.

See Also:

Constant Field Values

CUSTOM_PROPERTIES

static final java.lang.String CUSTOM_PROPERTIES

Custom properties relationship type.

See Also:

Constant Field Values

CORE_DOCUMENT

static final java.lang.String CORE_DOCUMENT

Core document relationship type.

See Also:

Constant Field Values

STRICT_CORE_DOCUMENT

static final java.lang.String STRICT_CORE_DOCUMENT

Core document relationship type for strict ooxml.

See Also:

Constant Field Values

CUSTOM_XML

static final java.lang.String CUSTOM_XML

Custom XML relationship type.

See Also:

Constant Field Values

IMAGE_PART

static final java.lang.String IMAGE_PART

Image type.

See Also:

Constant Field Values

HYPERLINK_PART

static final java.lang.String HYPERLINK_PART

Hyperlink type.

See Also:

Constant Field Values

STYLE_PART

static final java.lang.String STYLE_PART

Style type.

See Also:

Constant Field Values

EXTERNAL_LINK_PATH

static final java.lang.String EXTERNAL_LINK_PATH

External Link to another Document

See Also:

Constant Field Values

VISIO_CORE_DOCUMENT

static final java.lang.String VISIO_CORE_DOCUMENT

Visio 2010 VSDX equivalent of package CORE_DOCUMENT

See Also:

Constant Field Values

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

                Copyright 2016 The Apache Software Foundation or
        its licensors, as applicable.


text:
package com.hazelcast.client.impl.protocol.task.dynamicconfig;

import com.hazelcast.client.impl.protocol.ClientMessage;
import com.hazelcast.client.impl.protocol.codec.DynamicConfigAddQueueConfigCodec;
import com.hazelcast.config.ItemListenerConfig;
import com.hazelcast.config.MergePolicyConfig;
import com.hazelcast.config.QueueConfig;
import com.hazelcast.config.QueueStoreConfig;
import com.hazelcast.instance.impl.Node;
import com.hazelcast.internal.dynamicconfig.DynamicConfigurationAwareConfig;
import com.hazelcast.internal.nio.Connection;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;

import java.util.List;

public class AddQueueConfigMessageTask
        extends AbstractAddConfigMessageTask<DynamicConfigAddQueueConfigCodec.RequestParameters> {

    public AddQueueConfigMessageTask(ClientMessage clientMessage, Node node, Connection connection) {
        super(clientMessage, node, connection);
    }

    @Override
    protected DynamicConfigAddQueueConfigCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) {
        return DynamicConfigAddQueueConfigCodec.decodeRequest(clientMessage);
    }

    @Override
    protected ClientMessage encodeResponse(Object response) {
        return DynamicConfigAddQueueConfigCodec.encodeResponse();
    }

    @Override
    protected IdentifiedDataSerializable getConfig() {
        QueueConfig config = new QueueConfig(parameters.name);
        config.setAsyncBackupCount(parameters.asyncBackupCount);
        config.setBackupCount(parameters.backupCount);
        config.setEmptyQueueTtl(parameters.emptyQueueTtl);
        config.setMaxSize(parameters.maxSize);
        config.setSplitBrainProtectionName(parameters.splitBrainProtectionName);
        config.setStatisticsEnabled(parameters.statisticsEnabled);
        if (parameters.queueStoreConfig != null) {
            QueueStoreConfig storeConfig = parameters.queueStoreConfig.asQueueStoreConfig(serializationService);
            config.setQueueStoreConfig(storeConfig);
        }
        if (parameters.listenerConfigs != null && !parameters.listenerConfigs.isEmpty()) {
            List<ItemListenerConfig> itemListenerConfigs =
                    (List<ItemListenerConfig>) adaptListenerConfigs(parameters.listenerConfigs);
            config.setItemListenerConfigs(itemListenerConfigs);
        }
        MergePolicyConfig mergePolicyConfig = mergePolicyConfig(parameters.mergePolicy, parameters.mergeBatchSize);
        config.setMergePolicyConfig(mergePolicyConfig);
        if (parameters.isPriorityComparatorClassNameExists) {
            config.setPriorityComparatorClassName(parameters.priorityComparatorClassName);
        }
        return config;
    }

    @Override
    public String getMethodName() {
        return "addQueueConfig";
    }

    @Override
    protected boolean checkStaticConfigDoesNotExist(IdentifiedDataSerializable config) {
        DynamicConfigurationAwareConfig nodeConfig = (DynamicConfigurationAwareConfig) nodeEngine.getConfig();
        QueueConfig queueConfig = (QueueConfig) config;
        return nodeConfig.checkStaticConfigDoesNotExist(nodeConfig.getStaticConfig().getQueueConfigs(),
                queueConfig.getName(), queueConfig);
    }
}


text:
package org.apache.flink.runtime.executiongraph.failover.flip1;

import org.apache.flink.runtime.io.network.partition.ResultPartitionType;
import org.apache.flink.runtime.scheduler.strategy.TestingSchedulingExecutionVertex;
import org.apache.flink.runtime.scheduler.strategy.TestingSchedulingTopology;
import org.apache.flink.util.TestLogger;

import org.junit.Test;

import java.util.Arrays;
import java.util.HashSet;

import static org.junit.Assert.assertEquals;

/** Tests for {@link RestartAllFailoverStrategy}. */
public class RestartAllFailoverStrategyTest extends TestLogger {

    @Test
    public void testGetTasksNeedingRestart() {
        final TestingSchedulingTopology topology = new TestingSchedulingTopology();

        final TestingSchedulingExecutionVertex v1 = topology.newExecutionVertex();
        final TestingSchedulingExecutionVertex v2 = topology.newExecutionVertex();
        final TestingSchedulingExecutionVertex v3 = topology.newExecutionVertex();

        topology.connect(v1, v2, ResultPartitionType.PIPELINED);
        topology.connect(v2, v3, ResultPartitionType.BLOCKING);

        final RestartAllFailoverStrategy strategy = new RestartAllFailoverStrategy(topology);

        assertEquals(
                new HashSet<>(Arrays.asList(v1.getId(), v2.getId(), v3.getId())),
                strategy.getTasksNeedingRestart(v1.getId(), new Exception("Test failure")));
    }
}


text:
package org.elasticsearch.action.ingest;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentParser.Token;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg;
import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken;

public class SimulatePipelineResponse extends ActionResponse implements ToXContentObject {
    private String pipelineId;
    private boolean verbose;
    private List<SimulateDocumentResult> results;

    @SuppressWarnings("unchecked")
    public static final ConstructingObjectParser<SimulatePipelineResponse, Void> PARSER =
        new ConstructingObjectParser<>(
            "simulate_pipeline_response",
            true,
            a -> {
                List<SimulateDocumentResult> results = (List<SimulateDocumentResult>)a[0];
                boolean verbose = false;
                if (results.size() > 0) {
                    if (results.get(0) instanceof SimulateDocumentVerboseResult) {
                        verbose = true;
                    }
                }
                return new SimulatePipelineResponse(null, verbose, results);
            }
        );
    static {
        PARSER.declareObjectArray(
            constructorArg(),
            (parser, context) -> {
                Token token = parser.currentToken();
                ensureExpectedToken(Token.START_OBJECT, token, parser::getTokenLocation);
                SimulateDocumentResult result = null;
                while ((token = parser.nextToken()) != Token.END_OBJECT) {
                    ensureExpectedToken(token, Token.FIELD_NAME, parser::getTokenLocation);
                    String fieldName = parser.currentName();
                    token = parser.nextToken();
                    if (token == Token.START_ARRAY) {
                        if (fieldName.equals(SimulateDocumentVerboseResult.PROCESSOR_RESULT_FIELD)) {
                            List<SimulateProcessorResult> results = new ArrayList<>();
                            while ((token = parser.nextToken()) == Token.START_OBJECT) {
                                results.add(SimulateProcessorResult.fromXContent(parser));
                            }
                            ensureExpectedToken(Token.END_ARRAY, token, parser::getTokenLocation);
                            result = new SimulateDocumentVerboseResult(results);
                        } else {
                            parser.skipChildren();
                        }
                    } else if (token.equals(Token.START_OBJECT)) {
                        switch (fieldName) {
                            case WriteableIngestDocument.DOC_FIELD:
                                result = new SimulateDocumentBaseResult(
                                    WriteableIngestDocument.INGEST_DOC_PARSER.apply(parser, null).getIngestDocument()
                                );
                                break;
                            case "error":
                                result = new SimulateDocumentBaseResult(ElasticsearchException.fromXContent(parser));
                                break;
                            default:
                                parser.skipChildren();
                                break;
                        }
                    } // else it is a value skip it
                }
                assert result != null;
                return result;
            },
            new ParseField(Fields.DOCUMENTS));
    }

    public SimulatePipelineResponse() {

    }

    public SimulatePipelineResponse(String pipelineId, boolean verbose, List<SimulateDocumentResult> responses) {
        this.pipelineId = pipelineId;
        this.verbose = verbose;
        this.results = Collections.unmodifiableList(responses);
    }

    public String getPipelineId() {
        return pipelineId;
    }

    public List<SimulateDocumentResult> getResults() {
        return results;
    }

    public boolean isVerbose() {
        return verbose;
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        out.writeOptionalString(pipelineId);
        out.writeBoolean(verbose);
        out.writeVInt(results.size());
        for (SimulateDocumentResult response : results) {
            response.writeTo(out);
        }
    }

    @Override
    public void readFrom(StreamInput in) throws IOException {
        super.readFrom(in);
        this.pipelineId = in.readOptionalString();
        boolean verbose = in.readBoolean();
        int responsesLength = in.readVInt();
        results = new ArrayList<>();
        for (int i = 0; i < responsesLength; i++) {
            SimulateDocumentResult simulateDocumentResult;
            if (verbose) {
                simulateDocumentResult = new SimulateDocumentVerboseResult(in);
            } else {
                simulateDocumentResult = new SimulateDocumentBaseResult(in);
            }
            results.add(simulateDocumentResult);
        }
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.startObject();
        builder.startArray(Fields.DOCUMENTS);
        for (SimulateDocumentResult response : results) {
            response.toXContent(builder, params);
        }
        builder.endArray();
        builder.endObject();
        return builder;
    }

    public static SimulatePipelineResponse fromXContent(XContentParser parser) {
        return PARSER.apply(parser, null);
    }

    static final class Fields {
        static final String DOCUMENTS = "docs";
    }
}


text:
Creates and prints a randomly generated maze.

To use, just compile and run GenerateMaze.

Features:

     Variable height and width mazes.
     Growing Tree algorithm for maze gneeration.
     Graphics to output the maze, with option to show solution.

What I Learned:

     Common algorithms used in maze solving/maze generation.
     How to structure and manipulate a maze using arrays and subclasses.

Needs Work:

     Output is done using school-provided code (DrawingPanel). Need to rewrite.


text:
layout: relation
title: 'nsubj'
shortdef: 'nominal subject'
udver: '2'
---

The dependency type `nsubj` marks nominal subjects of a clause. Subjects are direct dependents of the main predicate of the clause, which may be a verb, noun or adjective.

~~~ sdparse
Тетям рамась чипсат . \n My father bought some chips .
nsubj(рамась, Тетям)
~~~

~~~ sdparse
Тетям од . \n My father is young .
nsubj(од, Тонавтыцясь)
~~~

~~~ sdparse
Тетям вадря пидиця-паниця . \n My father is a good cook .
nsubj(пидиця-паниця, Тетям)
~~~

<!-- Interlanguage links updated Po lis 14 15:35:33 CET 2022 -->


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/timefly_album_pressed" android:state_pressed="true"/>
    <item android:drawable="@drawable/timefly_album_normal"></item>

</selector>


text:
package org.mJeliot.model;

import java.util.Vector;

import org.mJeliot.protocol.Route;
import org.mJeliot.protocol.ProtocolParser;

public class RemoteController {

	private final Route messageRouter;
	private int animationSpeed;
	private Vector<RemoteControllerListener> listeners = new Vector<RemoteControllerListener>();

	public RemoteController(Route messageRouter) {
		this.messageRouter = messageRouter;

	}

	public void step() {
		this.sendControl(-1, "step");
	}

	public void play() {
		this.sendControl(-1, "play");
	}

	public void pause() {
		this.sendControl(-1, "pause");
	}

	public void rewind() {
		this.sendControl(-1, "rewind");
	}

	public void control() {
		this.sendControl(-1, "control");
	}
	public void endControl() {
		this.sendControl(-1, "endControl");
	}

	private void sendControl(int animationSpeed, String command) {
		messageRouter.sendMessage(ProtocolParser.generateRemoteCommand(
				messageRouter.getLecture().getId(), messageRouter.getUser()
						.getId(), messageRouter.getDestination(), animationSpeed, command));
	}

	public void changeAnimationSpeed(int animationSpeed) {
		this.sendControl(animationSpeed, "changeAnimationSpeed");
	}

	public void setAnimationSpeed(int animationSpeed) {
		if (animationSpeed != -1) {
			this.animationSpeed = animationSpeed;
			this.fireOnAnimationSpeedChanged();
		}
	}

	private void fireOnAnimationSpeedChanged() {
		for (RemoteControllerListener listener : this.listeners ) {
			listener.onAnimationSpeedChanged(this, this.animationSpeed);
		}
	}

	public int getAnimationSpeed() {
		return this.animationSpeed;
	}

	public void addRemoteControllerListener(RemoteControllerListener remoteControllerListener) {
		if (!this.listeners.contains(remoteControllerListener)) {
			this.listeners.add(remoteControllerListener);
		}
	}
	public void removeRemoteControllerListener(RemoteControllerListener remoteControllerListener) {
		this.listeners.remove(remoteControllerListener);
	}
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<servico xsi:schemaLocation="http://servicos.gov.br/v3/schema.../servico.xsd" xmlns="http://servicos.gov.br/v3/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <id>obter-aprovacao-do-programa-anual-de-trabalho-e-orcamento-para-os-campos-de-petroleo-e-gas-natural</id>
    <dbId>3316</dbId>
    <nome>Obter aprovação do Programa Anual de Trabalho e Orçamento para os campos de petróleo e gás natural</nome>
    <sigla></sigla>
    <descricao>Consiste em: (i) receber dos Operadores de Contrato de Contrato de Concessão, Partilha e Cessão Onerosa a(s) documentação(ões) referente ao PAT de um campo; (ii) analisar a(s) documentação(ões); (iii) elaborar Despacho, (iv) enviar ofício ao Operador; (v) elaborar Exposição de Assunto e (vi) publicar no site da ANP o ato administrativo.</descricao>
    <contato></contato>
    <gratuito>true</gratuito>
    <porcentagem-manual>false</porcentagem-manual>
    <servico-digital>false</servico-digital>
    <link-servico-digital></link-servico-digital>
    <solicitantes>
        <solicitante id="3903">
            <tipo>Operadores de Contrato de Contrato de Concessão, Partilha e Cessão Onerosa</tipo>
            <requisitos></requisitos>
        </solicitante>
    </solicitantes>
    <tempo-total-estimado>
        <entre min="31" max="60" unidade="dias-corridos"/>
        <descricao></descricao>
    </tempo-total-estimado>
    <validade-documento>
        <descricao></descricao>
    </validade-documento>
    <etapas>
        <etapa id="7432">
            <titulo>Solicitar autorização</titulo>
            <descricao></descricao>
            <documentos>
                <default>
                    <item id="10565">Programa Anual de Trabalho e Orçamento</item>
                </default>
            </documentos>
            <custos>
                <default/>
            </custos>
            <canais-de-prestacao>
                <default>
                    <canal-de-prestacao id="7870" tipo="presencial">
                        <descricao>**Agência Nacional de Petróleo, Gás Natural e Biocombustíveis** - Av. Rio Branco, 65 / 22º andar - 20090-004 - Rio de Janeiro - RJ</descricao>
                    </canal-de-prestacao>
                </default>
            </canais-de-prestacao>
        </etapa>
    </etapas>
    <orgao id="http://estruturaorganizacional.dados.gov.br/id/unidade-organizacional/25281" dbId="917">
        <nomeOrgao>Agência Nacional do Petróleo, Gás Natural e Biocombustíveis (ANP)</nomeOrgao>
    </orgao>
    <segmentos-da-sociedade>
        <item idSegmento="3" idServicoSegmento="7358">Empresas</item>
    </segmentos-da-sociedade>
    <areas-de-interesse>
        <item>Energia</item>
        <item>Combustíveis</item>
    </areas-de-interesse>
    <palavras-chave>
        <item id="13661">petróleo</item>
        <item id="13662">plano</item>
        <item id="13663">anp</item>
    </palavras-chave>
</servico>


text:
import json
import re
import socket
import time

import requests
from fabric import colors

class Notifier(object):
    NICK = 'django-fabric'

    def message_payload(self):
        return {}

    def notification_message_context(self, instance):
        return {
            'url': self.urls[instance],
            'status': self.status_code
        }

    def pre_deploy_notify(self, instance):
        self.send_notification('Deploying %(url)s' % self.notification_message_context(instance))

    def post_deploy_notify(self, instance):
        self.send_notification('Finished deploying %(url)s it responds with status %(status)s' %
                               self.notification_message_context(instance))

    def send_notification(self, message):
        raise NotImplemented

class IrcNotifyMixin(Notifier):
    SERVER = 'irc.freenode.org'
    PORT = 6667
    ROOMS = []
    TIMEOUT = 25

    def post_deploy_notify(self, instance):
        pass

    def send_notification(self, message):
        irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        irc.settimeout(self.TIMEOUT)
        irc.connect((self.SERVER, self.PORT))
        irc.send("USER %s %s %s :django-fabric\n" % ((self.NICK,) * 3))
        irc.send("NICK %s\n" % self.NICK)
        start = time.time()
        while (time.time() - start) < self.TIMEOUT:
            irc_message = irc.recv(2048).strip('\n\r')
            pong = re.compile(r'^PING\s*:\s*(.*)$').findall(irc_message)

            if pong:
                irc.send("PONG %s\n" % pong)

            if re.findall(' 00[1-4] %s' % self.NICK, irc_message):
                for room in self.ROOMS:
                    irc.send("JOIN %s\n" % room)
                    irc.send("PRIVMSG %s :%s\n" % (room, message))
                    irc.send("PART %s\n" % room)

                break

        irc.send("QUIT\n")
        irc.close()

class SlackNotifyMixin(Notifier):
    CHANNEL = '#general'

    def send_notification(self, message):
        payload = {
            'channel': self.CHANNEL,
            'username': self.NICK,
            'text': message
        }
        data = {'payload': json.dumps(payload)}
        if requests.post(self.URL, data=data).status_code != requests.codes.ok:
            print(colors.yellow('Could not notify Slack'))

class HipChatNotifyMixin(Notifier):
    URL = 'https://api.hipchat.com/v2/room/%s/notification?auth_token=%s'
    COLOR = 'yellow'
    NOTIFY = False

    def send_notification(self, message):
        payload = {
            'message': message,
            'color': self.COLOR,
            'notify': self.NOTIFY
        }
        url = self.URL % (self.ROOM, self.HIPCHAT_TOKEN)
        data = {'payload': json.dumps(payload)}

        if requests.post(url, data=data).status_code != requests.codes.ok:
            print(colors.yellow('Could not notify HipChat'))


text:
namespace protobuf_unittest_import {

// Internal implementation detail -- do not call these.
void  protobuf_AddDesc_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto();
void protobuf_AssignDesc_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto();
void protobuf_ShutdownFile_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto();

class PublicImportMessage;

// ===================================================================

class PublicImportMessage : public ::google::protobuf::Message {
 public:
  PublicImportMessage();
  virtual ~PublicImportMessage();

  PublicImportMessage(const PublicImportMessage& from);

  inline PublicImportMessage& operator=(const PublicImportMessage& from) {
    CopyFrom(from);
    return *this;
  }

  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
    return _unknown_fields_;
  }

  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
    return &_unknown_fields_;
  }

  static const ::google::protobuf::Descriptor* descriptor();
  static const PublicImportMessage& default_instance();

  void Swap(PublicImportMessage* other);

  // implements Message ----------------------------------------------

  PublicImportMessage* New() const;
  void CopyFrom(const ::google::protobuf::Message& from);
  void MergeFrom(const ::google::protobuf::Message& from);
  void CopyFrom(const PublicImportMessage& from);
  void MergeFrom(const PublicImportMessage& from);
  void Clear();
  bool IsInitialized() const;

  int ByteSize() const;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input);
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const;
  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
  int GetCachedSize() const { return _cached_size_; }
  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const;
  public:
  ::google::protobuf::Metadata GetMetadata() const;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // optional int32 e = 1;
  inline bool has_e() const;
  inline void clear_e();
  static const int kEFieldNumber = 1;
  inline ::google::protobuf::int32 e() const;
  inline void set_e(::google::protobuf::int32 value);

  // @@protoc_insertion_point(class_scope:protobuf_unittest_import.PublicImportMessage)
 private:
  inline void set_has_e();
  inline void clear_has_e();

  ::google::protobuf::UnknownFieldSet _unknown_fields_;

  ::google::protobuf::uint32 _has_bits_[1];
  mutable int _cached_size_;
  ::google::protobuf::int32 e_;
  friend void  protobuf_AddDesc_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto();
  friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto();
  friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto();

  void InitAsDefaultInstance();
  static PublicImportMessage* default_instance_;
};
// ===================================================================

// ===================================================================

// PublicImportMessage

// optional int32 e = 1;
inline bool PublicImportMessage::has_e() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void PublicImportMessage::set_has_e() {
  _has_bits_[0] |= 0x00000001u;
}
inline void PublicImportMessage::clear_has_e() {
  _has_bits_[0] &= ~0x00000001u;
}
inline void PublicImportMessage::clear_e() {
  e_ = 0;
  clear_has_e();
}
inline ::google::protobuf::int32 PublicImportMessage::e() const {
  // @@protoc_insertion_point(field_get:protobuf_unittest_import.PublicImportMessage.e)
  return e_;
}
inline void PublicImportMessage::set_e(::google::protobuf::int32 value) {
  set_has_e();
  e_ = value;
  // @@protoc_insertion_point(field_set:protobuf_unittest_import.PublicImportMessage.e)
}

// @@protoc_insertion_point(namespace_scope)

}  // namespace protobuf_unittest_import

#ifndef SWIG
namespace google {
namespace protobuf {

}  // namespace google
}  // namespace protobuf
#endif  // SWIG

// @@protoc_insertion_point(global_scope)

#endif  // PROTOBUF_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto__INCLUDED


text:
<?php

if (!defined('PGV_PHPGEDVIEW')) {
	header('HTTP/1.0 403 Forbidden');
	exit;
}

$pgv_lang["advanced_name_fields"]	= "Noms addicionals (noms familiars, diminutius, àlies, motiu, malnom, nom de casada,...)";
$pgv_lang["accept_changes"] 		= "Reviseu les modificacions.";
$pgv_lang["replace"]				= "Modifica un registre";
$pgv_lang["append"] 				= "Afegeix un registre";
$pgv_lang["review_changes"] 		= "Revisió de les modificacions del GEDCOM";
$pgv_lang["remove_object"]			= "Elimina l'objecte";
$pgv_lang["remove_links"]			= "Elimina els enllaços";
$pgv_lang["media_not_deleted"]		= "Directori multimèdia no eliminat.";
$pgv_lang["thumbs_not_deleted"]		= "Directori de miniatures no eliminat.";
$pgv_lang["thumbs_deleted"]			= "Eliminat correctament el directori de miniatures.";
$pgv_lang["show_thumbnail"]			= "Mostra les miniatures";
$pgv_lang["link_media"]				= "Enllaça multimèdia";
$pgv_lang["to_person"]				= "A una persona";
$pgv_lang["to_family"]				= "A una família";
$pgv_lang["to_source"]				= "A una font";
$pgv_lang["edit_fam"]				= "Edita família";
$pgv_lang["copy"]					= "Copia";
$pgv_lang["cut"]					= "Talla";
$pgv_lang["sort_by_birth"]			= "Ordena per dates de naixement";
$pgv_lang["reorder_children"]		= "Reordeneu la mainada";
$pgv_lang["add_from_clipboard"]		= "Enganxa: ";
$pgv_lang["record_copied"]			= "Registre enganxat";
$pgv_lang["add_unlinked_person"]	= "Addició d'una persona desvinculada";
$pgv_lang["add_unlinked_source"]	= "Addició d'una font desvinculada";
$pgv_lang["server_file"]			= "Nom del fitxer al servidor";
$pgv_lang["server_file_advice"]		= "No ho canvieu per conservar el nom de fitxer original.";
$pgv_lang["server_file_advice2"]	= "També podeu entrar-hi un URL, començant amb «http://».";
$pgv_lang["server_folder_advice"]	= "Es poden entrar fins a #GLOBALS[MEDIA_DIRECTORY_LEVELS]# noms de carpeta a continuació del «#GLOBALS[MEDIA_DIRECTORY]#» per defecte.
No entreu la part «#GLOBALS[MEDIA_DIRECTORY]#» del destí del nom de la carpeta.";
$pgv_lang["server_folder_advice2"]	= "Aquesta entrada s'ignorarà si heu entrat un URL al camp nom de fitxer.";
$pgv_lang["add_linkid_advice"]		= "Entreu o cerqueu l'ID de la persona, família o font al que cal vincular aquest ítem multimèdia.";
$pgv_lang["use_browse_advice"]		= "Feu servir el botó «Cerca» per cercar al vostre ordinador el fitxer desitjat.";
$pgv_lang["add_media_other_folder"]	= "Altres carpetes... entreu-les";
$pgv_lang["add_media_file"]			= "Fitxer de multimèdia existent al servidor";
$pgv_lang["main_media_ok1"]			= "El fitxer principal de multimèdia #GLOBALS[oldMediaName]# s'ha reanomenat correctament com #GLOBALS[newMediaName]#.";
$pgv_lang["main_media_ok2"]			= "El fitxer principal de multimèdia #GLOBALS[oldMediaName]# s'ha canviat correctament de #GLOBALS[oldMediaFolder]# a #GLOBALS[newMediaFolder]#.";
$pgv_lang["main_media_ok3"]			= "El fitxer principal multimèdia s'ha canviat i reanomenat correctament de #GLOBALS[oldMediaFolder]##GLOBALS[oldMediaName]# a #GLOBALS[newMediaFolder]##GLOBALS[newMediaName]#.";
$pgv_lang["main_media_fail0"]		= "El fitxer principal de multimèdia #GLOBALS[oldMediaFolder]##GLOBALS[oldMediaName]# no hi és.";
$pgv_lang["main_media_fail1"]		= "El fitxer principal de multimèdia #GLOBALS[oldMediaName]# no pot reanomenar-se com #GLOBALS[newMediaName]#.";
$pgv_lang["main_media_fail2"]		= "El fitxer principal de multimèdia #GLOBALS[oldMediaName]# no por ésser canviat de #GLOBALS[oldMediaFolder]# a #GLOBALS[newMediaFolder]#.";
$pgv_lang["main_media_fail3"]		= "El fitxer principal de multimèdia no pot reanomenar-se i canviar-se de #GLOBALS[oldMediaFolder]##GLOBALS[oldMediaName]# a #GLOBALS[newMediaFolder]##GLOBALS[newMediaName]#.";
$pgv_lang["resn_disabled"]				= "Nota: Us cal activar la propietat 'Empra restricció de privadesa GEDCOM (RESN)' per a que aquest paràmetre tingui efecte";
$pgv_lang["thumb_media_ok1"]		= "Fitxer de miniatures #GLOBALS[oldMediaName]# correctament reanomenat a #GLOBALS[newMediaName]#.";
$pgv_lang["thumb_media_ok2"]		= "Fitxer de miniatures #GLOBALS[oldMediaName]# correctament canviat de #GLOBALS[oldThumbFolder]# a #GLOBALS[newThumbFolder]#.";
$pgv_lang["thumb_media_ok3"]		= "Fitxer de miniatures correctament reanomenat i canviat de #GLOBALS[oldThumbFolder]##GLOBALS[oldMediaName]# a #GLOBALS[newThumbFolder]##GLOBALS[newMediaName]#.";
$pgv_lang["thumb_media_fail0"]		= "El fitxer de miniatures #GLOBALS[oldThumbFolder]##GLOBALS[oldMediaName]# no hi és.";
$pgv_lang["thumb_media_fail1"]		= "El fitxer de miniatures #GLOBALS[oldMediaName]# no pot reanomenar-se com #GLOBALS[newMediaName]#.";
$pgv_lang["thumb_media_fail2"]		= "El fitxer de miniatures #GLOBALS[oldMediaName]# no pot moure's de #GLOBALS[oldThumbFolder]# a #GLOBALS[newThumbFolder]#.";
$pgv_lang["thumb_media_fail3"]		= "El fitxer de miniatures no pot reanomenar-se i moure's de #GLOBALS[oldThumbFolder]##GLOBALS[oldMediaName]# a #GLOBALS[newThumbFolder]##GLOBALS[newMediaName]#.";
$pgv_lang["add_asso"]				= "Afegeix un nou associat";
$pgv_lang["edit_sex"]				= "Edita el sexe";
$pgv_lang["add_obje"]				= "Afegeix un objecte multimèdia";
$pgv_lang["add_name"]				= "Afegeix un altre nom";
$pgv_lang["edit_raw"]				= "Edita el registre primari GEDCOM";
$pgv_lang["label_add_remote_link"]  = "Afegeix l'enllaç";
$pgv_lang["label_gedcom_id"]        = "ID de la Base de Dades";
$pgv_lang["label_local_id"]         = "ID de la persona";
$pgv_lang["accept"] 				= "D'acord";
$pgv_lang["accept_all"] 			= "D'acord amb els canvis";
$pgv_lang["accept_gedcom"]			= "Decidiu per cada canvi si acceptar-lo o rebutjar-lo.

Per acceptar-los tots de cop, polseu \"D'acord amb els canvis\" al caixetí següent.
Per disposar de més informació d'un canvi,
polseu \"Mostra el què s'ha canviat\" per veure les diferències,
o polseu \"Veure el registre GEDCOM\" per veure les noves dades en format GEDCOM.";
$pgv_lang["accept_successful"]		= "S'han acceptat correctament els canvis a la base de dades";
$pgv_lang["add_child"]				= "Afegeix mainada";
$pgv_lang["add_child_to_family"]	= "Afegeix mainada a aquesta família";
$pgv_lang["add_fact"]				= "Afegeix un esdeveniment";
$pgv_lang["add_father"] 			= "Afegeix un nou pare";
$pgv_lang["add_husb"]				= "Afegeix-li un marit";
$pgv_lang["add_husb_to_family"] 	= "Afegeix un marit a aquesta família";
$pgv_lang["add_media"]				= "Crea un ítem multimèdia nou";
$pgv_lang["add_media_lbl"]			= "Afegeix un fitxer multimèdia";
$pgv_lang["add_mother"] 			= "Afegeix una nova mare";
$pgv_lang["add_new_chil"] 			= "Afegeix més canalla";
$pgv_lang["add_new_husb"]			= "Crea una nova persona i vincula'l com a espòs";
$pgv_lang["add_new_wife"]			= "Crea una nova persona i vincula-la com a muller";
$pgv_lang["add_note"]				= "Afegeix una nova nota";
$pgv_lang["add_note_lbl"]			= "Afegeix una nota";
$pgv_lang["add_sibling"]			= "Afegeix un germà o germana";
$pgv_lang["add_son_daughter"]		= "Afegeix un fill o filla";
$pgv_lang["add_source"] 			= "Afegeix una nova ressenya de font";
$pgv_lang["add_source_lbl"] 		= "Afegeix una ressenya de font";
$pgv_lang["add_wife"]				= "Afegeix-li una esposa";
$pgv_lang["add_wife_to_family"] 	= "Afegeix una esposa a aquesta família";
$pgv_lang["advanced_search_discription"] = "Recerca avançada de llocs";
$pgv_lang["auto_thumbnail"]			= "Miniatura automàtica";
$pgv_lang["basic_search"]			= "busca";
$pgv_lang["basic_search_discription"] = "Recerca bàsica del lloc";
$pgv_lang["birthdate_search"]		= "Data de naixement: ";
$pgv_lang["birthplace_search"]		= "Lloc de naixement: ";
$pgv_lang["change"]					= "Canvia";
$pgv_lang["change_family_instr"]	= "Feu servir aquesta pàgina per canviar o eliminar membres de la família.

Per cada membre de la família podeu fer servir l'enllaç Canvia per escollir una altre persona que ocupi el mateix rol a la família. També podeu fer servir l'enllaç Elimina per treure-la.

Quan hagueu acabat amb els canvis, polseu el botó Desa per guardar-los.
";
$pgv_lang["change_family_members"]	= "Canvia membres de la família";
$pgv_lang["changes_occurred"]		= "S'han fet els següents canvis en aquest registre:";
$pgv_lang["confirm_remove"]			= "Segur que voleu eliminar aquesta persona de la família?";
$pgv_lang["confirm_remove_object"]	= "Segur que voleu eliminar aquest objecte de la base de dades?";
$pgv_lang["create_repository"]		= "Crea arxiu";
$pgv_lang["create_source"]			= "Crea una nova font";
$pgv_lang["current_person"]         = "Ell/a mateix/a";
$pgv_lang["date"]					= "Data";
$pgv_lang["deathdate_search"]		= "Data de defunció: ";
$pgv_lang["deathplace_search"]		= "Lloc de defunció: ";
$pgv_lang["delete_dir_success"]		= "S'han eliminat correctament els Directoris multimèdia i de miniatures.";
$pgv_lang["delete_file"]			= "Elimina el fitxer";
$pgv_lang["delete_repo"]			= "Elimina l'arxiu";
$pgv_lang["directory_not_empty"]	= "El directori no és buit.";
$pgv_lang["directory_not_exist"]	= "El directori no existeix.";
$pgv_lang["error_remote"]           = "Heu seleccionat un lloc remot.";
$pgv_lang["error_same"]             = "Heu seleccionat el mateix lloc.";
$pgv_lang["external_file"]			= "Aquest objecte multimèdia no existeix com a fitxer al servidor. No pot eliminar-se, moure's o reanomenar-se.";
$pgv_lang["file_missing"]			= "No s'ha rebut el fitxer. Torneu-lo a carregar.";
$pgv_lang["file_partial"]			= "Fitxer parcialment carregat. Torneu-hi";
$pgv_lang["file_success"]			= "S'ha carregat correctament el fitxer";
$pgv_lang["file_too_big"]			= "El fitxer carregat excedeix el volum permès";
$pgv_lang["folder"]		 			= "Carpeta al servidor";
$pgv_lang["gedcom_editing_disabled"]	= "L'edició d'aquest GEDCOM ha sigut inhabilitada per l'administrador.";
$pgv_lang["gedrec_deleted"] 		= "Registre GEDCOM eliminat correctament.";
$pgv_lang["gen_thumb"]				= "Crea miniatura";
$pgv_lang["gender_search"]			= "Sexe: ";
$pgv_lang["generate_thumbnail"]		= "Generar miniatura automàticament des de ";
$pgv_lang["hebrew_givn"]			= "Noms de Pila Hebreus";
$pgv_lang["hebrew_surn"]			= "Cognoms Hebreus";
$pgv_lang["hide_changes"]			= "Polseu aquí per amagar els canvis.";
$pgv_lang["highlighted"]			= "Imatge principal";
$pgv_lang["illegal_chars"]			= "Noms en blanc o caràcters prohibits al nom";
$pgv_lang["invalid_search_multisite_input"] = "Entreu quelcom del següent:  Nom, Data de naixement, lloc de naixement, data de defunció i sexe ";
$pgv_lang["invalid_search_multisite_input_gender"] = "Cerqueu-ho amb més informació que només el sexe";
$pgv_lang["label_diff_server"]      = "Nou lloc remot";
$pgv_lang["label_location"]         = "Localització del lloc";
$pgv_lang["label_password_id2"]		= "Contrasenya: ";
$pgv_lang["label_rel_to_current"]   = "Parentiu amb aquesta persona";
$pgv_lang["label_same_server"]      = "Lloc local";
$pgv_lang["label_site"]             = "Lloc";
$pgv_lang["label_site_url"]         = "URL del lloc:";
$pgv_lang["label_username_id2"]		= "Nom d'usuari: ";
$pgv_lang["lbl_server_list"]        = "Un lloc remot existent";
$pgv_lang["lbl_type_server"]        = "Entreu un nou lloc.";
$pgv_lang["link_as_child"]			= "Vincula aquesta persona a una família existent com a fill/a";
$pgv_lang["link_as_husband"]		= "Vincula'l a una família existent com a espòs";
$pgv_lang["link_success"]			= "S'ha afegit correctament el vincle";
$pgv_lang["link_to_existing_media"]	= "Vincula-la a un ítem multimèdia existent";
$pgv_lang["max_media_depth"]		= "No podeu entrar més de #GLOBALS[MEDIA_DIRECTORY_LEVELS]# noms de sotsdirectori";
$pgv_lang["max_upload_size"]		= "Volum màxim a carregar: ";
$pgv_lang["media_deleted"]			= "Eliminat correctament el Directori multimèdia";
$pgv_lang["media_exists"]			= "El fitxer multimèdia ja existeix.";
$pgv_lang["media_file"] 			= "Fitxer multimèdia a carregar";
$pgv_lang["media_file_deleted"]		= "Eliminat correctament el Fitxer multimèdia";
$pgv_lang["media_file_moved"]			= "S'ha canviat de lloc el Fitxer multimèdia";
$pgv_lang["media_file_not_moved"]	= "El fitxer multimèdia no pot moure's.";
$pgv_lang["media_file_not_renamed"]	= "El fitxer multimèdia no pot moure's o reanomenar-se.";
$pgv_lang["media_thumb_exists"]		= "La miniatura ja existeix.";
$pgv_lang["multiple_gedcoms"]		= "Aquest fitxer és vinculat a una altra base de dades genealògica d'aquest servidor. No pot eliminar-se, reanomenar-se o moure's mentre es mantingui aquest enllaç.";
$pgv_lang["must_provide"]			= "Heu de donar un ";
$pgv_lang["name_search"]			= "Nom: ";
$pgv_lang["new_repo_created"]		= "S'ha creat un nou Arxiu";
$pgv_lang["new_source_created"] 	= "S'ha creat correctament la nova font.";
$pgv_lang["no_changes"] 			= "Actualment no hi ha canvis per revisar.";
$pgv_lang["no_known_servers"]		= "Servidors desconeguts
No s'han trobat resultats";
$pgv_lang["no_temple"]				= "Sense Temple -' Living Ordinance'";
$pgv_lang["no_upload"]				= "La càrrega de fitxers multimèdia no és permesa degut a que les entrades multimèdia estan desactivades o el directori multimèdia és de només lectura.";
$pgv_lang["paste_id_into_field"]	= "Pels camps d'edició, vinculeu aquest ID acabat de crear ";
$pgv_lang["paste_rid_into_field"]	= "Pels camps d'edició, vinculeu aquest ID acabat de crear ";
$pgv_lang["privacy_not_granted"]	= "No teniu accés a";
$pgv_lang["privacy_prevented_editing"]	= "Els paràmetres de privadesa no us permeten editar aquest registre.";
$pgv_lang["record_marked_deleted"]	= "Aquest registre ha estat senyalat per a eliminar, pendent de l'autorització de l'administrador.";
$pgv_lang["replace_with"]			= "Canvia-ho per";
$pgv_lang["show_changes"]			= "Aquest registre ha estat modificat. Polseu aquí per veure els canvis.";
$pgv_lang["thumb_genned"]			= "Generada automàticament la miniatura de #thumbnail#.";
$pgv_lang["thumbgen_error"]			= "La miniatura de #thumbnail# no pot generar-se automàticament.";
$pgv_lang["thumbnail"]				= "Miniatura a carregar";
$pgv_lang["title_remote_link"]      = "Afegeix un enllaç remot";
$pgv_lang["undo"]					= "Desfés";
$pgv_lang["undo_all"]				= "Desfés tots els canvis";
$pgv_lang["undo_all_confirm"]		= "Esteu segur que cal desfer tots els canvis d'aquest GEDCOM?";
$pgv_lang["undo_successful"]		= "S'han desfet correctament";
$pgv_lang["update_successful"]		= "Correctament modificat";
$pgv_lang["upload"]					= "Carrega";
$pgv_lang["upload_error"]			= "Ha ocorregut un error tot carregant el fitxer.";
$pgv_lang["upload_media"]			= "Carrega fitxers multimèdia";
$pgv_lang["upload_media_help"]		= "~#pgv_lang[upload_media]#~

Seleccioneu els fitxers del vostre ordinador a carregar al servidor. Tots els fitxers col·locaran al directori #MEDIA_DIRECTORY# o a un dels seus sotsdirectoris.

Els noms de carpeta que especifiqueu s'afegiran a #MEDIA_DIRECTORY#. Per exemple, #MEDIA_DIRECTORY#lamevafamilia. Si el directori de miniatures no existeix, es crearà automàticament.";
$pgv_lang["upload_successful"]		= "Càrrega correcta.";
$pgv_lang["view_change_diff"]		= "Mostra el que s'ha canviat";
$pgv_lang["add_marriage"]			= "Afegiu detalls del casament";
$pgv_lang["edit_concurrency_change"] = "El darrer a modificar aquest registre fou #CHANGEUSER# el #CHANGEDATE#";
$pgv_lang["edit_concurrency_msg2"]	= "El registre amb l'id #PID# fou canviat per un altre usuari d'ençà el darrer cop que vareu accedir-lo.";
$pgv_lang["edit_concurrency_msg1"]	= "Ha ocorregut un error tot creant el formulari d'edició. Un altre usuari deu haver canviat aquest registre d'ençà que us l'havíeu mirat.";
$pgv_lang["edit_concurrency_reload"]	= "Feu servir el botó 'enrere' del vostre navegador i actualitzeu la pàgina anterior per estar ben segur que esteu treballant amb el registre més recent";
$pgv_lang["admin_override"]			= "Opció d'administració";
$pgv_lang["no_update_CHAN"]			= "No canviïs el registre CHAN (darrer canvi)";
$pgv_lang["select_events"]			= "Selecciona esdeveniments";
$pgv_lang["source_events"]			= "Esdeveniments associats amb aquesta font";
$pgv_lang["edit_repo"]				= "Edita Repositori";
$pgv_lang["reorder_media"]					= "Reodeneu els ítems multimèdia";
$pgv_lang["reorder_media_title"]			= "Per a redordenar els ítems multimèdia, arrossegueu i allibereu les imatges al nou lloc.";
$pgv_lang["reorder_media_window"]			= "Reordenació multimèdia (finestra)";
$pgv_lang["reorder_media_window_title"]		= "Per a reordenar els ítems multimèdia, polseu sobre una fila i arrossegue-la fins al nou lloc.";
$pgv_lang["reorder_media_save"]				= "Desa els multimèdia ordenats a la base de dades";
$pgv_lang["reorder_media_reset"]			= "Restableix l'ordre original";
$pgv_lang["reorder_media_cancel"]			= "Surt i torna";
$pgv_lang["file_no_temp_dir"]		= "Manca el directori PHP temporal";
$pgv_lang["file_cant_write"]		= "Error PHP en escriure al disc";
$pgv_lang["file_bad_extension"]		= "PHP bloquejat per extensió d'arxiu";
$pgv_lang["file_unkown_err"]		= "Error desconegut en la càrrega d'arxius. Codi d'error #pgv_lang [global_num1]#. Si us plau, informeu d'això com un error.";
$pgv_lang["gen_missing_thumbs"]		= "Crea les miniatures faltants";
$pgv_lang["gen_missing_thumbs_lbl"]	= "Manquen miniatures";
$pgv_lang["copy_error"]				= "No es pot copiar l'arxiu #Globals [whichFile2]# des de #Globals [whichFile1]#";
$pgv_lang["add_unlinked_note"]		= "Addició d'una nota desvinculada";
$pgv_lang["add_unlinked"]			= "Registres desvinculats";
$pgv_lang["add_opf_child"]				= "Afegiu un fill/a per crear una família monoparental";
$pgv_lang["add_shared_note"]		= "Afegiu una nova nota compartida";
$pgv_lang["add_shared_note_lbl"]	= "Afegiu una nota compartida";
$pgv_lang["create_shared_note"]		= "Creeu una nova nota compartida";
$pgv_lang["create_shared_note_assisted"]	= "Creeu una nota compartida nova emprant l'assitent";
$pgv_lang["new_shared_note_created"] 	= "S'ha creat correctament la nova nota compartida.";
$pgv_lang["shared_note_updated"] 	= "S'ha modificat correctament la nota compartida.";
$pgv_lang["to_note"]				= "A una nota compartida";
$pgv_lang["to_repository"]			= "A un arxiu";
?>


text:
install

```
go get github.com/mossila/gin-sse-simple
```

Or clone and sync with `govendor`
```
git clone https://github.com/mossila/gin-sse-simple.git
cd gin-sse-simple/
govendor sync
```

usage

```
go run time_stream.go
```
use [watcher](https://github.com/canthefason/go-watcher) for live development

```
cd gin-sse-simple/
watcher
```

website client

```
http://localhost:8888/
```

test with raw data.

```
curl http://localhost:8888/time/
```

result

```
event:message
data:2015-09-09 13:01:30.278489263 +0700 ICT

event:message
data:2015-09-09 13:01:31.275659459 +0700 ICT

event:message
data:2015-09-09 13:01:32.27942686 +0700 ICT

event:message
data:2015-09-09 13:01:33.279488214 +0700 ICT

event:message
data:2015-09-09 13:01:34.277990689 +0700 ICT
```

## Performance

Tested with [sse-pref](https://github.com/matthiasn/sse-perf)

####Hardware
Yeah, that my macbook.

![alt tag](img/hardware.png)

## Connection

* max connection is about 2555 (maybe OSX 's max connections configured?).
* max speed about 50 MB/s (I tested on localhost. Why it has limits?)
* max msg/s is  about 80-90K msg/s.

![alt tag](img/connection.png)

This image test configured with larger message size.
![alt tag](img/max-connection.png)

## CPU

Cpu usage Instant drop after close all connection

![alt tag](img/cpu-usage.png)


text:
AdminApp.service('ShopDetailService', function($http, Properties){
'use strict';

    return {
        update: function(data){
           return $http.post(Properties.URL_SHOP_DETAIL, data);
        },
        findById: function(id){
             return $http.get(Properties.URL_SHOP_DETAIL+id);
        }
    }

});


text:
<?php
?>
        <footer>
            Copyright © 2015, Patrick Bélanger and contributors. All rights reserved.
        </footer>
    </body>
</html>
<!-- end : footer.php -->


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Docums Mycol. 29(no. 115): 34 (1999)

#### Original name
Lyophyllum sphaerosporum var. inodorum Kühner

### Remarks
null


text:
var mcFly = require("./McFly.js");
var items  = [];

function addItem(item) {
	items.push(item);
}

var Store = mcFly.createStore({
	getItems : function() {
		return items;
	}
}, function(payload) {

	if(payload.actionType === "ADD") {
		addItem(payload.data);
	}

	Store.emitChange();
	return true;
});
module.exports = Store;


text:
      <[$ctrl.getNavbarText()]>

      <li ng-class="{'navbar-tab-active': $ctrl.isMainEditorTabSelected(), 'uib-dropdown': $ctrl.getTotalWarningsCount()}"
          ng-attr-uib-dropdown="<[$ctrl.getTotalWarningsCount()]>"
          class="nav-item icon nav-list-item"
          ng-click="$ctrl.selectMainTab()">

            <[$ctrl.getTotalWarningsCount()]>

            Warnings

              <[issue]>

              <[issue]>

    <topic-editor-tab></topic-editor-tab>

    <oppia-topic-questions-tab></oppia-topic-questions-tab>

    <oppia-subtopic-editor-tab></oppia-subtopic-editor-tab>

    <oppia-topic-preview-tab></oppia-topic-preview-tab>

    <oppia-subtopic-preview-tab></oppia-subtopic-preview-tab>


text:
package cz.encircled.joiner.exception;

/**
 * Basic class for all Joiner runtime exceptions
 *
 * @author Kisel on 25.01.2016.
 */
public class JoinerExceptions {

    public static JoinerException entityNotFound() {
        return new JoinerException("FindOne returned no result, exactly 1 is expected");
    }

    public static JoinerException multipleEntitiesFound() {
        return new JoinerException("FindOne returned multiple result");
    }

}


text:
import { safeMarkup } from 'preprint-service/helpers/safe-markup';
import { module, test } from 'qunit';

module('Unit | Helper | safe markup');

test('marks string as safe for unescaped output', function(assert) {
    const result = safeMarkup(['
myString
']);
    assert.equal(result.toString(), '
myString
');
});


text:
#include <Arduino.h>

#include "CSGOGame.h"
#include "Game.h"
#include "HardwareMap.h"
#include "TimeManager.h"

CSGOGame::CSGOGame(int csgoID)
    : Game("CS:GO Competitive", "CS:GO", csgoID, CSGO_NUM_SETTINGS),
      armTime(5),
      defuseTime(7),
      password("7355608"),
      timeUntilBoom(35),
      prevButtonState(0),
      gameOver(false),
      arming(false),
      armed(false),
      timeSinceArmStart(0L),
      timeSpentArming(0L),
      timeArmComplete(0L)
{
    // Initialize Tweakable Game Settings
    GameOption armTimeOpt  = {"Arm Time",       &armTimeOpts[0],  &armTime};
    GameOption defTimeOpt  = {"Defuse Time",    &defTimeOpts[0],  &defuseTime};
    GameOption boomTimeOpt = {"TimeTillBoom",   &boomTimeOpts[0], &timeUntilBoom};

    gameSettings[0] = armTimeOpt;
    gameSettings[1] = defTimeOpt;
    gameSettings[2] = boomTimeOpt;
}

////////////////////////////////////////////////////////////
// Public interface methods
////////////////////////////////////////////////////////////

void CSGOGame::init()
{
    lcd = HardwareMap::getLCD();
}

bool CSGOGame::isPlaying()
{
    return !gameOver;
}

void CSGOGame::doGameLoop()
{
    unsigned long globalTime = TimeManager::getTime();
    updateDisplay(globalTime);
    updateArmStatus(globalTime);
    countDown(globalTime);
}

void CSGOGame::doEndGame()
{
    lcd->clear();

    // Bomb was defused
    if (!armed)
    {
        lcd->print("Bomb Defused");
        lcd->setCursor(0, 1);
        lcd->print("Counter Terrorists");
        lcd->setCursor(0, 2);
        lcd->print("win");

        digitalWrite(HardwareMap::ledBLU, HIGH);
        digitalWrite(HardwareMap::ledRED, LOW);
    }
    else
    {
        lcd->print("Bomb Blew Up");
        lcd->setCursor(0, 1);
        lcd->print("Terrorists win");

        digitalWrite(HardwareMap::ledBLU, LOW);
        digitalWrite(HardwareMap::ledRED, HIGH);
    }
}

GameOption* CSGOGame::getGameOptions()
{
    return gameSettings;
}

////////////////////////////////////////////////////////////
// Private Gameplay methods
////////////////////////////////////////////////////////////

void CSGOGame::updateDisplay(unsigned long globalTime)
{
    lcd->clear();

    // Phase 1: Waiting for bomb to become armed
    if (!arming)
    {
        lcd->setCursor(7, 1);
        lcd->print(formatTime());

        // Blink the lights if the bomb is armed
        if (armed)
        {
            int blinkPeriod;
            if (timeUntilBoom >= 30)         blinkPeriod = 1000;
            else if (timeUntilBoom >= 10)    blinkPeriod =  500;
            else if (timeUntilBoom >=  5)    blinkPeriod =  250;
            else                             blinkPeriod =  150;

            int brightness = 1 + sin((globalTime - timeArmComplete) * 2.0 * PI / blinkPeriod);
            digitalWrite(HardwareMap::ledRED, brightness);
            digitalWrite(HardwareMap::ledBLU, LOW);
        }
    }
    else if (arming)
    {
        // Displays the status of arming/disarming
        int armProgress = 0;

        // Display status message
        if (!armed)
        {
            lcd->setCursor(5, 1);
            lcd->print("Arming...");

            armProgress = ((password.length())/((double) armTime * 1000)) * timeSpentArming + 1;
            lcd->setCursor(5, 2);
            lcd->print("|");
            for(int i = 0; i < armProgress; i++)
                lcd->print(password[i]);
            for(int i = 0; i < 7 - armProgress; i++)
                lcd->print("*");
            lcd->print("|");

        }
        else
        {
            lcd->setCursor(4, 0);
            lcd->print("Defusing...");

            lcd->setCursor(7, 1);
            lcd->print(formatTime());

            armProgress = ((password.length())/((double) defuseTime * 1000)) * timeSpentArming;
            lcd->setCursor(5, 2);
            lcd->print("|");
            for(int i = 0; i < armProgress; i++)
                lcd->print("#");
            for(int i = 0; i < 7 - armProgress; i++)
                lcd->print("*");
            lcd->print("|");

            // Blink the Blue LEDs to indicate defusing
            int brightness = 1 + sin((globalTime - timeArmComplete) * 2.0 * PI / 500);
            digitalWrite(HardwareMap::ledBLU, brightness);
            digitalWrite(HardwareMap::ledRED, LOW);
        }
    }
}

void CSGOGame::updateArmStatus(unsigned long globalTime)
{
    int currentButtonState = digitalRead(HardwareMap::buttonRED) & digitalRead(HardwareMap::buttonBLU);

    // Commence the arming/defusing process if it's the first time pushing the button OR if we've already started
    if (currentButtonState == HIGH && (arming || prevButtonState == LOW))
    {
        arming = true;

        // Update the timeSinceArmStart only in the beginning
        if (prevButtonState == LOW && currentButtonState == HIGH)
            timeSinceArmStart = globalTime;

        timeSpentArming = globalTime - timeSinceArmStart;

        if (!armed && (timeSpentArming > armTime * 1000))
        {
            armed  = true;
            arming = false;

            timeSpentArming      = 0;
            timeArmComplete = globalTime;
        }
        else if (armed && (timeSpentArming > defuseTime * 1000))
        {
            arming = false;
            armed  = false;
            gameOver = true;
        }
    }
    else
    {
        arming = false;
    }

    prevButtonState = currentButtonState;
}

void CSGOGame::countDown(unsigned long globalTime)
{
    if (!armed) return;
    if (timeUntilBoom <= 0) gameOver = true;

    unsigned long timeSinceArmComplete = globalTime - timeArmComplete;
    if (timeSinceArmComplete > 1000)
    {
        timeArmComplete += 1000;
        timeUntilBoom --;
    }

}

// Returns the bomb time formatted as a mm:ss string
String CSGOGame::formatTime()
{
    String result = "";
    int min = timeUntilBoom / 60;
    int sec = timeUntilBoom % 60;

    // add the minutes, and a leading 0 if necessary
    if(min < 10)
        result += '0';
    result += min;

    result += ':';

    // add the timeUntilBoom, and a leading 0 if necessary
    if(sec < 10)
        result += '0';
    result += sec;

    return result;
}


text:
module Azure end
module Azure::ARM end
module Azure::ARM::Commerce end


text:
import java.util.HashMap;

public class Solution {
  public static void main(String args[]) {
    final long startTime = System.nanoTime();

    String testString1 = "abcdefg";
    String testString2 = "aacdefg";
    String testString3 = "";
    String testString4 = null;
    System.out.println("---Begin test---");
    System.out.println("For " + testString1 + ": ");
    System.out.println(allCharsUnique(testString1));
    System.out.println("For " + testString2 + ": ");
    System.out.println(allCharsUnique(testString2));
    System.out.println("For " + testString3 + ": ");
    System.out.println(allCharsUnique(testString3));
    System.out.println("For " + testString4 + ": ");
    System.out.println(allCharsUnique(testString4));

    /* Print total time spent */
    final long duration = System.nanoTime() - startTime;
    System.out.println("\nduration: " + duration/1000000000.0 + "s");
  }

  public static boolean allCharsUnique(String str) {
    if (str == null) { return true; }
    if (str.length() > 256) { return false; }
    boolean[] includedChars = new boolean[256];
    for (int i=0; i<str.length(); i++) {
      int currentChar = str.charAt(i);
      if (includedChars[currentChar]) {
        return false;
      }
      else {
        includedChars[currentChar] = true;
      }
    }
    return true;
  }
}


text:
use trust_dns_resolver::config::{NameServerConfigGroup, ResolverOpts};

/// Configuration for master file based zones
#[derive(Deserialize, PartialEq, Debug)]
pub struct ForwardConfig {
    /// upstream name_server configurations
    pub name_servers: NameServerConfigGroup,
    /// Resolver options
    pub options: Option<ResolverOpts>,
}


text:
namespace autofill {

AutofillPopupViewViews::AutofillPopupViewViews(
    AutofillPopupController* controller,
    views::Widget* parent_widget)
    : AutofillPopupBaseView(controller, parent_widget),
      controller_(controller) {}

AutofillPopupViewViews::~AutofillPopupViewViews() {}

void AutofillPopupViewViews::Show() {
  DoShow();
}

void AutofillPopupViewViews::Hide() {
  // The controller is no longer valid after it hides us.
  controller_ = NULL;

  DoHide();
}

void AutofillPopupViewViews::UpdateBoundsAndRedrawPopup() {
  DoUpdateBoundsAndRedrawPopup();
}

void AutofillPopupViewViews::OnPaint(gfx::Canvas* canvas) {
  if (!controller_)
    return;

  canvas->DrawColor(kPopupBackground);
  OnPaintBorder(canvas);

  for (size_t i = 0; i < controller_->GetLineCount(); ++i) {
    gfx::Rect line_rect = controller_->layout_model().GetRowBounds(i);

    if (controller_->GetSuggestionAt(i).frontend_id ==
        POPUP_ITEM_ID_SEPARATOR) {
      canvas->FillRect(line_rect, kLabelTextColor);
    } else {
      DrawAutofillEntry(canvas, i, line_rect);
    }
  }
}

void AutofillPopupViewViews::InvalidateRow(size_t row) {
  SchedulePaintInRect(controller_->layout_model().GetRowBounds(row));
}

void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
                                               int index,
                                               const gfx::Rect& entry_rect) {
  canvas->FillRect(entry_rect, controller_->GetBackgroundColorForRow(index));

  const bool is_rtl = controller_->IsRTL();
  const int text_align =
      is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT;
  gfx::Rect value_rect = entry_rect;
  value_rect.Inset(AutofillPopupLayoutModel::kEndPadding, 0);
  canvas->DrawStringRectWithFlags(
      controller_->GetElidedValueAt(index),
      controller_->layout_model().GetValueFontListForRow(index),
      controller_->layout_model().GetValueFontColorForRow(index), value_rect,
      text_align);

  // Use this to figure out where all the other Autofill items should be placed.
  int x_align_left =
      is_rtl ? AutofillPopupLayoutModel::kEndPadding
             : entry_rect.right() - AutofillPopupLayoutModel::kEndPadding;

  // Draw the Autofill icon, if one exists
  ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
  int row_height = controller_->layout_model().GetRowBounds(index).height();
  if (!controller_->GetSuggestionAt(index).icon.empty()) {
    int icon = controller_->layout_model().GetIconResourceID(
        controller_->GetSuggestionAt(index).icon);
    DCHECK_NE(-1, icon);
    const gfx::ImageSkia* image = rb.GetImageSkiaNamed(icon);
    int icon_y = entry_rect.y() + (row_height - image->height()) / 2;

    x_align_left += is_rtl ? 0 : -image->width();

    canvas->DrawImageInt(*image, x_align_left, icon_y);

    x_align_left +=
        is_rtl ? image->width() + AutofillPopupLayoutModel::kIconPadding
               : -AutofillPopupLayoutModel::kIconPadding;
  }

  // Draw the label text.
  const int label_width =
      gfx::GetStringWidth(controller_->GetElidedLabelAt(index),
                          controller_->layout_model().GetLabelFontList());
  if (!is_rtl)
    x_align_left -= label_width;

  canvas->DrawStringRectWithFlags(
      controller_->GetElidedLabelAt(index),
      controller_->layout_model().GetLabelFontList(), kLabelTextColor,
      gfx::Rect(x_align_left, entry_rect.y(), label_width, entry_rect.height()),
      text_align);
}

AutofillPopupView* AutofillPopupView::Create(
    AutofillPopupController* controller) {
  views::Widget* observing_widget =
      views::Widget::GetTopLevelWidgetForNativeView(
          controller->container_view());

  // If the top level widget can't be found, cancel the popup since we can't
  // fully set it up.
  if (!observing_widget)
    return NULL;

  return new AutofillPopupViewViews(controller, observing_widget);
}

}  // namespace autofill


text:
package org.osmdroid;

import java.nio.ByteBuffer;

import android.graphics.Bitmap;
import android.test.AndroidTestCase;

/**
 * @author Neil Boyd
 *
 */
public class ContextResourceProxyTest extends AndroidTestCase {

	public void test_getString() {
		final ResourceProxy rp = new ResourceProxyImpl(getContext());
		final String mapnik = rp.getString(ResourceProxy.string.mapnik);
		assertEquals("Got string okay", "Mapnik", mapnik);
	}

	public void test_getBitmap() {
		final ResourceProxy rp = new ResourceProxyImpl(getContext());
		final Bitmap center = rp.getBitmap(ResourceProxy.bitmap.person);
		assertNotNull("Got bitmap okay", center);
	}

	public void test_getBitmap_compare_with_default() {
		final ResourceProxy contextResourceProxy = new ResourceProxyImpl(getContext());
		final Bitmap contextBitmap = contextResourceProxy.getBitmap(ResourceProxy.bitmap.person);

		final ResourceProxy defaultResourceProxy = new DefaultResourceProxyImpl(getContext());
		final Bitmap defaultBitmap = defaultResourceProxy.getBitmap(ResourceProxy.bitmap.person);
		// FIXME this throws an exception

		// compare a few things to see if they're the same bitmap
		assertEquals("Compare config", contextBitmap.getConfig(), defaultBitmap.getConfig());
		assertEquals("Compare width", contextBitmap.getWidth(), defaultBitmap.getWidth());
		assertEquals("Compare height", contextBitmap.getHeight(), defaultBitmap.getHeight());

		// compare the total thing
		final ByteBuffer bb1 = ByteBuffer.allocate(contextBitmap.getWidth()
				* contextBitmap.getHeight() * 4);
		contextBitmap.copyPixelsToBuffer(bb1);
		final ByteBuffer bb2 = ByteBuffer.allocate(defaultBitmap.getWidth()
				* defaultBitmap.getHeight() * 4);
		defaultBitmap.copyPixelsToBuffer(bb2);
		assertEquals("Compare pixels", bb1, bb2);
	}
}


text:
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/webui/projector_app/projector_xhr_sender.h"

#include "ash/webui/projector_app/test/mock_app_client.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "google_apis/google_api_keys.h"
#include "net/base/url_util.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace {

const char kTestUserEmail[] = "testuser1@gmail.com";
const base::TimeDelta kExpiryTimeFromNow = base::Minutes(10);
constexpr char kTestDriveRequestUrl[] =
    "https://www.googleapis.com/drive/v3/files/fileID";
constexpr char kTestTranslationRequestUrl[] =
    "https://translation.googleapis.com/language/translate/v2";

GURL GetUrlWithApiKey(const GURL& url) {
  return net::AppendQueryParameter(url, "key", google_apis::GetAPIKey());
}

}  // namespace

namespace ash {

class ProjectorXhrSenderTest : public testing::Test {
 public:
  ProjectorXhrSenderTest() = default;
  ProjectorXhrSenderTest(const ProjectorXhrSenderTest&) = delete;
  ProjectorXhrSenderTest& operator=(const ProjectorXhrSenderTest&) = delete;
  ~ProjectorXhrSenderTest() override = default;

  // testing::Test:
  void SetUp() override {
    sender_ = std::make_unique<ProjectorXhrSender>(
        mock_app_client_.GetUrlLoaderFactory());
  }

  ProjectorXhrSender* sender() { return sender_.get(); }
  MockAppClient& mock_app_client() { return mock_app_client_; }

 private:
  base::test::SingleThreadTaskEnvironment task_environment_;
  std::unique_ptr<ProjectorXhrSender> sender_;
  MockAppClient mock_app_client_;
};

TEST_F(ProjectorXhrSenderTest, Success) {
  base::RunLoop run_loop;

  const std::string& test_response_body = "{}";
  sender()->Send(
      GURL(kTestDriveRequestUrl), "GET", /*request_body=*/"",
      /*use_credentials=*/false,
      base::BindOnce(
          [](const std::string& expected_response_body,
             base::RepeatingClosure quit_closure, bool success,
             const std::string& response_body, const std::string& error) {
            EXPECT_TRUE(success);
            EXPECT_EQ(expected_response_body, response_body);
            EXPECT_EQ("", error);
            quit_closure.Run();
          },
          test_response_body, run_loop.QuitClosure()));

  mock_app_client().test_url_loader_factory().AddResponse(kTestDriveRequestUrl,
                                                          test_response_body);

  mock_app_client().GrantOAuthTokenFor(
      kTestUserEmail,
      /* expiry_time = */ base::Time::Now() + kExpiryTimeFromNow);
  run_loop.Run();
}

TEST_F(ProjectorXhrSenderTest, TwoRequests) {
  base::RunLoop run_loop;
  const std::string& test_response_body = "{}";
  sender()->Send(
      GURL(kTestDriveRequestUrl), "GET", /*request_body=*/"",
      /*use_credentials=*/false,
      base::BindOnce(
          [](const std::string& expected_response_body,
             base::RepeatingClosure quit_closure, bool success,
             const std::string& response_body, const std::string& error) {
            EXPECT_TRUE(success);
            EXPECT_EQ(expected_response_body, response_body);
            EXPECT_EQ("", error);
            quit_closure.Run();
          },
          test_response_body, run_loop.QuitClosure()));

  base::RunLoop run_loop2;
  const std::string& test_response_body2 = "{data: {}}";
  auto translation_url = GURL(kTestTranslationRequestUrl);
  sender()->Send(
      translation_url, "GET", /*request_body=*/"",
      /*use_credentials=*/false,
      base::BindOnce(
          [](const std::string& expected_response_body,
             base::RepeatingClosure quit_closure, bool success,
             const std::string& response_body, const std::string& error) {
            EXPECT_TRUE(success);
            EXPECT_EQ(expected_response_body, response_body);
            EXPECT_EQ("", error);
            quit_closure.Run();
          },
          test_response_body2, run_loop2.QuitClosure()));

  mock_app_client().test_url_loader_factory().AddResponse(kTestDriveRequestUrl,
                                                          test_response_body);

  mock_app_client().test_url_loader_factory().AddResponse(
      GetUrlWithApiKey(translation_url).spec(), test_response_body2);

  mock_app_client().GrantOAuthTokenFor(
      kTestUserEmail,
      /* expiry_time = */ base::Time::Now() + kExpiryTimeFromNow);
  run_loop.Run();
  run_loop2.Run();
}

TEST_F(ProjectorXhrSenderTest, UseCredentials) {
  base::RunLoop run_loop;

  const std::string& test_response_body = "{}";
  sender()->Send(
      GURL(kTestDriveRequestUrl), "GET", /*request_body=*/"",
      /*use_credentials=*/true,
      base::BindOnce(
          [](const std::string& expected_response_body,
             base::RepeatingClosure quit_closure, bool success,
             const std::string& response_body, const std::string& error) {
            EXPECT_TRUE(success);
            EXPECT_EQ(expected_response_body, response_body);
            EXPECT_EQ("", error);
            quit_closure.Run();
          },
          test_response_body, run_loop.QuitClosure()));

  // Verify that http request is sent without granting OAuth token.
  mock_app_client().test_url_loader_factory().AddResponse(kTestDriveRequestUrl,
                                                          test_response_body);

  run_loop.Run();
}

TEST_F(ProjectorXhrSenderTest, UseApiKey) {
  base::RunLoop run_loop;

  auto url = GURL(kTestTranslationRequestUrl);
  const std::string& test_response_body = "{}";
  sender()->Send(
      url, "GET", /*request_body=*/"", /*use_credentials=*/false,
      base::BindOnce(
          [](const std::string& expected_response_body,
             base::RepeatingClosure quit_closure, bool success,
             const std::string& response_body, const std::string& error) {
            EXPECT_TRUE(success);
            EXPECT_EQ(expected_response_body, response_body);
            EXPECT_EQ("", error);
            quit_closure.Run();
          },
          test_response_body, run_loop.QuitClosure()));

  // Verify that http request is sent with API key.
  mock_app_client().test_url_loader_factory().AddResponse(
      GetUrlWithApiKey(url).spec(), test_response_body);

  run_loop.Run();
}

TEST_F(ProjectorXhrSenderTest, NetworkError) {
  base::RunLoop run_loop;

  sender()->Send(
      GURL(kTestDriveRequestUrl), /*method=*/"GET", /*request_body=*/"",
      /*use_credentials=*/false,
      base::BindOnce(
          [](base::RepeatingClosure quit_closure, bool success,
             const std::string& response_body, const std::string& error) {
            EXPECT_FALSE(success);
            EXPECT_EQ("", response_body);
            EXPECT_EQ("XHR_FETCH_FAILURE", error);
            quit_closure.Run();
          },
          run_loop.QuitClosure()));

  mock_app_client().test_url_loader_factory().AddResponse(
      GURL(kTestDriveRequestUrl), network::mojom::URLResponseHead::New(),
      std::string(), network::URLLoaderCompletionStatus(net::HTTP_NOT_FOUND));

  mock_app_client().GrantOAuthTokenFor(
      kTestUserEmail,
      /* expiry_time = */ base::Time::Now() + kExpiryTimeFromNow);
  run_loop.Run();
}

TEST_F(ProjectorXhrSenderTest, UnsupportedUrl) {
  base::RunLoop run_loop;

  sender()->Send(
      GURL("https://example.com"), /*method=*/"GET", /*request_body=*/"",
      /*use_credentials=*/false,
      base::BindOnce(
          [](base::RepeatingClosure quit_closure, bool success,
             const std::string& response_body, const std::string& error) {
            EXPECT_FALSE(success);
            EXPECT_EQ("", response_body);
            EXPECT_EQ("UNSUPPORTED_URL", error);
            quit_closure.Run();
          },
          run_loop.QuitClosure()));

  run_loop.Run();
}

}  // namespace ash


text:
<?php

namespace SkNd\UserBundle\DataFixtures\ORM;

use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
//use SkNd\UserBundle\Entity\User;
use SkNd\UserBundle\Entity\MemoryWall;
use SkNd\MediaBundle\Entity\MediaResource;
use SkNd\MediaBundle\Entity\MediaResourceCache;

class LoadUsers implements FixtureInterface, ContainerAwareInterface {

    private $container;
    private $em;
    private $userManager;

    //in order to get access to methods controlled by the container, it can be automatically injected using this method
    public function setContainer(ContainerInterface $container = null){
        $this->container = $container;
        $this->em = $this->container->get('doctrine')->getEntityManager();
        $this->userManager = $this->container->get('fos_user.user_manager');

    }

    public function load(ObjectManager $manager){
        //$manager->createQuery('DELETE from SkNd\MediaBundle\Entity\MediaResource')->execute();
        $mrs = $manager->getRepository('SkNdMediaBundle:MediaResource')->findAll();
        foreach($mrs as $mr){
            $manager->remove($mr);
        }
        foreach($mrs = $manager->getRepository('SkNdMediaBundle:MediaResourceCache')->findAll() as $mrc)
            $manager->remove($mrc);

        $manager->flush();

        $users = $this->userManager->findUsers();
        foreach($users as $user){
            $this->userManager->deleteUser($user);
        }

        $mrs = array();
        array_push($mrs, $this->getNewMediaResource('testuser-mr1',$manager));
        array_push($mrs, $this->getNewMediaResource('testuser-mr2',$manager));
        array_push($mrs, $this->getNewMediaResource('testuser-mr3',$manager));

        //3 sample users
        $user = $this->userManager->createUser();
        $user->setDateofbirth(new \DateTime("now"));
        $user->setUsername('testuser');
        $user->setEmail('test@test.com');
        $user->setPlainPassword('testuser');
        $user->setFirstname('testuserFirstname');
        $user->setEnabled(true);
        $user->createDefaultMemoryWall('my-memory-wall');

        //create a private memory wall
        $privateMw = new MemoryWall($user);
        $privateMw->setIsPublic(false);
        $privateMw->setName('private wall');
        $user->addMemoryWall($privateMw);
        $this->userManager->updateUser($user, true);
        $mw = $user->getMemoryWalls()->first();
        $mw->addMediaResource($mrs[0]);

        $user = $this->userManager->createUser();
        $user->setDateofbirth(new \DateTime("now"));
        $user->setUsername('testuser2');
        $user->setEmail('test2@test.com');
        $user->setPlainPassword('testuser2');
        $user->setEnabled(true);
        $user->createDefaultMemoryWall('my-memory-wall-1');
        $this->userManager->updateUser($user, true);
        $mw = $user->getMemoryWalls()->first();
        $mw->addMediaResource($mrs[0]);
        $mw->addMediaResource($mrs[1]);

        $user = $this->userManager->createUser();
        $user->setDateofbirth(new \DateTime("now"));
        $user->setUsername('testuser3');
        $user->setEmail('test3@test3.com');
        $user->setPlainPassword('testuser3');
        $user->setEnabled(true);
        $user->createDefaultMemoryWall('my-memory-wall-2');
        $this->userManager->updateUser($user, true);
        $mw = $user->getMemoryWalls()->first();
        $mw->addMediaResource($mrs[2]);

        $manager->flush();

    }

    private function getNewMediaResource($id, $manager){
        $mr = new MediaResource();
        $mr->setId($id);
        $mr->setAPI($manager->getRepository('SkNdMediaBundle:API')->findOneBy(array('id' => 1)));
        $mr->setMediaType($manager->getRepository('SkNdMediaBundle:MediaType')->findOneBy(array('id' => 1)));
        $mr->setMediaResourceCache($this->getCache($id));
        $manager->persist($mr);
        $manager->flush();

        return $mr;
    }
    private function getCache($id){
        $mrc = new MediaResourceCache();
        $mrc->setId($id);
        //$mrc->setDateCreated(new \DateTime("now"));
        $mrc->setTitle($id);
        //$mrc->setXmlData(simplexml_load_file('src\SkNd\MediaBundle\Tests\MediaAPI\SampleResponses\sampleAmazonDetails.xml')->asXml());
        $mrc->setXmlRef('sampleAmazonDetails.xml');
        return $mrc;
    }

}

?>


text:
from recipe_engine import recipe_api

class PresubmitApi(recipe_api.RecipeApi):
  @property
  def presubmit_support_path(self):
    return self.package_repo_resource('presubmit_support.py')

  def __call__(self, *args, **kwargs):
    """Return a presubmit step."""

    name = kwargs.pop('name', 'presubmit')

    env = self.m.context.env
    env.setdefault('PATH', '%(PATH)s')
    env['PATH'] = self.m.path.pathsep.join([
        env['PATH'], str(self._module.PACKAGE_REPO_ROOT)])

    with self.m.context(env=env):
      return self.m.python(
          name, self.presubmit_support_path, list(args), **kwargs)


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

<title>Uses of Class org.raxa.module.handlesms.Keyword</title>
<meta name="date" content="2013-09-11">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.raxa.module.handlesms.Keyword

Packages that use Keyword

Package
Description

org.raxa.module.handlesms

Uses of Keyword in org.raxa.module.handlesms

Fields in org.raxa.module.handlesms with type parameters of type Keyword

Modifier and Type
Field and Description

private static java.util.Map<java.lang.Integer,Keyword>
Menu.digitToKeyWord

maps option to keyword
 eg 1 -> Register
 eg 2->  Rem

Methods in org.raxa.module.handlesms that return Keyword

Modifier and Type
Method and Description

static Keyword
Keyword.valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name.

static Keyword[]
Keyword.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Method parameters in org.raxa.module.handlesms with type arguments of type Keyword

Modifier and Type
Method and Description

private void
Menu.mapInttoKeyWord(java.util.Map<java.lang.Integer,Keyword> digitToKeyWord2)

populate a map with option and keyword

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Open Source Software published under the Apache Licence, Version 2.0.
  -->

<configuration>

    <property name="log_path" value="${user.home}/.VocabHunter/logs"/>

    <if condition='property("os.name").contains("OS X")'>
        <then>
            <property name="log_path" value="${user.home}/Library/VocabHunter/logs"/>
        </then>
    </if>

    <if condition='property("os.name").contains("Windows")'>
        <then>
            <property name="log_path" value="${APPDATA}/VocabHunter/logs"/>
        </then>
    </if>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{3} - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${log_path}/system.log</file>

        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${log_path}/system%i.log</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>3</maxIndex>
        </rollingPolicy>

        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>512KB</maxFileSize>
        </triggeringPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{3} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="info">
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="FILE"/>
    </root>
</configuration>


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Alarm Todos</title>

    <link rel="apple-touch-icon" href="apple-touch-icon.png">

    <link rel="stylesheet" href="styles/main.css">

Todos

        <input id="new-todo" type="text" placeholder="What needs to be done?">

        <input id="toggle-all" type="checkbox">
        Mark all as complete

	        <input id="beep-every-second" type="checkbox">
	        Beep/Sec?

        Clear completed

      Double-click to edit a todo.

      Inspired by

      Jérôme Gravel-Niquet.

Created by: Zhen Kyle.


text:
#ifndef VICE_UIDRIVEPETCBM2_H
#define VICE_UIDRIVEPETCBM2_H

extern void uidrivepetcbm2_settings_dialog(HWND hwnd);

#endif