/***************************************************************************
 *   Copyright (C) 2016 by Nicolas Carion                                  *
 *   This file is part of Kdenlive. See www.kdenlive.org.                  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) version 3 or any later version accepted by the       *
 *   membership of KDE e.V. (or its successor approved  by the membership  *
 *   of KDE e.V.), which shall act as a proxy defined in Section 14 of     *
 *   version 3 of the license.                                             *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 ***************************************************************************/

#include "boolparamwidget.hpp"
#include "assets/model/assetparametermodel.hpp"

BoolParamWidget::BoolParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent)
    : AbstractParamWidget(std::move(model), index, parent)
{
    setupUi(this);
    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    // setup the comment
    QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
    setToolTip(comment);
    m_labelComment->setText(comment);
    m_widgetComment->setHidden(true);

    // setup the name
    m_labelName->setText(m_model->data(m_index, Qt::DisplayRole).toString());
    setMinimumHeight(m_labelName->sizeHint().height());

    // set check state
    slotRefresh();

    // emit the signal of the base class when appropriate
    connect(this->m_checkBox, &QCheckBox::stateChanged, this, [this](int state) {
        emit valueChanged(m_index, QString::number(state), true); });
}

void BoolParamWidget::slotShowComment(bool show)
{
    if (!m_labelComment->text().isEmpty()) {
        m_widgetComment->setVisible(show);
    }
}

void BoolParamWidget::slotRefresh()
{
    QSignalBlocker bk(m_checkBox);
    bool checked = m_model->data(m_index, AssetParameterModel::ValueRole).toInt();
    m_checkBox->setChecked(checked);
}

bool BoolParamWidget::getValue()
{
    return m_checkBox->isChecked();
}

{'repo_name': 'KDE/kdenlive', 'stars': '753', 'repo_language': 'C++', 'file_name': 'sampleplugin.cpp', 'mime_type': 'text/x-c', 'hash': 6485015819061031179, 'source_dataset': 'data'}


[comment]: # (@label Começando com o PO Sync)
[comment]: # (@link guides/sync-get-started)

