answer
stringlengths
15
1.25M
<?php namespace BoomCMS\Settings; use BoomCMS\Support\Facades\Settings; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Lang; abstract class Manager { public static function options() { $options = []; foreach (Config::get('boomcms.<API key>') as $name => $type) { $langPrefix = "boomcms::settings-manager.$name."; $options[] = [ 'name' => $name, 'label' => Lang::get("{$langPrefix}_label"), 'type' => $type, 'value' => Settings::get($name), 'info' => Lang::has("{$langPrefix}_info") ? Lang::get("{$langPrefix}_info") : '', ]; } usort($options, function ($a, $b) { return ($a['label'] < $b['label']) ? -1 : 1; }); return $options; } }
package endpoints.algebra.circe import io.circe.{Decoder => CirceDecoder, Encoder => CirceEncoder} trait CirceCodec[A] { def encoder: CirceEncoder[A] def decoder: CirceDecoder[A] } object CirceCodec { @inline def apply[A](implicit codec: CirceCodec[A]): CirceCodec[A] = codec implicit def <API key>[A](implicit enc: CirceEncoder[A], dec: CirceDecoder[A]): CirceCodec[A] = new CirceCodec[A] { val decoder = dec val encoder = enc } }
# go-miner # Data Mining Algorithms in GoLang. ## Installation $ go get github.com/ozzie80/go-miner ## Algorithms k-means Description From [Wikipedia](https://en.wikipedia.org/wiki/K-means_clustering): > k-means clustering aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. This results in a partitioning of the data space into Voronoi cells. The k-means implementation of go-miner uses the [k-means++](https: Usage Example // Create points or read from a .csv file points := []dt.Vector{{1.0, 2.0, 3.0}, {5.1, 6.2, 7.3}, {2.0, 3.5, 5.0}} // Specify Parameters: K, Points, MaxIter (optional) params := kmeans.Params{2, points, math.MaxInt64} // Run k-means clusters, err := kmeans.Run(params) // Get quality index score index := kmeans.DunnIndex{} // DaviesBouldinIndex{} score := index.GetScore(clusters) To Do - Concurrent version - Cuda/GPU version To Be Added - Apriori - *K*NN - Naive Bayes - PageRank - SVM - ... go-miner is MIT License.
namespace UCloudSDK.Models { <summary> <para> http://docs.ucloud.cn/api/ucdn/get_ucdn_traffic.html </para> </summary> public partial class <API key> { <summary> Action </summary> private string _action = "GetUcdnTraffic"; <summary> API <para> GetUcdnTraffic </para> </summary> public string Action { get { return _action; } set { _action = value; } } <summary> None </summary> public string { get; set; } } }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Progress extends CI_Controller { function __construct() { parent::__construct(); <API key>("Asia/Jakarta"); $this->load->model('M_progress'); if (empty($this->session->userdata('session'))) { redirect('login'); } } public function index() { $result['data'] = $this->M_progress->getAll(); $this->load->view('backend/header'); $this->load->view('backend/navbar'); $this->load->view('backend/sidenav'); $this->load->view('backend/list_progress',$result); $this->load->view('backend/footer'); } public function tambah() { $this->load->view('backend/header'); $this->load->view('backend/navbar'); $this->load->view('backend/sidenav'); $this->load->view('backend/add_progress'); $this->load->view('backend/footer'); } public function add() { $tanggal1 = substr($this->input->post('tanggal1'), 6,4)."-".substr($this->input->post('tanggal1'), 0,2)."-".substr($this->input->post('tanggal1'), 3,2); if (empty($this->input->post('tanggal2')) || empty($this->input->post('jam2'))) { $tanggal2 = substr($this->input->post('tanggal1'), 6,4)."-".substr($this->input->post('tanggal1'), 0,2)."-".substr($this->input->post('tanggal1'), 3,2); }else{ $tanggal2 = substr($this->input->post('tanggal2'), 6,4)."-".substr($this->input->post('tanggal2'), 0,2)."-".substr($this->input->post('tanggal2'), 3,2); } //die(); switch ($this->input->post('deputi')) { case 'asdep1': $created_by = 2; $url_back ='asdep1'; break; case 'asdep2': $created_by = 3; $url_back ='asdep2'; break; case 'asdep3': $created_by = 4; $url_back ='asdep3'; break; case 'asdep4': $created_by = 5; $url_back ='asdep4'; break; default: # code... break; } $dokumentasi1 = $this->uploadImage($_FILES['foto1'],'foto1'); $dokumentasi2 = $this->uploadImage($_FILES['foto2'],'foto2'); $data = array('narasiKebijakan'=>$this->input->post('narasiKebijakan'),'uraian'=>$this->input->post('uraian'), 'tanggal1'=>$tanggal1,'tanggal2'=>$tanggal2,'lokasi'=>$this->input->post('lokasi'),'hasil'=>$this->input->post('hasil'), 'tindak_ljt'=>$this->input->post('tindak_ljt'),'arahan'=>$this->input->post('arahan'),'masalah'=>$this->input->post('masalah'), 'dokumentasi1'=>$dokumentasi1,'dokumentasi2'=>$dokumentasi2,'created_by'=>$created_by, 'updated_by'=>$this->session->userdata('session')[0]->no); //print_r($data);die(); $this->M_progress->insert($data); redirect('Beranda/view/'.$url_back); } public function uploadImage($image,$name) { //print_r($image);die(); if ($image) { $file_name = 'file_'.time(); $config['upload_path'] = './assets/images/uploads/'; $config['allowed_types'] = 'jpg|png|JPG|PNG|JPEG|jpeg'; $config['max_size'] = 20480; $config['max_width'] = 5120; $config['max_height'] = 3840; $config['file_name'] = $file_name; $this->upload->initialize($config); if ($this->upload->do_upload($name)) { $img = $this->upload->data(); return $img['file_name']; }else{ return ""; //echo $this->upload->display_errors('<p>', '</p>'); } //redirect('Foto'); } } public function config() { $result['data'] = $this->M_progress->getAll(); $this->load->view('backend/header'); $this->load->view('backend/navbar'); $this->load->view('backend/sidenav'); $this->load->view('backend/list_progress',$result); $this->load->view('backend/footer'); } public function update($value) { $result = $this->M_progress->getId($value); $doc1 = $_FILES['foto1']; $doc2 = $_FILES['foto2']; $tanggal1 = substr($this->input->post('tanggal1'), 6,4)."-".substr($this->input->post('tanggal1'), 0,2)."-".substr($this->input->post('tanggal1'), 3,2); if (empty($this->input->post('tanggal2')) || empty($this->input->post('jam2'))) { $tanggal2 = substr($this->input->post('tanggal1'), 6,4)."-".substr($this->input->post('tanggal1'), 0,2)."-".substr($this->input->post('tanggal1'), 3,2); }else{ $tanggal2 = substr($this->input->post('tanggal2'), 6,4)."-".substr($this->input->post('tanggal2'), 0,2)."-".substr($this->input->post('tanggal2'), 3,2); } if ($doc1['size'] != 0) { $dokumentasi1 = $this->uploadImage($_FILES['foto1'],'foto1'); }else{ $dokumentasi1 = $result[0]->dokumentasi1; } if ($doc2['size'] != 0) { $dokumentasi2 = $this->uploadImage($_FILES['foto2'],'foto2'); }else{ $dokumentasi2 = $result[0]->dokumentasi2; } $data = array('narasiKebijakan'=>$this->input->post('narasiKebijakan'),'uraian'=>$this->input->post('uraian'),'tanggal1'=>$tanggal1,'tanggal2'=>$tanggal2,'lokasi'=>$this->input->post('lokasi'),'hasil'=>$this->input->post('hasil'),'arahan'=>$this->input->post('arahan'),'tindak_ljt'=>$this->input->post('tindak_ljt'),'masalah'=>$this->input->post('masalah'),'dokumentasi1'=>$dokumentasi1,'dokumentasi2'=>$dokumentasi2,'updated_by'=>$this->session->userdata('session')[0]->no,'updated_at'=>date("Y-m-d H:i:s")); //print_r($data);die(); $this->M_progress->updateId($data,$value); $data = $this->M_progress->getId($value); redirect('Beranda/view/'.$data[0]->role); } public function delete($value) { $this->M_progress->deleteId($value); $data = $this->M_kebijakan->getId($value); redirect('Beranda/view/'.$data[0]->role); } public function edit($value) { $result['data'] = $this->M_progress->getId($value); $this->load->view('backend/header'); $this->load->view('backend/navbar'); $this->load->view('backend/sidenav'); $this->load->view('backend/edit_progress',$result); $this->load->view('backend/footer'); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Andersc.CodeLib.Tester.Helpers { public class Book { public string Title { get; set; } public string Publisher { get; set; } public int Year { get; set; } } }
import test from 'ava'; import { spawn } from 'child_process'; test.cb('app should boot without exiting', (t) => { const cli = spawn('node', [ './cli' ]); cli.stderr.on('data', (param) => { console.log(param.toString()); }); cli.on('close', (code) => { t.fail(`app failed to boot ${code}`); }); setTimeout(() => { t.pass(); t.end(); cli.kill(); }, 500); });
require "spec_helper" module Smsru describe API do shared_context "shared configuration", need_values: 'configuration' do before :each do Smsru.configure do |conf| conf.api_id = 'your-api-id' conf.from = 'sender-name' conf.test = test conf.format = format end end subject { Smsru::API } end shared_examples 'send_sms' do it { expect(VCR.use_cassette(cassette) { subject.send_sms(phone, text) }).to eq(response) } end shared_examples 'send_group_sms' do it { expect(VCR.use_cassette(cassette) { subject.group_send(phone, text) }).to eq(response) } end let(:text) { 'Sample of text that will have sended inside sms.' } let(:phone) { '+79050000000' } context 'test', need_values: 'configuration' do let(:test) { true } describe 'format = false' do it_behaves_like "send_sms" do let(:response) { "100\n000-00000" } let(:cassette) { 'api/send_sms' } let(:format) { false } end end describe 'error message' do let(:phone) { '0000' } let(:raw_response) { "202\n0000" } it_behaves_like "send_sms" do let(:response) { raw_response } let(:cassette) { 'api/error_sms' } let(:format) { false } end it_behaves_like "send_sms" do let(:response) { Smsru::Response.new(phone, raw_response) } let(:cassette) { 'api/error_sms' } let(:format) { true } end end describe 'group send sms' do let(:raw_response) { "100\n000-00000\n000-00000" } let(:phone) { ['+79050000000', '+79060000000'] } let(:cassette) { 'api/group_sms' } describe 'format = true' do it_behaves_like "send_group_sms" do let(:response_phone) { '+79050000000,+79060000000' } let(:response) { [Smsru::Response.new(response_phone, raw_response)] } let(:format) { true } end end describe 'format = false' do it_behaves_like "send_group_sms" do let(:response) { [raw_response] } let(:format) { false } end end end end context 'production', need_values: 'configuration' do let(:test) { false } describe 'send sms' do let(:raw_response) { "100\n000-00000\nbalance=1000" } let(:cassette) { 'api/send_sms_production' } describe 'format = false' do it_behaves_like "send_sms" do let(:response) { raw_response } let(:format) { false } end end describe 'format = true' do it_behaves_like "send_sms" do let(:response) { Smsru::Response.new(phone, raw_response) } let(:format) { true } end end end describe 'group send sms' do let(:raw_response) { "100\n000-00000\n000-00000\nbalance=1000" } let(:cassette) { 'api/<API key>' } let(:phone) { ['+79050000000', '+79060000000'] } let(:response_phone) { '+79050000000,+79060000000' } describe 'format = true' do it_behaves_like "send_group_sms" do let(:response) { [Smsru::Response.new(response_phone, raw_response)] } let(:format) { true } end end describe 'format = false' do it_behaves_like "send_group_sms" do let(:response) { [raw_response] } let(:format) { false } end end end end end end
import { expect } from 'chai'; import buildUriTemplate from '../src/uri-template'; describe('URI Template Handler', () => { context('when there are path object parameters', () => { context('when the path object parameters are not query parameters', () => { const basePath = '/api'; const href = '/pet/findByTags'; const pathObjectParams = [ { in: 'path', description: 'Path parameter from path object', name: 'fromPath', required: true, type: 'string', }, ]; const queryParams = [ { in: 'query', description: 'Tags to filter by', name: 'tags', required: true, type: 'string', }, { in: 'query', description: 'For tests. Unknown type of query parameter.', name: 'unknown', required: true, type: 'unknown', }, ]; it('returns the correct URI', () => { const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams); expect(hrefForResource).to.equal('/api/pet/findByTags{?tags,unknown}'); }); }); context('when there are no query parameters but have one path object parameter', () => { const basePath = '/api'; const href = '/pet/{id}'; const pathObjectParams = [ { in: 'path', description: 'Pet\'s identifier', name: 'id', required: true, type: 'number', }, ]; const queryParams = []; it('returns the correct URI', () => { const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams); expect(hrefForResource).to.equal('/api/pet/{id}'); }); }); context('when there are query parameters defined', () => { const basePath = '/api'; const href = '/pet/findByTags'; const pathObjectParams = [ { in: 'query', description: 'Query parameter from path object', name: 'fromPath', required: true, type: 'string', }, ]; const queryParams = [ { in: 'query', description: 'Tags to filter by', name: 'tags', required: true, type: 'string', }, { in: 'query', description: 'For tests. Unknown type of query parameter.', name: 'unknown', required: true, type: 'unknown', }, ]; it('returns the correct URI', () => { const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams); expect(hrefForResource).to.equal('/api/pet/findByTags{?fromPath,tags,unknown}'); }); }); context('when there are parameters with reserved characters', () => { const basePath = '/my-api'; const href = '/pet/{unique%2did}'; const queryParams = [ { in: 'query', description: 'Tags to filter by', name: 'tag-names[]', required: true, type: 'string', }, ]; it('returns the correct URI', () => { const hrefForResource = buildUriTemplate(basePath, href, [], queryParams); expect(hrefForResource).to.equal('/my-api/pet/{unique%2did}{?tag%2dnames%5B%5D}'); }); }); context('when there is a conflict in parameter names', () => { const basePath = '/api'; const href = '/pet/findByTags'; const pathObjectParams = [ { in: 'query', description: 'Tags to filter by', name: 'tags', required: true, type: 'string', }, ]; const queryParams = [ { in: 'query', description: 'Tags to filter by', name: 'tags', required: true, type: 'string', }, ]; it('only adds one to the query parameters', () => { const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams); expect(hrefForResource).to.equal('/api/pet/findByTags{?tags}'); }); }); context('when there are no query parameters defined', () => { const basePath = '/api'; const href = '/pet/findByTags'; const pathObjectParams = [ { in: 'query', description: 'Query parameter from path object', name: 'fromPath', required: true, type: 'string', }, ]; const queryParams = []; it('returns the correct URI', () => { const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams); expect(hrefForResource).to.equal('/api/pet/findByTags{?fromPath}'); }); }); }); context('when there are query parameters but no path object parameters', () => { const basePath = '/api'; const href = '/pet/findByTags'; const pathObjectParams = []; const queryParams = [ { in: 'query', description: 'Tags to filter by', name: 'tags', required: true, type: 'string', }, { in: 'query', description: 'For tests. Unknown type of query parameter.', name: 'unknown', required: true, type: 'unknown', }, ]; it('returns the correct URI', () => { const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams); expect(hrefForResource).to.equal('/api/pet/findByTags{?tags,unknown}'); }); }); context('when there are no query or path object parameters', () => { const basePath = '/api'; const href = '/pet/findByTags'; const pathObjectParams = []; const queryParams = []; it('returns the correct URI', () => { const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams); expect(hrefForResource).to.equal('/api/pet/findByTags'); }); }); describe('array parameters with collectionFormat', () => { it('returns a template with default format', () => { const parameter = { in: 'query', name: 'tags', type: 'array', }; const hrefForResource = buildUriTemplate('', '/example', [parameter]); expect(hrefForResource).to.equal('/example{?tags}'); }); it('returns a template with csv format', () => { const parameter = { in: 'query', name: 'tags', type: 'array', collectionFormat: 'csv', }; const hrefForResource = buildUriTemplate('', '/example', [parameter]); expect(hrefForResource).to.equal('/example{?tags}'); }); it('returns an exploded template with multi format', () => { const parameter = { in: 'query', name: 'tags', type: 'array', collectionFormat: 'multi', }; const hrefForResource = buildUriTemplate('', '/example', [parameter]); expect(hrefForResource).to.equal('/example{?tags*}'); }); }); });
let Demo1 = require('./components/demo1.js'); document.body.appendChild(Demo1());
<! Author: Ray-Eldath refer to: - http://docs.mathjax.org/en/latest/options/index.html {% if site.mathjax %} <script type="text/javascript" async src="https://cdnjs.loli.net/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ jax: ["input/TeX", "output/HTML-CSS"], tex2jax: { inlineMath: [ ["$", "$"] ], displayMath: [ ["$$", "$$"] ], skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] }, "HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"] } }); </script> {% endif %}
Copyright (c) 2016 Dropbox, Inc. All rights reserved. Auto-generated by Stone, do not modify. #import <Foundation/Foundation.h> #import "<API key>.h" @class <API key>; <API key> #pragma mark - API Object The `FileRevertDetails` struct. Reverted files to a previous version. This class implements the `DBSerializable` protocol (serialize and deserialize instance methods), which is required for all Obj-C SDK API route objects. @interface <API key> : NSObject <DBSerializable, NSCopying> #pragma mark - Instance fields #pragma mark - Constructors Full constructor for the struct (exposes all instance variables). @return An initialized instance. - (instancetype)initDefault; - (instancetype)init NS_UNAVAILABLE; @end #pragma mark - Serializer Object The serialization class for the `FileRevertDetails` struct. @interface <API key> : NSObject Serializes `<API key>` instances. @param instance An instance of the `<API key>` API object. @return A json-compatible dictionary representation of the `<API key>` API object. + (NSDictionary *)serialize:(<API key> *)instance; Deserializes `<API key>` instances. @param dict A json-compatible dictionary representation of the `<API key>` API object. @return An instantiation of the `<API key>` object. + (<API key> *)deserialize:(NSDictionary *)dict; @end <API key>
# safe_projects Project management with git ## Configuration Create a file named `~/.projects` with the path where you'd like your repositories to be stored. This should ideally be a location that is backed up regularly. bash vim ~/.projects An example file looks like this: bash export REPOSITORY_ROOT=/net/eichler/vol4/home/jlhudd/projects/repositories Clone safe projects code and add scripts to `$PATH`. bash mkdir -p ~/src cd ~/src git clone https://github.com/huddlej/safe_projects.git PATH=$PATH:$HOME/src/safe_projects export PATH ## Usage Create a new project. bash create_project.sh <API key> Change into new project directory. bash cd <API key> Add environmental configuration to `config.sh`. Add rules for your analyses to `Snakefile`. Add configuration parameters for [snakemake](https://bitbucket.org/johanneskoester/snakemake/wiki/Home) to `config.json`. Run your analysis. bash snakemake Add your changes to the repository and commit them. bash git add Snakefile config.json config.sh git commit -m "added initial rules and configuration" Save your changes to the repository root (i.e., your backed up path from the configuration section above). bash git push origin master If your current working directory is already a git repository without a remote, you can quickly initialize a remote repository and push all your changes there by running the following command from the top-level of the working directory. bash initialize_project.sh
<div id="container" class="container-fluid" ng-controller="cloudAppController"> <div class="table"> <div class="col-lg-2"> <label for="teamDD">Team:</label> <select id="teamDD" class="form-control headerSelectWidth" ng-model="filteredTeam" ng-change="onTeamChange()" ng-options="team.id as team.name for team in teamsOnly"></select> </div> <!--<div class="col-lg-2"> <label for="moduleSearch">Module:</label> <input id="moduleSearch" class="form-control headerSelectWidth" ng-model="search.moduleName"/> </div> <div class="col-lg-2"> <label for="cloudAppSearch">CloudApp:</label> <input id="cloudAppSearch" class="form-control headerSelectWidth" ng-model="search.appName"/> </div> <div class="col-lg-1"> <div class="spinner" ng-show="isLoading"></div> </div> </div> <div ng-repeat = "module in cloudAddData.modules"> <div class="col-lg-12"> <table class="table"> <thead> <tr> <th> <span >{{module.moduleName}}</span> </th> </tr> <tr> <th> <span tooltip-placement="top">CloudApp</span> </th> <th> <span tooltip-placement="top">Page</span> </th> <th>StoryPoints</th> <th>Stream</th> <th>TaskStatus</th> <th>Blockers</th> </tr> </thead> <tbody> <tr ng-repeat = "cloudApp in module.cloudApps | filter:search:strict | orderBy:['appName','pageName']:reverse"> <! <td class="table_cell_border" ng-if="showCloud(cloudApp.appName)">{{cloudApp.appName}}</td> <td class="" ng-if="<API key>"></td> rowspan="{{module.}}" <td class="table_cell_border" style="vertical-align: middle;" rowspan="{{getSpan(cloudApp.appName, module.cloudAppRowspans)}}" ng-if="showCloud(cloudApp.appName)" >{{cloudApp.appName}}</td> <td class="table_cell_border">{{cloudApp.pageName}}</td> <td class="table_cell_border">{{cloudApp.storyPoints}}</td> <td class="table_cell_border">{{cloudApp.stream}}</td> <td class="table_cell_border">{{cloudApp.taskStatus}}</td> <td class="table_cell_border"> <span ng-repeat="blocker in cloudApp.blockers" > <a ng-if="blocker.status!='Closed'" class="btn btn-primary blocker_style" ng-style={'background-color':stringToColorCode(blocker.key)} href="{{blocker.uri}}" target="_blank"> {{blocker.key}} <span class="badge">{{blocker.pagesInvolved}}</span> </a> <a ng-if="blocker.status=='Closed'" class="btn btn-primary blocker_style blocker_status_{{blocker.status}}" href="{{blocker.uri}}" target="_blank"> {{blocker.key}} <span class="badge">{{blocker.pagesInvolved}}</span> </a> </span> </td> </tr> </tbody> </table> </div> </div> </div>
package doit.study.droid.fragments; import android.app.Activity; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.EditText; import doit.study.droid.R; public class <API key> extends DialogFragment { public static final String EXTRA_CAUSE = "doit.study.droid.extra_cause"; private static final String QUESTION_TEXT_KEY = "doit.study.droid.question_text_key"; private Activity mHostActivity; private View mView; private int[] mCauseIds = {R.id.question_incorrect, R.id.answer_incorrect, R.id.<API key>}; public static <API key> newInstance(String questionText) { <API key> dislikeDialog = new <API key>(); Bundle arg = new Bundle(); arg.putString(QUESTION_TEXT_KEY, questionText); dislikeDialog.setArguments(arg); return dislikeDialog; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { mHostActivity = getActivity(); LayoutInflater inflater = mHostActivity.getLayoutInflater(); mView = inflater.inflate(R.layout.<API key>, null); AlertDialog.Builder builder = new AlertDialog.Builder(mHostActivity); builder.setMessage(getString(R.string.report_because)) .setView(mView) .setPositiveButton(mHostActivity.getString(R.string.report), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Fragment fr = getTargetFragment(); if (fr != null) { Intent intent = new Intent(); intent.putExtra(EXTRA_CAUSE, formReport()); fr.onActivityResult(<API key>(), Activity.RESULT_OK, intent); } } }) .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User cancelled the dialog } }); // Create the AlertDialog object and return it return builder.create(); } private String formReport() { EditText editText = (EditText) mView.findViewById(R.id.comment); StringBuilder result = new StringBuilder(" Cause:"); for (int id : mCauseIds) { CheckBox checkBox = (CheckBox) mView.findViewById(id); if (checkBox.isChecked()) result.append(checkBox.getText()) .append(","); } result.append(" Comment:"); result.append(editText.getText()); return result.toString(); } }
<?php namespace Zycon42\Security\Application; use Nette; use Nette\Application\Request; use Nette\Reflection\ClassType; use Nette\Reflection\Method; use Symfony\Component\ExpressionLanguage\Expression; class <API key> extends Nette\Object { /** * @var ExpressionEvaluator */ private $expressionEvaluator; private $failedExpression; public function __construct(ExpressionEvaluator $expressionEvaluator) { $this->expressionEvaluator = $expressionEvaluator; } /** * @param ClassType|Method $element * @param Request $request * @return bool * @throws \<API key> */ public function checkRequirement($element, Request $request) { if ($element instanceof ClassType) { $expressions = $this-><API key>($element); } else if ($element instanceof Method) { $expressions = $this-><API key>($element); } else throw new \<API key>("Argument 'element' must be instanceof Nette\\Reflection\\ClassType or Nette\\Reflection\\Method"); if (!empty($expressions)) { foreach ($expressions as $expression) { $result = $this->expressionEvaluator->evaluate($expression, $request); if (!$result) { $this->failedExpression = $expression; return false; } } } return true; } public function getFailedExpression() { return $this->failedExpression; } private function <API key>(ClassType $classType) { $expressions = []; $this->walkClassHierarchy($classType, $expressions); return $expressions; } private function walkClassHierarchy(ClassType $classType, &$expressions) { $parentClass = $classType->getParentClass(); if ($parentClass) $this->walkClassHierarchy($parentClass, $expressions); $annotation = $classType->getAnnotation('Security'); if ($annotation) { if (!is_string($annotation)) { throw new \<API key>('Security annotation must be simple string with expression.'); } $expressions[] = new Expression($annotation); } } private function <API key>(Method $method) { $annotation = $method->getAnnotation('Security'); if ($annotation) { if (!is_string($annotation)) { throw new \<API key>('Security annotation must be simple string with expression.'); } return [new Expression($annotation)]; } return []; } }
<?php namespace App\Http\Middleware; use Input, Closure, Response, User; class CheckClientKey { public function handle($request, Closure $next) { $input = Input::all(); $output = array(); if(!isset($input['key'])){ $output['error'] = 'API key required'; return Response::json($output, 403); } $findUser = User::where('api_key', '=', $input['key'])->first(); if(!$findUser){ $output['error'] = 'Invalid API key'; return Response::json($output, 400); } if($findUser->activated == 0){ $output['error'] = 'Account not activated'; return Response::json($output, 403); } User::$api_user = $findUser; return $next($request); } }
#import <Foundation/Foundation.h> @interface NSURL (YSKit) /** Cover query string into NSDictionary */ - (NSDictionary *)ys_queryDictionary; + (NSURL *)<API key>:(NSString *)identifier; + (NSURL *)<API key>:(NSString *)identifier; @end
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> namespace CultureInfoEditor.Properties { <summary> A strongly-typed resource class, for looking up localized strings, etc. </summary> // This class was auto-generated by the <API key> // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.<API key>("System.Resources.Tools.<API key>", "4.0.0.0")] [global::System.Diagnostics.<API key>()] [global::System.Runtime.CompilerServices.<API key>()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.<API key>("Microsoft.Performance", "CA1811:<API key>")] internal Resources() { } <summary> Returns the cached ResourceManager instance used by this class. </summary> [global::System.ComponentModel.<API key>(global::System.ComponentModel.<API key>.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CultureInfoEditor.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } <summary> Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. </summary> [global::System.ComponentModel.<API key>(global::System.ComponentModel.<API key>.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
#region References using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using Speedy; #endregion namespace Scribe.Data.Entities { public class Page : ModifiableEntity { #region Constructors [SuppressMessage("ReSharper", "<API key>")] public Page() { Versions = new Collection<PageVersion>(); } #endregion #region Properties public virtual PageVersion ApprovedVersion { get; set; } public virtual int? ApprovedVersionId { get; set; } public virtual PageVersion CurrentVersion { get; set; } public virtual int? CurrentVersionId { get; set; } <summary> Gets or sets a flag to indicated this pages has been "soft" deleted. </summary> public bool IsDeleted { get; set; } public virtual ICollection<PageVersion> Versions { get; set; } #endregion } }
#pragma config(Sensor, in1, linefollower, sensorLineFollower) #pragma config(Sensor, dgtl5, OutputBeltSonar, sensorSONAR_mm) #pragma config(Motor, port6, WhipCreamMotor, tmotorVex393, openLoop) #pragma config(Motor, port7, InputBeltMotor, <API key>, openLoop) #pragma config(Motor, port8, ElevatorMotor, <API key>, openLoop) #pragma config(Motor, port9, OutputBeltMotor, <API key>, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// task main() { //Program begins, insert code within curly braces while (true) { //Input Conveior Belt startMotor(InputBeltMotor, 127); wait(2.5); stopMotor(InputBeltMotor); //Elevator startMotor(ElevatorMotor, 127); wait(1.5); stopMotor(ElevatorMotor); //Move Cookie To line follower do { startMotor(OutputBeltMotor, -127); } while(SensorValue(linefollower) > 2900); stopMotor(OutputBeltMotor); //Reset Elevator startMotor(ElevatorMotor, -127); wait(2); stopMotor(ElevatorMotor); //Move Cookie To Whip Cream startMotor(OutputBeltMotor, -127); wait(0.4); stopMotor(OutputBeltMotor); //Whip Cream Press startMotor(WhipCreamMotor, -127); wait(1); stopMotor(WhipCreamMotor); //Whip Cream Reset startMotor(WhipCreamMotor, 127); wait(0.9); stopMotor(WhipCreamMotor); //Output Conveior Belt startMotor(OutputBeltMotor, -127); wait(2); } }
<?php use League\Flysystem\Adapter\Local; use League\Flysystem\Filesystem; use Spatie\Backup\FileHelpers\FileSelector; class FileSelectorTest extends Orchestra\Testbench\TestCase { protected $path; protected $disk; protected $root; protected $testFilesPath; protected $fileSelector; public function setUp() { parent::setUp(); $this->root = realpath('tests/_data/disk/root'); $this->path = 'backups'; $this->testFilesPath = realpath($this->root.'/'.$this->path); //make sure all files in our testdirectory are 5 days old foreach (scandir($this->testFilesPath) as $file) { touch($this->testFilesPath.'/'.$file, time() - (60 * 60 * 24 * 5)); } $this->disk = new Illuminate\Filesystem\FilesystemAdapter(new Filesystem(new Local($this->root))); $this->fileSelector = new FileSelector($this->disk, $this->path); } /** * @test */ public function <API key>() { $oldFiles = $this->fileSelector->getFilesOlderThan(new DateTime(), ['zip']); $this->assertNotEmpty($oldFiles); $this->assertFalse(in_array('MariahCarey.php', $oldFiles)); } /** * @test */ public function <API key>() { $oldFiles = $this->fileSelector->getFilesOlderThan(new DateTime(), ['']); $this->assertEmpty($oldFiles); } /** * @test */ public function <API key>() { $testFileName = '<API key>.zip'; touch($this->testFilesPath.'/'.$testFileName, time() - (60 * 60 * 24 * 10) + 60); //create a file that is 10 days and a minute old $oldFiles = $this->fileSelector->getFilesOlderThan((new DateTime())->sub(new DateInterval('P9D')), ['zip']); $this->assertTrue(in_array($this->path.'/'.$testFileName, $oldFiles)); $oldFiles = $this->fileSelector->getFilesOlderThan((new DateTime())->sub(new DateInterval('P10D')), ['zip']); $this->assertFalse(in_array($this->path.'/'.$testFileName, $oldFiles)); $oldFiles = $this->fileSelector->getFilesOlderThan((new DateTime())->sub(new DateInterval('P11D')), ['zip']); $this->assertFalse(in_array($this->path.'/'.$testFileName, $oldFiles)); } /** * @test */ public function <API key>() { $files = $this->fileSelector->getFilesOlderThan(new DateTime(), ['zip']); touch(realpath('tests/_data/disk/root/TomJones.zip'), time() - (60 * 60 * 24 * 10) + 60); $this->assertFalse(in_array($this->path.'/'.'TomJones.zip', $files)); $this->assertTrue(in_array($this->path.'/'.'test.zip', $files)); } /** * Call artisan command and return code. * * @param string $command * @param array $parameters * * @return int */ public function artisan($command, $parameters = []) { } }
var Handler, MiniEventEmitter; Handler = require("./handler"); MiniEventEmitter = (function() { function MiniEventEmitter(obj) { var handler; handler = new Handler(this, obj); this.on = handler.on; this.off = handler.off; this.emit = handler.emit; this.emitIf = handler.emitIf; this.trigger = handler.emit; this.triggerIf = handler.emitIf; } MiniEventEmitter.prototype.listen = function(type, event, args) {}; return MiniEventEmitter; })(); module.exports = MiniEventEmitter;
#!/usr/bin/bash # Hard variables # Directory containing Snakemake and cluster.json files snakefile_dir='/nas/longleaf/home/sfrenk/pipelines/snakemake' usage="\nCreate directory with Snakemake files required for pipeline \n\n setup_dir -p <pipeline> -d <directory> \n\n pipelines: bowtie_srna, hisat2_rna, srna_telo\n\n" pipeline="" if [ -z "$1" ]; then printf "$usage" exit fi while [[ $ do key="$1" case $key in -p|--pipeline) pipeline="$2" shift ;; -d|--dir) dir="$2" shift ;; -h|--help) printf "$usage" exit ;; esac shift done if [[ ! -d $dir ]]; then echo "ERROR: Invalid directory" exit 1 fi if [[ $pipeline == "" ]]; then echo "ERROR: Please select pipeline: bowtie_srna or hisat2_rna" exit 1 fi # Determine pipeline file case $pipeline in "bowtie_srna"|"bowtie_sRNA") snakefile="bowtie_srna.Snakefile" ;; "hisat2_rna"|"hisat2_RNA") snakefile='hisat2_rna.Snakefile' ;; "srna_telo") snakefile="srna_telo.Snakefile" ;; *) echo "ERROR: Invalid pipeline. Please select one of the following: bowtie_srna, hisat2_rna or srna_telo" exit 1 ;; esac # Copy over the snakefile cp ${snakefile_dir}/${snakefile} ./${snakefile} # Edit base directory in Snakefile # Remove trailing "/" from dir if it's there input_dir="$(echo $dir |sed -r 's/\/$ input_dir=\"${input_dir}\" sed -i -e "s|^BASEDIR.*|BASEDIR = ${input_dir}|" $snakefile # Determine file extension extension="$(ls $dir | grep -Eo "\.[^/]+(\.gz)?$" | sort | uniq)" # Check if there are multiple file extensions in the same directory ext_count="$(ls $dir | grep -Eo "\.[^/]+(\.gz)?$" | sort | uniq | wc -l)" if [[ $ext_count == 0 ]]; then echo "ERROR: Directory is empty!" elif [[ $ext_count != 1 ]]; then echo "WARNING: Multiple file extensions found: using .fastq.gz" extension=".fastq.gz" fi # Edit extension and utils_dir in Snakefile extension="\"${extension}\"" sed -i -e "s|^EXTENSION.*|EXTENSION = ${extension}|g" $snakefile utils_dir="${snakefile_dir%/snakemake}/utils" utils_dir="\"${utils_dir}\"" sed -i -e "s|^UTILS_DIR.*|UTILS_DIR = ${utils_dir}|g" $snakefile # Create Snakmake command script printf "#!/usr/bin/bash\n" > "run_snakemake.sh" printf "#SBATCH -t 2-0\n\n" >> "run_snakemake.sh" printf "module add python\n\n" >> "run_snakemake.sh" printf "snakemake -s $snakefile --keep-going --rerun-incomplete --cluster-config ${snakefile_dir}/cluster.json -j 100 --cluster \"sbatch -n {cluster.n} -N {cluster.N} -t {cluster.time}\"\n" >> run_snakemake.sh
import React from 'react'; import {connect} from 'react-redux'; import StringList from './StringList/StringList' import TwitterSelector from './DomainSelector/TwitterSelector' import TweetFilter from './TweetFilter/TweetFilter' class Search extends React.Component { constructor(props) { super(props); this.state = { includedWords: [] }; this.getWords = this.getWords.bind(this); } getWords(words) { this.setState({ includedWords: words }); } render() { const styles = { fontFamily: 'Helvetica Neue', fontSize: 14, lineHeight: '10px', color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center', } return ( <div> <TweetFilter /> </div> ); } } export default Search;
// YZAlertView.h // AlertViewDemo #import <UIKit/UIKit.h> typedef void(^<API key>)(UIAlertAction *action); <API key>(8_0) @interface YYZAlertView : NSObject + (void)<API key>:(NSString *)title message:(NSString *)message cancelActionTitle:(NSString *)cancelActionTitle; + (void)<API key>:(NSString *)title message:(NSString *)message actionTitle:(NSString *)actionTitle actionHandler:(<API key>)actionHandler; + (void)<API key>:(NSString *)title message:(NSString *)message cancelActionTitle:(NSString *)cancelActionTitle otherActionTitle:(NSString *)otherActionTitle actionHandler:(<API key>)actionHandler; @end
{% extends "layout_unbranded.html" %} {% block page_title %} GOV.UK prototype kit {% endblock %} {% block content %} <main id="content" role="main"> <div class="grid-row"> <div class="column-full"> <div id="global-breadcrumb" class="breadcrumb"> <a class="link-back" href="results_confirm2?search=QQ123456C">Back</a> </div> <h1 class="heading-large">QQ123456C</h1> <div class="tab-content"> <div class="js-tabs nav-tabs"> <ul class="tabs-nav" role="tablist"> <li class="active"><a href="#current-sp-value" id="tab-overview">Overview</a></li> <li><a href="#options-sp-value" id="tab-options">Filling gaps</a></li> <li><a href="#improve-sp-value" id="tab-contracting-out">Starting amount</a></li> <li><a href="#contracted-out" id="tab-ni-record">National Insurance summary</a></li> </ul> </div> </div> </div> <div id="forecast" class="tab-pane"> <div class="column-half"> <div class="forecast-wrapper2"> <span class="forecast-label2">State Pension date</span> <span class="forecast-data-bold2">4 May 2034</span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">Final relevant year (FRY)</span> <span class="forecast-data-bold2">2033-34</span> <span class="forecast-label2">&nbsp;</span><span class="forecast-data-bold2 <API key>">18 years to FRY </span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">COPE estimate</span> <span class="forecast-data-bold2">£18.84 a week</span> <span class="forecast-no-data forecast-header <API key>">Was contracted out</span> </div> </div> <div class="column-half"> <div class="forecast-wrapper2"> <span class="forecast-label2">Estimate up to 5 April 2016 </span> <span class="forecast-data-bold2">£120.10 a week</span> <span class="forecast-label2 <API key>">Qualifying years</span> <span class="forecast-data-bold2 <API key>">28</span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">Forecast contributing future years</span> <span class="forecast-data-bold2">£159.55 a week</span> <span class="forecast-label2 <API key>">Future years needed</span> <span class="forecast-data-bold2 <API key>">9</span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">Most they can get</span> <span class="forecast-data-bold2">£159.55 a week</span> </div> </div> </div> <div id="options" class="tab-pane"> <div class="column-two-thirds"> <h3 class="heading-small">Improve by filling gaps</h3> <table class="vnics"><tr><th>Gaps filled</th><th>Old rules</th><th>New rules</th></tr> <tr><td>Estimate 05 April 2016</td><td class="vnics_bold">£120.10 a week</td><td>£108.33 a week</td></tr> <tr><td>1</td><td class="vnics_bold">£124.17 a week</td><td>£112.89 a week</td></tr> <tr><td>2</td><td class="vnics_bold">£128.24 a week<td>£117.45 a week</td></tr> <tr><td>3</td><td><td>£122.00 a week</td></tr> <tr><td>4</td><td><td>£126.56 a week</td></tr> <tr><td>5</td><td><td class="vnics_bold">£131.12 a week</td></tr> </table> </div> </div> <div id="contracting-out" class="tab-pane"> <div class="column-two-thirds"> <h3 class="heading-small">Starting amount at April 2016 is £117.16 a week</h3> </div> <div class="column-one-half column-half-left"> <div class="forecast-wrapper2"> <p class="heading-small">Old rules</p> <span class="forecast-label2">Basic</span> <span class="forecast-data2">£111.35 a week</span> <span class="forecast-label2 <API key>">Additional Pension and Grad</span> <span class="forecast-data2 <API key>">£5.81 a week</span> <span class="forecast-label2 <API key>">Total</span> <span class="forecast-data-bold2 <API key>">£117.16 a week </span> </div> </div> <div class="column-one-half column-half-right"> <div class="forecast-wrapper2"> <p class="heading-small">New rules</p> <span class="forecast-label2">New State Pension</span> <span class="forecast-data2">£124.52 a week</span> <span class="forecast-label2 <API key>">RDA</span> <span class="forecast-data2 <API key>">£18.84 a week</span> <span class="forecast-label2 <API key>">Total</span> <span class="forecast-data-bold2 <API key>">£105.68 a week</span> </div> </div> </div> <div id="ni-record" class="tab-pane"> <div class="column-two-thirds"> <h2 class="heading-small">Shortfalls in record</h2> <p>5 years can be filled</p> <dl class="accordion2"> <dt> <div class="ni-wrapper"> <div class="ni-years2">2016-17</div> <div class="ni-notfull">This year is not available yet</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2015-16</div> <div class="ni-notfull">£733.20 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2014-15</div> <div class="ni-notfull">£722.80 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2013-14</div> <div class="ni-notfull">£704.60 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2012-13</div> <div class="ni-notfull">£689.00 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2011-12</div> <div class="ni-notfull">£289.80 shortfall</div> </div> </dt> </dl> </div> <div class="column-one-third"> <aside class="govuk-related-items dwp-related-items" role="complementary"> <h2 class="heading-small" id="subsection-title">Full years and shortfalls</h2> <nav role="navigation" aria-labelledby="subsection-title"> <ul class="font-xsmall"> <nav role="navigation" aria-labelledby="parent-subsection"> <ul class="list-bullets"> <li><span style="font-size: 16px"><span style="font-weight: 700">28</span> qualifying years </span> </li> <li><span style="font-size: 16px"><span style="font-weight: 700">18</span> years to contribute before 05 April 2034</span> </li> <li><span style="font-size: 16px"><span style="font-weight: 700">5</span> years with a shortfall</span> </li> </ul> </ul> </nav> </aside> </div> </div> </div> </main> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript"> // function show(elementId) { // document.getElementById("id1").style.display = "none"; // document.getElementById("id2").style.display = "block"; // document.getElementById(elementId).style.display = "block"; jQuery(document).ready(function($){ $("a#tab-overview").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#forecast").show(); $("#ni-record").hide(); $("#contracting-out").hide(); $("#contracting-out").hide(); $("#options").hide(); window.location.hash = "#lie-forecast"; return false; }); $("a#tab-options").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#options").show(); $("#forecast").hide(); $("#ni-record").hide(); $("#contracting-out").hide(); window.location.hash = "#lie-options"; return false; }); $("a#tab-ni-record").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#ni-record").show(); $("#contracting-out").hide(); $("#forecast").hide(); $("#options").hide(); window.location.hash = "#lie-ni-record"; return false; }); $("a#tab-contracting-out").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#contracting-out").show(); $("#ni-record").hide(); $("#forecast").hide(); $("#options").hide(); window.location.hash = "#lie-contracting-out"; return false; }); if(window.location.hash === "#lie-forecast") { $("a#tab-overview").trigger('click'); } else if (window.location.hash === "#lie-ni-record") { $("a#tab-ni-record").trigger('click'); } else if (window.location.hash === "#lie-contracting-out") { $("a#tab-contracting-out").trigger('click'); } else if (window.location.hash === "#lie-optionst") { $("a#tab-options").trigger('click'); } }); </script> </div> </main> <script type="text/javascript"> function removeWhitespaces() { var txtbox = document.getElementById('search-main'); txtbox.value = txtbox.value.replace(/\s/g, ""); } </script> {% endblock %}
<div id="maxoptions_example"></div>
Given(/^I have an Auton that has two steps, first step scheduling the next step$/) do class <API key> < Nestene::Auton def first context.schedule_step(:second) end def second 'ok' end attr_accessor :context attribute foo: Fixnum end @auton_type="<API key>" @auton_id = Celluloid::Actor[:nestene_core].create_auton(@auton_type) end When(/^I schedule the first step that returns the uuid of the second scheduled step$/) do @step_execution_id = Celluloid::Actor[:nestene_core].schedule_step @auton_id, :first @step_execution_id = Celluloid::Actor[:nestene_core].<API key>(@auton_id, @step_execution_id) end When(/^I wait for the second step to finish$/) do @execution_result = Celluloid::Actor[:nestene_core].<API key>(@auton_id, @step_execution_id) end Given(/^I have two autons where first auton schedules step on the other auton$/) do class StepSchedulingAuton < Nestene::Auton def schedule_step self.step_id = context.<API key>('step_executor', :step) end attr_accessor :context attribute step_id: Fixnum end class StepExecutorAuton < Nestene::Auton def step context.schedule_step(:second) end attr_accessor :context attribute foo: Fixnum end @first_auton_id = Celluloid::Actor[:nestene_core].create_auton('StepSchedulingAuton') @second_auton_id = Celluloid::Actor[:nestene_core].create_auton('StepExecutorAuton','step_executor') end When(/^I schedule the step on the first auton and wait for it's execution$/) do step_id = Celluloid::Actor[:nestene_core].schedule_step @first_auton_id, :schedule_step @<API key> = Celluloid::Actor[:nestene_core].<API key> @first_auton_id, step_id end Then(/^second auton should either have scheduled or executed step$/) do Celluloid::Actor[:nestene_core].<API key> @second_auton_id, @<API key> end
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>ergo: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.10.2 / ergo - 8.6.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> ergo <small> 8.6.0 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2022-01-18 13:05:13 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-18 13:05:13 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.10.2 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/ergo&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Ergo&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} &quot;coq-counting&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} &quot;coq-nfix&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} &quot;coq-containers&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} ] tags: [ &quot;keyword: reflexive decision procedure&quot; &quot;keyword: satisfiability modulo theories&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures&quot; ] authors: [ &quot;Stéphane Lescuyer&quot; ] bug-reports: &quot;https://github.com/coq-contribs/ergo/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/ergo.git&quot; synopsis: &quot;Ergo: a Coq plugin for reification of term with arbitrary signature&quot; description: &quot;This library provides a tactic that performs SMT solving (SAT + congruence closure + arithmetic).&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/ergo/archive/v8.6.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-ergo.8.6.0 coq.8.10.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.10.2). The following dependencies couldn&#39;t be met: - coq-ergo -&gt; coq &lt; 8.7~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-ergo.8.6.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>finger-tree: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.12.1 / finger-tree - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> finger-tree <small> 8.7.0 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2022-01-11 21:45:50 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-11 21:45:50 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.12.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/finger-tree&quot; license: &quot;LGPL&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/FingerTree&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: data structures&quot; &quot;keyword: dependent types&quot; &quot;keyword: Finger Trees&quot; &quot;category: Computer Science/Data Types and Data Structures&quot; &quot;date: 2009-02&quot; ] authors: [ &quot;Matthieu Sozeau &lt;mattam@mattam.org&gt; [http://mattam.org]&quot; ] bug-reports: &quot;https://github.com/coq-contribs/finger-tree/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/finger-tree.git&quot; synopsis: &quot;Dependent Finger Trees&quot; description: &quot;&quot;&quot; http://mattam.org/research/russell/fingertrees.en.html A verified generic implementation of Finger Trees&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/finger-tree/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-finger-tree.8.7.0 coq.8.12.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.12.1). The following dependencies couldn&#39;t be met: - coq-finger-tree -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-finger-tree.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>paramcoq: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.10.0 / paramcoq - 1.1.1+coq8.7</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> paramcoq <small> 1.1.1+coq8.7 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-07-16 08:04:26 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-16 08:04:26 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.10.0 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; synopsis: &quot;Paramcoq&quot; name: &quot;coq-paramcoq&quot; version: &quot;1.1.1+coq8.7&quot; maintainer: &quot;Pierre Roux &lt;pierre.roux@onera.fr&gt;&quot; homepage: &quot;https://github.com/coq-community/paramcoq&quot; dev-repo: &quot;git+https://github.com/coq-community/paramcoq.git&quot; bug-reports: &quot;https://github.com/coq-community/paramcoq/issues&quot; license: &quot;MIT&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Param&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7.2&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword:paramcoq&quot; &quot;keyword:parametricity&quot; &quot;keyword:ocaml module&quot; &quot;category:paramcoq&quot; &quot;category:Miscellaneous/Coq Extensions&quot; &quot;logpath:Param&quot; ] authors: [ &quot;Chantal Keller (Inria, École polytechnique)&quot; &quot;Marc Lasson (ÉNS de Lyon)&quot; &quot;Abhishek Anand&quot; &quot;Pierre Roux&quot; &quot;Emilio Jesús Gallego Arias&quot; &quot;Cyril Cohen&quot; &quot;Matthieu Sozeau&quot; ] flags: light-uninstall url { src: &quot;https://github.com/coq-community/paramcoq/releases/download/v1.1.1+coq8.7/coq-paramcoq.1.1.1+coq8.7.tgz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-paramcoq.1.1.1+coq8.7 coq.8.10.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0). The following dependencies couldn&#39;t be met: - coq-paramcoq -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-paramcoq.1.1.1+coq8.7</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
using MineLib.Core; using MineLib.Core.Data; using MineLib.Core.IO; using ProtocolClassic.Data; namespace ProtocolClassic.Packets.Server { public struct LevelFinalizePacket : IPacketWithSize { public Position Coordinates; public byte ID { get { return 0x04; } } public short Size { get { return 7; } } public IPacketWithSize ReadPacket(IProtocolDataReader reader) { Coordinates = Position.FromReaderShort(reader); return this; } IPacket IPacket.ReadPacket(IProtocolDataReader reader) { return ReadPacket(reader); } public IPacket WritePacket(IProtocolStream stream) { Coordinates.ToStreamShort(stream); return this; } } }
#ifndef <API key> #define <API key> #include "../strategy/IFly.hpp" /** \interface IDuck Interface for duck. It can fly, quack and rotate right. */ class IDuck { public: virtual Course getCourse() const = 0; virtual int getDistance(Course course) const = 0; virtual void fly() = 0; virtual void quack() = 0; virtual void right() = 0; virtual void left() = 0; virtual ~IDuck() { } }; #endif // <API key>
require 'cred_hubble/resources/credential' module CredHubble module Resources class UserValue include Virtus.model attribute :username, String attribute :password, String attribute :password_hash, String def to_json(options = {}) attributes.to_json(options) end def attributes_for_put attributes.delete_if { |k, _| <API key>.include?(k) } end private def <API key> [:password_hash] end end class UserCredential < Credential attribute :value, UserValue def type Credential::USER_TYPE end def attributes_for_put super.merge(value: value && value.attributes_for_put) end end end end
# encoding: utf-8 require 'spec_helper' describe Optimizer::Algebra::Projection::ExtensionOperand, '#optimizable?' do subject { object.optimizable? } let(:header) { Relation::Header.coerce([[:id, Integer], [:name, String], [:age, Integer]]) } let(:base) { Relation.new(header, LazyEnumerable.new([[1, 'Dan Kubb', 35]])) } let(:relation) { operand.project([:id, :name]) } let(:object) { described_class.new(relation) } before do expect(object.operation).to be_kind_of(Algebra::Projection) end context 'when the operand is an extension, and the extended attribtue is removed ' do let(:operand) { base.extend { |r| r.add(:active, true) } } it { should be(true) } end context 'when the operand is an extension, and the extended attribtue is not removed ' do let(:operand) { base.extend { |r| r.add(:active, true) } } let(:relation) { operand.project([:id, :name, :active]) } it { should be(false) } end context 'when the operand is not an extension' do let(:operand) { base } it { should be(false) } end end
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Rendering; namespace ASP.NET_Core_Email.Models.ManageViewModels { public class <API key> { public string SelectedProvider { get; set; } public ICollection<SelectListItem> Providers { get; set; } } }
#include <stdio.h> #include "list.h" #define N 10 link reverse(link); int main(void) { int i; link head, x; // Population head = new_link(0); x = head; for (i = 1; i < N; ++i) { x = insert_after(x, new_link(i)); } // Reversal head = reverse(head); // Traversal x = head; do { printf("%i\n", x->item); x = x->next; } while (x != head); return 0; } link reverse(link x) { link t; link y = x; link r = NULL; do { t = y->next; y->next = r; r = y; y = t; } while (y != x); x->next = r; return r; }
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> namespace DataBindingHomeWork.Account { public partial class <API key> { <summary> email control. </summary> <remarks> Auto-generated field. To modify move field declaration from designer file to code-behind file. </remarks> protected global::System.Web.UI.WebControls.TextBox email; } }
-- service script, define some stuuf for use with main build config self=loader.extra[1] profile=loader.extra[2] prefix=loader.extra[3] config=loader.extra[4] prefix_addon=string.format('--prefix="%s"', prefix)
import { get } from "ember-metal/property_get"; import { set } from "ember-metal/property_set"; import Ember from "ember-metal/core"; // Ember.assert import EmberError from "ember-metal/error"; import { Descriptor, defineProperty } from "ember-metal/properties"; import { ComputedProperty } from "ember-metal/computed"; import create from "ember-metal/platform/create"; import { meta, inspect } from "ember-metal/utils"; import { addDependentKeys, removeDependentKeys } from "ember-metal/dependent_keys"; export default function alias(altKey) { return new AliasedProperty(altKey); } export function AliasedProperty(altKey) { this.altKey = altKey; this._dependentKeys = [altKey]; } AliasedProperty.prototype = create(Descriptor.prototype); AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { return get(obj, this.altKey); }; AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { return set(obj, this.altKey, value); }; AliasedProperty.prototype.willWatch = function(obj, keyName) { addDependentKeys(this, obj, keyName, meta(obj)); }; AliasedProperty.prototype.didUnwatch = function(obj, keyName) { removeDependentKeys(this, obj, keyName, meta(obj)); }; AliasedProperty.prototype.setup = function(obj, keyName) { Ember.assert("Setting alias '" + keyName + "' on self", this.altKey !== keyName); var m = meta(obj); if (m.watching[keyName]) { addDependentKeys(this, obj, keyName, m); } }; AliasedProperty.prototype.teardown = function(obj, keyName) { var m = meta(obj); if (m.watching[keyName]) { removeDependentKeys(this, obj, keyName, m); } }; AliasedProperty.prototype.readOnly = function() { this.set = <API key>; return this; }; function <API key>(obj, keyName, value) { throw new EmberError('Cannot set read-only property "' + keyName + '" on object: ' + inspect(obj)); } AliasedProperty.prototype.oneWay = function() { this.set = <API key>; return this; }; function <API key>(obj, keyName, value) { defineProperty(obj, keyName, null); return set(obj, keyName, value); } // Backwards compatibility with Ember Data AliasedProperty.prototype._meta = undefined; AliasedProperty.prototype.meta = ComputedProperty.prototype.meta;
# Alt Three Storage A cached secure storage provider for Laravel 5. ## Installation This version requires [PHP](https://php.net) 7.1 or 7.2, and supports Laravel 5.5 - 5.7 only. To get the latest version, simply require the project using [Composer](https://getcomposer.org): bash $ composer require alt-three/storage Once installed, if you are not using automatic package discovery, then you need to register the `AltThree\Storage\<API key>` service provider in your `config/app.php`. ## Configuration Alt Three Storage requires configuration. To get started, you'll need to publish all vendor assets: bash $ php artisan vendor:publish This will create a `config/login.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases. ## Security If you discover a security vulnerability within this package, please e-mail us at support@alt-three.com. All security vulnerabilities will be promptly addressed. Alt Three Storage is licensed under [The MIT License (MIT)](LICENSE).
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_65) on Sat Dec 27 23:31:06 CST 2014 --> <TITLE> Uses of Class pages.MarkovTable </TITLE> <META NAME="date" CONTENT="2014-12-27"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class pages.MarkovTable"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../pages/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../pages/MarkovTable.html" title="class in pages"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?pages//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MarkovTable.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <CENTER> <H2> <B>Uses of Class<br>pages.MarkovTable</B></H2> </CENTER> <A NAME="pages"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A> in <A HREF="../../pages/package-summary.html">pages</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../pages/package-summary.html">pages</A> declared as <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>(package private) &nbsp;<A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></CODE></FONT></TD> <TD><CODE><B>Model.</B><B><A HREF="../../pages/Model.html#markov">markov</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;<A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></CODE></FONT></TD> <TD><CODE><B>ClassifyingThread.</B><B><A HREF="../../pages/ClassifyingThread.html#markov">markov</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;<A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></CODE></FONT></TD> <TD><CODE><B>ClassifyingExecutor.</B><B><A HREF="../../pages/ClassifyingExecutor.html#markov">markov</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../pages/package-summary.html">pages</A> that return <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></CODE></FONT></TD> <TD><CODE><B>Corpus.</B><B><A HREF="../../pages/Corpus.html#makeMarkovTable(java.util.ArrayList, double)">makeMarkovTable</A></B>(java.util.ArrayList&lt;java.lang.String&gt;&nbsp;volumesToUse, double&nbsp;alpha)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../pages/package-summary.html">pages</A> with parameters of type <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../pages/<API key>.html#classify(java.lang.String, java.lang.String, java.lang.String, pages.MarkovTable, java.util.ArrayList, pages.Vocabulary, pages.FeatureNormalizer, boolean)">classify</A></B>(java.lang.String&nbsp;thisFile, java.lang.String&nbsp;inputDir, java.lang.String&nbsp;outputDir, <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A>&nbsp;markov, java.util.ArrayList&lt;java.lang.String&gt;&nbsp;genres, <A HREF="../../pages/Vocabulary.html" title="class in pages">Vocabulary</A>&nbsp;vocabulary, <A HREF="../../pages/FeatureNormalizer.html" title="class in pages">FeatureNormalizer</A>&nbsp;normalizer, boolean&nbsp;isPairtree)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>GenrePredictor.</B><B><A HREF="../../pages/GenrePredictor.html#classify(java.lang.String, java.lang.String, java.lang.String, pages.MarkovTable, java.util.ArrayList, pages.Vocabulary, pages.FeatureNormalizer, boolean)">classify</A></B>(java.lang.String&nbsp;thisFile, java.lang.String&nbsp;inputDir, java.lang.String&nbsp;outputDir, <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A>&nbsp;markov, java.util.ArrayList&lt;java.lang.String&gt;&nbsp;genres, <A HREF="../../pages/Vocabulary.html" title="class in pages">Vocabulary</A>&nbsp;vocabulary, <A HREF="../../pages/FeatureNormalizer.html" title="class in pages">FeatureNormalizer</A>&nbsp;normalizer, boolean&nbsp;isPairtree)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;java.util.ArrayList&lt;double[]&gt;</CODE></FONT></TD> <TD><CODE><B>ForwardBackward.</B><B><A HREF="../../pages/ForwardBackward.html#smooth(java.util.ArrayList, pages.MarkovTable, double[])">smooth</A></B>(java.util.ArrayList&lt;double[]&gt;&nbsp;evidenceVectors, <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A>&nbsp;markov, double[]&nbsp;wordLengths)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../pages/package-summary.html">pages</A> with parameters of type <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../pages/ClassifyingThread.html#ClassifyingThread(java.lang.String, java.lang.String, java.lang.String, int, java.util.ArrayList, pages.MarkovTable, java.util.ArrayList, pages.Vocabulary, pages.FeatureNormalizer, boolean, java.lang.String)">ClassifyingThread</A></B>(java.lang.String&nbsp;thisFile, java.lang.String&nbsp;inputDir, java.lang.String&nbsp;outputDir, int&nbsp;numGenres, java.util.ArrayList&lt;<A HREF="../../pages/GenrePredictor.html" title="class in pages">GenrePredictor</A>&gt;&nbsp;classifiers, <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A>&nbsp;markov, java.util.ArrayList&lt;java.lang.String&gt;&nbsp;genres, <A HREF="../../pages/Vocabulary.html" title="class in pages">Vocabulary</A>&nbsp;vocabulary, <A HREF="../../pages/FeatureNormalizer.html" title="class in pages">FeatureNormalizer</A>&nbsp;normalizer, boolean&nbsp;isPairtree, java.lang.String&nbsp;modelLabel)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../pages/Model.html#Model(pages.Vocabulary, pages.FeatureNormalizer, pages.GenreList, java.util.ArrayList, pages.MarkovTable)">Model</A></B>(<A HREF="../../pages/Vocabulary.html" title="class in pages">Vocabulary</A>&nbsp;vocabulary, <A HREF="../../pages/FeatureNormalizer.html" title="class in pages">FeatureNormalizer</A>&nbsp;normalizer, <A HREF="../../pages/GenreList.html" title="class in pages">GenreList</A>&nbsp;genreList, java.util.ArrayList&lt;<A HREF="../../pages/GenrePredictor.html" title="class in pages">GenrePredictor</A>&gt;&nbsp;classifiers, <A HREF="../../pages/MarkovTable.html" title="class in pages">MarkovTable</A>&nbsp;markov)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../pages/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../pages/MarkovTable.html" title="class in pages"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?pages//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MarkovTable.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> </BODY> </HTML>
#!/usr/bin/env bash GEM_BIN=$1/ruby/bin/gem export GEM_HOME=/usr/local/kidsruby/ruby/lib/ruby/gems/1.9.1 install_gems() { echo $<API key> ${GEM_BIN} install htmlentities-4.3.0.gem --no-ri --no-rdoc 2>&1 ${GEM_BIN} install rubywarrior-i18n-0.0.3.gem --no-ri --no-rdoc 2>&1 ${GEM_BIN} install serialport-1.1.1-universal.x86_64-darwin-10.gem --no-ri --no-rdoc 2>&1 ${GEM_BIN} install <API key>.0.1.gem --no-ri --no-rdoc 2>&1 } install_qtbindings() { echo $<API key> ${GEM_BIN} install qtbindings-4.7.<API key>.gem --no-ri --no-rdoc 2>&1 } install_gosu() { echo $<API key> ${GEM_BIN} install gosu-0.7.36.2-universal-darwin.gem --no-ri --no-rdoc 2>&1 } install_gems install_qtbindings install_gosu
require File.join(File.dirname(__FILE__), 'test_helper') require 'activesupport' class SplamTest < Test::Unit::TestCase class FixedRule < Splam::Rule def run add_score 25, "The force is strong with this one" end end # It should not be in the default set Splam::Rule.default_rules.delete SplamTest::FixedRule class Foo include ::Splam splammable :body attr_accessor :body def body @body || "This is body\320\224 \320\199" end end class FooReq include ::Splam splammable :body do |s| s.rules = [ Splam::Rules::Keyhits, Splam::Rules::True ] end attr_accessor :body attr_accessor :request def request(obj) @request end end class FooCond include ::Splam splammable :body, 0, lambda { |s| false } attr_accessor :body end class PickyFoo include ::Splam splammable :body do |s| s.rules = [:fixed_rule, FixedRule] end def body 'lol wut' end end class HeavyFoo include ::Splam splammable :body do |s| s.rules = {:fixed_rule => 3} end def body 'lol wut' end end def test_runs_plugins f = Foo.new assert ! f.splam? assert_equal 10, f.splam_score end def <API key> f = PickyFoo.new assert ! f.splam? assert_equal 25, f.splam_score end def <API key> f = HeavyFoo.new assert ! f.splam? assert_equal 75, f.splam_score end def <API key> f = FooCond.new assert f.splam? # it IS spam, coz threshold is 0 end def <API key> Dir.glob(File.join(File.dirname(__FILE__), "fixtures", "comment", "spam", "*.txt")).each do |f| comment = Foo.new spam = File.open(f).read comment.body = spam # some spam have a lower threshold denoted by their filename # trickier to detect if f =~ /\/(\d+)_.*\.txt/ Foo.splam_suite.threshold = $1.to_i else Foo.splam_suite.threshold = 180 end spam = comment.splam? score = comment.splam_score #$stderr.puts "#{f} score: #{score}\n#{comment.splam_reasons.inspect}" assert spam, "Comment #{f} was not spam, score was #{score} but threshold was #{Foo.splam_suite.threshold}\nReasons were #{comment.splam_reasons.inspect}" end end def test_scores_ham_low Dir.glob(File.join(File.dirname(__FILE__), "fixtures", "comment", "ham", "*.txt")).each do |f| comment = Foo.new comment.body = File.open(f).read spam = comment.splam? score = comment.splam_score #$stderr.puts "#{f} score: #{score}" assert !spam, "File #{f} should be marked ham < #{Foo.splam_suite.threshold}, but was marked with score #{score}\nReasons were #{comment.splam_reasons.inspect}\n\n#{comment.body}" end end def <API key> f = FooReq.new f.body = "true" f.request = {:counter => "", :time => 3, :remote_ip => "1.2.3.4"} assert f.splam? assert_equal 300, f.splam_score end def <API key> f = FooReq.new f.body = "8" f.request = {:counter => "", :time => 3, :remote_ip => "1.2.3.4"} assert f.splam? assert_equal 300, f.splam_score end end
<?php namespace Symfony\Component\Serializer; use Symfony\Component\Serializer\SerializerInterface; /** * Defines the interface of encoders * * @author Jordi Boggiano <j.boggiano@seld.be> */ interface <API key> { /** * Sets the owning Serializer object * * @param SerializerInterface $serializer */ function setSerializer(SerializerInterface $serializer); }
#include <windows.h> #include <tchar.h> #include <string.h> LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd) { HWND hWnd; MSG msg; WNDCLASS wc; wc.lpszClassName = _T("SetBkColor"); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WindowProc; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; wc.cbClsExtra = 0; wc.cbWndExtra = 0; if (!RegisterClass(&wc)) { MessageBox(NULL, _T("RegisterClass failed!"), _T("SetBkColor"), MB_OK | MB_ICONHAND); return -1; } hWnd = CreateWindow(_T("SetBkColor"), _T("SetBkColor"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (hWnd == NULL) { MessageBox(NULL, _T("CreateWindow failed!"), _T("SetBkColor"), MB_OK | MB_ICONHAND); return -2; } ShowWindow(hWnd, SW_SHOW); while (GetMessage(&msg, NULL, 0, 0) > 0) { DispatchMessage(&msg); } return (int)msg.wParam; } LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_CREATE: { return 0; } break; case WM_DESTROY: { PostQuitMessage(0); } break; case WM_PAINT: { HDC hDC; PAINTSTRUCT ps; TCHAR tszText[] = _T("ABCDE"); size_t uiLen = 0; hDC = BeginPaint(hwnd, &ps); SetBkColor(hDC, RGB(0x00, 0x00, 0xff)); SetTextColor(hDC, RGB(0xff, 0x00, 0x00)); uiLen = _tcslen(tszText); TextOut(hDC, 50, 50, tszText, (int)uiLen); EndPaint(hwnd, &ps); } break; default: break; } return DefWindowProc(hwnd, uMsg, wParam, lParam); }
Ext.define('Siccad.view.authentication.CapsWarningTooltip', { extend : 'Ext.tip.QuickTip', alias : 'widget.capswarningtooltip', target : '<API key>, id : 'toolcaps', anchor : 'left', anchorOffset : 60, width : 305, dismissDelay : 0, autoHide : false, disabled : false, title : '<b>Caps Lock est&aacute; ativada</b>', html : '<div>Se Caps lock estiver ativado, isso pode fazer com que voc&ecirc;</div>' + '<div>digite a senha incorretamente.</div><br/>' + '<div>Voc&ecirc; deve pressionar a tecla Caps lock para desativ&aacute;-la</div>' + '<div>antes de digitar a senha.</div>' });
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Rotate : MonoBehaviour { public Vector3 m_rotate; public float m_speed; void Start() { transform.rotation = Random.rotation; } // Update is called once per frame void Update () { transform.Rotate(m_rotate*Time.deltaTime* m_speed); } }
package slacknotifications.teamcity.payload; import jetbrains.buildServer.messages.Status; import jetbrains.buildServer.responsibility.ResponsibilityEntry; import jetbrains.buildServer.responsibility.<API key>; import jetbrains.buildServer.serverSide.*; import jetbrains.buildServer.tests.TestName; import slacknotifications.teamcity.BuildStateEnum; import slacknotifications.teamcity.Loggers; import slacknotifications.teamcity.payload.content.<API key>; import java.util.Collection; public class <API key> { SBuildServer server; public <API key>(SBuildServer server){ this.server = server; Loggers.SERVER.info("<API key> :: Starting"); } public <API key> beforeBuildFinish(SRunningBuild runningBuild, SFinishedBuild previousBuild) { <API key> content = new <API key>(server, runningBuild, previousBuild, BuildStateEnum.<API key>); return content; } public <API key> buildFinished(SRunningBuild runningBuild, SFinishedBuild previousBuild) { <API key> content = new <API key>(server, runningBuild, previousBuild, BuildStateEnum.BUILD_FINISHED); return content; } public <API key> buildInterrupted(SRunningBuild runningBuild, SFinishedBuild previousBuild) { <API key> content = new <API key>(server, runningBuild, previousBuild, BuildStateEnum.BUILD_INTERRUPTED); return content; } public <API key> buildStarted(SRunningBuild runningBuild, SFinishedBuild previousBuild) { <API key> content = new <API key>(server, runningBuild, previousBuild, BuildStateEnum.BUILD_STARTED); return content; } /** Used by versions of TeamCity less than 7.0 */ public <API key> responsibleChanged(SBuildType buildType, ResponsibilityInfo <API key>, ResponsibilityInfo <API key>, boolean isUserAction) { <API key> content = new <API key>(server, buildType, BuildStateEnum.<API key>); String oldUser = "Nobody"; String newUser = "Nobody"; try { oldUser = <API key>.getResponsibleUser().getDescriptiveName(); } catch (Exception e) {} try { newUser = <API key>.getResponsibleUser().getDescriptiveName(); } catch (Exception e) {} content.setText(buildType.getFullName().toString() + " changed responsibility from " + oldUser + " to " + newUser + " with comment '" + <API key>.getComment().toString().trim() + "'" ); return content; } /** Used by versions of TeamCity 7.0 and above */ public <API key> responsibleChanged(SBuildType buildType, ResponsibilityEntry <API key>, ResponsibilityEntry <API key>) { <API key> content = new <API key>(server, buildType, BuildStateEnum.<API key>); String oldUser = "Nobody"; String newUser = "Nobody"; if (<API key>.getState() != ResponsibilityEntry.State.NONE) { oldUser = <API key>.getResponsibleUser().getDescriptiveName(); } if (<API key>.getState() != ResponsibilityEntry.State.NONE) { newUser = <API key>.getResponsibleUser().getDescriptiveName(); } content.setText(buildType.getFullName().toString().toString().trim() + " changed responsibility from " + oldUser + " to " + newUser + " with comment '" + <API key>.getComment().toString().trim() + "'" ); return content; } public <API key> responsibleChanged(SProject project, <API key> <API key>, <API key> <API key>, boolean isUserAction) { // TODO Auto-generated method stub return null; } public <API key> responsibleChanged(SProject project, Collection<TestName> testNames, ResponsibilityEntry entry, boolean isUserAction) { // TODO Auto-generated method stub return null; } /* HashMap<String, <API key>> formats = new HashMap<String,<API key>>(); Comparator<<API key>> rankComparator = new <API key>(); List<<API key>> <API key> = new ArrayList<<API key>>(); SBuildServer server; public <API key>(SBuildServer server){ this.server = server; Loggers.SERVER.info("<API key> :: Starting"); } public void <API key>(<API key> payloadFormat){ Loggers.SERVER.info(this.getClass().getSimpleName() + " :: Registering payload " + payloadFormat.getFormatShortName() + " with rank of " + payloadFormat.getRank()); formats.put(payloadFormat.getFormatShortName(),payloadFormat); this.<API key>.add(payloadFormat); Collections.sort(this.<API key>, rankComparator); Loggers.SERVER.debug(this.getClass().getSimpleName() + " :: Payloads list is " + this.<API key>.size() + " items long. Payloads are ranked in the following order.."); for (<API key> pl : this.<API key>){ Loggers.SERVER.debug(this.getClass().getSimpleName() + " :: Payload Name: " + pl.getFormatShortName() + " Rank: " + pl.getRank()); } } public <API key> getFormat(String formatShortname){ if (formats.containsKey(formatShortname)){ return formats.get(formatShortname); } return null; } public Boolean isRegisteredFormat(String format){ return formats.containsKey(format); } public Set<String> <API key>(){ return formats.keySet(); } public Collection<<API key>> <API key>(){ return <API key>; } public SBuildServer getServer() { return server; } */ }
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [sip.js](./sip.js.md) &gt; [RegistererOptions](./sip.js.registereroptions.md) &gt; [instanceId](./sip.js.registereroptions.instanceid.md) ## RegistererOptions.instanceId property UUID to provide with "+sip.instance" Contact parameter. <b>Signature:</b> typescript instanceId?: string;
<?php /* SRVDVServerBundle:Registration:email.txt.twig */ class <API key> extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( 'subject' => array($this, 'block_subject'), 'body_text' => array($this, 'block_body_text'), 'body_html' => array($this, 'block_body_html'), ); } protected function doDisplay(array $context, array $blocks = array()) { $<API key> = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $<API key>->enter($<API key> = new <API key>($this->getTemplateName(), "template", "SRVDVServerBundle:Registration:email.txt.twig")); // line 2 echo " "; // line 3 $this->displayBlock('subject', $context, $blocks); // line 8 $this->displayBlock('body_text', $context, $blocks); // line 13 $this->displayBlock('body_html', $context, $blocks); $<API key>->leave($<API key>); } // line 3 public function block_subject($context, array $blocks = array()) { $<API key> = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $<API key>->enter($<API key> = new <API key>($this->getTemplateName(), "block", "subject")); // line 4 echo " "; // line 5 echo " "; echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\<API key>')->trans("registration.email.subject", array("%username%" => $this->getAttribute((isset($context["user"]) ? $context["user"] : $this->getContext($context, "user")), "username", array()), "%confirmationUrl%" => (isset($context["confirmationUrl"]) ? $context["confirmationUrl"] : $this->getContext($context, "confirmationUrl"))), "FOSUserBundle"); echo " "; $<API key>->leave($<API key>); } // line 8 public function block_body_text($context, array $blocks = array()) { $<API key> = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $<API key>->enter($<API key> = new <API key>($this->getTemplateName(), "block", "body_text")); // line 9 echo " "; // line 10 echo " "; echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\<API key>')->trans("registration.email.message", array("%username%" => $this->getAttribute((isset($context["user"]) ? $context["user"] : $this->getContext($context, "user")), "username", array()), "%confirmationUrl%" => (isset($context["confirmationUrl"]) ? $context["confirmationUrl"] : $this->getContext($context, "confirmationUrl"))), "FOSUserBundle"); echo " "; $<API key>->leave($<API key>); } // line 13 public function block_body_html($context, array $blocks = array()) { $<API key> = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $<API key>->enter($<API key> = new <API key>($this->getTemplateName(), "block", "body_html")); $<API key>->leave($<API key>); } public function getTemplateName() { return "SRVDVServerBundle:Registration:email.txt.twig"; } public function getDebugInfo() { return array ( 75 => 13, 65 => 10, 63 => 9, 57 => 8, 47 => 5, 45 => 4, 39 => 3, 32 => 13, 30 => 8, 28 => 3, 25 => 2,); } /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ public function getSource() { @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); return $this->getSourceContext()->getCode(); } public function getSourceContext() { return new Twig_Source("{% <API key> 'FOSUserBundle' %} {% block subject %} {% autoescape false %} {{ 'registration.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }} {% endautoescape %} {% endblock %} {% block body_text %} {% autoescape false %} {{ 'registration.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }} {% endautoescape %} {% endblock %} {% block body_html %}{% endblock %} ", "SRVDVServerBundle:Registration:email.txt.twig", "C:\\wamp64\\www\\serveurDeVoeux\\src\\SRVDV\\ServerBundle/Resources/views/Registration/email.txt.twig"); } }
using Portal.CMS.Entities.Enumerators; using Portal.CMS.Services.Generic; using Portal.CMS.Services.PageBuilder; using Portal.CMS.Web.Architecture.ActionFilters; using Portal.CMS.Web.Architecture.Extensions; using Portal.CMS.Web.Areas.PageBuilder.ViewModels.Component; using Portal.CMS.Web.ViewModels.Shared; using System; using System.Linq; using System.Threading.Tasks; using System.Web.Mvc; using System.Web.SessionState; namespace Portal.CMS.Web.Areas.PageBuilder.Controllers { [AdminFilter(<API key>.Modal)] [SessionState(<API key>.ReadOnly)] public class ComponentController : Controller { private readonly IPageSectionService _pageSectionService; private readonly <API key> <API key>; private readonly IImageService _imageService; public ComponentController(IPageSectionService pageSectionService, <API key> <API key>, IImageService imageService) { _pageSectionService = pageSectionService; <API key> = <API key>; _imageService = imageService; } [HttpGet] [OutputCache(Duration = 86400)] public async Task<ActionResult> Add() { var model = new AddViewModel { <API key> = await <API key>.<API key>() }; return View("_Add", model); } [HttpPost] [ValidateInput(false)] public async Task<JsonResult> Add(int pageSectionId, string containerElementId, string elementBody) { elementBody = elementBody.Replace("animated bounce", string.Empty); await <API key>.AddAsync(pageSectionId, containerElementId, elementBody); return Json(new { State = true }); } [HttpPost] public async Task<ActionResult> Delete(int pageSectionId, string elementId) { try { await <API key>.DeleteAsync(pageSectionId, elementId); return Json(new { State = true }); } catch (Exception ex) { return Json(new { State = false, Message = ex.InnerException }); } } [HttpPost] [ValidateInput(false)] public async Task<ActionResult> Edit(int pageSectionId, string elementId, string elementHtml) { await <API key>.EditElementAsync(pageSectionId, elementId, elementHtml); return Content("Refresh"); } [HttpGet] public async Task<ActionResult> EditImage(int pageSectionId, string elementId, string elementType) { var imageList = await _imageService.GetAsync(); var model = new ImageViewModel { SectionId = pageSectionId, ElementType = elementType, ElementId = elementId, GeneralImages = new PaginationViewModel { PaginationType = "general", TargetInputField = "SelectedImageId", ImageList = imageList.Where(x => x.ImageCategory == ImageCategory.General) }, IconImages = new PaginationViewModel { PaginationType = "icon", TargetInputField = "SelectedImageId", ImageList = imageList.Where(x => x.ImageCategory == ImageCategory.Icon) }, ScreenshotImages = new PaginationViewModel { PaginationType = "screenshot", TargetInputField = "SelectedImageId", ImageList = imageList.Where(x => x.ImageCategory == ImageCategory.Screenshot) }, TextureImages = new PaginationViewModel { PaginationType = "texture", TargetInputField = "SelectedImageId", ImageList = imageList.Where(x => x.ImageCategory == ImageCategory.Texture) } }; return View("_EditImage", model); } [HttpPost] public async Task<JsonResult> EditImage(ImageViewModel model) { try { var selectedImage = await _imageService.GetAsync(model.SelectedImageId); await <API key>.EditImageAsync(model.SectionId, model.ElementType, model.ElementId, selectedImage.CDNImagePath()); return Json(new { State = true, Source = selectedImage.CDNImagePath() }); } catch (Exception) { return Json(new { State = false }); } } [HttpGet] public ActionResult EditVideo(int pageSectionId, string <API key>, string <API key>) { var model = new VideoViewModel { SectionId = pageSectionId, <API key> = <API key>, <API key> = <API key>, VideoUrl = string.Empty }; return View("_EditVideo", model); } [HttpPost] [<API key>] public async Task<ActionResult> EditVideo(VideoViewModel model) { try { await <API key>.EditSourceAsync(model.SectionId, model.<API key>, model.VideoUrl); return Json(new { State = true }); } catch (Exception) { return Json(new { State = false }); } } [HttpGet] public ActionResult EditContainer(int pageSectionId, string elementId) { var model = new ContainerViewModel { SectionId = pageSectionId, ElementId = elementId }; return View("_EditContainer", model); } [HttpPost] [<API key>] public async Task<ActionResult> EditContainer(ContainerViewModel model) { await _pageSectionService.EditAnimationAsync(model.SectionId, model.ElementId, model.Animation.ToString()); return Content("Refresh"); } [HttpPost] [ValidateInput(false)] public async Task<ActionResult> Link(int pageSectionId, string elementId, string elementHtml, string elementHref, string elementTarget) { await <API key>.EditAnchorAsync(pageSectionId, elementId, elementHtml, elementHref, elementTarget); return Content("Refresh"); } [HttpPost] public async Task<JsonResult> Clone(int pageSectionId, string elementId, string componentStamp) { await <API key>.CloneElementAsync(pageSectionId, elementId, componentStamp); return Json(new { State = true }); } } }
// ActionOnDispose.cs // Implemention of IDisposable that runs a delegate on Dispose. using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; namespace System.Threading.Tasks.Dataflow.Internal { <summary>Provider of disposables that run actions.</summary> internal sealed class Disposables { <summary>An IDisposable that does nothing.</summary> internal readonly static IDisposable Nop = new NopDisposable(); <summary>Creates an IDisposable that runs an action when disposed.</summary> <typeparam name="T1">Specifies the type of the first argument.</typeparam> <typeparam name="T2">Specifies the type of the second argument.</typeparam> <param name="action">The action to invoke.</param> <param name="arg1">The first argument.</param> <param name="arg2">The second argument.</param> <returns>The created disposable.</returns> internal static IDisposable Create<T1, T2>(Action<T1, T2> action, T1 arg1, T2 arg2) { Contract.Requires(action != null, "Non-null disposer action required."); return new Disposable<T1, T2>(action, arg1, arg2); } <summary>Creates an IDisposable that runs an action when disposed.</summary> <typeparam name="T1">Specifies the type of the first argument.</typeparam> <typeparam name="T2">Specifies the type of the second argument.</typeparam> <typeparam name="T3">Specifies the type of the third argument.</typeparam> <param name="action">The action to invoke.</param> <param name="arg1">The first argument.</param> <param name="arg2">The second argument.</param> <param name="arg3">The third argument.</param> <returns>The created disposable.</returns> internal static IDisposable Create<T1, T2, T3>(Action<T1, T2, T3> action, T1 arg1, T2 arg2, T3 arg3) { Contract.Requires(action != null, "Non-null disposer action required."); return new Disposable<T1, T2, T3>(action, arg1, arg2, arg3); } <summary>A disposable that's a nop.</summary> [DebuggerDisplay("Disposed = true")] private sealed class NopDisposable : IDisposable { void IDisposable.Dispose() { } } <summary>An IDisposable that will run a delegate when disposed.</summary> [DebuggerDisplay("Disposed = {Disposed}")] private sealed class Disposable<T1, T2> : IDisposable { <summary>First state argument.</summary> private readonly T1 _arg1; <summary>Second state argument.</summary> private readonly T2 _arg2; <summary>The action to run when disposed. Null if disposed.</summary> private Action<T1, T2> _action; <summary>Initializes the ActionOnDispose.</summary> <param name="action">The action to run when disposed.</param> <param name="arg1">The first argument.</param> <param name="arg2">The second argument.</param> internal Disposable(Action<T1, T2> action, T1 arg1, T2 arg2) { Contract.Requires(action != null, "Non-null action needed for disposable"); _action = action; _arg1 = arg1; _arg2 = arg2; } <summary>Gets whether the IDisposable has been disposed.</summary> [SuppressMessage("Microsoft.Performance", "CA1811:<API key>")] private bool Disposed { get { return _action == null; } } <summary>Invoke the action.</summary> void IDisposable.Dispose() { Action<T1, T2> toRun = _action; if (toRun != null && Interlocked.CompareExchange(ref _action, null, toRun) == toRun) { toRun(_arg1, _arg2); } } } <summary>An IDisposable that will run a delegate when disposed.</summary> [DebuggerDisplay("Disposed = {Disposed}")] private sealed class Disposable<T1, T2, T3> : IDisposable { <summary>First state argument.</summary> private readonly T1 _arg1; <summary>Second state argument.</summary> private readonly T2 _arg2; <summary>Third state argument.</summary> private readonly T3 _arg3; <summary>The action to run when disposed. Null if disposed.</summary> private Action<T1, T2, T3> _action; <summary>Initializes the ActionOnDispose.</summary> <param name="action">The action to run when disposed.</param> <param name="arg1">The first argument.</param> <param name="arg2">The second argument.</param> <param name="arg3">The third argument.</param> internal Disposable(Action<T1, T2, T3> action, T1 arg1, T2 arg2, T3 arg3) { Contract.Requires(action != null, "Non-null action needed for disposable"); _action = action; _arg1 = arg1; _arg2 = arg2; _arg3 = arg3; } <summary>Gets whether the IDisposable has been disposed.</summary> [SuppressMessage("Microsoft.Performance", "CA1811:<API key>")] private bool Disposed { get { return _action == null; } } <summary>Invoke the action.</summary> void IDisposable.Dispose() { Action<T1, T2, T3> toRun = _action; if (toRun != null && Interlocked.CompareExchange(ref _action, null, toRun) == toRun) { toRun(_arg1, _arg2, _arg3); } } } } }
using System; using System.Collections.Generic; using Esb.Transport; namespace Esb.Message { public interface IMessageQueue { void Add(Envelope message); IEnumerable<Envelope> Messages { get; } Envelope GetNextMessage(); void SuspendMessages(Type messageType); void ResumeMessages(Type messageType); void RerouteMessages(Type messageType); void RemoveMessages(Type messageType); event EventHandler<EventArgs> OnMessageArived; IRouter Router { get; set; } } }
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually #pragma once #include <common/common.h> #include <<API key>.hpp> #include <common/ATFCore.hpp> START_ATF_NAMESPACE namespace Register { class <API key> : public IRegister { public: void Register() override { auto& hook_core = CATFCore::get_instance(); for (auto& r : Detail::<API key>) hook_core.reg_wrapper(r.pBind, r); } }; }; // end namespace Register END_ATF_NAMESPACE
title: date: 2016-06-05 22:58:54 tags: * [](http://www.huishenghuiying.com.cn/xiazai.html#selctbuy) * [](https://hostr.co/file/FDp8MOYlRuHv/AppNee.com.Corel.X5-X9.All.Products.Universal.Keygen.7z?warning=on) * [](https: # 1 `.exe` `.rar`360 # 2 `setup.xml` * `SHOWSERIALDIALOG` `value` `true` * `SERIALNUMBER` `value` > ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//1.png) > ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//2.png) `.rar` `.exe` # 4 `Corel VideoStudio Pro/Ulitime X8` ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//3.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//4.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//5.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//6.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//7.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//8.png) # 630 > `Corel FastFlick X8` ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//9.png) ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//10.png) > * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//11.png) ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//12.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//13.png) ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//14.png) * `Generate Activation Code` ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//15.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//16.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//17.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//18.png) * ![](https://github.com/luoye-fe/hexo-blog/blob/master/source/_posts//19.png)
// generates an interface file given an eni file // you can generate an eni file using the aws-cli // example: // aws ec2 <API key> --<API key> eni-2492676c > eni-7290653a.json var ENI_FILE = "json/eni-651e2c2c.json"; // the interface you want to configure var INTERFACE = "eth1"; // port you want squid proxy to start at; doesn't matter if you're not using squid var PORT = 3188; // get the gateway ip by running `route -n` var GATEWAYIP = "172.31.16.1"; // number to start with in RT TABLES var RT_TABLES = 2; fs = require('fs'); fs.readFile(ENI_FILE, function (err, data) { if (!err) { var eni = JSON.parse(data).NetworkInterfaces[0]; var netConfig = "auto " + INTERFACE + "\niface " + INTERFACE + " inet dhcp\n\n"; var squidConfig = ""; var rtTables = ""; for (var i = 0; i < eni.PrivateIpAddresses.length; i++) { var addressObject = eni.PrivateIpAddresses[i]; // construct string // current subinterface var subinterface = INTERFACE + ":" + i; netConfig += "auto " + subinterface + "\n"; netConfig += "iface "+ subinterface + " inet static\n"; netConfig += "address " + addressObject.PrivateIpAddress + "\n"; // this IP is the gateway IP netConfig += "up ip route add default via " + GATEWAYIP + " dev " + subinterface + " table " + subinterface + "\n" netConfig += "up ip rule add from " + addressObject.PrivateIpAddress + " lookup " + subinterface + "\n\n"; squidConfig += "http_port localhost:" + PORT + " name="+ PORT + "\nacl a" + PORT + " myportname " + PORT + " src localhost\nhttp_access allow a" + PORT + "\<API key> " + addressObject.PrivateIpAddress + " a" + PORT + "\n\n"; rtTables += RT_TABLES + " " + subinterface + "\n"; PORT++; RT_TABLES++; }; // trim newlines netConfig = netConfig.replace(/^\s+|\s+$/g, ''); squidConfig = squidConfig.replace(/^\s+|\s+$/g, ''); rtTables = rtTables.replace(/^\s+|\s+$/g, ''); fs.writeFile("./cfg/" + INTERFACE + ".cfg", netConfig, function(err) { if(err) { console.log(err); } else { console.log("Generated networking config and saved it to " + INTERFACE + ".cfg."); } }); fs.writeFile("./cfg/" + INTERFACE + "-squid.cfg", squidConfig, function(err) { if(err) { console.log(err); } else { console.log("Generated squid config and saved it to " + INTERFACE + ".cfg."); } }); fs.writeFile("./cfg/" + INTERFACE + "-rt_tables.cfg", rtTables, function(err) { if(err) { console.log(err); } else { console.log("Generated rt_tables and saved it to " + INTERFACE + ".cfg."); } }); } if (err) { console.log("Error! Make sure you're running this in the config-utils directory and that the JSON file + the cfg directory are both there."); } });
# nodejs-boilerplate ## About A boilerplate for a developer environment pre-built for a nodejs project using expressjs for the backend and angularjs for the front end. This boilerplate also comes with a built in logger for requests as well as a Gruntfile with my favorite addons for developing nodejs projects. :godmode: ## Dependencies **AngularJS** Using the Browserify addon in grunt, I've created a folder structure for organizing angular projects into smaller components within the *public/js/modules* folder. While running grunt watch, all of these files are included in *public/js/main.js* and will continue to be compressed into *public/js/bundle.min.js*. I have set AngularJS html5Mode option to true and have made the server configurations necessary to remove the hashtag from urls. Strict mode has been added to each module to ensure proper javascript is being used. **bower** Using a .bowerrc file, I have set it so running *bower install* will install packages directly into the *public/js/bower_components* folder. This is intended to keep frontend libraries and frameworks seperate from backend node_modules and Gruntfile addons. **SASS and Compass** This boilerplate comes with the SASS precompiler and I have decided to go with SCSS because I enjoy curly brackets. **Grunt** Be sure to keep the grunt watch task running during development. I've set jshint to all javascript files including those found in the backend. Thank you and have a nice day :)
namespace Hyperar.HattrickUltimate.UserInterface { using System; using System.Windows.Forms; using Interface; <summary> ILocalizableForm base implementation. </summary> public partial class LocalizableFormBase : Form, ILocalizableForm { #region Public Methods <summary> Populates controls' properties with the corresponding localized string. </summary> public virtual void PopulateLanguage() { } #endregion Public Methods #region Protected Methods <summary> Raises the System.Windows.Forms.Form.Load event. </summary> <param name="e">An System.EventArgs that contains the event data.</param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.PopulateLanguage(); } #endregion Protected Methods } }
var width = window.innerWidth, height = window.innerHeight, boids = [], destination, canvas, context; const MAX_NUMBER = 100; const MAX_SPEED = 1; const radius = 5; init(); animation(); function init(){ canvas = document.getElementById('canvas'), context = canvas.getContext( "2d" ); canvas.width = width; canvas.height = height; destination = { x:Math.random()*width, y:Math.random()*height }; for (var i = 0; i <MAX_NUMBER; i++) { boids[i] = new Boid(); }; } var _animation; function animation(){ _animation = <API key>(animation); context.clearRect(0,0,width,height); for (var i = 0; i < boids.length; i++) { boids[i].rule1(); boids[i].rule2(); boids[i].rule3(); boids[i].rule4(); boids[i].rule5(); boids[i].rule6(); var nowSpeed = Math.sqrt(boids[i].vx * boids[i].vx + boids[i].vy * boids[i].vy ); if(nowSpeed > MAX_SPEED){ boids[i].vx *= MAX_SPEED / nowSpeed; boids[i].vy *= MAX_SPEED / nowSpeed; } boids[i].x += boids[i].vx; boids[i].y += boids[i].vy; drawCircle(boids[i].x,boids[i].y); drawVector(boids[i].x,boids[i].y,boids[i].vx,boids[i].vy); }; } /* //mouseEvent document.onmousemove = function (event){ destination ={ x:event.screenX, y:event.screenY } }; */ function Boid(){ this.x = Math.random()*width; this.y = Math.random()*height; this.vx = 0.0; this.vy = 0.0; this.dx = Math.random()*width; this.dy = Math.random()*height; this.rule1 = function(){ var centerx = 0, centery = 0; for (var i = 0; i < boids.length; i++) { if (boids[i] != this) { centerx += boids[i].x; centery += boids[i].y; }; }; centerx /= MAX_NUMBER-1; centery /= MAX_NUMBER-1; this.vx += (centerx-this.x)/1000; this.vy += (centery-this.y)/1000; } this.rule2 = function(){ var _vx = 0, _vy = 0; for (var i = 0; i < boids.length; i++) { if(this != boids[i]){ var distance = distanceTo(this.x,boids[i].x,this.y,boids[i].y); if(distance<25){ distance += 0.001; _vx -= (boids[i].x - this.x)/distance; _vy -= (boids[i].y - this.y)/distance; //this.dx = -boids[i].x; //this.dy = -boids[i].y; } } }; this.vx += _vx; this.vy += _vy; } this.rule3 = function(){ var _pvx = 0, _pvy = 0; for (var i = 0; i < boids.length; i++) { if (boids[i] != this) { _pvx += boids[i].vx; _pvy += boids[i].vy; } }; _pvx /= MAX_NUMBER-1; _pvy /= MAX_NUMBER-1; this.vx += (_pvx - this.vx)/10; this.vy += (_pvy - this.vy)/10; }; this.rule4 = function(){ if(this.x < 10 && this.vx < 0)this.vx += 10/(Math.abs( this.x ) + 1 ); if(this.x > width && this.vx > 0)this.vx -= 10/(Math.abs( width - this.x ) + 1 ); if (this.y < 10 && this.vy < 0)this.vy += 10/(Math.abs( this.y ) + 1 ); if(this.y > height && this.vy > 0)this.vy -= 10/(Math.abs( height - this.y ) + 1 ); }; this.rule5 = function(){ var _dx = this.dx - this.x, _dy = this.dy - this.y; this.vx += (this.dx - this.x)/500; this.vy += (this.dy - this.y)/500; } this.rule6 = function(){ var _vx = Math.random()-0.5, _vy = Math.random()-0.5; for (var i = 0; i < boids.length; i++) { if(this != boids[i] && this.dx != boids[i].dx && this.dy != boids[i].dy){ var distance = distanceTo(this.x,boids[i].x,this.y,boids[i].y); if(distance<20 && distance>15){ console.log(distance); distance += 0.001; _vx += (boids[i].x - this.x)/distance; _vy += (boids[i].y - this.y)/distance; drawLine(this.x,this.y,boids[i].x,boids[i].y); this.dx = boids[i].dx; this.dy = boids[i].dy; } } }; this.vx += _vx; this.vy += _vy; } } function distanceTo(x1,x2,y1,y2){ var dx = x2-x1, dy = y2-y1; return Math.sqrt(dx*dx+dy*dy); } function drawCircle(x,y){ context.beginPath(); context.strokeStyle = "#fff"; context.arc(x,y,radius,0,Math.PI*2,false); context.stroke(); } const VectorLong = 10; function drawVector(x,y,vx,vy){ context.beginPath(); var pointx = x+vx*VectorLong; var pointy = y+vy*VectorLong; context.moveTo(x,y); context.lineTo(pointx,pointy); context.stroke(); } function drawLine(x1,y1,x2,y2){ context.beginPath(); context.moveTo(x1,y1); context.lineTo(x2,y2); context.stroke(); }
package com.facetime.spring.support; import java.util.ArrayList; import java.util.List; import com.facetime.core.conf.ConfigUtils; import com.facetime.core.utils.StringUtils; /** * * * @author yufei * @param <T> */ public class Page<T> { private static int BEGIN_PAGE_SIZE = 20; private static int ADD_PAGE_SIZE_RATIO = 10; public static int DEFAULT_PAGE_SIZE = 10; private static int MAX_PAGE_SIZE = 200; private QueryInfo<T> queryInfo = null; private List<T> queryResult = null; public Page() { this(new QueryInfo<T>()); } public Page(QueryInfo<T> queryInfo) { this.queryInfo = queryInfo; this.queryResult = new ArrayList<T>(15); } /** * @return */ public final static int getAddPageSize() { String addPageSizeRatio = ConfigUtils.getProperty("add_page_size_ratio"); if (StringUtils.isValid(addPageSizeRatio)) ADD_PAGE_SIZE_RATIO = Integer.parseInt(addPageSizeRatio); return ADD_PAGE_SIZE_RATIO; } /** * @return */ public final static int getBeginPageSize() { String beginPageSize = ConfigUtils.getProperty("begin_page_size"); if (StringUtils.isValid(beginPageSize)) BEGIN_PAGE_SIZE = Integer.parseInt(beginPageSize); return BEGIN_PAGE_SIZE; } public static final int getDefaultPageSize() { String defaultPageSize = ConfigUtils.getProperty("default_page_size"); if (StringUtils.isValid(defaultPageSize)) DEFAULT_PAGE_SIZE = Integer.parseInt(defaultPageSize); return DEFAULT_PAGE_SIZE; } public static final int getMaxPageSize() { String maxPageSize = ConfigUtils.getProperty("max_page_size"); if (StringUtils.isValid(maxPageSize)) { MAX_PAGE_SIZE = Integer.parseInt(maxPageSize); } return MAX_PAGE_SIZE; } public String getBeanName() { return this.queryInfo.getBeanName(); } public int getCurrentPageNo() { return this.queryInfo.getCurrentPageNo(); } public String getKey() { return this.queryInfo.getKey(); } public Integer getNeedRowNum() { return this.getPageSize() - this.getQueryResult().size(); } public long getNextPage() { return this.queryInfo.getNextPage(); } public int getPageCount() { return this.queryInfo.getPageCount(); } public int getPageSize() { return this.queryInfo.getPageSize(); } public List<T> getParams() { return this.queryInfo.getParams(); } public int getPreviousPage() { return this.queryInfo.getPreviousPage(); } public String[] getProperties() { return this.queryInfo.getProperties(); } public List<T> getQueryResult() { return this.queryResult; } public int getRecordCount() { return this.queryInfo.getRecordCount(); } public String getSql() { return this.queryInfo.getSql(); } public boolean isHasResult() { return this.queryResult != null && this.queryResult.size() > 0; } public void setBeanName(String beanNameValue) { this.queryInfo.setBeanName(beanNameValue); } public void setCurrentPageNo(int currentPageNo) { this.queryInfo.setCurrentPageNo(currentPageNo); } public void setKey(String keyValue) { this.queryInfo.setKey(keyValue); } public void setPageCount(int pageCount) { this.queryInfo.setPageCount(pageCount); } public void setPageSize(int pageSize) { this.queryInfo.setPageSize(pageSize); } public void setParams(List<T> paramsValue) { this.queryInfo.setParams(paramsValue); } public void setProperties(String[] propertiesValue) { this.queryInfo.setProperties(propertiesValue); } public void setQueryResult(List<T> list) { this.queryResult = list; } public void setRecordCount(int count) { this.queryInfo.setRecordCount(count); } public void setSql(String sql) { this.queryInfo.setSql(sql); } }
layout: post title: Mancester 6/26 Screened today, imaged 6/22 growth exp. & screened larvae; cleaned broodstock, yada yada yada... # Imaged 6/22 SN growth experiment larvae Grace imaged the well plate, taking photos of first the well ![file_000 8](https://user-images.githubusercontent.com/17264765/<API key>.jpeg) # Screening data ![snip20170707_48](https://user-images.githubusercontent.com/17264765/<API key>.png) ![snip20170707_46](https://user-images.githubusercontent.com/17264765/<API key>.png) TB Continued.... need to reference notebook entry left @ home
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @<API key>=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; -- TABLES -- Table `gene` CREATE TABLE IF NOT EXISTS `gene` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `hgnc_id` int(10) unsigned NOT NULL, `symbol` varchar(40) NOT NULL, `name` TEXT NOT NULL, `type` enum('protein-coding gene','pseudogene','non-coding RNA','other') NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `hgnc_id` (`hgnc_id`), UNIQUE KEY `symbol` (`symbol`), KEY `type` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Genes from HGNC'; -- Table `gene_alias` CREATE TABLE IF NOT EXISTS `gene_alias` ( `gene_id` int(10) unsigned NOT NULL, `symbol` varchar(40) NOT NULL, `type` enum('synonym','previous') NOT NULL, KEY `fk_gene_id1` (`gene_id` ASC) , CONSTRAINT `fk_gene_id1` FOREIGN KEY (`gene_id` ) REFERENCES `gene` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, KEY `symbol` (`symbol`), KEY `type` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Alternative symbols of genes'; -- Table `gene_transcript` CREATE TABLE IF NOT EXISTS `gene_transcript` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `gene_id` int(10) unsigned NOT NULL, `name` varchar(40) NOT NULL, `source` enum('ccds', 'ensembl') NOT NULL, `chromosome` enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','X','Y','MT') NOT NULL, `start_coding` int(10) unsigned NULL, `end_coding` int(10) unsigned NULL, `strand` enum('+', '-') NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_gene_id3` FOREIGN KEY (`gene_id` ) REFERENCES `gene` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE KEY `gene_name_unique` (`gene_id`, `name`), UNIQUE KEY `name` (`name`) , KEY `source` (`source`), KEY `chromosome` (`chromosome`), KEY `start_coding` (`start_coding`), KEY `end_coding` (`end_coding`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Gene transcipts'; -- Table `gene_exon` CREATE TABLE IF NOT EXISTS `gene_exon` ( `transcript_id` int(10) unsigned NOT NULL, `start` int(10) unsigned NOT NULL, `end` int(10) unsigned NOT NULL, KEY `fk_transcript_id2` (`transcript_id` ASC) , CONSTRAINT `fk_transcript_id2` FOREIGN KEY (`transcript_id` ) REFERENCES `gene_transcript` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, KEY `start` (`start`), KEY `end` (`end`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Transcript exons'; -- Table `geneinfo_germline` CREATE TABLE IF NOT EXISTS `geneinfo_germline` ( `symbol` VARCHAR(40) NOT NULL, `inheritance` ENUM('AR','AD','AR+AD','XLR','XLD','XLR+XLD','MT','MU','n/a') NOT NULL, `gnomad_oe_syn` FLOAT NULL, `gnomad_oe_mis` FLOAT NULL, `gnomad_oe_lof` FLOAT NULL, `comments` text NOT NULL, PRIMARY KEY `symbol` (`symbol`) ) ENGINE=InnoDB CHARSET=utf8; -- Table `mid` CREATE TABLE IF NOT EXISTS `mid` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `sequence` VARCHAR(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `genome` CREATE TABLE IF NOT EXISTS `genome` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `build` VARCHAR(45) NOT NULL, `comment` TEXT NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `build_UNIQUE` (`build` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `processing_system` CREATE TABLE IF NOT EXISTS `processing_system` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name_short` VARCHAR(50) NOT NULL, `name_manufacturer` VARCHAR(100) NOT NULL, `adapter1_p5` VARCHAR(45) NULL DEFAULT NULL, `adapter2_p7` VARCHAR(45) NULL DEFAULT NULL, `type` ENUM('WGS','WGS (shallow)','WES','Panel','Panel Haloplex','Panel MIPs','RNA','ChIP-Seq', 'cfDNA (patient-specific)', 'cfDNA') NOT NULL, `shotgun` TINYINT(1) NOT NULL, `umi_type` ENUM('n/a','HaloPlex HS','SureSelect HS','ThruPLEX','Safe-SeqS','MIPs','QIAseq','IDT-UDI-UMI','IDT-xGen-Prism') NOT NULL DEFAULT 'n/a', `target_file` VARCHAR(255) NULL DEFAULT NULL COMMENT 'filename of sub-panel BED file relative to the megSAP enrichment folder.', `genome_id` INT(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_short` (`name_short` ASC), UNIQUE INDEX `name_manufacturer` (`name_manufacturer` ASC), INDEX `<API key>` (`genome_id` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`genome_id`) REFERENCES `genome` (`id`) ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `device` CREATE TABLE IF NOT EXISTS `device` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `type` ENUM('GAIIx','MiSeq','HiSeq2500','NextSeq500','NovaSeq5000','NovaSeq6000','MGI-2000','SequelII','PromethION') NOT NULL, `name` VARCHAR(45) NOT NULL, `comment` TEXT NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `sequencing_run` CREATE TABLE IF NOT EXISTS `sequencing_run` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `fcid` VARCHAR(45) NULL DEFAULT NULL, `flowcell_type` ENUM('Illumina MiSeq v2','Illumina MiSeq v2 Micro','Illumina MiSeq v2 Nano','Illumina MiSeq v3','Illumina NextSeq High Output','Illumina NextSeq Mid Output','Illumina NovaSeq SP','Illumina NovaSeq S1','Illumina NovaSeq S2','Illumina NovaSeq S4','PromethION FLO-PRO002','SMRTCell 8M','n/a') NOT NULL DEFAULT 'n/a', `start_date` DATE NULL DEFAULT NULL, `end_date` DATE NULL DEFAULT NULL, `device_id` INT(11) NOT NULL, `recipe` VARCHAR(45) NOT NULL COMMENT 'Read length for reads and index reads separated by \'+\'', `pool_molarity` float DEFAULT NULL, `<API key>` enum('n/a','Tapestation','Bioanalyzer','qPCR','Tapestation & Qubit','Bioanalyzer & Qubit','Bioanalyzer & Tecan Infinite','Fragment Analyzer & Qubit','Fragment Analyzer & Tecan Infinite','Illumina 450bp & Qubit ssDNA','PCR Size & ssDNA') NOT NULL DEFAULT 'n/a', `comment` TEXT NULL DEFAULT NULL, `quality` ENUM('n/a','good','medium','bad') NOT NULL DEFAULT 'n/a', `status` ENUM('n/a','run_started','run_finished','run_aborted','<API key>','analysis_started','analysis_finished','<API key>','<API key>') NOT NULL DEFAULT 'n/a', `backup_done` TINYINT(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC), UNIQUE INDEX `fcid_UNIQUE` (`fcid` ASC), INDEX `fk_run_device1` (`device_id` ASC), CONSTRAINT `fk_run_device1` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `runqc_read` CREATE TABLE IF NOT EXISTS `runqc_read` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `read_num` INT NOT NULL, `cycles` INT NOT NULL, `is_index` BOOLEAN NOT NULL, `q30_perc` FLOAT NOT NULL, `error_rate` FLOAT DEFAULT NULL, `sequencing_run_id` INT(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE (`sequencing_run_id`, `read_num`), INDEX `<API key>` (`sequencing_run_id` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`sequencing_run_id`) REFERENCES `sequencing_run` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `runqc_lane` CREATE TABLE IF NOT EXISTS `runqc_lane` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `lane_num` INT NOT NULL, `cluster_density` FLOAT NOT NULL, `cluster_density_pf` FLOAT NOT NULL, `yield` FLOAT NOT NULL, `error_rate` FLOAT DEFAULT NULL, `q30_perc` FLOAT NOT NULL, `occupied_perc` FLOAT DEFAULT NULL, `runqc_read_id` INT(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE (`runqc_read_id`, `lane_num`), INDEX `fk_runqc_read_id` (`runqc_read_id` ASC), CONSTRAINT `fk_runqc_read_id` FOREIGN KEY (`runqc_read_id`) REFERENCES `runqc_read` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `species` CREATE TABLE IF NOT EXISTS `species` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `sender` CREATE TABLE IF NOT EXISTS `sender` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `phone` VARCHAR(45) NULL DEFAULT NULL, `email` VARCHAR(45) NULL DEFAULT NULL, `affiliation` VARCHAR(100) NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `user` CREATE TABLE IF NOT EXISTS `user` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` VARCHAR(45) NOT NULL COMMENT 'Use the lower-case Windows domain name!', `password` VARCHAR(64) NOT NULL, `user_role` ENUM('user','admin','special') NOT NULL, `name` VARCHAR(45) NOT NULL, `email` VARCHAR(100) NOT NULL, `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_login` DATETIME NULL DEFAULT NULL, `active` TINYINT(1) DEFAULT 1 NOT NULL, `salt` VARCHAR(40) NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`user_id` ASC), UNIQUE INDEX `email_UNIQUE` (`email` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `sample` CREATE TABLE IF NOT EXISTS `sample` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(20) NOT NULL, `name_external` VARCHAR(255) NULL DEFAULT NULL COMMENT 'External names.<br>If several, separate by comma!<br>Always enter full names, no short forms!', `received` DATE NULL DEFAULT NULL, `receiver_id` INT(11) NULL DEFAULT NULL, `sample_type` ENUM('DNA','DNA (amplicon)','DNA (native)','RNA','cfDNA') NOT NULL, `species_id` INT(11) NOT NULL, `concentration` FLOAT NULL DEFAULT NULL, `volume` FLOAT NULL DEFAULT NULL, `od_260_280` FLOAT NULL DEFAULT NULL, `gender` ENUM('male','female','n/a') NOT NULL, `comment` TEXT NULL DEFAULT NULL, `quality` ENUM('n/a','good','medium','bad') NOT NULL DEFAULT 'n/a', `od_260_230` FLOAT NULL DEFAULT NULL, `integrity_number` FLOAT NULL DEFAULT NULL, `tumor` TINYINT(1) NOT NULL, `ffpe` TINYINT(1) NOT NULL, `sender_id` INT(11) NOT NULL, `disease_group` ENUM('n/a','Neoplasms','Diseases of the blood or blood-forming organs','Diseases of the immune system','Endocrine, nutritional or metabolic diseases','Mental, behavioural or neurodevelopmental disorders','Sleep-wake disorders','Diseases of the nervous system','Diseases of the visual system','Diseases of the ear or mastoid process','Diseases of the circulatory system','Diseases of the respiratory system','Diseases of the digestive system','Diseases of the skin','Diseases of the musculoskeletal system or connective tissue','Diseases of the genitourinary system','Developmental anomalies','Other diseases') NOT NULL DEFAULT 'n/a', `disease_status` ENUM('n/a','Affected','Unaffected','Unclear') NOT NULL DEFAULT 'n/a', `tissue` ENUM('n/a','Blood','Buccal mucosa','Skin') NOT NULL DEFAULT 'n/a', PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC), INDEX `fk_samples_species1` (`species_id` ASC), INDEX `sender_id` (`sender_id` ASC), INDEX `receiver_id` (`receiver_id` ASC), INDEX `name_external` (`name_external` ASC), INDEX `tumor` (`tumor` ASC), INDEX `quality` (`quality` ASC), INDEX `disease_group` (`disease_group`), INDEX `disease_status` (`disease_status`), CONSTRAINT `fk_samples_species1` FOREIGN KEY (`species_id`) REFERENCES `species` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `sample_ibfk_1` FOREIGN KEY (`sender_id`) REFERENCES `sender` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `sample_ibfk_2` FOREIGN KEY (`receiver_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `sample_disease_info` CREATE TABLE IF NOT EXISTS `sample_disease_info` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `sample_id` INT(11) NOT NULL, `disease_info` TEXT NOT NULL, `type` ENUM('HPO term id', 'ICD10 code', 'OMIM disease/phenotype identifier', 'Orpha number', 'CGI cancer type', 'tumor fraction', 'age of onset', 'clinical phenotype (free text)', 'RNA reference tissue') NOT NULL, `user_id` int(11) DEFAULT NULL, `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), CONSTRAINT `fk_sample_id` FOREIGN KEY (`sample_id`) REFERENCES `sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `sample_relations` CREATE TABLE IF NOT EXISTS `sample_relations` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `sample1_id` INT(11) NOT NULL, `relation` ENUM('parent-child', 'tumor-normal', 'siblings', 'same sample', 'tumor-cfDNA', 'same patient', 'cousins', 'twins', 'twins (monozygotic)') NOT NULL, `sample2_id` INT(11) NOT NULL, `user_id` int(11) DEFAULT NULL, `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE INDEX `relation_unique` (`sample1_id` ASC, `relation` ASC, `sample2_id` ASC), CONSTRAINT `fk_sample1_id` FOREIGN KEY (`sample1_id`) REFERENCES `sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_sample2_id` FOREIGN KEY (`sample2_id`) REFERENCES `sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_user2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `project` CREATE TABLE IF NOT EXISTS `project` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `aliases` TEXT DEFAULT NULL, `type` ENUM('diagnostic','research','test','external') NOT NULL, `<API key>` INT(11) NOT NULL COMMENT 'Person who is responsible for this project.<br>The person will be notified when new samples are available.', `comment` TEXT NULL DEFAULT NULL, `analysis` ENUM('fastq','mapping','variants') NOT NULL DEFAULT 'variants' COMMENT 'Bioinformatics analysis to be done for non-tumor germline samples in this project.<br>"fastq" skips the complete analysis.<br>"mapping" creates the BAM file but calls no variants.<br>"variants" performs the full analysis.', `preserve_fastqs` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Prevents FASTQ files from being deleted after mapping in this project.<br>Has no effect if megSAP is not configured to delete FASTQs automatically.<br>For diagnostics, do not check. For other project types ask the bioinformatician in charge.', `email_notification` varchar(200) DEFAULT NULL COMMENT 'List of email addresses (separated by semicolon) that are notified in addition to the project coordinator when new samples are available.', PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC), INDEX `<API key>` (`<API key>` ASC), CONSTRAINT `project_ibfk_1` FOREIGN KEY (`<API key>`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `processed_sample` CREATE TABLE IF NOT EXISTS `processed_sample` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `sample_id` INT(11) NOT NULL, `process_id` INT(2) NOT NULL, `sequencing_run_id` INT(11) NULL DEFAULT NULL, `lane` varchar(15) NOT NULL COMMENT 'Comma-separated lane list (1-8)', `mid1_i7` INT(11) NULL DEFAULT NULL, `mid2_i5` INT(11) NULL DEFAULT NULL, `operator_id` INT(11) NULL DEFAULT NULL, `<API key>` INT(11) NOT NULL, `comment` TEXT NULL DEFAULT NULL, `project_id` INT(11) NOT NULL, `processing_input` FLOAT NULL DEFAULT NULL, `molarity` FLOAT NULL DEFAULT NULL, `normal_id` INT(11) NULL DEFAULT NULL COMMENT 'For tumor samples, a normal sample can be given here which is used as reference sample during the data analysis.', `quality` ENUM('n/a','good','medium','bad') NOT NULL DEFAULT 'n/a', PRIMARY KEY (`id`), UNIQUE INDEX `sample_psid_unique` (`sample_id` ASC, `process_id` ASC), INDEX `<API key>` (`sample_id` ASC), INDEX `<API key>` (`mid1_i7` ASC), INDEX `<API key>` (`<API key>` ASC), INDEX `<API key>` (`sequencing_run_id` ASC), INDEX `<API key>` (`mid2_i5` ASC), INDEX `project_id` (`project_id` ASC), INDEX `operator_id` (`operator_id` ASC), INDEX `normal_id_INDEX` (`normal_id` ASC), INDEX `quality` (`quality` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`mid1_i7`) REFERENCES `mid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`mid2_i5`) REFERENCES `mid` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`<API key>`) REFERENCES `processing_system` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sequencing_run_id`) REFERENCES `sequencing_run` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`normal_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sample_id`) REFERENCES `sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`operator_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `variant` CREATE TABLE IF NOT EXISTS `variant` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start` INT(11) NOT NULL, `end` INT(11) NOT NULL, `ref` TEXT NOT NULL, `obs` TEXT NOT NULL, `1000g` FLOAT NULL DEFAULT NULL, `gnomad` FLOAT NULL DEFAULT NULL, `coding` TEXT NULL DEFAULT NULL, `comment` TEXT NULL DEFAULT NULL, `cadd` FLOAT NULL DEFAULT NULL, `spliceai` FLOAT NULL DEFAULT NULL, `germline_het` INT(11) NOT NULL DEFAULT '0', `germline_hom` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE INDEX `variant_UNIQUE` (`chr` ASC, `start` ASC, `end` ASC, `ref`(255) ASC, `obs`(255) ASC), INDEX `1000g` (`1000g` ASC), INDEX `gnomad` (`gnomad` ASC), INDEX `comment` (`comment`(50) ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `variant_publication` CREATE TABLE IF NOT EXISTS `variant_publication` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `sample_id` INT(11) NOT NULL, `variant_id` INT(11) NOT NULL, `db` ENUM('LOVD','ClinVar') NOT NULL, `class` ENUM('1','2','3','4','5', 'M') NOT NULL, `details` TEXT NOT NULL, `user_id` INT(11) NOT NULL, `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `result` TEXT DEFAULT NULL, `replaced` BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sample_id`) REFERENCES `sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `variant_id` INT(11) NOT NULL, `class` ENUM('n/a','1','2','3','4','5','M') NOT NULL, `comment` TEXT NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `<API key>` (`variant_id`), CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, INDEX `class` (`class` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(11) NOT NULL AUTO_INCREMENT, `variant_id` int(11) NOT NULL, `class` ENUM('n/a','activating','likely_activating','inactivating','likely_inactivating','unclear','test_dependent') NOT NULL, `comment` TEXT, PRIMARY KEY (`id`), UNIQUE KEY `<API key>` (`variant_id`), CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(11) NOT NULL AUTO_INCREMENT, `variant_id` int(11) NOT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `known_oncogenic_aa` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `weak_cancerhotspot` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `very_high_maf` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `high_maf` BOOLEAN NULL DEFAULT NULL, `<API key>` BOOLEAN NULL DEFAULT NULL, `synonymous_mutation` BOOLEAN NULL DEFAULT NULL, `comment` TEXT NULL DEFAULT NULL, `created_by` int(11) DEFAULT NULL, `created_date` DATETIME NOT NULL, `last_edit_by` int(11) DEFAULT NULL, `last_edit_date` TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `<API key>` (`variant_id`), CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`last_edit_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `somatic_gene_role` CREATE TABLE IF NOT EXISTS `somatic_gene_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `symbol` VARCHAR(40) NOT NULL, `gene_role` ENUM('activating','loss_of_function', 'ambiguous') NOT NULL, `high_evidence` BOOLEAN DEFAULT FALSE, `comment` TEXT NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY (`symbol`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `detected_variant` CREATE TABLE IF NOT EXISTS `detected_variant` ( `processed_sample_id` INT(11) NOT NULL, `variant_id` INT(11) NOT NULL, `genotype` ENUM('hom','het') NOT NULL, PRIMARY KEY (`processed_sample_id`, `variant_id`), INDEX `<API key>` (`variant_id` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `qc_terms` CREATE TABLE IF NOT EXISTS `qc_terms` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `qcml_id` VARCHAR(10) NULL DEFAULT NULL, `name` VARCHAR(45) NOT NULL, `description` TEXT NOT NULL, `type` ENUM('float', 'int', 'string') NOT NULL, `obsolete` TINYINT(1) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC), UNIQUE INDEX `qcml_id_UNIQUE` (`qcml_id` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `processed_sample_qc` CREATE TABLE IF NOT EXISTS `processed_sample_qc` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `processed_sample_id` INT(11) NOT NULL, `qc_terms_id` INT(11) NOT NULL, `value` TEXT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `<API key>` (`processed_sample_id` ASC, `qc_terms_id` ASC), INDEX `<API key>` (`processed_sample_id` ASC), INDEX `<API key>` (`qc_terms_id` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`qc_terms_id`) REFERENCES `qc_terms` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `sample_group` CREATE TABLE IF NOT EXISTS `sample_group` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `comment` TEXT NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `sample_group_id` INT(11) NOT NULL, `sample_id` INT(11) NOT NULL, PRIMARY KEY (`id`), INDEX `<API key>` (`sample_id` ASC), INDEX `<API key>` (`sample_group_id` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`sample_id`) REFERENCES `sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sample_group_id`) REFERENCES `sample_group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `<API key>` INT(11) NOT NULL, `<API key>` INT(11) NULL DEFAULT NULL, `variant_id` INT(11) NOT NULL, `variant_frequency` FLOAT NOT NULL, `depth` INT(11) NOT NULL, `quality_snp` FLOAT NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `<API key>` (`<API key>` ASC, `<API key>` ASC, `variant_id` ASC), INDEX `variant_id_INDEX` (`variant_id` ASC), INDEX `<API key>` (`<API key>` ASC), INDEX `<API key>` (`<API key>` ASC), INDEX `fk_dsv_has_ps1` (`<API key>` ASC), INDEX `fk_dsv_has_ps2` (`<API key>` ASC), CONSTRAINT `fk_dsv_has_ps1` FOREIGN KEY (`<API key>`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_dsv_has_ps2` FOREIGN KEY (`<API key>`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_dsv_has_v` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `diag_status` CREATE TABLE IF NOT EXISTS `diag_status` ( `processed_sample_id` INT(11) NOT NULL, `status` ENUM('pending','in progress','done','done - follow up pending','cancelled','not usable because of data quality') NOT NULL, `user_id` INT(11) NOT NULL, `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `outcome` ENUM('n/a','no significant findings','uncertain','significant findings','significant findings - second method', 'significant findings - non-genetic', 'candidate gene') NOT NULL DEFAULT 'n/a', `comment` TEXT NULL DEFAULT NULL, PRIMARY KEY (`processed_sample_id`), INDEX `user_id` (`user_id` ASC), CONSTRAINT `diag_status_ibfk_1` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `diag_status_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `kasp_status` CREATE TABLE IF NOT EXISTS `kasp_status` ( `processed_sample_id` INT(11) NOT NULL, `random_error_prob` FLOAT UNSIGNED NOT NULL, `snps_evaluated` INT(10) UNSIGNED NOT NULL, `snps_match` INT(10) UNSIGNED NOT NULL, PRIMARY KEY (`processed_sample_id`), CONSTRAINT `processed_sample0` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `hpo_term` CREATE TABLE IF NOT EXISTS `hpo_term` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `hpo_id` VARCHAR(10) NOT NULL, `name` TEXT NOT NULL, `definition` TEXT NOT NULL, `synonyms` TEXT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `hpo_id` (`hpo_id` ASC), INDEX `name` (`name`(100) ASC), INDEX `synonyms` (`synonyms`(100) ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `hpo_genes` CREATE TABLE IF NOT EXISTS `hpo_genes` ( `hpo_term_id` INT(10) UNSIGNED NOT NULL, `gene` VARCHAR(40) CHARACTER SET 'utf8' NOT NULL, `details` TEXT COMMENT 'Semicolon seperated pairs of database sources with evidences of where the connection was found (Source, Original Evidence, Evidence translated; Source2, ....)', `evidence` ENUM('n/a','low','medium','high') NOT NULL DEFAULT 'n/a', PRIMARY KEY (`hpo_term_id`, `gene`), CONSTRAINT `hpo_genes_ibfk_1` FOREIGN KEY (`hpo_term_id`) REFERENCES `hpo_term` (`id`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `hpo_parent` CREATE TABLE IF NOT EXISTS `hpo_parent` ( `parent` INT(10) UNSIGNED NOT NULL, `child` INT(10) UNSIGNED NOT NULL, PRIMARY KEY (`parent`, `child`), INDEX `child` (`child` ASC), CONSTRAINT `hpo_parent_ibfk_2` FOREIGN KEY (`child`) REFERENCES `hpo_term` (`id`), CONSTRAINT `hpo_parent_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `hpo_term` (`id`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `analysis_job` CREATE TABLE IF NOT EXISTS `analysis_job` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `type` enum('single sample','multi sample','trio','somatic') NOT NULL, `high_priority` TINYINT(1) NOT NULL, `args` text NOT NULL, `sge_id` varchar(10) DEFAULT NULL, `sge_queue` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Table `analysis_job_sample` CREATE TABLE IF NOT EXISTS `analysis_job_sample` ( `id` int(11) NOT NULL AUTO_INCREMENT, `analysis_job_id` int(11) NOT NULL, `processed_sample_id` int(11) NOT NULL, `info` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_analysis_job_id` FOREIGN KEY (`analysis_job_id` ) REFERENCES `analysis_job` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id` ) REFERENCES `processed_sample` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(11) NOT NULL AUTO_INCREMENT, `analysis_job_id` int(11) NOT NULL, `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `user_id` int(11) DEFAULT NULL, `status` enum('queued','started','finished','cancel','canceled','error') NOT NULL, `output` text DEFAULT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_analysis_job_id2` FOREIGN KEY (`analysis_job_id` ) REFERENCES `analysis_job` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_user_id2` FOREIGN KEY (`user_id` ) REFERENCES `user` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Table `omim_gene` CREATE TABLE IF NOT EXISTS `omim_gene` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `gene` VARCHAR(40) CHARACTER SET 'utf8' NOT NULL, `mim` VARCHAR(10) CHARACTER SET 'utf8' NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mim_unique` (`mim`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `omim_phenotype` CREATE TABLE IF NOT EXISTS `omim_phenotype` ( `omim_gene_id` INT(11) UNSIGNED NOT NULL, `phenotype` VARCHAR(255) CHARACTER SET 'utf8' NOT NULL, PRIMARY KEY (`omim_gene_id`, `phenotype`), CONSTRAINT `omim_gene_id_FK` FOREIGN KEY (`omim_gene_id` ) REFERENCES `omim_gene` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `gene` VARCHAR(40) CHARACTER SET 'utf8' NOT NULL, `disease_group` ENUM('Neoplasms','Diseases of the blood or blood-forming organs','Diseases of the immune system','Endocrine, nutritional or metabolic diseases','Mental, behavioural or neurodevelopmental disorders','Sleep-wake disorders','Diseases of the nervous system','Diseases of the visual system','Diseases of the ear or mastoid process','Diseases of the circulatory system','Diseases of the respiratory system','Diseases of the digestive system','Diseases of the skin','Diseases of the musculoskeletal system or connective tissue','Diseases of the genitourinary system','Developmental anomalies','Other diseases') NOT NULL, `phenotype_accession` VARCHAR(6) CHARACTER SET 'utf8' NOT NULL, PRIMARY KEY (`gene`,`disease_group`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `processed_sample_id` INT(11) NOT NULL, `merged_into` INT(11) NOT NULL, PRIMARY KEY (`processed_sample_id`), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`merged_into`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ps_tumor_id` int(11) NOT NULL, `ps_normal_id` int(11) NOT NULL, `created_by` int(11) NOT NULL, `created_date` DATETIME NOT NULL, `last_edit_by` int(11) DEFAULT NULL, `last_edit_date` timestamp NULL DEFAULT NULL, `mtb_xml_upload_date` timestamp NULL DEFAULT NULL, `target_file` VARCHAR(255) NULL DEFAULT NULL COMMENT 'filename of sub-panel BED file without path', `tum_content_max_af` BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'include tumor content calculated by median value maximum allele frequency', `<API key>` BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'include tumor content calculated by maximum CNV clonality', `tum_content_hist` BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'include histological tumor content estimate ', `msi_status` BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'include microsatellite instability status', `cnv_burden` BOOLEAN NOT NULL DEFAULT FALSE, `hrd_score` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'homologous recombination deficiency score, determined manually by user', `hrd_statement` ENUM('no proof', 'proof', 'undeterminable') NULL DEFAULT NULL COMMENT 'comment to be shown in somatic report about HRD score', `cnv_loh_count` INT(11) NULL DEFAULT NULL COMMENT 'number of somatic LOH events, determined from CNV file', `cnv_tai_count` INT(11) NULL DEFAULT NULL COMMENT 'number of somatic telomer allelic imbalance events, determined from CNV file', `cnv_lst_count` INT(11) NULL DEFAULT NULL COMMENT 'number of somatic long state transitions events, determined from CNV file', `tmb_ref_text` VARCHAR(200) NULL DEFAULT NULL COMMENT 'reference data as free text for tumor mutation burden', `quality` ENUM('no abnormalities','tumor cell content too low', 'quality of tumor DNA too low', 'DNA quantity too low', 'heterogeneous sample') NULL DEFAULT NULL COMMENT 'user comment on the quality of the DNA', `fusions_detected` BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'fusions or other SVs were detected. Cannot be determined automatically, because manta files contain too many false positives', `cin_chr` TEXT NULL DEFAULT NULL COMMENT 'comma separated list of instable chromosomes', `limitations` TEXT NULL DEFAULT NULL COMMENT 'manually created text if the analysis has special limitations', `filter` VARCHAR(255) NULL DEFAULT NULL COMMENT 'name of the variant filter', PRIMARY KEY (`id`), UNIQUE INDEX `<API key>` (`ps_tumor_id` ASC, `ps_normal_id` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`last_edit_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`ps_normal_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`ps_tumor_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARSET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(11) NOT NULL AUTO_INCREMENT, `<API key>` int(11) NOT NULL, `variant_id` int(11) NOT NULL, `exclude_artefact` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `<API key>` text DEFAULT NULL, `<API key>` text DEFAULT NULL, `comment` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`<API key>`) REFERENCES `<API key>` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `<API key>` (`<API key>` ASC, `variant_id` ASC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(11) NOT NULL AUTO_INCREMENT, `<API key>` int(11) NOT NULL, `variant_id` int(11) NOT NULL, `tum_freq` FLOAT UNSIGNED NULL DEFAULT NULL COMMENT 'frequency of this variant in the tumor sample.', `tum_depth` int(11) UNSIGNED NULL DEFAULT NULL COMMENT 'depth of this variant in the tumor sample.', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`<API key>`) REFERENCES `<API key>` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `<API key>` (`<API key>` ASC, `variant_id` ASC) ) COMMENT='variants detected in control tissue that are marked as tumor related by the user' ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Table `somatic_cnv_callset` CREATE TABLE IF NOT EXISTS `somatic_cnv_callset` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `ps_tumor_id` INT(11) NOT NULL, `ps_normal_id` INT(11) NOT NULL, `caller` ENUM('ClinCNV') NOT NULL, `caller_version` varchar(25) NOT NULL, `call_date` DATETIME NOT NULL, `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', `quality` ENUM('n/a','good','medium','bad') NOT NULL DEFAULT 'n/a', PRIMARY KEY (`id`), INDEX `caller` (`caller` ASC), INDEX `call_date` (`call_date` ASC), INDEX `quality` (`quality` ASC), UNIQUE INDEX `combo_ids` (`ps_tumor_id` ASC, `ps_normal_id` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`ps_normal_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`ps_tumor_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='somatic CNV call set'; -- Table `somatic_cnv` CREATE TABLE IF NOT EXISTS `somatic_cnv` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `<API key>` INT(11) UNSIGNED NOT NULL, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start` INT(11) UNSIGNED NOT NULL, `end` INT(11) UNSIGNED NOT NULL, `cn` FLOAT UNSIGNED NOT NULL COMMENT 'copy-number change in whole sample, including normal parts', `tumor_cn` INT(11) UNSIGNED NOT NULL COMMENT 'copy-number change normalized to tumor tissue only', `tumor_clonality` FLOAT NOT NULL COMMENT 'tumor clonality, i.e. fraction of tumor cells', `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`<API key>`) REFERENCES `somatic_cnv_callset` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` UNIQUE(`<API key>`,`chr`,`start`,`end`), INDEX `chr` (`chr` ASC), INDEX `start` (`start` ASC), INDEX `end` (`end` ASC), INDEX `tumor_cn` (`tumor_cn` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='somatic CNV'; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(11) NOT NULL AUTO_INCREMENT, `<API key>` int(11) NOT NULL, `somatic_cnv_id` int(11) UNSIGNED NOT NULL, `exclude_artefact` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `comment` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`<API key>`) REFERENCES `<API key>` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`somatic_cnv_id`) REFERENCES `somatic_cnv` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `<API key>` (`<API key>` ASC, `somatic_cnv_id` ASC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `processed_sample_id` INT(11) NOT NULL, `created_by` int(11) NOT NULL, `created_date` DATETIME NOT NULL, `last_edit_by` int(11) DEFAULT NULL, `last_edit_date` TIMESTAMP NULL DEFAULT NULL, `finalized_by` int(11) DEFAULT NULL, `finalized_date` TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `<API key>` (`processed_sample_id`), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id` ) REFERENCES `processed_sample` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`last_edit_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`finalized_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `<API key>` INT(11) NOT NULL, `variant_id` INT(11) NOT NULL, `type` ENUM('diagnostic variant', 'candidate variant', 'incidental finding') NOT NULL, `causal` BOOLEAN NOT NULL, `inheritance` ENUM('n/a', 'AR','AD','XLR','XLD','MT') NOT NULL, `de_novo` BOOLEAN NOT NULL, `mosaic` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `exclude_artefact` BOOLEAN NOT NULL, `exclude_frequency` BOOLEAN NOT NULL, `exclude_phenotype` BOOLEAN NOT NULL, `exclude_mechanism` BOOLEAN NOT NULL, `exclude_other` BOOLEAN NOT NULL, `comments` text NOT NULL, `comments2` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`<API key>` ) REFERENCES `<API key>` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `<API key>` (`<API key>` ASC, `variant_id` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `disease_term` CREATE TABLE IF NOT EXISTS `disease_term` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `source` ENUM('OrphaNet') NOT NULL, `identifier` VARCHAR(40) CHARACTER SET 'utf8' NOT NULL, `name` TEXT CHARACTER SET 'utf8' NOT NULL, `synonyms` TEXT CHARACTER SET 'utf8' DEFAULT NULL, PRIMARY KEY (`id`), INDEX `disease_source` (`source` ASC), UNIQUE KEY `disease_id` (`identifier`), INDEX `disease_name` (`name`(50) ASC), INDEX `disease_synonyms` (`synonyms`(50) ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `disease_gene` CREATE TABLE IF NOT EXISTS `disease_gene` ( `disease_term_id` INT(11) UNSIGNED NOT NULL, `gene` VARCHAR(40) CHARACTER SET 'utf8' NOT NULL, PRIMARY KEY (`disease_term_id`, `gene`), CONSTRAINT `<API key>` FOREIGN KEY (`disease_term_id`) REFERENCES `disease_term` (`id`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `cnv_callset` CREATE TABLE IF NOT EXISTS `cnv_callset` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `processed_sample_id` INT(11) NOT NULL, `caller` ENUM('CnvHunter', 'ClinCNV') NOT NULL, `caller_version` varchar(25) NOT NULL, `call_date` DATETIME DEFAULT NULL, `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', `quality` ENUM('n/a','good','medium','bad') NOT NULL DEFAULT 'n/a', PRIMARY KEY (`id`), INDEX `caller` (`quality` ASC), INDEX `call_date` (`call_date` ASC), INDEX `quality` (`quality` ASC), UNIQUE KEY `<API key>` (`processed_sample_id`), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='germline CNV call set'; -- Table `cnv` CREATE TABLE IF NOT EXISTS `cnv` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `cnv_callset_id` INT(11) UNSIGNED NOT NULL, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start` INT(11) UNSIGNED NOT NULL, `end` INT(11) UNSIGNED NOT NULL, `cn` INT(11) UNSIGNED NOT NULL COMMENT 'copy-number', `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`cnv_callset_id`) REFERENCES `cnv_callset` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, INDEX `chr` (`chr` ASC), INDEX `start` (`start` ASC), INDEX `end` (`end` ASC), INDEX `cn` (`cn` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='germline CNV'; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `<API key>` INT(11) NOT NULL, `cnv_id` INT(11) UNSIGNED NOT NULL, `type` ENUM('diagnostic variant', 'candidate variant', 'incidental finding') NOT NULL, `causal` BOOLEAN NOT NULL, `class` ENUM('n/a','1','2','3','4','5','M') NOT NULL, `inheritance` ENUM('n/a', 'AR','AD','XLR','XLD','MT') NOT NULL, `de_novo` BOOLEAN NOT NULL, `mosaic` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `exclude_artefact` BOOLEAN NOT NULL, `exclude_frequency` BOOLEAN NOT NULL, `exclude_phenotype` BOOLEAN NOT NULL, `exclude_mechanism` BOOLEAN NOT NULL, `exclude_other` BOOLEAN NOT NULL, `comments` text NOT NULL, `comments2` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`<API key>` ) REFERENCES `<API key>` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`cnv_id`) REFERENCES `cnv` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `<API key>` (`<API key>` ASC, `cnv_id` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `sv_callset` CREATE TABLE IF NOT EXISTS `sv_callset` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `processed_sample_id` INT(11) NOT NULL, `caller` ENUM('Manta') NOT NULL, `caller_version` varchar(25) NOT NULL, `call_date` DATETIME DEFAULT NULL, PRIMARY KEY (`id`), INDEX `call_date` (`call_date` ASC), UNIQUE KEY `<API key>` (`processed_sample_id`), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='SV call set'; -- Table `sv_deletion` CREATE TABLE IF NOT EXISTS `sv_deletion` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `sv_callset_id` INT(11) UNSIGNED NOT NULL, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start_min` INT(11) UNSIGNED NOT NULL, `start_max` INT(11) UNSIGNED NOT NULL, `end_min` INT(11) UNSIGNED NOT NULL, `end_max` INT(11) UNSIGNED NOT NULL, `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`sv_callset_id`) REFERENCES `sv_callset` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, INDEX `exact_match` (`chr`, `start_min`, `start_max`, `end_min`, `end_max`), INDEX `overlap_match` (`chr`, `start_min`, `end_max`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='SV deletion'; -- Table `sv_duplication` CREATE TABLE IF NOT EXISTS `sv_duplication` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `sv_callset_id` INT(11) UNSIGNED NOT NULL, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start_min` INT(11) UNSIGNED NOT NULL, `start_max` INT(11) UNSIGNED NOT NULL, `end_min` INT(11) UNSIGNED NOT NULL, `end_max` INT(11) UNSIGNED NOT NULL, `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`sv_callset_id`) REFERENCES `sv_callset` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, INDEX `exact_match` (`chr`, `start_min`, `start_max`, `end_min`, `end_max`), INDEX `overlap_match` (`chr`, `start_min`, `end_max`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='SV duplication'; -- Table `sv_insertion` CREATE TABLE IF NOT EXISTS `sv_insertion` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `sv_callset_id` INT(11) UNSIGNED NOT NULL, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `pos`INT(11) UNSIGNED NOT NULL, `ci_lower` INT(5) UNSIGNED NOT NULL DEFAULT 0, `ci_upper` INT(5) UNSIGNED NOT NULL, `inserted_sequence` TEXT DEFAULT NULL, `known_left` TEXT DEFAULT NULL, `known_right` TEXT DEFAULT NULL, `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`sv_callset_id`) REFERENCES `sv_callset` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, INDEX `match` (`chr`, `pos`, `ci_upper`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='SV insertion'; -- Table `sv_inversion` CREATE TABLE IF NOT EXISTS `sv_inversion` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `sv_callset_id` INT(11) UNSIGNED NOT NULL, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start_min` INT(11) UNSIGNED NOT NULL, `start_max` INT(11) UNSIGNED NOT NULL, `end_min` INT(11) UNSIGNED NOT NULL, `end_max` INT(11) UNSIGNED NOT NULL, `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`sv_callset_id`) REFERENCES `sv_callset` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, INDEX `exact_match` (`chr`, `start_min`, `start_max`, `end_min`, `end_max`), INDEX `overlap_match` (`chr`, `start_min`, `end_max`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='SV inversion'; -- Table `sv_translocation` CREATE TABLE IF NOT EXISTS `sv_translocation` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `sv_callset_id` INT(11) UNSIGNED NOT NULL, `chr1` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start1` INT(11) UNSIGNED NOT NULL, `end1` INT(11) UNSIGNED NOT NULL, `chr2` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start2` INT(11) UNSIGNED NOT NULL, `end2` INT(11) UNSIGNED NOT NULL, `quality_metrics` TEXT DEFAULT NULL COMMENT 'quality metrics as JSON key-value array', PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`sv_callset_id`) REFERENCES `sv_callset` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, INDEX `match` (`chr1`, `start1`, `end1`, `chr2`, `start2`, `end2`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COMMENT='SV translocation'; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `<API key>` INT(11) NOT NULL, `sv_deletion_id` INT(11) UNSIGNED DEFAULT NULL, `sv_duplication_id` INT(11) UNSIGNED DEFAULT NULL, `sv_insertion_id` INT(11) UNSIGNED DEFAULT NULL, `sv_inversion_id` INT(11) UNSIGNED DEFAULT NULL, `sv_translocation_id` INT(11) UNSIGNED DEFAULT NULL, `type` ENUM('diagnostic variant', 'candidate variant', 'incidental finding') NOT NULL, `causal` BOOLEAN NOT NULL, `class` ENUM('n/a','1','2','3','4','5','M') NOT NULL, `inheritance` ENUM('n/a', 'AR','AD','XLR','XLD','MT') NOT NULL, `de_novo` BOOLEAN NOT NULL, `mosaic` BOOLEAN NOT NULL, `<API key>` BOOLEAN NOT NULL, `exclude_artefact` BOOLEAN NOT NULL, `exclude_frequency` BOOLEAN NOT NULL, `exclude_phenotype` BOOLEAN NOT NULL, `exclude_mechanism` BOOLEAN NOT NULL, `exclude_other` BOOLEAN NOT NULL, `comments` text NOT NULL, `comments2` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`<API key>` ) REFERENCES `<API key>` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_deletion_id`) REFERENCES `sv_deletion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_duplication_id`) REFERENCES `sv_duplication` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_insertion_id`) REFERENCES `sv_insertion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_inversion_id`) REFERENCES `sv_inversion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_translocation_id`) REFERENCES `sv_translocation` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `<API key>` (`<API key>` ASC, `sv_deletion_id` ASC, `sv_duplication_id` ASC, `sv_insertion_id` ASC, `sv_inversion_id` ASC, `sv_translocation_id` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `processed_sample_id` INT(11) NOT NULL, `dna_rna_id` TEXT CHARACTER SET 'utf8' DEFAULT NULL, `reviewer1` INT NOT NULL, `review_date1` DATE NOT NULL, `reviewer2` INT NOT NULL, `review_date2` DATE NOT NULL, `analysis_scope` TEXT CHARACTER SET 'utf8' DEFAULT NULL, `acmg_requested` BOOLEAN DEFAULT FALSE NOT NULL, `acmg_analyzed` BOOLEAN DEFAULT FALSE NOT NULL, `acmg_noticeable` BOOLEAN DEFAULT FALSE NOT NULL, `<API key>` BOOLEAN DEFAULT FALSE NOT NULL, `<API key>` BOOLEAN DEFAULT FALSE NOT NULL, `filtered_by_mito` BOOLEAN DEFAULT FALSE NOT NULL, `filtered_by_x_chr` BOOLEAN DEFAULT FALSE NOT NULL, `filtered_by_cnv` BOOLEAN DEFAULT FALSE NOT NULL, `filtered_by_svs` BOOLEAN DEFAULT FALSE NOT NULL, `filtered_by_res` BOOLEAN DEFAULT FALSE NOT NULL, `filtered_by_mosaic` BOOLEAN DEFAULT FALSE NOT NULL, `<API key>` BOOLEAN DEFAULT FALSE NOT NULL, `<API key>` BOOLEAN DEFAULT FALSE NOT NULL, `<API key>` BOOLEAN DEFAULT FALSE NOT NULL, `<API key>` BOOLEAN DEFAULT FALSE NOT NULL, PRIMARY KEY (`id`), INDEX `processed_sample_id` (`processed_sample_id` ASC), UNIQUE KEY `<API key>` (`processed_sample_id`), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`reviewer1`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`reviewer2`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` varchar(40) NOT NULL, `added_by` INT(11) NOT NULL, `added_date` timestamp NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `<API key>` (`name` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`added_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@<API key>; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; -- Table `variant_validation` CREATE TABLE IF NOT EXISTS `variant_validation` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` INT(11) NOT NULL, `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `sample_id` INT(11) NOT NULL, `variant_type` ENUM('SNV_INDEL', 'CNV', 'SV') NOT NULL, `variant_id` INT(11) DEFAULT NULL, `cnv_id` INT(11) UNSIGNED DEFAULT NULL, `sv_deletion_id` INT(11) UNSIGNED DEFAULT NULL, `sv_duplication_id` INT(11) UNSIGNED DEFAULT NULL, `sv_insertion_id` INT(11) UNSIGNED DEFAULT NULL, `sv_inversion_id` INT(11) UNSIGNED DEFAULT NULL, `sv_translocation_id` INT(11) UNSIGNED DEFAULT NULL, `genotype` ENUM('hom','het') DEFAULT NULL, `validation_method` ENUM('Sanger sequencing', 'breakpoint PCR', 'qPCR', 'MLPA', 'Array', 'shallow WGS', 'fragment length analysis', 'n/a') NOT NULL DEFAULT 'n/a', `status` ENUM('n/a','to validate','to segregate','for reporting','true positive','false positive','wrong genotype') NOT NULL DEFAULT 'n/a', `comment` TEXT NULL DEFAULT NULL, PRIMARY KEY (`id`), INDEX `fk_user_id` (`user_id` ASC), CONSTRAINT `vv_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sample_id`) REFERENCES `sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`cnv_id`) REFERENCES `cnv` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_deletion_id`) REFERENCES `sv_deletion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_duplication_id`) REFERENCES `sv_duplication` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_insertion_id`) REFERENCES `sv_insertion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_inversion_id`) REFERENCES `sv_inversion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`sv_translocation_id`) REFERENCES `sv_translocation` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `<API key>` (`sample_id`, `variant_id`, `cnv_id`, `sv_deletion_id`, `sv_duplication_id`, `sv_insertion_id`, `sv_inversion_id`, `sv_translocation_id`), INDEX `status` (`status` ASC), INDEX `variant_type` (`variant_type` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `study` CREATE TABLE IF NOT EXISTS `study` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `study_sample` CREATE TABLE IF NOT EXISTS `study_sample` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `study_id` INT(11) NOT NULL, `processed_sample_id` INT(11) NOT NULL, `<API key>` VARCHAR(50) DEFAULT NULL, PRIMARY KEY (`id`), CONSTRAINT `<API key>` FOREIGN KEY (`study_id`) REFERENCES `study` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE INDEX `unique_sample_ps` (`study_id`, `processed_sample_id`), INDEX `<API key>` (`<API key>` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `secondary_analysis` CREATE TABLE IF NOT EXISTS `secondary_analysis` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `type` enum('multi sample','trio','somatic') NOT NULL, `gsvar_file` VARCHAR(1000) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `unique_gsvar` (`gsvar_file`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `gaps` CREATE TABLE IF NOT EXISTS `gaps` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start` INT(11) UNSIGNED NOT NULL, `end` INT(11) UNSIGNED NOT NULL, `processed_sample_id` INT(11) NOT NULL, `status` enum('checked visually','to close','in progress','closed','canceled') NOT NULL, `history` TEXT, PRIMARY KEY (`id`), INDEX `gap_index` (`chr` ASC, `start` ASC, `end` ASC), INDEX `processed_sample_id` (`processed_sample_id` ASC), INDEX `status` (`status` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `parent_gene_id` int(10) unsigned NOT NULL, `pseudogene_gene_id` int(10) unsigned DEFAULT NULL, `gene_name` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_parent_gene_id` FOREIGN KEY (`parent_gene_id` ) REFERENCES `gene` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`pseudogene_gene_id` ) REFERENCES `gene` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, UNIQUE KEY `<API key>` (`parent_gene_id`, `pseudogene_gene_id`, `gene_name`), INDEX `parent_gene_id` (`parent_gene_id` ASC), INDEX `pseudogene_gene_id` (`pseudogene_gene_id` ASC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Gene-Pseudogene relation'; -- Table `<API key>` CREATE TABLE IF NOT EXISTS `<API key>` ( `processed_sample_id` INT(11) NOT NULL, `num_snps` INT(11) NOT NULL, `score_afr` FLOAT NOT NULL, `score_eur` FLOAT NOT NULL, `score_sas` FLOAT NOT NULL, `score_eas` FLOAT NOT NULL, `population` enum('AFR','EUR','SAS','EAS','ADMIXED/UNKNOWN') NOT NULL, PRIMARY KEY (`processed_sample_id`), CONSTRAINT `<API key>` FOREIGN KEY (`processed_sample_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `subpanels` CREATE TABLE IF NOT EXISTS `subpanels` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` varchar(200) NOT NULL, `created_by` int(11) DEFAULT NULL, `created_date` DATE NOT NULL, `mode` ENUM('exon', 'gene') NOT NULL, `extend` INT(11) NOT NULL, `genes` MEDIUMTEXT NOT NULL, `roi` MEDIUMTEXT NOT NULL, `archived` TINYINT(1) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), INDEX(`created_by`), INDEX(`created_date`), INDEX(`archived`), CONSTRAINT `<API key>` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `cfdna_panels` CREATE TABLE IF NOT EXISTS `cfdna_panels` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `tumor_id` INT(11) NOT NULL, `cfdna_id` INT(11) DEFAULT NULL, `created_by` INT(11) DEFAULT NULL, `created_date` DATE NOT NULL, `<API key>` INT(11) NOT NULL, `bed` MEDIUMTEXT NOT NULL, `vcf` MEDIUMTEXT NOT NULL, `excluded_regions` MEDIUMTEXT DEFAULT NULL, PRIMARY KEY (`id`), INDEX(`created_by`), INDEX(`created_date`), INDEX(`tumor_id`), UNIQUE `unique_cfdna_panel`(`tumor_id`, `<API key>`), CONSTRAINT `<API key>` FOREIGN KEY (`tumor_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`cfdna_id`) REFERENCES `processed_sample` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `<API key>` FOREIGN KEY (`<API key>`) REFERENCES `processing_system` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `cfdna_panel_genes` CREATE TABLE IF NOT EXISTS `cfdna_panel_genes` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `gene_name` VARCHAR(40) CHARACTER SET 'utf8' NOT NULL, `chr` ENUM('chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','chr21','chr22','chrY','chrX','chrMT') NOT NULL, `start` INT(11) UNSIGNED NOT NULL, `end` INT(11) UNSIGNED NOT NULL, `date` DATE NOT NULL, `bed` MEDIUMTEXT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX(`gene_name`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; -- Table `variant_literature` CREATE TABLE IF NOT EXISTS `variant_literature` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `variant_id` INT(11) NOT NULL, `pubmed` VARCHAR(12) CHARACTER SET 'utf8' NOT NULL, PRIMARY KEY (`id`), INDEX(`variant_id`), UNIQUE INDEX `<API key>` (`variant_id` ASC, `pubmed` ASC), CONSTRAINT `<API key>` FOREIGN KEY (`variant_id`) REFERENCES `variant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;
#ifndef ABSTRACTTRANSFORM_H #define ABSTRACTTRANSFORM_H #include <new> #include <mfapi.h> #include <mftransform.h> #include <mfidl.h> #include <mferror.h> #include <strsafe.h> #include <assert.h> // Note: The Direct2D helper library is included for its 2D matrix operations. #include <D2d1helper.h> #include <wrl\implements.h> #include <wrl\module.h> #include <windows.media.h> #include <INITGUID.H> #include "Common.h" #include "Interop\MessengerInterface.h" // Forward declaration class ImageAnalyzer; class <API key>; class Settings; class CAbstractTransform : public Microsoft::WRL::RuntimeClass< Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>, ABI::Windows::Media::IMediaExtension, IMFTransform> { public: CAbstractTransform(); virtual ~CAbstractTransform(); STDMETHOD(<API key>)(); // IMediaExtension virtual STDMETHODIMP SetProperties(ABI::Windows::Foundation::Collections::IPropertySet *pConfiguration); // IMFTransform STDMETHODIMP GetStreamLimits( DWORD *pdwInputMinimum, DWORD *pdwInputMaximum, DWORD *pdwOutputMinimum, DWORD *pdwOutputMaximum ); STDMETHODIMP GetStreamCount( DWORD *pcInputStreams, DWORD *pcOutputStreams ); STDMETHODIMP GetStreamIDs( DWORD dwInputIDArraySize, DWORD *pdwInputIDs, DWORD dwOutputIDArraySize, DWORD *pdwOutputIDs ); STDMETHODIMP GetInputStreamInfo( DWORD dwInputStreamID, <API key> * pStreamInfo ); STDMETHODIMP GetOutputStreamInfo( DWORD dwOutputStreamID, <API key> * pStreamInfo ); STDMETHODIMP GetAttributes(IMFAttributes** pAttributes); STDMETHODIMP <API key>( DWORD dwInputStreamID, IMFAttributes **ppAttributes ); STDMETHODIMP <API key>( DWORD dwOutputStreamID, IMFAttributes **ppAttributes ); STDMETHODIMP DeleteInputStream(DWORD dwStreamID); STDMETHODIMP AddInputStreams( DWORD cStreams, DWORD *adwStreamIDs ); STDMETHODIMP <API key>( DWORD dwInputStreamID, DWORD dwTypeIndex, // 0-based IMFMediaType **ppType ); STDMETHODIMP <API key>( DWORD dwOutputStreamID, DWORD dwTypeIndex, // 0-based IMFMediaType **ppType ); STDMETHODIMP SetInputType( DWORD dwInputStreamID, IMFMediaType *pType, DWORD dwFlags ); STDMETHODIMP SetOutputType( DWORD dwOutputStreamID, IMFMediaType *pType, DWORD dwFlags ); STDMETHODIMP GetInputCurrentType( DWORD dwInputStreamID, IMFMediaType **ppType ); STDMETHODIMP <API key>( DWORD dwOutputStreamID, IMFMediaType **ppType ); STDMETHODIMP GetInputStatus( DWORD dwInputStreamID, DWORD *pdwFlags ); STDMETHODIMP GetOutputStatus(DWORD *pdwFlags); STDMETHODIMP SetOutputBounds( LONGLONG hnsLowerBound, LONGLONG hnsUpperBound ); STDMETHODIMP ProcessEvent( DWORD dwInputStreamID, IMFMediaEvent *pEvent ); STDMETHODIMP ProcessMessage( MFT_MESSAGE_TYPE eMessage, ULONG_PTR ulParam ); virtual STDMETHODIMP ProcessInput( DWORD dwInputStreamID, IMFSample *pSample, DWORD dwFlags ); virtual STDMETHODIMP ProcessOutput( DWORD dwFlags, DWORD cOutputBufferCount, <API key> *pOutputSamples, // one per stream DWORD *pdwStatus ); protected: // HasPendingOutput: Returns TRUE if the MFT is holding an input sample. BOOL HasPendingOutput() const { return m_pSample != NULL; } // IsValidInputStream: Returns TRUE if dwInputStreamID is a valid input stream identifier. BOOL IsValidInputStream(DWORD dwInputStreamID) const { return dwInputStreamID == 0; } // IsValidOutputStream: Returns TRUE if dwOutputStreamID is a valid output stream identifier. BOOL IsValidOutputStream(DWORD dwOutputStreamID) const { return dwOutputStreamID == 0; } HRESULT OnGetPartialType(DWORD dwTypeIndex, IMFMediaType **ppmt); HRESULT OnCheckInputType(IMFMediaType *pmt); HRESULT OnCheckOutputType(IMFMediaType *pmt); HRESULT OnCheckMediaType(IMFMediaType *pmt); void OnSetInputType(IMFMediaType *pmt); void OnSetOutputType(IMFMediaType *pmt); HRESULT OnFlush(); virtual HRESULT UpdateFormatInfo(); virtual HRESULT BeginStreaming(); virtual HRESULT EndStreaming(); virtual HRESULT OnProcessOutput(IMFMediaBuffer *pIn, IMFMediaBuffer *pOut) = 0; virtual void <API key>(const GUID subtype); protected: // Members CRITICAL_SECTION m_critSec; D2D_RECT_U m_rcDest; // Destination rectangle for the effect. // Streaming bool <API key>; IMFSample *m_pSample; // Input sample. IMFMediaType *m_pInputType; // Input media type. IMFMediaType *m_pOutputType; // Output media type. // Fomat information UINT32 <API key>; UINT32 <API key>; DWORD m_cbImageSize; // Image size, in bytes. IMFAttributes *m_pAttributes; VideoEffect::MessengerInterface ^m_messenger; ImageAnalyzer *m_imageAnalyzer; <API key> *<API key>; Settings *m_settings; GUID <API key>; }; #endif // ABSTRACTTRANSFORM_H
package com.cnpc.framework.base.service.impl; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSON; import com.cnpc.framework.base.entity.Dict; import com.cnpc.framework.base.pojo.TreeNode; import com.cnpc.framework.base.service.DictService; import com.cnpc.framework.constant.RedisConstant; import com.cnpc.framework.utils.StrUtil; import com.cnpc.framework.utils.TreeUtil; @Service("dictService") public class DictServiceImpl extends BaseServiceImpl implements DictService { @Override public List<TreeNode> getTreeData() { String key = RedisConstant.DICT_PRE+"tree"; List<TreeNode> tnlist = null; String tnStr = redisDao.get(key); if(!StrUtil.isEmpty(key)) { tnlist = JSON.parseArray(tnStr,TreeNode.class); } if (tnlist != null) { return tnlist; } else { String hql = "from Dict order by levelCode asc"; List<Dict> dicts = this.find(hql); Map<String, TreeNode> nodelist = new LinkedHashMap<String, TreeNode>(); for (Dict dict : dicts) { TreeNode node = new TreeNode(); node.setText(dict.getName()); node.setId(dict.getId()); node.setParentId(dict.getParentId()); node.setLevelCode(dict.getLevelCode()); nodelist.put(node.getId(), node); } tnlist = TreeUtil.getNodeList(nodelist); redisDao.save(key, tnlist); return tnlist; } } public List<Dict> getDictsByCode(String code) { String key = RedisConstant.DICT_PRE+ code; List dicts = redisDao.get(key, List.class); if (dicts == null) { String hql = "from Dict where code='" + code + "'"; Dict dict = this.get(hql); dicts = this.find("from Dict where parentId='" + dict.getId() + "' order by levelCode"); redisDao.add(key, dicts); return dicts; } else { return dicts; } } @Override public List<TreeNode> getTreeDataByCode(String code) { String key = RedisConstant.DICT_PRE + code + "s"; List<TreeNode> tnlist = null; String tnStr = redisDao.get(key); if(!StrUtil.isEmpty(key)) { tnlist = JSON.parseArray(tnStr,TreeNode.class); } if (tnlist != null) { return tnlist; } else { String hql = "from Dict where code='" + code + "' order by levelCode asc"; List<Dict> dicts = this.find(hql); hql = "from Dict where code='" + code + "' or parent_id = '" +dicts.get(0).getId()+ "' order by levelCode asc"; dicts = this.find(hql); Map<String, TreeNode> nodelist = new LinkedHashMap<String, TreeNode>(); for (Dict dict : dicts) { TreeNode node = new TreeNode(); node.setText(dict.getName()); node.setId(dict.getId()); node.setParentId(dict.getParentId()); node.setLevelCode(dict.getLevelCode()); nodelist.put(node.getId(), node); } tnlist = TreeUtil.getNodeList(nodelist); redisDao.save(key, tnlist); return tnlist; } } @Override public List<TreeNode> getMeasureTreeData() { String hql = "from Dict WHERE (levelCode LIKE '000026%' OR levelCode LIKE '000027%') order by levelCode asc"; List<Dict> funcs = this.find(hql); Map<String, TreeNode> nodelist = new LinkedHashMap<String, TreeNode>(); for (Dict dict : funcs) { TreeNode node = new TreeNode(); node.setText(dict.getName()); node.setId(dict.getId()); node.setParentId(dict.getParentId()); node.setLevelCode(dict.getLevelCode()); nodelist.put(node.getId(), node); } return TreeUtil.getNodeList(nodelist); } }
#!/bin/bash DATESTR=$(date +"%Y%m%d%H%M%S") LOCAL_BACKUP_DIR=/home/rails/db_backups/dsi function fetch_ntriples() { FILE_NAME="$LOCAL_BACKUP_DIR/$1" GRAPH_URI=$2 SOURCE_URI=http://46.4.78.148/dsi/data?graph=$GRAPH_URI curl -s -H "Accept:text/plain" -f -o $FILE_NAME $SOURCE_URI CURL_STATUS=$? if [ $CURL_STATUS -ne 0 ]; then echo "Failed to fetch URL with curl: $SOURCE_URI" echo "Backup Failed to Complete." exit 1 fi gzip $FILE_NAME echo "Downloaded & Gzipped triples to $FILE_NAME" } function upload_to_s3() { FNAME=$1 FILE_NAME="$LOCAL_BACKUP_DIR/$FNAME.gz" s3cmd put -P $FILE_NAME s3://digitalsocial-dumps S3_STATUS=$? if [ $S3_STATUS -ne 0 ]; then echo "Failed to put backup on S3" echo "Backup Failed to Complete." exit 2 fi echo "Copied $FILE_NAME to S3" } # For backup purposes function set_modified_date() { query=`printf 'WITH <http://data.digitalsocial.eu/graph/<API key>/metadata> DELETE {?ds <http://purl.org/dc/terms/modified> ?mod} INSERT {?ds <http://purl.org/dc/terms/modified> "%s"^^<http://www.w3.org/2001/XMLSchema#dateTime>} WHERE { GRAPH <http://data.digitalsocial.eu/graph/<API key>/metadata> { ?ds a <http://publishmydata.com/def/dataset#Dataset> . OPTIONAL {?ds <http://purl.org/dc/terms/modified> ?mod} } }' $DATESTR` curl -s -f -d "request=$query" http://46.4.78.148/dsi/update > /dev/null CURL_STATUS=$? if [ $CURL_STATUS -ne 0 ]; then echo "Failed to update modified date" echo "Backup Failed to Complete." exit 3 fi echo "Modification Date Set" } function remove_dsi_backup() { FNAME=$1 rm $FNAME echo "Removed old local backup: $FNAME" } export -f remove_dsi_backup # export the function so we can use it with find function remove_old_backups() { # NOTE the crazy syntax for calling an exported function and # passing an arg to find -exec. find $LOCAL_BACKUP_DIR -mtime +14 -exec bash -c 'remove_dsi_backup "$0"' {} \; } MAIN_DATA_SET="<API key>$DATESTR.nt" ACTIVITY_TYPES="<API key>$DATESTR.nt" <API key>="<API key>$DATESTR.nt" AREA_OF_SOCIETY="<API key>$DATESTR.nt" fetch_ntriples $MAIN_DATA_SET "http%3A%2F%2Fdata.digitalsocial.eu%2Fgraph%<API key>" fetch_ntriples $ACTIVITY_TYPES "http%3A%2F%2Fdata.digitalsocial.eu%2Fgraph%2Fconcept-scheme%2Factivity-type" fetch_ntriples $<API key> "http%3A%2F%2Fdata.digitalsocial.eu%2Fgraph%2Fconcept-scheme%2Ftechnology-method" fetch_ntriples $AREA_OF_SOCIETY "http%3A%2F%2Fdata.digitalsocial.eu%2Fgraph%2Fconcept-scheme%2Farea-of-society" upload_to_s3 $MAIN_DATA_SET upload_to_s3 $ACTIVITY_TYPES upload_to_s3 $<API key> upload_to_s3 $AREA_OF_SOCIETY set_modified_date remove_old_backups echo "$DATESTR Backup Complete."
// IOService.cpp // Firedrake // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "IOService.h" namespace IO { IODefineMeta(Service, RegistryEntry) String *<API key>; String *<API key>; String *<API key>; extern void RegisterClass(MetaClass *meta, Dictionary *properties); extern void RegisterProvider(Service *provider); extern void <API key>(Service *provider, const Function<bool (MetaClass *meta, Dictionary *properties)> &callback); void Service::InitialWakeUp(MetaClass *meta) { if(meta == Service::GetMetaClass()) { <API key> = String::Alloc()->InitWithCString("<API key>"); <API key> = String::Alloc()->InitWithCString("<API key>"); <API key> = String::Alloc()->InitWithCString("<API key>"); } RegistryEntry::InitialWakeUp(meta); } void Service::RegisterService(MetaClass *meta, Dictionary *properties) { RegisterClass(meta, properties); } Service *Service::InitWithProperties(Dictionary *properties) { if(!RegistryEntry::Init()) return nullptr; _started = false; _properties = properties->Retain(); return this; } Dictionary *Service::GetProperties() const { return _properties; } void Service::Start() { _started = true; } void Service::Stop() {} // Matching void Service::RegisterProvider() { IO::RegisterProvider(this); } bool Service::MatchProperties(__unused Dictionary *properties) { return true; } void Service::StartMatching() { DoMatch(); } void Service::DoMatch() { <API key>(this, [this](MetaClass *meta, Dictionary *properties) { if(MatchProperties(properties)) { Service *service = static_cast<Service *>(meta->Alloc()); service = service->InitWithProperties(properties); if(service) { PublishService(service); return true; } } return false; }); } void Service::PublishService(Service *service) { AttachChild(service); } void Service::AttachToParent(RegistryEntry *parent) { RegistryEntry::AttachToParent(parent); Start(); } }
namespace Microsoft.Research.Wwt.Sdk.Core { <summary> Interface for DEM plate file generator. </summary> public interface <API key> { <summary> Gets the number of processed tiles for the level in context. </summary> long TilesProcessed { get; } <summary> This function is used to create the plate file from already generated DEM pyramid. </summary> <param name="serializer"> DEM tile serializer to retrieve the tile. </param> void CreateFromDemTile(IDemTileSerializer serializer); } }
namespace PlacesToEat.Data.Common { using System; using System.Data.Entity; using System.Linq; using Contracts; using Models; public class DbUserRepository<T> : IDbUserRepository<T> where T : class, IAuditInfo, IDeletableEntity { public DbUserRepository(DbContext context) { if (context == null) { throw new ArgumentException("An instance of DbContext is required to use this repository.", nameof(context)); } this.Context = context; this.DbSet = this.Context.Set<T>(); } private IDbSet<T> DbSet { get; } private DbContext Context { get; } public IQueryable<T> All() { return this.DbSet.AsQueryable().Where(x => !x.IsDeleted); } public IQueryable<T> AllWithDeleted() { return this.DbSet.AsQueryable(); } public void Delete(T entity) { entity.IsDeleted = true; entity.DeletedOn = DateTime.UtcNow; } public T GetById(string id) { return this.DbSet.Find(id); } public void HardDelete(T entity) { this.DbSet.Remove(entity); } public void Save() { this.Context.SaveChanges(); } } }
describe("Dragable Row Directive ", function () { var scope, container, element, html, compiled, compile; beforeEach(module("app", function ($provide) { $provide.value("authService", {}) })); beforeEach(inject(function ($compile, $rootScope) { html = '<div id="element-id" data-draggable-row=""' + ' <API key>=".draggable"' + ' <API key>=".drop-area">' + '<div class="draggable"></div>' + '<div class="drop-area" style="display: none;"></div>' + '</div>'; scope = $rootScope.$new(); compile = $compile; })); function prepareDirective(s) { container = angular.element(html); compiled = compile(container); element = compiled(s); s.$digest(); } it('should add draggable attribute to draggable element, when initialise', function () { prepareDirective(scope); expect(element.find('.draggable').attr('draggable')).toBe('true'); }); it('should prevent default, when dragging over allowed element', function () { prepareDirective(scope); var event = $.Event('dragover'); event.preventDefault = window.jasmine.createSpy('preventDefault'); event.originalEvent = { dataTransfer: { types: {}, getData: window.jasmine.createSpy('getData').and.returnValue("element-id") } }; element.trigger(event); expect(event.preventDefault).toHaveBeenCalled(); }); it('should show drop area, when drag enter allowed element', function () { prepareDirective(scope); var event = $.Event('dragenter'); event.originalEvent = { dataTransfer: { types: {}, getData: window.jasmine.createSpy('getData').and.returnValue("element-id") } }; element.trigger(event); expect(element.find('.drop-area').css('display')).not.toEqual('none'); expect(event.originalEvent.dataTransfer.getData).<API key>('draggedRow'); }); it('should call scope onDragEnd, when dragging ends', function () { prepareDirective(scope); var event = $.Event('dragend'); var isolateScope = element.isolateScope(); spyOn(isolateScope, 'onDragEnd'); element.trigger(event); expect(isolateScope.onDragEnd).toHaveBeenCalled(); }); it('should set drag data and call scope onDrag, when drag starts', function () { prepareDirective(scope); var event = $.Event('dragstart'); event.originalEvent = { dataTransfer: { setData: window.jasmine.createSpy('setData') } }; var isolateScope = element.isolateScope(); spyOn(isolateScope, 'onDrag'); element.find('.draggable').trigger(event); expect(isolateScope.onDrag).toHaveBeenCalled(); expect(event.originalEvent.dataTransfer.setData).<API key>('draggedRow', 'element-id'); }); it('should prevent default, when dragging over allowed drop area', function () { prepareDirective(scope); var event = $.Event('dragover'); event.preventDefault = window.jasmine.createSpy('preventDefault'); event.originalEvent = { dataTransfer: { types: {}, getData: window.jasmine.createSpy('getData').and.returnValue("element-id") } }; element.find('.drop-area').trigger(event); expect(event.preventDefault).toHaveBeenCalled(); }); it('should show drop area, when drag enter allowed drop area', function () { prepareDirective(scope); var event = $.Event('dragenter'); event.originalEvent = { dataTransfer: { types: {}, getData: window.jasmine.createSpy('getData').and.returnValue("element-id") } }; element.find('.drop-area').trigger(event); expect(element.find('.drop-area').css('display')).not.toEqual('none'); expect(event.originalEvent.dataTransfer.getData).<API key>('draggedRow'); }); it('should hide drop area, when drag leave drop area', function () { prepareDirective(scope); var event = $.Event('dragleave'); event.originalEvent = { dataTransfer: { types: {}, getData: window.jasmine.createSpy('getData').and.returnValue("element-id") } }; element.find('.drop-area').trigger(event); expect(element.find('.drop-area').css('display')).toEqual('none'); expect(event.originalEvent.dataTransfer.getData).<API key>('draggedRow'); }); it('should hide drop area and call scope onDrop, when drop on drop area', function () { prepareDirective(scope); var event = $.Event('drop'); event.preventDefault = window.jasmine.createSpy('preventDefault'); event.originalEvent = { dataTransfer: { types: {}, getData: window.jasmine.createSpy('getData').and.returnValue("element-id") } }; var isolateScope = element.isolateScope(); spyOn(isolateScope, 'onDrop'); element.find('.drop-area').trigger(event); expect(event.originalEvent.dataTransfer.getData).<API key>('draggedRow'); expect(event.preventDefault).toHaveBeenCalled(); expect(element.find('.drop-area').css('display')).toEqual('none'); expect(isolateScope.onDrop).toHaveBeenCalled(); }); });
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Ninject.Modules; using Ninject.Extensions.Conventions; namespace SongManager.Web.NinjectSupport { <summary> Automatically loads all Boot Modules and puts them into the Ninject Dependency Resolver </summary> public class <API key> : NinjectModule { public override void Load() { // Bind all BootModules Kernel.Bind( i => i.<API key>( "SongManager.Web.dll", "SongManager.Web.Core.dll", "SongManager.Web.Data.dll", "SongManager.Core.dll" ) .SelectAllClasses() .InheritedFrom( typeof( SongManager.Core.Boot.IBootModule ) ) .BindSingleInterface() ); } } }
# Amaretti.js [![Join the chat at https: [![Build Status](https: [![Coverage Status](https: Amaretti.js is a library to encrypt and decrypt message into the browser. They use native implementation (WebCrypto APIs) when available, or SJCL library when not. ## Getting started Installation This library can be installed with npm or bower, as you prefer: bash bower install amaretti bash npm install amaretti How to use it Just import the javascript file and require the library. Require system is included into amaretti library html <script src="public/vendor.js"></script> <script src="public/amaretti.js"></script> var Amaretti = require('amaretti').init(); Generate a salt Salt are used into key generation and to randomize the encryption of a message. You can get a base64 salt using this `Amaretti.getSalt()` javascript Amaretti.getSalt().then(function(salt) { // Manipulate your salt }, function (error) { // There was an error }); Generate a key To encrypt or decrypt messages, you need to use a key. You can generate a key usable with a passphrase (like a password). Key generated is returned as base64. To randomize the generation, you need to give a salt and a hash algorithm javascript Amaretti.generateKey(passphrase, salt, hash).then(function(key) { // Manipulate your key }, function (error) { // There was an error }); * __passphrase__: is the passphrase used to encrypt or decrypt messages * __salt__: is the salt, base64 encoded, used to randomize the key generator * __hash__: is the name of algorithm used to hash the key. It could be _SHA-1_ or _SHA-256_ Encrypt a message You can encrypt a message with your key. Amaretti use AES-GCM to encrypt data. To avoid brut-force attack agains the encrypted data, each data had to be encrypt with a different and random nonce. You can use a salt as nonce. Don't lose this nonce, you will need it to decrypt the message. javascript Amaretti.encrypt(key, message, nonce).then(function(encrypted) { // Manipulate your encrypted message }, function (error) { // There was an error }); * __key__: is the base64 used to encrypt message * __message__: is the message to encrypt * __nonce__: is a random value, in base64 format, use to avoid attacks Decrypt a message javascript Amaretti..decrypt(key, encrypted, nonce).then(function(decrypted) { // Manipulate your encrypted message }, function (error) { // There was an error }); * __key__: is the base64 used to encrypt message * __encrypted: is the encrypted message to decrypt, in base64 format * __nonce__: is a random value, in base64 format, use to avoid attacks MIT ## How to contribute Hum ... on github :) To build library bash npm install bower install brunch build To run tests bash npm run test ## Ideas for a roadmap * Return key and crypted data with JOSE standard (JWE and JWT) * Check sha-256 for firefox and sha-1 for SJCL ito key generation
package com.kromracing.runningroute.client; import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.Widget; final public class Utils { private Utils() { } /** * Sets the HTML id for a widget. * @param widget The widget to have the id set, ex: TextBox * @param id ID in HTML, ex: textbox-location */ static void setId(final Widget widget, final String id) { if (widget instanceof CheckBox) { final Element checkBoxElement = widget.getElement(); // The first element is the actual box to check. That is the one we care about. final Element inputElement = DOM.getChild(checkBoxElement, 0); inputElement.setAttribute("id", id); //DOM.setElementAttribute(inputElement, "id", id); deprecated! } else { widget.getElement().setAttribute("id", id); //DOM.setElementAttribute(widget.getElement(), "id", id); deprecated! } } }
package org.paylogic.jenkins.advancedscm; import hudson.EnvVars; import hudson.FilePath; import hudson.Launcher; import hudson.model.Action; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import hudson.model.TaskListener; import hudson.plugins.mercurial.HgExe; import hudson.plugins.mercurial.MercurialTagAction; import hudson.scm.PollingResult; import hudson.util.ArgumentListBuilder; import hudson.util.StreamTaskListener; import org.junit.Assume; import org.junit.internal.<API key>; import org.junit.rules.ExternalResource; import org.jvnet.hudson.test.JenkinsRule; import org.paylogic.jenkins.ABuildCause; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Set; import java.util.TreeSet; import static java.util.Collections.sort; import static org.junit.Assert.*; public final class MercurialRule extends ExternalResource { private TaskListener listener; private final JenkinsRule j; public MercurialRule(JenkinsRule j) { this.j = j; } @Override protected void before() throws Exception { listener = new StreamTaskListener(System.out, Charset.defaultCharset()); try { if (new ProcessBuilder("hg", "--version").start().waitFor() != 0) { throw new <API key>("hg --version signaled an error"); } } catch(IOException ioe) { String message = ioe.getMessage(); if(message.startsWith("Cannot run program \"hg\"") && message.endsWith("No such file or directory")) { throw new <API key>("hg is not available; please check that your PATH environment variable is properly configured"); } Assume.assumeNoException(ioe); // failed to check availability of hg } } private Launcher launcher() { return j.jenkins.createLauncher(listener); } private HgExe hgExe() throws Exception { return new HgExe(null, null, launcher(), j.jenkins, listener, new EnvVars()); } public void hg(String... args) throws Exception { HgExe hg = hgExe(); assertEquals(0, hg.launch(nobody(hg.seed(false)).add(args)).join()); } public void hg(File repo, String... args) throws Exception { HgExe hg = hgExe(); assertEquals(0, hg.launch(nobody(hg.seed(false)).add(args)).pwd(repo).join()); } private static ArgumentListBuilder nobody(ArgumentListBuilder args) { return args.add("--config").add("ui.username=nobody@nowhere.net"); } public void touchAndCommit(File repo, String... names) throws Exception { for (String name : names) { FilePath toTouch = new FilePath(repo).child(name); if (!toTouch.exists()) { toTouch.getParent().mkdirs(); toTouch.touch(0); hg(repo, "add", name); } else { toTouch.write(toTouch.readToString() + "extra line\n", "UTF-8"); } } hg(repo, "commit", "--message", "added " + Arrays.toString(names)); } public String buildAndCheck(FreeStyleProject p, String name, Action... actions) throws Exception { FreeStyleBuild b = j.<API key>(p.scheduleBuild2(0, new ABuildCause(), actions).get()); // Somehow this needs a cause or it will fail if (!b.getWorkspace().child(name).exists()) { Set<String> children = new TreeSet<String>(); for (FilePath child : b.getWorkspace().list()) { children.add(child.getName()); } fail("Could not find " + name + " among " + children); } assertNotNull(b.getAction(MercurialTagAction.class)); @SuppressWarnings("deprecation") String log = b.getLog(); return log; } public PollingResult pollSCMChanges(FreeStyleProject p) { return p.poll(new StreamTaskListener(System.out, Charset .defaultCharset())); } public String getLastChangesetId(File repo) throws Exception { return hgExe().popen(new FilePath(repo), listener, false, new ArgumentListBuilder("log", "-l1", "--template", "{node}")); } public String[] getBranches(File repo) throws Exception { String rawBranches = hgExe().popen(new FilePath(repo), listener, false, new ArgumentListBuilder("branches")); ArrayList<String> list = new ArrayList<String>(); for (String line: rawBranches.split("\n")) { // line should contain: <branchName> <revision>:<hash> (yes, with lots of whitespace) String[] <API key> = line.split("\\s+"); String branchName = <API key>[0]; list.add(branchName); } sort(list); return list.toArray(new String[list.size()]); } public String searchLog(File repo, String query) throws Exception { return hgExe().popen(new FilePath(repo), listener, false, new ArgumentListBuilder("log", "-k", query)); } }
function simulated_annealing(tuning_run::Run, channel::RemoteChannel; temperature::Function = log_temperature) iteration = 1 function iterate(tuning_run::Run) p = temperature(iteration) iteration += 1 return <API key>(tuning_run, threshold = p) end technique(tuning_run, channel, iterate, name = "Simulated Annealing") end
/* Close all */ .monaco-workbench .explorer-viewlet .<API key> { background: url("close-all-light.svg") center center no-repeat; } .vs-dark .monaco-workbench .explorer-viewlet .<API key> { background: url("close-all-dark.svg") center center no-repeat; } .hc-black .monaco-workbench .explorer-viewlet .<API key> { background: url("close-all-light.svg") center center no-repeat; } /* Save all */ .monaco-workbench .explorer-action.save-all { background: url("save-all-light.svg") center center no-repeat; } .vs-dark .monaco-workbench .explorer-action.save-all { background: url("save-all-dark.svg") center center no-repeat; } .hc-black .monaco-workbench .explorer-action.save-all { background: url("save-all-hc.svg") center center no-repeat; } /* Add file */ .monaco-workbench .explorer-action.new-file { background: url("add-file-light.svg") center center no-repeat; } .vs-dark .monaco-workbench .explorer-action.new-file { background: url("add-file-dark.svg") center center no-repeat; } .hc-black .monaco-workbench .explorer-action.new-file { background: url("add-file-hc.svg") center center no-repeat; } /* Add Folder */ .monaco-workbench .explorer-action.new-folder { background: url("add-folder-light.svg") center center no-repeat; } .vs-dark .monaco-workbench .explorer-action.new-folder { background: url("add-folder-dark.svg") center center no-repeat; } .hc-black .monaco-workbench .explorer-action.new-folder { background: url("add-folder-hc.svg") center center no-repeat; } /* Refresh */ .monaco-workbench .explorer-action.refresh-explorer { background: url("refresh-light.svg") center center no-repeat; } .vs-dark .monaco-workbench .explorer-action.refresh-explorer { background: url("refresh-dark.svg") center center no-repeat; } .hc-black .monaco-workbench .explorer-action.refresh-explorer { background: url("refresh-hc.svg") center center no-repeat; } /* Collapse all */ .monaco-workbench .explorer-action.collapse-explorer { background: url("collapse-all-light.svg") center center no-repeat; } .vs-dark .monaco-workbench .explorer-action.collapse-explorer { background: url("collapse-all-dark.svg") center center no-repeat; } .hc-black .monaco-workbench .explorer-action.collapse-explorer { background: url("collapse-all-hc.svg") center center no-repeat; } /* Split editor vertical */ .monaco-workbench .<API key> { background-image: url("<API key>.svg"); } .vs-dark .monaco-workbench .<API key> { background-image: url("<API key>.svg"); } .hc-black .monaco-workbench .<API key> { background-image: url("<API key>.svg"); } /* Split editor horizontal */ .monaco-workbench .<API key> { background-image: url("<API key>.svg"); } .vs-dark .monaco-workbench .<API key> { background-image: url("<API key>.svg"); } .hc-black .monaco-workbench .<API key> { background-image: url("<API key>.svg"); } .monaco-workbench .file-editor-action.action-open-preview { background: url("preview-light.svg") center center no-repeat; } .vs-dark .monaco-workbench .file-editor-action.action-open-preview, .hc-black .monaco-workbench .file-editor-action.action-open-preview { background: url("preview-dark.svg") center center no-repeat; } .explorer-viewlet .<API key> .close-editor-action { background: url("action-close-light.svg") center center no-repeat; } .explorer-viewlet .<API key> .focused .monaco-list-row.selected:not(.highlighted) .close-editor-action { background: url("action-close-focus.svg") center center no-repeat; } .explorer-viewlet .<API key> .monaco-list .monaco-list-row.dirty:not(:hover) > .monaco-action-bar .close-editor-action { background: url("action-close-dirty.svg") center center no-repeat; } .vs-dark .explorer-viewlet .<API key> .monaco-list .monaco-list-row.dirty:not(:hover) > .monaco-action-bar .close-editor-action, .hc-black .monaco-workbench .explorer-viewlet .<API key> .monaco-list .monaco-list-row.dirty:not(:hover) > .monaco-action-bar .close-editor-action { background: url("<API key>.svg") center center no-repeat; } .explorer-viewlet .<API key> .monaco-list.focused .monaco-list-row.selected.dirty:not(:hover) > .monaco-action-bar .close-editor-action { background: url("<API key>.svg") center center no-repeat; } .vs-dark .monaco-workbench .explorer-viewlet .<API key> .close-editor-action, .hc-black .monaco-workbench .explorer-viewlet .<API key> .close-editor-action { background: url("action-close-dark.svg") center center no-repeat; }
package zhou.adapter; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import java.util.List; public class NormalAdapter extends RecyclerView.Adapter<NormalAdapter.Holder> { private List<String> msg; public NormalAdapter(List<String> msg) { this.msg = msg; } @Override public Holder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_normal, null); Holder holder = new Holder(view); return holder; } @Override public void onBindViewHolder(Holder holder, int position) { String m = msg.get(position); holder.icon.setImageResource(R.mipmap.ic_launcher); holder.text.setText(m); } @Override public int getItemCount() { return msg == null ? 0 : msg.size(); } public static class Holder extends RecyclerView.ViewHolder { public TextView text; public ImageView icon; public Holder(View itemView) { super(itemView); text = (TextView) itemView.findViewById(R.id.item_text); icon = (ImageView) itemView.findViewById(R.id.item_icon); } } }
<ng-container *ngIf="preview.user && !authHelper.isSelf(preview.user)"> <user-info [user]="preview.user"> </user-info> </ng-container> <!-- description + image --> <label-value [label]="i18n.voucher.voucher"> {{ preview.type.voucherTitle }} </label-value> <ng-container *ngIf="buyVoucher.count === 1; else multiple"> <label-value [label]="i18n.transaction.amount"> {{ buyVoucher.amount | currency:preview.type.configuration.currency }} </label-value> </ng-container> <ng-template #multiple> <label-value [label]="i18n.voucher.numberOfVouchers"> {{ buyVoucher.count }} </label-value> <label-value [label]="i18n.voucher.amountPerVoucher"> {{ buyVoucher.amount | currency:preview.type.configuration.currency }} </label-value> <label-value [label]="i18n.voucher.totalAmount"> {{ preview.totalAmount | currency:preview.type.configuration.currency }} </label-value> </ng-template> <label-value *ngIf="preview.type.gift === 'choose'" kind="fieldView" [label]="i18n.voucher.buy.usage" [value]="buyVoucher.gift ? i18n.voucher.buy.usageGift : i18n.voucher.buy.usageSelf"> </label-value> <label-value *ngIf="preview.type.gift === 'never'" kind="fieldView" [label]="i18n.voucher.buy.usage" [value]="i18n.voucher.buy.usageAlwaysSelf"> </label-value> <!-- payment fields --> <ng-container *ngFor="let cf of paymentCustomFields"> <label-value [hidden]="!fieldHelper.hasValue(cf.internalName, buyVoucher.paymentCustomValues)" [label]="cf.name" [labelPosition]="labelOnTop((layout.ltsm$ | async), cf) ? 'top' : 'auto'"> <format-field-value [customValues]="buyVoucher.paymentCustomValues" [fields]="paymentCustomFields" [fieldName]="cf.internalName"> </format-field-value> </label-value> </ng-container> <!-- custom fields --> <ng-container *ngFor="let cf of voucherCustomFields"> <label-value [hidden]="!fieldHelper.hasValue(cf.internalName, buyVoucher.voucherCustomValues)" [label]="cf.name" [labelPosition]="labelOnTop((layout.ltsm$ | async), cf) ? 'top' : 'auto'"> <format-field-value [customValues]="buyVoucher.voucherCustomValues" [fields]="voucherCustomFields" [fieldName]="cf.internalName"> </format-field-value> </label-value> </ng-container> <ng-container *ngIf="preview.<API key>"> <hr *ngIf="layout.gtxxs$ | async"> <<API key> focused [formControl]="form.get('<API key>')" [passwordInput]="preview.<API key>" [<API key>]="<API key>" (<API key>)="<API key>.emit($event)" (confirmed)="confirmed.emit($event)"> </<API key>> </ng-container>
<?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_TW" version="2.0"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About GulfCoin</source> <translation></translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;GulfCoin&lt;/b&gt; version</source> <translation>&lt;b&gt;&lt;/b&gt;</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http: <translation> . MIT/X11 , COPYING , : http: OpenSSL Project OpenSSL Toolkit (http: </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation></translation> </message> <message> <location line="+0"/> <source>The GulfCoin developers</source> <translation></translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation></translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation></translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation></translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation></translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation></translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your GulfCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>. , .</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation></translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation> &amp;QR </translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a GulfCoin address</source> <translation></translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation></translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation></translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation></translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation></translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified GulfCoin address</source> <translation></translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation></translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation></translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your GulfCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>. , .</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation></translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation></translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation></translation> </message> <message> <location line="+265"/> <source>Export Address Book Data</source> <translation></translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation> (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation></translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation> %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation></translation> </message> <message> <location line="+0"/> <source>Address</source> <translation></translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>()</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation></translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation></translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation></translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation></translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>.&lt;br/&gt;&lt;b&gt;10&lt;/b&gt;, &lt;b&gt;8&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation></translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation></translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation></translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation></translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation></translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation></translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation></translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source> <translation>: , &lt;b&gt;&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>: , . , , .</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>: !</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation></translation> </message> <message> <location line="-56"/> <source>GulfCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your gulfcoins from being stolen by malware infecting your computer.</source> <translation>. , .</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation></translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>. .</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation></translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation></translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>.</translation> </message> </context> <context> <name>GulfCoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+254"/> <source>Sign &amp;message...</source> <translation>...</translation> </message> <message> <location line="+246"/> <source>Synchronizing with network...</source> <translation>...</translation> </message> <message> <location line="-321"/> <source>&amp;Overview</source> <translation></translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation></translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation></translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation></translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation></translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation></translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation></translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation></translation> </message> <message> <location line="+7"/> <source>Show information about GulfCoin</source> <translation></translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation> &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation> Qt </translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>...</translation> </message> <message> <location line="+9"/> <source>&amp;Encrypt Wallet...</source> <translation>...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>...</translation> </message> <message> <location line="+251"/> <source>Importing blocks from disk...</source> <translation>...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>...</translation> </message> <message> <location line="-319"/> <source>Send coins to a GulfCoin address</source> <translation></translation> </message> <message> <location line="+52"/> <source>Modify configuration options for GulfCoin</source> <translation></translation> </message> <message> <location line="+12"/> <source>Backup wallet to another location</source> <translation></translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation></translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation></translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation></translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>...</translation> </message> <message> <location line="-183"/> <location line="+6"/> <location line="+508"/> <source>GulfCoin</source> <translation></translation> </message> <message> <location line="-514"/> <location line="+6"/> <source>Wallet</source> <translation></translation> </message> <message> <location line="+107"/> <source>&amp;Send</source> <translation></translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation></translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation></translation> </message> <message> <location line="+23"/> <location line="+2"/> <source>&amp;About GulfCoin</source> <translation></translation> </message> <message> <location line="+10"/> <location line="+2"/> <source>&amp;Show / Hide</source> <translation></translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation></translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation></translation> </message> <message> <location line="+7"/> <source>Sign messages with your GulfCoin addresses to prove you own them</source> <translation></translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified GulfCoin addresses</source> <translation></translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation></translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation></translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation></translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation></translation> </message> <message> <location line="-228"/> <location line="+288"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="-5"/> <location line="+5"/> <source>GulfCoin client</source> <translation></translation> </message> <message numerus="yes"> <location line="+121"/> <source>%n active connection(s) to GulfCoin network</source> <translation><numerusform> %n </numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation> %2 %1 .</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation> %1 .</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n </numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n </numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n </numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation> %1</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation> %1 .</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation></translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation></translation> </message> <message> <location line="+3"/> <source>Information</source> <translation></translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>. %1 , , . ?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation></translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation></translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation></translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation></translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>: %1 : %2 : %3 : %4</translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>URI </translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid GulfCoin address or malformed URI parameters.</source> <translation> URI! URI .</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+110"/> <source>A fatal error occurred. GulfCoin can no longer continue safely and will quit.</source> <translation>. , .</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+105"/> <source>Network Alert</source> <translation></translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation></translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation></translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation></translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation></translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>. .</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation></translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation></translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation></translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation></translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>&quot;%1&quot;.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid GulfCoin address.</source> <translation> &quot;%1&quot; .</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <location filename="../intro.cpp" line="+61"/> <source>A new data directory will be created.</source> <translation>.</translation> </message> <message> <location line="+22"/> <source>name</source> <translation></translation> </message> <message> <location line="+2"/> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation>. , %1.</translation> </message> <message> <location line="+3"/> <source>Path already exists, and is not a directory.</source> <translation>, .</translation> </message> <message> <location line="+7"/> <source>Cannot create data directory here.</source> <translation></translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+517"/> <location line="+13"/> <source>GulfCoin-Qt</source> <translation>-Qt</translation> </message> <message> <location line="-13"/> <source>version</source> <translation></translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation></translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation></translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>, &quot;de_DE&quot; (: )</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation> </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation> (: 1)</translation> </message> <message> <location line="+1"/> <source>Choose data directory on startup (default: 0)</source> <translation> (: 0)</translation> </message> </context> <context> <name>Intro</name> <message> <location filename="../forms/intro.ui" line="+14"/> <source>Welcome</source> <translation></translation> </message> <message> <location line="+9"/> <source>Welcome to GulfCoin-Qt.</source> <translation>&quot;-Qt&quot;</translation> </message> <message> <location line="+26"/> <source>As this is the first time the program is launched, you can choose where GulfCoin-Qt will store its data.</source> <translation>, &quot;-Qt&quot;.</translation> </message> <message> <location line="+10"/> <source>GulfCoin-Qt will download and store a copy of the GulfCoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> <translation>-Qt . %1GB , . .</translation> </message> <message> <location line="+10"/> <source>Use the default data directory</source> <translation></translation> </message> <message> <location line="+7"/> <source>Use a custom data directory:</source> <translation>:</translation> </message> <message> <location filename="../intro.cpp" line="+100"/> <source>Error</source> <translation></translation> </message> <message> <location line="+9"/> <source>GB of free space available</source> <translation>GB </translation> </message> <message> <location line="+3"/> <source>(of %1GB needed)</source> <translation>( %1GB)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation></translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation></translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>, kB , . 1 kB.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation></translation> </message> <message> <location line="+31"/> <source>Automatically start GulfCoin after logging in to the system.</source> <translation>.</translation> </message> <message> <location line="+3"/> <source>&amp;Start GulfCoin on system login</source> <translation></translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation></translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation></translation> </message> <message> <location line="+6"/> <source>Automatically open the GulfCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation> GulfCoin . UPnP .</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation> &amp;UPnP </translation> </message> <message> <location line="+7"/> <source>Connect to the GulfCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation> SOCKS ( Tor ).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation> SOCKS :</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation> ( 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation> ( 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS :</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation> SOCKS ( 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation></translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation></translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation></translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>, . , .</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation></translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation></translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation></translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting GulfCoin.</source> <translation>. .</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>.</translation> </message> <message> <location line="+9"/> <source>Whether to show GulfCoin addresses in the transaction list or not.</source> <translation>.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation></translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation></translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation></translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation></translation> </message> <message> <location filename="../optionsdialog.cpp" line="+54"/> <source>default</source> <translation></translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation></translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation></translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting GulfCoin.</source> <translation>.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation></translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation></translation> </message> <message> <location line="+50"/> <location line="+202"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the GulfCoin network after a connection is established, but this process has not completed yet.</source> <translation>. , , .</translation> </message> <message> <location line="-131"/> <source>Unconfirmed:</source> <translation>:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation></translation> </message> <message> <location line="+49"/> <source>Confirmed:</source> <translation>:</translation> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation></translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation>, </translation> </message> <message> <location line="+13"/> <source>Immature:</source> <translation></translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation></translation> </message> <message> <location line="+13"/> <source>Total:</source> <translation>:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation></translation> </message> <message> <location line="+53"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;&lt;/b&gt;</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation></translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+108"/> <source>Cannot start gulfcoin: click-to-pay handler</source> <translation> gulfcoin </translation> </message> </context> <context> <name>QObject</name> <message> <location filename="../bitcoin.cpp" line="+92"/> <location filename="../intro.cpp" line="-32"/> <source>GulfCoin</source> <translation></translation> </message> <message> <location line="+1"/> <source>Error: Specified data directory &quot;%1&quot; does not exist.</source> <translation>: &quot;%1&quot;.</translation> </message> <message> <location filename="../intro.cpp" line="+1"/> <source>Error: Specified data directory &quot;%1&quot; can not be created.</source> <translation>: &quot;%1&quot;.</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>QR </translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation></translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+64"/> <source>Error encoding URI into QR Code.</source> <translation> URI QR </translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>, .</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>,.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation> QR </translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation></translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+345"/> <source>N/A</source> <translation></translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation></translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation></translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation> OpenSSL </translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation></translation> </message> <message> <location line="+29"/> <source>Network</source> <translation></translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation></translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation></translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation></translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation></translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation></translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation></translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation></translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation></translation> </message> <message> <location line="+7"/> <source>Show the GulfCoin-Qt help message to get a list with possible GulfCoin command-line options.</source> <translation>&quot;-Qt&quot;, .</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation></translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation></translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation></translation> </message> <message> <location line="-104"/> <source>GulfCoin - Debug window</source> <translation> - </translation> </message> <message> <location line="+25"/> <source>GulfCoin Core</source> <translation></translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation></translation> </message> <message> <location line="+7"/> <source>Open the GulfCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>. .</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation></translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the GulfCoin RPC console.</source> <translation> RPC .</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>, &lt;b&gt;Ctrl-L&lt;/b&gt; .</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation> &lt;b&gt;help&lt;/b&gt; .</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+128"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation></translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation></translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation></translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation></translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation></translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>:</translation> </message> <message> <location line="+10"/> <source>123.456 ABC</source> <translation>123.456 ABC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation></translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation></translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-62"/> <location line="+2"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; %2 (%3)</translation> </message> <message> <location line="+6"/> <source>Confirm send coins</source> <translation></translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation> %1 ?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation></translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>, .</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation> 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation> %1 , .</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>. , .</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>: !</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>: . , . wallet.dat, , .</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation></translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. <API key>)</source> <translation> ( <API key>)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>, </translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation></translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation></translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation></translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a GulfCoin address (e.g. <API key>)</source> <translation> ( <API key>)</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation> - </translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation></translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>, . , , . .</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. <API key>)</source> <translation> ( <API key>)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation></translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation></translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation></translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation></translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation></translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this GulfCoin address</source> <translation></translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation></translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation></translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation></translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation></translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>, (, , ), , . , , , &quot;&quot;.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. <API key>)</source> <translation> ( <API key>)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified GulfCoin address</source> <translation></translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation></translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation></translation> </message> <message> <location filename="../<API key>.cpp" line="+27"/> <location line="+3"/> <source>Enter a GulfCoin address (e.g. <API key>)</source> <translation> ( <API key>)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>&quot;&quot;</translation> </message> <message> <location line="+3"/> <source>Enter GulfCoin signature</source> <translation></translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The GulfCoin developers</source> <translation></translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation> %1 </translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation> %1 </translation> </message> <message> <location line="+18"/> <source>Status</source> <translation></translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, %n </numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation></translation> </message> <message> <location line="+7"/> <source>Source</source> <translation></translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation></translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation></translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation></translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation></translation> </message> <message> <location line="-2"/> <source>label</source> <translation></translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation></translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform> %n </numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation></translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation></translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation></translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation></translation> </message> <message> <location line="+6"/> <source>Message</source> <translation></translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation></translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation></translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation> 1 , . , , . , &quot;&quot;, . , , .</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation></translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation></translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation></translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation></translation> </message> <message> <location line="+1"/> <source>true</source> <translation></translation> </message> <message> <location line="+0"/> <source>false</source> <translation></translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, </translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform> %n </numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation></translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Transaction details</source> <translation></translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation></translation> </message> </context> <context> <name><API key></name> <message> <location filename="../<API key>.cpp" line="+225"/> <source>Date</source> <translation></translation> </message> <message> <location line="+0"/> <source>Type</source> <translation></translation> </message> <message> <location line="+0"/> <source>Address</source> <translation></translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation></translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform> %n </numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation> %1 </translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation> ( %1 )</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation> ( %1 , %2 )</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation> ( %1 )</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform> %n </numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>, !</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation></translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation></translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation></translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation></translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation></translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation></translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>()</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>. .</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation></translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation></translation> </message> <message> <location line="-15"/> <source>Today</source> <translation></translation> </message> <message> <location line="+1"/> <source>This week</source> <translation></translation> </message> <message> <location line="+1"/> <source>This month</source> <translation></translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation></translation> </message> <message> <location line="+1"/> <source>This year</source> <translation></translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation></translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation></translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation></translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation></translation> </message> <message> <location line="+1"/> <source>Other</source> <translation></translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation></translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation></translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation></translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation></translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation></translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation></translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation></translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation></translation> </message> <message> <location line="+143"/> <source>Export Transaction Data</source> <translation></translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation> (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation></translation> </message> <message> <location line="+1"/> <source>Date</source> <translation></translation> </message> <message> <location line="+1"/> <source>Type</source> <translation></translation> </message> <message> <location line="+1"/> <source>Label</source> <translation></translation> </message> <message> <location line="+1"/> <source>Address</source> <translation></translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation></translation> </message> <message> <location line="+1"/> <source>ID</source> <translation></translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation></translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation> %1 .</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation></translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation></translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+46"/> <source>&amp;Export</source> <translation></translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation></translation> </message> <message> <location line="+197"/> <source>Backup Wallet</source> <translation></translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation> (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation></translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation></translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation></translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+98"/> <source>GulfCoin version</source> <translation></translation> </message> <message> <location line="+104"/> <source>Usage:</source> <translation>:</translation> </message> <message> <location line="-30"/> <source>Send command to -server or gulfcoind</source> <translation> -server gulfcoind </translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation> </translation> </message> <message> <location line="-13"/> <source>Get help for a command</source> <translation> </translation> </message> <message> <location line="+25"/> <source>Options:</source> <translation>: </translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: gulfcoin.conf)</source> <translation> (: gulfcoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: gulfcoind.pid)</source> <translation> (: gulfcoind.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation> </translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>(MB, : 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 12401 or testnet: 22401)</source> <translation> &lt;port&gt; (: 12401, : 22401)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation> &lt;n&gt; (: 125)</translation> </message> <message> <location line="-49"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>, </translation> </message> <message> <location line="+84"/> <source>Specify your own public address</source> <translation></translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation> (: 100)</translation> </message> <message> <location line="-136"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation> (: 86400)</translation> </message> <message> <location line="-33"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation> IPv4 %u RPC : %s</translation> </message> <message> <location line="+31"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 12402 or testnet: 22402)</source> <translation> &lt;port&gt; JSON-RPC (: 12402, : 22402)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation> JSON-RPC </translation> </message> <message> <location line="+77"/> <source>Run in the background as a daemon and accept commands</source> <translation></translation> </message> <message> <location line="+38"/> <source>Use the test network</source> <translation> </translation> </message> <message> <location line="-114"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation> (: -proxy -connect 1)</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=gulfcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;GulfCoin Alert&quot; admin@foo.com </source> <translation>%s, RPC (rpcpassword): %s : rpcuser=gulfcoinrpc rpcpassword=%s () (rpcuser)(rpcpassword)! , , &quot;&quot;. , ; : alertnotify=echo %%s | mail -s &quot;GulfCoin Alert&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation> IPv6 %u RPC , IPv4 : %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>, . IPv6 &quot;[]:&quot; </translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. GulfCoin is probably already running.</source> <translation> %s. .</translation> </message> <message> <location line="+3"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation>, , . , .</translation> </message> <message> <location line="+4"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>: ! , . wallet.dat, , .</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>: %s ! , , .</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation> ( %s )</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation> ( %s )</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation> (: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation> - - </translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>: -paytxfee ! .</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>: ! , .</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong GulfCoin will not work properly.</source> <translation>: ! .</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>: wallet.dat ! , .</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>: wallet.dat , ! wallet.dat %s, wallet.{timestamp}.bak. , .</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation> wallet.dat </translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>()</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation></translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation> (: -externalip 1)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation></translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation> %s !</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation></translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation></translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>: !</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>: , !</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>: :</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>. -listen=0.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation></translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation></translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation> (: -connect 1)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation> (: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation> (: 288, 0 )</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation> (0 4, : 3)</translation> </message> <message> <location line="+2"/> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation>. ?</translation> </message> <message> <location line="+18"/> <source>Not enough file descriptors available.</source> <translation>.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation> blk000??.dat </translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation> RPC ( 4)</translation> </message> <message> <location line="+7"/> <source>Specify wallet file (within data directory)</source> <translation>()</translation> </message> <message> <location line="+20"/> <source>Verifying blocks...</source> <translation>...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>...</translation> </message> <message> <location line="+1"/> <source>Wallet %s resides outside data directory %s</source> <translation> %s %s </translation> </message> <message> <location line="+4"/> <source>You need to rebuild the database using -reindex to change -txindex</source> <translation> -txindex , -reindex </translation> </message> <message> <location line="-76"/> <source>Imports blocks from external blk000??.dat file</source> <translation> blk000??.dat </translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation> ( 16, 0 , 0 , 0)</translation> </message> <message> <location line="+78"/> <source>Information</source> <translation></translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation> -tor : &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation> -minrelaytxfee=&lt;&gt; : &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation> -mintxfee=&lt;amount&gt; : &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation> ( 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation> &lt;n&gt;*1000 (: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation> &lt;n&gt;*1000 (: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation> (: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation> &lt;net&gt; (IPv4, IPv6, Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>. -debug* </translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation></translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation></translation> </message> <message> <location line="+5"/> <source>SSL options: (see the GulfCoin Wiki for SSL setup instructions)</source> <translation>SSL : (SSL GulfCoin Wiki)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation> SOCKS (4 5, : 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>, debug.log </translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation></translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation> (: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation> (: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation> debug.log (: -debug 1)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation></translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation> (: 5000)</translation> </message> <message> <location line="+5"/> <source>System error: </source> <translation>:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation></translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation></translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation></translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>(UPnP) (: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>(UPnP) (: 1)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation> Tor (: -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>JSON-RPC </translation> </message> <message> <location line="+5"/> <source>Warning</source> <translation></translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>: , !</translation> </message> <message> <location line="+2"/> <source>wallet.dat corrupt, salvage failed</source> <translation> weallet.dat , </translation> </message> <message> <location line="-52"/> <source>Password for JSON-RPC connections</source> <translation>JSON-RPC </translation> </message> <message> <location line="-68"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation> JSON-RPC </translation> </message> <message> <location line="+77"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation> &lt;ip&gt; (: 127.0.0.1) </translation> </message> <message> <location line="-121"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation> ( %s )</translation> </message> <message> <location line="+149"/> <source>Upgrade wallet to latest format</source> <translation></translation> </message> <message> <location line="-22"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation> &lt;n&gt; (: 100) </translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>, .</translation> </message> <message> <location line="+36"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation> JSON-RPC OpenSSL (https) </translation> </message> <message> <location line="-27"/> <source>Server certificate file (default: server.cert)</source> <translation> (: server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation> (: server.pem) </translation> </message> <message> <location line="-156"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation> (: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) </translation> </message> <message> <location line="+171"/> <source>This help message</source> <translation> </translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation> %s ( %d, %s)</translation> </message> <message> <location line="-93"/> <source>Connect through socks proxy</source> <translation> SOCKS </translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation> -addnode, -seednode, -connect </translation> </message> <message> <location line="+56"/> <source>Loading addresses...</source> <translation>...</translation> </message> <message> <location line="-36"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation> wallet.dat : </translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of GulfCoin</source> <translation> wallet.dat : GulfCoin</translation> </message> <message> <location line="+96"/> <source>Wallet needed to be rewritten: restart GulfCoin to complete</source> <translation>: </translation> </message> <message> <location line="-98"/> <source>Error loading wallet.dat</source> <translation> wallet.dat </translation> </message> <message> <location line="+29"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation> -proxy : &apos;%s&apos;</translation> </message> <message> <location line="+57"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation> -onlynet : &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation> -socks : %i</translation> </message> <message> <location line="-98"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation> -bind : &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation> -externalip : &apos;%s&apos;</translation> </message> <message> <location line="+45"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation> -paytxfee=&lt;&gt; : &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation></translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation></translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>...</translation> </message> <message> <location line="-58"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>, </translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. GulfCoin is probably already running.</source> <translation> %s . .</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation> KB </translation> </message> <message> <location line="+20"/> <source>Loading wallet...</source> <translation>...</translation> </message> <message> <location line="-53"/> <source>Cannot downgrade wallet</source> <translation></translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation></translation> </message> <message> <location line="+65"/> <source>Rescanning...</source> <translation>...</translation> </message> <message> <location line="-58"/> <source>Done loading</source> <translation></translation> </message> <message> <location line="+84"/> <source>To use the %s option</source> <translation> %s </translation> </message> <message> <location line="-76"/> <source>Error</source> <translation></translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation> RPC (rpcpassword=&lt;password&gt;): %s , , &quot;&quot;.</translation> </message> </context> </TS>
package UserInterface.Animation; /** * Makes shit get big, makes shit get small. */ public class SizeAnimation extends Animation { protected int iW, iH, fW, fH, cW, cH; public SizeAnimation(long period, int paceType, boolean loop, int iW, int iH, int fW, int fH) { super(period, paceType, loop); this.iW = iW; this.iH = iH; this.fW = fW; this.fH = fH; this.cW = iW; this.cH = iH; } @Override protected void updateAnimation(double p) { cW = (int)Math.round((fW - iW)*p) + iW; cH = (int)Math.round((fH - iH)*p) + iH; } public int getWidth() { return cW; } public int getHeight() { return cH; } }
import * as path from "path"; import * as tl from "vsts-task-lib/task"; import {IExecOptions, IExecSyncResult} from "vsts-task-lib/toolrunner"; import * as auth from "packaging-common/nuget/Authentication"; import * as commandHelper from "packaging-common/nuget/CommandHelper"; import {NuGetConfigHelper2} from "packaging-common/nuget/NuGetConfigHelper2"; import * as ngToolRunner from "packaging-common/nuget/NuGetToolRunner2"; import peParser = require("packaging-common/pe-parser/index"); import {VersionInfo} from "packaging-common/pe-parser/VersionResource"; import * as nutil from "packaging-common/nuget/Utility"; import * as pkgLocationUtils from "packaging-common/locationUtilities"; import * as telemetry from "utility-common/telemetry"; import <API key> from "packaging-common/nuget/<API key>"; class RestoreOptions implements <API key> { constructor( public nuGetPath: string, public configFile: string, public noCache: boolean, public <API key>: boolean, public verbosity: string, public packagesDirectory: string, public environment: ngToolRunner.<API key>, public authInfo: auth.<API key>, ) { } } export async function run(nuGetPath: string): Promise<void> { let packagingLocation: pkgLocationUtils.PackagingLocation; try { packagingLocation = await pkgLocationUtils.getPackagingUris(pkgLocationUtils.ProtocolType.NuGet); } catch (error) { tl.debug("Unable to get packaging URIs, using default collection URI"); tl.debug(JSON.stringify(error)); const collectionUrl = tl.getVariable("System.<API key>"); packagingLocation = { PackagingUris: [collectionUrl], DefaultPackagingUri: collectionUrl}; } const <API key>: string = null; const <API key>: string = null; try { nutil.setConsoleCodePage(); // Reading inputs const solutionPattern = tl.getPathInput("solution", true, false); const useLegacyFind: boolean = tl.getVariable("NuGet.UseLegacyFindFiles") === "true"; let filesList: string[] = []; if (!useLegacyFind) { const findOptions: tl.FindOptions = <tl.FindOptions>{}; const matchOptions: tl.MatchOptions = <tl.MatchOptions>{}; const searchPatterns: string[] = nutil.<API key>(solutionPattern); filesList = tl.findMatch(undefined, searchPatterns, findOptions, matchOptions); } else { filesList = nutil.resolveFilterSpec( solutionPattern, tl.getVariable("System.<API key>") || process.cwd()); } filesList.forEach((solutionFile) => { if (!tl.stats(solutionFile).isFile()) { throw new Error(tl.loc("NotARegularFile", solutionFile)); } }); const noCache = tl.getBoolInput("noCache"); const <API key> = tl.getBoolInput("<API key>"); const verbosity = tl.getInput("verbosityRestore"); let packagesDirectory = tl.getPathInput("packagesDirectory"); if (!tl.filePathSupplied("packagesDirectory")) { packagesDirectory = null; } const nuGetVersion: VersionInfo = await peParser.<API key>(nuGetPath); // Discovering NuGet quirks based on the version tl.debug("Getting NuGet quirks"); const quirks = await ngToolRunner.getNuGetQuirksAsync(nuGetPath); // Clauses ordered in this way to avoid short-circuit evaluation, so the debug info printed by the functions // is unconditionally displayed const useV1CredProvider: boolean = ngToolRunner.<API key>(quirks); const useV2CredProvider: boolean = ngToolRunner.<API key>(quirks); const credProviderPath: string = nutil.<API key>(useV2CredProvider); const useCredConfig = ngToolRunner.<API key>(quirks) && (!useV1CredProvider && !useV2CredProvider); // Setting up auth-related variables tl.debug("Setting up auth"); let urlPrefixes = packagingLocation.PackagingUris; tl.debug(`Discovered URL prefixes: ${urlPrefixes}`); // Note to readers: This variable will be going away once we have a fix for the location service for // customers behind proxies const testPrefixes = tl.getVariable("NuGetTasks.<API key>"); if (testPrefixes) { urlPrefixes = urlPrefixes.concat(testPrefixes.split(";")); tl.debug(`All URL prefixes: ${urlPrefixes}`); } const access<API key>.<API key>(); const externalAuthArr: auth.ExternalAuthInfo[] = commandHelper.<API key>("externalEndpoints"); const authInfo = new auth.<API key>( new auth.InternalAuthInfo( urlPrefixes, accessToken, ((useV1CredProvider || useV2CredProvider) ? credProviderPath : null), useCredConfig), externalAuthArr); const environmentSettings: ngToolRunner.<API key> = { credProviderFolder: useV2CredProvider === false ? credProviderPath : null, V2CredProviderPath: useV2CredProvider === true ? credProviderPath : null, extensionsDisabled: true, }; // Setting up sources, either from provided config file or from feed selection tl.debug("Setting up sources"); let nuGetConfigPath : string = undefined; let configFile: string = undefined; let selectOrConfig = tl.getInput("selectOrConfig"); // This IF is here in order to provide a value to nuGetConfigPath (if option selected, if user provided it) // and then pass it into the config helper if (selectOrConfig === "config") { nuGetConfigPath = tl.getPathInput("nugetConfigPath", false, true); if (!tl.filePathSupplied("nugetConfigPath")) { nuGetConfigPath = undefined; } // If using NuGet version 4.8 or greater and nuget.config was provided, // do not create temp config file if (useV2CredProvider && nuGetConfigPath) { configFile = nuGetConfigPath; } } // If there was no nuGetConfigPath, NuGetConfigHelper will create a temp one const nuGetConfigHelper = new NuGetConfigHelper2( nuGetPath, nuGetConfigPath, authInfo, environmentSettings, null); let credCleanup = () => { return; }; // Now that the NuGetConfigHelper was initialized with all the known information we can proceed // and check if the user picked the 'select' option to fill out the config file if needed if (selectOrConfig === "select") { const sources: auth.IPackageSource[] = new Array<auth.IPackageSource>(); const feed = tl.getInput("feedRestore"); if (feed) { const feedUrl: string = await nutil.<API key>( packagingLocation.DefaultPackagingUri, feed, nuGetVersion, accessToken); sources.push({ feedName: feed, feedUri: feedUrl, isInternal: true, }); } const includeNuGetOrg = tl.getBoolInput("includeNuGetOrg", false); if (includeNuGetOrg) { const nuGetSource: auth.IPackageSource = nuGetVersion.productVersion.a < 3 ? auth.<API key> : auth.<API key>; sources.push(nuGetSource); } // Creating NuGet.config for the user if (sources.length > 0) { // tslint:disable-next-line:max-line-length tl.debug(`Adding the following sources to the config file: ${sources.map((x) => x.feedName).join(";")}`); nuGetConfigHelper.<API key>(sources); credCleanup = () => tl.rmRF(nuGetConfigHelper.tempNugetConfigPath); nuGetConfigPath = nuGetConfigHelper.tempNugetConfigPath; } else { tl.debug("No sources were added to the temp NuGet.config file"); } } if (!useV2CredProvider && !configFile) { // Setting creds in the temp NuGet.config if needed await nuGetConfigHelper.set<API key>(); tl.debug('Setting nuget.config auth'); } else { // In case of !!useV2CredProvider, V2 credential provider will handle external credentials tl.debug('No temp nuget.config auth'); } // if configfile has already been set, let it be if (!configFile) { // Use config file if: // - User selected "Select feeds" option // - User selected "NuGet.config" option and the nuGetConfig input has a value let useConfigFile: boolean = selectOrConfig === "select" || (selectOrConfig === "config" && !!nuGetConfigPath); configFile = useConfigFile ? nuGetConfigHelper.tempNugetConfigPath : undefined; if (useConfigFile) { credCleanup = () => tl.rmRF(nuGetConfigHelper.tempNugetConfigPath); } } tl.debug(`ConfigFile: ${configFile}`); try { const restoreOptions = new RestoreOptions( nuGetPath, configFile, noCache, <API key>, verbosity, packagesDirectory, environmentSettings, authInfo); for (const solutionFile of filesList) { restorePackages(solutionFile, restoreOptions); } } finally { credCleanup(); } tl.setResult(tl.TaskResult.Succeeded, tl.loc("<API key>")); } catch (err) { tl.error(err); if (<API key> || <API key>) { tl.warning(tl.loc("<API key>", <API key>, <API key>)); } tl.setResult(tl.TaskResult.Failed, tl.loc("<API key>")); } } function restorePackages(solutionFile: string, options: RestoreOptions): IExecSyncResult { const nugetTool = ngToolRunner.<API key>(options.nuGetPath, options.environment, options.authInfo); nugetTool.arg("restore"); nugetTool.arg(solutionFile); if (options.packagesDirectory) { nugetTool.arg("-PackagesDirectory"); nugetTool.arg(options.packagesDirectory); } if (options.noCache) { nugetTool.arg("-NoCache"); } if (options.<API key>) { nugetTool.arg("-<API key>"); } if (options.verbosity && options.verbosity !== "-") { nugetTool.arg("-Verbosity"); nugetTool.arg(options.verbosity); } nugetTool.arg("-NonInteractive"); if (options.configFile) { nugetTool.arg("-ConfigFile"); nugetTool.arg(options.configFile); } const execResult = nugetTool.execSync({ cwd: path.dirname(solutionFile) } as IExecOptions); if (execResult.code !== 0) { telemetry.logResult("Packaging", "NuGetCommand", execResult.code); throw tl.loc("<API key>", execResult.code, execResult.stderr ? execResult.stderr.trim() : execResult.stderr); } return execResult; }
import _ from 'lodash'; import { createSelector } from 'reselect'; const srcFilesSelector = state => state.srcFiles; const featuresSelector = state => state.features; const featureByIdSelector = state => state.featureById; const keywordSelector = (state, keyword) => keyword; function getMarks(feature, ele) { const marks = []; switch (ele.type) { case 'component': if (ele.connectToStore) marks.push('C'); if (_.find(feature.routes, { component: ele.name })) marks.push('R'); break; case 'action': if (ele.isAsync) marks.push('A'); break; default: break; } return marks; } function <API key>(feature) { const components = feature.components; return { key: `${feature.key}-components`, className: 'components', label: 'Components', icon: 'appstore-o', count: components.length, children: components.map(comp => ({ key: comp.file, className: 'component', label: comp.name, icon: 'appstore-o', searchable: true, marks: getMarks(feature, comp), })), }; } function getActionsTreeData(feature) { const actions = feature.actions; return { key: `${feature.key}-actions`, className: 'actions', label: 'Actions', icon: 'notification', count: actions.length, children: actions.map(action => ({ key: action.file, className: 'action', label: action.name, icon: 'notification', searchable: true, marks: getMarks(feature, action), })), }; } function getChildData(child) { return { key: child.file, className: child.children ? 'misc-folder' : 'misc-file', label: child.name, icon: child.children ? 'folder' : 'file', searchable: !child.children, children: child.children ? child.children.map(getChildData) : null, }; } function getMiscTreeData(feature) { const misc = feature.misc; return { key: `${feature.key}-misc`, className: 'misc', label: 'Misc', icon: 'folder', children: misc.map(getChildData), }; } export const getExplorerTreeData = createSelector( srcFilesSelector, featuresSelector, featureByIdSelector, (srcFiles, features, featureById) => { const featureNodes = features.map((fid) => { const feature = featureById[fid]; return { key: feature.key, className: 'feature', label: feature.name, icon: 'book', children: [ { label: 'Routes', key: `${fid}-routes`, searchable: false, className: 'routes', icon: 'share-alt', count: feature.routes.length }, getActionsTreeData(feature), <API key>(feature), getMiscTreeData(feature), ], }; }); const allNodes = [ { key: 'features', label: 'Features', icon: 'features', children: _.compact(featureNodes), }, { key: 'others-node', label: 'Others', icon: 'folder', children: srcFiles.map(getChildData), } ]; return { root: true, children: allNodes }; } ); function filterTreeNode(node, keyword) { const reg = new RegExp(_.escapeRegExp(keyword), 'i'); return { node, children: _.compact(node.children.map((child) => { if (child.searchable && reg.test(child.label)) return child; if (child.children) { const c = filterTreeNode(child, keyword); return c.children.length > 0 ? c : null; } return null; })), }; } export const <API key> = createSelector( getExplorerTreeData, keywordSelector, (treeData, keyword) => { if (!keyword) return treeData; return filterTreeNode(treeData, keyword); } ); // when searching the tree, all nodes should be expanded, the tree component needs expandedKeys property. export const getExpandedKeys = createSelector( <API key>, (treeData) => { const keys = []; let arr = [...treeData.children]; while (arr.length) { const pop = arr.pop(); if (pop.children) { keys.push(pop.key); arr = [...arr, ...pop.children]; } } return keys; } );
<?php class Receiving_lib { var $CI; function __construct() { $this->CI =& get_instance(); } function get_cart() { if(!$this->CI->session->userdata('cartRecv')) $this->set_cart(array()); return $this->CI->session->userdata('cartRecv'); } function set_cart($cart_data) { $this->CI->session->set_userdata('cartRecv',$cart_data); } function get_supplier() { if(!$this->CI->session->userdata('supplier')) $this->set_supplier(-1); return $this->CI->session->userdata('supplier'); } function set_supplier($supplier_id) { $this->CI->session->set_userdata('supplier',$supplier_id); } function get_mode() { if(!$this->CI->session->userdata('recv_mode')) $this->set_mode('receive'); return $this->CI->session->userdata('recv_mode'); } function set_mode($mode) { $this->CI->session->set_userdata('recv_mode',$mode); } function get_stock_source() { if(!$this->CI->session->userdata('recv_stock_source')) { $location_id = $this->CI->Stock_locations-><API key>(); $this->set_stock_source($location_id); } return $this->CI->session->userdata('recv_stock_source'); } function get_comment() { return $this->CI->session->userdata('comment'); } function set_comment($comment) { $this->CI->session->set_userdata('comment', $comment); } function clear_comment() { $this->CI->session->unset_userdata('comment'); } function get_invoice_number() { return $this->CI->session->userdata('recv_invoice_number'); } function set_invoice_number($invoice_number) { $this->CI->session->set_userdata('recv_invoice_number', $invoice_number); } function <API key>() { $this->CI->session->unset_userdata('recv_invoice_number'); } function set_stock_source($stock_source) { $this->CI->session->set_userdata('recv_stock_source',$stock_source); } function clear_stock_source() { $this->CI->session->unset_userdata('recv_stock_source'); } function <API key>() { if(!$this->CI->session->userdata('<API key>')) { $location_id = $this->CI->Stock_locations-><API key>(); $this-><API key>($location_id); } return $this->CI->session->userdata('<API key>'); } function <API key>($stock_destination) { $this->CI->session->set_userdata('<API key>',$stock_destination); } function <API key>() { $this->CI->session->unset_userdata('<API key>'); } function add_item($item_id,$quantity=1,$item_location,$discount=0,$price=null,$description=null,$serialnumber=null) { //make sure item exists in database. if(!$this->CI->Item->exists($item_id)) { //try to get item id given an item_number $item_id = $this->CI->Item->get_item_id($item_id); if(!$item_id) return false; } //Get items in the receiving so far. $items = $this->get_cart(); //We need to loop through all items in the cart. //If the item is already there, get it's key($updatekey). //We also need to get the next key that we are going to use in case we need to add the //item to the list. Since items can be deleted, we can't use a count. we use the highest key + 1. $maxkey=0; //Highest key so far $itemalreadyinsale=FALSE; //We did not find the item yet. $insertkey=0; //Key to use for new entry. $updatekey=0; //Key to use to update(quantity) foreach ($items as $item) { //We primed the loop so maxkey is 0 the first time. //Also, we have stored the key in the element itself so we can compare. //There is an array function to get the associated key for an element, but I like it better //like that! if($maxkey <= $item['line']) { $maxkey = $item['line']; } if($item['item_id']==$item_id && $item['item_location']==$item_location) { $itemalreadyinsale=TRUE; $updatekey=$item['line']; } } $insertkey=$maxkey+1; $item_info=$this->CI->Item->get_info($item_id,$item_location); //array records are identified by $insertkey and item_id is just another field. $item = array(($insertkey)=> array( 'item_id'=>$item_id, 'item_location'=>$item_location, 'stock_name'=>$this->CI->Stock_locations->get_location_name($item_location), 'line'=>$insertkey, 'name'=>$item_info->name, 'description'=>$description!=null ? $description: $item_info->description, 'serialnumber'=>$serialnumber!=null ? $serialnumber: '', '<API key>'=>$item_info-><API key>, 'is_serialized'=>$item_info->is_serialized, 'quantity'=>$quantity, 'discount'=>$discount, 'in_stock'=>$this->CI->Item_quantities->get_item_quantity($item_id, $item_location)->quantity, 'price'=>$price!=null ? $price: $item_info->cost_price ) ); //Item already exists if($itemalreadyinsale) { $items[$updatekey]['quantity']+=$quantity; } else { //add to existing array $items+=$item; } $this->set_cart($items); return true; } function edit_item($line,$description,$serialnumber,$quantity,$discount,$price) { $items = $this->get_cart(); if(isset($items[$line])) { $items[$line]['description'] = $description; $items[$line]['serialnumber'] = $serialnumber; $items[$line]['quantity'] = $quantity; $items[$line]['discount'] = $discount; $items[$line]['price'] = $price; $this->set_cart($items); } return false; } function is_valid_receipt($<API key>) { //RECV $pieces = explode(' ',$<API key>); if(count($pieces)==2) { return $this->CI->Receiving->exists($pieces[1]); } else { return $this->CI->Receiving-><API key>($<API key>)->num_rows() > 0; } return false; } function is_valid_item_kit($item_kit_id) { //KIT $pieces = explode(' ',$item_kit_id); if(count($pieces)==2) { return $this->CI->Item_kit->exists($pieces[1]); } return false; } function <API key>($<API key>) { //POS $pieces = explode(' ',$<API key>); if ($pieces[0] == "RECV") { $receiving_id = $pieces[1]; } else { $receiving = $this->CI->Receiving-><API key>($<API key>)->row(); $receiving_id = $receiving->receiving_id; } $this->empty_cart(); $this->delete_supplier(); $this->clear_comment(); foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row) { $this->add_item($row->item_id,-$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber); } $this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id); } function add_item_kit($<API key>,$item_location) { //KIT $pieces = explode(' ',$<API key>); $item_kit_id = $pieces[1]; foreach ($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item) { $this->add_item($item_kit_item['item_id'],$item_kit_item['quantity'],$item_location); } } function <API key>($receiving_id) { $this->empty_cart(); $this->delete_supplier(); foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row) { $this->add_item($row->item_id,$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber); } $this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id); $receiving_info=$this->CI->Receiving->get_info($receiving_id); //$this->set_invoice_number($receiving_info->row()->invoice_number); } function <API key>($requisition_id,$item_location) { $this->empty_cart(); $this->delete_supplier(); foreach($this->CI->Receiving-><API key>($requisition_id)->result() as $row) { $this->add_item_unit($row->item_id,$row-><API key>,$item_location,$row->description); } $this->set_supplier($this->CI->Receiving->get_supplier($requisition_id)->person_id); $receiving_info=$this->CI->Receiving->get_info($receiving_id); //$this->set_invoice_number($receiving_info->row()->invoice_number); } function delete_item($line) { $items=$this->get_cart(); unset($items[$line]); $this->set_cart($items); } function empty_cart() { $this->CI->session->unset_userdata('cartRecv'); } function delete_supplier() { $this->CI->session->unset_userdata('supplier'); } function clear_mode() { $this->CI->session->unset_userdata('receiving_mode'); } function clear_all() { $this->clear_mode(); $this->empty_cart(); $this->delete_supplier(); $this->clear_comment(); $this-><API key>(); } function get_item_total($quantity, $price, $discount_percentage) { $total = bcmul($quantity, $price, PRECISION); $discount_fraction = bcdiv($discount_percentage, 100, PRECISION); $discount_amount = bcmul($total, $discount_fraction, PRECISION); return bcsub($total, $discount_amount, PRECISION); } function get_total() { $total = 0; foreach($this->get_cart() as $item) { $total += $this->get_item_total($item['quantity'], $item['price'], $item['discount']); } return $total; } } ?>
package com.mauriciotogneri.apply.compiler.syntactic.nodes.arithmetic; import com.mauriciotogneri.apply.compiler.lexical.Token; import com.mauriciotogneri.apply.compiler.syntactic.TreeNode; import com.mauriciotogneri.apply.compiler.syntactic.nodes.<API key>; public class <API key> extends <API key> { public <API key>(Token token, TreeNode left, TreeNode right) { super(token, left, right); } @Override public String sourceCode() { return String.format("mod(%s, %s)", left.sourceCode(), right.sourceCode()); } }
#LocalFolderPathStr=${PWD} #LocalFilePathStr=$LocalFolderPathStr'/.pypirc' #HomeFilePathStr=$HOME'/.pypirc' #echo $LocalFilePathStr #echo $HomeFilePathStr #cp $LocalFilePathStr $HomeFilePathStr python setup.py register sudo python setup.py sdist upload
import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; @Component({ selector: 'app-user', template: '<router-outlet></router-outlet>' }) export class UserComponent implements OnInit { constructor(public router: Router) { } ngOnInit() { if (this.router.url === '/user') { this.router.navigate(['/dashboard']); } } }
# coding: utf-8 from sqlalchemy.testing import eq_, assert_raises, <API key>, \ config, is_ import re from sqlalchemy.testing.util import picklers from sqlalchemy.interfaces import ConnectionProxy from sqlalchemy import MetaData, Integer, String, INT, VARCHAR, func, \ bindparam, select, event, TypeDecorator, create_engine, Sequence from sqlalchemy.sql import column, literal from sqlalchemy.testing.schema import Table, Column import sqlalchemy as tsa from sqlalchemy import testing from sqlalchemy.testing import engines from sqlalchemy import util from sqlalchemy.testing.engines import testing_engine import logging.handlers from sqlalchemy.dialects.oracle.zxjdbc import ReturningParam from sqlalchemy.engine import result as _result, default from sqlalchemy.engine.base import Engine from sqlalchemy.testing import fixtures from sqlalchemy.testing.mock import Mock, call, patch from contextlib import contextmanager users, metadata, users_autoinc = None, None, None class ExecuteTest(fixtures.TestBase): __backend__ = True @classmethod def setup_class(cls): global users, users_autoinc, metadata metadata = MetaData(testing.db) users = Table('users', metadata, Column('user_id', INT, primary_key=True, autoincrement=False), Column('user_name', VARCHAR(20)), ) users_autoinc = Table('users_autoinc', metadata, Column('user_id', INT, primary_key=True, <API key>=True), Column('user_name', VARCHAR(20)), ) metadata.create_all() @engines.close_first def teardown(self): testing.db.execute(users.delete()) @classmethod def teardown_class(cls): metadata.drop_all() @testing.fails_on("postgresql+pg8000", "pg8000 still doesn't allow single % without params") def <API key>(self): stmt = "SELECT '%'" + testing.db.dialect.statement_compiler( testing.db.dialect, None).default_from() conn = testing.db.connect() result = conn.\ execution_options(no_parameters=True).\ scalar(stmt) eq_(result, '%') @testing.<API key>('firebird', 'sqlite', '+pyodbc', '+mxodbc', '+zxjdbc', 'mysql+oursql') def test_raw_qmark(self): def go(conn): conn.execute('insert into users (user_id, user_name) ' 'values (?, ?)', (1, 'jack')) conn.execute('insert into users (user_id, user_name) ' 'values (?, ?)', [2, 'fred']) conn.execute('insert into users (user_id, user_name) ' 'values (?, ?)', [3, 'ed'], [4, 'horse']) conn.execute('insert into users (user_id, user_name) ' 'values (?, ?)', (5, 'barney'), (6, 'donkey')) conn.execute('insert into users (user_id, user_name) ' 'values (?, ?)', 7, 'sally') res = conn.execute('select * from users order by user_id') assert res.fetchall() == [ (1, 'jack'), (2, 'fred'), (3, 'ed'), (4, 'horse'), (5, 'barney'), (6, 'donkey'), (7, 'sally'), ] for multiparam, param in [ (("jack", "fred"), {}), ((["jack", "fred"],), {}) ]: res = conn.execute( "select * from users where user_name=? or " "user_name=? order by user_id", *multiparam, **param) assert res.fetchall() == [ (1, 'jack'), (2, 'fred') ] res = conn.execute("select * from users where user_name=?", "jack" ) assert res.fetchall() == [(1, 'jack')] conn.execute('delete from users') go(testing.db) conn = testing.db.connect() try: go(conn) finally: conn.close() # some psycopg2 versions bomb this. @testing.<API key>('mysql+mysqldb', 'mysql+pymysql', 'mysql+cymysql', 'mysql+mysqlconnector', 'postgresql') @testing.fails_on('postgresql+zxjdbc', 'sprintf not supported') def test_raw_sprintf(self): def go(conn): conn.execute('insert into users (user_id, user_name) ' 'values (%s, %s)', [1, 'jack']) conn.execute('insert into users (user_id, user_name) ' 'values (%s, %s)', [2, 'ed'], [3, 'horse']) conn.execute('insert into users (user_id, user_name) ' 'values (%s, %s)', 4, 'sally') conn.execute('insert into users (user_id) values (%s)', 5) res = conn.execute('select * from users order by user_id') assert res.fetchall() == [(1, 'jack'), (2, 'ed'), (3, 'horse'), (4, 'sally'), (5, None)] for multiparam, param in [ (("jack", "ed"), {}), ((["jack", "ed"],), {}) ]: res = conn.execute( "select * from users where user_name=%s or " "user_name=%s order by user_id", *multiparam, **param) assert res.fetchall() == [ (1, 'jack'), (2, 'ed') ] res = conn.execute("select * from users where user_name=%s", "jack" ) assert res.fetchall() == [(1, 'jack')] conn.execute('delete from users') go(testing.db) conn = testing.db.connect() try: go(conn) finally: conn.close() # pyformat is supported for mysql, but skipping because a few driver # versions have a bug that bombs out on this test. (1.2.2b3, # 1.2.2c1, 1.2.2) @testing.skip_if(lambda : testing.against('mysql+mysqldb'), 'db-api flaky') @testing.<API key>('postgresql+psycopg2', 'postgresql+pypostgresql', 'mysql+mysqlconnector', 'mysql+pymysql', 'mysql+cymysql') def test_raw_python(self): def go(conn): conn.execute('insert into users (user_id, user_name) ' 'values (%(id)s, %(name)s)', {'id': 1, 'name' : 'jack'}) conn.execute('insert into users (user_id, user_name) ' 'values (%(id)s, %(name)s)', {'id': 2, 'name' : 'ed'}, {'id': 3, 'name': 'horse'}) conn.execute('insert into users (user_id, user_name) ' 'values (%(id)s, %(name)s)', id=4, name='sally' ) res = conn.execute('select * from users order by user_id') assert res.fetchall() == [(1, 'jack'), (2, 'ed'), (3, 'horse'), (4, 'sally')] conn.execute('delete from users') go(testing.db) conn = testing.db.connect() try: go(conn) finally: conn.close() @testing.<API key>('sqlite', 'oracle+cx_oracle') def test_raw_named(self): def go(conn): conn.execute('insert into users (user_id, user_name) ' 'values (:id, :name)', {'id': 1, 'name': 'jack' }) conn.execute('insert into users (user_id, user_name) ' 'values (:id, :name)', {'id': 2, 'name': 'ed' }, {'id': 3, 'name': 'horse'}) conn.execute('insert into users (user_id, user_name) ' 'values (:id, :name)', id=4, name='sally') res = conn.execute('select * from users order by user_id') assert res.fetchall() == [(1, 'jack'), (2, 'ed'), (3, 'horse'), (4, 'sally')] conn.execute('delete from users') go(testing.db) conn= testing.db.connect() try: go(conn) finally: conn.close() @testing.engines.<API key> def <API key>(self): conn = testing.db.connect() for _c in testing.db, conn: <API key>( tsa.exc.DBAPIError, r"<API key>", _c.execute, '<API key>' ) @testing.requires.sqlite def <API key>(self): e = create_engine('sqlite: e.dialect.is_disconnect = is_disconnect = Mock() with e.connect() as c: c.connection.cursor = Mock( return_value=Mock( execute=Mock( side_effect=TypeError("I'm not a DBAPI error") )) ) <API key>( TypeError, "I'm not a DBAPI error", c.execute, "select " ) eq_(is_disconnect.call_count, 0) def <API key>(self): class MyType(TypeDecorator): impl = Integer def process_bind_param(self, value, dialect): raise Exception("nope") def _go(conn): <API key>( tsa.exc.StatementError, r"nope \(original cause: Exception: nope\) u?'SELECT 1 ", conn.execute, select([1]).\ where( column('foo') == literal('bar', MyType()) ) ) _go(testing.db) conn = testing.db.connect() try: _go(conn) finally: conn.close() def <API key>(self): name = util.u('méil') with testing.db.connect() as conn: <API key>( tsa.exc.StatementError, util.u( "A value is required for bind parameter 'uname'" r'.*SELECT users.user_name AS .m\\xe9il.') if util.py2k else util.u( "A value is required for bind parameter 'uname'" '.*SELECT users.user_name AS .méil.') , conn.execute, select([users.c.user_name.label(name)]).where( users.c.user_name == bindparam("uname")), {'uname_incorrect': 'foo'} ) def <API key>(self): self.<API key>(Exception("hello world")) @testing.crashes("postgresql+psycopg2", "Older versions don't support cursor pickling, newer ones do") @testing.fails_on("mysql+oursql", "Exception doesn't come back exactly the same from pickle") @testing.fails_on("mysql+mysqlconnector", "Exception doesn't come back exactly the same from pickle") @testing.fails_on("oracle+cx_oracle", "cx_oracle exception seems to be having " "some issue with pickling") def <API key>(self): raw = testing.db.raw_connection() the_orig = None try: try: cursor = raw.cursor() cursor.execute("SELECTINCORRECT") except testing.db.dialect.dbapi.DatabaseError as orig: # py3k has "orig" in local scope... the_orig = orig finally: raw.close() self.<API key>(the_orig) def <API key>(self, orig): for sa_exc in ( tsa.exc.StatementError("some error", "select * from table", {"foo":"bar"}, orig), tsa.exc.InterfaceError("select * from table", {"foo":"bar"}, orig), tsa.exc.<API key>("message", "tname"), tsa.exc.<API key>("message", "tname", "cname"), tsa.exc.<API key>("some message", [1, 2, 3], [(1, 2), (3, 4)]), ): for loads, dumps in picklers(): repickled = loads(dumps(sa_exc)) eq_(repickled.args[0], sa_exc.args[0]) if isinstance(sa_exc, tsa.exc.StatementError): eq_(repickled.params, {"foo":"bar"}) eq_(repickled.statement, sa_exc.statement) if hasattr(sa_exc, "<API key>"): eq_(repickled.<API key>, sa_exc.<API key>) eq_(repickled.orig.args[0], orig.args[0]) def <API key>(self): class MyException(Exception, tsa.exc.DontWrapMixin): pass class MyType(TypeDecorator): impl = Integer def process_bind_param(self, value, dialect): raise MyException("nope") def _go(conn): <API key>( MyException, "nope", conn.execute, select([1]).\ where( column('foo') == literal('bar', MyType()) ) ) _go(testing.db) conn = testing.db.connect() try: _go(conn) finally: conn.close() def test_empty_insert(self): """test that execute() interprets [] as a list with no params""" testing.db.execute(users_autoinc.insert(). values(user_name=bindparam('name', None)), []) eq_(testing.db.execute(users_autoinc.select()).fetchall(), [(1, None)]) @testing.requires.ad_hoc_engines def <API key>(self): eng = engines.testing_engine(options={'execution_options': {'foo': 'bar'}}) with eng.contextual_connect() as conn: eq_(conn._execution_options['foo'], 'bar') eq_(conn.execution_options(bat='hoho')._execution_options['foo' ], 'bar') eq_(conn.execution_options(bat='hoho')._execution_options['bat' ], 'hoho') eq_(conn.execution_options(foo='hoho')._execution_options['foo' ], 'hoho') eng.<API key>(foo='hoho') conn = eng.contextual_connect() eq_(conn._execution_options['foo'], 'hoho') @testing.requires.ad_hoc_engines def <API key>(self): eng = engines.testing_engine(options={'execution_options': {'base': 'x1'}}) eng1 = eng.execution_options(foo="b1") eng2 = eng.execution_options(foo="b2") eng1a = eng1.execution_options(bar="a1") eng2a = eng2.execution_options(foo="b3", bar="a2") eq_(eng._execution_options, {'base': 'x1'}) eq_(eng1._execution_options, {'base': 'x1', 'foo': 'b1'}) eq_(eng2._execution_options, {'base': 'x1', 'foo': 'b2'}) eq_(eng1a._execution_options, {'base': 'x1', 'foo': 'b1', 'bar': 'a1'}) eq_(eng2a._execution_options, {'base': 'x1', 'foo': 'b3', 'bar': 'a2'}) is_(eng1a.pool, eng.pool) # test pool is shared eng2.dispose() is_(eng1a.pool, eng2.pool) is_(eng.pool, eng2.pool) @testing.requires.ad_hoc_engines def <API key>(self): canary = [] def l1(*arg, **kw): canary.append("l1") def l2(*arg, **kw): canary.append("l2") def l3(*arg, **kw): canary.append("l3") eng = engines.testing_engine(options={'execution_options': {'base': 'x1'}}) event.listen(eng, "before_execute", l1) eng1 = eng.execution_options(foo="b1") event.listen(eng, "before_execute", l2) event.listen(eng1, "before_execute", l3) eng.execute(select([1])).close() eng1.execute(select([1])).close() eq_(canary, ["l1", "l2", "l3", "l1", "l2"]) @testing.requires.ad_hoc_engines def <API key>(self): def l1(*arg, **kw): pass eng = create_engine(testing.db.url) assert not eng._has_events event.listen(eng, "before_execute", l1) eng2 = eng.execution_options(foo='bar') assert eng2._has_events def <API key>(self): class MockCursor(engines.DBAPIProxyCursor): def execute(self, stmt, params=None, **kw): if "test unicode returns" in stmt: raise self.engine.dialect.dbapi.DatabaseError("boom") else: return super(MockCursor, self).execute(stmt, params, **kw) eng = engines.proxying_engine(cursor_cls=MockCursor) <API key>( tsa.exc.SAWarning, "Exception attempting to detect unicode returns", eng.connect ) assert eng.dialect.<API key> in (True, False) eng.dispose() def <API key>(self): eng = create_engine(testing.db.url) for i in range(3): eq_(eng.scalar(select([1])), 1) eng.dispose() def <API key>(self): eng = engines.testing_engine() for i in range(3): eq_(eng.scalar(select([1])), 1) eng.dispose() class <API key>(fixtures.TablesTest): __backend__ = True @classmethod def define_tables(cls, metadata): cls.table = Table('exec_test', metadata, Column('a', Integer), Column('b', Integer), test_needs_acid=True ) def _trans_fn(self, is_transaction=False): def go(conn, x, value=None): if is_transaction: conn = conn.connection conn.execute(self.table.insert().values(a=x, b=value)) return go def _trans_rollback_fn(self, is_transaction=False): def go(conn, x, value=None): if is_transaction: conn = conn.connection conn.execute(self.table.insert().values(a=x, b=value)) raise Exception("breakage") return go def _assert_no_data(self): eq_( testing.db.scalar(self.table.count()), 0 ) def _assert_fn(self, x, value=None): eq_( testing.db.execute(self.table.select()).fetchall(), [(x, value)] ) def <API key>(self): fn = self._trans_fn() ctx = testing.db.begin() testing.<API key>(ctx, fn, 5, value=8) self._assert_fn(5, value=8) def <API key>(self): engine = engines.testing_engine() mock_connection = Mock( return_value=Mock( begin=Mock(side_effect=Exception("boom")) ) ) engine._connection_cls = mock_connection assert_raises( Exception, engine.begin ) eq_( mock_connection.return_value.close.mock_calls, [call()] ) def <API key>(self): fn = self._trans_rollback_fn() ctx = testing.db.begin() <API key>( Exception, "breakage", testing.<API key>, ctx, fn, 5, value=8 ) self._assert_no_data() def <API key>(self): fn = self._trans_fn() engine = engines.testing_engine(options=dict( strategy='threadlocal', pool=testing.db.pool)) ctx = engine.begin() testing.<API key>(ctx, fn, 5, value=8) self._assert_fn(5, value=8) def <API key>(self): fn = self._trans_rollback_fn() engine = engines.testing_engine(options=dict( strategy='threadlocal', pool=testing.db.pool)) ctx = engine.begin() <API key>( Exception, "breakage", testing.<API key>, ctx, fn, 5, value=8 ) self._assert_no_data() def <API key>(self): fn = self._trans_fn(True) conn = testing.db.connect() ctx = conn.begin() testing.<API key>(ctx, fn, 5, value=8) self._assert_fn(5, value=8) def <API key>(self): fn = self._trans_rollback_fn(True) conn = testing.db.connect() ctx = conn.begin() <API key>( Exception, "breakage", testing.<API key>, ctx, fn, 5, value=8 ) self._assert_no_data() def <API key>(self): fn = self._trans_fn() ctx = testing.db.connect() testing.<API key>(ctx, fn, 5, value=8) # autocommit is on self._assert_fn(5, value=8) @testing.fails_on('mysql+oursql', "oursql bug ? getting wrong rowcount") def <API key>(self): fn = self._trans_fn() self._assert_no_data() ctx = testing.db.connect().execution_options(autocommit=False) testing.<API key>(ctx, fn, 5, value=8) # autocommit is off self._assert_no_data() def <API key>(self): fn = self._trans_fn() testing.db.transaction(fn, 5, value=8) self._assert_fn(5, value=8) def <API key>(self): fn = self._trans_rollback_fn() <API key>( Exception, "breakage", testing.db.transaction, fn, 5, value=8 ) self._assert_no_data() def <API key>(self): fn = self._trans_fn() conn = testing.db.connect() conn.transaction(fn, 5, value=8) self._assert_fn(5, value=8) def <API key>(self): fn = self._trans_rollback_fn() conn = testing.db.connect() assert_raises( Exception, conn.transaction, fn, 5, value=8 ) self._assert_no_data() class CompiledCacheTest(fixtures.TestBase): __backend__ = True @classmethod def setup_class(cls): global users, metadata metadata = MetaData(testing.db) users = Table('users', metadata, Column('user_id', INT, primary_key=True, <API key>=True), Column('user_name', VARCHAR(20)), ) metadata.create_all() @engines.close_first def teardown(self): testing.db.execute(users.delete()) @classmethod def teardown_class(cls): metadata.drop_all() def test_cache(self): conn = testing.db.connect() cache = {} cached_conn = conn.execution_options(compiled_cache=cache) ins = users.insert() cached_conn.execute(ins, {'user_name':'u1'}) cached_conn.execute(ins, {'user_name':'u2'}) cached_conn.execute(ins, {'user_name':'u3'}) assert len(cache) == 1 eq_(conn.execute("select count(*) from users").scalar(), 3) class MockStrategyTest(fixtures.TestBase): def _engine_fixture(self): buf = util.StringIO() def dump(sql, *multiparams, **params): buf.write(util.text_type(sql.compile(dialect=engine.dialect))) engine = create_engine('postgresql://', strategy='mock', executor=dump) return engine, buf def <API key>(self): engine, buf = self._engine_fixture() metadata = MetaData() t = Table('testtable', metadata, Column('pk', Integer, Sequence('testtable_pk_seq'), primary_key=True) ) t.create(engine) t.drop(engine) eq_( re.findall(r'CREATE (\w+)', buf.getvalue()), ["SEQUENCE", "TABLE"] ) eq_( re.findall(r'DROP (\w+)', buf.getvalue()), ["SEQUENCE", "TABLE"] ) class ResultProxyTest(fixtures.TestBase): __backend__ = True def test_nontuple_row(self): """ensure the C version of BaseRowProxy handles duck-type-dependent rows.""" from sqlalchemy.engine import RowProxy class MyList(object): def __init__(self, l): self.l = l def __len__(self): return len(self.l) def __getitem__(self, i): return list.__getitem__(self.l, i) proxy = RowProxy(object(), MyList(['value']), [None], {'key' : (None, None, 0), 0: (None, None, 0)}) eq_(list(proxy), ['value']) eq_(proxy[0], 'value') eq_(proxy['key'], 'value') @testing.provide_metadata def <API key>(self): """assert that rowcount is only called on deletes and updates. This because cursor.rowcount may can be expensive on some dialects such as Firebird, however many dialects require it be called before the cursor is closed. """ metadata = self.metadata engine = engines.testing_engine() t = Table('t1', metadata, Column('data', String(10)) ) metadata.create_all(engine) with patch.object(engine.dialect.execution_ctx_cls, "rowcount") as mock_rowcount: mock_rowcount.__get__ = Mock() engine.execute(t.insert(), {'data': 'd1'}, {'data': 'd2'}, {'data': 'd3'}) eq_(len(mock_rowcount.__get__.mock_calls), 0) eq_( engine.execute(t.select()).fetchall(), [('d1', ), ('d2', ), ('d3', )] ) eq_(len(mock_rowcount.__get__.mock_calls), 0) engine.execute(t.update(), {'data': 'd4'}) eq_(len(mock_rowcount.__get__.mock_calls), 1) engine.execute(t.delete()) eq_(len(mock_rowcount.__get__.mock_calls), 2) def <API key>(self): import collections from sqlalchemy.engine import RowProxy row = RowProxy(object(), ['value'], [None], {'key' : (None, None, 0), 0: (None, None, 0)}) assert isinstance(row, collections.Sequence) @testing.requires.cextensions def <API key>(self): import csv import collections metadata = MetaData() metadata.bind = 'sqlite: users = Table('users', metadata, Column('id', Integer, primary_key=True), Column('name', String(40)), ) users.create() users.insert().execute(name='Test') row = users.select().execute().fetchone() s = util.StringIO() writer = csv.writer(s) # csv performs PySequenceCheck call writer.writerow(row) assert s.getvalue().strip() == '1,Test' @testing.requires.selectone def <API key>(self): statements = [ ( "select 1", [ lambda r: r.<API key>(), lambda r: r.last_updated_params(), lambda r: r.prefetch_cols(), lambda r: r.postfetch_cols(), lambda r : r.<API key> ], "Statement is not a compiled expression construct." ), ( select([1]), [ lambda r: r.<API key>(), lambda r : r.<API key> ], r"Statement is not an insert\(\) expression construct." ), ( select([1]), [ lambda r: r.last_updated_params(), ], r"Statement is not an update\(\) expression construct." ), ( select([1]), [ lambda r: r.prefetch_cols(), lambda r : r.postfetch_cols() ], r"Statement is not an insert\(\) " r"or update\(\) expression construct." ), ] for stmt, meths, msg in statements: r = testing.db.execute(stmt) try: for meth in meths: <API key>( tsa.exc.InvalidRequestError, msg, meth, r ) finally: r.close() class <API key>(fixtures.TestBase): def <API key>(self): engine = testing_engine("sqlite://", options=dict(_initialize=False)) engine.dialect = Mock() conn = engine.connect() c2 = conn.execution_options(foo="bar") eq_( engine.dialect.<API key>.mock_calls, [call(c2, {"foo": "bar"})] ) def <API key>(self): engine = testing_engine("sqlite: engine.dialect = Mock() e2 = engine.execution_options(foo="bar") eq_( engine.dialect.<API key>.mock_calls, [call(e2, {"foo": "bar"})] ) def <API key>(self): dialect = Mock() engine = Engine(Mock(), dialect, Mock(), execution_options={"foo": "bar"}) eq_( dialect.<API key>.mock_calls, [call(engine, {"foo": "bar"})] ) def <API key>(self): engine = testing_engine("sqlite: options=dict(execution_options={"foo": "bar"})) conn = engine.connect() eq_(conn._execution_options, {"foo": "bar"}) def <API key>(self): e1 = testing_engine("sqlite: options=dict(execution_options={"foo": "bar"})) e2 = e1.execution_options(bat="hoho") c1 = e1.connect() c2 = e2.connect() eq_(c1._execution_options, {"foo": "bar"}) eq_(c2._execution_options, {"foo": "bar", "bat": "hoho"}) class <API key>(fixtures.TestBase): __requires__ = ('sqlite', ) @classmethod def setup_class(cls): from sqlalchemy.engine import base, default cls.engine = engine = testing_engine('sqlite: m = MetaData() cls.table = t = Table('test', m, Column('x', Integer, primary_key=True), Column('y', String(50, convert_unicode='force')) ) m.create_all(engine) engine.execute(t.insert(), [ {'x':i, 'y':"t_%d" % i} for i in range(1, 12) ]) def _test_proxy(self, cls): class ExcCtx(default.<API key>): def get_result_proxy(self): return cls(self) self.engine.dialect.execution_ctx_cls = ExcCtx rows = [] r = self.engine.execute(select([self.table])) assert isinstance(r, cls) for i in range(5): rows.append(r.fetchone()) eq_(rows, [(i, "t_%d" % i) for i in range(1, 6)]) rows = r.fetchmany(3) eq_(rows, [(i, "t_%d" % i) for i in range(6, 9)]) rows = r.fetchall() eq_(rows, [(i, "t_%d" % i) for i in range(9, 12)]) r = self.engine.execute(select([self.table])) rows = r.fetchmany(None) eq_(rows[0], (1, "t_1")) # number of rows here could be one, or the whole thing assert len(rows) == 1 or len(rows) == 11 r = self.engine.execute(select([self.table]).limit(1)) r.fetchone() eq_(r.fetchone(), None) r = self.engine.execute(select([self.table]).limit(5)) rows = r.fetchmany(6) eq_(rows, [(i, "t_%d" % i) for i in range(1, 6)]) def test_plain(self): self._test_proxy(_result.ResultProxy) def <API key>(self): self._test_proxy(_result.<API key>) def <API key>(self): self._test_proxy(_result.<API key>) def <API key>(self): self._test_proxy(_result.<API key>) class EngineEventsTest(fixtures.TestBase): __requires__ = 'ad_hoc_engines', __backend__ = True def tearDown(self): Engine.dispatch._clear() Engine._has_events = False def _assert_stmts(self, expected, received): orig = list(received) for stmt, params, posn in expected: if not received: assert False, "Nothing available for stmt: %s" % stmt while received: teststmt, testparams, testmultiparams = \ received.pop(0) teststmt = re.compile(r'[\n\t ]+', re.M).sub(' ', teststmt).strip() if teststmt.startswith(stmt) and (testparams == params or testparams == posn): break def <API key>(self): e1 = testing_engine(config.db_url) e2 = testing_engine(config.db_url) canary = Mock() event.listen(e1, "before_execute", canary) s1 = select([1]) s2 = select([2]) e1.execute(s1) e2.execute(s2) eq_( [arg[1][1] for arg in canary.mock_calls], [s1] ) event.listen(e2, "before_execute", canary) e1.execute(s1) e2.execute(s2) eq_([arg[1][1] for arg in canary.mock_calls], [s1, s1, s2]) def <API key>(self): canary = Mock() event.listen(Engine, "before_execute", canary.be1) e1 = testing_engine(config.db_url) e2 = testing_engine(config.db_url) event.listen(e1, "before_execute", canary.be2) event.listen(Engine, "before_execute", canary.be3) e1.connect() e2.connect() e1.execute(select([1])) eq_(canary.be1.call_count, 1) eq_(canary.be2.call_count, 1) e2.execute(select([1])) eq_(canary.be1.call_count, 2) eq_(canary.be2.call_count, 1) eq_(canary.be3.call_count, 2) def <API key>(self): canary = Mock() e1 = testing_engine(config.db_url) event.listen(e1, "before_execute", canary.be1) conn = e1.connect() event.listen(conn, "before_execute", canary.be2) conn.execute(select([1])) eq_(canary.be1.call_count, 1) eq_(canary.be2.call_count, 1) conn._branch().execute(select([1])) eq_(canary.be1.call_count, 2) eq_(canary.be2.call_count, 2) def <API key>(self): # new feature as of #2978 canary = Mock() e1 = create_engine(config.db_url) assert not e1._has_events conn = e1.connect() event.listen(e1, "before_execute", canary.be1) conn.execute(select([1])) eq_(canary.be1.call_count, 1) conn._branch().execute(select([1])) eq_(canary.be1.call_count, 2) def <API key>(self): canary = Mock() e1 = create_engine(config.db_url) assert not e1._has_events event.listen(e1, "before_execute", canary.be1) conn = e1._connection_cls(e1, connection=e1.raw_connection(), _has_events=False) conn.execute(select([1])) eq_(canary.be1.call_count, 0) conn._branch().execute(select([1])) eq_(canary.be1.call_count, 0) def <API key>(self): canary = Mock() e1 = testing_engine(config.db_url) event.listen(e1, "<API key>", canary.bce) event.listen(e1, "<API key>", canary.ace) stmt = str(select([1]).compile(dialect=e1.dialect)) with e1.connect() as conn: dialect = conn.dialect ctx = dialect.execution_ctx_cls._init_statement( dialect, conn, conn.connection, stmt, {}) ctx._execute_scalar(stmt, Integer()) eq_(canary.bce.mock_calls, [call(conn, ctx.cursor, stmt, ctx.parameters[0], ctx, False)]) eq_(canary.ace.mock_calls, [call(conn, ctx.cursor, stmt, ctx.parameters[0], ctx, False)]) def <API key>(self): canary = Mock() e1 = testing_engine(config.db_url) event.listen(e1, "<API key>", canary.bce) event.listen(e1, "<API key>", canary.ace) stmt = str(select([1]).compile(dialect=e1.dialect)) with e1.connect() as conn: result = conn.execute(stmt) ctx = result.context eq_(canary.bce.mock_calls, [call(conn, ctx.cursor, stmt, ctx.parameters[0], ctx, False)]) eq_(canary.ace.mock_calls, [call(conn, ctx.cursor, stmt, ctx.parameters[0], ctx, False)]) def <API key>(self): def before_execute(conn, clauseelement, multiparams, params): assert isinstance(multiparams, (list, tuple)) assert isinstance(params, dict) def after_execute(conn, clauseelement, multiparams, params, result): assert isinstance(multiparams, (list, tuple)) assert isinstance(params, dict) e1 = testing_engine(config.db_url) event.listen(e1, 'before_execute', before_execute) event.listen(e1, 'after_execute', after_execute) e1.execute(select([1])) e1.execute(select([1]).compile(dialect=e1.dialect).statement) e1.execute(select([1]).compile(dialect=e1.dialect)) e1._execute_compiled(select([1]).compile(dialect=e1.dialect), (), {}) @testing.fails_on('firebird', 'Data type unknown') def test_execute_events(self): stmts = [] cursor_stmts = [] def execute(conn, clauseelement, multiparams, params ): stmts.append((str(clauseelement), params, multiparams)) def cursor_execute(conn, cursor, statement, parameters, context, executemany): cursor_stmts.append((str(statement), parameters, None)) for engine in [ engines.testing_engine(options=dict(implicit_returning=False)), engines.testing_engine(options=dict(implicit_returning=False, strategy='threadlocal')), engines.testing_engine(options=dict(implicit_returning=False)).\ connect() ]: event.listen(engine, 'before_execute', execute) event.listen(engine, '<API key>', cursor_execute) m = MetaData(engine) t1 = Table('t1', m, Column('c1', Integer, primary_key=True), Column('c2', String(50), default=func.lower('Foo'), primary_key=True) ) m.create_all() try: t1.insert().execute(c1=5, c2='some data') t1.insert().execute(c1=6) eq_(engine.execute('select * from t1').fetchall(), [(5, 'some data'), (6, 'foo')]) finally: m.drop_all() compiled = [('CREATE TABLE t1', {}, None), ('INSERT INTO t1 (c1, c2)', {'c2': 'some data', 'c1': 5}, None), ('INSERT INTO t1 (c1, c2)', {'c1': 6}, None), ('select * from t1', {}, None), ('DROP TABLE t1', {}, None)] # or engine.dialect.<API key>: if not testing.against('oracle+zxjdbc'): cursor = [ ('CREATE TABLE t1', {}, ()), ('INSERT INTO t1 (c1, c2)', { 'c2': 'some data', 'c1': 5}, (5, 'some data')), ('SELECT lower', {'lower_2': 'Foo'}, ('Foo', )), ('INSERT INTO t1 (c1, c2)', {'c2': 'foo', 'c1': 6}, (6, 'foo')), ('select * from t1', {}, ()), ('DROP TABLE t1', {}, ()), ] else: insert2_params = 6, 'Foo' if testing.against('oracle+zxjdbc'): insert2_params += (ReturningParam(12), ) cursor = [('CREATE TABLE t1', {}, ()), ('INSERT INTO t1 (c1, c2)', {'c2': 'some data', 'c1': 5}, (5, 'some data')), ('INSERT INTO t1 (c1, c2)', {'c1': 6, 'lower_2': 'Foo'}, insert2_params), ('select * from t1', {}, ()), ('DROP TABLE t1', {}, ())] # bind param name 'lower_2' might # be incorrect self._assert_stmts(compiled, stmts) self._assert_stmts(cursor, cursor_stmts) def test_options(self): canary = [] def execute(conn, *args, **kw): canary.append('execute') def cursor_execute(conn, *args, **kw): canary.append('cursor_execute') engine = engines.testing_engine() event.listen(engine, 'before_execute', execute) event.listen(engine, '<API key>', cursor_execute) conn = engine.connect() c2 = conn.execution_options(foo='bar') eq_(c2._execution_options, {'foo':'bar'}) c2.execute(select([1])) c3 = c2.execution_options(bar='bat') eq_(c3._execution_options, {'foo':'bar', 'bar':'bat'}) eq_(canary, ['execute', 'cursor_execute']) def test_retval_flag(self): canary = [] def tracker(name): def go(conn, *args, **kw): canary.append(name) return go def execute(conn, clauseelement, multiparams, params): canary.append('execute') return clauseelement, multiparams, params def cursor_execute(conn, cursor, statement, parameters, context, executemany): canary.append('cursor_execute') return statement, parameters engine = engines.testing_engine() assert_raises( tsa.exc.ArgumentError, event.listen, engine, "begin", tracker("begin"), retval=True ) event.listen(engine, "before_execute", execute, retval=True) event.listen(engine, "<API key>", cursor_execute, retval=True) engine.execute(select([1])) eq_( canary, ['execute', 'cursor_execute'] ) def test_engine_connect(self): engine = engines.testing_engine() tracker = Mock() event.listen(engine, "engine_connect", tracker) c1 = engine.connect() c2 = c1._branch() c1.close() eq_( tracker.mock_calls, [call(c1, False), call(c2, True)] ) def <API key>(self): engine = engines.testing_engine() engine_tracker = Mock() conn_tracker = Mock() event.listen(engine, "<API key>", engine_tracker) event.listen(engine, "<API key>", conn_tracker) e2 = engine.execution_options(e1='opt_e1') c1 = engine.connect() c2 = c1.execution_options(c1='opt_c1') c3 = e2.connect() c4 = c3.execution_options(c3='opt_c3') eq_( engine_tracker.mock_calls, [call(e2, {'e1': 'opt_e1'})] ) eq_( conn_tracker.mock_calls, [call(c2, {"c1": "opt_c1"}), call(c4, {"c3": "opt_c3"})] ) @testing.requires.sequences @testing.provide_metadata def test_cursor_execute(self): canary = [] def tracker(name): def go(conn, cursor, statement, parameters, context, executemany): canary.append((statement, context)) return go engine = engines.testing_engine() t = Table('t', self.metadata, Column('x', Integer, Sequence('t_id_seq'), primary_key=True), implicit_returning=False ) self.metadata.create_all(engine) with engine.begin() as conn: event.listen(conn, '<API key>', tracker('cursor_execute')) conn.execute(t.insert()) # we see the sequence pre-executed in the first call assert "t_id_seq" in canary[0][0] assert "INSERT" in canary[1][0] # same context is_( canary[0][1], canary[1][1] ) def test_transactional(self): canary = [] def tracker(name): def go(conn, *args, **kw): canary.append(name) return go engine = engines.testing_engine() event.listen(engine, 'before_execute', tracker('execute')) event.listen(engine, '<API key>', tracker('cursor_execute')) event.listen(engine, 'begin', tracker('begin')) event.listen(engine, 'commit', tracker('commit')) event.listen(engine, 'rollback', tracker('rollback')) conn = engine.connect() trans = conn.begin() conn.execute(select([1])) trans.rollback() trans = conn.begin() conn.execute(select([1])) trans.commit() eq_(canary, [ 'begin', 'execute', 'cursor_execute', 'rollback', 'begin', 'execute', 'cursor_execute', 'commit', ]) @testing.requires.savepoints @testing.requires.<API key> def <API key>(self): canary1 = [] def tracker1(name): def go(*args, **kw): canary1.append(name) return go canary2 = [] def tracker2(name): def go(*args, **kw): canary2.append(name) return go engine = engines.testing_engine() for name in ['begin', 'savepoint', 'rollback_savepoint', 'release_savepoint', 'rollback', 'begin_twophase', 'prepare_twophase', 'commit_twophase']: event.listen(engine, '%s' % name, tracker1(name)) conn = engine.connect() for name in ['begin', 'savepoint', 'rollback_savepoint', 'release_savepoint', 'rollback', 'begin_twophase', 'prepare_twophase', 'commit_twophase']: event.listen(conn, '%s' % name, tracker2(name)) trans = conn.begin() trans2 = conn.begin_nested() conn.execute(select([1])) trans2.rollback() trans2 = conn.begin_nested() conn.execute(select([1])) trans2.commit() trans.rollback() trans = conn.begin_twophase() conn.execute(select([1])) trans.prepare() trans.commit() eq_(canary1, ['begin', 'savepoint', 'rollback_savepoint', 'savepoint', 'release_savepoint', 'rollback', 'begin_twophase', 'prepare_twophase', 'commit_twophase'] ) eq_(canary2, ['begin', 'savepoint', 'rollback_savepoint', 'savepoint', 'release_savepoint', 'rollback', 'begin_twophase', 'prepare_twophase', 'commit_twophase'] ) class HandleErrorTest(fixtures.TestBase): __requires__ = 'ad_hoc_engines', __backend__ = True def tearDown(self): Engine.dispatch._clear() Engine._has_events = False def <API key>(self): engine = engines.testing_engine() canary = Mock() event.listen(engine, "dbapi_error", canary) with engine.connect() as conn: try: conn.execute("SELECT FOO FROM I_DONT_EXIST") assert False except tsa.exc.DBAPIError as e: eq_(canary.mock_calls[0][1][5], e.orig) eq_(canary.mock_calls[0][1][2], "SELECT FOO FROM I_DONT_EXIST") def <API key>(self): engine = engines.testing_engine() listener = Mock(return_value=None) event.listen(engine, 'dbapi_error', listener) nope = Exception("nope") class MyType(TypeDecorator): impl = Integer def process_bind_param(self, value, dialect): raise nope with engine.connect() as conn: <API key>( tsa.exc.StatementError, r"nope \(original cause: Exception: nope\) u?'SELECT 1 ", conn.execute, select([1]).where( column('foo') == literal('bar', MyType())) ) # no legacy event eq_(listener.mock_calls, []) def <API key>(self): engine = engines.testing_engine() listener = Mock(return_value=None) event.listen(engine, 'dbapi_error', listener) nope = TypeError("I'm not a DBAPI error") with engine.connect() as c: c.connection.cursor = Mock( return_value=Mock( execute=Mock( side_effect=nope )) ) <API key>( TypeError, "I'm not a DBAPI error", c.execute, "select " ) # no legacy event eq_(listener.mock_calls, []) def test_handle_error(self): engine = engines.testing_engine() canary = Mock(return_value=None) event.listen(engine, "handle_error", canary) with engine.connect() as conn: try: conn.execute("SELECT FOO FROM I_DONT_EXIST") assert False except tsa.exc.DBAPIError as e: ctx = canary.mock_calls[0][1][0] eq_(ctx.original_exception, e.orig) is_(ctx.<API key>, e) eq_(ctx.statement, "SELECT FOO FROM I_DONT_EXIST") def <API key>(self): engine = engines.testing_engine() class MyException(Exception): pass @event.listens_for(engine, 'handle_error', retval=True) def err(context): stmt = context.statement exception = context.original_exception if "ERROR ONE" in str(stmt): return MyException("my exception") elif "ERROR TWO" in str(stmt): return exception else: return None conn = engine.connect() # case 1: custom exception <API key>( MyException, "my exception", conn.execute, "SELECT 'ERROR ONE' FROM I_DONT_EXIST" ) # case 2: return the DBAPI exception we're given; # no wrapping should occur assert_raises( conn.dialect.dbapi.Error, conn.execute, "SELECT 'ERROR TWO' FROM I_DONT_EXIST" ) # case 3: normal wrapping assert_raises( tsa.exc.DBAPIError, conn.execute, "SELECT 'ERROR THREE' FROM I_DONT_EXIST" ) def <API key>(self): engine = engines.testing_engine() class MyException1(Exception): pass class MyException2(Exception): pass class MyException3(Exception): pass @event.listens_for(engine, 'handle_error', retval=True) def err1(context): stmt = context.statement if "ERROR ONE" in str(stmt) or "ERROR TWO" in str(stmt) \ or "ERROR THREE" in str(stmt): return MyException1("my exception") elif "ERROR FOUR" in str(stmt): raise MyException3("my exception short circuit") @event.listens_for(engine, 'handle_error', retval=True) def err2(context): stmt = context.statement if ("ERROR ONE" in str(stmt) or "ERROR FOUR" in str(stmt)) \ and isinstance(context.chained_exception, MyException1): raise MyException2("my exception chained") elif "ERROR TWO" in str(stmt): return context.chained_exception else: return None conn = engine.connect() with patch.object(engine. dialect.execution_ctx_cls, "<API key>") as patched: <API key>( MyException2, "my exception chained", conn.execute, "SELECT 'ERROR ONE' FROM I_DONT_EXIST" ) eq_(patched.call_count, 1) with patch.object(engine. dialect.execution_ctx_cls, "<API key>") as patched: assert_raises( MyException1, conn.execute, "SELECT 'ERROR TWO' FROM I_DONT_EXIST" ) eq_(patched.call_count, 1) with patch.object(engine. dialect.execution_ctx_cls, "<API key>") as patched: # test that non None from err1 isn't cancelled out # by err2 assert_raises( MyException1, conn.execute, "SELECT 'ERROR THREE' FROM I_DONT_EXIST" ) eq_(patched.call_count, 1) with patch.object(engine. dialect.execution_ctx_cls, "<API key>") as patched: assert_raises( tsa.exc.DBAPIError, conn.execute, "SELECT 'ERROR FIVE' FROM I_DONT_EXIST" ) eq_(patched.call_count, 1) with patch.object(engine. dialect.execution_ctx_cls, "<API key>") as patched: <API key>( MyException3, "my exception short circuit", conn.execute, "SELECT 'ERROR FOUR' FROM I_DONT_EXIST" ) eq_(patched.call_count, 1) def <API key>(self): """test that handle_error is called with a context in cases where _handle_dbapi_error() is normally called without any context. """ engine = engines.testing_engine() listener = Mock(return_value=None) event.listen(engine, 'handle_error', listener) nope = Exception("nope") class MyType(TypeDecorator): impl = Integer def process_bind_param(self, value, dialect): raise nope with engine.connect() as conn: <API key>( tsa.exc.StatementError, r"nope \(original cause: Exception: nope\) u?'SELECT 1 ", conn.execute, select([1]).where( column('foo') == literal('bar', MyType())) ) ctx = listener.mock_calls[0][1][0] assert ctx.statement.startswith("SELECT 1 ") is_(ctx.is_disconnect, False) is_(ctx.original_exception, nope) def <API key>(self): """test that dbapi_error is called with a context in cases where DBAPI raises an exception that is not a DBAPI exception, e.g. internal errors or encoding problems. """ engine = engines.testing_engine() listener = Mock(return_value=None) event.listen(engine, 'handle_error', listener) nope = TypeError("I'm not a DBAPI error") with engine.connect() as c: c.connection.cursor = Mock( return_value=Mock( execute=Mock( side_effect=nope )) ) <API key>( TypeError, "I'm not a DBAPI error", c.execute, "select " ) ctx = listener.mock_calls[0][1][0] eq_(ctx.statement, "select ") is_(ctx.is_disconnect, False) is_(ctx.original_exception, nope) def <API key>(self, orig_error, evt_value): engine = engines.testing_engine() @event.listens_for(engine, "handle_error") def evt(ctx): ctx.is_disconnect = evt_value with patch.object(engine.dialect, "is_disconnect", Mock(return_value=orig_error)): with engine.connect() as c: try: c.execute("SELECT x FROM nonexistent") assert False except tsa.exc.StatementError as st: eq_(st.<API key>, evt_value) def <API key>(self): self.<API key>(False, True) self.<API key>(True, True) def <API key>(self): self.<API key>(True, False) self.<API key>(False, False) class ProxyConnectionTest(fixtures.TestBase): """These are the same tests as EngineEventsTest, except using the deprecated ConnectionProxy interface. """ __requires__ = 'ad_hoc_engines', __prefer_requires__ = '<API key>', @testing.uses_deprecated(r'.*Use event.listen') @testing.fails_on('firebird', 'Data type unknown') def test_proxy(self): stmts = [] cursor_stmts = [] class MyProxy(ConnectionProxy): def execute( self, conn, execute, clauseelement, *multiparams, **params ): stmts.append((str(clauseelement), params, multiparams)) return execute(clauseelement, *multiparams, **params) def cursor_execute( self, execute, cursor, statement, parameters, context, executemany, ): cursor_stmts.append((str(statement), parameters, None)) return execute(cursor, statement, parameters, context) def assert_stmts(expected, received): for stmt, params, posn in expected: if not received: assert False, "Nothing available for stmt: %s" % stmt while received: teststmt, testparams, testmultiparams = \ received.pop(0) teststmt = re.compile(r'[\n\t ]+', re.M).sub(' ', teststmt).strip() if teststmt.startswith(stmt) and (testparams == params or testparams == posn): break for engine in \ engines.testing_engine(options=dict(implicit_returning=False, proxy=MyProxy())), \ engines.testing_engine(options=dict(implicit_returning=False, proxy=MyProxy(), strategy='threadlocal')): m = MetaData(engine) t1 = Table('t1', m, Column('c1', Integer, primary_key=True), Column('c2', String(50), default=func.lower('Foo'), primary_key=True) ) m.create_all() try: t1.insert().execute(c1=5, c2='some data') t1.insert().execute(c1=6) eq_(engine.execute('select * from t1').fetchall(), [(5, 'some data'), (6, 'foo')]) finally: m.drop_all() engine.dispose() compiled = [('CREATE TABLE t1', {}, None), ('INSERT INTO t1 (c1, c2)', {'c2': 'some data', 'c1': 5}, None), ('INSERT INTO t1 (c1, c2)', {'c1': 6}, None), ('select * from t1', {}, None), ('DROP TABLE t1', {}, None)] if not testing.against('oracle+zxjdbc'): # or engine.dialect.pr # <API key> cursor = [ ('CREATE TABLE t1', {}, ()), ('INSERT INTO t1 (c1, c2)', {'c2': 'some data', 'c1' : 5}, (5, 'some data')), ('SELECT lower', {'lower_2': 'Foo'}, ('Foo', )), ('INSERT INTO t1 (c1, c2)', {'c2': 'foo', 'c1': 6}, (6, 'foo')), ('select * from t1', {}, ()), ('DROP TABLE t1', {}, ()), ] else: insert2_params = 6, 'Foo' if testing.against('oracle+zxjdbc'): insert2_params += (ReturningParam(12), ) cursor = [('CREATE TABLE t1', {}, ()), ('INSERT INTO t1 (c1, c2)', {'c2': 'some data' , 'c1': 5}, (5, 'some data')), ('INSERT INTO t1 (c1, c2)', {'c1': 6, 'lower_2': 'Foo'}, insert2_params), ('select * from t1', {}, ()), ('DROP TABLE t1' , {}, ())] # bind param name 'lower_2' might # be incorrect assert_stmts(compiled, stmts) assert_stmts(cursor, cursor_stmts) @testing.uses_deprecated(r'.*Use event.listen') def test_options(self): canary = [] class TrackProxy(ConnectionProxy): def __getattribute__(self, key): fn = object.__getattribute__(self, key) def go(*arg, **kw): canary.append(fn.__name__) return fn(*arg, **kw) return go engine = engines.testing_engine(options={'proxy':TrackProxy()}) conn = engine.connect() c2 = conn.execution_options(foo='bar') eq_(c2._execution_options, {'foo':'bar'}) c2.execute(select([1])) c3 = c2.execution_options(bar='bat') eq_(c3._execution_options, {'foo':'bar', 'bar':'bat'}) eq_(canary, ['execute', 'cursor_execute']) @testing.uses_deprecated(r'.*Use event.listen') def test_transactional(self): canary = [] class TrackProxy(ConnectionProxy): def __getattribute__(self, key): fn = object.__getattribute__(self, key) def go(*arg, **kw): canary.append(fn.__name__) return fn(*arg, **kw) return go engine = engines.testing_engine(options={'proxy':TrackProxy()}) conn = engine.connect() trans = conn.begin() conn.execute(select([1])) trans.rollback() trans = conn.begin() conn.execute(select([1])) trans.commit() eq_(canary, [ 'begin', 'execute', 'cursor_execute', 'rollback', 'begin', 'execute', 'cursor_execute', 'commit', ]) @testing.uses_deprecated(r'.*Use event.listen') @testing.requires.savepoints @testing.requires.<API key> def <API key>(self): canary = [] class TrackProxy(ConnectionProxy): def __getattribute__(self, key): fn = object.__getattribute__(self, key) def go(*arg, **kw): canary.append(fn.__name__) return fn(*arg, **kw) return go engine = engines.testing_engine(options={'proxy':TrackProxy()}) conn = engine.connect() trans = conn.begin() trans2 = conn.begin_nested() conn.execute(select([1])) trans2.rollback() trans2 = conn.begin_nested() conn.execute(select([1])) trans2.commit() trans.rollback() trans = conn.begin_twophase() conn.execute(select([1])) trans.prepare() trans.commit() canary = [t for t in canary if t not in ('cursor_execute', 'execute')] eq_(canary, ['begin', 'savepoint', 'rollback_savepoint', 'savepoint', 'release_savepoint', 'rollback', 'begin_twophase', 'prepare_twophase', 'commit_twophase'] ) class DialectEventTest(fixtures.TestBase): @contextmanager def _run_test(self, retval): m1 = Mock() m1.do_execute.return_value = retval m1.do_executemany.return_value = retval m1.<API key>.return_value = retval e = engines.testing_engine(options={"_initialize": False}) event.listen(e, "do_execute", m1.do_execute) event.listen(e, "do_executemany", m1.do_executemany) event.listen(e, "<API key>", m1.<API key>) e.dialect.do_execute = m1.real_do_execute e.dialect.do_executemany = m1.real_do_executemany e.dialect.<API key> = m1.<API key> def mock_the_cursor(cursor, *arg): arg[-1].get_result_proxy = Mock(return_value=Mock(context=arg[-1])) return retval m1.real_do_execute.side_effect = m1.do_execute.side_effect = mock_the_cursor m1.real_do_executemany.side_effect = m1.do_executemany.side_effect = mock_the_cursor m1.<API key>.side_effect = m1.<API key>.side_effect = mock_the_cursor with e.connect() as conn: yield conn, m1 def _assert(self, retval, m1, m2, mock_calls): eq_(m1.mock_calls, mock_calls) if retval: eq_(m2.mock_calls, []) else: eq_(m2.mock_calls, mock_calls) def _test_do_execute(self, retval): with self._run_test(retval) as (conn, m1): result = conn.execute("insert into table foo", {"foo": "bar"}) self._assert( retval, m1.do_execute, m1.real_do_execute, [call( result.context.cursor, "insert into table foo", {"foo": "bar"}, result.context)] ) def <API key>(self, retval): with self._run_test(retval) as (conn, m1): result = conn.execute("insert into table foo", [{"foo": "bar"}, {"foo": "bar"}]) self._assert( retval, m1.do_executemany, m1.real_do_executemany, [call( result.context.cursor, "insert into table foo", [{"foo": "bar"}, {"foo": "bar"}], result.context)] ) def <API key>(self, retval): with self._run_test(retval) as (conn, m1): result = conn.execution_options(no_parameters=True).\ execute("insert into table foo") self._assert( retval, m1.<API key>, m1.<API key>, [call( result.context.cursor, "insert into table foo", result.context)] ) def <API key>(self, retval): with self._run_test(retval) as (conn, m1): dialect = conn.dialect stmt = "insert into table foo" params = {"foo": "bar"} ctx = dialect.execution_ctx_cls._init_statement( dialect, conn, conn.connection, stmt, [params]) conn._cursor_execute(ctx.cursor, stmt, params, ctx) self._assert( retval, m1.do_execute, m1.real_do_execute, [call( ctx.cursor, "insert into table foo", {"foo": "bar"}, ctx)] ) def <API key>(self): self._test_do_execute(True) def <API key>(self): self._test_do_execute(False) def <API key>(self): self.<API key>(True) def <API key>(self): self.<API key>(False) def <API key>(self): self.<API key>(True) def <API key>(self): self.<API key>(False) def <API key>(self): self.<API key>(True) def <API key>(self): self.<API key>(False)
#pragma once #include <core/patterns/Derivable.h> #include <core/collection/containers/Set.h> #include <core/Comparator.h> namespace nspace { /** * \brief Node. */ template<typename Derived> class Node : public Derivable<Derived>, public <API key><Derived*>, public <API key><Derived*>::Observer { private: /** * \brief The predecessors. */ Set<Derived*> _predecessors; /** * \brief The successors. */ Set<Derived*> _successors; public: /** * \brief Default constructor. */ Node(); /** * \brief Destructor. removes all successors and predecessors */ virtual ~Node(); /** * \brief callback when an element is added to the node. makes sure that the nodes are connected in * both directions. * * \param [in,out] sender If non-null, the sender. * \param [in,out] node If non-null, the node. */ void elementAdded(<API key><Derived*> * sender, Derived * node); /** * \brief callback when an element is removed from the node. makes sure the nodes are removed. * * \param [in,out] sender If non-null, the sender. * \param [in,out] node If non-null, the node. */ void elementRemoved(<API key><Derived*> * sender, Derived * node); /** * \brief all connected nodes (union of predecessors and successors) * * \return null if it fails, else. */ Set<Derived*> neighbors() const; /** * \brief read access to predecessors. * * \return null if it fails, else. */ const Set<Derived*> & predecessors() const; /** * \brief read write access to predecessors. * * \return null if it fails, else. */ Set<Derived*> & predecessors(); /** * \brief read write access to successor by index. * * \param i Zero-based index of the. * * \return null if it fails, else. */ Derived * successor(uint i); /** * \brief read access to successor by index. * * \param i Zero-based index of the. * * \return null if it fails, else. */ const Derived * successor(uint i) const; /** * \brief read / write access to predecessor by index. * * \param i Zero-based index of the. * * \return null if it fails, else. */ Derived * predecessor(uint i); /** * \brief read access to predecessor by index. * * \param i Zero-based index of the. * * \return null if it fails, else. */ const Derived * predecessor(uint i) const; /** * \brief read access tot first successor. * * \return null if it fails, else. */ const Derived * firstSuccessor() const; /** * \brief read write access to first successor. * * \return null if it fails, else. */ Derived * firstSuccessor(); /** * \brief returns the first predecessor (const) * * \return null if it fails, else. */ const Derived * firstPredecessor() const; /** * \brief returns the first predecessor. * * \return null if it fails, else. */ Derived * firstPredecessor(); /** * \brief allows const access to the successors. * * \return null if it fails, else. */ const Set<Derived*> & successors() const; /** * \brief allows access to the successors. * * \return null if it fails, else. */ Set<Derived*> & successors(); /** * \brief adds a set of predecessors (arrows indicate direction of connection. * * \param nodes The nodes. * * \return The shifted result. */ Derived & operator <<(const Set<Derived*> &nodes); /** * \brief adds a set of successors. * * \param nodes The nodes. * * \return The shifted result. */ Derived & operator >>(const Set<Derived*> &nodes); /** * \brief adds a single predecessor. * * \param [in,out] node The node. * * \return The shifted result. */ Derived & operator <<(Derived & node); /** * \brief adds a single successor. * * \param [in,out] node The node. * * \return The shifted result. */ Derived & operator >>(Derived & node); /** * \brief adds a single predecessor (by pointer) * * \param [in,out] node If non-null, the node. * * \return The shifted result. */ Derived & operator <<(Derived * node); /** * \brief adds a single successor (by pointer) * * \param [in,out] node If non-null, the node. * * \return The shifted result. */ Derived & operator >>(Derived * node); /** * \brief removes the node from successors and predecessors. * * \param [in,out] node If non-null, the node to remove. */ void remove(Derived * node); /** * \brief iterates the neighbors. * * \param [in,out] action If non-null, the action. */ void foreachNeighbor(std::function<void (Derived*)> action) const; /** * \brief iterates the predecessors. * * \param [in,out] action If non-null, the action. */ void foreachPredecessor(std::function<void (Derived*)> action) const; /** * \brief iterates the successors. * * \param [in,out] action If non-null, the action. */ void foreachSuccessor(std::function<void (Derived*)> action) const; /** * \brief does a depth first search calling action on every node and also passing the path to the * node as a parameter to action. * * \param [in,out] action If non-null, the action. * \param currentpath (optional) [in,out] If non-null, the currentpath. */ void dfsWithPath(std::function<void (Derived *, Set<Derived * > )> action, Set<Derived * > currentpath = Set<Derived*>()); /** * \brief Dfs the given action. * * \param [in,out] action If non-null, the action. */ void dfs(std::function<void (Derived * )> action); /** * \brief really bad implementation of dfs, it is slow and will crash (stack overflow ) if there * are cycles in the graph. * * \param [in,out] f [in,out] If non-null, the std::function&lt;void(bool&amp;,Derived*)&gt; to * process. * \param successors The successors. */ void dfs(std::function<void (bool &, Derived *)> f, std::function<void (Set<Derived*> &, const Derived &) > successors); /** * \brief also a realy bad implemention. this time of bfs (performancewise). it does not crash if * cycles are contained and returns the number of cycles found. * * \param [in,out] f [in,out] If non-null, the std::function&lt;void(bool&amp;,Derived*)&gt; to * process. * \param successors The successors. * * \return . */ int bfs(std::function<void (bool&,Derived*)> f,std::function<void (Set<Derived*> &, const Derived &) > successors); /** * \brief overload. * * \param [in,out] f [in,out] If non-null, the std::function&lt;void(bool&amp;,Derived*)&gt; to * process. * * \return . */ int bfs(std::function<void (bool&,Derived*)> f); /** * \brief Executes the predecessor added action. * * \param [in,out] predecessor If non-null, the predecessor. */ virtual void onPredecessorAdded(Derived * predecessor){} /** * \brief Executes the successor added action. * * \param [in,out] successor If non-null, the successor. */ virtual void onSuccessorAdded(Derived * successor){} /** * \brief Executes the predecessor removed action. * * \param [in,out] predecessor If non-null, the predecessor. */ virtual void <API key>(Derived* predecessor){} /** * \brief Executes the successor removed action. * * \param [in,out] predecessor If non-null, the predecessor. */ virtual void onSuccessorRemoved(Derived * predecessor){} }; // implementation of node template<typename Derived> void Node<Derived>::remove(Derived * node){ successors()/=node; predecessors()/=node; } template<typename Derived> void Node<Derived>::foreachNeighbor(std::function<void (Derived*)> action) const { neighbors().foreachElement(action); } template<typename Derived> void Node<Derived>::foreachPredecessor(std::function<void (Derived*)> action) const { predecessors().foreachElement(action); } template<typename Derived> void Node<Derived>::foreachSuccessor(std::function<void (Derived*)> action) const { successors().foreachElement(action); } template<typename Derived> Node<Derived>::Node(){ _predecessors.addObserver(this); _successors.addObserver(this); } template<typename Derived> Node<Derived>::~Node(){ _predecessors.clear(); _successors.clear(); } // callback when an element is added to the node. makes sure that the nodes are connected in both directions template<typename Derived> void Node<Derived>::elementAdded(<API key><Derived*> * sender, Derived * node){ if(sender==&_predecessors) { onPredecessorAdded(node); node->successors() |= &this->derived(); } if(sender==&_successors) { onSuccessorAdded(node); node->predecessors()|=&this->derived(); } } // callback when an element is removed from the node. makes sure the nodes are removed template<typename Derived> void Node<Derived>::elementRemoved(<API key><Derived*> * sender, Derived * node){ if(sender==&_predecessors) { <API key>(node); node->successors() /=&this->derived(); } if(sender==&_successors) { onSuccessorRemoved(node); node->predecessors()/=&this->derived(); } } // all connected nodes (union of predecessors and successors) template<typename Derived> Set<Derived*> Node<Derived>::neighbors() const { return predecessors()|successors(); } // read access to predecessors template<typename Derived> const Set<Derived*> & Node<Derived>::predecessors() const { return _predecessors; } // read write access to predecessors template<typename Derived> Set<Derived*> & Node<Derived>::predecessors(){ return _predecessors; } // read write access to successor by index template<typename Derived> Derived * Node<Derived>::successor(uint i){ return successors().at(i); } // read access to successor by index template<typename Derived> const Derived * Node<Derived>::successor(uint i) const { return successors().at(i); } //read / write access to predecessor by index template<typename Derived> Derived * Node<Derived>::predecessor(uint i){ return predecessors().at(i); } // read access to predecessor by index template<typename Derived> const Derived * Node<Derived>::predecessor(uint i) const { return predecessors().at(i); } // read access tot first successor template<typename Derived> const Derived * Node<Derived>::firstSuccessor() const { return successors().first(); } //read write access to first successor template<typename Derived> Derived * Node<Derived>::firstSuccessor(){ return successors().first(); } // returns the first predecessor (const) template<typename Derived> const Derived * Node<Derived>::firstPredecessor() const { return predecessors().first(); } // returns the first predecessor template<typename Derived> Derived * Node<Derived>::firstPredecessor(){ return predecessors().first(); } // allows const access to the successors template<typename Derived> const Set<Derived*> & Node<Derived>::successors() const { return _successors; } //allows access to the successors template<typename Derived> Set<Derived*> & Node<Derived>::successors(){ return _successors; } // adds a set of predecessors (arrows indicate direction of connection template<typename Derived> Derived & Node<Derived>::operator <<(const Set<Derived*> &nodes){ predecessors() |= nodes; return this->derived(); } // adds a set of successors template<typename Derived> Derived & Node<Derived>::operator >>(const Set<Derived*> &nodes){ successors() |= nodes; return this->derived(); } // adds a single predecessor template<typename Derived> Derived & Node<Derived>::operator <<(Derived & node){ predecessors().add(&node); return this->derived(); } //adds a single successor template<typename Derived> Derived & Node<Derived>::operator >>(Derived & node){ successors().add(&node); return this->derived(); } // adds a single predecessor (by pointer) template<typename Derived> Derived & Node<Derived>::operator <<(Derived * node){ predecessors().add(node); return this->derived(); } // adds a single successor (by pointer) template<typename Derived> Derived & Node<Derived>::operator >>(Derived * node){ successors().add(node); return this->derived(); } template<typename Derived> void Node<Derived>::dfsWithPath(std::function<void (Derived *, Set<Derived * > )> action, Set<Derived * > currentpath){ action(&this->derived(),currentpath); successors().foreachElement([action,this,&currentpath](Derived * next){ next->dfsWithPath(action,currentpath|&this->derived()); }); } template<typename Derived> void Node<Derived>::dfs(std::function<void (Derived * )> action){ auto a = [action](bool& b, Derived * d){action(d); }; auto b = [] (Set<Derived * > &successors, const Derived &current){successors |= current.successors(); }; dfs(a,b ); } // really bad implementation of dfs, it is slow and will crash (stack overflow ) if there are cycles in the graph template<typename Derived> void Node<Derived>::dfs(std::function<void (bool &, Derived *)> f, std::function<void (Set<Derived*> &, const Derived &) > successors){ Set<Derived* > next; successors(next,this->derived()); bool cont=true; f(cont,&this->derived()); if(!cont) return; next.foreachElement([f,successors](Derived * n){ n->dfs(f,successors); }); } // also a realy bad implemention. this time of bfs (performancewise). it does not crash if cycles are contained and returns the number of cycles found template<typename Derived> int Node<Derived>::bfs(std::function<void (bool&,Derived*)> f,std::function<void (Set<Derived*> &, const Derived &) > successors){ Set<Derived *> list = &this->derived(); int cycles =0; while(list) { // get first element Derived * current = list.first(); // remove first element list /= current; //execute function bool cont = true; f(cont,current); if(!cont) return cycles; // add successors of current; successors(list,*current); } return cycles; } // overload template<typename Derived> int Node<Derived>::bfs(std::function<void (bool&,Derived*)> f){ std::function<void (Set<Derived*> &, const Derived &) > sfunc = [] (Set<Node *>&successors,const Derived &node){ successors |= node.successors(); }; return bfs(f,sfunc); } }
exports.login = function* (ctx) { const result = yield ctx.service.mine.login(ctx.request.body); if (!result) { ctx.status = 400; ctx.body = { status: 400, msg: `please check your username and password`, } return; } ctx.body = { access_token: result.access_token, msg: 'login success', }; ctx.status = 200; } exports.signup = function* (ctx) { const result = yield ctx.service.mine.signup(ctx.request.body); if (!result.result) { ctx.status = 400; ctx.body = { status: 400, msg: result.msg, } return; } ctx.status = 201; ctx.body = { status: 201, msg: 'success', } } exports.info = function* (ctx) { const info = yield ctx.service.mine.info(ctx.auth.user_id); if (info == null) { ctx.status = 200; ctx.body = { status: 200, msg: 'there is no info for current user', } return; } ctx.body = info; ctx.status = 200; } exports.statistics = function* (ctx) { const info = yield ctx.service.mine.statistics(ctx.auth.user_id); if (info == null) { ctx.status = 200; ctx.body = { shares_count: 0, friends_count: 0, helpful_count: 0, }; return; } ctx.body = info; ctx.status = 200; } exports.accounts = function* (ctx) { const accounts = yield ctx.service.mine.accounts(ctx.auth.user_id); ctx.body = accounts; ctx.status = 200; } exports.update = function* (ctx) { let profile = ctx.request.body; profile.id = ctx.auth.user_id; const result = yield ctx.service.mine.update(profile); if (result) { ctx.status = 204; return; } ctx.status = 500; ctx.body = { msg: 'update profile failed', } } exports.avatar = function* (ctx) { const parts = ctx.multipart(); const { filename, error } = yield ctx.service.mine.avatar(parts, `avatar/${ctx.auth.user_id}`); if (error) { ctx.status = 500; ctx.body = { status: 500, msg: 'update avatar failed', }; return false; } ctx.status = 200; ctx.body = { filename, msg: 'success', } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <script> const importObject = Object.freeze({ env: { __memory_base: 0, __table_base: 0, memory: new WebAssembly.Memory({ initial: 1, // 64KiB - single page maximum: 10 // 640KiB }), table: new WebAssembly.Table({ // Table initial: 0, // length element: 'anyfunc' }) } }); const loadWASM = (url, importObject) => fetch(url) .then(response => response.arrayBuffer()) .then(buffer => WebAssembly .instantiate(buffer, importObject) ) .then(results => results.instance); loadWASM('sum.wasm', importObject).then(instance => { const {exports} = instance; const result = exports._sum(40, 2); console.log({instance, result}); }); const loadWASM2 = async (url, importObject) => { const buffer = await fetch(url).then(r => r.arrayBuffer()); const result = await WebAssembly.instantiate(buffer, importObject); return result.instance; }; loadWASM2('sum.wasm', importObject).then(instance => { const {exports} = instance; const result = exports._sum(40, 2); console.log({instance, result}); }); // 3d way, disabled because: // RangeError: WebAssembly.Instance is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.instantiate. // Note: To generate fib-module with html example smaller than 11kb, use option -g2 instead of -g4 // const loadWASM3 = (url, importObject) => fetch(url) // .then(response => response.arrayBuffer()) // .then(buffer => WebAssembly.compile(buffer)) // .then(module => new WebAssembly.Instance(module, importObject)); // loadWASM3('sum.wasm', importObject).then(instance => { // const {exports} = instance; // const result = exports._sum(40, 2); // console.log({ // instance, // result </script> </body> </html>
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Text; using System.Web; namespace Umbraco.Core { <summary> Extension methods for dictionary & <API key> </summary> internal static class <API key> { <summary> Method to Get a value by the key. If the key doesn't exist it will create a new TVal object for the key and return it. </summary> <typeparam name="TKey"></typeparam> <typeparam name="TVal"></typeparam> <param name="dict"></param> <param name="key"></param> <returns></returns> public static TVal GetOrCreate<TKey, TVal>(this IDictionary<TKey, TVal> dict, TKey key) where TVal : class, new() { if (dict.ContainsKey(key) == false) { dict.Add(key, new TVal()); } return dict[key]; } <summary> Updates an item with the specified key with the specified value </summary> <typeparam name="TKey"></typeparam> <typeparam name="TValue"></typeparam> <param name="dict"></param> <param name="key"></param> <param name="updateFactory"></param> <returns></returns> <remarks> Taken from: http://stackoverflow.com/questions/12240219/<API key> If there is an item in the dictionary with the key, it will keep trying to update it until it can </remarks> public static bool TryUpdate<TKey, TValue>(this <API key><TKey, TValue> dict, TKey key, Func<TValue, TValue> updateFactory) { TValue curValue; while (dict.TryGetValue(key, out curValue)) { if (dict.TryUpdate(key, updateFactory(curValue), curValue)) return true; //if we're looping either the key was removed by another thread, or another thread //changed the value, so we start again. } return false; } <summary> Updates an item with the specified key with the specified value </summary> <typeparam name="TKey"></typeparam> <typeparam name="TValue"></typeparam> <param name="dict"></param> <param name="key"></param> <param name="updateFactory"></param> <returns></returns> <remarks> Taken from: http://stackoverflow.com/questions/12240219/<API key> WARNING: If the value changes after we've retreived it, then the item will not be updated </remarks> public static bool <API key><TKey, TValue>(this <API key><TKey, TValue> dict, TKey key, Func<TValue, TValue> updateFactory) { TValue curValue; if (!dict.TryGetValue(key, out curValue)) return false; dict.TryUpdate(key, updateFactory(curValue), curValue); return true;//note we return true whether we succeed or not, see explanation below. } <summary> Converts a dictionary to another type by only using direct casting </summary> <typeparam name="TKeyOut"></typeparam> <typeparam name="TValOut"></typeparam> <param name="d"></param> <returns></returns> public static IDictionary<TKeyOut, TValOut> ConvertTo<TKeyOut, TValOut>(this IDictionary d) { var result = new Dictionary<TKeyOut, TValOut>(); foreach (DictionaryEntry v in d) { result.Add((TKeyOut)v.Key, (TValOut)v.Value); } return result; } <summary> Converts a dictionary to another type using the specified converters </summary> <typeparam name="TKeyOut"></typeparam> <typeparam name="TValOut"></typeparam> <param name="d"></param> <param name="keyConverter"></param> <param name="valConverter"></param> <returns></returns> public static IDictionary<TKeyOut, TValOut> ConvertTo<TKeyOut, TValOut>(this IDictionary d, Func<object, TKeyOut> keyConverter, Func<object, TValOut> valConverter) { var result = new Dictionary<TKeyOut, TValOut>(); foreach (DictionaryEntry v in d) { result.Add(keyConverter(v.Key), valConverter(v.Value)); } return result; } <summary> Converts a dictionary to a NameValueCollection </summary> <param name="d"></param> <returns></returns> public static NameValueCollection <API key>(this IDictionary<string, string> d) { var n = new NameValueCollection(); foreach (var i in d) { n.Add(i.Key, i.Value); } return n; } <summary> Merges all key/values from the sources dictionaries into the destination dictionary </summary> <typeparam name="T"></typeparam> <typeparam name="TK"></typeparam> <typeparam name="TV"></typeparam> <param name="destination">The source dictionary to merge other dictionaries into</param> <param name="overwrite"> By default all values will be retained in the destination if the same keys exist in the sources but this can changed if overwrite = true, then any key/value found in any of the sources will overwritten in the destination. Note that it will just use the last found key/value if this is true. </param> <param name="sources">The other dictionaries to merge values from</param> public static void MergeLeft<T, TK, TV>(this T destination, IEnumerable<IDictionary<TK, TV>> sources, bool overwrite = false) where T : IDictionary<TK, TV> { foreach (var p in sources.SelectMany(src => src).Where(p => overwrite || destination.ContainsKey(p.Key) == false)) { destination[p.Key] = p.Value; } } <summary> Merges all key/values from the sources dictionaries into the destination dictionary </summary> <typeparam name="T"></typeparam> <typeparam name="TK"></typeparam> <typeparam name="TV"></typeparam> <param name="destination">The source dictionary to merge other dictionaries into</param> <param name="overwrite"> By default all values will be retained in the destination if the same keys exist in the sources but this can changed if overwrite = true, then any key/value found in any of the sources will overwritten in the destination. Note that it will just use the last found key/value if this is true. </param> <param name="source">The other dictionary to merge values from</param> public static void MergeLeft<T, TK, TV>(this T destination, IDictionary<TK, TV> source, bool overwrite = false) where T : IDictionary<TK, TV> { destination.MergeLeft(new[] {source}, overwrite); } <summary> Returns the value of the key value based on the key, if the key is not found, a null value is returned </summary> <typeparam name="TKey">The type of the key.</typeparam> <typeparam name="TVal">The type of the val.</typeparam> <param name="d">The d.</param> <param name="key">The key.</param> <param name="defaultValue">The default value.</param> <returns></returns> public static TVal GetValue<TKey, TVal>(this IDictionary<TKey, TVal> d, TKey key, TVal defaultValue = default(TVal)) { if (d.ContainsKey(key)) { return d[key]; } return defaultValue; } <summary> Returns the value of the key value based on the key as it's string value, if the key is not found, then an empty string is returned </summary> <param name="d"></param> <param name="key"></param> <returns></returns> public static string GetValueAsString<TKey, TVal>(this IDictionary<TKey, TVal> d, TKey key) { if (d.ContainsKey(key)) { return d[key].ToString(); } return String.Empty; } <summary> Returns the value of the key value based on the key as it's string value, if the key is not found or is an empty string, then the provided default value is returned </summary> <param name="d"></param> <param name="key"></param> <param name="defaultValue"></param> <returns></returns> public static string GetValueAsString<TKey, TVal>(this IDictionary<TKey, TVal> d, TKey key, string defaultValue) { if (d.ContainsKey(key)) { var value = d[key].ToString(); if (value != string.Empty) return value; } return defaultValue; } <summary>contains key ignore case.</summary> <param name="dictionary">The dictionary.</param> <param name="key">The key.</param> <typeparam name="TValue">Value Type</typeparam> <returns>The contains key ignore case.</returns> public static bool <API key><TValue>(this IDictionary<string, TValue> dictionary, string key) { return dictionary.Keys.InvariantContains(key); } <summary> Converts a dictionary object to a query string representation such as: firstname=shannon&lastname=deminick </summary> <param name="d"></param> <returns></returns> public static string ToQueryString(this IDictionary<string, object> d) { if (!d.Any()) return ""; var builder = new StringBuilder(); foreach (var i in d) { builder.Append(String.Format("{0}={1}&", HttpUtility.UrlEncode(i.Key), i.Value == null ? string.Empty : HttpUtility.UrlEncode(i.Value.ToString()))); } return builder.ToString().TrimEnd('&'); } <summary>The get entry ignore case.</summary> <param name="dictionary">The dictionary.</param> <param name="key">The key.</param> <typeparam name="TValue">The type</typeparam> <returns>The entry</returns> public static TValue GetValueIgnoreCase<TValue>(this IDictionary<string, TValue> dictionary, string key) { return dictionary.GetValueIgnoreCase(key, default(TValue)); } <summary>The get entry ignore case.</summary> <param name="dictionary">The dictionary.</param> <param name="key">The key.</param> <param name="defaultValue">The default value.</param> <typeparam name="TValue">The type</typeparam> <returns>The entry</returns> public static TValue GetValueIgnoreCase<TValue>(this IDictionary<string, TValue> dictionary, string key, TValue defaultValue) { key = dictionary.Keys.FirstOrDefault(i => i.InvariantEquals(key)); return key.IsNullOrWhiteSpace() == false ? dictionary[key] : defaultValue; } } }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Phenotype Demo</title> <meta name="description" content="Phenotype Demo"> <link rel="stylesheet" href="style.css"> <script src="phenotype.js" type="application/javascript"></script> </head> <body> <a href="https://github.com/benjamine/phenotype" id="fork_me"> <img alt="Fork me on GitHub" src="http://s3.amazonaws.com/github/ribbons/<API key>.png"> </a> <h1>Phenotype Demo</h1> <script type="text/javascript"> var Trait = phenotype.Trait; var Walker = new Trait('Walker', { goTo: function(location) { phenotype.pending(); } }); var Swimmer = new Trait('Swimmer', { goTo: function(location) { phenotype.pending(); } }); var Flyer = new Trait('Flyer', { goTo: function(location) { phenotype.pending(); } }); var Duck = new Trait('Duck', Walker, Swimmer, Flyer); try { Duck.create(); } catch(err) { // conflict, goTo is defined in Walker, Swimmer and Flyer console.error(err); } // updating var jet = Flyer.create(); // add a trait to existing object var Vehicle = new Trait('Vehicle', { seats: 3 }); Vehicle.addTo(jet); // logs 3 console.log(jet.seats); // modify existing Trait Vehicle.add({ seats: 4, wings: 2 }, new Trait({ pilot: true })); // logs 4 2 true console.log(jet.seats, jet.wings, jet.pilot); // using "required" var Retriever = new Trait('Retriever', { goTo: phenotype.member.required, grab: phenotype.member.required, retrieve: function(thing) { this.goTo(thing.location); this.grab(thing); this.goTo(this.previousLocation); } }); try { var retriever = Retriever.create(); } catch(err) { // goTo is required by Retriever, this is an abstract Trait console.error(err); } var Dog = new Trait('Dog', Walker, Retriever, { grab: function(thing) { phenotype.pending(); } }); var dog = Dog.create(); try { var ball = {}; dog.retrieve(ball); } catch(err) { // throws "pending" error from grab method above console.error(err); } // using mixin (allows to apply a Trait to a preexistent object) var parrot = { name: 'pepe' }; try { Retriever.mixin(parrot); } catch(err) { // goTo is required by Retriever, and parrot doesn't have it console.log(err); } parrot.goTo = phenotype.pending; parrot.grab = phenotype.pending; // this time parrot provides all required methods Retriever.mixin(parrot); // using "aliasOf" and "from" var Bird = new Trait('Bird', Walker, Flyer, { walkTo: phenotype.member.aliasOf(Walker, 'goTo'), goTo: phenotype.member.from(Flyer) }); var Hawk = new Trait('Hawk', Bird, Retriever, { grab: function(thing) { phenotype.pending(); } }); var Capibara = new Trait('Capibara', Walker, Swimmer, { walkTo: phenotype.member.aliasOf(Walker, 'goTo'), swimTo: phenotype.member.aliasOf(Swimmer, 'goTo'), goTo: function(location) { location.isOnWater() ? this.swimTo(location) : this.walkTo(location); } }); // using ancestors var Electric = new Trait('Electric', { shutdown: function() { console.log('disconnected power'); } }); var CombustionEngine = new Trait('CombustionEngine', { shutdown: function() { console.log('disconnected fuel injection'); } }); var Car = new Trait('Car', Electric, CombustionEngine, { open: function(all){ console.log('doors unlocked'); }, shutdown: phenotype.member.ancestors().then(function() { console.log('doors locked'); }) }); var RetractableRoof = new Trait('RetractableRoof', { openRoof: function() { console.log('roof retracted'); }, shutdown: function() { console.log('roof extended'); } }); var ConvertibleCar = new Trait('ConvertibleCar', Car, RetractableRoof, { open: phenotype.member.ancestors().wrap(function(inner, base){ return function(all){ inner.call(this, all); if (all) { this.openRoof(); } } }), shutdown: phenotype.member.ancestors() }); // using pipe and async var Peeler = new Trait('Peeler', { process: function(err, thing) { console.log('peeling ' + thing); // peeling takes time, but timeout at 1500ms var async = phenotype.async(1500); setTimeout(function(){ async.done('peeled ' + thing); }, 1000); return async; } }); Peeler.create().process(null, "apple").then(function(err, result){ if (err) { console.error('error peeling apple'); return; } // logs "peeled apple" console.log('result:', result); }); var Chopper = new Trait('Chopper', { process: function(err, thing) { console.log('chopping ' + thing); return 'chopped ' + thing; } }); var Mixer = new Trait('Mixer', { process: function(err, thing) { console.log('mixing ' + thing); // mixing takes time var async = phenotype.async(3000); setTimeout(function(){ async.done('mixed ' + thing); }, 1200); return async; } }); var Oven = new Trait('Oven', { process: function(err, thing) { console.log('baking ' + thing); return 'baked ' + thing; } }); var CookingMachine = new Trait('CookingMachine', Peeler, Chopper, Mixer, Oven, { process: phenotype.member.ancestors().pipe({continueOnError: true}) .then(function(err, thing) { if (err) { console.error('cooking failed'); console.error(err); return; } console.log('finished cooking:', thing); return thing; }) }); var machine = CookingMachine.create(); machine.process(null, "vegetables").then(function(err, result){ if (err) { console.error('error, no result'); return; } // logs "result: baked mixed chopped peeled vegetables" console.log('result:', result); }); // properties & events var Labrador = new Trait('Labrador', Dog, Retriever, phenotype.HasEvents, { name: phenotype.member.property(), initial: phenotype.member.property(function(){ return this.name().substr(0, 1).toUpperCase(); }), }); var spike = Labrador.create(); spike.name('Spike'); // logs "Spike" console.log(spike.name()); // logs "S" console.log(spike.initial()); spike.on({ bark: function(e, volume) { console.log(e.source.name(), 'barked', volume); }, namechanged: function(e, data) { console.log(data.property.name, 'changed from', data.previousValue, 'to', data.value); }, initialchanged: function(e, data) { console.log(data.property.name, 'changed from', data.previousValue, 'to', data.value); } }); // logs "Spikey barked loud" spike.emit('bark', 'loud'); spike.off('bark'); spike.emit('bark', 'louder'); // logs "name changed from Spike to Spikey" spike.name('Spikey'); </script> <section id="main"> <div>Not much to see here,<br/>check output on browser console</div> </section> <footer> <a href="https://github.com/benjamine/phenotype">Download Phenotype</a><br> <p class="credits">developed by <a href="http: </footer> </body> </html>
import * as yargs from "yargs"; import { getEnvironment, getSlimConfig } from "../cli-helpers"; export const devCommand: yargs.CommandModule = { command: "dev", describe: "Start a development server.", builder: { open: { alias: "o", type: "boolean", description: "Automatically open the web browser." }, "update-dlls": { alias: "u", type: "boolean", description: "Create dynamically linked libraries for vendors (@angular/core, etc.) and polyfills." }, cordova: { type: "boolean", description: "Output the build to the target directory." }, aot: { type: "boolean", description: "Use the Angular AOT compiler." } }, handler: (options: Options) => { const dllTask = require("../tasks/dll.task"); const devTask = require("../tasks/dev.task"); const rootDir = process.cwd(); const slimConfig = getSlimConfig(rootDir); const <API key> = getEnvironment(rootDir); return dllTask(<API key>, slimConfig, options["update-dlls"]) .then(() => devTask(<API key>, slimConfig, options.open, options.aot)) .then(code => { process.exit(code); }) .catch(code => { process.exit(code); }); } };
export const browserVersions = () => { let u = navigator.userAgent return { trident: u.indexOf('Trident') > -1, presto: u.indexOf('Presto') > -1, // opera webKit: u.indexOf('AppleWebKit') > -1, gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1, mobile: !!u.match(/AppleWebKit.*Mobile.*/), ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // androiduc iPhone: u.indexOf('iPhone') > -1, // iPhoneQQHD iPad: u.indexOf('iPad') > -1, // iPad webApp: u.indexOf('Safari') === -1 // web } }
module YandexMusic class Client include YandexMusic::Auth include YandexMusic::Endpoints::Search include YandexMusic::Endpoints::ArtistAlbums include YandexMusic::Endpoints::AlbumsTracks def initialize(client_id, client_secret) @client_id, @client_secret = client_id, client_secret end private def http @faraday ||= Faraday.new do |faraday| faraday.request :url_encoded # form-encode POST params faraday.adapter Faraday.default_adapter # make requests with Net::HTTP faraday.use YandexMusic::AppHttpClient # run requests through app emulator end end def prepared(params) params.inject({}) do |result, (key, value)| result[key.to_s.gsub("_", "-")] = value result end end def parse_time(string) Time.new(*string.scan(/\d+/).slice(0, 6).map(&:to_i), string.match(/[+-]{1}\d{2}:\d{2}/)[0]).utc end end end
<div class="container"> <div class="col-md-12 col-sm-12 col-xs-12 no-padding"> <div ng-controller="GroupMenu" ng-model="currentMenu" ng-init="currentMenu = 'new'" ng-include="'group/menu'" class="row"></div> <div class="row"> <div class="col-md-12 no-padding"> <div class="row"> <div class="panel panel-default"> <div class="panel-heading"> <i class="fa fa-users"></i> Editar Grupo </div> <div class="panel-body"> <div class="col-md-6 col-md-offset-3"> <br/> <div class="thumbnail"> <div class="caption"> <form> <div class="row center-block" style="position: absolute"> <div id="fileupload" ng-controller="UploaderController" data-file-upload="options" ng-class="{'<API key>': processing() || loadingFiles}"> <span class="btn btn-default btn-sm btn-block fileinput-button"> <i class="fa fa-refresh fa-spin" ng-if="active() > 0"></i> <i class="fa fa-camera" ng-if="active() == 0"></i> Subir logo <input type="file" name="files[]" multiple ng-disabled="disabled"> </span> </div> </div> <div class="form-group"> <img ng-src="{{image.url}}" class="img-responsive"> </div> <div class="form-group"> <input ng-model="group.title" type="text" class="form-control" id="exampleInputEmail1" placeholder="Nombre del grupo"> </div> <div class="form-group"> <textarea ng-model="group.text" class="form-control" id="<API key>" placeholder="Descripción"></textarea> </div> <div class="form-group"> <label ng-if="group.privado" ng-click="group.privado = false"> <i class="fa fa-check-square-o" ng-model="group.privado"></i> Privado </label> <label ng-if="!group.privado" ng-click="group.privado = true"> <i class="fa fa-square-o" ng-model="group.privado"></i> Privado </label> </div> <button type="submit" class="btn btn-success" ng-click="actionSubmit()"> {{submitTitle}} <i class="fa fa-floppy-o"></i> </button> <a ng-href="/#/group/{{group._id}}" class="btn btn-default btn-primary"> Ver <i class="fa fa-eye"></i> </a> </form> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div>
<?php $hostname = "localhost"; $user = "root"; $password = "admin"; $database = "employees"; mysql_connect($hostname, $user, $password); mysql_set_charset('utf8'); @mysql_select_db($database) or die( "Unable to select database"); mysql_query("SET NAMES 'utf8'"); $mysqli = new mysqli($hostname, $user, $password, $database); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: " . $mysqli->connect_error; exit; } if (!$mysqli->set_charset("utf8")) { printf("Error loading character set utf8: %s\n", $mysqli->error); exit; }
title: The Little Eye Blog # View. # 1 = List # 2 = Compact # 3 = Card view: 3 aliases: ["/the-little-eye/"] # Optional header image (relative to `static/img/` folder). header: caption: "" image: "" A Point of View on Microscopy Research, the History of the Microscope and a hint of Interdisciplinary Academia My aim with this blog is to share with others some of my interests, mainly in microscopy and bioimaging. You can expect to see a few different styles of posts as detailed in  [Welcome to The Little Eye]({{< relref "20170619_intro" >}}). Why “The Little Eye”? I’ve taken the name The Little Eye from Galileo Galilei who coined his early compound microscopes: "Occhiolino", Italian for "little eye". The term "microscope" was coined by Giovanni Faber, a contempory of Galileo, and comes from the Greek words for "small" and "to look at", intended to be analogous to "telescope" (see [Welcome to The Little Eye]({{< relref "20170619_intro" >}})).
.root { display: inline-block; position: relative; z-index: 1; cursor: var(--cursor-pointer); height: var(--navbar-height); line-height: var(--navbar-height); border: none; padding: var(--<API key>); font-size: var(--font-size-large); } .root:not(:last-child) { margin-right: var(--navbar-item-space); } .root::after { position: absolute; icon-font: url('../../i-icon.vue/assets/arrow-down.svg'); font-size: var(--<API key>); right: 10px; top: 0; line-height: var(--navbar-height); } .popper { background: white; font-size: var(--<API key>); width: 100%; line-height: var(--<API key>); } .root[disabled] { cursor: var(--cursor-not-allowed); color: var(--<API key>); }