text:
namespace content {

namespace {

network::mojom::CorsOriginPatternPtr CreateTestPattern(
    std::string target_domain) {
  std::string scheme = "chrome-extension";
  uint16_t port = 123;
  network::mojom::CorsDomainMatchMode domain_mode =
      network::mojom::CorsDomainMatchMode::kAllowSubdomains;
  network::mojom::CorsPortMatchMode port_mode =
      network::mojom::CorsPortMatchMode::kAllowOnlySpecifiedPort;
  network::mojom::CorsOriginAccessMatchPriority priority =
      network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority;

  return network::mojom::CorsOriginPattern::New(
      scheme, target_domain, port, domain_mode, port_mode, priority);
}

}  // namespace

TEST(CorsOriginPatternSetter, InitialEmptyList) {
  content::BrowserTaskEnvironment task_environment;
  scoped_refptr<content::SharedCorsOriginAccessList> shared_list;

  {
    content::TestBrowserContext browser_context;
    shared_list = browser_context.GetSharedCorsOriginAccessList();
    ASSERT_TRUE(shared_list);

    // The list is empty (in absence of calls to CorsOriginPatternSetter::Set).
    std::vector<network::mojom::CorsOriginAccessPatternsPtr> patterns =
        shared_list->GetOriginAccessList().CreateCorsOriginAccessPatternsList();
    EXPECT_EQ(0u, patterns.size());

    // |shared_list| should own 1 ref-count + |browser_context|'s UserData
    // should own 1 ref-count.
    EXPECT_FALSE(shared_list->HasOneRef());
  }

  // |shared_list| should own the only remaining ref-count (i.e. the product
  // code shouldn't hold any ref-counts at this point).
  EXPECT_TRUE(shared_list->HasOneRef());
}

TEST(CorsOriginPatternSetter, ClonePatterns) {
  content::BrowserTaskEnvironment task_environment;
  const char kTestDomain[] = "example.com";
  network::mojom::CorsOriginPatternPtr test_pattern =
      CreateTestPattern(kTestDomain);

  std::vector<network::mojom::CorsOriginPatternPtr> original_patterns;
  original_patterns.push_back(CreateTestPattern(kTestDomain));
  EXPECT_EQ(1u, original_patterns.size());
  EXPECT_EQ(*test_pattern, *original_patterns[0]);

  std::vector<network::mojom::CorsOriginPatternPtr> cloned_patterns =
      mojo::Clone(original_patterns);
  // `original_patterns` is not affected by the Clone method.
  EXPECT_EQ(1u, original_patterns.size());
  EXPECT_EQ(*test_pattern, *original_patterns[0]);
  // Equivalent contents, but different pointers (i.e. separate objects).
  EXPECT_EQ(1u, cloned_patterns.size());
  EXPECT_EQ(*original_patterns[0], *cloned_patterns[0]);
  EXPECT_NE(original_patterns[0].get(), cloned_patterns[0].get());
}

TEST(CorsOriginPatternSetter, Set) {
  content::BrowserTaskEnvironment task_environment;
  scoped_refptr<content::SharedCorsOriginAccessList> shared_list;

  {
    content::TestBrowserContext browser_context;

    const char kTestDomain[] = "example.com";
    network::mojom::CorsOriginPatternPtr test_pattern =
        CreateTestPattern(kTestDomain);
    url::Origin source_origin =
        url::Origin::Create(GURL("https://initiator.com"));
    std::vector<network::mojom::CorsOriginPatternPtr> allowlist;
    allowlist.push_back(CreateTestPattern(kTestDomain));

    // Call CorsOriginPatternSetter::Set and wait until it completes.
    base::RunLoop run_loop;
    CorsOriginPatternSetter::Set(&browser_context, source_origin,
                                 std::move(allowlist), {},
                                 run_loop.QuitClosure());
    run_loop.Run();

    // Verify that the results got properly stored.
    shared_list = browser_context.GetSharedCorsOriginAccessList();
    ASSERT_TRUE(shared_list);
    std::vector<network::mojom::CorsOriginAccessPatternsPtr> patterns =
        shared_list->GetOriginAccessList().CreateCorsOriginAccessPatternsList();
    ASSERT_EQ(1u, patterns.size());
    ASSERT_TRUE(patterns[0]);
    EXPECT_EQ(source_origin, patterns[0]->source_origin);
    EXPECT_EQ(0u, patterns[0]->block_patterns.size());
    ASSERT_EQ(1u, patterns[0]->allow_patterns.size());
    EXPECT_EQ(*test_pattern, *patterns[0]->allow_patterns[0]);

    // TODO(lukasza): Add verification that
    // network::mojom::NetworkContext::SetCorsOriginAccessListsForOrigin got
    // called.  The immediate problem is that TestBrowserContext has 0
    // StoragePartition objects - we would need to find a way to add
    // TestStoragePartition objects with test-controlled TestNetworkContext.

    // |shared_list| should own 1 ref-count + |browser_context|'s UserData
    // should own 1 ref-count.
    EXPECT_FALSE(shared_list->HasOneRef());
  }

  // |shared_list| should own the only remaining ref-count (i.e. the product
  // code shouldn't hold any ref-counts at this point).
  EXPECT_TRUE(shared_list->HasOneRef());
}

}  // namespace content


text:
package br.com.objectos.jabuticava.bvmf.rf.cri;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import java.io.IOException;

import com.google.inject.Inject;

import org.jsoup.nodes.Document;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;

/**
 * @author marcio.endo@objectos.com.br (Marcio Endo)
 */
@Test
@Guice(modules = { ModuloDeTesteWayCri.class })
public class TesteDeCriForm {

  @Inject
  private CriForm form;

  public void post_deve_retornar_listagem() throws IOException {
    Document prova = HtmlsFalso.LISTAGEM;
    Document res = form.post();
    assertThat(res.text(), equalTo(prova.text()));
  }

}

redpajama_set_name: RedPajamaGithub


text:
var springFunControllers = angular.module('springFunControllers', []);

springFunControllers.controller('MessagesController', function($scope, $http) {
    $scope.messages = [];

    $http.get('/message/all').success(function (data, status, headers, config) {
        $scope.messages = data;
    }).error(function (data, status, headers, config) {
        $scope.errorMessage = "Can't retrieve messages list!";
    });

    $scope.deleteMessage = function(id) {
        $http.delete('/message/delete/' + id).success(function (data, status, headers, config) {
            $scope.messages = $scope.messages.filter(function(message) {
                    return message.id != id;
                }
            );
        }).error(function (data, status, headers, config) {
            $scope.errorMessage = "Can't delete message!";
        });
    };

    $scope.sendMessage = function() {
        var message = $scope.message;
        var params = JSON.stringify(message);
        $http.post('/message/create', params, {
            headers: {
                'Content-Type': 'application/json; charset=UTF-8'
            }
        }).success(function (data, status, headers, config) {
            if(data.created) {
                $scope.messages.push(data.newMessage);
                $scope.message = {};
                $scope.errorMessage = null;
            } else {
                $scope.errorMessage = "Sending message failed!"
            }
        }).error(function (data, status, headers, config) {
            $scope.errorMessage = "Sending message failed!"
        });
    };
});


text:
package org.elasticsearch.index.mapper.camelcase;

import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.index.IndexService;
import org.elasticsearch.index.mapper.DocumentMapper;
import org.elasticsearch.index.mapper.ParsedDocument;
import org.elasticsearch.test.ESSingleNodeTestCase;
import org.junit.Test;

/**
 *
 */
public class CamelCaseFieldNameTests extends ESSingleNodeTestCase {

    @Test
    public void testCamelCaseFieldNameStaysAsIs() throws Exception {
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .endObject().endObject().string();

        IndexService index = createIndex("test");
        client().admin().indices().preparePutMapping("test").setType("type").setSource(mapping).get();
        DocumentMapper documentMapper = index.mapperService().documentMapper("type");

        ParsedDocument doc = documentMapper.parse("test", "type", "1", XContentFactory.jsonBuilder().startObject()
                .field("thisIsCamelCase", "value1")
                .endObject().bytes());

        assertNotNull(doc.dynamicMappingsUpdate());
        client().admin().indices().preparePutMapping("test").setType("type").setSource(doc.dynamicMappingsUpdate().toString()).get();

        documentMapper = index.mapperService().documentMapper("type");
        assertNotNull(documentMapper.mappers().getMapper("thisIsCamelCase"));
        assertNull(documentMapper.mappers().getMapper("this_is_camel_case"));

        documentMapper = index.mapperService().documentMapperParser().parse("type", documentMapper.mappingSource());

        assertNotNull(documentMapper.mappers().getMapper("thisIsCamelCase"));
        assertNull(documentMapper.mappers().getMapper("this_is_camel_case"));
    }
}


text:
package com.thoughtworks.go.config.materials;

import com.thoughtworks.go.config.*;
import com.thoughtworks.go.config.validation.FilePathTypeValidator;
import com.thoughtworks.go.domain.ConfigErrors;
import com.thoughtworks.go.domain.materials.MaterialConfig;
import com.thoughtworks.go.util.FileUtil;
import com.thoughtworks.go.util.StringUtil;
import com.thoughtworks.go.util.command.UrlArgument;
import org.apache.commons.lang.StringUtils;

import java.io.File;
import java.io.IOException;
import java.util.Map;

import static com.thoughtworks.go.util.ExceptionUtils.bomb;

/**
 * @understands a source control repository and its configuration
 */
public abstract class ScmMaterialConfig extends AbstractMaterialConfig implements ParamsAttributeAware {

    public static final String URL = "url";
    public static final String USERNAME = "username";

    @ConfigSubtag
    private Filter filter;

    @ConfigAttribute(value = "dest", allowNull = true)
    protected String folder;

    @ConfigAttribute(value = "autoUpdate", optional = true)
    private boolean autoUpdate = true;

    public static final String PASSWORD = "password";
    public static final String ENCRYPTED_PASSWORD = "encryptedPassword";
    public static final String PASSWORD_CHANGED = "passwordChanged";
    public static final String AUTO_UPDATE = "autoUpdate";

    public static final String FOLDER = "folder";
    public static final String FILTER = "filterAsString";

    public ScmMaterialConfig(String typeName) {
        super(typeName);
    }

    public ScmMaterialConfig(CaseInsensitiveString name, Filter filter, String folder, boolean autoUpdate, String typeName, ConfigErrors errors) {
        super(typeName, name, errors);
        this.filter = filter;
        this.folder = folder;
        this.autoUpdate = autoUpdate;
    }

    @Override protected void appendPipelineUniqueCriteria(Map<String, Object> basicCriteria) {
        basicCriteria.put("dest", folder);
    }

    public File workingdir(File baseFolder) {
        if (getFolder() == null) {
            return baseFolder;
        }
        return new File(baseFolder, getFolder());
    }

    //most of the material such as hg, git, p4 all print the file from the root without '/'
    //but subverion print it with '/', we standarize it here. look at the implementation of subversion as well.
    public boolean matches(String name, String regex) {
        if (regex.startsWith("/")) {
            regex = regex.substring(1);
        }
        return name.matches(regex);
    }

    public abstract String getUserName();