Esse guia servirá para criar e configurar uma aplicação em [Ionic 5](https://beta.ionicframework.com/docs/) com o uso do PO Sync.

Para maiores detalhes sobre os serviços e métodos utilizados neste tutorial, consulte a documentação de
[Fundamentos do PO Sync](/guides/sync-fundamentals) e a documentação de referência de [API do PO Sync](/documentation/po-sync).

### Pré-requisitos

- [Node.js e NPM](https://nodejs.org/en/)
- [Angular CLI](https://cli.angular.io/) (^10.0.2):
  - ```shell
    npm install -g @angular/cli@~10.0.2
    ```
- [Ionic](https://ionicframework.com/docs/cli/) (5.4.16):
  - ```shell
    npm install -g ionic@5.4.16
    ```
- [Cordova](https://cordova.apache.org/docs/en/latest/) (9.0.0):
  - ```shell
    npm i -g cordova
    ```

> É importante ter conhecimento prévio em Angular e Ionic para seguir esta documentação e obter melhor entendimento do PO Sync.

### Passo 1 - Criando o aplicativo

Para a aplicação de exemplo usaremos o template *blank* do Ionic. Para isso, execute o seguinte comando:

```shell
ionic start po-sync-getting-started blank --skip-deps
```

> `--skip-deps`: pula a instalação das dependências do `package.json`.

Caso surja a questão relacionada ao framework desejado, opte por `Angular`.

### Passo 2 - Instalando as dependências

É necessário realizar alguns ajustes de compatibilidade do PO para o projeto criado.

Navegue até a pasta do aplicativo:
```shell
cd po-sync-getting-started
```

Antes de executar a instalação, é necessário que todas as dependências do projeto estejam declaradas de acordo com a versão do PO no arquivo `package.json`, localizado na raiz da aplicação:

```typescript
  ...
  "dependencies": {
    "@angular/common": "~10.0.0",
    "@angular/core": "~10.0.0",
    "@angular/forms": "~10.0.0",
    "@angular/platform-browser": "~10.0.0",
    "@angular/platform-browser-dynamic": "~10.0.0",
    "@angular/router": "~10.0.0",
    "@ionic-native/core": "5.23.0",
    "@ionic-native/splash-screen": "5.23.0",
    "@ionic-native/status-bar": "5.23.0",
    "@ionic/angular": "5.3.3",
    "rxjs": "~6.5.5",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.3"
    ...
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1000.0",
    "@angular/cli": "~10.0.5",
    "@angular/compiler": "~10.0.0",
    "@angular/compiler-cli": "~10.0.0",
    "@angular/language-service": "~10.0.0",
    "typescript": "~3.9.6"
  },
  ...
```

> Após configurar seu arquivo, certifique-se de salvar as alterações realizadas.

Execute o seguinte comando para instalar as dependências:

```shell
npm install
```

### Passo 3 - Instalando o po-sync

Para instalar o `po-sync` no aplicativo execute o seguinte comando:

```shell
ng add @po-ui/ng-sync
```

Após a instalação do `po-sync`, é necessário instalar o plugin
[cordova-plugin-network-information](https://github.com/apache/cordova-plugin-network-information) utilizado pelo [@ionic-native/network](https://ionicframework.com/docs/native/network/), para que a
aplicação realize as sincronizações com sucesso.

Para realizar essa instalação, execute o seguinte comando:

```shell
ionic cordova plugin add cordova-plugin-network-information
```

### Passo 4 - Utilizando o po-sync

#### Passo 4.1 - Importando o `po-sync` e o `po-storage`
No arquivo `src/app/app.module.ts`, adicione a importação dos módulos do `po-storage` e do `po-sync`:

> Caso você utilize o comando `ng add`, esse passo será feito automaticamente.

```typescript
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

/* Imports adicionados */
import { PoStorageModule } from '@po-ui/ng-storage';
import { PoSyncModule } from '@po-ui/ng-sync';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    PoStorageModule.forRoot(), // import do módulo Po Storage
    PoSyncModule, // import do módulo Po Sync
  ],
  providers: [
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
```

#### Passo 4.2 - Mapeando seu primeiro *schema*

O `po-sync` utiliza a definição de `schemas`, onde cada `schema` representa um modelo de dados armazenado no dispositivo.

Crie o arquivo `src/app/home/conference-schema.constants.ts` e adicione o conteúdo abaixo:

```typescript
import { PoSyncSchema } from '@po-ui/ng-sync';

export const conferenceSchema: PoSyncSchema = {
  getUrlApi: 'https://po-sample-api.herokuapp.com/conference/conference-api/api/v1/conferences',
  diffUrlApi: 'https://po-sample-api.herokuapp.com/conference/conference-api/api/v1/conferences/diff',
  deletedField: 'deleted',
  fields: [ 'id', 'title', 'location', 'description' ],
  idField: 'id',
  name: 'Conference',
  pageSize: 1
};
```

### Passo 5 - Configurando o método prepare

Após ter o seu primeiro *schema* criado, configure o seu aplicativo utilizando o `po-sync` através do método `PoSyncService.prepare()`.

#### Passo 5.1 - Alterando o `src/app/app.component.ts`

Substitua o conteúdo do arquivo pelo conteúdo abaixo:

```typescript
import { Component } from '@angular/core';

import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { PoSyncConfig, PoNetworkType, PoSyncService } from '@po-ui/ng-sync';

import { conferenceSchema } from './home/conference-schema.constants';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.scss']
})
export class AppComponent {
  constructor(
    private platform: Platform,
    private splashScreen: SplashScreen,
    private statusBar: StatusBar,
    private poSync: PoSyncService
  ) {
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.splashScreen.hide();

      this.initSync();

    });
  }

  initSync() {
    const config: PoSyncConfig = {
      type: PoNetworkType.ethernet
    };
    const schemas = [conferenceSchema];

    this.poSync.prepare(schemas, config).then(() => {
      this.poSync.sync();
    });
  }
}
```

Após utilizar o método `PoSyncService.prepare()`, a aplicação estará pronta para sincronizar os dados através do método `PoSyncService.sync()`.

### Passo 6 - Acessando os dados

Localize o arquivo `src/app/home/home.page.ts` e faça as seguintes alterações:

```typescript
import { Component } from '@angular/core';

import { PoSyncService } from '@po-ui/ng-sync';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {

  conference;

  constructor(private poSync: PoSyncService) {
    this.poSync.onSync().subscribe(() => this.loadHomePage());
  }

  async loadHomePage() {
    this.conference = await this.poSync.getModel('Conference').findOne().exec();
  }

  clear() {
    this.conference = null;
  }

}
```

No construtor, foi realizado uma inscrição no método `PoSyncService.onSync()`, para quando ocorrer uma sincronização, o método `loadHomePage()` busque um registro do *schema* "Conference".

### Passo 7 - Exibindo os dados em tela

No arquivo `src/app/home/home.page.html` crie a seguinte estrutura:
```html
<ion-content class="ion-padding">
  <ion-button expand="full" (click)="loadHomePage()">Buscar informações</ion-button>
  <ion-button expand="full" color="danger" (click)="clear()">Apagar informações</ion-button>

  <ion-card *ngIf="conference">
    <ion-card-content>
      <ion-card-title>
        {{ conference.title }}
      </ion-card-title>
      <p>{{ conference.description }}</p>
      <p>{{ conference.location }}</p>
    </ion-card-content>
  </ion-card>
</ion-content>
```

### Passo 8 - Executando o aplicativo

Execute o comando `ionic serve` e verifique o funcionamento do aplicativo Ionic com `po-sync`.

#### Passo 8.1 - Entendendo o funcionamento do `po-sync`

- O aplicativo sincroniza os dados que estão no servidor através do método `PoSyncService.sync()`;

- Durante esta sincronização é efetuada a busca dos registros utilizando a URL de GET, informada no `conference-schema.constants.ts`, e o retorno é salvo no dispositivo do cliente;

- Com os dados salvos no dispositivo, é possível desabilitar o acesso à internet do aplicativo e ainda continuar acessando os dados através do `po-sync`.

Demonstração do aplicativo acessando os dados *offline*:

![Getting Started App](./assets/graphics/po-sync/app-get-started.gif)

### Próximos passos

- Leia sobre os principais [fundamentos do PO Sync](./guides/sync-fundamentals).

- Saiba mais sobre a [API do PO Sync](./documentation/po-sync).

{'repo_name': 'po-ui/po-angular', 'stars': '392', 'repo_language': 'TypeScript', 'file_name': 'index.ts', 'mime_type': 'text/x-java', 'hash': 5713680888456803676, 'source_dataset': 'data'}


package org.kapott.hbci.sepa.jaxb.pain_008_003_02;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for GenericOrganisationIdentification1 complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="GenericOrganisationIdentification1">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Id" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.003.02}Max35Text"/>
 *         <element name="SchmeNm" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.003.02}OrganisationIdentificationSchemeName1Choice" minOccurs="0"/>
 *         <element name="Issr" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.003.02}Max35Text" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GenericOrganisationIdentification1", namespace = "urn:iso:std:iso:20022:tech:xsd:pain.008.003.02", propOrder = {
    "id",
    "schmeNm",
    "issr"
})
public class GenericOrganisationIdentification1 {

    @XmlElement(name = "Id", namespace = "urn:iso:std:iso:20022:tech:xsd:pain.008.003.02", required = true)
    protected String id;
    @XmlElement(name = "SchmeNm", namespace = "urn:iso:std:iso:20022:tech:xsd:pain.008.003.02")
    protected OrganisationIdentificationSchemeName1Choice schmeNm;
    @XmlElement(name = "Issr", namespace = "urn:iso:std:iso:20022:tech:xsd:pain.008.003.02")
    protected String issr;

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setId(String value) {
        this.id = value;
    }

    /**
     * Gets the value of the schmeNm property.
     *
     * @return
     *     possible object is
     *     {@link OrganisationIdentificationSchemeName1Choice }
     *
     */
    public OrganisationIdentificationSchemeName1Choice getSchmeNm() {
        return schmeNm;
    }

    /**
     * Sets the value of the schmeNm property.
     *
     * @param value
     *     allowed object is
     *     {@link OrganisationIdentificationSchemeName1Choice }
     *
     */
    public void setSchmeNm(OrganisationIdentificationSchemeName1Choice value) {
        this.schmeNm = value;
    }

    /**
     * Gets the value of the issr property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIssr() {
        return issr;
    }

    /**
     * Sets the value of the issr property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIssr(String value) {
        this.issr = value;
    }

}

{'repo_name': 'willuhn/hbci4java', 'stars': '119', 'repo_language': 'Java', 'file_name': 'org.springsource.ide.eclipse.gradle.refresh.prefs', 'mime_type': 'text/plain', 'hash': -8297181141101507214, 'source_dataset': 'data'}


<?php
namespace Anam\PhantomMagick;

use Exception;
use Anam\PhantomMagick\Str;

class Runner
{
    /**
     * Executable phantomjs binary path
     *
     * @var string
     */
    protected $binary = 'phantomjs';

    /**
     * Executable phantomjs binary path
     *
     * @var string
     */
    protected $alternateBinary;

    /**
     * Phantomjs command with arguments
     *
     * @var string
     */
    protected $command;

    /**
     * Constructor
     *
     * @param string $binary
     */
    public function __construct($binary = null)
    {
        if ($binary !== null) {
            $this->binary = $binary;
        }

        if (class_exists('\Anam\PhantomLinux\Path')) {
            $this->setAlternateBinary(\Anam\PhantomLinux\Path::binaryPath());
        }
    }

    /**
     * Set Alternate Binary
     *
     * @param string $binary
     *
     * @return void
     **/
    public function setAlternateBinary($binary)
    {
        $this->alternateBinary = $binary;
    }

    /**
     * Get Alternate binary
     *
     * @return string
     **/
    public function getAlternateBinary()
    {
       return $this->alternateBinary;
    }

    /**
     * Set shell command
     *
     * @param string $command
     *
     * @return void
     **/
    public function setCommand($command)
    {
        $this->command = $command;
    }

    /**
     * Get PhantomJS shell command
     *
     * @return string
     **/
    public function getCommand()
    {
       return $this->command;
    }

    /**
     * Run the phantomjs command
     * @param  string $script  Conversion script
     * @param  string $source  Data file location
     * @param  string $output  Output file location
     * @param  array  $options
     * @return string
     */
    public function run($script, $source, $output, array $options = array())
    {
        $binary = $this->pickBinary();

        $arguments = ['script' => $script, 'source' => $source, 'output' => $output] + $options;

        $arguments = $this->escapeShellArguments($arguments);

        $this->setCommand(escapeshellcmd("{$binary} --ssl-protocol=any --ignore-ssl-errors=yes ") . implode(' ', $arguments));

        return shell_exec($this->getCommand());
    }

    /**
     * Escape shell arguments
     *
     * @param  array  $arguments
     * @return array
     */
    private function escapeShellArguments(array $arguments)
    {
        foreach ($arguments as $key => $argument) {
            $arguments[$key] = escapeshellarg($argument);
        }

        return $arguments;
    }

    /**
     * Check phantomjs is installed or not
     *
     * @param  string $binary  Binary location
     * @return boolean
     */
    public function verifyBinary($binary)
    {
        $uname = strtolower(php_uname());

        if (Str::contains($uname, 'darwin')) {
            if (! shell_exec(escapeshellcmd("command -v {$binary} >/dev/null 2>&1"))) {
                return false;
            }
        } elseif (Str::contains($uname, 'win')) {
            if (! shell_exec(escapeshellcmd("{$binary}"))) {
                return false;
            }
        } elseif (Str::contains($uname, 'linux')) {
            if (! shell_exec(escapeshellcmd("which {$binary}"))) {
                return false;
            }
        } else {
            throw new \RuntimeException("Unknown operating system.");
        }

        return true;
    }

    /**
     * Choose binary
     *
     * @return string
     */
    public function pickBinary()
    {
        if ($this->binary != 'phantomjs') {
            if (! $this->verifyBinary($this->binary)) {
                throw new Exception('Binary does not exist');
            }

            return $this->binary;
        }

        if (! $this->verifyBinary($this->binary)) {

            if (! $this->verifyBinary($this->getAlternateBinary())) {
                throw new Exception('Binary does not exist');
            }

            $this->binary = $this->getAlternateBinary();
        }

        return $this->binary;
    }
}

{'repo_name': 'anam-hossain/phantommagick', 'stars': '145', 'repo_language': 'PHP', 'file_name': 'AdapterTest.php', 'mime_type': 'text/x-php', 'hash': 2763771767055105515, 'source_dataset': 'data'}


package configs

import (
	"github.com/hashicorp/hcl2/hcl"
)

// MergeBodies creates a new HCL body that contains a combination of the
// given base and override bodies. Attributes and blocks defined in the
// override body take precedence over those of the same name defined in
// the base body.
//
// If any block of a particular type appears in "override" then it will
// replace _all_ of the blocks of the same type in "base" in the new
// body.
func MergeBodies(base, override hcl.Body) hcl.Body {
	return mergeBody{
		Base:     base,
		Override: override,
	}
}

// mergeBody is a hcl.Body implementation that wraps a pair of other bodies
// and allows attributes and blocks within the override to take precedence
// over those defined in the base body.
//
// This is used to deal with dynamically-processed bodies in Module.mergeFile.
// It uses a shallow-only merging strategy where direct attributes defined
// in Override will override attributes of the same name in Base, while any
// blocks defined in Override will hide all blocks of the same type in Base.
//
// This cannot possibly "do the right thing" in all cases, because we don't
// have enough information about user intent. However, this behavior is intended
// to be reasonable for simple overriding use-cases.
type mergeBody struct {
	Base     hcl.Body
	Override hcl.Body
}

var _ hcl.Body = mergeBody{}

func (b mergeBody) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) {
	var diags hcl.Diagnostics
	baseSchema := schemaWithDynamic(schema)
	overrideSchema := schemaWithDynamic(schemaForOverrides(schema))

	baseContent, _, cDiags := b.Base.PartialContent(baseSchema)
	diags = append(diags, cDiags...)
	overrideContent, _, cDiags := b.Override.PartialContent(overrideSchema)
	diags = append(diags, cDiags...)

	content := b.prepareContent(baseContent, overrideContent)

	return content, diags
}

func (b mergeBody) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) {
	var diags hcl.Diagnostics
	baseSchema := schemaWithDynamic(schema)
	overrideSchema := schemaWithDynamic(schemaForOverrides(schema))

	baseContent, baseRemain, cDiags := b.Base.PartialContent(baseSchema)
	diags = append(diags, cDiags...)
	overrideContent, overrideRemain, cDiags := b.Override.PartialContent(overrideSchema)
	diags = append(diags, cDiags...)

	content := b.prepareContent(baseContent, overrideContent)

	remain := MergeBodies(baseRemain, overrideRemain)

	return content, remain, diags
}

func (b mergeBody) prepareContent(base *hcl.BodyContent, override *hcl.BodyContent) *hcl.BodyContent {
	content := &hcl.BodyContent{
		Attributes: make(hcl.Attributes),
	}

	// For attributes we just assign from each map in turn and let the override
	// map clobber any matching entries from base.
	for k, a := range base.Attributes {
		content.Attributes[k] = a
	}
	for k, a := range override.Attributes {
		content.Attributes[k] = a
	}

	// Things are a little more interesting for blocks because they arrive
	// as a flat list. Our merging semantics call for us to suppress blocks
	// from base if at least one block of the same type appears in override.
	// We explicitly do not try to correlate and deeply merge nested blocks,
	// since we don't have enough context here to infer user intent.

	overriddenBlockTypes := make(map[string]bool)
	for _, block := range override.Blocks {
		if block.Type == "dynamic" {
			overriddenBlockTypes[block.Labels[0]] = true
			continue
		}
		overriddenBlockTypes[block.Type] = true
	}
	for _, block := range base.Blocks {
		// We skip over dynamic blocks whose type label is an overridden type
		// but note that below we do still leave them as dynamic blocks in
		// the result because expanding the dynamic blocks that are left is
		// done much later during the core graph walks, where we can safely
		// evaluate the expressions.
		if block.Type == "dynamic" && overriddenBlockTypes[block.Labels[0]] {
			continue
		}
		if overriddenBlockTypes[block.Type] {
			continue
		}
		content.Blocks = append(content.Blocks, block)
	}
	for _, block := range override.Blocks {
		content.Blocks = append(content.Blocks, block)
	}

	return content
}

func (b mergeBody) JustAttributes() (hcl.Attributes, hcl.Diagnostics) {
	var diags hcl.Diagnostics
	ret := make(hcl.Attributes)

	baseAttrs, aDiags := b.Base.JustAttributes()
	diags = append(diags, aDiags...)
	overrideAttrs, aDiags := b.Override.JustAttributes()
	diags = append(diags, aDiags...)

	for k, a := range baseAttrs {
		ret[k] = a
	}
	for k, a := range overrideAttrs {
		ret[k] = a
	}

	return ret, diags
}

func (b mergeBody) MissingItemRange() hcl.Range {
	return b.Base.MissingItemRange()
}

{'repo_name': 'vancluever/terraform-provider-acme', 'stars': '213', 'repo_language': 'Go', 'file_name': 'dyn.html.markdown', 'mime_type': 'text/plain', 'hash': -5128640963829147562, 'source_dataset': 'data'}


var VENDOR_PREFIX_PATTERN = /$\-moz\-|\-ms\-|\-o\-|\-webkit\-/;

function prefixesIn(tokens) {
  var prefixes = [];

  for (var i = 0, l = tokens.length; i < l; i++) {
    var token = tokens[i];

    for (var j = 0, m = token.value.length; j < m; j++) {
      var match = VENDOR_PREFIX_PATTERN.exec(token.value[j][0]);

      if (match && prefixes.indexOf(match[0]) == -1)
        prefixes.push(match[0]);
    }
  }

  return prefixes;
}

function same(left, right) {
  return prefixesIn(left).sort().join(',') == prefixesIn(right).sort().join(',');
}

module.exports = {
  same: same
};

{'repo_name': 'Joao-Henrique/React_Express_App_Medium_Tutorial', 'stars': '138', 'repo_language': 'JavaScript', 'file_name': 'index.jade', 'mime_type': 'text/plain', 'hash': 4106837316687050964, 'source_dataset': 'data'}


using TextCellListCode.WinPhone.Resources;

namespace TextCellListCode.WinPhone
{
    /// <summary>
    /// Provides access to string resources.
    /// </summary>
    public class LocalizedStrings
    {
        private static AppResources _localizedResources = new AppResources();

        public AppResources LocalizedResources { get { return _localizedResources; } }
    }
}

{'repo_name': 'xamarin/xamarin-forms-book-preview-2', 'stars': '218', 'repo_language': 'C#', 'file_name': 'Default.rd.xml', 'mime_type': 'text/plain', 'hash': 8986711205325181835, 'source_dataset': 'data'}


# [Neo Random](http://alexa.amazon.com/#skills/amzn1.ask.skill.6a6c3eaa-503c-4b39-a0b4-d0440953f340)
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the Neo Random skill, try saying...

* *Alexa Open neo random*

* *Alexa Ask neo random to a number*

* *Alexa Ask neo random to give me a random number*

Neo Random let's you generate a random number from 0 to 100.
If you need a quickly number, just tell Alexa to use Neo Random to give you a random number and enjoy with it.

***

### Skill Details

* **Invocation Name:** neo random
* **Category:** null
* **ID:** amzn1.ask.skill.6a6c3eaa-503c-4b39-a0b4-d0440953f340
* **ASIN:** B01MCUSW7S
* **Author:** Javier Pita
* **Release Date:** October 21, 2016 @ 02:13:01
* **In-App Purchasing:** No

{'repo_name': 'dale3h/alexa-skills-list', 'stars': '201', 'repo_language': 'JavaScript', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': 9146224346406710453, 'source_dataset': 'data'}


// ======================================================================
//
//           Copyright (C) 2019-2020 湖南心莱信息科技有限公司
//           All rights reserved
//
//           filename : RefundOutput.cs
//           description :
//
//           created by 雪雁 at  2019-01-17 13:49
//           Mail: wenqiang.li@xin-lai.com
//           QQ群：85318032（技术交流）
//           Blog：http://www.cnblogs.com/codelove/
//           GitHub：https://github.com/xin-lai
//           Home：http://xin-lai.com
//
// ======================================================================

using System;
using System.Xml.Serialization;

namespace Magicodes.Pay.Wxpay.Pay.Dto
{
    /// <summary>
    ///     申请退款return_code为SUCCESS的时候有返回
    /// </summary>
    [XmlRoot("xml")]
    [Serializable]
    public class RefundOutput : PayOutputBase
    {
        /// <summary>
        ///     Gets or sets the Transaction_id
        ///     微信订单号	是	String(28)	4007752501201407033233368018	微信订单号
        /// </summary>
        [XmlElement("transaction_id")]
        public string TransactionId { get; set; }

        /// <summary>
        ///     Gets or sets the Out_trade_no
        ///     商户订单号	是	String(32)	33368018	商户系统内部的订单号
        /// </summary>
        [XmlElement("out_trade_no")]
        public string OutTradeNo { get; set; }

        /// <summary>
        ///     Gets or sets the Out_refund_no
        ///     商户退款单号	是	String(32)	121775250	商户退款单号
        /// </summary>
        [XmlElement("out_refund_no")]
        public string OutRefundNo { get; set; }

        /// <summary>
        ///     Gets or sets the Refund_id
        ///     微信退款单号	是	String(28)	2007752501201407033233368018	微信退款单号
        /// </summary>
        [XmlElement("refund_id")]
        public string RefundId { get; set; }

        /// <summary>
        ///     Gets or sets the Refund_channel
        ///     退款渠道	否	String(16)	ORIGINAL	ORIGINAL—原路退款 BALANCE—退回到余额
        /// </summary>
        [XmlElement("refund_channel")]
        public string RefundChannel { get; set; }

        /// <summary>
        ///     Gets or sets the Refund_fee
        ///     申请退款金额	是	Int	100	退款总金额,单位为分,可以做部分退款
        /// </summary>
        [XmlElement("refund_fee")]
        public int RefundFee { get; set; }

        /// <summary>
        ///     Gets or sets the Settlement_refund_fee
        ///     退款金额	否	Int	100	去掉非充值代金券退款金额后的退款金额，退款金额=申请退款金额-非充值代金券退款金额，退款金额<=申请退款金额
        /// </summary>
        [XmlElement("settlement_refund_fee")]
        public int SettlementRefundFee { get; set; }

        /// <summary>
        ///     Gets or sets the Total_fee
        ///     订单金额	是	Int	100	订单总金额，单位为分，只能为整数，详见支付金额
        /// </summary>
        [XmlElement("total_fee")]
        public int TotalFee { get; set; }

        /// <summary>
        ///     Gets or sets the Settlement_total_fee
        ///     应结订单金额	否	Int	100	去掉非充值代金券金额后的订单总金额，应结订单金额=订单金额-非充值代金券金额，应结订单金额<=订单金额。
        /// </summary>
        [XmlElement("settlement_total_fee")]
        public int SettlementTotalFee { get; set; }

        /// <summary>
        ///     Gets or sets the Fee_type
        ///     订单金额货币种类	否	String(8)	CNY	订单金额货币类型，符合ISO 4217标准的三位字母代码，默认人民币：CNY，其他值列表详见货币类型
        /// </summary>
        [XmlElement("fee_type")]
        public string FeeType { get; set; }

        /// <summary>
        ///     Gets or sets the Cash_fee
        ///     现金支付金额	是	Int	100	现金支付金额，单位为分，只能为整数，详见支付金额
        /// </summary>
        [XmlElement("cash_fee")]
        public int CashFee { get; set; }

        /// <summary>
        ///     Gets or sets the Cash_refund_fee
        ///     现金退款金额	否	Int	100	现金退款金额，单位为分，只能为整数，详见支付金额
        /// </summary>
        [XmlElement("cash_refund_fee")]
        public int CashRefundFee { get; set; }

        /// <summary>
        ///     Gets or sets the Coupon_type_0
        ///     代金券类型	否	String(8)	CASH	CASH--充值代金券 NO_CASH---非充值代金券 订单使用代金券时有返回（取值：CASH、NO_CASH）。$n为下标,从0开始编号，举例：coupon_type_0
        /// </summary>
        [XmlElement("coupon_type_0")]
        public string CouponType0 { get; set; }

        /// <summary>
        ///     Gets or sets the Coupon_refund_fee_0
        ///     代金券退款金额	否	Int	100	代金券退款金额小于等于退款金额，退款金额-代金券或立减优惠退款金额为现金，说明详见代金券或立减优惠
        /// </summary>
        [XmlElement("coupon_refund_fee_0")]
        public int CouponRefundFee0 { get; set; }

        /// <summary>
        ///     Gets or sets the Coupon_refund_count_0
        ///     退款代金券使用数量	否	Int	1	退款代金券使用数量 ,$n为下标,从0开始编号
        /// </summary>
        [XmlElement("coupon_refund_count_0")]
        public int CouponRefundCount0 { get; set; }

        /// <summary>
        ///     Gets or sets the Coupon_refund_batch_id_0_0
        ///     退款代金券批次ID	否	String(20)	100	退款代金券批次ID ,$n为下标，$m为下标，从0开始编号
        /// </summary>
        [XmlElement("coupon_refund_batch_id_0_0")]
        public string CouponRefundBatchId00 { get; set; }

        /// <summary>
        ///     Gets or sets the Coupon_refund_id_0_0
        ///     退款代金券ID	否	String(20)	10000 	退款代金券ID, $n为下标，$m为下标，从0开始编号
        /// </summary>
        [XmlElement("coupon_refund_id_0_0")]
        public string CouponRefundId00 { get; set; }

        /// <summary>
        ///     Gets or sets the Coupon_refund_fee_0_0
        ///     单个退款代金券支付金额	否	Int	100	单个退款代金券支付金额, $n为下标，$m为下标，从0开始编号
        /// </summary>
        [XmlElement("coupon_refund_fee_0_0")]
        public int CouponRefundFee00 { get; set; }

        /// <summary>
        /// Gets or sets the Sign
        /// 签名
        /// </summary>
        [XmlAttribute("sign")]
        public string Sign { get; set; }
    }
}

{'repo_name': 'xin-lai/Magicodes.Pay', 'stars': '198', 'repo_language': 'C#', 'file_name': 'AllinpayBuilder.cs', 'mime_type': 'text/plain', 'hash': -6605266109791592524, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: fc4fdfb02bfa2d236926e5430dfb8447
ModelImporter:
  serializedVersion: 25
  internalIDToNameTable: []
  externalObjects: {}
  materials:
    importMaterials: 0
    materialName: 0
    materialSearch: 1
    materialLocation: 1
  animations:
    legacyGenerateAnimations: 4
    bakeSimulation: 0
    resampleCurves: 1
    optimizeGameObjects: 0
    motionNodeName:
    rigImportErrors:
    rigImportWarnings:
    animationImportErrors:
    animationImportWarnings:
    animationRetargetingWarnings:
    animationDoRetargetingWarnings: 0
    importAnimatedCustomProperties: 0
    importConstraints: 0
    animationCompression: 1
    animationRotationError: 0.5
    animationPositionError: 0.5
    animationScaleError: 0.5
    animationWrapMode: 0
    extraExposedTransformPaths: []
    extraUserProperties: []
    clipAnimations: []
    isReadable: 0
  meshes:
    lODScreenPercentages: []
    globalScale: 1
    meshCompression: 0
    addColliders: 0
    useSRGBMaterialColor: 1
    importVisibility: 0
    importBlendShapes: 0
    importCameras: 0
    importLights: 0
    swapUVChannels: 0
    generateSecondaryUV: 0
    useFileUnits: 1
    keepQuads: 0
    weldVertices: 1
    preserveHierarchy: 0
    skinWeightsMode: 0
    maxBonesPerVertex: 4
    minBoneWeight: 0.001
    meshOptimizationFlags: -1
    indexFormat: 0
    secondaryUVAngleDistortion: 8
    secondaryUVAreaDistortion: 15.000001
    secondaryUVHardAngle: 88
    secondaryUVPackMargin: 4
    useFileScale: 1
  tangentSpace:
    normalSmoothAngle: 60
    normalImportMode: 0
    tangentImportMode: 3
    normalCalculationMode: 4
    legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
    blendShapeNormalImportMode: 1
    normalSmoothingSource: 0
  referencedClips: []
  importAnimation: 0
  copyAvatar: 0
  humanDescription:
    serializedVersion: 3
    human: []
    skeleton: []
    armTwist: 0.5
    foreArmTwist: 0.5
    upperLegTwist: 0.5
    legTwist: 0.5
    armStretch: 0.05
    legStretch: 0.05
    feetSpacing: 0
    globalScale: 1
    rootMotionBoneName:
    hasTranslationDoF: 0
    hasExtraRoot: 0
    skeletonHasParents: 1
  lastHumanDescriptionAvatarSource: {instanceID: 0}
  animationType: 0
  humanoidOversampling: 1
  additionalBone: 0
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'keijiro/Rsvfx', 'stars': '485', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': 3757079619605287779, 'source_dataset': 'data'}


// Copyright 2010-2014 RethinkDB, all rights reserved.
#ifndef CLUSTERING_ADMINISTRATION_JOBS_BACKEND_HPP_
#define CLUSTERING_ADMINISTRATION_JOBS_BACKEND_HPP_

#include <memory>
#include <string>
#include <vector>

#include "rdb_protocol/artificial_table/caching_cfeed_backend.hpp"
#include "clustering/administration/auth/user_context.hpp"
#include "clustering/administration/metadata.hpp"
#include "concurrency/watchable.hpp"

class server_config_client_t;

class jobs_artificial_table_backend_t :
    public timer_cfeed_artificial_table_backend_t
{
public:
    jobs_artificial_table_backend_t(
        rdb_context_t *rdb_context,
        lifetime_t<name_resolver_t const &> name_resolver,
        mailbox_manager_t *_mailbox_manager,
        std::shared_ptr<semilattice_readwrite_view_t<
            cluster_semilattice_metadata_t> > _semilattice_view,
        const clone_ptr_t<watchable_t<change_tracking_map_t<
            peer_id_t, cluster_directory_metadata_t> > > &_directory_view,
        server_config_client_t *_server_config_client,
        table_meta_client_t *_table_meta_client,
        admin_identifier_format_t _identifier_format);
    ~jobs_artificial_table_backend_t();

    std::string get_primary_key_name();

    bool read_all_rows_as_vector(
            auth::user_context_t const &user_context,
            signal_t *interruptor,
            std::vector<ql::datum_t> *rows_out,
            admin_err_t *error_out);

    bool read_row(
            auth::user_context_t const &user_context,
            ql::datum_t primary_key,
            signal_t *interruptor,
            ql::datum_t *row_out,
            admin_err_t *error_out);

    bool write_row(
            auth::user_context_t const &user_context,
            ql::datum_t primary_key,
            bool pkey_was_autogenerated,
            ql::datum_t *new_value_inout,
            signal_t *interruptor,
            admin_err_t *error_out);

private:
    void get_all_job_reports(
            auth::user_context_t const &user_context,
            signal_t *interruptor,
            std::map<uuid_u, ql::datum_t> *jobs_out);

    mailbox_manager_t *mailbox_manager;

    std::shared_ptr< semilattice_readwrite_view_t<
        cluster_semilattice_metadata_t> > semilattice_view;

    clone_ptr_t<watchable_t<change_tracking_map_t<peer_id_t,
        cluster_directory_metadata_t> > > directory_view;

    server_config_client_t *server_config_client;
    table_meta_client_t *table_meta_client;

    admin_identifier_format_t identifier_format;
};

#endif /* CLUSTERING_ADMINISTRATION_JOBS_BACKEND_HPP_ */

{'repo_name': 'rethinkdb/rethinkdb', 'stars': '23797', 'repo_language': 'C++', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 1056126470681759830, 'source_dataset': 'data'}


/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is C++ hashtable templates.
 *
 * The Initial Developer of the Original Code is
 * Benjamin Smedberg.
 * Portions created by the Initial Developer are Copyright (C) 2002
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef nsTHashtable_h__
#define nsTHashtable_h__

#include "nscore.h"
#include "pldhash.h"
#include "nsDebug.h"
#include NEW_H

// helper function for nsTHashtable::Clear()
NS_COM_GLUE PLDHashOperator
PL_DHashStubEnumRemove(PLDHashTable    *table,
                       PLDHashEntryHdr *entry,
                       PRUint32         ordinal,
                       void            *userArg);

/**
 * a base class for templated hashtables.
 *
 * Clients will rarely need to use this class directly. Check the derived
 * classes first, to see if they will meet your needs.
 *
 * @param EntryType  the templated entry-type class that is managed by the
 *   hashtable. EntryType must extend the following declaration,
 *   and must not declare any virtual functions or derive from classes
 *   with virtual functions.  Any vtable pointer would break the
 *   PLDHashTable code.
 *
   class EntryType : public PLDHashEntryHdr
 *   {
 *   public: or friend nsTHashtable<EntryType>;
 *     // KeyType is what we use when Get()ing or Put()ing this entry
 *     // this should either be a simple datatype (PRUint32, nsISupports*) or
 *     // a const reference (const nsAString&)
 *     typedef something KeyType;
 *     // KeyTypePointer is the pointer-version of KeyType, because pldhash.h
 *     // requires keys to cast to const void*
 *     typedef const something* KeyTypePointer;
 *
 *     EntryType(KeyTypePointer aKey);
 *
 *     // the copy constructor must be defined, even if AllowMemMove() == true
 *     // or you will cause link errors!
 *     EntryType(const EntryType& aEnt);
 *
 *     // the destructor must be defined... or you will cause link errors!
 *     ~EntryType();
 *
 *     // KeyEquals(): does this entry match this key?
 *     PRBool KeyEquals(KeyTypePointer aKey) const;
 *
 *     // KeyToPointer(): Convert KeyType to KeyTypePointer
 *     static KeyTypePointer KeyToPointer(KeyType aKey);
 *
 *     // HashKey(): calculate the hash number
 *     static PLDHashNumber HashKey(KeyTypePointer aKey);
 *
 *     // ALLOW_MEMMOVE can we move this class with memmove(), or do we have
 *     // to use the copy constructor?
 *     enum { ALLOW_MEMMOVE = PR_(TRUE or FALSE) };
 *   }

 *
 * @see nsInterfaceHashtable
 * @see nsDataHashtable
 * @see nsClassHashtable
 * @author "Benjamin Smedberg <bsmedberg@covad.net>"
 */

template<class EntryType>
class nsTHashtable
{
public:
  /**
   * A dummy constructor; you must call Init() before using this class.
   */
  nsTHashtable();

  /**
   * destructor, cleans up and deallocates
   */
  ~nsTHashtable();

  /**
   * Initialize the table.  This function must be called before any other
   * class operations.  This can fail due to OOM conditions.
   * @param initSize the initial number of buckets in the hashtable, default 16
   * @return PR_TRUE if the class was initialized properly.
   */
  PRBool Init(PRUint32 initSize = PL_DHASH_MIN_SIZE);

  /**
   * Check whether the table has been initialized. This can be useful for static hashtables.
   * @return the initialization state of the class.
   */
  PRBool IsInitialized() const { return !!mTable.entrySize; }

  /**
   * Return the generation number for the table. This increments whenever
   * the table data items are moved.
   */
  PRUint32 GetGeneration() const { return mTable.generation; }

  /**
   * KeyType is typedef'ed for ease of use.
   */
  typedef typename EntryType::KeyType KeyType;

  /**
   * KeyTypePointer is typedef'ed for ease of use.
   */
  typedef typename EntryType::KeyTypePointer KeyTypePointer;

  /**
   * Return the number of entries in the table.
   * @return    number of entries
   */
  PRUint32 Count() const { return mTable.entryCount; }

  /**
   * Get the entry associated with a key.
   * @param     aKey the key to retrieve
   * @return    pointer to the entry class, if the key exists; nsnull if the
   *            key doesn't exist
   */
  EntryType* GetEntry(KeyType aKey) const
  {
    NS_ASSERTION(mTable.entrySize, "nsTHashtable was not initialized properly.");

    EntryType* entry =
      reinterpret_cast<EntryType*>
                      (PL_DHashTableOperate(
                            const_cast<PLDHashTable*>(&mTable),
                            EntryType::KeyToPointer(aKey),
                            PL_DHASH_LOOKUP));
    return PL_DHASH_ENTRY_IS_BUSY(entry) ? entry : nsnull;
  }

  /**
   * Get the entry associated with a key, or create a new entry,
   * @param     aKey the key to retrieve
   * @return    pointer to the entry class retreived; nsnull only if memory
                can't be allocated
   */
  EntryType* PutEntry(KeyType aKey)
  {
    NS_ASSERTION(mTable.entrySize, "nsTHashtable was not initialized properly.");

    return static_cast<EntryType*>
                      (PL_DHashTableOperate(
                            &mTable,
                            EntryType::KeyToPointer(aKey),
                            PL_DHASH_ADD));
  }

  /**
   * Remove the entry associated with a key.
   * @param     aKey of the entry to remove
   */
  void RemoveEntry(KeyType aKey)
  {
    NS_ASSERTION(mTable.entrySize, "nsTHashtable was not initialized properly.");

    PL_DHashTableOperate(&mTable,
                         EntryType::KeyToPointer(aKey),
                         PL_DHASH_REMOVE);
  }

  /**
   * Remove the entry associated with a key, but don't resize the hashtable.
   * This is a low-level method, and is not recommended unless you know what
   * you're doing and you need the extra performance. This method can be used
   * during enumeration, while RemoveEntry() cannot.
   * @param aEntry   the entry-pointer to remove (obtained from GetEntry or
   *                 the enumerator
   */
  void RawRemoveEntry(EntryType* aEntry)
  {
    PL_DHashTableRawRemove(&mTable, aEntry);
  }

  /**
   * client must provide an Enumerator function for
   *   EnumerateEntries
   * @param     aEntry the entry being enumerated
   * @param     userArg passed unchanged from EnumerateEntries
   * @return    combination of flags
   *            @link PLDHashOperator::PL_DHASH_NEXT PL_DHASH_NEXT @endlink ,
   *            @link PLDHashOperator::PL_DHASH_STOP PL_DHASH_STOP @endlink ,
   *            @link PLDHashOperator::PL_DHASH_REMOVE PL_DHASH_REMOVE @endlink
   */
  typedef PLDHashOperator (* Enumerator)(EntryType* aEntry, void* userArg);

  /**
   * Enumerate all the entries of the function.
   * @param     enumFunc the Enumerator function to call
   * @param     userArg a pointer to pass to the
   *            Enumerator function
   * @return    the number of entries actually enumerated
   */
  PRUint32 EnumerateEntries(Enumerator enumFunc, void* userArg)
  {
    NS_ASSERTION(mTable.entrySize, "nsTHashtable was not initialized properly.");

    s_EnumArgs args = { enumFunc, userArg };
    return PL_DHashTableEnumerate(&mTable, s_EnumStub, &args);
  }

  /**
   * remove all entries, return hashtable to "pristine" state ;)
   */
  void Clear()
  {
    NS_ASSERTION(mTable.entrySize, "nsTHashtable was not initialized properly.");

    PL_DHashTableEnumerate(&mTable, PL_DHashStubEnumRemove, nsnull);
  }

protected:
  PLDHashTable mTable;

  static const void* s_GetKey(PLDHashTable    *table,
                              PLDHashEntryHdr *entry);

  static PLDHashNumber s_HashKey(PLDHashTable *table,
                                 const void   *key);

  static PRBool s_MatchEntry(PLDHashTable           *table,
                             const PLDHashEntryHdr  *entry,
                             const void             *key);

  static void s_CopyEntry(PLDHashTable          *table,
                          const PLDHashEntryHdr *from,
                          PLDHashEntryHdr       *to);

  static void s_ClearEntry(PLDHashTable *table,
                           PLDHashEntryHdr *entry);

  static PRBool s_InitEntry(PLDHashTable     *table,
                            PLDHashEntryHdr  *entry,
                            const void       *key);

  /**
   * passed internally during enumeration.  Allocated on the stack.
   *
   * @param userFunc the Enumerator function passed to
   *   EnumerateEntries by the client
   * @param userArg the userArg passed unaltered
   */
  struct s_EnumArgs
  {
    Enumerator userFunc;
    void* userArg;
  };

  static PLDHashOperator s_EnumStub(PLDHashTable    *table,
                                    PLDHashEntryHdr *entry,
                                    PRUint32         number,
                                    void            *arg);
private:
  // copy constructor, not implemented
  nsTHashtable(nsTHashtable<EntryType>& toCopy);

  // assignment operator, not implemented
  nsTHashtable<EntryType>& operator= (nsTHashtable<EntryType>& toEqual);
};

//
// template definitions
//

template<class EntryType>
nsTHashtable<EntryType>::nsTHashtable()
{
  // entrySize is our "I'm initialized" indicator
  mTable.entrySize = 0;
}

template<class EntryType>
nsTHashtable<EntryType>::~nsTHashtable()
{
  if (mTable.entrySize)
    PL_DHashTableFinish(&mTable);
}

template<class EntryType>
PRBool
nsTHashtable<EntryType>::Init(PRUint32 initSize)
{
  if (mTable.entrySize)
  {
    NS_ERROR("nsTHashtable::Init() should not be called twice.");
    return PR_TRUE;
  }

  static PLDHashTableOps sOps =
  {
    ::PL_DHashAllocTable,
    ::PL_DHashFreeTable,
    s_HashKey,
    s_MatchEntry,
    ::PL_DHashMoveEntryStub,
    s_ClearEntry,
    ::PL_DHashFinalizeStub,
    s_InitEntry
  };

  if (!EntryType::ALLOW_MEMMOVE)
  {
    sOps.moveEntry = s_CopyEntry;
  }

  if (!PL_DHashTableInit(&mTable, &sOps, nsnull, sizeof(EntryType), initSize))
  {
    // if failed, reset "flag"
    mTable.entrySize = 0;
    return PR_FALSE;
  }

  return PR_TRUE;
}

// static definitions

template<class EntryType>
PLDHashNumber
nsTHashtable<EntryType>::s_HashKey(PLDHashTable  *table,
                                   const void    *key)
{
  return EntryType::HashKey(reinterpret_cast<const KeyTypePointer>(key));
}

template<class EntryType>
PRBool
nsTHashtable<EntryType>::s_MatchEntry(PLDHashTable          *table,
                                      const PLDHashEntryHdr *entry,
                                      const void            *key)
{
  return ((const EntryType*) entry)->KeyEquals(
    reinterpret_cast<const KeyTypePointer>(key));
}

template<class EntryType>
void
nsTHashtable<EntryType>::s_CopyEntry(PLDHashTable          *table,
                                     const PLDHashEntryHdr *from,
                                     PLDHashEntryHdr       *to)
{
  EntryType* fromEntry =
    const_cast<EntryType*>(reinterpret_cast<const EntryType*>(from));

  new(to) EntryType(*fromEntry);

  fromEntry->~EntryType();
}

template<class EntryType>
void
nsTHashtable<EntryType>::s_ClearEntry(PLDHashTable    *table,
                                      PLDHashEntryHdr *entry)
{
  reinterpret_cast<EntryType*>(entry)->~EntryType();
}

template<class EntryType>
PRBool
nsTHashtable<EntryType>::s_InitEntry(PLDHashTable    *table,
                                     PLDHashEntryHdr *entry,
                                     const void      *key)
{
  new(entry) EntryType(reinterpret_cast<KeyTypePointer>(key));
  return PR_TRUE;
}

template<class EntryType>
PLDHashOperator
nsTHashtable<EntryType>::s_EnumStub(PLDHashTable    *table,
                                    PLDHashEntryHdr *entry,
                                    PRUint32         number,
                                    void            *arg)
{
  // dereferences the function-pointer to the user's enumeration function
  return (* reinterpret_cast<s_EnumArgs*>(arg)->userFunc)(
    reinterpret_cast<EntryType*>(entry),
    reinterpret_cast<s_EnumArgs*>(arg)->userArg);
}

#endif // nsTHashtable_h__

{'repo_name': 'hryuk/Carberp', 'stars': '470', 'repo_language': 'C++', 'file_name': 'ntdll.h', 'mime_type': 'text/x-c', 'hash': -472395513705937244, 'source_dataset': 'data'}


import sys
sys.path.insert(0, "/Users/oleavr/src/frida/build/frida-macos-universal/lib/python2.7/site-packages")
import AppDelegate
import Capture
import MainWindowController
import ProcessList

if __name__ == "__main__":
    from PyObjCTools import AppHelper
    AppHelper.runEventLoop()

{'repo_name': 'frida/frida-python', 'stars': '469', 'repo_language': 'C', 'file_name': '__init__.py', 'mime_type': 'text/plain', 'hash': 3615124286977426181, 'source_dataset': 'data'}


#!/bin/bash

set -e

GREEN='\033[32;1m'
RESET='\033[0m'

VERSIONS_ARRAY=(
  'preview'
)

joinVersions() {
	versions=$(printf ",%s" "${VERSIONS_ARRAY[@]}")
	echo "${versions:1}"
}

VERSION_STRING=$(joinVersions)

run() {
  export CURRENT_BRANCH="master"
  export CURRENT_VERSION=${VERSIONS_ARRAY[0]}
  export VERSIONS=${VERSION_STRING}
  export DGRAPH_ENDPOINT=${DGRAPH_ENDPOINT:-"https://play.dgraph.io/query?latency=true"}

  export HUGO_TITLE="Dgraph Doc - Preview" \
  export VERSIONS=${VERSION_STRING} \
  export CURRENT_BRANCH="master" \
  export CURRENT_VERSION=${CURRENT_VERSION}

  pushd "$(dirname "$0")/.." > /dev/null
  pushd themes > /dev/null

  if [ ! -d "hugo-docs" ]; then
    echo -e "$(date) $GREEN  Hugo-docs repository not found. Cloning the repo. $RESET"
    git clone https://github.com/dgraph-io/hugo-docs.git
  else
    echo -e "$(date) $GREEN  Hugo-docs repository found. Pulling the latest version from master. $RESET"
    pushd hugo-docs > /dev/null
    git pull
    popd > /dev/null
  fi
  popd > /dev/null

  if [[ $1 == "-p" || $1 == "--preview" ]]; then
    echo -e "$(date) $GREEN  Generating documentation static pages in the public folder. $RESET"
      hugo --destination=public --baseURL="$2" 1> /dev/null
    echo -e "$(date) $GREEN  Done building. $RESET"
  else
    hugo server -w --baseURL=http://localhost:1313
  fi
  popd > /dev/null
}

run "$1" "$2"

{'repo_name': 'dgraph-io/dgraph', 'stars': '13628', 'repo_language': 'Go', 'file_name': 'a.txt', 'mime_type': 'text/plain', 'hash': -2536892853335835819, 'source_dataset': 'data'}


comment_char    %
escape_char     /

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Somali language locale for Djibouti.
%
% Charset: ISO-8859-1
%
% Somali terms provided by Mohamed Diriye Abdullahi <diriyeam@magellan.umontreal.ca>
% Department of Linguistics and Translation, Université de Montréal, Montreal.
% Prepared and contributed to glibc by Daniel Yacob <locales@geez.org>.
%
% This locale data has been developed under the Yeha Project:
%      http://yeha.sourceforge.net/
%
% build with: localedef -f ISO-8859-1 -i so_DJ so_DJ
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

LC_IDENTIFICATION
%
title      "Somali language locale for Djibouti."
source     "Ge'ez Frontier Foundation"
address    "7802 Solomon Seal Dr., Springfield, VA 22152, USA"
contact    ""
email      "locales@geez.org"
tel        ""
fax        ""
language   "so"
territory  "DJ"
revision   "0.20"
date       "2003-07-05"
%
category  "i18n:2000";LC_IDENTIFICATION
category  "i18n:2000";LC_COLLATE
category  "i18n:2000";LC_CTYPE
category  "i18n:2000";LC_MEASUREMENT
category  "i18n:2000";LC_MONETARY
category  "posix:1993";LC_NUMERIC
category  "i18n:2000";LC_PAPER
category  "i18n:2000";LC_TELEPHONE
category  "i18n:2000";LC_NAME
category  "i18n:2000";LC_ADDRESS
category  "i18n:2000";LC_MESSAGES
category  "i18n:2000";LC_TIME
%
END LC_IDENTIFICATION

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Latin Character Set Specifc Data:
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

LC_COLLATE
copy "so_SO"
END LC_COLLATE

LC_CTYPE
copy "so_SO"
END LC_CTYPE

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Djibouti Specifc and Shared Data:
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

LC_MEASUREMENT
copy "aa_DJ"
END LC_MEASUREMENT

LC_MONETARY
copy "aa_DJ"
END LC_MONETARY

LC_NUMERIC
copy "aa_DJ"
END LC_NUMERIC

LC_PAPER
copy "aa_DJ"
END LC_PAPER

LC_TELEPHONE
copy "aa_DJ"
END LC_TELEPHONE

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Somali Specific Data:
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

LC_NAME
copy "so_SO"
END LC_NAME

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Somali/DJ Specific Data:
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

LC_ADDRESS
%
% This is the ISO_IEC TR14652 Locale definition for the LC_ADDRESS category.
%
postal_fmt    "<U0025><U007A><U0025><U0063><U0025><U0054><U0025><U0073>/
<U0025><U0062><U0025><U0065><U0025><U0072>"
country_name  "<U004A><U0061><U0062><U0075><U0075><U0074><U0069>"
country_post  "<U0044><U004A><U0049>"
country_ab2   "<U0044><U004A>"
country_ab3   "<U0044><U004A><U0049>"
country_num   262
% country_car   unknown
% country_isbn  unknown, Need ISO 2108
lang_name     "<U0053><U006F><U006F><U006D><U0061><U0061><U006C><U0069>"
lang_ab       "<U0073><U006F>"
lang_term     "<U0073><U006F><U006D>"
lang_lib      "<U0073><U006F><U006D>"
%
END LC_ADDRESS

LC_MESSAGES
%
yesexpr "<U005E><U005B><U006F><U004F><U0079><U0059><U005D><U002E><U002A>"
noexpr  "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>"
%
END LC_MESSAGES

LC_TIME
%
% Abbreviated weekday names (%a)
%
abday    "<U0061><U0078><U0061>";/
         "<U0069><U0073><U006E>";/
         "<U0073><U0061><U006C>";/
         "<U0061><U0072><U0062>";/
         "<U006B><U0068><U0061>";/
         "<U006A><U0069><U006D>";/
         "<U0073><U0061><U0062>"
%
% Full weekday names (%A)
%
day      "<U0041><U0078><U0061><U0064>";/
         "<U0049><U0073><U006E><U0069><U0069><U006E>";/
         "<U0053><U0061><U006C><U0061><U0061><U0073><U006F>";/
         "<U0041><U0072><U0062><U0061><U0063><U006F>";/
         "<U004B><U0068><U0061><U006D><U0069><U0069><U0073>";/
         "<U004A><U0069><U006D><U0063><U006F>";/
         "<U0053><U0061><U0062><U0074><U0069>"
%
% Abbreviated month names (%b)
%
abmon    "<U006B><U006F><U0062>";/
         "<U006C><U0061><U0062>";/
         "<U0073><U0061><U0064>";/
         "<U0061><U0066><U0072>";/
         "<U0073><U0068><U0061>";/
         "<U006C><U0069><U0078>";/
         "<U0074><U006F><U0064>";/
         "<U0073><U0069><U0064>";/
         "<U0073><U0061><U0067>";/
         "<U0074><U006F><U0062>";/
         "<U006B><U0069><U0074>";/
         "<U006C><U0069><U0074>"
%
% Full month names (%B)
%
mon      "<U0042><U0069><U0073><U0068><U0061> <U004B><U006F><U006F><U0062><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U004C><U0061><U0062><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U0053><U0061><U0064><U0064><U0065><U0078><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U0041><U0066><U0072><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U0053><U0068><U0061><U006E><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U004C><U0069><U0078><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U0054><U006F><U0064><U006F><U0062><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U0053><U0069><U0064><U0065><U0065><U0064><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U0053><U0061><U0067><U0061><U0061><U006C><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U0054><U006F><U0062><U006E><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U004B><U006F><U0077> <U0069><U0079><U006F> <U0054><U006F><U0062><U006E><U0061><U0061><U0064>";/
         "<U0042><U0069><U0073><U0068><U0061> <U004C><U0061><U0062><U0061> <U0069><U0079><U006F> <U0054><U006F><U0062><U006E><U0061><U0061><U0064>"
%
% Equivalent of AM PM
%
am_pm    "<U0073><U0075><U0062><U0061><U0078><U006E><U0069><U006D><U006F>";/
         "<U0067><U0061><U006C><U0061><U0062><U006E><U0069><U006D><U006F>"
%
% Appropriate date representation (%x)
%	"%d.%m.%Y"
%
d_fmt   "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
%
% Appropriate time representation (%X)
%	"%H:%M:%S"
%
t_fmt "<U0025><U006C><U003A><U0025><U004D><U003A><U0025><U0053>"
%
% Appropriate AM/PM time representation (%r)
%	"%X %p"
%
t_fmt_ampm "<U0025><U0058><U0020><U0025><U0070>"
%
% Appropriate date and time representation (%c)
%	"%a %d %b %Y %r %Z
%
d_t_fmt    "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062>/
<U0020><U0025><U0059><U0020><U0025><U0072><U0020><U0025><U005A>"
%
% Appropriate date representation (date(1))
%	"%a %b %e %r %Z %Y"
%
date_fmt    "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0072><U0020><U0025><U005A><U0020><U0025><U0059>"
%
END LC_TIME
%

{'repo_name': 'raspberrypi/tools', 'stars': '1482', 'repo_language': 'C++', 'file_name': 'PHDRS.html', 'mime_type': 'text/html', 'hash': -3487758225471691497, 'source_dataset': 'data'}


require "jsduck/util/singleton"
require "jsduck/js/scoped_traverser"

module JsDuck
  module Js

    # Looks the AST of a FunctionDeclaration or FunctionExpression for
    # uses of this.fireEvent().
    class Fires
      include Util::Singleton

      # Returns array of event names fired by the given function.
      # When no events fired, empty array is returned.
      def detect(function_node)
        @traverser = Js::ScopedTraverser.new

        events = []
        @traverser.traverse(function_node["body"]) do |node|
          if fire_event?(node)
            events << node["arguments"][0].to_value
          end
        end

        events.sort.uniq
      end

      private

      # True when node is this.fireEvent("name") call.
      # Also true for me.fireEvent() when me == this.
      def fire_event?(node)
        node.call_expression? &&
          node["callee"].member_expression? &&
          @traverser.this?(node["callee"]["object"].to_s) &&
          node["callee"]["property"].to_s == "fireEvent" &&
          node["arguments"].length > 0 &&
          node["arguments"][0].value_type == "String"
      end

    end
  end
end

{'repo_name': 'senchalabs/jsduck', 'stars': '1504', 'repo_language': 'Ruby', 'file_name': 'Tests.js', 'mime_type': 'text/plain', 'hash': 2739521238793540553, 'source_dataset': 'data'}


{'repo_name': 'mozilla/gecko-dev', 'stars': '1901', 'repo_language': 'None', 'file_name': 'AddonManager.rst', 'mime_type': 'text/plain', 'hash': 3534704149255956984, 'source_dataset': 'data'}


import hexColorRegex = require('hex-color-regex');

hexColorRegex(); // $ExpectType RegExp
hexColorRegex({ strict: true }); // $ExpectType RegExp

{'repo_name': 'DefinitelyTyped/DefinitelyTyped', 'stars': '28981', 'repo_language': 'TypeScript', 'file_name': 'react-flatpickr-tests.tsx', 'mime_type': 'text/x-java', 'hash': -3996330130047945392, 'source_dataset': 'data'}


var quote = require('../');
var concat = require('concat-stream');
var test = require('tape');

test('simple', function (t) {
    t.plan(1);
    var q = quote();
    q.end('abc');

    q.pipe(concat(function (body) {
        t.equal(body.toString('utf8'), '"abc"');
    }));
});

{'repo_name': 'tuyaohui/IM_iOS', 'stars': '222', 'repo_language': 'Objective-C', 'file_name': 'HISTORY.md', 'mime_type': 'text/plain', 'hash': 8264590297353058158, 'source_dataset': 'data'}


/****************************************************************************
 * Name:        src/msw/winestub.cpp
 * Purpose:     wxWINE module mapping main() to WinMain()
 * Author:      Robert Roebling
 * Created:     04/01/98
 * Copyright:   (c) Robert Roebling
 * Licence:     wxWindows licence
 *****************************************************************************/

#include <string.h>
#include "winuser.h"
#include "xmalloc.h"

extern int PASCAL WinMain( HINSTANCE, HINSTANCE, LPSTR, int );
extern HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] );

/* Most Windows C/C++ compilers use something like this to */
/* access argc and argv globally: */
int _ARGC;
char **_ARGV;

int main( int argc, char *argv [] )
{
  HINSTANCE hInstance;
  LPSTR lpszCmdParam;
  int i, len = 0;
  _ARGC = argc;
  _ARGV = (char **)argv;

  if (!(hInstance = MAIN_WinelibInit( &argc, argv ))) return 0;

  /* Alloc szCmdParam */
  for (i = 1; i < argc; i++) len += strlen(argv[i]) + 1;
  lpszCmdParam = (LPSTR) xmalloc(len + 1);
  /* Concatenate arguments */
  if (argc > 1) strcpy(lpszCmdParam, argv[1]);
  else lpszCmdParam[0] = '\0';
  for (i = 2; i < argc; i++) strcat(strcat(lpszCmdParam, " "), argv[i]);

  return WinMain (hInstance,    /* hInstance */
          0,            /* hPrevInstance */
          lpszCmdParam, /* lpszCmdParam */
          SW_NORMAL);   /* nCmdShow */
}

{'repo_name': 'wxWidgets/wxWidgets', 'stars': '3121', 'repo_language': 'C++', 'file_name': 'toolbar.h', 'mime_type': 'text/x-c++', 'hash': -3050731618749842790, 'source_dataset': 'data'}


// @flow
import config from 'lib/config';

export const fbPixel: () => ThirdPartyTag = () => ({
    shouldRun: config.get('switches.facebookTrackingPixel', false),
    url: `https://www.facebook.com/tr?id=${config.get(
        'libs.facebookAccountId'
    )}&ev=PageView&noscript=1`,
    sourcepointId: '5e7e1298b8e05c54a85c52d2',
    useImage: true,
});

{'repo_name': 'guardian/frontend', 'stars': '5473', 'repo_language': 'HTML', 'file_name': 'logback.xml', 'mime_type': 'text/plain', 'hash': 816928614256999554, 'source_dataset': 'data'}


// SPDX-License-Identifier: GPL-2.0
// Copyright(c) 2018 Intel Corporation. All rights reserved.

#include <linux/module.h>
#include <linux/printk.h>
#include "watermark.h"

nfit_test_watermark(device_dax);

{'repo_name': 'altera-opensource/linux-socfpga', 'stars': '161', 'repo_language': 'C', 'file_name': 'bnx2x_ethtool.c', 'mime_type': 'text/x-c', 'hash': 7922479674881495654, 'source_dataset': 'data'}


<!--
Copyright (c) 2020 Proton Technologies AG

This file is part of ProtonVPN.

ProtonVPN is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ProtonVPN is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ProtonVPN.  If not, see <https://www.gnu.org/licenses/>.
-->

<modals:BaseModalWindow x:Class="ProtonVPN.BugReporting.ReportBugModalView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:bugReporting="clr-namespace:ProtonVPN.BugReporting"
        xmlns:wpf="clr-namespace:ProtonVPN.Core.Wpf"
        xmlns:modals="clr-namespace:ProtonVPN.Modals"
        xmlns:resources="clr-namespace:ProtonVPN.Resources"
        Style="{StaticResource BaseModalStyle}"
        Title="{resources:Loc BugReport_ttl}"
        mc:Ignorable="d"
        Width="400"
        Height="Auto"
        SizeToContent="Height"
        d:DataContext="{d:DesignInstance bugReporting:ReportBugModalViewModel}">
    <Window.Resources>
        <Style x:Key="ButtonsPanel" TargetType="StackPanel">
            <Setter Property="DockPanel.Dock" Value="Right"/>
            <Setter Property="Orientation" Value="Horizontal"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="Visibility" Value="Collapsed"/>
        </Style>
        <Style x:Key="FormButtonsPanel" BasedOn="{StaticResource ButtonsPanel}" TargetType="StackPanel">
            <Style.Triggers>
                <DataTrigger Binding="{Binding OverlayViewModel}" Value="{x:Null}">
                    <Setter Property="Visibility" Value="Visible"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="FailureButtonsPanel" BasedOn="{StaticResource ButtonsPanel}" TargetType="StackPanel">
            <Style.Triggers>
                <DataTrigger Binding="{Binding OverlayViewModel, Converter={StaticResource DataTypeConverter}}" Value="{x:Type bugReporting:FailureViewModel}">
                    <Setter Property="Visibility" Value="Visible"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="SuccessButtonsPanel" BasedOn="{StaticResource ButtonsPanel}" TargetType="StackPanel">
            <Style.Triggers>
                <DataTrigger Binding="{Binding OverlayViewModel, Converter={StaticResource DataTypeConverter}}" Value="{x:Type bugReporting:SentViewModel}">
                    <Setter Property="Visibility" Value="Visible"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="SendingText" TargetType="TextBlock">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="TextAlignment" Value="Center"/>
            <Setter Property="Visibility" Value="Collapsed"/>
            <Setter Property="Margin" Value="10,0"/>
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Sending}" Value="True">
                    <Setter Property="Visibility" Value="Visible"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>

    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" x:Name="HolderGrid">
                <bugReporting:Form DataContext="{Binding FormViewModel}"/>
                <wpf:ChangeAwareContentControl x:Name="ContentControl" Content="{Binding OverlayViewModel}">
                    <wpf:ChangeAwareContentControl.Resources>
                        <DataTemplate DataType="{x:Type bugReporting:SendingViewModel}">
                            <bugReporting:SendingView/>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type bugReporting:SentViewModel}">
                            <bugReporting:SentView/>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type bugReporting:FailureViewModel}">
                            <bugReporting:FailureView/>
                        </DataTemplate>
                    </wpf:ChangeAwareContentControl.Resources>
                </wpf:ChangeAwareContentControl>
            </Grid>

            <Grid Grid.Row="1" Background="{StaticResource ModalBarColor}" Height="66">
                <TextBlock Style="{StaticResource SendingText}"
                           Text="{resources:Loc BugReport_msg_SendingInfo}"/>
                <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center">
                    <StackPanel Style="{StaticResource FormButtonsPanel}">
                        <Button Style="{StaticResource SecondaryModalButton}"
                                Content="{resources:Loc BugReport_btn_Cancel}"
                                Command="{Binding CloseCommand}"/>
                        <Button Style="{StaticResource PrimaryModalButton}"
                                Content="{resources:Loc BugReport_btn_Send}"
                                Command="{Binding SendReportCommand}"/>
                    </StackPanel>
                    <StackPanel Style="{StaticResource FailureButtonsPanel}">
                        <Button Style="{StaticResource SecondaryModalButton}"
                                Content="{resources:Loc BugReport_btn_Back}"
                                Command="{Binding BackCommand}"/>
                        <Button Style="{StaticResource PrimaryModalButton}"
                                Content="{resources:Loc BugReport_btn_Retry}"
                                Command="{Binding RetryCommand}"/>
                    </StackPanel>
                    <StackPanel Style="{StaticResource SuccessButtonsPanel}">
                        <Button Style="{StaticResource PrimaryModalButton}"
                                Content="{resources:Loc BugReport_btn_Close}"
                                Command="{Binding CloseCommand}"/>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