    public abstract String getPassword();

    public abstract String getEncryptedPassword();

    public abstract boolean isCheckExternals();

    public abstract String getUrl();

    public abstract void setUrl(String url);

    protected abstract UrlArgument getUrlArgument();

    protected abstract String getLocation();

    public Filter filter() {
        if (filter == null) {
            return new Filter();
        }
        return filter;
    }

    public String getFilterAsString() {
        return filter().getStringForDisplay();
    }

    public Filter rawFilter() {
        return filter;
    }

    public void setFilter(Filter filter) {
        this.filter = filter;
    }

    public String getDescription() {
        return getUriForDisplay();
    }

    public String getUriForDisplay() {
        return getUrlArgument().forDisplay();
    }

    public String getFolder() {
        return folder;
    }

    public String getDisplayName() {
        return name == null ? getUriForDisplay() : CaseInsensitiveString.str(name);
    }

    public boolean isAutoUpdate() {
        return autoUpdate;
    }

    public boolean getAutoUpdate() {
        return autoUpdate;
    }

    public void setAutoUpdate(boolean value) {
        autoUpdate = value;
    }

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

        ScmMaterialConfig that = (ScmMaterialConfig) o;

        if (folder != null ? !folder.equals(that.folder) : that.folder != null) {
            return false;
        }

        return super.equals(that);
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (folder != null ? folder.hashCode() : 0);
        return result;
    }

    @Override
    protected final void validateConcreteMaterial(ValidationContext validationContext) {
        validateNotOutsideSandbox();
        validateDestFolderPath();
        validateConcreteScmMaterial();
    }

    public abstract void validateConcreteScmMaterial();

    private void validateDestFolderPath() {
        if (StringUtils.isBlank(folder)) {
            return;
        }
        if (!new FilePathTypeValidator().isPathValid(folder)) {
            errors().add(FOLDER, FilePathTypeValidator.errorMessage("directory", getFolder()));
        }
    }

    public void setConfigAttributes(Object attributes) {
        super.setConfigAttributes(attributes);
        Map map = (Map) attributes;
        if (map.containsKey(FOLDER)) {
            String folder = (String) map.get(FOLDER);
            if (StringUtils.isBlank(folder)) {
                folder = null;
            }
            this.folder = folder;
        }
        this.setAutoUpdate("true".equals(map.get(AUTO_UPDATE)));
        if (map.containsKey(FILTER)) {
            String pattern = (String) map.get(FILTER);
            if (!StringUtil.isBlank(pattern)) {
                this.setFilter(Filter.fromDisplayString(pattern));
            } else {
                this.setFilter(null);
            }
        }
    }

    public boolean isAutoUpdateStateMismatch(MaterialConfigs materialAutoUpdateMap) {
        if(materialAutoUpdateMap.size() > 1){
            for (MaterialConfig otherMaterial : materialAutoUpdateMap) {
                if (otherMaterial.isAutoUpdate() != this.autoUpdate) {
                    return true;
                }
            }
        }
        return false;
    }

    public void setAutoUpdateMismatchError() {
        addError(AUTO_UPDATE, String.format("Material of type %s (%s) is specified more than once in the configuration with different values for the autoUpdate attribute."
                + " All copies of the a material should have the same value for this attribute.", getTypeForDisplay(), getDescription()));
    }
    public void setAutoUpdateMismatchErrorWithConfigRepo() {
        addError(AUTO_UPDATE, String.format("Material of type %s (%s) is specified as a configuration repository and pipeline material with disabled autoUpdate."
                + " All copies of the a material must have autoUpdate enabled or configuration repository must be removed", getTypeForDisplay(), getDescription()));
    }

    public void setDestinationFolderError(String message) {
        addError(FOLDER, message);
    }

    public void validateNotSubdirectoryOf(String otherSCMMaterialFolder) {
        String myDirPath = this.getFolder();
        if (myDirPath == null || otherSCMMaterialFolder == null) {
            return;
        }
        File myDir = new File(myDirPath);
        File otherDir = new File(otherSCMMaterialFolder);
        try {
            if (FileUtil.isSubdirectoryOf(myDir, otherDir)) {
                addError(FOLDER, "Invalid Destination Directory. Every material needs a different destination directory and the directories should not be nested.");
            }
        } catch (IOException e) {
            throw bomb("Dest folder specification is not valid. " + e.getMessage());
        }
    }

    public void validateDestinationDirectoryName(String otherSCMMaterialFolder) {
        if (folder != null && folder.equalsIgnoreCase(otherSCMMaterialFolder)) {
            addError(FOLDER, "The destination directory must be unique across materials.");
        }
    }

    private void validateNotOutsideSandbox() {
        String dest = this.getFolder();
        if (dest == null) {
            return;
        }
        if (!(FileUtil.isFolderInsideSandbox(dest))) {
            setDestinationFolderError(String.format("Dest folder '%s' is not valid. It must be a sub-directory of the working folder.", dest));
        }
    }

    public Boolean isUsedInFetchArtifact(PipelineConfig pipelineConfig) {
        return false;
    }

    // TODO: Consider renaming this to dest since we use that word in the UI & Config
    public void setFolder(String folder) {
        this.folder = folder;
    }

}


text:
=pod

=head1 NAME

    Bio::EnsEMBL::Hive::AnalysisCtrlRule

=head1 DESCRIPTION

    An 'analysis control rule' is a high level blocking control structure where there is
    a 'ctrled_analysis' which is 'BLOCKED' from running until all of its 'condition_analysis' are 'DONE'.
    If a ctrled_analysis requires multiple analysis to be DONE before it can run, a separate
    AnalysisCtrlRule must be created/stored for each condtion analysis.

    Allows the 'condition' analysis to be specified with a network savy URL like
    mysql://ensadmin:<pass>@ecs2:3361/compara_hive_test?analysis.logic_name='blast_NCBI34'

=head1 LICENSE

    Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
    Copyright [2016-2022] EMBL-European Bioinformatics Institute

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License
    is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and limitations under the License.

=head1 CONTACT

    Please subscribe to the Hive mailing list:  http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users  to discuss Hive-related questions or to be notified of our updates

=head1 APPENDIX

    The rest of the documentation details each of the object methods.
    Internal methods are usually preceded with a _

=cut

package Bio::EnsEMBL::Hive::AnalysisCtrlRule;

use strict;
use warnings;

use Bio::EnsEMBL::Hive::Utils ('throw');
use Bio::EnsEMBL::Hive::TheApiary;

use base ( 'Bio::EnsEMBL::Hive::Storable' );

sub unikey {    # override the default from Cacheable parent
    return [ 'condition_analysis_url', 'ctrled_analysis' ];
}

=head1 AUTOLOADED

    ctrled_analysis_id / ctrled_analysis

=cut

=head2 condition_analysis_url

    Arg[1]  : (optional) string $url
    Usage   : $self->condition_analysis_url($url);
    Function: Get/set method for the analysis which must be 'DONE' in order for
                the controlled analysis to be un-BLOCKED. Specified as a URL.
    Returns : string

=cut

sub condition_analysis_url {
    my $self = shift @_;

    if(@_) {
        $self->{'_condition_analysis_url'} = shift @_;
        if( $self->{'_condition_analysis'} ) {
            $self->{'_condition_analysis'} = undef;
        }
    } elsif( !$self->{'_condition_analysis_url'} and my $condition_analysis=$self->{'_condition_analysis'} ) {

        my $ref_pipeline = $self->ctrled_analysis && $self->ctrled_analysis->hive_pipeline;
        $self->{'_condition_analysis_url'} = $condition_analysis->relative_url( $ref_pipeline );    # the URL may be shorter if hive_pipeline is the same for source and target
    }

    return $self->{'_condition_analysis_url'};
}

=head2 condition_analysis

    Arg[1]  : (optional) Bio::EnsEMBL::Hive::Analysis object
    Usage   : $self->condition_analysis($anal);
    Function: Get/set method for the analysis which must be 'DONE' in order for
                the controlled analysis to be un-BLOCKED
    Returns : Bio::EnsEMBL::Hive::Analysis

=cut

sub condition_analysis {
    my ($self, $analysis, $no_die) = @_;

    if( defined $analysis ) {
        unless ($analysis->isa('Bio::EnsEMBL::Hive::Analysis')) {
            throw( "condition_analysis arg must be a [Bio::EnsEMBL::Hive::Analysis] not a [$analysis]");
        }
        $self->{'_condition_analysis'} = $analysis;
    }

    if( !$self->{'_condition_analysis'} and my $condition_analysis_url = $self->condition_analysis_url ) {   # lazy-load through TheApiary

        $self->{'_condition_analysis'} = Bio::EnsEMBL::Hive::TheApiary->find_by_url( $condition_analysis_url, $self->hive_pipeline, $no_die );
    }

    return $self->{'_condition_analysis'};
}

=head2 toString

    Args       : (none)
    Example    : print $c_rule->toString()."\n";
    Description: returns a stringified representation of the rule
    Returntype : string

=cut

sub toString {
    my $self = shift;

    return join('',
            'AnalysisCtrlRule: ',
            $self->condition_analysis_url,
            ' ---| ',
            $self->ctrled_analysis->logic_name,
    );
}

1;


text:
import os
import yaml

from .logging import error, warn

def get(logger, filename=None):
    if filename:
        try:
            with open(filename) as f:
                return yaml.safe_load(f)
        except IOError:
            error(logger, 'config file not found at %s' % filename)

    for folder in (os.curdir,
                   os.path.join(os.path.expanduser('~'), '.dsops'),
                   os.path.join('etc', 'dsops')):
        try:
            with open(os.path.join(folder, 'dsops.yml')) as f:
                return yaml.safe_load(f)
        except IOError:
            pass

    error(logger, 'no dsops.yml file found')

def parse(logger, configfile, config, **kwargs):
    if not configfile:
        error(logger, 'config file is empty')

    app, task = kwargs['app'], kwargs['task']
    if app not in configfile:
        error(logger, '%s is not configured' % app)

    app_config = configfile[app]
    if task not in app_config:
        error(logger, '%s is not configured for %s task' % (app, task))

    task_config = app_config[task]
    for k, v in config.items():
        config[k] = task_config[k] if k in task_config else v

    if 'env' in kwargs and kwargs['env']:
        env = kwargs['env']
        if env in task_config:
            env_config = task_config[env]
            for k, v in config.items():
                config[k] = env_config[k] if k in env_config else v
        else:
            warn(logger, '%s if not configured for %s' % (app, env))

    if 'required' in kwargs:
        for key in kwargs['required']:
            if not config[key]:
                error(logger, 'no %s configured for %s' % (key, app))


text:
autocommit off;
create class trigx( name char(10), num int);
create class trigy( name char(10), num int);
insert into trigy values( 'test1', 10);
insert into trigy(num) values(20);
insert into trigy values( 'test3', 30);
create trigger test_insert before insert on trigx
if new.name is null execute reject;
insert into trigx select * from trigy;
select * from trigx order by 1,2;
insert into trigx values( 'test1', 10);
insert into trigx(num) values(20);
insert into trigx values( 'test3', 10);
select * from trigx order by 1,2;
create trigger test_update before update on trigx
if new.num > 10 execute reject;
update trigx set num = 20 where num = 10;
select * from trigx order by 1,2;
update trigx set num = 20 where name = 'test1';
update trigx set num = 5 where name = 'test1';
select * from trigx order by 1,2;
create trigger test_delete before delete on trigx
if obj.num = 10 execute reject;
delete from trigx;
select * from trigx order by 1,2;
delete from trigx where num = 10;
delete from trigx where num = 5;
select * from trigx order by 1,2;
rollback;


text:
After losing a few employees due to mutiple reasons, we have decided to hire a few more employees to reduce the work load on the other employees. The new employees are listed below with their name, username, and password.

Peter Quill, pquill, starLord123
Groot, groot, iAmGroot!
##Directions
These new employees must be added to the active directory so that they have access to the Remote Desktop Server.


text:
package adinar.annotationsutils.common;

/** Just an alias for {@link AnnotationFilterEntry} to use with Classes. */
public class ClassEntry extends AnnotationFilterEntry<Class> {
    public static final String TAG = "ClassEntry";

    public ClassEntry(Class clazz) {
        super(clazz);
    }
}


text:
#if !defined(XALANDEFAULTPARSEDSOURCE_HEADER_GUARD)
#define XALANDEFAULTPARSEDSOURCE_HEADER_GUARD

// Base include file.  Must be first.
#include <xalanc/XalanTransformer/XalanTransformerDefinitions.hpp>

#include <xalanc/XalanSourceTree/XalanSourceTreeDocument.hpp>
#include <xalanc/XalanSourceTree/XalanSourceTreeDOMSupport.hpp>
#include <xalanc/XalanSourceTree/XalanSourceTreeParserLiaison.hpp>

#include <xalanc/XalanTransformer/XalanParsedSource.hpp>

namespace XALAN_CPP_NAMESPACE {

class XSLTInputSource;

class XalanDefaultParsedSourceDOMSupport : public XalanSourceTreeDOMSupport
{
public:

    XalanDefaultParsedSourceDOMSupport(
            const XalanSourceTreeParserLiaison&     theParserLiaison,
            const XalanSourceTreeDOMSupport&        theDOMSupport);

    virtual
    ~XalanDefaultParsedSourceDOMSupport();

    virtual void
    reset();

    // These interfaces are inherited from DOMSupport...

    virtual const XalanDOMString&
    getUnparsedEntityURI(
            const XalanDOMString&   theName,
            const XalanDocument&    theDocument) const;

    virtual bool
    isNodeAfter(
            const XalanNode&    node1,
            const XalanNode&    node2) const;

private:

    // Not implemented...
    XalanDefaultParsedSourceDOMSupport(const XalanDefaultParsedSourceDOMSupport&);

    XalanDefaultParsedSourceDOMSupport&
    operator=(const XalanDefaultParsedSourceDOMSupport&);

    // Data members...
    const XalanSourceTreeDOMSupport&    m_domSupport;
};

class XALAN_TRANSFORMER_EXPORT XalanDefaultParsedSourceHelper : public XalanParsedSourceHelper
{
public:

    XalanDefaultParsedSourceHelper(const XalanSourceTreeDOMSupport&     theSourceDOMSupport,
                                    MemoryManager&                  theManager XALAN_DEFAULT_MEMMGR);

    static XalanDefaultParsedSourceHelper*
    create(const XalanSourceTreeDOMSupport&     theSourceDOMSupport,
            MemoryManager&                  theManager);

    ~XalanDefaultParsedSourceHelper();

    virtual DOMSupport&
    getDOMSupport();

    virtual XMLParserLiaison&
    getParserLiaison();

private:

    // Not implemented...
    XalanDefaultParsedSourceHelper(const XalanDefaultParsedSourceHelper&);

    XalanDefaultParsedSourceHelper&
    operator=(const XalanDefaultParsedSourceHelper&);

    // Data members...
    XalanSourceTreeParserLiaison        m_parserLiaison;

    XalanDefaultParsedSourceDOMSupport  m_domSupport;
};

/**
 * This is designed to allow a XalanTranfomer object to reuse a parsed
 * document.
 */
class XALAN_TRANSFORMER_EXPORT XalanDefaultParsedSource : public XalanParsedSource
{
public:

    XalanDefaultParsedSource(
            const InputSource&      theInputSource,
            bool                    fValidate = false,
            ErrorHandler*           theErrorHandler = 0,
            EntityResolver*         theEntityResolver = 0,
            XMLEntityResolver*      theXMLEntityResolver = 0,
            const XalanDOMChar*     theExternalSchemaLocation = 0,
            const XalanDOMChar*     theExternalNoNamespaceSchemaLocation = 0,
            bool                    fPoolAllTextNodes = XalanSourceTreeDocument::getPoolAllTextNodes(),
            MemoryManager&          theManager XALAN_DEFAULT_MEMMGR);

    static XalanDefaultParsedSource*
    create(
            MemoryManager&          theManager,
            const InputSource&      theInputSource,
            bool                    fValidate = false,
            ErrorHandler*           theErrorHandler = 0,
            EntityResolver*         theEntityResolver = 0,
            XMLEntityResolver*      theXMLEntityResolver = 0,
            const XalanDOMChar*     theExternalSchemaLocation = 0,
            const XalanDOMChar*     theExternalNoNamespaceSchemaLocation = 0,
            bool                    fPoolAllTextNodes = XalanSourceTreeDocument::getPoolAllTextNodes());

    virtual
    ~XalanDefaultParsedSource();

    virtual XalanDocument*
    getDocument() const;

    virtual XalanParsedSourceHelper*
    createHelper(MemoryManager&     theManager) const;

    virtual const XalanDOMString&
    getURI() const;

private:

    // Not implemented...
    XalanDefaultParsedSource(const XalanDefaultParsedSource&);

    XalanDefaultParsedSource&
    operator=(const XalanDefaultParsedSource&);

    // Data members...
    XalanSourceTreeParserLiaison    m_parserLiaison;

    XalanSourceTreeDOMSupport       m_domSupport;

    XalanSourceTreeDocument*        m_parsedSource;

    XalanDOMString                  m_uri;
};

}

#endif  // XALANDEFAULTPARSEDSOURCE_HEADER_GUARD


text:
namespace {
const QString GAMEBASE_UNARCHIVED_DIR = "gamebase_tmp";
const QString CONTRIB_UNARCHIVED_DIR = "contrib_tmp";

bool changeDir(QDir dir, QString dirName, QDir& dstDir)
{
    if (!dir.exists(dirName))
        return false;
    dstDir = dir;
    return dstDir.cd(dirName);
}

bool makeDir(QDir dir, QString dirName, QDir& dstDir)
{
    if (!dir.exists(dirName)) {
        if (!dir.mkdir(dirName))
            return false;
    }
    dstDir = dir;
    return dstDir.cd(dirName);
}
}

LibraryDeployer::LibraryDeployer(const Library& library)
    : library(library)
{
    workingDir = Settings::instance().workingDir();
    manager = new FilesManager(this);
    manager->setRootDirectory(workingDir.path);
    compiler = new Compiler(this);
    compiler->setLegacySolution(true);
}

void LibraryDeployer::run()
{
    QDir srcDir(library.source.path);
    if (!srcDir.cd(library.archiveName))
        return emitFinish();

    if (workingDir.check() != SourceStatus::OK)
        return emitFinish();

    QDir dstDir(workingDir.path);
    QDir rootDir;
    if (!unarchive(srcDir, rootDir))
        return emitFinish();
    if (!prepare(rootDir))
        return emitFinish();
    if (!unarchiveContrib(srcDir, rootDir))
        return emitFinish();

    for (int i = 0; i < 100; ++i) {
        if (dstDir.rename(rootDir.absolutePath(),
                          dstDir.absoluteFilePath(Files::DEPLOYED_ROOT_DIR_NAME)))
            break;
        if (i == 99) {
            qDebug() << "Failed to rename " << rootDir.absolutePath()
                     << " to " << dstDir.absoluteFilePath(Files::DEPLOYED_ROOT_DIR_NAME);
            return emitFinish();
        }
    }
    if (!changeDir(dstDir, Files::DEPLOYED_ROOT_DIR_NAME, rootDir))
        return emitFinish();

    if (library.state == Library::SourceCode) {
        if (!compileSources(rootDir)) {
            qDebug() << "Failed to compile sources";
            return emitFinish();
        }
    }

    if (!makeLink(rootDir)) {
        qDebug() << "Failed to make link";
        return emitFinish();
    }

    emitFinish();
}

bool LibraryDeployer::unarchive(QDir srcDir, QDir& rootDir)
{
    auto archivePath = srcDir.absoluteFilePath(Files::GAMEBASE_ARCHIVE_NAME);

    QDir dstDir(workingDir.path);
    if (dstDir.exists(GAMEBASE_UNARCHIVED_DIR)) {
        ProgressManager::invokeShow("Удаление временных файлов...", "Удалено файлов");
        manager->remove(GAMEBASE_UNARCHIVED_DIR);
        if (!manager->run()) {
            qDebug() << "Failed to remove " << dstDir.absoluteFilePath(GAMEBASE_UNARCHIVED_DIR);
            return false;
        }
        manager->reset();
    }

    rootDir = dstDir;
    if (!rootDir.mkdir(GAMEBASE_UNARCHIVED_DIR)
        || !rootDir.cd(GAMEBASE_UNARCHIVED_DIR))
        return false;

    ProgressManager::invokeShow("Распаковка корня пакета...", "Распаковано файлов");
    manager->unarchive(archivePath, GAMEBASE_UNARCHIVED_DIR);
    if (!manager->run()) {
        qDebug() << "Failed to unarchive library";
        return false;
    }
    manager->reset();
    return true;
}

bool LibraryDeployer::prepare(QDir rootDir)
{
    QDir packageDir, resourcesDir, fontsDir, designsDir, editorDesignDir,
            contribDir, binDir, debugDir, releaseDir, editorDir;

    ProgressManager::invokeShow("Подготовка пакета...", "Скопировано файлов");
    if (!changeDir(rootDir, Files::PACKAGE_DIR_NAME, packageDir))
        return false;
    if (!changeDir(rootDir, Files::RESOURCES_DIR_NAME, resourcesDir))
        return false;
    if (!changeDir(resourcesDir, Files::DESIGNS_DIR_NAME, designsDir))
        return false;
    if (!changeDir(designsDir, Files::EDITOR_PROJECT_NAME, editorDesignDir))
        return false;

    if (!makeDir(resourcesDir, Files::FONTS_DIR_NAME, fontsDir))
        return false;
    if (!makeDir(rootDir, Files::CONTRIB_DIR_NAME, contribDir))
        return false;
    if (!makeDir(contribDir, Files::BIN_DIR_NAME, binDir))
        return false;
    if (!makeDir(binDir, Files::DEBUG_DIR_NAME, debugDir))
        return false;
    if (!makeDir(binDir, Files::RELEASE_DIR_NAME, releaseDir))
        return false;
    if (!makeDir(binDir, Files::EDITOR_DIR_NAME, editorDir))
        return false;

    manager->unarchive(packageDir.absoluteFilePath(Files::FONTS_DIR_NAME + ".zip"),
                       fontsDir.absolutePath());
    manager->copyFiles(editorDesignDir.absolutePath(), editorDir.absolutePath());
    manager->copy(packageDir.absoluteFilePath("config.json"),
                  debugDir.absoluteFilePath(Files::APP_CONFIG_NAME));
    manager->copy(packageDir.absoluteFilePath("config.json"),
                  releaseDir.absoluteFilePath(Files::APP_CONFIG_NAME));

    if (!manager->run()) {
        qDebug() << "Failed to prepare library";
        return false;
    }
    manager->reset();

    return true;
}