</modals:BaseModalWindow>

{'repo_name': 'ProtonVPN/win-app', 'stars': '316', 'repo_language': 'C#', 'file_name': 'ProtonVPN.aip', 'mime_type': 'text/xml', 'hash': 8127931288248768177, 'source_dataset': 'data'}


###########################################################################
#
# Copyright 2019 Samsung Electronics All Rights Reserved.
#
# 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.
#
###########################################################################

CONFIGURED += loadable_sample/wifiapp

{'repo_name': 'Samsung/TizenRT', 'stars': '345', 'repo_language': 'C', 'file_name': 'Kconfig', 'mime_type': 'text/plain', 'hash': 5147481159388872251, 'source_dataset': 'data'}


base=./mount
dir=$base/temp/ai2018/sentiment/tfrecord.5k.mix.glove.canyin/

fold=0
if [ $# == 1 ];
  then fold=$1
fi
if [ $FOLD ];
  then fold=$FOLD
fi

model_dir=$base/temp/ai2018/sentiment/model/v4/gru.5k.canyin.mix.neubinary
num_epochs=20

mkdir -p $model_dir/epoch
cp $dir/vocab* $model_dir
cp $dir/vocab* $model_dir/epoch

exe=./train.py
if [ "$INFER" = "1"  ];
  then echo "INFER MODE"
  exe=./infer.py
  model_dir=$1
  fold=0
fi

mode=train
if [ "$INFER" = "2"  ];
  then echo "VALID MODE"
  #exe=./infer.py
  mode=valid
  model_dir=$1
  fold=0
fi

if [ "$INFER" = "3"  ];
  then echo "TEST MODE"
  #exe=./infer.py
  mode=test
  model_dir=$1
  fold=0
fi

if [ "$INFER" = "4"  ];
  then echo "VALID+TEST MODE"
  #exe=./infer.py
  mode=valid,test
  model_dir=$1
  fold=0
fi

python $exe \
        --loss_type=binary_2 \
        --model=Model \
        --use_self_match=1 \
        --label_emb_height=20 \
        --use_label_att=1 \
        --vocab $dir/vocab.txt \
        --model_dir=$model_dir \
        --train_input=$dir/train/'*,' \
        --valid_input=$dir/valid/'*,' \
        --test_input=$dir/test/'*,' \
        --info_path=$dir/info.pkl \
        --emb_dim 300 \
        --word_embedding_file=$dir/emb.npy \
        --finetune_word_embedding=1 \
        --batch_size 32 \
        --encoder_type=rnn \
        --keep_prob=0.7 \
        --num_layers=2 \
        --rnn_hidden_size=200 \
        --encoder_output_method=topk,att \
        --top_k=3 \
        --eval_interval_steps 1000 \
        --metric_eval_interval_steps 1000 \
        --save_interval_steps 1000 \
        --save_interval_epochs=1 \
        --valid_interval_epochs=1 \
        --inference_interval_epochs=1 \
        --freeze_graph=1 \
        --optimizer=adam \
        --learning_rate=0.001 \
        --decay_target=f1 \
        --decay_patience=1 \
        --decay_factor=0.8 \
        --num_epochs=$num_epochs \
        --mode=$mode \

{'repo_name': 'chenghuige/wenzheng', 'stars': '536', 'repo_language': 'Jupyter Notebook', 'file_name': 'tokenizer.py', 'mime_type': 'text/x-python', 'hash': -8719628430504848195, 'source_dataset': 'data'}


// Copyright (c) 2008-2009  GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s)     : Laurent Rineau

#ifndef CGAL_COMPLEX_3_IN_TRIANGULATION_3_TO_VTK
#define CGAL_COMPLEX_3_IN_TRIANGULATION_3_TO_VTK

#include <CGAL/license/Mesh_3.h>

#include <CGAL/Time_stamper.h>

#include <vtkPoints.h>
#include <vtkUnstructuredGrid.h>
#include <vtkCellArray.h>
#include <vtkType.h>

#include <boost/unordered_map.hpp>

namespace CGAL {

//if export_complex is false, there must be no far point.
template <typename C3T3>
vtkUnstructuredGrid*
output_c3t3_to_vtk_unstructured_grid(const C3T3& c3t3,
                                     vtkUnstructuredGrid* grid = 0,
                                     bool export_complex = true)
{
  typedef typename C3T3::Triangulation                      Triangulation;
  typedef typename Triangulation::Vertex_handle             Vertex_handle;
  typedef CGAL::Hash_handles_with_or_without_timestamps     Hash_fct;

  const Triangulation& tr = c3t3.triangulation();

  vtkPoints* const vtk_points = vtkPoints::New();
  vtkCellArray* const vtk_facets = vtkCellArray::New();
  vtkCellArray* const vtk_cells = vtkCellArray::New();

  vtk_points->Allocate(c3t3.triangulation().number_of_vertices()- c3t3.number_of_far_points());
  vtk_facets->Allocate(c3t3.number_of_facets_in_complex());
  vtk_cells->Allocate(export_complex ? c3t3.number_of_cells_in_complex() : tr.number_of_finite_cells());

  boost::unordered_map<Vertex_handle, vtkIdType, Hash_fct> V;
  vtkIdType inum = 0;

  for(typename Triangulation::Finite_vertices_iterator
        vit = tr.finite_vertices_begin(),
        end = tr.finite_vertices_end();
      vit != end;
      ++vit)
  {
    typedef typename Triangulation::Point Point;
    if(vit->in_dimension() > -1)
    {
      const Point& p = tr.point(vit);
      vtk_points->InsertNextPoint(CGAL::to_double(p.x()),
                                  CGAL::to_double(p.y()),
                                  CGAL::to_double(p.z()));
      V[vit] = inum++;
    }
  }
  for(typename C3T3::Facets_in_complex_iterator
        fit = c3t3.facets_in_complex_begin(),
        end = c3t3.facets_in_complex_end();
      fit != end; ++fit)
  {
    vtkIdType cell[3];
    int j=0;
    for (int i = 0; i < 4; ++i)
      if (i != fit->second)
        cell[j++] =  V[(*fit).first->vertex(i)];
    CGAL_assertion(j==3);
    vtk_facets->InsertNextCell(3, cell);
  }
  if(export_complex)
  {
    for(typename C3T3::Cells_in_complex_iterator
        cit = c3t3.cells_in_complex_begin(),
        end = c3t3.cells_in_complex_end();
        cit != end; ++cit)
    {
      vtkIdType cell[4];
      for (int i = 0; i < 4; ++i)
        cell[i] =  V[cit->vertex(i)];
      vtk_cells->InsertNextCell(4, cell);
    }
  }
  else
  {
    for(auto cit = tr.finite_cells_begin(),
        end = tr.finite_cells_end();
        cit != end; ++cit)
    {
      if(!c3t3.is_in_complex(cit))
      {
        vtkIdType cell[4];
        for (int i = 0; i < 4; ++i)
          cell[i] =  V[cit->vertex(i)];
        vtk_cells->InsertNextCell(4, cell);
      }
    }
  }
  if(!grid) {
    grid = vtkUnstructuredGrid::New();
  }

  grid->SetPoints(vtk_points);
  vtk_points->Delete();

  grid->SetCells(VTK_TRIANGLE, vtk_facets);
  grid->SetCells(VTK_TETRA, vtk_cells);
  vtk_facets->Delete();
  vtk_cells->Delete();
  return grid;
}

} // end namespace CGAL

#endif // CGAL_COMPLEX_3_IN_TRIANGULATION_3_TO_VTK

{'repo_name': 'CGAL/cgal', 'stars': '1973', 'repo_language': 'C++', 'file_name': 'license.txt', 'mime_type': 'text/plain', 'hash': -3280526632098326270, 'source_dataset': 'data'}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>org.glyptodon.guacamole.net.event.listener Class Hierarchy (guacamole-ext 0.9.6 API)</title>
<meta name="date" content="2015-03-30">
<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

Hierarchy For Package org.glyptodon.guacamole.net.event.listener

Package Hierarchies:

All Packages

Interface Hierarchy

org.glyptodon.guacamole.net.event.listener.AuthenticationFailureListener

org.glyptodon.guacamole.net.event.listener.AuthenticationSuccessListener

org.glyptodon.guacamole.net.event.listener.TunnelCloseListener

org.glyptodon.guacamole.net.event.listener.TunnelConnectListener

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2015. All rights reserved.

{'repo_name': 'apache/guacamole-website', 'stars': '148', 'repo_language': 'JavaScript', 'file_name': 'LocalEnvironment.html', 'mime_type': 'text/html', 'hash': -2841056361802376248, 'source_dataset': 'data'}