bool LibraryDeployer::unarchiveContrib(QDir srcDir, QDir rootDir)
{
    QDir contribDir, binDir, debugDir, releaseDir, tmpContribDir;

    ProgressManager::invokeShow("Распаковка зависимостей...", "Распаковано файлов");
    if (!changeDir(rootDir, Files::CONTRIB_DIR_NAME, contribDir))
        return false;
    if (!changeDir(contribDir, Files::BIN_DIR_NAME, binDir))
        return false;
    if (!changeDir(binDir, Files::DEBUG_DIR_NAME, debugDir))
        return false;
    if (!changeDir(binDir, Files::RELEASE_DIR_NAME, releaseDir))
        return false;
    if (!makeDir(contribDir, CONTRIB_UNARCHIVED_DIR, tmpContribDir))
        return false;

    manager->unarchive(srcDir.absoluteFilePath(Files::CONTRIB_ARCHIVE_NAME),
                       tmpContribDir.absolutePath());
    if (!manager->run()) {
        qDebug() << "Failed to unarchive dependency files";
        return false;
    }
    manager->reset();

    ProgressManager::invokeShow("Копирование файлов зависимостей...", "Скопировано файлов");
    manager->rename(tmpContribDir.absoluteFilePath(Files::INCLUDE_DIR_NAME),
                    contribDir.absoluteFilePath(Files::INCLUDE_DIR_NAME));
    manager->moveFiles(tmpContribDir.absoluteFilePath(Files::DEBUG_DIR_NAME),
                       debugDir.absolutePath());
    manager->moveFiles(tmpContribDir.absoluteFilePath(Files::RELEASE_DIR_NAME),
                       releaseDir.absolutePath());
    if (!manager->run()) {
        qDebug() << "Failed to move dependency files";
        return false;
    }
    manager->reset();

    if (!tmpContribDir.removeRecursively()) {
        qDebug() << "Failed to remove " << tmpContribDir.absolutePath();
        return false;
    }

    return true;
}

bool LibraryDeployer::compileSources(QDir rootDir)
{
    auto dir = rootDir;
    dir.cd(Files::SOURCES_DIR_NAME);
    dir.cd(Files::GAMEBASE_PROJECT_NAME);
    if (!compiler->compile(dir, Compiler::BuildType::Debug))
        return false;
    if (!compiler->compile(dir, Compiler::BuildType::Release))
        return false;
    dir.cdUp();
    dir.cd(Files::EDITOR_PROJECT_NAME);
    if (!compiler->compile(dir, Compiler::BuildType::Release))
        return false;
    return true;
}

bool LibraryDeployer::makeLink(QDir rootDir)
{
    QDir parentDir, contribDir, binDir, releaseDir;

    parentDir = rootDir;
    if (!parentDir.cdUp())
        return false;
    if (!changeDir(rootDir, Files::CONTRIB_DIR_NAME, contribDir))
        return false;
    if (!changeDir(contribDir, Files::BIN_DIR_NAME, binDir))
        return false;
    if (!changeDir(binDir, Files::RELEASE_DIR_NAME, releaseDir))
        return false;
    if (!QFile::link(releaseDir.absoluteFilePath(Files::EDITOR_PROJECT_NAME + ".exe"),
                     parentDir.absoluteFilePath(Files::EDITOR_LINK_NAME)))
        return false;
    return true;
}

void LibraryDeployer::emitFinish()
{
    emit finishedDeploy(library.afterAction(Library::Deploy));
}


text:
from django.db.models import Sum
from django.utils.timezone import now
from le_utils.constants import exercises
from rest_framework import serializers

from kolibri.core.auth.models import FacilityUser
from kolibri.core.logger.constants.exercise_attempts import MAPPING
from kolibri.core.logger.models import AttemptLog
from kolibri.core.logger.models import ContentSessionLog
from kolibri.core.logger.models import ContentSummaryLog
from kolibri.core.logger.models import ExamAttemptLog
from kolibri.core.logger.models import ExamLog
from kolibri.core.logger.models import MasteryLog
from kolibri.core.logger.models import UserSessionLog
from kolibri.core.serializers import KolibriModelSerializer

class ContentSessionLogSerializer(KolibriModelSerializer):

    extra_fields = serializers.JSONField(default='{}')

    class Meta:
        model = ContentSessionLog
        fields = ('id', 'user', 'content_id', 'channel_id', 'start_timestamp',
                  'end_timestamp', 'time_spent', 'kind', 'extra_fields', 'progress')

class ExamLogSerializer(KolibriModelSerializer):
    progress = serializers.SerializerMethodField()
    score = serializers.SerializerMethodField()

    def get_progress(self, obj):
        return obj.attemptlogs.values_list('item').distinct().count()

    def get_score(self, obj):
        return obj.attemptlogs.values_list('item').order_by('completion_timestamp').distinct().aggregate(Sum('correct')).get('correct__sum')

    class Meta:
        model = ExamLog
        fields = ('id', 'exam', 'user', 'closed', 'progress', 'score', 'completion_timestamp')
        read_only_fields = ('completion_timestamp', )

    def update(self, instance, validated_data):
        # This has changed, set the completion timestamp
        if validated_data.get('closed') and not instance.closed:
            instance.completion_timestamp = now()
        return super(ExamLogSerializer, self).update(instance, validated_data)

class MasteryLogSerializer(KolibriModelSerializer):

    pastattempts = serializers.SerializerMethodField()
    totalattempts = serializers.SerializerMethodField()
    mastery_criterion = serializers.JSONField(default='{}')
    update_fields = ('pastattempts', )

    class Meta:
        model = MasteryLog
        fields = ('id', 'summarylog', 'start_timestamp', 'pastattempts', 'totalattempts', 'user',
                  'end_timestamp', 'completion_timestamp', 'mastery_criterion', 'mastery_level', 'complete')

    def get_pastattempts(self, obj):
        mastery_criterion = obj.mastery_criterion
        exercise_type = mastery_criterion.get('type')
        attemptlogs = AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog) \
                                        .values('correct', 'hinted', 'error') \
                                        .order_by('-start_timestamp')

        # get the first x logs depending on the exercise type
        if exercise_type == exercises.M_OF_N:
            return attemptlogs[:mastery_criterion['n']]
        elif MAPPING.get(exercise_type):
            return attemptlogs[:MAPPING.get(exercise_type)]
        else:
            return attemptlogs[:10]

    def get_totalattempts(self, obj):
        return AttemptLog.objects.filter(masterylog__summarylog=obj.summarylog).count()

class AttemptLogSerializer(KolibriModelSerializer):
    answer = serializers.JSONField(default='{}')
    interaction_history = serializers.JSONField(default='[]')

    class Meta:
        model = AttemptLog
        fields = ('id', 'masterylog', 'start_timestamp', 'sessionlog',
                  'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',
                  'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history', 'error')

class ExamAttemptLogSerializer(KolibriModelSerializer):
    answer = serializers.JSONField(default='{}', allow_null=True)
    interaction_history = serializers.JSONField(default='[]')

    class Meta:
        model = ExamAttemptLog
        fields = ('id', 'examlog', 'start_timestamp', 'channel_id', 'content_id',
                  'end_timestamp', 'completion_timestamp', 'item', 'time_spent', 'user',
                  'complete', 'correct', 'hinted', 'answer', 'simple_answer', 'interaction_history')

    def validate(self, data):
        # Only do this validation when both are being set
        # not necessary on PATCH, for example
        if data.get('examlog') and data.get('user'):
            try:
                if data['examlog'].user != data['user']:
                    raise serializers.ValidationError('User field and user for related exam log are not the same')
            except ExamLog.DoesNotExist:
                raise serializers.ValidationError('Invalid exam log')
        return data

class ContentSummaryLogSerializer(KolibriModelSerializer):

    currentmasterylog = serializers.SerializerMethodField()
    extra_fields = serializers.JSONField(default='{}')
    update_fields = ()

    class Meta:
        model = ContentSummaryLog
        fields = ('id', 'user', 'content_id', 'channel_id', 'start_timestamp', 'currentmasterylog',
                  'end_timestamp', 'completion_timestamp', 'time_spent', 'progress', 'kind', 'extra_fields')

    def get_currentmasterylog(self, obj):
        try:
            current_log = obj.masterylogs.latest('end_timestamp')
            return MasteryLogSerializer(current_log).data
        except MasteryLog.DoesNotExist:
            return None

class UserSessionLogSerializer(KolibriModelSerializer):

    update_fields = ()

    class Meta:
        model = UserSessionLog
        fields = ('id', 'user', 'channels', 'start_timestamp', 'last_interaction_timestamp', 'pages')

class TotalContentProgressSerializer(serializers.ModelSerializer):

    progress = serializers.SerializerMethodField()

    class Meta:
        model = FacilityUser
        fields = ('progress', 'id')

    def get_progress(self, obj):
        return obj.contentsummarylog_set.filter(progress=1).aggregate(Sum('progress')).get('progress__sum')


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Portal do cidadão</title>
	<link rel="stylesheet" href="resources/styles/index.css">
	<link rel="stylesheet" href="resources/styles/legislacao.css">
	<link rel="stylesheet" href="resources/styles/cidadao.css">
	<link rel="stylesheet" href="resources/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" href="resources/styles/fonts.css">

	<?php include 'includes/menu.html';?>

Sem Informações para Mostrar

			           O que é necessário

                        Sem Informações para Mostrar

			           Onde Requerer

                        Sem Informações para Mostrar

			           Como Requerer

			        	Sem Informações para Mostrar

			           Mais Informações

			        	Sem Informações para Mostrar

<?php include 'includes/footerIn.html';?>


text:
package com.google.appengine.api.users;

/**
 * This interface should be implemented by providers of the {@link UserService} and registered with
 * {@link com.google.appengine.spi.ServiceFactoryFactory}.
 *
 */
public interface IUserServiceFactory {

  /**
   * Creates an implementation of the UserService.
   */
  UserService getUserService();

}


text:
package main

import (
	"fmt"
	"log"
	"net/http"
	"os"

	"github.com/jadiego/bloom/apiserver/handlers"
	"github.com/jadiego/bloom/apiserver/middleware"
	"github.com/jadiego/bloom/apiserver/models/stories"
	"github.com/jadiego/bloom/apiserver/models/users"
	"github.com/jadiego/bloom/apiserver/sessions"
	redis "gopkg.in/redis.v5"
)

// default port numbers
const (
	defaultPort      = "443"
	defaultRedisPort = "6379"
	defaultMongoPort = "27017"
)

// route paths
const (
	apiRoot             = "/v1/"
	apiUsers            = apiRoot + "users"
	apiSessions         = apiRoot + "sessions"
	apiResetCodes       = apiRoot + "resetcodes"
	apiResetPassword    = apiRoot + "passwords/"
	apiSessionsMine     = apiSessions + "/mine"
	apiUsersMe          = apiUsers + "/me"
	apiStories          = apiRoot + "stories"
	apiSpecificStories  = apiStories + "/"
	apiSections         = apiRoot + "sections"
	apiSpecificSections = apiSections + "/"
)

//main is the main entry point for this program
func main() {
	fmt.Println("Starting Bloom App..")
	//read and use the following environment variables
	//when initializing and starting your web server
	// PORT - port number to listen on for HTTP requests (if not set, use defaultPort)
	// HOST - host address to respond to (if not set, leave empty, which means any host)
	// SESSIONKEY - a string to use as the session ID singing key
	// REDISADDR - the address of your redis session store (if not set, use defaultRedisPort)
	// DBADDR - the address of your database server (if not set, use defaultMongoPort)
	port := os.Getenv("PORT")
	if len(port) == 0 {
		fmt.Println("Port number not set. Defaulting to port: " + defaultPort)
		port = defaultPort
	}
	host := os.Getenv("HOST")
	if len(host) == 0 {
		fmt.Println("Host not set. Defaulting to empty host")
		host = ""
	}
	addr := fmt.Sprintf("%s:%s", host, port)

	//Set Redis
	redisAddr := os.Getenv("REDISADDR")
	if len(redisAddr) == 0 {
		fmt.Println("Redis address not set. Defaulting to port: " + defaultRedisPort)
		redisAddr = defaultRedisPort
	}
	rclient := redis.NewClient(&redis.Options{
		Addr: redisAddr,
	})
	rstore := sessions.NewRedisStore(rclient, -1)

	//Set Users DB
	dbAddr := os.Getenv("DBADDR")
	if len(dbAddr) == 0 {
		fmt.Println("DB address not set. Defaulting to port: " + defaultMongoPort)
		dbAddr = defaultMongoPort
	}
	udbstore, err := users.NewMongoStore(dbAddr, "bloom", "users")
	if err != nil {
		log.Fatalf("error starting DB: %v", err.Error())
	}
	defer udbstore.Session.Close()
	// Set Stories DB
	sdbstore, err := stories.NewMongoStore(dbAddr, "bloom", "stories", "sections")
	if err != nil {
		log.Fatalf("error starting DB: %v", err.Error())
	}
	defer sdbstore.Session.Close()

	//Get sessionkey
	sesskey := os.Getenv("SESSIONKEY")
	if len(sesskey) < 1 {
		log.Fatal("sesion key env not set")
	}

	//Initialize context
	ctx := &handlers.Context{
		SessionKey:   sesskey,
		SessionStore: rstore,
		UserStore:    udbstore,
		StoryStore:   sdbstore,
	}

	//get the TLS key and cert paths from environment variables
	//this allows us to use a self-signed cert/key during development
	//and the Let's Encrypt cert/key in production
	tlsKeyPath := os.Getenv("TLSKEY")
	tlsCertPath := os.Getenv("TLSCERT")

	//ensure the mail env used by ctx.PasswordResetHandler
	if len(os.Getenv("MAILHOST")) < 1 {
		log.Fatal("mail host not set")
	}
	if len(os.Getenv("MAILPORT")) < 1 {
		log.Fatal("mail port not set")
	}
	if len(os.Getenv("MAILUSERNAME")) < 1 {
		log.Fatal("mail username not set")
	}
	if len(os.Getenv("MAILPASSWORD")) < 1 {
		log.Fatal("mail password not set")
	}

	mux := http.NewServeMux()
	muxLogged := http.NewServeMux()

	muxLogged.HandleFunc(apiUsers, ctx.UsersHandler)
	muxLogged.HandleFunc(apiSessions, ctx.SessionsHandler)
	muxLogged.HandleFunc(apiSessionsMine, ctx.SessionsMineHandler)
	muxLogged.HandleFunc(apiUsersMe, ctx.UsersMeHanlder)
	muxLogged.HandleFunc(apiStories, ctx.StoriesHandler)
	muxLogged.HandleFunc(apiSpecificStories, ctx.SpecificStoryhandler)
	muxLogged.HandleFunc(apiSections, ctx.SectionsHandler)
	muxLogged.HandleFunc(apiSpecificSections, ctx.SpecificSectionHandler)
	muxLogged.HandleFunc(apiResetCodes, ctx.ResetCodesHandler)
	muxLogged.HandleFunc(apiResetPassword, ctx.PasswordResetHandler)

	logger := log.New(os.Stdout, "", log.LstdFlags)
	mux.Handle(apiRoot, middleware.Adapt(muxLogged, middleware.CORS("", "", "", ""), middleware.Notify(logger)))

	//start your web server and use log.Fatal() to log
	//any errors that occur if the server can't start
	//HINT: https://golang.org/pkg/net/http/#ListenAndServe
	fmt.Printf("server is listening at %s:%s...\n", host, port)
	log.Fatal(http.ListenAndServeTLS(addr, tlsCertPath, tlsKeyPath, mux))

}


text:
package org.apache.jena.riot.thrift;

import static org.apache.jena.riot.RDFLanguages.RDFTHRIFT ;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.apache.jena.riot.* ;
import org.junit.Test ;

public class TestThriftSetup {

    @Test public void setup_01() {
        assertTrue(RDFLanguages.isRegistered(RDFTHRIFT)) ;
    }

    @Test public void setup_02() {
        Lang lang = RDFLanguages.filenameToLang("data.rt") ;
        assertEquals(lang, RDFTHRIFT) ;
    }

    @Test public void setup_03() {
        assertTrue(RDFParserRegistry.isQuads(RDFTHRIFT)) ;
        assertTrue(RDFParserRegistry.isTriples(RDFTHRIFT)) ;
        assertTrue(RDFParserRegistry.isRegistered(RDFTHRIFT));
        assertNotNull(RDFParserRegistry.getFactory(RDFTHRIFT)) ;
    }

    @Test public void setup_04() {
        assertTrue(RDFWriterRegistry.contains(RDFTHRIFT)) ;
        assertNotNull(RDFWriterRegistry.getWriterDatasetFactory(RDFTHRIFT)) ;
        assertTrue(RDFWriterRegistry.contains(RDFFormat.RDF_THRIFT)) ;
        assertNotNull(RDFWriterRegistry.getWriterDatasetFactory(RDFFormat.RDF_THRIFT)) ;
        assertTrue(RDFWriterRegistry.contains(RDFFormat.RDF_THRIFT_VALUES)) ;
        assertNotNull(RDFWriterRegistry.getWriterDatasetFactory(RDFFormat.RDF_THRIFT_VALUES)) ;
    }
}


text:
using content::BrowserThread;
using storage::FileSystemURL;

namespace sync_file_system {

namespace {

void PrepareForProcessRemoteChangeCallbackAdapter(
    const RemoteChangeProcessor::PrepareChangeCallback& callback,
    SyncStatusCode status,
    const LocalFileSyncInfo& sync_file_info,
    storage::ScopedFile snapshot) {
  callback.Run(status, sync_file_info.metadata, sync_file_info.changes);
}

void InvokeCallbackOnNthInvocation(int* count, const base::Closure& callback) {
  --*count;
  if (*count <= 0)
    callback.Run();
}

}  // namespace

LocalFileSyncService::OriginChangeMap::OriginChangeMap()
    : next_(change_count_map_.end()) {}
LocalFileSyncService::OriginChangeMap::~OriginChangeMap() {}

bool LocalFileSyncService::OriginChangeMap::NextOriginToProcess(GURL* origin) {
  DCHECK(origin);
  if (change_count_map_.empty())
    return false;
  Map::iterator begin = next_;
  do {
    if (next_ == change_count_map_.end())
      next_ = change_count_map_.begin();
    DCHECK_NE(0, next_->second);
    *origin = next_++->first;
    if (!ContainsKey(disabled_origins_, *origin))
      return true;
  } while (next_ != begin);
  return false;
}

int64_t LocalFileSyncService::OriginChangeMap::GetTotalChangeCount() const {
  int64_t num_changes = 0;
  for (Map::const_iterator iter = change_count_map_.begin();
       iter != change_count_map_.end(); ++iter) {
    if (ContainsKey(disabled_origins_, iter->first))
      continue;
    num_changes += iter->second;
  }
  return num_changes;
}

void LocalFileSyncService::OriginChangeMap::SetOriginChangeCount(
    const GURL& origin,
    int64_t changes) {
  if (changes != 0) {
    change_count_map_[origin] = changes;
    return;
  }
  Map::iterator found = change_count_map_.find(origin);
  if (found != change_count_map_.end()) {
    if (next_ == found)
      ++next_;
    change_count_map_.erase(found);
  }
}

void LocalFileSyncService::OriginChangeMap::SetOriginEnabled(
    const GURL& origin, bool enabled) {
  if (enabled)
    disabled_origins_.erase(origin);
  else
    disabled_origins_.insert(origin);
}

// LocalFileSyncService -------------------------------------------------------

std::unique_ptr<LocalFileSyncService> LocalFileSyncService::Create(
    Profile* profile) {
  return base::WrapUnique(new LocalFileSyncService(profile, nullptr));
}

std::unique_ptr<LocalFileSyncService> LocalFileSyncService::CreateForTesting(
    Profile* profile,
    leveldb::Env* env) {
  std::unique_ptr<LocalFileSyncService> sync_service(
      new LocalFileSyncService(profile, env));
  sync_service->sync_context_->set_mock_notify_changes_duration_in_sec(0);
  return sync_service;
}

LocalFileSyncService::~LocalFileSyncService() {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
}

void LocalFileSyncService::Shutdown() {
  sync_context_->RemoveOriginChangeObserver(this);
  sync_context_->ShutdownOnUIThread();
  profile_ = nullptr;
}

void LocalFileSyncService::MaybeInitializeFileSystemContext(
    const GURL& app_origin,
    storage::FileSystemContext* file_system_context,
    const SyncStatusCallback& callback) {
  sync_context_->MaybeInitializeFileSystemContext(
      app_origin, file_system_context,
      base::Bind(&LocalFileSyncService::DidInitializeFileSystemContext,
                 AsWeakPtr(), app_origin,
                 base::RetainedRef(file_system_context), callback));
}

void LocalFileSyncService::AddChangeObserver(Observer* observer) {
  change_observers_.AddObserver(observer);
}

void LocalFileSyncService::RegisterURLForWaitingSync(
    const FileSystemURL& url,
    const base::Closure& on_syncable_callback) {
  sync_context_->RegisterURLForWaitingSync(url, on_syncable_callback);
}

void LocalFileSyncService::ProcessLocalChange(
    const SyncFileCallback& callback) {
  // Pick an origin to process next.
  GURL origin;
  if (!origin_change_map_.NextOriginToProcess(&origin)) {
    callback.Run(SYNC_STATUS_NO_CHANGE_TO_SYNC, FileSystemURL());
    return;
  }
  DCHECK(!origin.is_empty());
  DCHECK(ContainsKey(origin_to_contexts_, origin));

  DVLOG(1) << "Starting ProcessLocalChange";

  sync_context_->GetFileForLocalSync(
      origin_to_contexts_[origin],
      base::Bind(&LocalFileSyncService::DidGetFileForLocalSync,
                 AsWeakPtr(), callback));
}

void LocalFileSyncService::SetLocalChangeProcessor(
    LocalChangeProcessor* local_change_processor) {
  local_change_processor_ = local_change_processor;
}

void LocalFileSyncService::SetLocalChangeProcessorCallback(
    const GetLocalChangeProcessorCallback& get_local_change_processor) {
  get_local_change_processor_ = get_local_change_processor;
}

void LocalFileSyncService::HasPendingLocalChanges(
    const FileSystemURL& url,
    const HasPendingLocalChangeCallback& callback) {
  if (!ContainsKey(origin_to_contexts_, url.origin())) {
    base::ThreadTaskRunnerHandle::Get()->PostTask(
        FROM_HERE,
        base::Bind(callback, SYNC_FILE_ERROR_INVALID_URL, false));
    return;
  }
  sync_context_->HasPendingLocalChanges(
      origin_to_contexts_[url.origin()], url, callback);
}

void LocalFileSyncService::PromoteDemotedChanges(
    const base::Closure& callback) {
  if (origin_to_contexts_.empty()) {
    callback.Run();
    return;
  }

  base::Closure completion_callback =
      base::Bind(&InvokeCallbackOnNthInvocation,
                 base::Owned(new int(origin_to_contexts_.size() + 1)),
                 callback);
  for (OriginToContext::iterator iter = origin_to_contexts_.begin();
       iter != origin_to_contexts_.end(); ++iter)
    sync_context_->PromoteDemotedChanges(iter->first, iter->second,
                                         completion_callback);
  completion_callback.Run();
}

void LocalFileSyncService::GetLocalFileMetadata(
    const FileSystemURL& url, const SyncFileMetadataCallback& callback) {
  DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
  sync_context_->GetFileMetadata(origin_to_contexts_[url.origin()],
                                 url, callback);
}

void LocalFileSyncService::PrepareForProcessRemoteChange(
    const FileSystemURL& url,
    const PrepareChangeCallback& callback) {
  DVLOG(1) << "PrepareForProcessRemoteChange: " << url.DebugString();

  if (!ContainsKey(origin_to_contexts_, url.origin())) {
    // This could happen if a remote sync is triggered for the app that hasn't
    // been initialized in this service.
    DCHECK(profile_);
    // The given url.origin() must be for valid installed app.
    const extensions::Extension* extension =
        extensions::ExtensionRegistry::Get(profile_)
            ->enabled_extensions().GetAppByURL(url.origin());
    if (!extension) {
      util::Log(
          logging::LOG_WARNING,
          FROM_HERE,
          "PrepareForProcessRemoteChange called for non-existing origin: %s",
          url.origin().spec().c_str());

      // The extension has been uninstalled and this method is called
      // before the remote changes for the origin are removed.
      callback.Run(SYNC_STATUS_NO_CHANGE_TO_SYNC,
                   SyncFileMetadata(), FileChangeList());
      return;
    }
    GURL site_url =
        extensions::util::GetSiteForExtensionId(extension->id(), profile_);
    DCHECK(!site_url.is_empty());
    scoped_refptr<storage::FileSystemContext> file_system_context =
        content::BrowserContext::GetStoragePartitionForSite(profile_, site_url)
            ->GetFileSystemContext();
    MaybeInitializeFileSystemContext(
        url.origin(), file_system_context.get(),
        base::Bind(&LocalFileSyncService::DidInitializeForRemoteSync,
                   AsWeakPtr(), url, base::RetainedRef(file_system_context),
                   callback));
    return;
  }

  DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
  sync_context_->PrepareForSync(
      origin_to_contexts_[url.origin()], url,
      LocalFileSyncContext::SYNC_EXCLUSIVE,
      base::Bind(&PrepareForProcessRemoteChangeCallbackAdapter, callback));
}

void LocalFileSyncService::ApplyRemoteChange(
    const FileChange& change,
    const base::FilePath& local_path,
    const FileSystemURL& url,
    const SyncStatusCallback& callback) {
  DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
  util::Log(logging::LOG_VERBOSE, FROM_HERE,
            "[Remote -> Local] ApplyRemoteChange: %s on %s",
            change.DebugString().c_str(),
            url.DebugString().c_str());

  sync_context_->ApplyRemoteChange(
      origin_to_contexts_[url.origin()],
      change, local_path, url,
      base::Bind(&LocalFileSyncService::DidApplyRemoteChange, AsWeakPtr(),
                 callback));
}

void LocalFileSyncService::FinalizeRemoteSync(
    const FileSystemURL& url,
    bool clear_local_changes,
    const base::Closure& completion_callback) {
  DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
  sync_context_->FinalizeExclusiveSync(
      origin_to_contexts_[url.origin()],
      url, clear_local_changes, completion_callback);
}

void LocalFileSyncService::RecordFakeLocalChange(
    const FileSystemURL& url,
    const FileChange& change,
    const SyncStatusCallback& callback) {
  DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
  sync_context_->RecordFakeLocalChange(origin_to_contexts_[url.origin()],
                                       url, change, callback);
}

void LocalFileSyncService::OnChangesAvailableInOrigins(
    const std::set<GURL>& origins) {
  bool need_notification = false;
  for (std::set<GURL>::const_iterator iter = origins.begin();
       iter != origins.end(); ++iter) {
    const GURL& origin = *iter;
    if (!ContainsKey(origin_to_contexts_, origin)) {
      // This could happen if this is called for apps/origins that haven't
      // been initialized yet, or for apps/origins that are disabled.
      // (Local change tracker could call this for uninitialized origins
      // while it's reading dirty files from the database in the
      // initialization phase.)
      pending_origins_with_changes_.insert(origin);
      continue;
    }
    need_notification = true;
    SyncFileSystemBackend* backend =
        SyncFileSystemBackend::GetBackend(origin_to_contexts_[origin]);
    DCHECK(backend);
    DCHECK(backend->change_tracker());
    origin_change_map_.SetOriginChangeCount(
        origin, backend->change_tracker()->num_changes());
  }
  if (!need_notification)
    return;
  int64_t num_changes = origin_change_map_.GetTotalChangeCount();
  FOR_EACH_OBSERVER(Observer, change_observers_,
                    OnLocalChangeAvailable(num_changes));
}

void LocalFileSyncService::SetOriginEnabled(const GURL& origin, bool enabled) {
  if (!ContainsKey(origin_to_contexts_, origin))
    return;
  origin_change_map_.SetOriginEnabled(origin, enabled);
}

LocalFileSyncService::LocalFileSyncService(Profile* profile,
                                           leveldb::Env* env_override)
    : profile_(profile),
      sync_context_(new LocalFileSyncContext(
          profile_->GetPath(),
          env_override,
          BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get(),
          BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)
              .get())),
      local_change_processor_(nullptr) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  sync_context_->AddOriginChangeObserver(this);
}

void LocalFileSyncService::DidInitializeFileSystemContext(
    const GURL& app_origin,
    storage::FileSystemContext* file_system_context,
    const SyncStatusCallback& callback,
    SyncStatusCode status) {
  if (status != SYNC_STATUS_OK) {
    callback.Run(status);
    return;
  }
  DCHECK(file_system_context);
  origin_to_contexts_[app_origin] = file_system_context;

  if (pending_origins_with_changes_.find(app_origin) !=
      pending_origins_with_changes_.end()) {
    // We have remaining changes for the origin.
    pending_origins_with_changes_.erase(app_origin);
    SyncFileSystemBackend* backend =
        SyncFileSystemBackend::GetBackend(file_system_context);
    DCHECK(backend);
    DCHECK(backend->change_tracker());
    origin_change_map_.SetOriginChangeCount(
        app_origin, backend->change_tracker()->num_changes());
    int64_t num_changes = origin_change_map_.GetTotalChangeCount();
    FOR_EACH_OBSERVER(Observer, change_observers_,
                      OnLocalChangeAvailable(num_changes));
  }
  callback.Run(status);
}

void LocalFileSyncService::DidInitializeForRemoteSync(
    const FileSystemURL& url,
    storage::FileSystemContext* file_system_context,
    const PrepareChangeCallback& callback,
    SyncStatusCode status) {
  if (status != SYNC_STATUS_OK) {
    DVLOG(1) << "FileSystemContext initialization failed for remote sync:"
             << url.DebugString() << " status=" << status
             << " (" << SyncStatusCodeToString(status) << ")";
    callback.Run(status, SyncFileMetadata(), FileChangeList());
    return;
  }
  origin_to_contexts_[url.origin()] = file_system_context;
  PrepareForProcessRemoteChange(url, callback);
}

void LocalFileSyncService::DidApplyRemoteChange(
    const SyncStatusCallback& callback,
    SyncStatusCode status) {
  util::Log(logging::LOG_VERBOSE, FROM_HERE,
            "[Remote -> Local] ApplyRemoteChange finished --> %s",
            SyncStatusCodeToString(status));
  callback.Run(status);
}

void LocalFileSyncService::DidGetFileForLocalSync(
    const SyncFileCallback& callback,
    SyncStatusCode status,
    const LocalFileSyncInfo& sync_file_info,
    storage::ScopedFile snapshot) {
  if (status != SYNC_STATUS_OK) {
    callback.Run(status, sync_file_info.url);
    return;
  }
  if (sync_file_info.changes.empty()) {
    // There's a slight chance this could happen.
    ProcessLocalChange(callback);
    return;
  }

  FileChange next_change = sync_file_info.changes.front();
  DVLOG(1) << "ProcessLocalChange: " << sync_file_info.url.DebugString()
           << " change:" << next_change.DebugString();

  GetLocalChangeProcessor(sync_file_info.url)->ApplyLocalChange(
      next_change,
      sync_file_info.local_file_path,
      sync_file_info.metadata,
      sync_file_info.url,
      base::Bind(&LocalFileSyncService::ProcessNextChangeForURL,
                 AsWeakPtr(), callback,
                 base::Passed(&snapshot), sync_file_info,
                 next_change, sync_file_info.changes.PopAndGetNewList()));
}

void LocalFileSyncService::ProcessNextChangeForURL(
    const SyncFileCallback& callback,
    storage::ScopedFile snapshot,
    const LocalFileSyncInfo& sync_file_info,
    const FileChange& processed_change,
    const FileChangeList& changes,
    SyncStatusCode status) {
  DVLOG(1) << "Processed one local change: "
           << sync_file_info.url.DebugString()
           << " change:" << processed_change.DebugString()
           << " status:" << status;

  if (status == SYNC_STATUS_RETRY) {
    GetLocalChangeProcessor(sync_file_info.url)->ApplyLocalChange(
        processed_change,
        sync_file_info.local_file_path,
        sync_file_info.metadata,
        sync_file_info.url,
        base::Bind(&LocalFileSyncService::ProcessNextChangeForURL,
                   AsWeakPtr(), callback, base::Passed(&snapshot),
                   sync_file_info, processed_change, changes));
    return;
  }

  if (status == SYNC_FILE_ERROR_NOT_FOUND &&
      processed_change.change() == FileChange::FILE_CHANGE_DELETE) {
    // This must be ok (and could happen).
    status = SYNC_STATUS_OK;
  }

  const FileSystemURL& url = sync_file_info.url;
  if (status != SYNC_STATUS_OK || changes.empty()) {
    DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
    sync_context_->FinalizeSnapshotSync(
        origin_to_contexts_[url.origin()], url, status,
        base::Bind(callback, status, url));
    return;
  }

  FileChange next_change = changes.front();
  GetLocalChangeProcessor(url)->ApplyLocalChange(
      changes.front(),
      sync_file_info.local_file_path,
      sync_file_info.metadata,
      url,
      base::Bind(&LocalFileSyncService::ProcessNextChangeForURL,
                 AsWeakPtr(), callback,
                 base::Passed(&snapshot), sync_file_info,
                 next_change, changes.PopAndGetNewList()));
}

LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor(
    const FileSystemURL& url) {
  if (!get_local_change_processor_.is_null())
    return get_local_change_processor_.Run(url.origin());
  DCHECK(local_change_processor_);
  return local_change_processor_;
}

}  // namespace sync_file_system


text:
package com.sun.corba.se.PortableActivationIDL;

/**
* com/sun/corba/se/PortableActivationIDL/ServerProxy.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u72/5732/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
* Tuesday, December 22, 2015 7:17:37 PM PST
*/

/** Server callback interface, passed to Activator in registerServer method.
    */
public interface ServerProxy extends ServerProxyOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
{
} // interface ServerProxy


text:
/* -*- c++ -*- */
#ifndef JAWS_HTTP_10_H
#define JAWS_HTTP_10_H

#include "ace/RB_Tree.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "JAWS/Pipeline_Tasks.h"

// Forward declaration
class JAWS_HTTP_10_Request;

// Reading the initial request

class JAWS_HTTP_10_Read_Task : public JAWS_Pipeline_Handler
{
public:
  JAWS_HTTP_10_Read_Task (void);
  virtual ~JAWS_HTTP_10_Read_Task (void);

  virtual int handle_put (JAWS_Data_Block *data, ACE_Time_Value *tv);

private:
};

// Parsing the request

class JAWS_HTTP_10_Parse_Task : public JAWS_Pipeline_Handler
{
public:
  JAWS_HTTP_10_Parse_Task (void);
  virtual ~JAWS_HTTP_10_Parse_Task (void);

  virtual int handle_put (JAWS_Data_Block *data, ACE_Time_Value *tv);

};

// Write the response

class JAWS_HTTP_10_Write_Task : public JAWS_Pipeline_Handler
{
public:
  JAWS_HTTP_10_Write_Task (void);
  virtual ~JAWS_HTTP_10_Write_Task (void);

  virtual int handle_put (JAWS_Data_Block *data, ACE_Time_Value *tv);

private:
};

// Helpers

class JAWS_HTTP_10_Helper
// Static functions to enhance the lives of HTTP programmers everywhere.
{
public:

  static char *HTTP_decode_string (char *path);
  // Decode '%' escape codes in a URI

};

#endif /* !defined (JAWS_HTTP_10_H) */


text:
package com.tle.common.scripting;

/** @author Aaron */
public class ScriptException extends RuntimeException {
  private static final long serialVersionUID = 1L;

  public ScriptException(Exception wrapped) {
    super(wrapped);
  }
}


text:
namespace Microsoft.Azure.Management.Eventhub.Fluent
{
    using Microsoft.Azure.Management.EventHub.Fluent;
    using Microsoft.Azure.Management.EventHub.Fluent.Models;
    using Microsoft.Azure.Management.ResourceManager.Fluent.Core;
    using Microsoft.Azure.Management.Storage.Fluent;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Implementation for  EventHubs.
    /// </summary>
    ///GENTHASH:Y29tLm1pY3Jvc29mdC5henVyZS5tYW5hZ2VtZW50LmV2ZW50aHViLmltcGxlbWVudGF0aW9uLkV2ZW50SHVic0ltcGw=
    internal partial class EventHubsImpl  :
        Wrapper<IEventHubsOperations>,
        IEventHubs
    {
        private readonly IEventHubManager manager;
        private readonly IStorageManager storageManager;

        ///GENMHASH:033B3D5B0CB5B1CB48112216162F1E15:9FCC807E672DA3E71D7540953C306BD0
        public EventHubsImpl(IEventHubManager manager, IStorageManager storageManager) : base(manager.Inner.EventHubs)
        {
            this.manager = manager;
            this.storageManager = storageManager;
        }

        ///GENMHASH:B6961E0C7CB3A9659DE0E1489F44A936:168EFDB95EECDB98D4BDFCCA32101AC1
        public IEventHubManager Manager
        {
            get
            {
                return this.manager;
            }
        }

        ///GENMHASH:8ACFB0E23F5F24AD384313679B65F404:CAEAA7B656CCE3621F20FB55E8F156B8
        public EventHubImpl Define(string name)
        {
            return new EventHubImpl(name, this.Manager, this.storageManager);
        }

        ///GENMHASH:8911278EAF12BC5F0E2B7B33F06FAE96:A3AF1EADE39C250534E5C9F3E1000D42
        public IEventHubAuthorizationRules AuthorizationRules()
        {
            return this.Manager.EventHubAuthorizationRules;
        }

        ///GENMHASH:BA5C78D019449627922BF148AC1D7EC1:0BE8F883611ED1ADDB1EF29853C5B32E
        public IEventHubConsumerGroups ConsumerGroups()
        {
            return this.Manager.ConsumerGroups;
        }

        ///GENMHASH:5002116800CBAC02BBC1B4BF62BC4942:37DAFCA0F979EB14168635F75681B9E4
        public IEventHub GetById(string id)
        {
            return Extensions.Synchronize(() => GetByIdAsync(id));
        }

        ///GENMHASH:E776888E46F8A3FC56D24DF4A74E5B74:279A0BE8EAAA54434723FD778381D28C
        public async Task<Microsoft.Azure.Management.Eventhub.Fluent.IEventHub> GetByIdAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
        {
            ResourceId resourceId = ResourceId.FromString(id ?? throw new ArgumentNullException("id"));
            return await GetByNameAsync(resourceId.ResourceGroupName,
                resourceId.Parent.Name,
                resourceId.Name,
                cancellationToken);
        }

        ///GENMHASH:6F4AD1869ECF2F037CD0AF38FA93C9B0:0A31950E036F62CFC3C4166A8686573F
        public async Task<Microsoft.Azure.Management.Eventhub.Fluent.IEventHub> GetByNameAsync(string resourceGroupName, string namespaceName, string name, CancellationToken cancellationToken = default(CancellationToken))
        {
            var inner = await this.Inner.GetAsync(resourceGroupName,
                namespaceName,
                name,
                cancellationToken);
            if (inner == null)
            {
                return null;
            }
            else
            {
                return WrapModel(inner);
            }
        }

        ///GENMHASH:AD2574D8A0B41B7543E661226E7079CC:3EAC4D0C83CAC924621C946950DC6EB1
        public IEventHub GetByName(string resourceGroupName, string namespaceName, string name)
        {
            return Extensions.Synchronize(() => GetByNameAsync(resourceGroupName, namespaceName, name));
        }

        ///GENMHASH:CFA8F482B43AF8D63CC08E2DEC651ED3:8B61E578211E798393BC11B4706B4C15
        public void DeleteById(string id)
        {
            Extensions.Synchronize(() => DeleteByIdAsync(id));
        }

        ///GENMHASH:4D33A73A344E127F784620E76B686786:9723D6330EE11E0764C52AE608F5F48E
        public async Task DeleteByIdAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
        {
            ResourceId resourceId = ResourceId.FromString(id ?? throw new ArgumentNullException("id"));
            await DeleteByNameAsync(resourceId.ResourceGroupName,
                resourceId.Parent.Name,
                resourceId.Name,
                cancellationToken);
        }

        ///GENMHASH:666C0465A5F64EEA835CC2DA55F94875:066987FB34F379BFE8B7DD7842362947
        public void DeleteByName(string resourceGroupName, string namespaceName, string name)
        {
            Extensions.Synchronize(() => DeleteByNameAsync(resourceGroupName, namespaceName, name));
        }

        ///GENMHASH:76D3089A9A4A15E17E55ADC8A99BA937:A7ED93C8E89A6166255AB510D73F3A59
        public async Task DeleteByNameAsync(string resourceGroupName, string namespaceName, string name, CancellationToken cancellationToken = default(CancellationToken))
        {
            await this.Inner.DeleteAsync(resourceGroupName,
                namespaceName,
                name,
                cancellationToken);
        }

        ///GENMHASH:6EDC0210EC32BAF3169D04C5071B3BA4:C0F3C750FC7EB704999286CDE900CACE
        public async Task<IPagedCollection<Microsoft.Azure.Management.Eventhub.Fluent.IEventHub>> ListByNamespaceAsync(string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken))
        {
            return await PagedCollection<IEventHub, EventhubInner>.LoadPage(cancel => this.Inner.ListByNamespaceAsync(resourceGroupName, namespaceName, cancel),
              (nextLink, cancel) => this.Inner.ListByNamespaceNextAsync(nextLink),
              WrapModel,
              true,
              cancellationToken);
        }

        ///GENMHASH:BC72564BF6A743AB48443EB9A1982EC5:4EAEA7F11457F47611F9F0234F239A8C
        public IEnumerable<Microsoft.Azure.Management.Eventhub.Fluent.IEventHub> ListByNamespace(string resourceGroupName, string namespaceName)
        {
            return Extensions.Synchronize(() => this.Inner.ListByNamespaceAsync(resourceGroupName, namespaceName))
                .AsContinuousCollection(nextLink => Extensions.Synchronize(() => this.Inner.ListByNamespaceNextAsync(nextLink)))
                .Select(inner => WrapModel(inner));
        }

        ///GENMHASH:B7540FDAF52A09CAAD2AE0F1AEB9D55C:43F9E1DF562D60097594D20716D4D4AF
        private EventHubImpl WrapModel(EventhubInner innerModel)
        {
            return new EventHubImpl(innerModel.Name, innerModel, this.manager, this.storageManager);
        }
    }
}


text:
module CLI

using JSON

using ..Simulators

function run_funcs(module_names, run_names, repeat)
    benchmark = []
    for i = 1:repeat, m = module_names, r = run_names
        run = Simulators.prepare(m, r)
        _, elapsed, bytes, gctime, gcdiff = @timed run()
        push!(benchmark, Dict(
            :try => i - 1,
            :module => m,
            :run => r,
            :elapsed => elapsed,
            :bytes => bytes,
            :gctime => gctime,
            :gcdiff => gcdiff,
        ))
    end
    benchmark
end

function cli_run(module_names, run_names, repeat)
    benchmark = run_funcs(module_names, run_names, repeat)
    JSON.print(Dict(:benchmark => benchmark, :lang => "julia"))
    println()
end

function main(args=ARGS)
    if args[1] == "run"
        repeat = 5
        cli_run(split(args[2], ','),
                split(args[3], ','),
                repeat)
    end
end

end


text:
#if NET_3_5
#region License

#endregion

using System;
using System.Text;
using System.Globalization;
using System.ServiceModel.Syndication;

using NUnit.Framework;

namespace Spring.Http.Converters.Feed
{
    /// <summary>
    /// Unit tests for the Rss20FeedHttpMessageConverter class.
    /// </summary>
    /// <author>Bruno Baia</author>
    [TestFixture]
    public class Rss20FeedHttpMessageConverterTests
    {
        private Rss20FeedHttpMessageConverter converter;

	    [SetUp]
	    public void SetUp()
        {
            converter = new Rss20FeedHttpMessageConverter();
	    }

        [Test]
        public void CanRead()
        {
            Assert.IsTrue(converter.CanRead(typeof(SyndicationFeed), new MediaType("application", "rss+xml")));
            Assert.IsTrue(converter.CanRead(typeof(SyndicationItem), new MediaType("application", "rss+xml")));
            Assert.IsFalse(converter.CanRead(typeof(string), new MediaType("application", "rss+xml")));
            Assert.IsFalse(converter.CanRead(typeof(SyndicationFeed), new MediaType("text", "plain")));
        }

        [Test]
        public void CanWrite()
        {
            Assert.IsTrue(converter.CanWrite(typeof(SyndicationFeed), new MediaType("application", "rss+xml")));
            Assert.IsTrue(converter.CanWrite(typeof(SyndicationItem), new MediaType("application", "rss+xml")));
            Assert.IsFalse(converter.CanWrite(typeof(string), new MediaType("application", "rss+xml")));
            Assert.IsFalse(converter.CanWrite(typeof(SyndicationFeed), new MediaType("text", "plain")));
        }

        [Test]
        public void Read()
        {
            DateTimeOffset offset = DateTimeOffset.UtcNow;

            string body = String.Format("<rss xmlns:a10=\"http://www.w3.org/2005/Atom\" version=\"2.0\"><channel><title>Test Feed</title><link>http://www.springframework.net/Feed</link><description>This is a test feed</description><copyright>Copyright 2010</copyright><managingEditor>bruno.baia@springframework.net</managingEditor><lastBuildDate>{0}</lastBuildDate><a10:id>Atom10FeedHttpMessageConverterTests.Write</a10:id></channel></rss>",
                offset.ToString("ddd, dd MMM yyyy HH:mm:ss Z", CultureInfo.InvariantCulture));

            MockHttpInputMessage message = new MockHttpInputMessage(body, Encoding.UTF8);

            SyndicationFeed result = converter.Read<SyndicationFeed>(message);
            Assert.IsNotNull(result, "Invalid result");
            Assert.AreEqual("Atom10FeedHttpMessageConverterTests.Write", result.Id, "Invalid result");
            Assert.AreEqual("Test Feed", result.Title.Text, "Invalid result");
            Assert.AreEqual("This is a test feed", result.Description.Text, "Invalid result");
            Assert.IsTrue(result.Links.Count == 1, "Invalid result");
            Assert.AreEqual(new Uri("http://www.springframework.net/Feed"), result.Links[0].Uri, "Invalid result");
            Assert.AreEqual("Copyright 2010", result.Copyright.Text, "Invalid result");
            Assert.IsTrue(result.Authors.Count == 1, "Invalid result");
            Assert.AreEqual("bruno.baia@springframework.net", result.Authors[0].Email, "Invalid result");
        }

        [Test]
        public void Write()
        {
            DateTimeOffset offset = DateTimeOffset.UtcNow;

            string expectedBody = String.Format("<rss xmlns:a10=\"http://www.w3.org/2005/Atom\" version=\"2.0\"><channel><title>Test Feed</title><link>http://www.springframework.net/Feed</link><description>This is a test feed</description><copyright>Copyright 2010</copyright><managingEditor>bruno.baia@springframework.net</managingEditor><lastBuildDate>{0}</lastBuildDate><a10:id>Atom10FeedHttpMessageConverterTests.Write</a10:id></channel></rss>",
                offset.ToString("ddd, dd MMM yyyy HH:mm:ss Z", CultureInfo.InvariantCulture));

            SyndicationFeed body = new SyndicationFeed("Test Feed", "This is a test feed", new Uri("http://www.springframework.net/Feed"), "Atom10FeedHttpMessageConverterTests.Write", offset);
            SyndicationPerson sp = new SyndicationPerson("bruno.baia@springframework.net", "Bruno Baïa", "http://www.springframework.net/bbaia");
            body.Authors.Add(sp);
            body.Copyright = new TextSyndicationContent("Copyright 2010");

            MockHttpOutputMessage message = new MockHttpOutputMessage();

            converter.Write(body, null, message);

            Assert.AreEqual(expectedBody, message.GetBodyAsString(Encoding.UTF8), "Invalid result");
            Assert.AreEqual(new MediaType("application", "rss+xml"), message.Headers.ContentType, "Invalid content-type");
            //Assert.IsTrue(message.Headers.ContentLength > -1, "Invalid content-length");
        }
    }
}
#endif


text:
module OptionsManager
  def require_options(options, required_params)
    missing_args = []
    required_params.each do |param|
      missing_args << param.to_s if  options[param].nil?
    end
    raise ArgumentError, "Missing required argument: #{missing_args.join(',')}" unless missing_args.empty?
  end

  def validate_option_in_list(option, list)
    raise ArgumentError, "Option: #{option} should be one of #{list.inspect}" unless list.include?(option)
  end

end


text:
CREATE PROCEDURE [dbo].[h3giGetActiveDeviceReferentialsForAccessory]
(
	@accessoryId VARCHAR(20)
)
AS
BEGIN
	SET NOCOUNT ON
	SELECT deviceId FROM h3giDeviceAccessoryReferentials WHERE accessoryId = @accessoryId
END

GRANT EXECUTE ON h3giGetActiveDeviceReferentialsForAccessory TO b4nuser
GO


text:
package com.google.security.zynamics.binnavi.API.debug;

import java.math.BigInteger;

import com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValue;

// / Single register value of a thread.
/**
 * Represents a single register of a thread of the target process.
 */
public final class Register {
  /**
   * The wrapped internal register object.
   */
  private final RegisterValue m_register;

  // / @cond INTERNAL
  /**
   * Creates a new API register object.
   *
   * @param register The wrapped internal register object.
   */
  // / @endcond
  public Register(final RegisterValue register) {
    m_register = register;
  }

  // ! Name of the register.
  /**
   * Returns the name of the register.
   *
   * @return The name of the register.
   */
  public String getName() {
    return m_register.getName();
  }

  // ! Value of the register.
  /**
   * Returns the value of the register.
   *
   * @return The value of the register.
   */
  public BigInteger getValue() {
    return m_register.getValue();
  }

  // ! Checks if the register is the PC register.
  /**
   * Tells whether the register is the program counter / instruction pointer register of the target
   * thread.
   *
   * @return True, if the register is the program counter. False, otherwise.
   */
  public boolean isProgramCounter() {
    return m_register.isPc();
  }

  // ! Checks if the register is the stack pointer register.
  /**
   * Tells whether the register is the stack pointer register of the target thread.
   *
   * @return True, if the register is the stack pointer. False, otherwise.
   */
  public boolean isStackPointer() {
    return m_register.isSp();
  }

  // ! Printable representation of the register.
  /**
   * Returns a string representation of the register.
   *
   * @return A string representation of the register.
   */
  @Override
  public String toString() {
    return String.format("%s - %08X", getName(), getValue());
  }
}


text:
namespace Yupi.Model.Domain
{
    using System;

    public class BanzaiTeleporterBaseItem : FloorBaseItem
    {
    }
}


text:
import traverse from './traverse.js';

export default dsl;

Object.assign(dsl, {
	// TODO: this is crazy, but I'm doing this for the time being because I
	//       don't want to think about boring html escaping.
	html: dsl,

	traverse

});

function dsl(strings, ...values) {
	return values.map((value, i) => {
			if ('function' === typeof value) {
				value = value();
			}
			return strings[i] + value;
		}).join("");
}


text:
package com.thoughtworks.go.agent.common;

import org.junit.Test;

import java.io.File;
import java.net.URL;
import java.util.Properties;

import static org.junit.Assert.assertEquals;

public class AgentBootstrapperArgsTest {

    @Test
    public void shouldSerializeToPropertiesWhenCertFileIsSet() throws Exception {
        AgentBootstrapperArgs original = new AgentBootstrapperArgs(new URL("https://go.example.com:8154/go"), new File("/path/to/certfile"), AgentBootstrapperArgs.SslMode.NONE);
        Properties properties = original.toProperties();

        AgentBootstrapperArgs reHydrated = AgentBootstrapperArgs.fromProperties(properties);

        assertEquals(original, reHydrated);
    }

    @Test
    public void shouldSerializeToPropertiesWhenInsecureIsSet() throws Exception {
        AgentBootstrapperArgs original = new AgentBootstrapperArgs(new URL("https://go.example.com:8154/go"), null, AgentBootstrapperArgs.SslMode.NONE);
        Properties properties = original.toProperties();

        AgentBootstrapperArgs reHydrated = AgentBootstrapperArgs.fromProperties(properties);

        assertEquals(original, reHydrated);
    }

}


text:
struct empty
{
   friend bool operator == (const empty &, const empty &){ return true; }
   friend bool operator <  (const empty &, const empty &){ return true; }
};

template class ::boost::container::deque<empty>;

int main()
{
   ::boost::container::deque<empty> dummy;
   (void)dummy;
   return 0;
}


text:
class ListGoodsController < ApplicationController
  before_action :set_list_good, only: [:show, :edit, :update, :destroy]

  # GET /list_goods
  # GET /list_goods.json
  def index
    @list_goods = ListGood.all
  end

  # GET /list_goods/1
  # GET /list_goods/1.json
  def show
  end

  # GET /list_goods/new
  def new
    @list_good = ListGood.new
  end

  # GET /list_goods/1/edit
  def edit
  end

  # POST /list_goods
  # POST /list_goods.json
  def create
    @list_good = ListGood.new(list_good_params)

    respond_to do |format|
      if @list_good.save
        format.html { redirect_to @list_good, notice: 'List good was successfully created.' }
        format.json { render :show, status: :created, location: @list_good }
      else
        format.html { render :new }
        format.json { render json: @list_good.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /list_goods/1
  # PATCH/PUT /list_goods/1.json
  def update
    respond_to do |format|
      if @list_good.update(list_good_params)
        format.html { redirect_to @list_good, notice: 'List good was successfully updated.' }
        format.json { render :show, status: :ok, location: @list_good }
      else
        format.html { render :edit }
        format.json { render json: @list_good.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /list_goods/1
  # DELETE /list_goods/1.json
  def destroy
    @list_good.destroy
    respond_to do |format|
      format.html { redirect_to list_goods_url, notice: 'List good was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_list_good
      @list_good = ListGood.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def list_good_params
      params.require(:list_good).permit(:WANT_ID, :USER_ID, :NAME, :COUNT)
    end
end