repo_name
stringlengths 4
116
| path
stringlengths 4
379
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
insin/deduped-babel-presets | plugins/react-inline-elements.js | 73 | module.exports = require('babel-plugin-transform-react-inline-elements')
| mit |
WuTheFWasThat/vimflowy | src/assets/ts/utils/browser.ts | 2998 | /* Utilities for stuff related to being in the browser */
import $ from 'jquery';
import { saveAs } from 'file-saver';
// needed for the browser checks
declare var window: any;
// TODO: get jquery typing to work?
export function scrollDiv($elem: any, amount: number) {
// # animate. seems to not actually be great though
// $elem.stop().animate({
// scrollTop: $elem[0].scrollTop + amount
// }, 50)
return $elem.scrollTop($elem.scrollTop() + amount);
}
// TODO: get jquery typing to work?
export function scrollIntoView(el: Element, $within: any, margin: number = 0) {
const elemTop = el.getBoundingClientRect().top;
const elemBottom = el.getBoundingClientRect().bottom;
const top_margin = margin;
const bottom_margin = margin + ($('#bottom-bar').height() as number);
if (elemTop < top_margin) {
// scroll up
return scrollDiv($within, elemTop - top_margin);
} else if (elemBottom > window.innerHeight - bottom_margin) {
// scroll down
return scrollDiv($within, elemBottom - window.innerHeight + bottom_margin);
}
}
export function isScrolledIntoView($elem: any, $container: any) {
const docViewTop = $container.offset().top;
const docViewBottom = docViewTop + $container.outerHeight();
const elemTop = $elem.offset().top;
const elemBottom = elemTop + $elem.height();
return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
}
export function getParameterByName(name: string) {
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
const results = regex.exec(window.location.href);
if (!results) { return null; }
if (!results[2]) { return ''; }
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
export function downloadFile(filename: string, content: string, mimetype: string) {
const blob = new Blob([content], {type: `${mimetype};charset=utf-8`});
saveAs(blob, filename);
}
// SEE: http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
export function isOpera(): boolean {
return !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; // Opera 8.0+
}
export function isSafari(): boolean {
return Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; // Safari 3+
}
export function isChrome(): boolean {
return !!window.chrome && !isOpera; // Chrome 1+
}
declare var InstallTrigger: any;
export function isFirefox(): boolean {
return typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
}
export function cancel(ev: Event) {
ev.stopPropagation();
ev.preventDefault();
return false;
}
export function mimetypeLookup(filename: string): string | undefined {
const parts = filename.split('.');
const extension = parts.length > 1 ? parts[parts.length - 1] : '';
const extensionLookup: {[key: string]: string} = {
'json': 'application/json',
'txt': 'text/plain',
'': 'text/plain',
};
return extensionLookup[extension.toLowerCase()];
}
| mit |
kristianmandrup/prawn_html | lib/html/pdf/actions/position.rb | 408 | module Prawn
module Html
module PdfActionHandler
module Position
def do_break
pdf.move_down break_height
ypos += break_height
end
def do_new_page
if ypos > options[:position][:page_height]
pdf.start_new_page
ypos = start_page_ypos
end
end
end
end
end
end
| mit |
jenkinsci/jenkins-design-language | utils/elementset/ElementSetManip.test.ts | 1354 | import { $ } from './ElementSet';
import './ElementSetManip';
describe('ElementSetManip', () => {
beforeEach(() => {
document.documentElement.innerHTML = `
<div class="elem1" title="title 1">
<div class="child1">text 1</div>
</div>
<div class="elem2">
<div class="child2">text 2</div>
</div>
<div class="elem3">
<div class="child3">text 3 1</div>
<div class="child3">text 3 2</div>
<div class="child3">text 3 3</div>
</div>
`;
});
it('handles classes', () => {
const $m2 = $('.elem2');
expect($m2.is('cls2')).toBeFalsy();
$m2.add.c('cls2');
expect($m2.is('.cls2')).toBeTruthy();
$m2.rm.c('cls2');
expect($m2.is('.cls2')).toBeFalsy();
});
it('handles attributes', () => {
const $m1 = $('.elem1');
expect($m1.get.attr('title')).toBe('title 1');
$m1.set.attr('title', 'modified title');
expect($m1.get.attr('title')).toBe('modified title');
$m1.rm.attr('title');
expect($m1.get.attr('title')).toBeFalsy();
});
it('handles sizes', () => {
const $m1 = $('.elem1');
// jsdom just always returns 0
expect($m1.get.width()).toBe(0);
expect($m1.get.height()).toBe(0);
});
});
| mit |
crummy/codeeval | translation.cpp | 1291 | // https://www.codeeval.com/open_challenges/121/
#include <fstream>
#include <iostream>
#include <map>
using namespace std;
int main(int argc, char** argv) {
// couldn't figure out the algorithm, so just hardcode it and guess the two missing chars
map<char, char> translation;
translation['y'] = 'a';
translation['n'] = 'b';
translation['f'] = 'c';
translation['i'] = 'd';
translation['c'] = 'e';
translation['w'] = 'f';
translation['l'] = 'g';
translation['b'] = 'h';
translation['k'] = 'i';
translation['u'] = 'j';
translation['o'] = 'k';
translation['m'] = 'l';
translation['x'] = 'm';
translation['s'] = 'n';
translation['e'] = 'o';
translation['v'] = 'p';
translation['z'] = 'q';
translation['p'] = 'r';
translation['d'] = 's';
translation['r'] = 't';
translation['j'] = 'u';
translation['g'] = 'v'; // ?
translation['t'] = 'w';
translation['h'] = 'x'; // ?
translation['a'] = 'y';
translation['q'] = 'z';
ifstream file;
file.open(argv[1]);
while (!file.eof()) {
char ch = file.get();
if (ch >= 'a' && ch <= 'z') {
cout << translation[ch];
} else {
cout << ch;
}
}
cout << endl;
} | mit |
Winterfr0st/dfrost | src/Math/Vertex2.cpp | 350 | #include <Math/Vertex2.h>
namespace dfrost {
namespace Math {
Vertex2::Vertex2(const Vertex2& other) :
x_(other.x_),
y_(other.y_) {
}
Vertex2::Vertex2(Vertex2&& other) :
x_(other.x_),
y_(other.y_) {
}
Vertex2::Vertex2(float x, float y) :
x_(x),
y_(y) {
}
float Vertex2::X() const {
return x_;
}
float Vertex2::Y() const {
return y_;
}
}
} | mit |
stephen144/ypreg | db/schema.rb | 7878 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20151022151545) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "addresses", force: :cascade do |t|
t.string "line1"
t.string "line2"
t.string "city"
t.string "state"
t.integer "zipcode"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "event_localities", force: :cascade do |t|
t.integer "event_id"
t.integer "locality_id"
t.boolean "paid", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["event_id", "locality_id"], name: "index_event_localities_on_event_id_and_locality_id", unique: true, using: :btree
t.index ["event_id"], name: "index_event_localities_on_event_id", using: :btree
t.index ["locality_id"], name: "index_event_localities_on_locality_id", using: :btree
end
create_table "event_lodgings", force: :cascade do |t|
t.integer "event_id"
t.integer "lodging_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["event_id", "lodging_id"], name: "index_event_lodgings_on_event_id_and_lodging_id", unique: true, using: :btree
t.index ["event_id"], name: "index_event_lodgings_on_event_id", using: :btree
t.index ["lodging_id"], name: "index_event_lodgings_on_lodging_id", using: :btree
end
create_table "events", force: :cascade do |t|
t.date "begin_date"
t.string "description"
t.date "end_date"
t.integer "event_type", default: 0
t.integer "location_id"
t.string "name"
t.date "registration_close_date"
t.integer "registration_cost"
t.date "registration_open_date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["location_id"], name: "index_events_on_location_id", using: :btree
end
create_table "hospitality_registration_assignments", force: :cascade do |t|
t.integer "hospitality_id"
t.integer "registration_id"
t.integer "locality_id"
t.integer "event_id"
t.index ["event_id"], name: "index_hospitality_registration_assignments_on_event_id", using: :btree
t.index ["hospitality_id", "registration_id", "locality_id"], name: "hosp_assignmts", unique: true, using: :btree
t.index ["hospitality_id"], name: "index_hospitality_registration_assignments_on_hospitality_id", using: :btree
t.index ["locality_id"], name: "index_hospitality_registration_assignments_on_locality_id", using: :btree
t.index ["registration_id"], name: "index_hospitality_registration_assignments_on_registration_id", using: :btree
end
create_table "localities", force: :cascade do |t|
t.string "city"
t.string "state"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "locations", force: :cascade do |t|
t.string "address1"
t.string "address2"
t.string "city"
t.text "description"
t.integer "location_type", default: 0
t.string "name"
t.string "state"
t.integer "zipcode"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "max_capacity"
end
create_table "lodgings", force: :cascade do |t|
t.text "description"
t.integer "location_id"
t.integer "lodging_type", default: 0
t.integer "max_capacity"
t.integer "min_capacity"
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["location_id"], name: "index_lodgings_on_location_id", using: :btree
end
create_table "notes", force: :cascade do |t|
t.string "content"
t.integer "user_id"
t.integer "event_id"
t.index ["event_id"], name: "index_notes_on_event_id", using: :btree
t.index ["user_id"], name: "index_notes_on_user_id", using: :btree
end
create_table "pg_search_documents", force: :cascade do |t|
t.text "content"
t.string "searchable_type"
t.integer "searchable_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["searchable_type", "searchable_id"], name: "index_pg_search_documents_on_searchable_type_and_searchable_id", using: :btree
end
create_table "registrations", force: :cascade do |t|
t.integer "event_locality_id"
t.integer "event_lodging_id"
t.boolean "guest", default: false
t.boolean "medical_release", default: false
t.boolean "paid", default: false
t.integer "payment_type", default: 0
t.integer "payment_adjustment", default: 0
t.boolean "serving_one", default: false
t.integer "status"
t.integer "user_id"
t.integer "vehicle_seating_capacity"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["event_locality_id", "user_id"], name: "index_registrations_on_event_locality_id_and_user_id", unique: true, using: :btree
t.index ["event_locality_id"], name: "index_registrations_on_event_locality_id", using: :btree
t.index ["event_lodging_id"], name: "index_registrations_on_event_lodging_id", using: :btree
t.index ["user_id"], name: "index_registrations_on_user_id", using: :btree
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "name"
t.integer "locality_id"
t.integer "lodgings_id"
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "role", default: 0
t.integer "age", default: 0
t.string "avatar"
t.datetime "background_check_date"
t.date "birthday"
t.string "cell_phone"
t.integer "gender", default: 0
t.integer "grade", default: 0
t.string "home_phone"
t.string "work_phone"
t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
t.index ["locality_id"], name: "index_users_on_locality_id", using: :btree
t.index ["lodgings_id"], name: "index_users_on_lodgings_id", using: :btree
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
end
end
| mit |
Atvaark/insomnia | packages/insomnia-app/webpack/webpack.config.base.babel.js | 1713 | const webpack = require('webpack');
const path = require('path');
const pkg = require('../package.json');
module.exports = {
devtool: 'source-map',
context: path.join(__dirname, '../app'),
entry: ['./renderer.js', './renderer.html'],
output: {
path: path.join(__dirname, '../build'),
filename: 'bundle.js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.(js)$/,
use: ['babel-loader'],
exclude: [/node_modules/, /__fixtures__/, /__tests__/]
},
{
// To make
test: /\.(js|flow)$/,
use: ['babel-loader'],
include: [/node_modules\/graphql-language-service-interface/]
},
{
test: /\.(less|css)$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { importLoaders: 1 } },
{ loader: 'less-loader', options: { noIeCompat: true } }
]
},
{
test: /\.(html|woff2)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
},
{
test: /\.(png)$/,
loader: 'url-loader'
}
]
},
resolve: {
extensions: ['.js', '.json'],
mainFields: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
},
node: {
__dirname: false // Use Node __dirname
},
externals: [
// Omit all dependencies in app/package.json (we want them loaded at runtime via NodeJS)
...Object.keys(pkg.dependencies).filter(name => !pkg.packedDependencies.includes(name)),
// To get jsonlint working...
'file',
'system'
],
plugins: [new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 })],
target: 'electron-renderer'
};
| mit |
osavchenko/SonataAdminBundle | tests/App/Datagrid/Datagrid.php | 1869 | <?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Tests\App\Datagrid;
use Sonata\AdminBundle\Datagrid\DatagridInterface;
use Sonata\AdminBundle\Datagrid\PagerInterface;
use Sonata\AdminBundle\Filter\FilterInterface;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormFactoryInterface;
final class Datagrid implements DatagridInterface
{
private $formFactory;
private $pager;
public function __construct(FormFactoryInterface $formFactory, PagerInterface $pager)
{
$this->formFactory = $formFactory;
$this->pager = $pager;
}
public function getPager()
{
return $this->pager;
}
public function getQuery()
{
}
public function getResults()
{
return $this->pager->getResults();
}
public function buildPager()
{
}
public function addFilter(FilterInterface $filter)
{
}
public function getFilters()
{
}
public function reorderFilters(array $keys)
{
}
public function getValues()
{
return [];
}
public function getColumns()
{
}
public function setValue($name, $operator, $value)
{
}
public function getForm()
{
return $this->formFactory->createNamedBuilder('filter', FormType::class, [])->getForm();
}
public function getFilter($name)
{
}
public function hasFilter($name)
{
}
public function removeFilter($name)
{
}
public function hasActiveFilters()
{
}
public function hasDisplayableFilters()
{
}
}
| mit |
juradoz/jdial | jdial-core/src/test/java/al/jdi/core/devolveregistro/ModificadorResultadoSemAgentesFakeTest.java | 3405 | package al.jdi.core.devolveregistro;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import al.jdi.core.configuracoes.Configuracoes;
import al.jdi.core.devolveregistro.ModificadorResultado.ResultadosConhecidos;
import al.jdi.core.modelo.Discavel;
import al.jdi.core.modelo.Ligacao;
import al.jdi.core.tenant.Tenant;
import al.jdi.dao.beans.DaoFactory;
import al.jdi.dao.beans.ResultadoLigacaoDao;
import al.jdi.dao.model.Campanha;
import al.jdi.dao.model.Cliente;
import al.jdi.dao.model.MotivoSistema;
import al.jdi.dao.model.ResultadoLigacao;
public class ModificadorResultadoSemAgentesFakeTest {
private ModificadorResultadoSemAgentesFake modificadorResultadoSemAgentesFake;
@Mock
private Configuracoes configuracoes;
@Mock
private DaoFactory daoFactory;
@Mock
private ResultadoLigacao resultadoLigacao;
@Mock
private Ligacao ligacao;
@Mock
private Cliente cliente;
@Mock
private Campanha campanha;
@Mock
private ResultadoLigacaoDao resultadoLigacaoDao;
@Mock
private ResultadoLigacao resultadoLigacaoAtendida;
@Mock
private ResultadoLigacao resultadoLigacaoSemAgentes;
@Mock
private Tenant tenant;
@Mock
private Discavel discavel;
@Before
public void setUp() throws Exception {
initMocks(this);
when(daoFactory.getResultadoLigacaoDao()).thenReturn(resultadoLigacaoDao);
when(resultadoLigacaoDao.procura(MotivoSistema.ATENDIDA.getCodigo(), campanha)).thenReturn(
resultadoLigacaoAtendida);
when(resultadoLigacaoDao.procura(ResultadosConhecidos.SEM_AGENTES.getCodigo(), campanha))
.thenReturn(resultadoLigacaoSemAgentes);
when(tenant.getConfiguracoes()).thenReturn(configuracoes);
when(tenant.getCampanha()).thenReturn(campanha);
when(ligacao.getDiscavel()).thenReturn(discavel);
when(discavel.getCliente()).thenReturn(cliente);
modificadorResultadoSemAgentesFake = new ModificadorResultadoSemAgentesFake();
}
@Test
public void acceptDeveriaRetornarTrue() throws Exception {
assertThat(modificadorResultadoSemAgentesFake.accept(tenant, daoFactory, ligacao,
resultadoLigacaoAtendida), is(true));
}
@Test
public void acceptDeveriaRetornarFalseUraReversa() throws Exception {
when(configuracoes.isUraReversa()).thenReturn(true);
assertThat(modificadorResultadoSemAgentesFake.accept(tenant, daoFactory, ligacao,
resultadoLigacaoAtendida), is(false));
}
@Test
public void acceptDeveriaRetornarFalseResultado() throws Exception {
assertThat(
modificadorResultadoSemAgentesFake.accept(tenant, daoFactory, ligacao, resultadoLigacao),
is(false));
}
@Test
public void acceptDeveriaRetornarFalseNoAgente() throws Exception {
when(ligacao.isNoAgente()).thenReturn(true);
assertThat(modificadorResultadoSemAgentesFake.accept(tenant, daoFactory, ligacao,
resultadoLigacaoAtendida), is(false));
}
@Test
public void modificaDeveriaRetornarSemAgentes() throws Exception {
assertThat(
modificadorResultadoSemAgentesFake.modifica(tenant, daoFactory, ligacao, resultadoLigacao),
is(sameInstance(resultadoLigacaoSemAgentes)));
}
}
| mit |
UCCNetworkingSociety/lowdown | app/Subscription.php | 787 | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Subscription extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'subscriptions';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['user_id', 'society_id'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [];
/**
* Get the society from a subscription
*/
public function societies()
{
return $this->belongsTo('App\Society');
}
/**
* Get the user from a subscription
*/
public function user(){
return $this->belongsTo('App\User');
}
}
| mit |
KIT-MAMID/mamid | master/cmd/master.go | 6906 | package main
import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
"flag"
"github.com/KIT-MAMID/mamid/master"
"github.com/KIT-MAMID/mamid/master/masterapi"
"github.com/KIT-MAMID/mamid/model"
"github.com/KIT-MAMID/mamid/msp"
"github.com/Sirupsen/logrus"
"github.com/gorilla/mux"
"io/ioutil"
"net/http"
"time"
)
var masterLog = logrus.WithField("module", "master")
type LogLevelFlag struct {
// flag.Value
lvl logrus.Level
}
func (f LogLevelFlag) String() string {
return f.lvl.String()
}
func (f LogLevelFlag) Set(val string) error {
l, err := logrus.ParseLevel(val)
if err != nil {
f.lvl = l
}
return err
}
func main() {
// Command Line Flags
var (
logLevel LogLevelFlag = LogLevelFlag{logrus.DebugLevel}
listenString string
slaveVerifyCA, slaveAuthCert, slaveAuthKey, apiCert, apiKey, apiVerifyCA string
dbDriver, dbDSN string
monitorInterval = 10 * time.Second
slaveTimeout = 5 * time.Second
)
flag.Var(&logLevel, "log.level", "possible values: debug, info, warning, error, fatal, panic")
flag.StringVar(&dbDriver, "db.driver", "postgres", "the database driver to use. See https://golang.org/pkg/database/sql/#Open")
flag.StringVar(&dbDSN, "db.dsn", "", "the data source name to use. for PostgreSQL, checkout https://godoc.org/github.com/lib/pq")
flag.StringVar(&listenString, "listen", ":8080", "net.Listen() string, e.g. addr:port")
flag.StringVar(&slaveVerifyCA, "slave.verifyCA", "", "The CA certificate to verify slaves against")
flag.StringVar(&slaveAuthCert, "slave.auth.cert", "", "The client certificate for authentication against the slave")
flag.StringVar(&slaveAuthKey, "slave.auth.key", "", "The key for the client certificate for authentication against the slave")
flag.DurationVar(&slaveTimeout, "slave.timeout", slaveTimeout,
"Timeout for requests from master to slave. Specify with suffix [ms,s,min,...]")
flag.StringVar(&apiCert, "api.cert", "", "Optional: a certificate for the api/webinterface")
flag.StringVar(&apiKey, "api.key", "", "Optional: the key for the certificate for the api/webinterface")
flag.StringVar(&apiVerifyCA, "api.verifyCA", "", "Optional: a ca to check client certs of webinterface/api users. Implies authentication")
flag.DurationVar(&monitorInterval, "monitor.interval", monitorInterval,
"Interval in which the monitoring component should poll slaves for status updates."+
"Note that the monitor waits for the slowest slave before a new monitor run starts (-slave.timeout). Specify with suffix [ms,s,min,...]")
flag.Parse()
if dbDriver != "postgres" {
masterLog.Fatal("-db.driver: only 'postgres' is supported")
}
if dbDSN == "" {
masterLog.Fatal("-db.dsn cannot be empty")
}
if slaveVerifyCA == "" {
masterLog.Fatal("No root certificate for the slave server communication passed. Specify with -slave.verifyCA")
}
if slaveAuthCert == "" {
masterLog.Fatal("No client certificate for the slave server communication passed. Specify with -slave.auth.cert")
}
if slaveAuthKey == "" {
masterLog.Fatal("No key for the client certificate for the slave server communication passed. Specify with -slave.auth.key")
}
if check := apiKey + apiCert; check != "" && (check == apiKey || check == apiCert) {
masterLog.Fatal("Either -apiCert specified without -apiKey or vice versa.")
}
// Start application
logrus.SetLevel(logLevel.lvl)
masterLog.Info("Startup")
// Setup controllers
bus := master.NewBus()
go bus.Run()
db, err := model.InitializeDB(dbDriver, dbDSN)
dieOnError(err)
clusterAllocatorBusWriteChannel := bus.GetNewWriteChannel()
clusterAllocator := &master.ClusterAllocator{
BusWriteChannel: &clusterAllocatorBusWriteChannel,
}
tx := db.Begin()
if err := clusterAllocator.InitializeGlobalSecrets(tx); err != nil {
tx.Rollback()
masterLog.Fatalf("Error initializing global secrets: %s", err)
}
tx.Commit()
go clusterAllocator.Run(db)
mainRouter := mux.NewRouter().StrictSlash(true)
httpStatic := http.FileServer(http.Dir("./gui/"))
mainRouter.Handle("/", httpStatic)
mainRouter.PathPrefix("/static/").Handler(httpStatic)
mainRouter.PathPrefix("/pages/").Handler(httpStatic)
masterAPI := &masterapi.MasterAPI{
DB: db,
ClusterAllocator: clusterAllocator,
Router: mainRouter.PathPrefix("/api/").Subrouter(),
}
masterAPI.Setup()
certPool := x509.NewCertPool()
cert, err := loadCertificateFromFile(slaveVerifyCA)
dieOnError(err)
certPool.AddCert(cert)
clientAuthCert, err := tls.LoadX509KeyPair(slaveAuthCert, slaveAuthKey)
dieOnError(err)
httpTransport := &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: certPool,
Certificates: []tls.Certificate{clientAuthCert},
},
}
mspClient := msp.MSPClientImpl{
HttpClient: http.Client{
Transport: httpTransport,
Timeout: slaveTimeout,
},
}
monitor := master.Monitor{
DB: db,
BusWriteChannel: bus.GetNewWriteChannel(),
MSPClient: mspClient,
Interval: monitorInterval,
}
go monitor.Run()
deployer := master.Deployer{
DB: db,
BusReadChannel: bus.GetNewReadChannel(),
MSPClient: mspClient,
}
go deployer.Run()
problemManager := master.ProblemManager{
DB: db,
BusReadChannel: bus.GetNewReadChannel(),
}
go problemManager.Run()
listenAndServe(listenString, mainRouter, apiCert, apiKey, apiVerifyCA)
}
func dieOnError(err error) {
if err != nil {
panic(err)
}
}
func loadCertificateFromFile(file string) (cert *x509.Certificate, err error) {
certFile, err := ioutil.ReadFile(file)
if err != nil {
return
}
block, _ := pem.Decode(certFile)
cert, err = x509.ParseCertificate(block.Bytes)
return
}
func listenAndServe(listenString string, mainRouter *mux.Router, apiCert string, apiKey string, apiVerifyCA string) {
// Listen...
if apiCert != "" {
// ...with TLS but WITHOUT client cert auth
if apiVerifyCA == "" {
err := http.ListenAndServeTLS(listenString, apiCert, apiKey, mainRouter)
dieOnError(err)
} else { // ...with TLS AND client cert auth
certPool := x509.NewCertPool()
caCertContent, err := ioutil.ReadFile(apiVerifyCA)
dieOnError(err)
certPool.AppendCertsFromPEM(caCertContent)
tlsConfig := &tls.Config{
ClientCAs: certPool,
ClientAuth: tls.RequireAndVerifyClientCert,
}
server := &http.Server{
TLSConfig: tlsConfig,
Addr: listenString,
Handler: mainRouter,
}
err = server.ListenAndServeTLS(apiCert, apiKey)
dieOnError(err)
}
} else {
// ...insecure and unauthenticated
err := http.ListenAndServe(listenString, mainRouter)
dieOnError(err)
}
}
| mit |
tamaracha/wbt-framework | api/controllers/response.js | 557 | 'use strict';
const models = require('../models');
const $ = module.exports={};
$.create = function *create(){
const guess = yield models.Guess.findById(this.params.guess);
this.assert(guess,'no guess found',404);
this.assert(guess.updatedAt.toUTCString() === this.header['if-unmodified-since'], 412, 'guess has been changed after last fetch');
const response = guess.responses.create(this.request.body);
guess.responses.push(response);
yield guess.save();
this.lastModified = guess.updatedAt;
this.body = response;
this.status = 201;
};
| mit |
unrolled/tango | handler.go | 4558 | package tango
import (
"html"
"net/http"
"net/url"
"path"
"strings"
)
type HandlerInterface interface {
New() HandlerInterface
Head(request *HttpRequest) *HttpResponse
Get(request *HttpRequest) *HttpResponse
Post(request *HttpRequest) *HttpResponse
Put(request *HttpRequest) *HttpResponse
Patch(request *HttpRequest) *HttpResponse
Delete(request *HttpRequest) *HttpResponse
Options(request *HttpRequest) *HttpResponse
PermanentRedirect(request *HttpRequest, urlStr string) *HttpResponse
TemporaryRedirect(request *HttpRequest, urlStr string) *HttpResponse
Prepare(request *HttpRequest) *HttpResponse
Finish(request *HttpRequest, response *HttpResponse)
ErrorHandler(errorStr string) *HttpResponse
}
type BaseHandler struct{}
func (h *BaseHandler) ErrorHandler(errorStr string) *HttpResponse {
return h.HttpResponseServerError()
}
func (h *BaseHandler) Prepare(request *HttpRequest) *HttpResponse {
return nil
}
func (h *BaseHandler) Finish(request *HttpRequest, response *HttpResponse) {
// pass
}
func (h *BaseHandler) Head(request *HttpRequest) *HttpResponse {
// Special case: When Head is 'nil', we grab the Get response and strip
// out the content.
return nil
}
func (h *BaseHandler) Get(request *HttpRequest) *HttpResponse {
return h.HttpResponseNotAllowed()
}
func (h *BaseHandler) Post(request *HttpRequest) *HttpResponse {
return h.HttpResponseNotAllowed()
}
func (h *BaseHandler) Put(request *HttpRequest) *HttpResponse {
return h.HttpResponseNotAllowed()
}
func (h *BaseHandler) Patch(request *HttpRequest) *HttpResponse {
return h.HttpResponseNotAllowed()
}
func (h *BaseHandler) Delete(request *HttpRequest) *HttpResponse {
return h.HttpResponseNotAllowed()
}
func (h *BaseHandler) Options(request *HttpRequest) *HttpResponse {
return h.HttpResponseNotAllowed()
}
func (h *BaseHandler) PermanentRedirect(request *HttpRequest, urlStr string) *HttpResponse {
return h.redirect(request, urlStr, http.StatusMovedPermanently)
}
func (h *BaseHandler) TemporaryRedirect(request *HttpRequest, urlStr string) *HttpResponse {
return h.redirect(request, urlStr, http.StatusTemporaryRedirect)
}
func (h *BaseHandler) redirect(r *HttpRequest, urlStr string, code int) *HttpResponse {
// Borrowed from http://golang.org/pkg/net/http/#Redirect
if u, err := url.Parse(urlStr); err == nil {
oldpath := r.URL.Path
if oldpath == "" {
oldpath = "/"
}
if u.Scheme == "" {
if urlStr == "" || urlStr[0] != '/' {
olddir, _ := path.Split(oldpath)
urlStr = olddir + urlStr
}
var query string
if i := strings.Index(urlStr, "?"); i != -1 {
urlStr, query = urlStr[:i], urlStr[i:]
}
trailing := urlStr[len(urlStr)-1] == '/'
urlStr = path.Clean(urlStr)
if trailing && !strings.HasSuffix(urlStr, "/") {
urlStr += "/"
}
urlStr += query
}
}
response := NewHttpResponse()
response.Header.Set("Location", urlStr)
response.StatusCode = code
// RFC2616 recommends that a short note "SHOULD" be included in the
// response because older user agents may not understand 301/307.
// Shouldn't send the response for POST or HEAD; that leaves GET.
if strings.EqualFold(r.Method, "GET") {
response.Content = "<a href=\"" + html.EscapeString(urlStr) + "\">" + http.StatusText(code) + "</a>.\n"
}
return response
}
func (h *BaseHandler) HttpResponseNotModified() *HttpResponse {
return shortHttpReturn(http.StatusNotModified)
}
func (h *BaseHandler) HttpResponseBadRequest() *HttpResponse {
return shortHttpReturn(http.StatusBadRequest)
}
func (h *BaseHandler) HttpResponseForbidden() *HttpResponse {
return shortHttpReturn(http.StatusForbidden)
}
func (h *BaseHandler) HttpResponseNotFound() *HttpResponse {
return shortHttpReturn(http.StatusNotFound)
}
func (h *BaseHandler) HttpResponseNotAllowed() *HttpResponse {
return shortHttpReturn(http.StatusMethodNotAllowed)
}
func (h *BaseHandler) HttpResponseGone() *HttpResponse {
return shortHttpReturn(http.StatusGone)
}
func (h *BaseHandler) HttpResponseServerError() *HttpResponse {
return shortHttpReturn(http.StatusInternalServerError)
}
func shortHttpReturn(code int) *HttpResponse {
return NewHttpResponse(http.StatusText(code), code, "text/plain")
}
| mit |
SaviorXTanren/mixer-client-csharp | Twitch/Twitch.Base.UnitTests/NewAPI/TagsServiceUnitTests.cs | 2599 | using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twitch.Base.Models.NewAPI.Tags;
using Twitch.Base.Models.NewAPI.Users;
namespace Twitch.Base.UnitTests.NewAPI
{
[TestClass]
public class TagsServiceUnitTests : UnitTestBase
{
[TestMethod]
public void GetStreamTags()
{
TestWrapper(async (TwitchConnection connection) =>
{
IEnumerable<TagModel> results = await connection.NewAPI.Tags.GetStreamTags();
Assert.IsNotNull(results);
Assert.IsTrue(results.Count() > 0);
});
}
[TestMethod]
public void GetStreamTagsByIDs()
{
TestWrapper(async (TwitchConnection connection) =>
{
IEnumerable<TagModel> tags = await connection.NewAPI.Tags.GetStreamTags();
IEnumerable<TagModel> results = await connection.NewAPI.Tags.GetStreamTagsByIDs(tags.Take(10).Select(t => t.tag_id));
Assert.IsNotNull(results);
Assert.IsTrue(results.Count() > 0);
});
}
[TestMethod]
public void GetStreamTagsForBroadcaster()
{
TestWrapper(async (TwitchConnection connection) =>
{
UserModel user = await connection.NewAPI.Users.GetUserByLogin("TwitchPresents");
IEnumerable<TagModel> results = await connection.NewAPI.Tags.GetStreamTagsForBroadcaster(user);
Assert.IsNotNull(results);
Assert.IsTrue(results.Count() > 0);
});
}
[TestMethod]
public void UpdateStreamTags()
{
TestWrapper(async (TwitchConnection connection) =>
{
IEnumerable<TagModel> tags = await connection.NewAPI.Tags.GetStreamTags();
UserModel user = await UsersServiceUnitTests.GetCurrentUser(connection);
await connection.NewAPI.Tags.UpdateStreamTags(user);
IEnumerable<TagModel> results = await connection.NewAPI.Tags.GetStreamTagsForBroadcaster(user);
Assert.IsNotNull(results);
Assert.IsTrue(results.Count() == 0);
await connection.NewAPI.Tags.UpdateStreamTags(user, tags.Take(3));
results = await connection.NewAPI.Tags.GetStreamTagsForBroadcaster(user);
Assert.IsNotNull(results);
Assert.IsTrue(results.Count() == 3);
});
}
}
}
| mit |
sodash/open-code | winterwell.web/test/com/winterwell/ical/ICalEventTest.java | 2220 | package com.winterwell.ical;
import static org.junit.Assert.*;
import java.util.List;
import org.junit.Test;
import com.winterwell.utils.time.Time;
public class ICalEventTest {
@Test
public void testGetRepeats() {
String ical = "BEGIN:VEVENT\n"
+ "DTSTART;TZID=Europe/London:20210302T103000\n"
+ "DTEND;TZID=Europe/London:20210302T113000\n"
+ "RRULE:FREQ=WEEKLY;BYDAY=TU\n"
+ "EXDATE;TZID=Europe/London:20210406T103000\n"
+ "DTSTAMP:20210615T134508Z\n"
+ "ORGANIZER;CN=am@good-loop.com:mailto:am@good-loop.com\n"
+ "UID:43q6ms332vmtvobgff_R20210302T103000@google.com\n"
+ "ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=dan\n"
+ " @good-loop.com;X-NUM-GUESTS=0:mailto:dan@good-loop.com\n"
+ "ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=am@go\n"
+ " od-loop.com;X-NUM-GUESTS=0:mailto:am@good-loop.com\n"
+ "ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=ry@g\n"
+ " ood-loop.com;X-NUM-GUESTS=0:mailto:ry@good-loop.com\n"
+ "ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=DECLINED;CN=dan\n"
+ " .winters@gmail.com;X-NUM-GUESTS=0:mailto:dan.winters@gmail.com\n"
+ "CREATED:20210211T171146Z\n"
+ "DESCRIPTION:https://docs.google.com/presentation/d/1xIqZ_FubERa_Gxxo\n"
+ " 2taBxosqQ8W3dGc/edit#slide=id.gbe18bd1b_0_22\\n\\nThis event has a vid\n"
+ " eo call.\\nJoin: https://meet.google.com/yrg-dpxa-vra\\n(GB) +44 20 3910 5158\n"
+ " PIN: 489139953#\\nView more phone numbers: https://tel.meet/yrg-dpxa-vra?pi\n"
+ " n=13761982&hs=7\n"
+ "LAST-MODIFIED:20210608T232901Z\n"
+ "LOCATION:\n"
+ "SEQUENCE:0\n"
+ "STATUS:CONFIRMED\n"
+ "SUMMARY:Explore Squad Weekly Check-in\n"
+ "TRANSP:OPAQUE\n"
+ "END:VEVENT";
ICalReader ir = new ICalReader(ical);
ICalEvent e = ir.getEvents().get(0);
assert e.timezone != null;
assert e.start.equals(new Time(2021, 3,2,10,30,0)) : e.start;
Time j1 = new Time(2021,6,1);
Time j2 = new Time(2021,7,1);
List<ICalEvent> rs = e.getRepeats(j1, j2);
ICalEvent e2 = rs.get(0);
System.out.println(e2);
assert e2.start.equals(new Time(2021, 3,2,9,30,0)) : e.start;
}
}
| mit |
santa01/graphene | example/src/main.cpp | 1207 | /*
* Copyright (c) 2013 Pavlo Lavrenenko
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 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 <Example.h>
int main() {
Example example;
return example.exec();
}
| mit |
panthole/AndroidChart | src/com/panthole/androidchart/renderer/DialRenderer.java | 4553 | /**
* Copyright (C) 2009 - 2013 SC 4ViewSoft SRL
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.panthole.androidchart.renderer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.panthole.androidchart.util.MathHelper;
/**
* Dial chart renderer.
*/
public class DialRenderer extends DefaultRenderer {
/** The start angle in the dial range. */
private double mAngleMin = 330;
/** The end angle in the dial range. */
private double mAngleMax = 30;
/** The start value in dial range. */
private double mMinValue = MathHelper.NULL_VALUE;
/** The end value in dial range. */
private double mMaxValue = -MathHelper.NULL_VALUE;
/** The spacing for the minor ticks. */
private double mMinorTickSpacing = MathHelper.NULL_VALUE;
/** The spacing for the major ticks. */
private double mMajorTickSpacing = MathHelper.NULL_VALUE;
/** An array of the renderers types (default is NEEDLE). */
private List<Type> mVisualTypes = new ArrayList<Type>();
public enum Type {
NEEDLE, ARROW;
}
/**
* Returns the start angle value of the dial.
*
* @return the angle start value
*/
public double getAngleMin() {
return mAngleMin;
}
/**
* Sets the start angle value of the dial.
*
* @param min the dial angle start value
*/
public void setAngleMin(double min) {
mAngleMin = min;
}
/**
* Returns the end angle value of the dial.
*
* @return the angle end value
*/
public double getAngleMax() {
return mAngleMax;
}
/**
* Sets the end angle value of the dial.
*
* @param max the dial angle end value
*/
public void setAngleMax(double max) {
mAngleMax = max;
}
/**
* Returns the start value to be rendered on the dial.
*
* @return the start value on dial
*/
public double getMinValue() {
return mMinValue;
}
/**
* Sets the start value to be rendered on the dial.
*
* @param min the start value on the dial
*/
public void setMinValue(double min) {
mMinValue = min;
}
/**
* Returns if the minimum dial value was set.
*
* @return the minimum dial value was set or not
*/
public boolean isMinValueSet() {
return mMinValue != MathHelper.NULL_VALUE;
}
/**
* Returns the end value to be rendered on the dial.
*
* @return the end value on the dial
*/
public double getMaxValue() {
return mMaxValue;
}
/**
* Sets the end value to be rendered on the dial.
*
* @param max the end value on the dial
*/
public void setMaxValue(double max) {
mMaxValue = max;
}
/**
* Returns if the maximum dial value was set.
*
* @return the maximum dial was set or not
*/
public boolean isMaxValueSet() {
return mMaxValue != -MathHelper.NULL_VALUE;
}
/**
* Returns the minor ticks spacing.
*
* @return the minor ticks spacing
*/
public double getMinorTicksSpacing() {
return mMinorTickSpacing;
}
/**
* Sets the minor ticks spacing.
*
* @param spacing the minor ticks spacing
*/
public void setMinorTicksSpacing(double spacing) {
mMinorTickSpacing = spacing;
}
/**
* Returns the major ticks spacing.
*
* @return the major ticks spacing
*/
public double getMajorTicksSpacing() {
return mMajorTickSpacing;
}
/**
* Sets the major ticks spacing.
*
* @param spacing the major ticks spacing
*/
public void setMajorTicksSpacing(double spacing) {
mMajorTickSpacing = spacing;
}
/**
* Returns the visual type at the specified index.
*
* @param index the index
* @return the visual type
*/
public Type getVisualTypeForIndex(int index) {
if (index < mVisualTypes.size()) {
return mVisualTypes.get(index);
}
return Type.NEEDLE;
}
/**
* Sets the visual types.
*
* @param types the visual types
*/
public void setVisualTypes(Type[] types) {
mVisualTypes.clear();
mVisualTypes.addAll(Arrays.asList(types));
}
}
| mit |
dollarshaveclub/ember-uni-form | app/mixins/finds-parent-form-view.js | 71 | export { default } from 'ember-uni-form/mixins/finds-parent-form-view'
| mit |
demansh/chat | server/src/main/java/org/demansh/message/writer/MessageWriter.java | 287 | package org.demansh.message.writer;
import org.demansh.socket.MessageWritable;
import org.demansh.message.model.Message;
import java.io.IOException;
public interface MessageWriter {
public void writeToSocket(Message message, MessageWritable messageWritable) throws IOException;
}
| mit |
Nejuf/QuizBuzz | config/initializers/warden.rb | 207 | Warden::Strategies.add(:guest_user) do
def valid?
session[:guest_user_id].present?
end
def authenticate!
u = User.find(session[:guest_user_id])
success!(u) if u.present?
end
end | mit |
renber/QuIterables | src/main/java/de/renebergelt/quiterables/PrimitiveArrayTransformer.java | 2408 | /*******************************************************************************
* This file is part of the Java QuIterables Library
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2016 René Bergelt
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 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.
*******************************************************************************/
package de.renebergelt.quiterables;
/**
* Helper class to convert an Iterable to primitive arrays
* @author René Bergelt
*/
public interface PrimitiveArrayTransformer<T> {
/**
* Transform to an int array
* @return int array of elements
*/
public int[] intArray();
/**
* Transform to a short array
* @return short array of elements
*/
public short[] shortArray();
/**
* Transform to a long array
* @return long array of elements
*/
public long[] longArray();
/**
* Transform to a float array
* @return float array of elements
*/
public float[] floatArray();
/**
* Transform to a double array
* @return double array of elements
*/
public double[] doubleArray();
/**
* Transform to a byte array
* @return byte array of elements
*/
public byte[] byteArray();
/**
* Transform to a boolean array
* @return boolean array of elements
*/
public boolean[] booleanArray();
/**
* Transform to a char array
* @return char array of elements
*/
public char[] charArray();
}
| mit |
touchlab/MagicThreads | library/src/main/java/co/touchlab/android/threading/eventbus/EventBusExt.java | 1394 | package co.touchlab.android.threading.eventbus;
import de.greenrobot.event.EventBus;
import de.greenrobot.event.SubscriberExceptionEvent;
/**
* Created by kgalligan on 7/28/14.
*/
public class EventBusExt
{
private static EventBusExt instance = new EventBusExt();
private EventBus eventBus;
public static class ErrorListener
{
public void onEvent(SubscriberExceptionEvent exceptionEvent)
{
final Throwable throwable = exceptionEvent.throwable;
//EventBus will just log this. Would prefer to blow up.
new Thread()
{
@Override
public void run()
{
if(throwable instanceof RuntimeException)
{
throw (RuntimeException) throwable;
}
else if(throwable instanceof Error)
{
throw (Error) throwable;
}
else
{
throw new RuntimeException(throwable);
}
}
}.start();
}
}
public EventBusExt()
{
eventBus = new EventBus();
eventBus.register(new ErrorListener());
}
public static EventBus getDefault()
{
return instance.eventBus;
}
}
| mit |
ravuthz/ravuthz.github.io | lib/mdx.js | 4398 | import { bundleMDX } from 'mdx-bundler'
import fs from 'fs'
import matter from 'gray-matter'
import path from 'path'
import readingTime from 'reading-time'
import { visit } from 'unist-util-visit'
import getAllFilesRecursively from './utils/files'
// Remark packages
import remarkGfm from 'remark-gfm'
import remarkFootnotes from 'remark-footnotes'
import remarkMath from 'remark-math'
import remarkCodeTitles from './remark-code-title'
import remarkTocHeadings from './remark-toc-headings'
import remarkImgToJsx from './remark-img-to-jsx'
// Rehype packages
import rehypeSlug from 'rehype-slug'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeKatex from 'rehype-katex'
import rehypeCitation from 'rehype-citation'
import rehypePrismPlus from 'rehype-prism-plus'
const root = process.cwd()
export function getFiles(type) {
const prefixPaths = path.join(root, 'data', type)
const files = getAllFilesRecursively(prefixPaths)
// Only want to return blog/path and ignore root, replace is needed to work on Windows
return files.map((file) => file.slice(prefixPaths.length + 1).replace(/\\/g, '/'))
}
export function formatSlug(slug) {
return slug.replace(/\.(mdx|md)/, '')
}
export function dateSortDesc(a, b) {
if (a > b) return -1
if (a < b) return 1
return 0
}
export async function getFileBySlug(type, slug) {
const mdxPath = path.join(root, 'data', type, `${slug}.mdx`)
const mdPath = path.join(root, 'data', type, `${slug}.md`)
const source = fs.existsSync(mdxPath)
? fs.readFileSync(mdxPath, 'utf8')
: fs.readFileSync(mdPath, 'utf8')
// https://github.com/kentcdodds/mdx-bundler#nextjs-esbuild-enoent
if (process.platform === 'win32') {
process.env.ESBUILD_BINARY_PATH = path.join(root, 'node_modules', 'esbuild', 'esbuild.exe')
} else {
process.env.ESBUILD_BINARY_PATH = path.join(root, 'node_modules', 'esbuild', 'bin', 'esbuild')
}
let toc = []
// Parsing frontmatter here to pass it in as options to rehype plugin
const { data: frontmatter } = matter(source)
const { code } = await bundleMDX({
source,
// mdx imports can be automatically source from the components directory
cwd: path.join(root, 'components'),
xdmOptions(options) {
// this is the recommended way to add custom remark/rehype plugins:
// The syntax might look weird, but it protects you in case we add/remove
// plugins in the future.
options.remarkPlugins = [
...(options.remarkPlugins ?? []),
[remarkTocHeadings, { exportRef: toc }],
remarkGfm,
remarkCodeTitles,
[remarkFootnotes, { inlineNotes: true }],
remarkMath,
remarkImgToJsx,
]
options.rehypePlugins = [
...(options.rehypePlugins ?? []),
rehypeSlug,
rehypeAutolinkHeadings,
rehypeKatex,
[
rehypeCitation,
{ bibliography: frontmatter?.bibliography, path: path.join(root, 'data') },
],
[rehypePrismPlus, { ignoreMissing: true }],
]
return options
},
esbuildOptions: (options) => {
options.loader = {
...options.loader,
'.js': 'jsx',
}
return options
},
})
return {
mdxSource: code,
toc,
frontMatter: {
readingTime: readingTime(code),
slug: slug || null,
fileName: fs.existsSync(mdxPath) ? `${slug}.mdx` : `${slug}.md`,
...frontmatter,
date: frontmatter.date ? new Date(frontmatter.date).toISOString() : null,
},
}
}
export async function getAllFilesFrontMatter(folder) {
const prefixPaths = path.join(root, 'data', folder)
const files = getAllFilesRecursively(prefixPaths)
const allFrontMatter = []
files.forEach((file) => {
// Replace is needed to work on Windows
const fileName = file.slice(prefixPaths.length + 1).replace(/\\/g, '/')
// Remove Unexpected File
if (path.extname(fileName) !== '.md' && path.extname(fileName) !== '.mdx') {
return
}
const source = fs.readFileSync(file, 'utf8')
const { data: frontmatter } = matter(source)
if (frontmatter.draft !== true) {
allFrontMatter.push({
...frontmatter,
slug: formatSlug(fileName),
date: frontmatter.date ? new Date(frontmatter.date).toISOString() : null,
})
}
})
return allFrontMatter.sort((a, b) => dateSortDesc(a.date, b.date))
}
| mit |
microstudi/Silex-Grunt-Skeleton | grunt/copy.js | 1945 | // COPY
// Copies remaining files to places other tasks can use
module.exports = function(grunt) {
'use strict';
grunt.config('copy', {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= conf.web %>',
dest: '<%= conf.distWeb %>',
src: [
'index.php',
'images/{,*/}*.webp',
'*.{ico,png,txt}',
'styles/{,*/}*.{otf,svg,ttf,woff,eot}'
// 'bower_components/sass-bootstrap/fonts/*.*'
]
}]
},
dev: {
files: [
{
expand: true,
dot: true,
cwd: '<%= conf.web %>',
dest: '.tmp/',
src: [
'index_dev.php',
'images/{,*/}*.webp',
'*.{ico,png,txt}',
'styles/{,*/}*.{otf,svg,ttf,woff,eot}'
]
}
]
},
'bower-components': {
expand: true,
dot: true,
cwd: 'bower_components',
dest: '.tmp/bower_components/',
src: '**/*.*'
},
js: {
expand: true,
dot: true,
cwd: '<%= conf.web %>/scripts',
dest: '.tmp/scripts/',
src: '{,*/}*.js'
},
images: {
expand: true,
dot: true,
cwd: '<%= conf.web %>/images',
dest: '.tmp/images/',
src: '{,*/}*.{gif,jpeg,jpg,png,webp,svg}'
},
styles: {
expand: true,
dot: true,
cwd: '<%= conf.web %>/styles',
dest: '.tmp/styles/',
src: '{,*/}*.css'
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
};
| mit |
rodzewich/playground | xlib/ui/element/adapters/browser/ol/Element.ts | 2929 | /// <reference path="./../Element.ts" />
/// <reference path="./../../../elements/ol/IElement.ts" />
/// <reference path="./../../../elements/ol/IOptions.ts" />
module xlib.ui.element.adapters.browser.ol {
import IEvent = element.elements.IEvent;
export class Element extends browser.Element implements element.elements.ol.IElement<HTMLElement> {
constructor(options?: element.elements.ol.IOptions<HTMLElement>) {
super(options);
}
public attributesDeny(): string[] {
// todo: fix this
return super.attributesDeny();
}
public attributesAllow(): string[] {
// todo: fix this
return super.attributesAllow();
}
public allowChildren(): boolean {
return true;
}
public allowText(): boolean {
return false;
}
public allowHtml(): boolean {
return false;
}
public allowTags(): string[] {
return ["li"];
}
public getTag(): string {
return "ol";
}
// todo: fix this
public getTitle(): string {
return null;
}
public setTitle(value: any): void {}
public getLang(): string {
return null;
}
public setLang(value: any): void {}
public getXmlLang(): string {
return null;
}
public setXmlLang(value: any): void {}
public getDir(): string {
return null;
}
public setDir(value: any): void {}
public getType(): string {
return null;
}
public setType(value: any): void {}
public getReversed(): string {
return null;
}
public setReversed(value: any): void {}
public getStart(): string {
return null;
}
public setStart(value: any): void {}
public onClick(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("click", listener);
}
public onDblClick(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("dblclick", listener);
}
public onMouseDown(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("mousedown", listener);
}
public onMouseUp(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("mouseup", listener);
}
public onMouseOver(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("mouseover", listener);
}
public onMouseMove(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("mousemove", listener);
}
public onMouseOut(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("mouseout", listener);
}
public onKeyPress(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("keypress", listener);
}
public onKeyDown(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("keydown", listener);
}
public onKeyUp(listener: (event?: IEvent<HTMLElement>) => void): void {
this.on("keyup", listener);
}
}
} | mit |
BLumia/BLumiaOJ | api/gen_identicon.php | 7643 | <?php
/* generate sprite for corners and sides */
function getsprite($shape,$R,$G,$B,$rotation) {
global $spriteZ;
$sprite=imagecreatetruecolor($spriteZ,$spriteZ);
if (function_exists('imageantialias'))
imageantialias($sprite,TRUE);
$fg=imagecolorallocate($sprite,$R,$G,$B);
$bg=imagecolorallocate($sprite,255,255,255);
imagefilledrectangle($sprite,0,0,$spriteZ,$spriteZ,$bg);
switch($shape) {
case 0: // triangle
$shape=array(
0.5,1,
1,0,
1,1
);
break;
case 1: // parallelogram
$shape=array(
0.5,0,
1,0,
0.5,1,
0,1
);
break;
case 2: // mouse ears
$shape=array(
0.5,0,
1,0,
1,1,
0.5,1,
1,0.5
);
break;
case 3: // ribbon
$shape=array(
0,0.5,
0.5,0,
1,0.5,
0.5,1,
0.5,0.5
);
break;
case 4: // sails
$shape=array(
0,0.5,
1,0,
1,1,
0,1,
1,0.5
);
break;
case 5: // fins
$shape=array(
1,0,
1,1,
0.5,1,
1,0.5,
0.5,0.5
);
break;
case 6: // beak
$shape=array(
0,0,
1,0,
1,0.5,
0,0,
0.5,1,
0,1
);
break;
case 7: // chevron
$shape=array(
0,0,
0.5,0,
1,0.5,
0.5,1,
0,1,
0.5,0.5
);
break;
case 8: // fish
$shape=array(
0.5,0,
0.5,0.5,
1,0.5,
1,1,
0.5,1,
0.5,0.5,
0,0.5
);
break;
case 9: // kite
$shape=array(
0,0,
1,0,
0.5,0.5,
1,0.5,
0.5,1,
0.5,0.5,
0,1
);
break;
case 10: // trough
$shape=array(
0,0.5,
0.5,1,
1,0.5,
0.5,0,
1,0,
1,1,
0,1
);
break;
case 11: // rays
$shape=array(
0.5,0,
1,0,
1,1,
0.5,1,
1,0.75,
0.5,0.5,
1,0.25
);
break;
case 12: // double rhombus
$shape=array(
0,0.5,
0.5,0,
0.5,0.5,
1,0,
1,0.5,
0.5,1,
0.5,0.5,
0,1
);
break;
case 13: // crown
$shape=array(
0,0,
1,0,
1,1,
0,1,
1,0.5,
0.5,0.25,
0.5,0.75,
0,0.5,
0.5,0.25
);
break;
case 14: // radioactive
$shape=array(
0,0.5,
0.5,0.5,
0.5,0,
1,0,
0.5,0.5,
1,0.5,
0.5,1,
0.5,0.5,
0,1
);
break;
default: // tiles
$shape=array(
0,0,
1,0,
0.5,0.5,
0.5,0,
0,0.5,
1,0.5,
0.5,1,
0.5,0.5,
0,1
);
break;
}
/* apply ratios */
for ($i=0;$i<count($shape);$i++)
$shape[$i]=$shape[$i]*$spriteZ;
imagefilledpolygon($sprite,$shape,count($shape)/2,$fg);
/* rotate the sprite */
for ($i=0;$i<$rotation;$i++)
$sprite=imagerotate($sprite,90,$bg);
return $sprite;
}
/* generate sprite for center block */
function getcenter($shape,$fR,$fG,$fB,$bR,$bG,$bB,$usebg) {
global $spriteZ;
$sprite=imagecreatetruecolor($spriteZ,$spriteZ);
if (function_exists('imageantialias'))
imageantialias($sprite,TRUE);
$fg=imagecolorallocate($sprite,$fR,$fG,$fB);
/* make sure there's enough contrast before we use background color of side sprite */
if ($usebg>0 && (abs($fR-$bR)>127 || abs($fG-$bG)>127 || abs($fB-$bB)>127))
$bg=imagecolorallocate($sprite,$bR,$bG,$bB);
else
$bg=imagecolorallocate($sprite,255,255,255);
imagefilledrectangle($sprite,0,0,$spriteZ,$spriteZ,$bg);
switch($shape) {
case 0: // empty
$shape=array();
break;
case 1: // fill
$shape=array(
0,0,
1,0,
1,1,
0,1
);
break;
case 2: // diamond
$shape=array(
0.5,0,
1,0.5,
0.5,1,
0,0.5
);
break;
case 3: // reverse diamond
$shape=array(
0,0,
1,0,
1,1,
0,1,
0,0.5,
0.5,1,
1,0.5,
0.5,0,
0,0.5
);
break;
case 4: // cross
$shape=array(
0.25,0,
0.75,0,
0.5,0.5,
1,0.25,
1,0.75,
0.5,0.5,
0.75,1,
0.25,1,
0.5,0.5,
0,0.75,
0,0.25,
0.5,0.5
);
break;
case 5: // morning star
$shape=array(
0,0,
0.5,0.25,
1,0,
0.75,0.5,
1,1,
0.5,0.75,
0,1,
0.25,0.5
);
break;
case 6: // small square
$shape=array(
0.33,0.33,
0.67,0.33,
0.67,0.67,
0.33,0.67
);
break;
case 7: // checkerboard
$shape=array(
0,0,
0.33,0,
0.33,0.33,
0.66,0.33,
0.67,0,
1,0,
1,0.33,
0.67,0.33,
0.67,0.67,
1,0.67,
1,1,
0.67,1,
0.67,0.67,
0.33,0.67,
0.33,1,
0,1,
0,0.67,
0.33,0.67,
0.33,0.33,
0,0.33
);
break;
}
/* apply ratios */
for ($i=0;$i<count($shape);$i++)
$shape[$i]=$shape[$i]*$spriteZ;
if (count($shape)>0)
imagefilledpolygon($sprite,$shape,count($shape)/2,$fg);
return $sprite;
}
/* parse hash string */
$csh=hexdec(substr($_GET["hash"],0,1)); // corner sprite shape
$ssh=hexdec(substr($_GET["hash"],1,1)); // side sprite shape
$xsh=hexdec(substr($_GET["hash"],2,1))&7; // center sprite shape
$cro=hexdec(substr($_GET["hash"],3,1))&3; // corner sprite rotation
$sro=hexdec(substr($_GET["hash"],4,1))&3; // side sprite rotation
$xbg=hexdec(substr($_GET["hash"],5,1))%2; // center sprite background
/* corner sprite foreground color */
$cfr=hexdec(substr($_GET["hash"],6,2));
$cfg=hexdec(substr($_GET["hash"],8,2));
$cfb=hexdec(substr($_GET["hash"],10,2));
/* side sprite foreground color */
$sfr=hexdec(substr($_GET["hash"],12,2));
$sfg=hexdec(substr($_GET["hash"],14,2));
$sfb=hexdec(substr($_GET["hash"],16,2));
/* final angle of rotation */
$angle=hexdec(substr($_GET["hash"],18,2));
/* size of each sprite */
$spriteZ=128;
/* start with blank 3x3 identicon */
$identicon=imagecreatetruecolor($spriteZ*3,$spriteZ*3);
if (function_exists('imageantialias'))
imageantialias($identicon,TRUE);
/* assign white as background */
$bg=imagecolorallocate($identicon,255,255,255);
imagefilledrectangle($identicon,0,0,$spriteZ,$spriteZ,$bg);
/* generate corner sprites */
$corner=getsprite($csh,$cfr,$cfg,$cfb,$cro);
imagecopy($identicon,$corner,0,0,0,0,$spriteZ,$spriteZ);
$corner=imagerotate($corner,90,$bg);
imagecopy($identicon,$corner,0,$spriteZ*2,0,0,$spriteZ,$spriteZ);
$corner=imagerotate($corner,90,$bg);
imagecopy($identicon,$corner,$spriteZ*2,$spriteZ*2,0,0,$spriteZ,$spriteZ);
$corner=imagerotate($corner,90,$bg);
imagecopy($identicon,$corner,$spriteZ*2,0,0,0,$spriteZ,$spriteZ);
/* generate side sprites */
$side=getsprite($ssh,$sfr,$sfg,$sfb,$sro);
imagecopy($identicon,$side,$spriteZ,0,0,0,$spriteZ,$spriteZ);
$side=imagerotate($side,90,$bg);
imagecopy($identicon,$side,0,$spriteZ,0,0,$spriteZ,$spriteZ);
$side=imagerotate($side,90,$bg);
imagecopy($identicon,$side,$spriteZ,$spriteZ*2,0,0,$spriteZ,$spriteZ);
$side=imagerotate($side,90,$bg);
imagecopy($identicon,$side,$spriteZ*2,$spriteZ,0,0,$spriteZ,$spriteZ);
/* generate center sprite */
$center=getcenter($xsh,$cfr,$cfg,$cfb,$sfr,$sfg,$sfb,$xbg);
imagecopy($identicon,$center,$spriteZ,$spriteZ,0,0,$spriteZ,$spriteZ);
// $identicon=imagerotate($identicon,$angle,$bg);
/* make white transparent */
imagecolortransparent($identicon,$bg);
/* create blank image according to specified dimensions */
$resized=imagecreatetruecolor($_GET["size"],$_GET["size"]);
if (function_exists('imageantialias'))
imageantialias($resized,TRUE);
/* assign white as background */
$bg=imagecolorallocate($resized,255,255,255);
imagefilledrectangle($resized,0,0,$_GET["size"],$_GET["size"],$bg);
/* resize identicon according to specification */
imagecopyresampled($resized,$identicon,0,0,(imagesx($identicon)-$spriteZ*3)/2,(imagesx($identicon)-$spriteZ*3)/2,$_GET["size"],$_GET["size"],$spriteZ*3,$spriteZ*3);
/* make white transparent */
imagecolortransparent($resized,$bg);
/* and finally, send to standard output */
header("Content-Type: image/png");
imagepng($resized);
?>
| mit |
Welfenlab/tutor-rethinkdb-database | test/correction.js | 14320 | /* global it */
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
chai.should();
var rdb = require("rethinkdb");
var _ = require("lodash");
var moment = require("moment");
var testUtils = require("./test_utils");
after(function(){
return testUtils.closeConnection();
});
describe("Correction methods", function(){
var test = {db:null,cleanup:null,load:null};
// setup a new fresh database for every test!
beforeEach(testUtils.beforeTest(test));
// remove the DB after each test
afterEach(testUtils.afterTest(test));
it("should return the number of pending corrections", function(){
return test.load({Solutions:
[
{exercise: 1, group: 1, results:["stuff"]},
{exercise: 1, group: 2},
{exercise: 2, group: 1},
{exercise: 2, group: 2}
]
}).then(function(){
return test.db.Corrections.getNumPending(1).then(function(pending){
pending.should.equal(1);
});
});
});
it("should return the processed flag", function() {
return test.load({
Solutions: [
{id: 0, processed: false},
{id: 1, processed: true}
]
}).then(function() {
return test.db.Corrections.hasPdf(0).then(function(has) {
has.should.equal(false);
return test.db.Corrections.hasPdf(1).then(function(has2) {
has2.should.equal(true);
});
});
});
});
it("lists all pending corrections for a tutor", function(){
return test.load({Solutions:[{id: 1, lock:"tutor",inProcess:true},{id: 2, lock:"tutor"},{id: 3, lock:"tutor", inProcess:false}]})
.then(function(){
return test.db.Corrections.getUnfinishedSolutionsForTutor("tutor").then(function(sol){
sol.should.have.length(1);
sol[0].id.should.equal(1);
});
});
});
it("lists all finished solutions for a tutor", function () {
return test.load({
Solutions: [
{id: 1, lock:"tutor",inProcess:true},
{id: 2, lock:"tutor"},
{id: 3, lock:"tutor",inProcess:false}
]})
.then(function() {
return test.db.Corrections.getFinishedSolutionsForTutor("tutor").then(function(sol) {
sol.should.have.length(1);
sol[0].id.should.equal(3);
});
});
});
it("can list all solutions for an exercise", function(){
return test.load({Solutions:[
{exercise: 1, group: 1},
{exercise: 1, group: 2},
{exercise: 2, group: 1},
{exercise: 2, group: 2}
]}).then(function(){
return test.db.Corrections.getSolutionsForExercise(1).then(function(sols){
sols.should.have.length(2);
bareSols = _.map(sols, function(s) { delete s.id; return s });
bareSols.should.deep.include.members([{exercise: 1, group: 1},{exercise: 1, group: 2}]);
});
});
});
/*
it("should be possible to store results for a locked solution", function(){
return test.load({Solutions:[{id:1, lock:"tutor"}]})
.then(function(){
return test.db.Corrections.setResultForExercise("tutor",1,["res"]).then(function(){
return test.db.Corrections.getResultForExercise(1).then(function(sol){
(sol == null).should.be.false;
sol.result.should.deep.equal(["res"]);
})
});
});
});
*/
it("should not be possibe to lock more than 10 solutions by a single tutor", function() {
return test.load(
{Solutions: [
{exercise: 1, id:1, lock:"Hans", inProcess: false},
{exercise: 1, id:2, lock:"Hans", inProcess: true},
{exercise: 1, id:3, lock:"Hans", inProcess: true},
{exercise: 1, id:4, lock:"Hans", inProcess: false},
{exercise: 1, id:5, lock:"Hans", inProcess: true},
{exercise: 1, id:6, lock:"Hans", inProcess: true},
{exercise: 1, id:7, lock:"Hans", inProcess: true},
{exercise: 1, id:8, lock:"Hans", inProcess: true},
{exercise: 1, id:9, lock:"Hans", inProcess: true},
{exercise: 1, id:10, lock:"Hans", inProcess: true},
{exercise: 1, id:12, lock:"Hans", inProcess: true},
{exercise: 1, id:13, lock:"Hans", inProcess: true},
{exercise: 1, id:14, lock:"Hans", inProcess: true},
{exercise: 1, id:11}, {exercise: 1, id:12}],
Tutors: [{name: "Hans"}]})
.then(function() {
return test.db.Corrections.lockNextSolutionForTutor("Hans", 1).should.be.rejected;
});
});
it("should create a time stamp when locking a solution", function () {
return test.load({Solutions: [{exercise: 1, group: 2}]})
.then(function() {
return test.db.Corrections.lockNextSolutionForTutor("tutor", 1).then(function(sol) {
sol.should.have.property("lockTimeStamp");
});
});
});
//---------------------------------------------------------------------
// Locks
//---------------------------------------------------------------------
it("should not be possible to store results for a not locked solution", function(){
return test.load({Solutions:[{id:1}]})
.then(function(){
return test.db.Corrections.setResultForExercise("tutor",1,["res"]).should.be.rejected;
});
});
it("should not be possible to store results for a solution locked by another tutor", function(){
return test.load({Solutions:[{id:1, lock:"tutor2"}]})
.then(function(){
return test.db.Corrections.setResultForExercise("tutor",1,["res"]).should.be.rejected;
});
});
it("should be possible to store for a solution locked by the tutor", function(){
return test.load({Solutions:[{id:1, lock:"tutor"}]})
.then(function(){
return test.db.Corrections.setResultForExercise("tutor",1,["res"]).should.be.fulfilled;
});
});
it("should lock a solution for a tutor", function(){
return test.load({Solutions: [{id:1,exercise:1, group:1},{exercise:2,group:2}]})
.then(function(){
return test.db.Corrections.lockSolutionForTutor("tutor",1).should.be.fulfilled;
});
});
it("locking a solution twice should have no effect", function(){
return test.load({Solutions: [{id:1,exercise:1, group:1},{exercise:2,group:2}]})
.then(function(){
return test.db.Corrections.lockSolutionForTutor("tutor",1).then(function(){
return test.db.Corrections.lockSolutionForTutor("tutor",1);
}).should.be.fulfilled;
})
});
it("should not be able to lock a solution by two different tutors", function(){
return test.load({Solutions: [{id:1,exercise:1, group:1},{exercise:2,group:2}]})
.then(function(){
return test.db.Corrections.lockSolutionForTutor("tutor",1).then(function(){
return test.db.Corrections.lockSolutionForTutor("tutor2",1)
}).should.be.rejected;
});
});
it("solutions with results cannot be locked", function(){
return test.load({Solutions: [{id:1,exercise:1, group:1,results:[]},{exercise:2,group:2}]})
.then(function(){
return test.db.Corrections.lockSolutionForTutor("tutor",1).should.be.rejected;
});
});
//---------------------------------------------------------------------
it("should lock a random not corrected solution", function(){
return test.load({Solutions: [{exercise:1, group:1, results:[]},{exercise:1,group:2}]})
.then(function(){
return test.db.Corrections.lockNextSolutionForTutor("tutor",1).then(function(){
return test.db.Corrections.getSolutionsForGroup(2).then(function(sol){
sol[0].lock.should.equal("tutor");
});
});
});
});
it("should mark a newly locked solution as 'inProcess'", function(){
return test.load({Solutions: [{exercise:1,group:2}]})
.then(function(){
return test.db.Corrections.lockNextSolutionForTutor("tutor",1).then(function(sol){
sol.inProcess.should.be.true;
});
});
});
it("should fail if no exercise could be locked", function(){
return test.load({Solutions: [{exercise:1, group:1, result:[]},{exercise:2,group:2}]})
.then(function(){
return test.db.Corrections.lockNextSolutionForTutor("tutor",3).then(function(res){
(res === undefined).should.be.true;
});
});
});
it("should finalize a solution by setting the 'inProcess' marker to false", function(){
return test.load({Solutions: [{id:1,results:[],lock:"tutor",inProcess:true}]})
.then(function(){
return test.db.Corrections.finishSolution("tutor",1).then(function(){
return test.db.Corrections.getUnfinishedSolutionsForTutor("tutor").then(function(sols){
sols.should.have.length(0);
});
});
});
});
it("should not finalize a solution of another tutor", function(){
return test.load({Solutions: [{id:1,results:[],lock:"tutor",inProcess:true}]})
.then(function(){
return test.db.Corrections.finishSolution("tutor2",1).should.be.rejected;
});
});
it("should not finalize a solution without results", function(){
return test.load({Solutions: [{id:1,lock:"tutor",inProcess:true}]})
.then(function(){
return test.db.Corrections.finishSolution("tutor2",1).should.be.rejected;
});
});
it("should list all unfinished exercises for a tutor", function(){
return test.load({Solutions: [{id:1,lock:"tutor",inProcess:true},{id:1,lock:"tutor",inProcess:false}]})
.then(function(){
return test.db.Corrections.getUnfinishedSolutionsForTutor("tutor").then(function(sols){
sols.should.have.length(1);
});
});
});
it("can get a solution by id", function(){
return test.load({Solutions: [{id:1}]})
.then(function(){
return test.db.Corrections.getSolutionById(1).then(function(s){
s.id.should.equal(1);
});
});
});
it("has a method returning the correction status of all exercises", function(){
var date = moment().subtract(1, "days").toJSON();
return test.load({Solutions:[
{exercise: 1, group: 1, results:[],lock: "tutor",inProcess:false},
{exercise: 1, group: 2},
{exercise: 2, group: 1, lock:"blubb",inProcess:true},
{exercise: 2, group: 2}
],Exercises:[
{id: 1, activationDate: rdb.ISO8601(date)},
{id: 2, activationDate: rdb.ISO8601(date)}
],Tutors: [
{name:"tutor", contingent:1}
]})
.then(function(){
return test.db.Corrections.getStatus("tutor").then(function(status){
status.should.have.length(2);
bareStatus = _.map(status, function(s) { delete s.id; delete s.exercise.activationDate; return s });
bareStatus.should.deep.include.members([
{
exercise:{id: 1},
should: 2,
is: 1,
solutions:2,corrected:1,locked:1
},
{
exercise:{id: 2},
should: 2,
is: 0,
solutions:2,corrected:0,locked:1
}]);
});
});
});
it("returns only queried unfinished exercises", function() {
return test.load({Solutions: [{id:1,exercise:1,lock:"tutor",inProcess:true},
{id:2,lock:"tutor",inProcess:false}]})
.then(function() {
return test.db.Corrections.getUnfinishedSolutionsForTutor("tutor").then(function(sols){
sols.should.have.length(1);
});
});
});
it("has a method that lists all solutions of a user", function(){
return test.load({Solutions: [{id:1,group:1,exercise:1}],
Groups: [{id:1,users:[2],pendingUsers:[]}],
Users: [{id:2, pseudonym:"A"}]})
.then(function() {
return test.db.Corrections.getUserSolutions(2).then(function(sols){
sols.should.have.length(1);
sols.should.deep.include.members([{id:1,group:1,exercise:1}]);
});
});
});
it("can calculate the contingent for an exercise and tutor", function(){
return test.load({Tutors:[{name:"a",contingent:20},{name:"b",contingent:10}],
Solutions:[{exercise:1},{exercise:1,lock:"a",inProcess:false},{exercise:1},{exercise:2}]
})
.then(function(){
return test.db.Corrections.getExerciseContingentForTutor("a",1).then(function(contingent){
contingent.should.should.equal(2);
contingent.is.should.equal(1);
});
});
});
it("can get a specific solution for a user", function(){
return test.load({Solutions: [{id:1,group:1,exercise:1},{id:2,group:1,exercise:2},{id:3,group:2,exercise:2}],
Groups: [{id:1,users:[2], pendingUsers:[]}],
Users: [{id:2,pseudonym:"B"}]})
.then(function(){
return test.db.Corrections.getUserExerciseSolution(2,2).then(function(sols){
sols.id.should.equal(2);
});
});
});
it('checks the results object for existence', function() {
return test.load({Solutions: [{id:1}]})
.then(function() {
return test.db.Corrections.checkResults(1).should.be.rejected
})
})
it('checks that the results object has a points field', function() {
return test.load({Solutions: [{id:1,results:''}]})
.then(function() {
return test.db.Corrections.checkResults(1).should.be.rejected
})
})
it('checks that the format of the points field is valid', function() {
var date = moment().subtract(1, "days").toJSON();
return test.load({Solutions: [{id:1,exercise:1,results:{points:["1"]}}],
Exercises: [{id:1,tasks:[1], activationDate: rdb.ISO8601(date)}]})
.then(function() {
return test.db.Corrections.checkResults(1).should.be.rejected
})
})
it('should verify a valid results entry', function() {
var date = moment().subtract(1, "days").toJSON();
return test.load({Solutions: [{id:1,exercise:1,results:{points:[1,2]}}],
Exercises: [{id:1,tasks:[1,3], activationDate: rdb.ISO8601(date)}]})
.then(function() {
return test.db.Corrections.checkResults(1).should.be.fulfilled
})
})
it('should verify a stored result', function() {
var date = moment().subtract(1, "days").toJSON();
return test.load({Solutions: [{id:1,exercise:1, lock: 'XY'}],
Exercises: [{id:1,tasks:[1,3], activationDate: rdb.ISO8601(date)}]})
.then(function() {
return test.db.Corrections.setResultForExercise("XY", 1, {pages:[],points:[1,2]}).then(function() {
return test.db.Corrections.checkResults(1)
}).should.be.fulfilled
})
})
/**/
});
| mit |
eroad/super-stacker | spec/unit/superstacker/template_dsl_spec.rb | 2633 | require 'superstacker/template_dsl'
include SuperStacker
describe TemplateDSL do
it 'should include the cloudformation_functions module' do
TemplateDSL.included_modules.include? SuperStacker::CloudformationFunctions
end
end
describe TemplateDSL, 'when compiled' do
context 'with no declarations' do
before(:each) do
@template = TemplateDSL.new('').compile
end
it 'should have a default template version' do
expect(@template['AWSTemplateFormatVersion']).to \
eq(TemplateDSL::AWSTemplateFormatVersion)
end
end
context 'with a description declared' do
before(:each) do
@description = 'test'
@template = TemplateDSL.new("description '#{@description}'").compile
end
it 'should have a description' do
expect(@template['Description']).to eq(@description)
end
end
context 'with a resource declared' do
before(:each) do
@resource = double('resource', :name => 'name', :type => 'type')
allow(Resource).to receive(:new).and_return(@resource)
@template = TemplateDSL.new('resource "name", "type"').compile
end
it 'should add the resource to the resource collection' do
expect(@template['Resources']['name']).to eq(@resource)
end
end
context 'with a mapping declared' do
before(:each) do
@mapping = double('mapping', :name => 'name')
allow(Mapping).to receive(:new).and_return(@mapping)
@template = TemplateDSL.new('mapping "name"').compile
end
it 'should add the mapping to the mapping collection' do
expect(@template['Mappings']['name']).to eq(@mapping)
end
end
context 'with a parameter declared' do
before(:each) do
@template = TemplateDSL.new('parameter "name", "Type" => "String"').compile
end
it 'should add the parameter to the parameters collection' do
expect(@template['Parameters']['name']).to eq({'Type' => 'String'})
end
end
context 'with a output declared' do
before(:each) do
@template = TemplateDSL.new('output "name", "value"').compile
end
it 'should add the output to the outputs collection' do
expect(@template['Outputs']['name']).to eq({'Value' => 'value'})
end
end
context 'with an output declared and exported' do
before(:each) do
@template = TemplateDSL.new('output "name", "value", "description", Fn.Sub("a")').compile
end
it 'should add the output to the outputs collection' do
expect(@template['Outputs']['name']).to eq({'Value' => 'value', 'Description' => 'description', 'Export' => { 'Name' => { 'Fn::Sub' => 'a' } } })
end
end
end
| mit |
general01/generalcoin | src/qt/bitcoinunits.cpp | 4271 | #include "bitcoinunits.h"
#include <QStringList>
BitcoinUnits::BitcoinUnits(QObject *parent):
QAbstractListModel(parent),
unitlist(availableUnits())
{
}
QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
{
QList<BitcoinUnits::Unit> unitlist;
unitlist.append(BTC);
unitlist.append(mBTC);
unitlist.append(uBTC);
return unitlist;
}
bool BitcoinUnits::valid(int unit)
{
switch(unit)
{
case BTC:
case mBTC:
case uBTC:
return true;
default:
return false;
}
}
QString BitcoinUnits::name(int unit)
{
switch(unit)
{
case BTC: return QString("G");
case mBTC: return QString("mHRC");
case uBTC: return QString::fromUtf8("μHRC");
default: return QString("???");
}
}
QString BitcoinUnits::description(int unit)
{
switch(unit)
{
case BTC: return QString("generals");
case mBTC: return QString("Milli-generals (1 / 1,000)");
case uBTC: return QString("Micro-generals (1 / 1,000,000)");
default: return QString("???");
}
}
qint64 BitcoinUnits::factor(int unit)
{
switch(unit)
{
case BTC: return 1000000;
case mBTC: return 1000;
case uBTC: return 1;
default: return 1000000;
}
}
int BitcoinUnits::amountDigits(int unit)
{
switch(unit)
{
case BTC: return 8; // 21,000,000 (# digits, without commas)
case mBTC: return 11; // 21,000,000,000
case uBTC: return 14; // 21,000,000,000,000
default: return 0;
}
}
int BitcoinUnits::decimals(int unit)
{
switch(unit)
{
case BTC: return 6;
case mBTC: return 3;
case uBTC: return 0;
default: return 0;
}
}
QString BitcoinUnits::format(int unit, qint64 n, bool fPlus)
{
// Note: not using straight sprintf here because we do NOT want
// localized number formatting.
if(!valid(unit))
return QString(); // Refuse to format invalid unit
qint64 coin = factor(unit);
int num_decimals = decimals(unit);
qint64 n_abs = (n > 0 ? n : -n);
qint64 quotient = n_abs / coin;
qint64 remainder = n_abs % coin;
QString quotient_str = QString::number(quotient);
QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0');
// Right-trim excess zeros after the decimal point
int nTrim = 0;
for (int i = remainder_str.size()-1; i>=2 && (remainder_str.at(i) == '0'); --i)
++nTrim;
remainder_str.chop(nTrim);
if (n < 0)
quotient_str.insert(0, '-');
else if (fPlus && n > 0)
quotient_str.insert(0, '+');
return quotient_str + QString(".") + remainder_str;
}
QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign)
{
return format(unit, amount, plussign) + QString(" ") + name(unit);
}
bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out)
{
if(!valid(unit) || value.isEmpty())
return false; // Refuse to parse invalid unit or empty string
int num_decimals = decimals(unit);
QStringList parts = value.split(".");
if(parts.size() > 2)
{
return false; // More than one dot
}
QString whole = parts[0];
QString decimals;
if(parts.size() > 1)
{
decimals = parts[1];
}
if(decimals.size() > num_decimals)
{
return false; // Exceeds max precision
}
bool ok = false;
QString str = whole + decimals.leftJustified(num_decimals, '0');
if(str.size() > 18)
{
return false; // Longer numbers will exceed 63 bits
}
qint64 retvalue = str.toLongLong(&ok);
if(val_out)
{
*val_out = retvalue;
}
return ok;
}
int BitcoinUnits::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return unitlist.size();
}
QVariant BitcoinUnits::data(const QModelIndex &index, int role) const
{
int row = index.row();
if(row >= 0 && row < unitlist.size())
{
Unit unit = unitlist.at(row);
switch(role)
{
case Qt::EditRole:
case Qt::DisplayRole:
return QVariant(name(unit));
case Qt::ToolTipRole:
return QVariant(description(unit));
case UnitRole:
return QVariant(static_cast<int>(unit));
}
}
return QVariant();
}
| mit |
richardfearn/diirt | pvmanager/pvmanager-jca/src/main/java/org/diirt/datasource/ca/VStringArrayFromDbr.java | 1126 | /**
* Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT
* All rights reserved. Use is subject to license terms. See LICENSE.TXT
*/
package org.diirt.datasource.ca;
import gov.aps.jca.dbr.DBR_TIME_String;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.diirt.vtype.VStringArray;
import org.diirt.vtype.VTypeToString;
import org.diirt.util.array.ArrayInt;
import org.diirt.util.array.ListInt;
/**
*
* @author carcassi
*/
class VStringArrayFromDbr extends VMetadata<DBR_TIME_String> implements VStringArray {
private List<String> data;
public VStringArrayFromDbr(DBR_TIME_String dbrValue, JCAConnectionPayload connPayload) {
super(dbrValue, connPayload);
data = Collections.unmodifiableList(Arrays.asList(dbrValue.getStringValue()));
}
@Override
public List<String> getData() {
return data;
}
@Override
public ListInt getSizes() {
return new ArrayInt(dbrValue.getStringValue().length);
}
@Override
public String toString() {
return VTypeToString.toString(this);
}
}
| mit |
zhu913104/KMdriod | play.py | 306 | from websocket import create_connection
import sys
step = sys.argv[1]
serverip = '192.168.141.16'
ws = create_connection("ws://"+serverip+":8887")
def play(step):
url = '{"qrcode":"http://'+serverip+':8080/qrcode.php?qrcode='+step+'"}'
ws.send(url.encode())
if __name__ == "__main__":
play(step)
| mit |
ad-tech-group/openssp | open-ssp-parent/open-ssp-common/src/main/java/com/atg/openssp/common/model/Productcategory.java | 1544 | package com.atg.openssp.common.model;
/**
*
* http://www.google.com/basepages/producttype/taxonomy.en-US.txt
*
* @author André Schmer
*
*/
public class Productcategory {
private int id;
private int gpid;// google product id, als referenz in campaign.productcategory.id
private int parent_id;
private int lft;// id muss >lft sein und <rght
private int rght;
private String name;
private boolean enabled;
public Productcategory() {
}
public int getId() {
return id;
}
public void setId(final int id) {
this.id = id;
}
public int getGpid() {
return gpid;
}
public void setGpid(final int gpid) {
this.gpid = gpid;
}
public int getParent_id() {
return parent_id;
}
public void setParent_id(final int parent_id) {
this.parent_id = parent_id;
}
public int getLft() {
return lft;
}
public void setLft(final int lft) {
this.lft = lft;
}
public int getRght() {
return rght;
}
public void setRght(final int rght) {
this.rght = rght;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(final boolean enabled) {
this.enabled = enabled;
}
@Override
public String toString() {
return String.format("Productcategory [id=%s, gpid=%s, parent_id=%s, lft=%s, rght=%s, name=%s, enabled=%s]", id,
gpid, parent_id, lft, rght, name, enabled);
}
}
| mit |
tombatossals/chords-db | src/db/ukulele/chords/Bb/mmaj11.js | 309 | export default {
key: 'Bb',
suffix: 'mmaj11',
positions: [
{
frets: '5354',
fingers: '3142'
},
{
frets: '6353',
fingers: '4131',
barres: 3,
capo: true
},
{
frets: '6986',
fingers: '1431',
barres: 6,
capo: true
}
]
};
| mit |
levibostian/VSAS | kristenTesting/VSASmainScreen.py | 4290 | """
VSAS main screen mock-up using existing gif image.
Author: Kristen Nielsen kristen.e.nielsen@gmail.com
References: pythonware.com
"""
from Tkinter import *
from PIL import Image, ImageTk
import tkMessageBox as MsgBox
from EmailScreen import EmailSettings
from PreviousRecordingsScreen import PreviousRecordingsScreen
#from TestVideo import VideoSettings
root = Tk()
class Application():
def displayAbout(self):
text = "VSAS\n(C) 2013\nGroup Delta\nAbu Audu, Levi Bostian,\nTaylor Brown, Kyle Mueller,\nKristen Nielsen"
MsgBox.showinfo(title="VSAS - About", message = text)
def displayHelp(self, event=None):
helpText = open("MainScreenHelp.txt", 'r').read()
MsgBox.showinfo(title="VSAS - Help", message = helpText)
def displayEmailSettings(self):
EmailSettings(self._master)
def logChoices(self):
PreviousRecordingsScreen(self._master)
#def displayVideoSettings(self):
#VideoSettings(self._master)
def buildMenu(self):
menuBar=Menu(self._master)
fileMenu = Menu(menuBar, tearoff=0)
#fileMenu.add_command(label='Adjust Camera')
#fileMenu.add_command(label='Video Settings', command=self.displayVideoSettings)
fileMenu.add_command(label='Email Settings', command=self.displayEmailSettings)
fileMenu.add_command(label='View Previous Recordings')
fileMenu.add_separator()
fileMenu.add_command(label="Exit", command=self.closeWindow)
menuBar.add_cascade(label="File", menu=fileMenu)
helpMenu = Menu(menuBar, tearoff=0)
helpMenu.add_command(label="About", command=self.displayAbout)
helpMenu.add_command(label="Help - F1", command=self.displayHelp)
menuBar.add_cascade(label="Help", menu=helpMenu)
self._master.config(menu=menuBar)
def closeWindow(self, event=None):
if MsgBox.askyesno("Quit", "Do you really want to quit?"):
self._master.destroy()
def updateImage(self):
image = self._motion.getMostCurrentImage()
self.photo = ImageTk.PhotoImage(image)
self.label.image = self.photo
self.label.configure( image=self.photo )
root.after(10, self.updateImage)
def __init__(self, master=None):
self._master = master
#self._motion = motionDetector
self._master.title("VSAS")
self._frame = Frame(self._master, height=600,width=800)
self._frame.pack()
self._frame.pack_propagate(0)
self.buildMenu()
self._master.bind("<F1>", self.displayHelp)
self._master.bind("<Escape>", self.closeWindow)
self._master.protocol("WM_DELETE_WINDOW", self.closeWindow)
self._imgCanvas = Canvas(self._frame)
self._imgCanvas.pack()
image = Image.open("VSAS Edit Video.gif")
# image file must be in same folder as this program. Otherwise
# you have to import os and sys.
photo = ImageTk.PhotoImage(image)
self._label = Label(self._imgCanvas,image=photo)
self._label.image = photo
self._label.pack()
self._btnCanvas = Canvas(self._frame)
self._btnCanvas.pack()
#adjustCameraButton = Button(self._btnCanvas, text= "Adjust Camera")
#adjustCameraButton['bg'] = 'red'
#adjustCameraButton.pack(side=TOP,padx=4,pady=4)
# adjustCameraButton['command']
emailButton = Button(self._btnCanvas, text='Email Settings')
emailButton.pack(side=LEFT,padx=4,pady=4)
emailButton['command']=self.displayEmailSettings
#videoButton = Button(self._btnCanvas, text='Video Settings')
#videoButton.pack(side=LEFT,padx=4,pady=2)
#videoButton['command']=self.displayVideoSettings
logButton = Button(self._btnCanvas, text='View Previous Events')
logButton.pack(side=LEFT,padx=4,pady=4)
logButton['command']=self.logChoices
helpButton = Button(self._btnCanvas, text='Help')
helpButton.pack(side=LEFT,padx=4,pady=4)
helpButton['command']=self.displayHelp
self._master.mainloop()
app = Application(root)
| mit |
RoboTricker/Transport-Pipes | src/main/java/de/robotricker/transportpipes/rendersystems/pipe/vanilla/model/data/VanillaIronPipeModelData.java | 624 | package de.robotricker.transportpipes.rendersystems.pipe.vanilla.model.data;
import de.robotricker.transportpipes.duct.Duct;
import de.robotricker.transportpipes.duct.types.BaseDuctType;
import de.robotricker.transportpipes.location.TPDirection;
public class VanillaIronPipeModelData extends VanillaPipeModelData {
private TPDirection outputDir;
public VanillaIronPipeModelData(BaseDuctType<? extends Duct> baseDuctType, TPDirection outputDir) {
super(baseDuctType.ductTypeOf("Iron"));
this.outputDir = outputDir;
}
public TPDirection getOutputDir() {
return outputDir;
}
}
| mit |
rocky/python-spark | test/test_checker.py | 2188 | #!/usr/bin/env python
"""
SPARK unit unit test grammar checking
"""
import unittest
from spark_parser.spark import GenericParser
class RightRecursive(GenericParser):
"""A simple expression parser for numbers and arithmetic operators: +, , *, and /.
Note: methods that begin p_ have docstrings that are grammar rules interpreted
by SPARK.
"""
def __init__(self, start='expr'):
GenericParser.__init__(self, start)
def p_expr_right(self, args):
"""
expr ::= term ADD expr
expr ::= term
term ::= NUMBER
"""
class UnexpandedNonterminal(GenericParser):
def __init__(self, start='expr'):
GenericParser.__init__(self, start)
def p_expr_unexpanded(self, args):
"""
expr ::= expr ADD term
expr ::= term2
term ::= NUMBER
"""
class UnusedLHS(GenericParser):
def __init__(self, start='expr'):
GenericParser.__init__(self, start)
def p_unused_lhs(self, args):
"""
expr ::= expr ADD term
expr ::= term
factor ::= term
term ::= NUMBER
"""
class TestChecker(unittest.TestCase):
def test_right_recursive(self):
parser = RightRecursive()
(lhs, rhs, tokens, right_recursive,
dup_rhs) = parser.check_sets()
self.assertEqual(len(lhs), 0)
self.assertEqual(len(rhs), 0)
self.assertEqual(len(right_recursive), 1)
return
def test_unexpanded_nonterminal(self):
parser = UnexpandedNonterminal()
(lhs, rhs, tokens, right_recursive,
dup_rhs) = parser.check_sets()
self.assertEqual(len(lhs), 0)
expect = set(['term2'])
self.assertEqual(expect, rhs)
self.assertEqual(len(right_recursive), 0)
return
def test_used_lhs(self):
parser = UnusedLHS()
(lhs, rhs, tokens, right_recursive,
dup_rhs) = parser.check_sets()
expect = set(['factor'])
self.assertEqual(expect, lhs)
self.assertEqual(len(rhs), 0)
self.assertEqual(len(right_recursive), 0)
return
pass
if __name__ == '__main__':
unittest.main()
| mit |
GabrielMalakias/CrmMentions | app/assets/javascripts/application.js | 719 | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require turbolinks
//= require_tree .
//= require bootstrap
| mit |
Bochenski/deepbeige | lib/arena.rb | 112 | #an arena is where tournaments are held
#Arenas can define and start tour
class Arena
def initialize
end
end | mit |
forsak3n/logbay | src/digest/ws.go | 3210 | package digest
import (
"context"
"errors"
"fmt"
"math/rand"
"net"
"net/http"
"sync"
"time"
"github.com/gorilla/websocket"
"logbay/common"
)
const (
WriteTimeout = 10 * time.Second
MaxWriteAttempts = 10 * time.Second
)
type WSDigestCfg struct {
Port int
URL string
Ingests []common.IngestPoint
}
type wsDigest struct {
common.DigestPoint
signals map[string]chan int
messages chan *websocket.PreparedMessage
clients *sync.Map
}
type wsConn struct {
conn *websocket.Conn
pongReceivedAt time.Time
}
var upgrader = websocket.Upgrader{
// default options
CheckOrigin: func(r *http.Request) bool { return true },
}
func NewWSDigest(name string, conf *WSDigestCfg) (common.Consumer, error) {
if conf.Port == 0 {
return nil, errors.New("port is not defined")
}
if len(conf.URL) == 0 {
conf.URL = "/logbay"
}
if conf.URL[0] != '/' {
conf.URL = fmt.Sprintf("/%s", conf.URL)
}
if len(name) == 0 {
name = fmt.Sprintf("ws-digest#%d", rand.Int())
}
d := &wsDigest{
common.DigestPoint{
Name: name,
Type: common.DigestWebSocket,
},
make(map[string]chan int),
make(chan *websocket.PreparedMessage),
&sync.Map{},
}
d.listen(conf.URL, conf.Port)
go d.broadcast()
return d, nil
}
func (w *wsDigest) listen(url string, port int) {
log := common.ContextLogger(context.WithValue(context.Background(), "prefix", "wsDigest"))
h := func(rw http.ResponseWriter, r *http.Request) {
c, err := upgrader.Upgrade(rw, r, nil)
if err != nil {
log.Errorln("switching protocols:", err)
return
}
clientKey := c.RemoteAddr().String()
c.SetCloseHandler(func(code int, text string) error {
w.clients.Delete(clientKey)
return nil
})
c.SetPongHandler(func(appData string) error {
value, ok := w.clients.Load(clientKey)
if !ok {
return nil
}
wsConn, ok := value.(*wsConn)
if !ok {
return nil
}
wsConn.pongReceivedAt = time.Now()
w.clients.Store(clientKey, wsConn)
return nil
})
w.clients.Store(clientKey, &wsConn{
conn: c,
})
}
http.HandleFunc(url, h)
go http.ListenAndServe(fmt.Sprintf("0.0.0.0:%d", port), nil)
}
func (w *wsDigest) Consume(msg string) error {
log := common.ContextLogger(context.WithValue(context.Background(), "prefix", "wsDigest"))
m, err := websocket.NewPreparedMessage(websocket.TextMessage, []byte(msg))
if err != nil {
log.Debugf("Can't prepare message %v", msg)
return err
}
w.messages <- m
return nil
}
func (w *wsDigest) broadcast() {
log := common.ContextLogger(context.WithValue(context.Background(), "prefix", "wsDigest"))
loop:
for {
select {
case msg, ok := <-w.messages:
if !ok {
break loop
}
w.clients.Range(func(key, value interface{}) bool {
c := value.(*wsConn)
if err := c.conn.SetWriteDeadline(time.Now().Add(WriteTimeout)); err != nil {
log.Errorf("set write deadline failed on %s", c.conn.RemoteAddr().String())
return true
}
if netErr, ok := c.conn.WritePreparedMessage(msg).(net.Error); ok && netErr.Timeout() {
log.Errorln("write timeout. addr: ", c.conn.RemoteAddr().String())
}
return true
})
default:
// do nothing
}
}
}
| mit |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-06-01/generated/azure_mgmt_compute/models/rollback_status_info.rb | 2234 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Compute::Mgmt::V2018_06_01
module Models
#
# Information about rollback on failed VM instances after a OS Upgrade
# operation.
#
class RollbackStatusInfo
include MsRestAzure
# @return [Integer] The number of instances which have been successfully
# rolled back.
attr_accessor :successfully_rolledback_instance_count
# @return [Integer] The number of instances which failed to rollback.
attr_accessor :failed_rolledback_instance_count
# @return [ApiError] Error details if OS rollback failed.
attr_accessor :rollback_error
#
# Mapper for RollbackStatusInfo class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'RollbackStatusInfo',
type: {
name: 'Composite',
class_name: 'RollbackStatusInfo',
model_properties: {
successfully_rolledback_instance_count: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'successfullyRolledbackInstanceCount',
type: {
name: 'Number'
}
},
failed_rolledback_instance_count: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'failedRolledbackInstanceCount',
type: {
name: 'Number'
}
},
rollback_error: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'rollbackError',
type: {
name: 'Composite',
class_name: 'ApiError'
}
}
}
}
}
end
end
end
end
| mit |
entrustcoin/eTRUST | src/qt/locale/bitcoin_fa_IR.ts | 114697 | <?xml version="1.0" ?><!DOCTYPE TS><TS language="fa_IR" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Entrustcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>Entrustcoin</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The BlackCoin developers
Copyright © 2014 The Entrustcoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<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>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your Entrustcoin 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 type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>و کپی آدرس</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Entrustcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified Entrustcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>و حذف</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>کپی و برچسب</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>و ویرایش</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>سی.اس.وی. (فایل جداگانه دستوری)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>رمز/پَس فرِیز جدید را در wallet وارد کنید. برای انتخاب رمز/پَس فرِیز از 10 کاراکتر تصادفی یا بیشتر و یا هشت کلمه یا بیشتر استفاده کنید. </translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>wallet را رمزگذاری کنید</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>برای انجام این عملکرد به رمز/پَس فرِیزِwallet نیاز است تا آن را از حالت قفل درآورد.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>باز کردن قفل wallet </translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>برای کشف رمز wallet، به رمز/پَس فرِیزِwallet نیاز است.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>کشف رمز wallet</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>رمز/پَس فرِیزِ قدیم و جدید را در wallet وارد کنید</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>رمزگذاری wallet را تایید کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>تایید رمزگذاری</translation>
</message>
<message>
<location line="-58"/>
<source>Entrustcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>رمزگذاری تایید نشد</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>رمزگذاری به علت خطای داخلی تایید نشد. wallet شما رمزگذاری نشد</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>رمزهای/پَس فرِیزهایِ وارد شده با هم تطابق ندارند</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>قفل wallet باز نشد</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>رمزهای/پَس فرِیزهایِ وارد شده wallet برای کشف رمز اشتباه است.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>کشف رمز wallet انجام نشد</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation>امضا و پیام</translation>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation>به روز رسانی با شبکه...</translation>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation>و بازبینی</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>نمای کلی از wallet را نشان بده</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>و تراکنش</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>تاریخچه تراکنش را باز کن</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>خروج</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>از "درخواست نامه"/ application خارج شو</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about Entrustcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>درباره و QT</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>نمایش اطلاعات درباره QT</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>و انتخابها</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>و رمزگذاری wallet</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>و گرفتن نسخه پیشتیبان از wallet</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>تغییر رمز/پَس فرِیز</translation>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Send coins to a Entrustcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for Entrustcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation>گرفتن نسخه پیشتیبان در آدرسی دیگر</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>رمز مربوط به رمزگذاریِ wallet را تغییر دهید</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-200"/>
<source>Entrustcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>کیف پول</translation>
</message>
<message>
<location line="+178"/>
<source>&About Entrustcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&نمایش/ عدم نمایش و</translation>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation>و فایل</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>و تنظیمات</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>و راهنما</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>نوار ابزار</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>Entrustcoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to Entrustcoin network</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>روزآمد</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>در حال روزآمد سازی..</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>ارسال تراکنش</translation>
</message>
<message>
<location line="+1"/>
<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="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid Entrustcoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>wallet رمزگذاری شد و در حال حاضر از حالت قفل در آمده است</translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>wallet رمزگذاری شد و در حال حاضر قفل است</translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. Entrustcoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation>هشدار شبکه</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>میزان وجه:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>میزان</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>حساب</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>تایید شده</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>آدرس را کپی کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>برچسب را کپی کنید</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>میزان وجه کپی شود</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(برچسب ندارد)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</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>&Label</source>
<translation>و برچسب</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&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 type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<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 "%1" is already in the address book.</source>
<translation>حساب وارد شده «1%» از پیش در دفترچه حساب ها موجود است.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Entrustcoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>عدم توانیی برای قفل گشایی wallet</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>عدم توانیی در ایجاد کلید جدید</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>Entrustcoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</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>&Main</source>
<translation type="unfinished"/>
</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. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start Entrustcoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start Entrustcoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Entrustcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the Entrustcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Entrustcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show Entrustcoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>و نمایش آدرسها در فهرست تراکنش</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>و تایید</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>و رد</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>پیش فرض</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Entrustcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>فرم</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Entrustcoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>کیف پول</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation>تراکنشهای اخیر</translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>خارج از روزآمد سازی</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>نام کنسول RPC</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="+348"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>ویرایش کنسول RPC</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the Entrustcoin-Qt help message to get a list with possible Entrustcoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>Entrustcoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Entrustcoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the Entrustcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the Entrustcoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<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="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>میزان وجه:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 eTRUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>ارسال همزمان به گیرنده های متعدد</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>مانده حساب:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 eTRUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>تایید عملیات ارسال </translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>و ارسال</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a Entrustcoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>میزان وجه کپی شود</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>تایید ارسال بیت کوین ها</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid Entrustcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(برچسب ندارد)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>و میزان وجه</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>پرداخت و به چه کسی</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>یک برچسب برای این آدرس بنویسید تا به دفترچه آدرسهای شما اضافه شود</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>و برچسب</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Entrustcoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>و امضای پیام </translation>
</message>
<message>
<location line="-118"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt و A</translation>
</message>
<message>
<location line="-193"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Entrustcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Entrustcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Entrustcoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter Entrustcoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>باز کن تا %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>تاریخ</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>پیام</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 510 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 "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>میزان</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>، هنوز با موفقیت ارسال نگردیده است</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>ناشناس</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.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>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<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>
<location line="+60"/>
<source>Open until %1</source>
<translation>باز کن تا %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>تایید شده (%1 تاییدها)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>این block توسط گره های دیگری دریافت نشده است و ممکن است قبول نشود</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>تولید شده اما قبول نشده است</translation>
</message>
<message>
<location line="+42"/>
<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="+190"/>
<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="+55"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>برچسب را ویرایش کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Comma separated file (*.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 type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</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="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>Entrustcoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>میزان استفاده:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or entrustcoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>فهرست دستورها</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>درخواست کمک برای یک دستور</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>انتخابها:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: entrustcoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: entrustcoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>دایرکتوری داده را مشخص کن</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>حافظه بانک داده را به مگابایت تنظیم کنید (پیش فرض: 25)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 51737 or testnet: 51997)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>نگهداری <N> ارتباطات برای قرینه سازی (پیش فرض:125)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>آستانه قطع برای قرینه سازی اشتباه (پیش فرض:100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>تعداد ثانیه ها برای اتصال دوباره قرینه های اشتباه (پیش فرض:86400)</translation>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<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 type="unfinished"/>
</message>
<message>
<location line="-5"/>
<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 type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 51736 or testnet: 51996)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>command line و JSON-RPC commands را قبول کنید</translation>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>به عنوان daemon بک گراند را اجرا کنید و دستورات را قبول نمایید</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>از تستِ شبکه استفاده نمایید</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Entrustcoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<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 type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>تعیین مدت زمان وقفه (time out) به هزارم ثانیه</translation>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>شناسه کاربری برای ارتباطاتِ JSON-RPC</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>رمز برای ارتباطاتِ JSON-RPC</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=entrustcoinrpc
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 "Entrustcoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>ارتباطاتِ JSON-RPC را از آدرس آی.پی. مشخصی برقرار کنید.</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>دستورات را به گره اجرا شده در<ip> ارسال کنید (پیش فرض:127.0.0.1)</translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>دستور را وقتی بهترین بلاک تغییر کرد اجرا کن (%s در دستور توسط block hash جایگزین شده است)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>wallet را به جدیدترین نسخه روزآمد کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>حجم key pool را به اندازه <n> تنظیم کنید (پیش فرض:100)</translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>زنجیره بلاک را برای تراکنش جا افتاده در WALLET دوباره اسکن کنید</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>برای ارتباطاتِ JSON-RPC از OpenSSL (https) استفاده کنید</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>فایل certificate سرور (پیش فرض server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>رمز اختصاصی سرور (پیش فرض: server.pem)</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>این پیام راهنما</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. Entrustcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>Entrustcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>لود شدن آدرسها..</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>خطا در هنگام لود شدن wallet.dat: Wallet corrupted</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of Entrustcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart Entrustcoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation>خطا در هنگام لود شدن wallet.dat</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>میزان اشتباه است for -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>میزان اشتباه است</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>وجوه ناکافی</translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>لود شدن نمایه بلاکها..</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>یک گره برای اتصال اضافه کنید و تلاش کنید تا اتصال را باز نگاه دارید</translation>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. Entrustcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>wallet در حال لود شدن است...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation>قابلیت برگشت به نسخه قبلی برای wallet امکان پذیر نیست</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation>آدرس پیش فرض قابل ذخیره نیست</translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>اسکنِ دوباره...</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>اتمام لود شدن</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation>برای استفاده از %s از اختیارات</translation>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>خطا</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>شما باید یک رمز rpcpassword=<password> را در فایل تنظیمات ایجاد کنید⏎ %s ⏎ اگر فایل ایجاد نشده است، آن را با یک فایل "فقط متنی" ایجاد کنید.
</translation>
</message>
</context>
</TS>
| mit |
theocodes/translator | test/minitest_helper.rb | 258 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'translator'
require 'minitest/autorun'
require 'minitest/reporters'
reporter_options = { color: true }
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(reporter_options)]
| mit |
kivy/python-for-android | pythonforandroid/recipes/libsecp256k1/__init__.py | 1083 | from pythonforandroid.logger import shprint
from pythonforandroid.util import current_directory
from pythonforandroid.recipe import Recipe
from multiprocessing import cpu_count
from os.path import exists
import sh
class LibSecp256k1Recipe(Recipe):
built_libraries = {'libsecp256k1.so': '.libs'}
url = 'https://github.com/bitcoin-core/secp256k1/archive/master.zip'
def build_arch(self, arch):
env = self.get_recipe_env(arch)
with current_directory(self.get_build_dir(arch.arch)):
if not exists('configure'):
shprint(sh.Command('./autogen.sh'), _env=env)
shprint(
sh.Command('./configure'),
'--host=' + arch.command_prefix,
'--prefix=' + self.ctx.get_python_install_dir(arch.arch),
'--enable-shared',
'--enable-module-recovery',
'--enable-experimental',
'--enable-module-ecdh',
_env=env)
shprint(sh.make, '-j' + str(cpu_count()), _env=env)
recipe = LibSecp256k1Recipe()
| mit |
abricot/services.xbmc | src/app/services/xbmc/mockio.js | 1123 | "use strict";
angular.module('services.io.mock', [])
.factory('io', ['$rootScope', '$q', '$http', '$parse',
function ($rootScope, $q, $http, $parse) {
// We return this object to anything injecting our service
var factory = {};
var isConnected = false;
factory.isConnected = function () {
return isConnected;
};
factory.register = function (method, callback) {
};
factory.send = function (method, params, shouldDefer, pathExpr) {
var defer = $q.defer();
$http.get('/js/data/' + method + '.json').success(function (data) {
var obj = data;
if (pathExpr) {
var getter = $parse(pathExpr);
obj = getter(data);
} else {
obj = data;
}
window.setTimeout(function () {
$rootScope.$apply(function () {
defer.resolve(obj);
});
}, Math.round(Math.random() * 1000))
});
return defer.promise;
};
factory.unregister = function (method, callback) {
};
factory.connect = function () {
isConnected = true;
};
return factory;
}
]); | mit |
carlosantoniodasilva/posgrad-relogio-ponto | leitora/CartaoPontoServer/Services/FuncionarioService.cs | 268 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace CartaoPontoServer.Services
{
public class FuncionarioService
{
public int Id { get; set; }
public string Nome { get; set; }
}
} | mit |
Berkmann18/Essencejs | 1.1/node_modules/babel-cli/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/kind-of/node_modules/is-buffer/index.js | 438 | /**
* Determine if an object is Buffer
*
* Author: Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* License: MIT
*
* `npm install is-buffer`
*/
module.exports = function (obj) {
return !!(obj != null &&
(obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)
(obj.constructor &&
typeof obj.constructor.isBuffer === 'function' &&
obj.constructor.isBuffer(obj))
))
};
| mit |
sparkdesignsystem/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/sprk-radio-item/sprk-radio-item.component.ts | 3078 | import {
Component,
Input,
Renderer2,
ContentChild,
OnInit,
} from '@angular/core';
import uniqueId from 'lodash/uniqueId';
import { SprkRadioInputDirective } from '../../../directives/inputs/sprk-radio-input/sprk-radio-input.directive';
import { SprkRadioLabelDirective } from '../../../directives/inputs/sprk-radio-label/sprk-radio-label.directive';
@Component({
selector: 'sprk-radio-item',
template: `
<div [ngClass]="getClasses()" [attr.data-id]="idString">
<ng-content></ng-content>
</div>
`,
})
export class SprkRadioItemComponent implements OnInit {
constructor(private renderer: Renderer2) {}
/**
* Expects a space separated string
* of classes to be added to the
* component.
*/
@Input()
additionalClasses: string;
/**
* This component expects a child label element
* with the `sprkRadioLabel` directive.
*/
@ContentChild(SprkRadioLabelDirective, { static: true })
label: SprkRadioLabelDirective;
/**
* This component expects a child radio input
* with the `sprkRadioInput` directive.
*/
@ContentChild(SprkRadioInputDirective, { static: true })
input: SprkRadioInputDirective;
/**
* This will be used to determine the variant of
* the radio item.
*/
@Input()
variant: 'huge' | undefined;
/**
* The value supplied will be assigned
* to the `data-id` attribute on the
* component. This is intended to be
* used as a selector for automated
* tools. This value should be unique
* per page.
*/
@Input()
idString: string;
/**
* @ignore
*/
getClasses(): string {
const classArray: string[] = ['sprk-b-SelectionContainer', 'sprk-b-Radio'];
if (this.additionalClasses) {
this.additionalClasses.split(' ').forEach((className) => {
classArray.push(className);
});
}
if (this.variant === 'huge') {
classArray.push('sprk-b-Radio--huge');
}
return classArray.join(' ');
}
/**
* @ignore
*/
generateIdForInput(): void {
let inputId = this.input.ref.nativeElement.id;
const labelFor = this.label.ref.nativeElement.htmlFor;
// Warn if 'for' exists but the 'id' does not
if (labelFor && !inputId) {
console.warn(
`Spark Design System Warning - The value of 'for' (${labelFor}) on the label expects a matching 'id' on the input.`,
);
return;
}
// Warn if 'for' and 'id' both exist but don't match
if (inputId && labelFor && inputId !== labelFor) {
console.warn(
`Spark Design System Warning - The value of 'for' (${labelFor}) on the label should match the 'id' on the input (${inputId}).`,
);
return;
}
// If we don't have a valid id, generate one with lodash
if (!inputId) {
inputId = uniqueId(`sprk_input_`);
this.renderer.setProperty(this.input.ref.nativeElement, 'id', inputId);
this.renderer.setAttribute(this.label.ref.nativeElement, 'for', inputId);
}
}
ngOnInit(): void {
if (this.label && this.input) {
this.generateIdForInput();
}
}
}
| mit |
leanovate/swagger-check | swagger-check-core/src/test/scala/de/leanovate/swaggercheck/fixtures/uber/UberProduct.scala | 840 | package de.leanovate.swaggercheck.fixtures.uber
import org.scalacheck.{Arbitrary, Gen}
import play.api.libs.json.Json
case class UberProduct(
product_id: Option[String],
description: Option[String],
display_name: Option[String],
capacity: Option[String],
image: Option[String]
)
object UberProduct {
implicit val jsonFormat = Json.format[UberProduct]
implicit val arbitrary = Arbitrary(for {
product_id <- Gen.option(Gen.identifier)
description <- Gen.option(Gen.alphaStr)
display_name <- Gen.option(Gen.alphaStr)
capacity <- Gen.option(Gen.alphaStr)
image <- Gen.option(Gen.identifier)
} yield UberProduct(product_id, description, display_name, capacity, image))
}
| mit |
mathiasbynens/unicode-data | 4.1.0/blocks/CJK-Unified-Ideographs-Extension-A-symbols.js | 72601 | // All symbols in the CJK Unified Ideographs Extension A block as per Unicode v4.1.0:
[
'\u3400',
'\u3401',
'\u3402',
'\u3403',
'\u3404',
'\u3405',
'\u3406',
'\u3407',
'\u3408',
'\u3409',
'\u340A',
'\u340B',
'\u340C',
'\u340D',
'\u340E',
'\u340F',
'\u3410',
'\u3411',
'\u3412',
'\u3413',
'\u3414',
'\u3415',
'\u3416',
'\u3417',
'\u3418',
'\u3419',
'\u341A',
'\u341B',
'\u341C',
'\u341D',
'\u341E',
'\u341F',
'\u3420',
'\u3421',
'\u3422',
'\u3423',
'\u3424',
'\u3425',
'\u3426',
'\u3427',
'\u3428',
'\u3429',
'\u342A',
'\u342B',
'\u342C',
'\u342D',
'\u342E',
'\u342F',
'\u3430',
'\u3431',
'\u3432',
'\u3433',
'\u3434',
'\u3435',
'\u3436',
'\u3437',
'\u3438',
'\u3439',
'\u343A',
'\u343B',
'\u343C',
'\u343D',
'\u343E',
'\u343F',
'\u3440',
'\u3441',
'\u3442',
'\u3443',
'\u3444',
'\u3445',
'\u3446',
'\u3447',
'\u3448',
'\u3449',
'\u344A',
'\u344B',
'\u344C',
'\u344D',
'\u344E',
'\u344F',
'\u3450',
'\u3451',
'\u3452',
'\u3453',
'\u3454',
'\u3455',
'\u3456',
'\u3457',
'\u3458',
'\u3459',
'\u345A',
'\u345B',
'\u345C',
'\u345D',
'\u345E',
'\u345F',
'\u3460',
'\u3461',
'\u3462',
'\u3463',
'\u3464',
'\u3465',
'\u3466',
'\u3467',
'\u3468',
'\u3469',
'\u346A',
'\u346B',
'\u346C',
'\u346D',
'\u346E',
'\u346F',
'\u3470',
'\u3471',
'\u3472',
'\u3473',
'\u3474',
'\u3475',
'\u3476',
'\u3477',
'\u3478',
'\u3479',
'\u347A',
'\u347B',
'\u347C',
'\u347D',
'\u347E',
'\u347F',
'\u3480',
'\u3481',
'\u3482',
'\u3483',
'\u3484',
'\u3485',
'\u3486',
'\u3487',
'\u3488',
'\u3489',
'\u348A',
'\u348B',
'\u348C',
'\u348D',
'\u348E',
'\u348F',
'\u3490',
'\u3491',
'\u3492',
'\u3493',
'\u3494',
'\u3495',
'\u3496',
'\u3497',
'\u3498',
'\u3499',
'\u349A',
'\u349B',
'\u349C',
'\u349D',
'\u349E',
'\u349F',
'\u34A0',
'\u34A1',
'\u34A2',
'\u34A3',
'\u34A4',
'\u34A5',
'\u34A6',
'\u34A7',
'\u34A8',
'\u34A9',
'\u34AA',
'\u34AB',
'\u34AC',
'\u34AD',
'\u34AE',
'\u34AF',
'\u34B0',
'\u34B1',
'\u34B2',
'\u34B3',
'\u34B4',
'\u34B5',
'\u34B6',
'\u34B7',
'\u34B8',
'\u34B9',
'\u34BA',
'\u34BB',
'\u34BC',
'\u34BD',
'\u34BE',
'\u34BF',
'\u34C0',
'\u34C1',
'\u34C2',
'\u34C3',
'\u34C4',
'\u34C5',
'\u34C6',
'\u34C7',
'\u34C8',
'\u34C9',
'\u34CA',
'\u34CB',
'\u34CC',
'\u34CD',
'\u34CE',
'\u34CF',
'\u34D0',
'\u34D1',
'\u34D2',
'\u34D3',
'\u34D4',
'\u34D5',
'\u34D6',
'\u34D7',
'\u34D8',
'\u34D9',
'\u34DA',
'\u34DB',
'\u34DC',
'\u34DD',
'\u34DE',
'\u34DF',
'\u34E0',
'\u34E1',
'\u34E2',
'\u34E3',
'\u34E4',
'\u34E5',
'\u34E6',
'\u34E7',
'\u34E8',
'\u34E9',
'\u34EA',
'\u34EB',
'\u34EC',
'\u34ED',
'\u34EE',
'\u34EF',
'\u34F0',
'\u34F1',
'\u34F2',
'\u34F3',
'\u34F4',
'\u34F5',
'\u34F6',
'\u34F7',
'\u34F8',
'\u34F9',
'\u34FA',
'\u34FB',
'\u34FC',
'\u34FD',
'\u34FE',
'\u34FF',
'\u3500',
'\u3501',
'\u3502',
'\u3503',
'\u3504',
'\u3505',
'\u3506',
'\u3507',
'\u3508',
'\u3509',
'\u350A',
'\u350B',
'\u350C',
'\u350D',
'\u350E',
'\u350F',
'\u3510',
'\u3511',
'\u3512',
'\u3513',
'\u3514',
'\u3515',
'\u3516',
'\u3517',
'\u3518',
'\u3519',
'\u351A',
'\u351B',
'\u351C',
'\u351D',
'\u351E',
'\u351F',
'\u3520',
'\u3521',
'\u3522',
'\u3523',
'\u3524',
'\u3525',
'\u3526',
'\u3527',
'\u3528',
'\u3529',
'\u352A',
'\u352B',
'\u352C',
'\u352D',
'\u352E',
'\u352F',
'\u3530',
'\u3531',
'\u3532',
'\u3533',
'\u3534',
'\u3535',
'\u3536',
'\u3537',
'\u3538',
'\u3539',
'\u353A',
'\u353B',
'\u353C',
'\u353D',
'\u353E',
'\u353F',
'\u3540',
'\u3541',
'\u3542',
'\u3543',
'\u3544',
'\u3545',
'\u3546',
'\u3547',
'\u3548',
'\u3549',
'\u354A',
'\u354B',
'\u354C',
'\u354D',
'\u354E',
'\u354F',
'\u3550',
'\u3551',
'\u3552',
'\u3553',
'\u3554',
'\u3555',
'\u3556',
'\u3557',
'\u3558',
'\u3559',
'\u355A',
'\u355B',
'\u355C',
'\u355D',
'\u355E',
'\u355F',
'\u3560',
'\u3561',
'\u3562',
'\u3563',
'\u3564',
'\u3565',
'\u3566',
'\u3567',
'\u3568',
'\u3569',
'\u356A',
'\u356B',
'\u356C',
'\u356D',
'\u356E',
'\u356F',
'\u3570',
'\u3571',
'\u3572',
'\u3573',
'\u3574',
'\u3575',
'\u3576',
'\u3577',
'\u3578',
'\u3579',
'\u357A',
'\u357B',
'\u357C',
'\u357D',
'\u357E',
'\u357F',
'\u3580',
'\u3581',
'\u3582',
'\u3583',
'\u3584',
'\u3585',
'\u3586',
'\u3587',
'\u3588',
'\u3589',
'\u358A',
'\u358B',
'\u358C',
'\u358D',
'\u358E',
'\u358F',
'\u3590',
'\u3591',
'\u3592',
'\u3593',
'\u3594',
'\u3595',
'\u3596',
'\u3597',
'\u3598',
'\u3599',
'\u359A',
'\u359B',
'\u359C',
'\u359D',
'\u359E',
'\u359F',
'\u35A0',
'\u35A1',
'\u35A2',
'\u35A3',
'\u35A4',
'\u35A5',
'\u35A6',
'\u35A7',
'\u35A8',
'\u35A9',
'\u35AA',
'\u35AB',
'\u35AC',
'\u35AD',
'\u35AE',
'\u35AF',
'\u35B0',
'\u35B1',
'\u35B2',
'\u35B3',
'\u35B4',
'\u35B5',
'\u35B6',
'\u35B7',
'\u35B8',
'\u35B9',
'\u35BA',
'\u35BB',
'\u35BC',
'\u35BD',
'\u35BE',
'\u35BF',
'\u35C0',
'\u35C1',
'\u35C2',
'\u35C3',
'\u35C4',
'\u35C5',
'\u35C6',
'\u35C7',
'\u35C8',
'\u35C9',
'\u35CA',
'\u35CB',
'\u35CC',
'\u35CD',
'\u35CE',
'\u35CF',
'\u35D0',
'\u35D1',
'\u35D2',
'\u35D3',
'\u35D4',
'\u35D5',
'\u35D6',
'\u35D7',
'\u35D8',
'\u35D9',
'\u35DA',
'\u35DB',
'\u35DC',
'\u35DD',
'\u35DE',
'\u35DF',
'\u35E0',
'\u35E1',
'\u35E2',
'\u35E3',
'\u35E4',
'\u35E5',
'\u35E6',
'\u35E7',
'\u35E8',
'\u35E9',
'\u35EA',
'\u35EB',
'\u35EC',
'\u35ED',
'\u35EE',
'\u35EF',
'\u35F0',
'\u35F1',
'\u35F2',
'\u35F3',
'\u35F4',
'\u35F5',
'\u35F6',
'\u35F7',
'\u35F8',
'\u35F9',
'\u35FA',
'\u35FB',
'\u35FC',
'\u35FD',
'\u35FE',
'\u35FF',
'\u3600',
'\u3601',
'\u3602',
'\u3603',
'\u3604',
'\u3605',
'\u3606',
'\u3607',
'\u3608',
'\u3609',
'\u360A',
'\u360B',
'\u360C',
'\u360D',
'\u360E',
'\u360F',
'\u3610',
'\u3611',
'\u3612',
'\u3613',
'\u3614',
'\u3615',
'\u3616',
'\u3617',
'\u3618',
'\u3619',
'\u361A',
'\u361B',
'\u361C',
'\u361D',
'\u361E',
'\u361F',
'\u3620',
'\u3621',
'\u3622',
'\u3623',
'\u3624',
'\u3625',
'\u3626',
'\u3627',
'\u3628',
'\u3629',
'\u362A',
'\u362B',
'\u362C',
'\u362D',
'\u362E',
'\u362F',
'\u3630',
'\u3631',
'\u3632',
'\u3633',
'\u3634',
'\u3635',
'\u3636',
'\u3637',
'\u3638',
'\u3639',
'\u363A',
'\u363B',
'\u363C',
'\u363D',
'\u363E',
'\u363F',
'\u3640',
'\u3641',
'\u3642',
'\u3643',
'\u3644',
'\u3645',
'\u3646',
'\u3647',
'\u3648',
'\u3649',
'\u364A',
'\u364B',
'\u364C',
'\u364D',
'\u364E',
'\u364F',
'\u3650',
'\u3651',
'\u3652',
'\u3653',
'\u3654',
'\u3655',
'\u3656',
'\u3657',
'\u3658',
'\u3659',
'\u365A',
'\u365B',
'\u365C',
'\u365D',
'\u365E',
'\u365F',
'\u3660',
'\u3661',
'\u3662',
'\u3663',
'\u3664',
'\u3665',
'\u3666',
'\u3667',
'\u3668',
'\u3669',
'\u366A',
'\u366B',
'\u366C',
'\u366D',
'\u366E',
'\u366F',
'\u3670',
'\u3671',
'\u3672',
'\u3673',
'\u3674',
'\u3675',
'\u3676',
'\u3677',
'\u3678',
'\u3679',
'\u367A',
'\u367B',
'\u367C',
'\u367D',
'\u367E',
'\u367F',
'\u3680',
'\u3681',
'\u3682',
'\u3683',
'\u3684',
'\u3685',
'\u3686',
'\u3687',
'\u3688',
'\u3689',
'\u368A',
'\u368B',
'\u368C',
'\u368D',
'\u368E',
'\u368F',
'\u3690',
'\u3691',
'\u3692',
'\u3693',
'\u3694',
'\u3695',
'\u3696',
'\u3697',
'\u3698',
'\u3699',
'\u369A',
'\u369B',
'\u369C',
'\u369D',
'\u369E',
'\u369F',
'\u36A0',
'\u36A1',
'\u36A2',
'\u36A3',
'\u36A4',
'\u36A5',
'\u36A6',
'\u36A7',
'\u36A8',
'\u36A9',
'\u36AA',
'\u36AB',
'\u36AC',
'\u36AD',
'\u36AE',
'\u36AF',
'\u36B0',
'\u36B1',
'\u36B2',
'\u36B3',
'\u36B4',
'\u36B5',
'\u36B6',
'\u36B7',
'\u36B8',
'\u36B9',
'\u36BA',
'\u36BB',
'\u36BC',
'\u36BD',
'\u36BE',
'\u36BF',
'\u36C0',
'\u36C1',
'\u36C2',
'\u36C3',
'\u36C4',
'\u36C5',
'\u36C6',
'\u36C7',
'\u36C8',
'\u36C9',
'\u36CA',
'\u36CB',
'\u36CC',
'\u36CD',
'\u36CE',
'\u36CF',
'\u36D0',
'\u36D1',
'\u36D2',
'\u36D3',
'\u36D4',
'\u36D5',
'\u36D6',
'\u36D7',
'\u36D8',
'\u36D9',
'\u36DA',
'\u36DB',
'\u36DC',
'\u36DD',
'\u36DE',
'\u36DF',
'\u36E0',
'\u36E1',
'\u36E2',
'\u36E3',
'\u36E4',
'\u36E5',
'\u36E6',
'\u36E7',
'\u36E8',
'\u36E9',
'\u36EA',
'\u36EB',
'\u36EC',
'\u36ED',
'\u36EE',
'\u36EF',
'\u36F0',
'\u36F1',
'\u36F2',
'\u36F3',
'\u36F4',
'\u36F5',
'\u36F6',
'\u36F7',
'\u36F8',
'\u36F9',
'\u36FA',
'\u36FB',
'\u36FC',
'\u36FD',
'\u36FE',
'\u36FF',
'\u3700',
'\u3701',
'\u3702',
'\u3703',
'\u3704',
'\u3705',
'\u3706',
'\u3707',
'\u3708',
'\u3709',
'\u370A',
'\u370B',
'\u370C',
'\u370D',
'\u370E',
'\u370F',
'\u3710',
'\u3711',
'\u3712',
'\u3713',
'\u3714',
'\u3715',
'\u3716',
'\u3717',
'\u3718',
'\u3719',
'\u371A',
'\u371B',
'\u371C',
'\u371D',
'\u371E',
'\u371F',
'\u3720',
'\u3721',
'\u3722',
'\u3723',
'\u3724',
'\u3725',
'\u3726',
'\u3727',
'\u3728',
'\u3729',
'\u372A',
'\u372B',
'\u372C',
'\u372D',
'\u372E',
'\u372F',
'\u3730',
'\u3731',
'\u3732',
'\u3733',
'\u3734',
'\u3735',
'\u3736',
'\u3737',
'\u3738',
'\u3739',
'\u373A',
'\u373B',
'\u373C',
'\u373D',
'\u373E',
'\u373F',
'\u3740',
'\u3741',
'\u3742',
'\u3743',
'\u3744',
'\u3745',
'\u3746',
'\u3747',
'\u3748',
'\u3749',
'\u374A',
'\u374B',
'\u374C',
'\u374D',
'\u374E',
'\u374F',
'\u3750',
'\u3751',
'\u3752',
'\u3753',
'\u3754',
'\u3755',
'\u3756',
'\u3757',
'\u3758',
'\u3759',
'\u375A',
'\u375B',
'\u375C',
'\u375D',
'\u375E',
'\u375F',
'\u3760',
'\u3761',
'\u3762',
'\u3763',
'\u3764',
'\u3765',
'\u3766',
'\u3767',
'\u3768',
'\u3769',
'\u376A',
'\u376B',
'\u376C',
'\u376D',
'\u376E',
'\u376F',
'\u3770',
'\u3771',
'\u3772',
'\u3773',
'\u3774',
'\u3775',
'\u3776',
'\u3777',
'\u3778',
'\u3779',
'\u377A',
'\u377B',
'\u377C',
'\u377D',
'\u377E',
'\u377F',
'\u3780',
'\u3781',
'\u3782',
'\u3783',
'\u3784',
'\u3785',
'\u3786',
'\u3787',
'\u3788',
'\u3789',
'\u378A',
'\u378B',
'\u378C',
'\u378D',
'\u378E',
'\u378F',
'\u3790',
'\u3791',
'\u3792',
'\u3793',
'\u3794',
'\u3795',
'\u3796',
'\u3797',
'\u3798',
'\u3799',
'\u379A',
'\u379B',
'\u379C',
'\u379D',
'\u379E',
'\u379F',
'\u37A0',
'\u37A1',
'\u37A2',
'\u37A3',
'\u37A4',
'\u37A5',
'\u37A6',
'\u37A7',
'\u37A8',
'\u37A9',
'\u37AA',
'\u37AB',
'\u37AC',
'\u37AD',
'\u37AE',
'\u37AF',
'\u37B0',
'\u37B1',
'\u37B2',
'\u37B3',
'\u37B4',
'\u37B5',
'\u37B6',
'\u37B7',
'\u37B8',
'\u37B9',
'\u37BA',
'\u37BB',
'\u37BC',
'\u37BD',
'\u37BE',
'\u37BF',
'\u37C0',
'\u37C1',
'\u37C2',
'\u37C3',
'\u37C4',
'\u37C5',
'\u37C6',
'\u37C7',
'\u37C8',
'\u37C9',
'\u37CA',
'\u37CB',
'\u37CC',
'\u37CD',
'\u37CE',
'\u37CF',
'\u37D0',
'\u37D1',
'\u37D2',
'\u37D3',
'\u37D4',
'\u37D5',
'\u37D6',
'\u37D7',
'\u37D8',
'\u37D9',
'\u37DA',
'\u37DB',
'\u37DC',
'\u37DD',
'\u37DE',
'\u37DF',
'\u37E0',
'\u37E1',
'\u37E2',
'\u37E3',
'\u37E4',
'\u37E5',
'\u37E6',
'\u37E7',
'\u37E8',
'\u37E9',
'\u37EA',
'\u37EB',
'\u37EC',
'\u37ED',
'\u37EE',
'\u37EF',
'\u37F0',
'\u37F1',
'\u37F2',
'\u37F3',
'\u37F4',
'\u37F5',
'\u37F6',
'\u37F7',
'\u37F8',
'\u37F9',
'\u37FA',
'\u37FB',
'\u37FC',
'\u37FD',
'\u37FE',
'\u37FF',
'\u3800',
'\u3801',
'\u3802',
'\u3803',
'\u3804',
'\u3805',
'\u3806',
'\u3807',
'\u3808',
'\u3809',
'\u380A',
'\u380B',
'\u380C',
'\u380D',
'\u380E',
'\u380F',
'\u3810',
'\u3811',
'\u3812',
'\u3813',
'\u3814',
'\u3815',
'\u3816',
'\u3817',
'\u3818',
'\u3819',
'\u381A',
'\u381B',
'\u381C',
'\u381D',
'\u381E',
'\u381F',
'\u3820',
'\u3821',
'\u3822',
'\u3823',
'\u3824',
'\u3825',
'\u3826',
'\u3827',
'\u3828',
'\u3829',
'\u382A',
'\u382B',
'\u382C',
'\u382D',
'\u382E',
'\u382F',
'\u3830',
'\u3831',
'\u3832',
'\u3833',
'\u3834',
'\u3835',
'\u3836',
'\u3837',
'\u3838',
'\u3839',
'\u383A',
'\u383B',
'\u383C',
'\u383D',
'\u383E',
'\u383F',
'\u3840',
'\u3841',
'\u3842',
'\u3843',
'\u3844',
'\u3845',
'\u3846',
'\u3847',
'\u3848',
'\u3849',
'\u384A',
'\u384B',
'\u384C',
'\u384D',
'\u384E',
'\u384F',
'\u3850',
'\u3851',
'\u3852',
'\u3853',
'\u3854',
'\u3855',
'\u3856',
'\u3857',
'\u3858',
'\u3859',
'\u385A',
'\u385B',
'\u385C',
'\u385D',
'\u385E',
'\u385F',
'\u3860',
'\u3861',
'\u3862',
'\u3863',
'\u3864',
'\u3865',
'\u3866',
'\u3867',
'\u3868',
'\u3869',
'\u386A',
'\u386B',
'\u386C',
'\u386D',
'\u386E',
'\u386F',
'\u3870',
'\u3871',
'\u3872',
'\u3873',
'\u3874',
'\u3875',
'\u3876',
'\u3877',
'\u3878',
'\u3879',
'\u387A',
'\u387B',
'\u387C',
'\u387D',
'\u387E',
'\u387F',
'\u3880',
'\u3881',
'\u3882',
'\u3883',
'\u3884',
'\u3885',
'\u3886',
'\u3887',
'\u3888',
'\u3889',
'\u388A',
'\u388B',
'\u388C',
'\u388D',
'\u388E',
'\u388F',
'\u3890',
'\u3891',
'\u3892',
'\u3893',
'\u3894',
'\u3895',
'\u3896',
'\u3897',
'\u3898',
'\u3899',
'\u389A',
'\u389B',
'\u389C',
'\u389D',
'\u389E',
'\u389F',
'\u38A0',
'\u38A1',
'\u38A2',
'\u38A3',
'\u38A4',
'\u38A5',
'\u38A6',
'\u38A7',
'\u38A8',
'\u38A9',
'\u38AA',
'\u38AB',
'\u38AC',
'\u38AD',
'\u38AE',
'\u38AF',
'\u38B0',
'\u38B1',
'\u38B2',
'\u38B3',
'\u38B4',
'\u38B5',
'\u38B6',
'\u38B7',
'\u38B8',
'\u38B9',
'\u38BA',
'\u38BB',
'\u38BC',
'\u38BD',
'\u38BE',
'\u38BF',
'\u38C0',
'\u38C1',
'\u38C2',
'\u38C3',
'\u38C4',
'\u38C5',
'\u38C6',
'\u38C7',
'\u38C8',
'\u38C9',
'\u38CA',
'\u38CB',
'\u38CC',
'\u38CD',
'\u38CE',
'\u38CF',
'\u38D0',
'\u38D1',
'\u38D2',
'\u38D3',
'\u38D4',
'\u38D5',
'\u38D6',
'\u38D7',
'\u38D8',
'\u38D9',
'\u38DA',
'\u38DB',
'\u38DC',
'\u38DD',
'\u38DE',
'\u38DF',
'\u38E0',
'\u38E1',
'\u38E2',
'\u38E3',
'\u38E4',
'\u38E5',
'\u38E6',
'\u38E7',
'\u38E8',
'\u38E9',
'\u38EA',
'\u38EB',
'\u38EC',
'\u38ED',
'\u38EE',
'\u38EF',
'\u38F0',
'\u38F1',
'\u38F2',
'\u38F3',
'\u38F4',
'\u38F5',
'\u38F6',
'\u38F7',
'\u38F8',
'\u38F9',
'\u38FA',
'\u38FB',
'\u38FC',
'\u38FD',
'\u38FE',
'\u38FF',
'\u3900',
'\u3901',
'\u3902',
'\u3903',
'\u3904',
'\u3905',
'\u3906',
'\u3907',
'\u3908',
'\u3909',
'\u390A',
'\u390B',
'\u390C',
'\u390D',
'\u390E',
'\u390F',
'\u3910',
'\u3911',
'\u3912',
'\u3913',
'\u3914',
'\u3915',
'\u3916',
'\u3917',
'\u3918',
'\u3919',
'\u391A',
'\u391B',
'\u391C',
'\u391D',
'\u391E',
'\u391F',
'\u3920',
'\u3921',
'\u3922',
'\u3923',
'\u3924',
'\u3925',
'\u3926',
'\u3927',
'\u3928',
'\u3929',
'\u392A',
'\u392B',
'\u392C',
'\u392D',
'\u392E',
'\u392F',
'\u3930',
'\u3931',
'\u3932',
'\u3933',
'\u3934',
'\u3935',
'\u3936',
'\u3937',
'\u3938',
'\u3939',
'\u393A',
'\u393B',
'\u393C',
'\u393D',
'\u393E',
'\u393F',
'\u3940',
'\u3941',
'\u3942',
'\u3943',
'\u3944',
'\u3945',
'\u3946',
'\u3947',
'\u3948',
'\u3949',
'\u394A',
'\u394B',
'\u394C',
'\u394D',
'\u394E',
'\u394F',
'\u3950',
'\u3951',
'\u3952',
'\u3953',
'\u3954',
'\u3955',
'\u3956',
'\u3957',
'\u3958',
'\u3959',
'\u395A',
'\u395B',
'\u395C',
'\u395D',
'\u395E',
'\u395F',
'\u3960',
'\u3961',
'\u3962',
'\u3963',
'\u3964',
'\u3965',
'\u3966',
'\u3967',
'\u3968',
'\u3969',
'\u396A',
'\u396B',
'\u396C',
'\u396D',
'\u396E',
'\u396F',
'\u3970',
'\u3971',
'\u3972',
'\u3973',
'\u3974',
'\u3975',
'\u3976',
'\u3977',
'\u3978',
'\u3979',
'\u397A',
'\u397B',
'\u397C',
'\u397D',
'\u397E',
'\u397F',
'\u3980',
'\u3981',
'\u3982',
'\u3983',
'\u3984',
'\u3985',
'\u3986',
'\u3987',
'\u3988',
'\u3989',
'\u398A',
'\u398B',
'\u398C',
'\u398D',
'\u398E',
'\u398F',
'\u3990',
'\u3991',
'\u3992',
'\u3993',
'\u3994',
'\u3995',
'\u3996',
'\u3997',
'\u3998',
'\u3999',
'\u399A',
'\u399B',
'\u399C',
'\u399D',
'\u399E',
'\u399F',
'\u39A0',
'\u39A1',
'\u39A2',
'\u39A3',
'\u39A4',
'\u39A5',
'\u39A6',
'\u39A7',
'\u39A8',
'\u39A9',
'\u39AA',
'\u39AB',
'\u39AC',
'\u39AD',
'\u39AE',
'\u39AF',
'\u39B0',
'\u39B1',
'\u39B2',
'\u39B3',
'\u39B4',
'\u39B5',
'\u39B6',
'\u39B7',
'\u39B8',
'\u39B9',
'\u39BA',
'\u39BB',
'\u39BC',
'\u39BD',
'\u39BE',
'\u39BF',
'\u39C0',
'\u39C1',
'\u39C2',
'\u39C3',
'\u39C4',
'\u39C5',
'\u39C6',
'\u39C7',
'\u39C8',
'\u39C9',
'\u39CA',
'\u39CB',
'\u39CC',
'\u39CD',
'\u39CE',
'\u39CF',
'\u39D0',
'\u39D1',
'\u39D2',
'\u39D3',
'\u39D4',
'\u39D5',
'\u39D6',
'\u39D7',
'\u39D8',
'\u39D9',
'\u39DA',
'\u39DB',
'\u39DC',
'\u39DD',
'\u39DE',
'\u39DF',
'\u39E0',
'\u39E1',
'\u39E2',
'\u39E3',
'\u39E4',
'\u39E5',
'\u39E6',
'\u39E7',
'\u39E8',
'\u39E9',
'\u39EA',
'\u39EB',
'\u39EC',
'\u39ED',
'\u39EE',
'\u39EF',
'\u39F0',
'\u39F1',
'\u39F2',
'\u39F3',
'\u39F4',
'\u39F5',
'\u39F6',
'\u39F7',
'\u39F8',
'\u39F9',
'\u39FA',
'\u39FB',
'\u39FC',
'\u39FD',
'\u39FE',
'\u39FF',
'\u3A00',
'\u3A01',
'\u3A02',
'\u3A03',
'\u3A04',
'\u3A05',
'\u3A06',
'\u3A07',
'\u3A08',
'\u3A09',
'\u3A0A',
'\u3A0B',
'\u3A0C',
'\u3A0D',
'\u3A0E',
'\u3A0F',
'\u3A10',
'\u3A11',
'\u3A12',
'\u3A13',
'\u3A14',
'\u3A15',
'\u3A16',
'\u3A17',
'\u3A18',
'\u3A19',
'\u3A1A',
'\u3A1B',
'\u3A1C',
'\u3A1D',
'\u3A1E',
'\u3A1F',
'\u3A20',
'\u3A21',
'\u3A22',
'\u3A23',
'\u3A24',
'\u3A25',
'\u3A26',
'\u3A27',
'\u3A28',
'\u3A29',
'\u3A2A',
'\u3A2B',
'\u3A2C',
'\u3A2D',
'\u3A2E',
'\u3A2F',
'\u3A30',
'\u3A31',
'\u3A32',
'\u3A33',
'\u3A34',
'\u3A35',
'\u3A36',
'\u3A37',
'\u3A38',
'\u3A39',
'\u3A3A',
'\u3A3B',
'\u3A3C',
'\u3A3D',
'\u3A3E',
'\u3A3F',
'\u3A40',
'\u3A41',
'\u3A42',
'\u3A43',
'\u3A44',
'\u3A45',
'\u3A46',
'\u3A47',
'\u3A48',
'\u3A49',
'\u3A4A',
'\u3A4B',
'\u3A4C',
'\u3A4D',
'\u3A4E',
'\u3A4F',
'\u3A50',
'\u3A51',
'\u3A52',
'\u3A53',
'\u3A54',
'\u3A55',
'\u3A56',
'\u3A57',
'\u3A58',
'\u3A59',
'\u3A5A',
'\u3A5B',
'\u3A5C',
'\u3A5D',
'\u3A5E',
'\u3A5F',
'\u3A60',
'\u3A61',
'\u3A62',
'\u3A63',
'\u3A64',
'\u3A65',
'\u3A66',
'\u3A67',
'\u3A68',
'\u3A69',
'\u3A6A',
'\u3A6B',
'\u3A6C',
'\u3A6D',
'\u3A6E',
'\u3A6F',
'\u3A70',
'\u3A71',
'\u3A72',
'\u3A73',
'\u3A74',
'\u3A75',
'\u3A76',
'\u3A77',
'\u3A78',
'\u3A79',
'\u3A7A',
'\u3A7B',
'\u3A7C',
'\u3A7D',
'\u3A7E',
'\u3A7F',
'\u3A80',
'\u3A81',
'\u3A82',
'\u3A83',
'\u3A84',
'\u3A85',
'\u3A86',
'\u3A87',
'\u3A88',
'\u3A89',
'\u3A8A',
'\u3A8B',
'\u3A8C',
'\u3A8D',
'\u3A8E',
'\u3A8F',
'\u3A90',
'\u3A91',
'\u3A92',
'\u3A93',
'\u3A94',
'\u3A95',
'\u3A96',
'\u3A97',
'\u3A98',
'\u3A99',
'\u3A9A',
'\u3A9B',
'\u3A9C',
'\u3A9D',
'\u3A9E',
'\u3A9F',
'\u3AA0',
'\u3AA1',
'\u3AA2',
'\u3AA3',
'\u3AA4',
'\u3AA5',
'\u3AA6',
'\u3AA7',
'\u3AA8',
'\u3AA9',
'\u3AAA',
'\u3AAB',
'\u3AAC',
'\u3AAD',
'\u3AAE',
'\u3AAF',
'\u3AB0',
'\u3AB1',
'\u3AB2',
'\u3AB3',
'\u3AB4',
'\u3AB5',
'\u3AB6',
'\u3AB7',
'\u3AB8',
'\u3AB9',
'\u3ABA',
'\u3ABB',
'\u3ABC',
'\u3ABD',
'\u3ABE',
'\u3ABF',
'\u3AC0',
'\u3AC1',
'\u3AC2',
'\u3AC3',
'\u3AC4',
'\u3AC5',
'\u3AC6',
'\u3AC7',
'\u3AC8',
'\u3AC9',
'\u3ACA',
'\u3ACB',
'\u3ACC',
'\u3ACD',
'\u3ACE',
'\u3ACF',
'\u3AD0',
'\u3AD1',
'\u3AD2',
'\u3AD3',
'\u3AD4',
'\u3AD5',
'\u3AD6',
'\u3AD7',
'\u3AD8',
'\u3AD9',
'\u3ADA',
'\u3ADB',
'\u3ADC',
'\u3ADD',
'\u3ADE',
'\u3ADF',
'\u3AE0',
'\u3AE1',
'\u3AE2',
'\u3AE3',
'\u3AE4',
'\u3AE5',
'\u3AE6',
'\u3AE7',
'\u3AE8',
'\u3AE9',
'\u3AEA',
'\u3AEB',
'\u3AEC',
'\u3AED',
'\u3AEE',
'\u3AEF',
'\u3AF0',
'\u3AF1',
'\u3AF2',
'\u3AF3',
'\u3AF4',
'\u3AF5',
'\u3AF6',
'\u3AF7',
'\u3AF8',
'\u3AF9',
'\u3AFA',
'\u3AFB',
'\u3AFC',
'\u3AFD',
'\u3AFE',
'\u3AFF',
'\u3B00',
'\u3B01',
'\u3B02',
'\u3B03',
'\u3B04',
'\u3B05',
'\u3B06',
'\u3B07',
'\u3B08',
'\u3B09',
'\u3B0A',
'\u3B0B',
'\u3B0C',
'\u3B0D',
'\u3B0E',
'\u3B0F',
'\u3B10',
'\u3B11',
'\u3B12',
'\u3B13',
'\u3B14',
'\u3B15',
'\u3B16',
'\u3B17',
'\u3B18',
'\u3B19',
'\u3B1A',
'\u3B1B',
'\u3B1C',
'\u3B1D',
'\u3B1E',
'\u3B1F',
'\u3B20',
'\u3B21',
'\u3B22',
'\u3B23',
'\u3B24',
'\u3B25',
'\u3B26',
'\u3B27',
'\u3B28',
'\u3B29',
'\u3B2A',
'\u3B2B',
'\u3B2C',
'\u3B2D',
'\u3B2E',
'\u3B2F',
'\u3B30',
'\u3B31',
'\u3B32',
'\u3B33',
'\u3B34',
'\u3B35',
'\u3B36',
'\u3B37',
'\u3B38',
'\u3B39',
'\u3B3A',
'\u3B3B',
'\u3B3C',
'\u3B3D',
'\u3B3E',
'\u3B3F',
'\u3B40',
'\u3B41',
'\u3B42',
'\u3B43',
'\u3B44',
'\u3B45',
'\u3B46',
'\u3B47',
'\u3B48',
'\u3B49',
'\u3B4A',
'\u3B4B',
'\u3B4C',
'\u3B4D',
'\u3B4E',
'\u3B4F',
'\u3B50',
'\u3B51',
'\u3B52',
'\u3B53',
'\u3B54',
'\u3B55',
'\u3B56',
'\u3B57',
'\u3B58',
'\u3B59',
'\u3B5A',
'\u3B5B',
'\u3B5C',
'\u3B5D',
'\u3B5E',
'\u3B5F',
'\u3B60',
'\u3B61',
'\u3B62',
'\u3B63',
'\u3B64',
'\u3B65',
'\u3B66',
'\u3B67',
'\u3B68',
'\u3B69',
'\u3B6A',
'\u3B6B',
'\u3B6C',
'\u3B6D',
'\u3B6E',
'\u3B6F',
'\u3B70',
'\u3B71',
'\u3B72',
'\u3B73',
'\u3B74',
'\u3B75',
'\u3B76',
'\u3B77',
'\u3B78',
'\u3B79',
'\u3B7A',
'\u3B7B',
'\u3B7C',
'\u3B7D',
'\u3B7E',
'\u3B7F',
'\u3B80',
'\u3B81',
'\u3B82',
'\u3B83',
'\u3B84',
'\u3B85',
'\u3B86',
'\u3B87',
'\u3B88',
'\u3B89',
'\u3B8A',
'\u3B8B',
'\u3B8C',
'\u3B8D',
'\u3B8E',
'\u3B8F',
'\u3B90',
'\u3B91',
'\u3B92',
'\u3B93',
'\u3B94',
'\u3B95',
'\u3B96',
'\u3B97',
'\u3B98',
'\u3B99',
'\u3B9A',
'\u3B9B',
'\u3B9C',
'\u3B9D',
'\u3B9E',
'\u3B9F',
'\u3BA0',
'\u3BA1',
'\u3BA2',
'\u3BA3',
'\u3BA4',
'\u3BA5',
'\u3BA6',
'\u3BA7',
'\u3BA8',
'\u3BA9',
'\u3BAA',
'\u3BAB',
'\u3BAC',
'\u3BAD',
'\u3BAE',
'\u3BAF',
'\u3BB0',
'\u3BB1',
'\u3BB2',
'\u3BB3',
'\u3BB4',
'\u3BB5',
'\u3BB6',
'\u3BB7',
'\u3BB8',
'\u3BB9',
'\u3BBA',
'\u3BBB',
'\u3BBC',
'\u3BBD',
'\u3BBE',
'\u3BBF',
'\u3BC0',
'\u3BC1',
'\u3BC2',
'\u3BC3',
'\u3BC4',
'\u3BC5',
'\u3BC6',
'\u3BC7',
'\u3BC8',
'\u3BC9',
'\u3BCA',
'\u3BCB',
'\u3BCC',
'\u3BCD',
'\u3BCE',
'\u3BCF',
'\u3BD0',
'\u3BD1',
'\u3BD2',
'\u3BD3',
'\u3BD4',
'\u3BD5',
'\u3BD6',
'\u3BD7',
'\u3BD8',
'\u3BD9',
'\u3BDA',
'\u3BDB',
'\u3BDC',
'\u3BDD',
'\u3BDE',
'\u3BDF',
'\u3BE0',
'\u3BE1',
'\u3BE2',
'\u3BE3',
'\u3BE4',
'\u3BE5',
'\u3BE6',
'\u3BE7',
'\u3BE8',
'\u3BE9',
'\u3BEA',
'\u3BEB',
'\u3BEC',
'\u3BED',
'\u3BEE',
'\u3BEF',
'\u3BF0',
'\u3BF1',
'\u3BF2',
'\u3BF3',
'\u3BF4',
'\u3BF5',
'\u3BF6',
'\u3BF7',
'\u3BF8',
'\u3BF9',
'\u3BFA',
'\u3BFB',
'\u3BFC',
'\u3BFD',
'\u3BFE',
'\u3BFF',
'\u3C00',
'\u3C01',
'\u3C02',
'\u3C03',
'\u3C04',
'\u3C05',
'\u3C06',
'\u3C07',
'\u3C08',
'\u3C09',
'\u3C0A',
'\u3C0B',
'\u3C0C',
'\u3C0D',
'\u3C0E',
'\u3C0F',
'\u3C10',
'\u3C11',
'\u3C12',
'\u3C13',
'\u3C14',
'\u3C15',
'\u3C16',
'\u3C17',
'\u3C18',
'\u3C19',
'\u3C1A',
'\u3C1B',
'\u3C1C',
'\u3C1D',
'\u3C1E',
'\u3C1F',
'\u3C20',
'\u3C21',
'\u3C22',
'\u3C23',
'\u3C24',
'\u3C25',
'\u3C26',
'\u3C27',
'\u3C28',
'\u3C29',
'\u3C2A',
'\u3C2B',
'\u3C2C',
'\u3C2D',
'\u3C2E',
'\u3C2F',
'\u3C30',
'\u3C31',
'\u3C32',
'\u3C33',
'\u3C34',
'\u3C35',
'\u3C36',
'\u3C37',
'\u3C38',
'\u3C39',
'\u3C3A',
'\u3C3B',
'\u3C3C',
'\u3C3D',
'\u3C3E',
'\u3C3F',
'\u3C40',
'\u3C41',
'\u3C42',
'\u3C43',
'\u3C44',
'\u3C45',
'\u3C46',
'\u3C47',
'\u3C48',
'\u3C49',
'\u3C4A',
'\u3C4B',
'\u3C4C',
'\u3C4D',
'\u3C4E',
'\u3C4F',
'\u3C50',
'\u3C51',
'\u3C52',
'\u3C53',
'\u3C54',
'\u3C55',
'\u3C56',
'\u3C57',
'\u3C58',
'\u3C59',
'\u3C5A',
'\u3C5B',
'\u3C5C',
'\u3C5D',
'\u3C5E',
'\u3C5F',
'\u3C60',
'\u3C61',
'\u3C62',
'\u3C63',
'\u3C64',
'\u3C65',
'\u3C66',
'\u3C67',
'\u3C68',
'\u3C69',
'\u3C6A',
'\u3C6B',
'\u3C6C',
'\u3C6D',
'\u3C6E',
'\u3C6F',
'\u3C70',
'\u3C71',
'\u3C72',
'\u3C73',
'\u3C74',
'\u3C75',
'\u3C76',
'\u3C77',
'\u3C78',
'\u3C79',
'\u3C7A',
'\u3C7B',
'\u3C7C',
'\u3C7D',
'\u3C7E',
'\u3C7F',
'\u3C80',
'\u3C81',
'\u3C82',
'\u3C83',
'\u3C84',
'\u3C85',
'\u3C86',
'\u3C87',
'\u3C88',
'\u3C89',
'\u3C8A',
'\u3C8B',
'\u3C8C',
'\u3C8D',
'\u3C8E',
'\u3C8F',
'\u3C90',
'\u3C91',
'\u3C92',
'\u3C93',
'\u3C94',
'\u3C95',
'\u3C96',
'\u3C97',
'\u3C98',
'\u3C99',
'\u3C9A',
'\u3C9B',
'\u3C9C',
'\u3C9D',
'\u3C9E',
'\u3C9F',
'\u3CA0',
'\u3CA1',
'\u3CA2',
'\u3CA3',
'\u3CA4',
'\u3CA5',
'\u3CA6',
'\u3CA7',
'\u3CA8',
'\u3CA9',
'\u3CAA',
'\u3CAB',
'\u3CAC',
'\u3CAD',
'\u3CAE',
'\u3CAF',
'\u3CB0',
'\u3CB1',
'\u3CB2',
'\u3CB3',
'\u3CB4',
'\u3CB5',
'\u3CB6',
'\u3CB7',
'\u3CB8',
'\u3CB9',
'\u3CBA',
'\u3CBB',
'\u3CBC',
'\u3CBD',
'\u3CBE',
'\u3CBF',
'\u3CC0',
'\u3CC1',
'\u3CC2',
'\u3CC3',
'\u3CC4',
'\u3CC5',
'\u3CC6',
'\u3CC7',
'\u3CC8',
'\u3CC9',
'\u3CCA',
'\u3CCB',
'\u3CCC',
'\u3CCD',
'\u3CCE',
'\u3CCF',
'\u3CD0',
'\u3CD1',
'\u3CD2',
'\u3CD3',
'\u3CD4',
'\u3CD5',
'\u3CD6',
'\u3CD7',
'\u3CD8',
'\u3CD9',
'\u3CDA',
'\u3CDB',
'\u3CDC',
'\u3CDD',
'\u3CDE',
'\u3CDF',
'\u3CE0',
'\u3CE1',
'\u3CE2',
'\u3CE3',
'\u3CE4',
'\u3CE5',
'\u3CE6',
'\u3CE7',
'\u3CE8',
'\u3CE9',
'\u3CEA',
'\u3CEB',
'\u3CEC',
'\u3CED',
'\u3CEE',
'\u3CEF',
'\u3CF0',
'\u3CF1',
'\u3CF2',
'\u3CF3',
'\u3CF4',
'\u3CF5',
'\u3CF6',
'\u3CF7',
'\u3CF8',
'\u3CF9',
'\u3CFA',
'\u3CFB',
'\u3CFC',
'\u3CFD',
'\u3CFE',
'\u3CFF',
'\u3D00',
'\u3D01',
'\u3D02',
'\u3D03',
'\u3D04',
'\u3D05',
'\u3D06',
'\u3D07',
'\u3D08',
'\u3D09',
'\u3D0A',
'\u3D0B',
'\u3D0C',
'\u3D0D',
'\u3D0E',
'\u3D0F',
'\u3D10',
'\u3D11',
'\u3D12',
'\u3D13',
'\u3D14',
'\u3D15',
'\u3D16',
'\u3D17',
'\u3D18',
'\u3D19',
'\u3D1A',
'\u3D1B',
'\u3D1C',
'\u3D1D',
'\u3D1E',
'\u3D1F',
'\u3D20',
'\u3D21',
'\u3D22',
'\u3D23',
'\u3D24',
'\u3D25',
'\u3D26',
'\u3D27',
'\u3D28',
'\u3D29',
'\u3D2A',
'\u3D2B',
'\u3D2C',
'\u3D2D',
'\u3D2E',
'\u3D2F',
'\u3D30',
'\u3D31',
'\u3D32',
'\u3D33',
'\u3D34',
'\u3D35',
'\u3D36',
'\u3D37',
'\u3D38',
'\u3D39',
'\u3D3A',
'\u3D3B',
'\u3D3C',
'\u3D3D',
'\u3D3E',
'\u3D3F',
'\u3D40',
'\u3D41',
'\u3D42',
'\u3D43',
'\u3D44',
'\u3D45',
'\u3D46',
'\u3D47',
'\u3D48',
'\u3D49',
'\u3D4A',
'\u3D4B',
'\u3D4C',
'\u3D4D',
'\u3D4E',
'\u3D4F',
'\u3D50',
'\u3D51',
'\u3D52',
'\u3D53',
'\u3D54',
'\u3D55',
'\u3D56',
'\u3D57',
'\u3D58',
'\u3D59',
'\u3D5A',
'\u3D5B',
'\u3D5C',
'\u3D5D',
'\u3D5E',
'\u3D5F',
'\u3D60',
'\u3D61',
'\u3D62',
'\u3D63',
'\u3D64',
'\u3D65',
'\u3D66',
'\u3D67',
'\u3D68',
'\u3D69',
'\u3D6A',
'\u3D6B',
'\u3D6C',
'\u3D6D',
'\u3D6E',
'\u3D6F',
'\u3D70',
'\u3D71',
'\u3D72',
'\u3D73',
'\u3D74',
'\u3D75',
'\u3D76',
'\u3D77',
'\u3D78',
'\u3D79',
'\u3D7A',
'\u3D7B',
'\u3D7C',
'\u3D7D',
'\u3D7E',
'\u3D7F',
'\u3D80',
'\u3D81',
'\u3D82',
'\u3D83',
'\u3D84',
'\u3D85',
'\u3D86',
'\u3D87',
'\u3D88',
'\u3D89',
'\u3D8A',
'\u3D8B',
'\u3D8C',
'\u3D8D',
'\u3D8E',
'\u3D8F',
'\u3D90',
'\u3D91',
'\u3D92',
'\u3D93',
'\u3D94',
'\u3D95',
'\u3D96',
'\u3D97',
'\u3D98',
'\u3D99',
'\u3D9A',
'\u3D9B',
'\u3D9C',
'\u3D9D',
'\u3D9E',
'\u3D9F',
'\u3DA0',
'\u3DA1',
'\u3DA2',
'\u3DA3',
'\u3DA4',
'\u3DA5',
'\u3DA6',
'\u3DA7',
'\u3DA8',
'\u3DA9',
'\u3DAA',
'\u3DAB',
'\u3DAC',
'\u3DAD',
'\u3DAE',
'\u3DAF',
'\u3DB0',
'\u3DB1',
'\u3DB2',
'\u3DB3',
'\u3DB4',
'\u3DB5',
'\u3DB6',
'\u3DB7',
'\u3DB8',
'\u3DB9',
'\u3DBA',
'\u3DBB',
'\u3DBC',
'\u3DBD',
'\u3DBE',
'\u3DBF',
'\u3DC0',
'\u3DC1',
'\u3DC2',
'\u3DC3',
'\u3DC4',
'\u3DC5',
'\u3DC6',
'\u3DC7',
'\u3DC8',
'\u3DC9',
'\u3DCA',
'\u3DCB',
'\u3DCC',
'\u3DCD',
'\u3DCE',
'\u3DCF',
'\u3DD0',
'\u3DD1',
'\u3DD2',
'\u3DD3',
'\u3DD4',
'\u3DD5',
'\u3DD6',
'\u3DD7',
'\u3DD8',
'\u3DD9',
'\u3DDA',
'\u3DDB',
'\u3DDC',
'\u3DDD',
'\u3DDE',
'\u3DDF',
'\u3DE0',
'\u3DE1',
'\u3DE2',
'\u3DE3',
'\u3DE4',
'\u3DE5',
'\u3DE6',
'\u3DE7',
'\u3DE8',
'\u3DE9',
'\u3DEA',
'\u3DEB',
'\u3DEC',
'\u3DED',
'\u3DEE',
'\u3DEF',
'\u3DF0',
'\u3DF1',
'\u3DF2',
'\u3DF3',
'\u3DF4',
'\u3DF5',
'\u3DF6',
'\u3DF7',
'\u3DF8',
'\u3DF9',
'\u3DFA',
'\u3DFB',
'\u3DFC',
'\u3DFD',
'\u3DFE',
'\u3DFF',
'\u3E00',
'\u3E01',
'\u3E02',
'\u3E03',
'\u3E04',
'\u3E05',
'\u3E06',
'\u3E07',
'\u3E08',
'\u3E09',
'\u3E0A',
'\u3E0B',
'\u3E0C',
'\u3E0D',
'\u3E0E',
'\u3E0F',
'\u3E10',
'\u3E11',
'\u3E12',
'\u3E13',
'\u3E14',
'\u3E15',
'\u3E16',
'\u3E17',
'\u3E18',
'\u3E19',
'\u3E1A',
'\u3E1B',
'\u3E1C',
'\u3E1D',
'\u3E1E',
'\u3E1F',
'\u3E20',
'\u3E21',
'\u3E22',
'\u3E23',
'\u3E24',
'\u3E25',
'\u3E26',
'\u3E27',
'\u3E28',
'\u3E29',
'\u3E2A',
'\u3E2B',
'\u3E2C',
'\u3E2D',
'\u3E2E',
'\u3E2F',
'\u3E30',
'\u3E31',
'\u3E32',
'\u3E33',
'\u3E34',
'\u3E35',
'\u3E36',
'\u3E37',
'\u3E38',
'\u3E39',
'\u3E3A',
'\u3E3B',
'\u3E3C',
'\u3E3D',
'\u3E3E',
'\u3E3F',
'\u3E40',
'\u3E41',
'\u3E42',
'\u3E43',
'\u3E44',
'\u3E45',
'\u3E46',
'\u3E47',
'\u3E48',
'\u3E49',
'\u3E4A',
'\u3E4B',
'\u3E4C',
'\u3E4D',
'\u3E4E',
'\u3E4F',
'\u3E50',
'\u3E51',
'\u3E52',
'\u3E53',
'\u3E54',
'\u3E55',
'\u3E56',
'\u3E57',
'\u3E58',
'\u3E59',
'\u3E5A',
'\u3E5B',
'\u3E5C',
'\u3E5D',
'\u3E5E',
'\u3E5F',
'\u3E60',
'\u3E61',
'\u3E62',
'\u3E63',
'\u3E64',
'\u3E65',
'\u3E66',
'\u3E67',
'\u3E68',
'\u3E69',
'\u3E6A',
'\u3E6B',
'\u3E6C',
'\u3E6D',
'\u3E6E',
'\u3E6F',
'\u3E70',
'\u3E71',
'\u3E72',
'\u3E73',
'\u3E74',
'\u3E75',
'\u3E76',
'\u3E77',
'\u3E78',
'\u3E79',
'\u3E7A',
'\u3E7B',
'\u3E7C',
'\u3E7D',
'\u3E7E',
'\u3E7F',
'\u3E80',
'\u3E81',
'\u3E82',
'\u3E83',
'\u3E84',
'\u3E85',
'\u3E86',
'\u3E87',
'\u3E88',
'\u3E89',
'\u3E8A',
'\u3E8B',
'\u3E8C',
'\u3E8D',
'\u3E8E',
'\u3E8F',
'\u3E90',
'\u3E91',
'\u3E92',
'\u3E93',
'\u3E94',
'\u3E95',
'\u3E96',
'\u3E97',
'\u3E98',
'\u3E99',
'\u3E9A',
'\u3E9B',
'\u3E9C',
'\u3E9D',
'\u3E9E',
'\u3E9F',
'\u3EA0',
'\u3EA1',
'\u3EA2',
'\u3EA3',
'\u3EA4',
'\u3EA5',
'\u3EA6',
'\u3EA7',
'\u3EA8',
'\u3EA9',
'\u3EAA',
'\u3EAB',
'\u3EAC',
'\u3EAD',
'\u3EAE',
'\u3EAF',
'\u3EB0',
'\u3EB1',
'\u3EB2',
'\u3EB3',
'\u3EB4',
'\u3EB5',
'\u3EB6',
'\u3EB7',
'\u3EB8',
'\u3EB9',
'\u3EBA',
'\u3EBB',
'\u3EBC',
'\u3EBD',
'\u3EBE',
'\u3EBF',
'\u3EC0',
'\u3EC1',
'\u3EC2',
'\u3EC3',
'\u3EC4',
'\u3EC5',
'\u3EC6',
'\u3EC7',
'\u3EC8',
'\u3EC9',
'\u3ECA',
'\u3ECB',
'\u3ECC',
'\u3ECD',
'\u3ECE',
'\u3ECF',
'\u3ED0',
'\u3ED1',
'\u3ED2',
'\u3ED3',
'\u3ED4',
'\u3ED5',
'\u3ED6',
'\u3ED7',
'\u3ED8',
'\u3ED9',
'\u3EDA',
'\u3EDB',
'\u3EDC',
'\u3EDD',
'\u3EDE',
'\u3EDF',
'\u3EE0',
'\u3EE1',
'\u3EE2',
'\u3EE3',
'\u3EE4',
'\u3EE5',
'\u3EE6',
'\u3EE7',
'\u3EE8',
'\u3EE9',
'\u3EEA',
'\u3EEB',
'\u3EEC',
'\u3EED',
'\u3EEE',
'\u3EEF',
'\u3EF0',
'\u3EF1',
'\u3EF2',
'\u3EF3',
'\u3EF4',
'\u3EF5',
'\u3EF6',
'\u3EF7',
'\u3EF8',
'\u3EF9',
'\u3EFA',
'\u3EFB',
'\u3EFC',
'\u3EFD',
'\u3EFE',
'\u3EFF',
'\u3F00',
'\u3F01',
'\u3F02',
'\u3F03',
'\u3F04',
'\u3F05',
'\u3F06',
'\u3F07',
'\u3F08',
'\u3F09',
'\u3F0A',
'\u3F0B',
'\u3F0C',
'\u3F0D',
'\u3F0E',
'\u3F0F',
'\u3F10',
'\u3F11',
'\u3F12',
'\u3F13',
'\u3F14',
'\u3F15',
'\u3F16',
'\u3F17',
'\u3F18',
'\u3F19',
'\u3F1A',
'\u3F1B',
'\u3F1C',
'\u3F1D',
'\u3F1E',
'\u3F1F',
'\u3F20',
'\u3F21',
'\u3F22',
'\u3F23',
'\u3F24',
'\u3F25',
'\u3F26',
'\u3F27',
'\u3F28',
'\u3F29',
'\u3F2A',
'\u3F2B',
'\u3F2C',
'\u3F2D',
'\u3F2E',
'\u3F2F',
'\u3F30',
'\u3F31',
'\u3F32',
'\u3F33',
'\u3F34',
'\u3F35',
'\u3F36',
'\u3F37',
'\u3F38',
'\u3F39',
'\u3F3A',
'\u3F3B',
'\u3F3C',
'\u3F3D',
'\u3F3E',
'\u3F3F',
'\u3F40',
'\u3F41',
'\u3F42',
'\u3F43',
'\u3F44',
'\u3F45',
'\u3F46',
'\u3F47',
'\u3F48',
'\u3F49',
'\u3F4A',
'\u3F4B',
'\u3F4C',
'\u3F4D',
'\u3F4E',
'\u3F4F',
'\u3F50',
'\u3F51',
'\u3F52',
'\u3F53',
'\u3F54',
'\u3F55',
'\u3F56',
'\u3F57',
'\u3F58',
'\u3F59',
'\u3F5A',
'\u3F5B',
'\u3F5C',
'\u3F5D',
'\u3F5E',
'\u3F5F',
'\u3F60',
'\u3F61',
'\u3F62',
'\u3F63',
'\u3F64',
'\u3F65',
'\u3F66',
'\u3F67',
'\u3F68',
'\u3F69',
'\u3F6A',
'\u3F6B',
'\u3F6C',
'\u3F6D',
'\u3F6E',
'\u3F6F',
'\u3F70',
'\u3F71',
'\u3F72',
'\u3F73',
'\u3F74',
'\u3F75',
'\u3F76',
'\u3F77',
'\u3F78',
'\u3F79',
'\u3F7A',
'\u3F7B',
'\u3F7C',
'\u3F7D',
'\u3F7E',
'\u3F7F',
'\u3F80',
'\u3F81',
'\u3F82',
'\u3F83',
'\u3F84',
'\u3F85',
'\u3F86',
'\u3F87',
'\u3F88',
'\u3F89',
'\u3F8A',
'\u3F8B',
'\u3F8C',
'\u3F8D',
'\u3F8E',
'\u3F8F',
'\u3F90',
'\u3F91',
'\u3F92',
'\u3F93',
'\u3F94',
'\u3F95',
'\u3F96',
'\u3F97',
'\u3F98',
'\u3F99',
'\u3F9A',
'\u3F9B',
'\u3F9C',
'\u3F9D',
'\u3F9E',
'\u3F9F',
'\u3FA0',
'\u3FA1',
'\u3FA2',
'\u3FA3',
'\u3FA4',
'\u3FA5',
'\u3FA6',
'\u3FA7',
'\u3FA8',
'\u3FA9',
'\u3FAA',
'\u3FAB',
'\u3FAC',
'\u3FAD',
'\u3FAE',
'\u3FAF',
'\u3FB0',
'\u3FB1',
'\u3FB2',
'\u3FB3',
'\u3FB4',
'\u3FB5',
'\u3FB6',
'\u3FB7',
'\u3FB8',
'\u3FB9',
'\u3FBA',
'\u3FBB',
'\u3FBC',
'\u3FBD',
'\u3FBE',
'\u3FBF',
'\u3FC0',
'\u3FC1',
'\u3FC2',
'\u3FC3',
'\u3FC4',
'\u3FC5',
'\u3FC6',
'\u3FC7',
'\u3FC8',
'\u3FC9',
'\u3FCA',
'\u3FCB',
'\u3FCC',
'\u3FCD',
'\u3FCE',
'\u3FCF',
'\u3FD0',
'\u3FD1',
'\u3FD2',
'\u3FD3',
'\u3FD4',
'\u3FD5',
'\u3FD6',
'\u3FD7',
'\u3FD8',
'\u3FD9',
'\u3FDA',
'\u3FDB',
'\u3FDC',
'\u3FDD',
'\u3FDE',
'\u3FDF',
'\u3FE0',
'\u3FE1',
'\u3FE2',
'\u3FE3',
'\u3FE4',
'\u3FE5',
'\u3FE6',
'\u3FE7',
'\u3FE8',
'\u3FE9',
'\u3FEA',
'\u3FEB',
'\u3FEC',
'\u3FED',
'\u3FEE',
'\u3FEF',
'\u3FF0',
'\u3FF1',
'\u3FF2',
'\u3FF3',
'\u3FF4',
'\u3FF5',
'\u3FF6',
'\u3FF7',
'\u3FF8',
'\u3FF9',
'\u3FFA',
'\u3FFB',
'\u3FFC',
'\u3FFD',
'\u3FFE',
'\u3FFF',
'\u4000',
'\u4001',
'\u4002',
'\u4003',
'\u4004',
'\u4005',
'\u4006',
'\u4007',
'\u4008',
'\u4009',
'\u400A',
'\u400B',
'\u400C',
'\u400D',
'\u400E',
'\u400F',
'\u4010',
'\u4011',
'\u4012',
'\u4013',
'\u4014',
'\u4015',
'\u4016',
'\u4017',
'\u4018',
'\u4019',
'\u401A',
'\u401B',
'\u401C',
'\u401D',
'\u401E',
'\u401F',
'\u4020',
'\u4021',
'\u4022',
'\u4023',
'\u4024',
'\u4025',
'\u4026',
'\u4027',
'\u4028',
'\u4029',
'\u402A',
'\u402B',
'\u402C',
'\u402D',
'\u402E',
'\u402F',
'\u4030',
'\u4031',
'\u4032',
'\u4033',
'\u4034',
'\u4035',
'\u4036',
'\u4037',
'\u4038',
'\u4039',
'\u403A',
'\u403B',
'\u403C',
'\u403D',
'\u403E',
'\u403F',
'\u4040',
'\u4041',
'\u4042',
'\u4043',
'\u4044',
'\u4045',
'\u4046',
'\u4047',
'\u4048',
'\u4049',
'\u404A',
'\u404B',
'\u404C',
'\u404D',
'\u404E',
'\u404F',
'\u4050',
'\u4051',
'\u4052',
'\u4053',
'\u4054',
'\u4055',
'\u4056',
'\u4057',
'\u4058',
'\u4059',
'\u405A',
'\u405B',
'\u405C',
'\u405D',
'\u405E',
'\u405F',
'\u4060',
'\u4061',
'\u4062',
'\u4063',
'\u4064',
'\u4065',
'\u4066',
'\u4067',
'\u4068',
'\u4069',
'\u406A',
'\u406B',
'\u406C',
'\u406D',
'\u406E',
'\u406F',
'\u4070',
'\u4071',
'\u4072',
'\u4073',
'\u4074',
'\u4075',
'\u4076',
'\u4077',
'\u4078',
'\u4079',
'\u407A',
'\u407B',
'\u407C',
'\u407D',
'\u407E',
'\u407F',
'\u4080',
'\u4081',
'\u4082',
'\u4083',
'\u4084',
'\u4085',
'\u4086',
'\u4087',
'\u4088',
'\u4089',
'\u408A',
'\u408B',
'\u408C',
'\u408D',
'\u408E',
'\u408F',
'\u4090',
'\u4091',
'\u4092',
'\u4093',
'\u4094',
'\u4095',
'\u4096',
'\u4097',
'\u4098',
'\u4099',
'\u409A',
'\u409B',
'\u409C',
'\u409D',
'\u409E',
'\u409F',
'\u40A0',
'\u40A1',
'\u40A2',
'\u40A3',
'\u40A4',
'\u40A5',
'\u40A6',
'\u40A7',
'\u40A8',
'\u40A9',
'\u40AA',
'\u40AB',
'\u40AC',
'\u40AD',
'\u40AE',
'\u40AF',
'\u40B0',
'\u40B1',
'\u40B2',
'\u40B3',
'\u40B4',
'\u40B5',
'\u40B6',
'\u40B7',
'\u40B8',
'\u40B9',
'\u40BA',
'\u40BB',
'\u40BC',
'\u40BD',
'\u40BE',
'\u40BF',
'\u40C0',
'\u40C1',
'\u40C2',
'\u40C3',
'\u40C4',
'\u40C5',
'\u40C6',
'\u40C7',
'\u40C8',
'\u40C9',
'\u40CA',
'\u40CB',
'\u40CC',
'\u40CD',
'\u40CE',
'\u40CF',
'\u40D0',
'\u40D1',
'\u40D2',
'\u40D3',
'\u40D4',
'\u40D5',
'\u40D6',
'\u40D7',
'\u40D8',
'\u40D9',
'\u40DA',
'\u40DB',
'\u40DC',
'\u40DD',
'\u40DE',
'\u40DF',
'\u40E0',
'\u40E1',
'\u40E2',
'\u40E3',
'\u40E4',
'\u40E5',
'\u40E6',
'\u40E7',
'\u40E8',
'\u40E9',
'\u40EA',
'\u40EB',
'\u40EC',
'\u40ED',
'\u40EE',
'\u40EF',
'\u40F0',
'\u40F1',
'\u40F2',
'\u40F3',
'\u40F4',
'\u40F5',
'\u40F6',
'\u40F7',
'\u40F8',
'\u40F9',
'\u40FA',
'\u40FB',
'\u40FC',
'\u40FD',
'\u40FE',
'\u40FF',
'\u4100',
'\u4101',
'\u4102',
'\u4103',
'\u4104',
'\u4105',
'\u4106',
'\u4107',
'\u4108',
'\u4109',
'\u410A',
'\u410B',
'\u410C',
'\u410D',
'\u410E',
'\u410F',
'\u4110',
'\u4111',
'\u4112',
'\u4113',
'\u4114',
'\u4115',
'\u4116',
'\u4117',
'\u4118',
'\u4119',
'\u411A',
'\u411B',
'\u411C',
'\u411D',
'\u411E',
'\u411F',
'\u4120',
'\u4121',
'\u4122',
'\u4123',
'\u4124',
'\u4125',
'\u4126',
'\u4127',
'\u4128',
'\u4129',
'\u412A',
'\u412B',
'\u412C',
'\u412D',
'\u412E',
'\u412F',
'\u4130',
'\u4131',
'\u4132',
'\u4133',
'\u4134',
'\u4135',
'\u4136',
'\u4137',
'\u4138',
'\u4139',
'\u413A',
'\u413B',
'\u413C',
'\u413D',
'\u413E',
'\u413F',
'\u4140',
'\u4141',
'\u4142',
'\u4143',
'\u4144',
'\u4145',
'\u4146',
'\u4147',
'\u4148',
'\u4149',
'\u414A',
'\u414B',
'\u414C',
'\u414D',
'\u414E',
'\u414F',
'\u4150',
'\u4151',
'\u4152',
'\u4153',
'\u4154',
'\u4155',
'\u4156',
'\u4157',
'\u4158',
'\u4159',
'\u415A',
'\u415B',
'\u415C',
'\u415D',
'\u415E',
'\u415F',
'\u4160',
'\u4161',
'\u4162',
'\u4163',
'\u4164',
'\u4165',
'\u4166',
'\u4167',
'\u4168',
'\u4169',
'\u416A',
'\u416B',
'\u416C',
'\u416D',
'\u416E',
'\u416F',
'\u4170',
'\u4171',
'\u4172',
'\u4173',
'\u4174',
'\u4175',
'\u4176',
'\u4177',
'\u4178',
'\u4179',
'\u417A',
'\u417B',
'\u417C',
'\u417D',
'\u417E',
'\u417F',
'\u4180',
'\u4181',
'\u4182',
'\u4183',
'\u4184',
'\u4185',
'\u4186',
'\u4187',
'\u4188',
'\u4189',
'\u418A',
'\u418B',
'\u418C',
'\u418D',
'\u418E',
'\u418F',
'\u4190',
'\u4191',
'\u4192',
'\u4193',
'\u4194',
'\u4195',
'\u4196',
'\u4197',
'\u4198',
'\u4199',
'\u419A',
'\u419B',
'\u419C',
'\u419D',
'\u419E',
'\u419F',
'\u41A0',
'\u41A1',
'\u41A2',
'\u41A3',
'\u41A4',
'\u41A5',
'\u41A6',
'\u41A7',
'\u41A8',
'\u41A9',
'\u41AA',
'\u41AB',
'\u41AC',
'\u41AD',
'\u41AE',
'\u41AF',
'\u41B0',
'\u41B1',
'\u41B2',
'\u41B3',
'\u41B4',
'\u41B5',
'\u41B6',
'\u41B7',
'\u41B8',
'\u41B9',
'\u41BA',
'\u41BB',
'\u41BC',
'\u41BD',
'\u41BE',
'\u41BF',
'\u41C0',
'\u41C1',
'\u41C2',
'\u41C3',
'\u41C4',
'\u41C5',
'\u41C6',
'\u41C7',
'\u41C8',
'\u41C9',
'\u41CA',
'\u41CB',
'\u41CC',
'\u41CD',
'\u41CE',
'\u41CF',
'\u41D0',
'\u41D1',
'\u41D2',
'\u41D3',
'\u41D4',
'\u41D5',
'\u41D6',
'\u41D7',
'\u41D8',
'\u41D9',
'\u41DA',
'\u41DB',
'\u41DC',
'\u41DD',
'\u41DE',
'\u41DF',
'\u41E0',
'\u41E1',
'\u41E2',
'\u41E3',
'\u41E4',
'\u41E5',
'\u41E6',
'\u41E7',
'\u41E8',
'\u41E9',
'\u41EA',
'\u41EB',
'\u41EC',
'\u41ED',
'\u41EE',
'\u41EF',
'\u41F0',
'\u41F1',
'\u41F2',
'\u41F3',
'\u41F4',
'\u41F5',
'\u41F6',
'\u41F7',
'\u41F8',
'\u41F9',
'\u41FA',
'\u41FB',
'\u41FC',
'\u41FD',
'\u41FE',
'\u41FF',
'\u4200',
'\u4201',
'\u4202',
'\u4203',
'\u4204',
'\u4205',
'\u4206',
'\u4207',
'\u4208',
'\u4209',
'\u420A',
'\u420B',
'\u420C',
'\u420D',
'\u420E',
'\u420F',
'\u4210',
'\u4211',
'\u4212',
'\u4213',
'\u4214',
'\u4215',
'\u4216',
'\u4217',
'\u4218',
'\u4219',
'\u421A',
'\u421B',
'\u421C',
'\u421D',
'\u421E',
'\u421F',
'\u4220',
'\u4221',
'\u4222',
'\u4223',
'\u4224',
'\u4225',
'\u4226',
'\u4227',
'\u4228',
'\u4229',
'\u422A',
'\u422B',
'\u422C',
'\u422D',
'\u422E',
'\u422F',
'\u4230',
'\u4231',
'\u4232',
'\u4233',
'\u4234',
'\u4235',
'\u4236',
'\u4237',
'\u4238',
'\u4239',
'\u423A',
'\u423B',
'\u423C',
'\u423D',
'\u423E',
'\u423F',
'\u4240',
'\u4241',
'\u4242',
'\u4243',
'\u4244',
'\u4245',
'\u4246',
'\u4247',
'\u4248',
'\u4249',
'\u424A',
'\u424B',
'\u424C',
'\u424D',
'\u424E',
'\u424F',
'\u4250',
'\u4251',
'\u4252',
'\u4253',
'\u4254',
'\u4255',
'\u4256',
'\u4257',
'\u4258',
'\u4259',
'\u425A',
'\u425B',
'\u425C',
'\u425D',
'\u425E',
'\u425F',
'\u4260',
'\u4261',
'\u4262',
'\u4263',
'\u4264',
'\u4265',
'\u4266',
'\u4267',
'\u4268',
'\u4269',
'\u426A',
'\u426B',
'\u426C',
'\u426D',
'\u426E',
'\u426F',
'\u4270',
'\u4271',
'\u4272',
'\u4273',
'\u4274',
'\u4275',
'\u4276',
'\u4277',
'\u4278',
'\u4279',
'\u427A',
'\u427B',
'\u427C',
'\u427D',
'\u427E',
'\u427F',
'\u4280',
'\u4281',
'\u4282',
'\u4283',
'\u4284',
'\u4285',
'\u4286',
'\u4287',
'\u4288',
'\u4289',
'\u428A',
'\u428B',
'\u428C',
'\u428D',
'\u428E',
'\u428F',
'\u4290',
'\u4291',
'\u4292',
'\u4293',
'\u4294',
'\u4295',
'\u4296',
'\u4297',
'\u4298',
'\u4299',
'\u429A',
'\u429B',
'\u429C',
'\u429D',
'\u429E',
'\u429F',
'\u42A0',
'\u42A1',
'\u42A2',
'\u42A3',
'\u42A4',
'\u42A5',
'\u42A6',
'\u42A7',
'\u42A8',
'\u42A9',
'\u42AA',
'\u42AB',
'\u42AC',
'\u42AD',
'\u42AE',
'\u42AF',
'\u42B0',
'\u42B1',
'\u42B2',
'\u42B3',
'\u42B4',
'\u42B5',
'\u42B6',
'\u42B7',
'\u42B8',
'\u42B9',
'\u42BA',
'\u42BB',
'\u42BC',
'\u42BD',
'\u42BE',
'\u42BF',
'\u42C0',
'\u42C1',
'\u42C2',
'\u42C3',
'\u42C4',
'\u42C5',
'\u42C6',
'\u42C7',
'\u42C8',
'\u42C9',
'\u42CA',
'\u42CB',
'\u42CC',
'\u42CD',
'\u42CE',
'\u42CF',
'\u42D0',
'\u42D1',
'\u42D2',
'\u42D3',
'\u42D4',
'\u42D5',
'\u42D6',
'\u42D7',
'\u42D8',
'\u42D9',
'\u42DA',
'\u42DB',
'\u42DC',
'\u42DD',
'\u42DE',
'\u42DF',
'\u42E0',
'\u42E1',
'\u42E2',
'\u42E3',
'\u42E4',
'\u42E5',
'\u42E6',
'\u42E7',
'\u42E8',
'\u42E9',
'\u42EA',
'\u42EB',
'\u42EC',
'\u42ED',
'\u42EE',
'\u42EF',
'\u42F0',
'\u42F1',
'\u42F2',
'\u42F3',
'\u42F4',
'\u42F5',
'\u42F6',
'\u42F7',
'\u42F8',
'\u42F9',
'\u42FA',
'\u42FB',
'\u42FC',
'\u42FD',
'\u42FE',
'\u42FF',
'\u4300',
'\u4301',
'\u4302',
'\u4303',
'\u4304',
'\u4305',
'\u4306',
'\u4307',
'\u4308',
'\u4309',
'\u430A',
'\u430B',
'\u430C',
'\u430D',
'\u430E',
'\u430F',
'\u4310',
'\u4311',
'\u4312',
'\u4313',
'\u4314',
'\u4315',
'\u4316',
'\u4317',
'\u4318',
'\u4319',
'\u431A',
'\u431B',
'\u431C',
'\u431D',
'\u431E',
'\u431F',
'\u4320',
'\u4321',
'\u4322',
'\u4323',
'\u4324',
'\u4325',
'\u4326',
'\u4327',
'\u4328',
'\u4329',
'\u432A',
'\u432B',
'\u432C',
'\u432D',
'\u432E',
'\u432F',
'\u4330',
'\u4331',
'\u4332',
'\u4333',
'\u4334',
'\u4335',
'\u4336',
'\u4337',
'\u4338',
'\u4339',
'\u433A',
'\u433B',
'\u433C',
'\u433D',
'\u433E',
'\u433F',
'\u4340',
'\u4341',
'\u4342',
'\u4343',
'\u4344',
'\u4345',
'\u4346',
'\u4347',
'\u4348',
'\u4349',
'\u434A',
'\u434B',
'\u434C',
'\u434D',
'\u434E',
'\u434F',
'\u4350',
'\u4351',
'\u4352',
'\u4353',
'\u4354',
'\u4355',
'\u4356',
'\u4357',
'\u4358',
'\u4359',
'\u435A',
'\u435B',
'\u435C',
'\u435D',
'\u435E',
'\u435F',
'\u4360',
'\u4361',
'\u4362',
'\u4363',
'\u4364',
'\u4365',
'\u4366',
'\u4367',
'\u4368',
'\u4369',
'\u436A',
'\u436B',
'\u436C',
'\u436D',
'\u436E',
'\u436F',
'\u4370',
'\u4371',
'\u4372',
'\u4373',
'\u4374',
'\u4375',
'\u4376',
'\u4377',
'\u4378',
'\u4379',
'\u437A',
'\u437B',
'\u437C',
'\u437D',
'\u437E',
'\u437F',
'\u4380',
'\u4381',
'\u4382',
'\u4383',
'\u4384',
'\u4385',
'\u4386',
'\u4387',
'\u4388',
'\u4389',
'\u438A',
'\u438B',
'\u438C',
'\u438D',
'\u438E',
'\u438F',
'\u4390',
'\u4391',
'\u4392',
'\u4393',
'\u4394',
'\u4395',
'\u4396',
'\u4397',
'\u4398',
'\u4399',
'\u439A',
'\u439B',
'\u439C',
'\u439D',
'\u439E',
'\u439F',
'\u43A0',
'\u43A1',
'\u43A2',
'\u43A3',
'\u43A4',
'\u43A5',
'\u43A6',
'\u43A7',
'\u43A8',
'\u43A9',
'\u43AA',
'\u43AB',
'\u43AC',
'\u43AD',
'\u43AE',
'\u43AF',
'\u43B0',
'\u43B1',
'\u43B2',
'\u43B3',
'\u43B4',
'\u43B5',
'\u43B6',
'\u43B7',
'\u43B8',
'\u43B9',
'\u43BA',
'\u43BB',
'\u43BC',
'\u43BD',
'\u43BE',
'\u43BF',
'\u43C0',
'\u43C1',
'\u43C2',
'\u43C3',
'\u43C4',
'\u43C5',
'\u43C6',
'\u43C7',
'\u43C8',
'\u43C9',
'\u43CA',
'\u43CB',
'\u43CC',
'\u43CD',
'\u43CE',
'\u43CF',
'\u43D0',
'\u43D1',
'\u43D2',
'\u43D3',
'\u43D4',
'\u43D5',
'\u43D6',
'\u43D7',
'\u43D8',
'\u43D9',
'\u43DA',
'\u43DB',
'\u43DC',
'\u43DD',
'\u43DE',
'\u43DF',
'\u43E0',
'\u43E1',
'\u43E2',
'\u43E3',
'\u43E4',
'\u43E5',
'\u43E6',
'\u43E7',
'\u43E8',
'\u43E9',
'\u43EA',
'\u43EB',
'\u43EC',
'\u43ED',
'\u43EE',
'\u43EF',
'\u43F0',
'\u43F1',
'\u43F2',
'\u43F3',
'\u43F4',
'\u43F5',
'\u43F6',
'\u43F7',
'\u43F8',
'\u43F9',
'\u43FA',
'\u43FB',
'\u43FC',
'\u43FD',
'\u43FE',
'\u43FF',
'\u4400',
'\u4401',
'\u4402',
'\u4403',
'\u4404',
'\u4405',
'\u4406',
'\u4407',
'\u4408',
'\u4409',
'\u440A',
'\u440B',
'\u440C',
'\u440D',
'\u440E',
'\u440F',
'\u4410',
'\u4411',
'\u4412',
'\u4413',
'\u4414',
'\u4415',
'\u4416',
'\u4417',
'\u4418',
'\u4419',
'\u441A',
'\u441B',
'\u441C',
'\u441D',
'\u441E',
'\u441F',
'\u4420',
'\u4421',
'\u4422',
'\u4423',
'\u4424',
'\u4425',
'\u4426',
'\u4427',
'\u4428',
'\u4429',
'\u442A',
'\u442B',
'\u442C',
'\u442D',
'\u442E',
'\u442F',
'\u4430',
'\u4431',
'\u4432',
'\u4433',
'\u4434',
'\u4435',
'\u4436',
'\u4437',
'\u4438',
'\u4439',
'\u443A',
'\u443B',
'\u443C',
'\u443D',
'\u443E',
'\u443F',
'\u4440',
'\u4441',
'\u4442',
'\u4443',
'\u4444',
'\u4445',
'\u4446',
'\u4447',
'\u4448',
'\u4449',
'\u444A',
'\u444B',
'\u444C',
'\u444D',
'\u444E',
'\u444F',
'\u4450',
'\u4451',
'\u4452',
'\u4453',
'\u4454',
'\u4455',
'\u4456',
'\u4457',
'\u4458',
'\u4459',
'\u445A',
'\u445B',
'\u445C',
'\u445D',
'\u445E',
'\u445F',
'\u4460',
'\u4461',
'\u4462',
'\u4463',
'\u4464',
'\u4465',
'\u4466',
'\u4467',
'\u4468',
'\u4469',
'\u446A',
'\u446B',
'\u446C',
'\u446D',
'\u446E',
'\u446F',
'\u4470',
'\u4471',
'\u4472',
'\u4473',
'\u4474',
'\u4475',
'\u4476',
'\u4477',
'\u4478',
'\u4479',
'\u447A',
'\u447B',
'\u447C',
'\u447D',
'\u447E',
'\u447F',
'\u4480',
'\u4481',
'\u4482',
'\u4483',
'\u4484',
'\u4485',
'\u4486',
'\u4487',
'\u4488',
'\u4489',
'\u448A',
'\u448B',
'\u448C',
'\u448D',
'\u448E',
'\u448F',
'\u4490',
'\u4491',
'\u4492',
'\u4493',
'\u4494',
'\u4495',
'\u4496',
'\u4497',
'\u4498',
'\u4499',
'\u449A',
'\u449B',
'\u449C',
'\u449D',
'\u449E',
'\u449F',
'\u44A0',
'\u44A1',
'\u44A2',
'\u44A3',
'\u44A4',
'\u44A5',
'\u44A6',
'\u44A7',
'\u44A8',
'\u44A9',
'\u44AA',
'\u44AB',
'\u44AC',
'\u44AD',
'\u44AE',
'\u44AF',
'\u44B0',
'\u44B1',
'\u44B2',
'\u44B3',
'\u44B4',
'\u44B5',
'\u44B6',
'\u44B7',
'\u44B8',
'\u44B9',
'\u44BA',
'\u44BB',
'\u44BC',
'\u44BD',
'\u44BE',
'\u44BF',
'\u44C0',
'\u44C1',
'\u44C2',
'\u44C3',
'\u44C4',
'\u44C5',
'\u44C6',
'\u44C7',
'\u44C8',
'\u44C9',
'\u44CA',
'\u44CB',
'\u44CC',
'\u44CD',
'\u44CE',
'\u44CF',
'\u44D0',
'\u44D1',
'\u44D2',
'\u44D3',
'\u44D4',
'\u44D5',
'\u44D6',
'\u44D7',
'\u44D8',
'\u44D9',
'\u44DA',
'\u44DB',
'\u44DC',
'\u44DD',
'\u44DE',
'\u44DF',
'\u44E0',
'\u44E1',
'\u44E2',
'\u44E3',
'\u44E4',
'\u44E5',
'\u44E6',
'\u44E7',
'\u44E8',
'\u44E9',
'\u44EA',
'\u44EB',
'\u44EC',
'\u44ED',
'\u44EE',
'\u44EF',
'\u44F0',
'\u44F1',
'\u44F2',
'\u44F3',
'\u44F4',
'\u44F5',
'\u44F6',
'\u44F7',
'\u44F8',
'\u44F9',
'\u44FA',
'\u44FB',
'\u44FC',
'\u44FD',
'\u44FE',
'\u44FF',
'\u4500',
'\u4501',
'\u4502',
'\u4503',
'\u4504',
'\u4505',
'\u4506',
'\u4507',
'\u4508',
'\u4509',
'\u450A',
'\u450B',
'\u450C',
'\u450D',
'\u450E',
'\u450F',
'\u4510',
'\u4511',
'\u4512',
'\u4513',
'\u4514',
'\u4515',
'\u4516',
'\u4517',
'\u4518',
'\u4519',
'\u451A',
'\u451B',
'\u451C',
'\u451D',
'\u451E',
'\u451F',
'\u4520',
'\u4521',
'\u4522',
'\u4523',
'\u4524',
'\u4525',
'\u4526',
'\u4527',
'\u4528',
'\u4529',
'\u452A',
'\u452B',
'\u452C',
'\u452D',
'\u452E',
'\u452F',
'\u4530',
'\u4531',
'\u4532',
'\u4533',
'\u4534',
'\u4535',
'\u4536',
'\u4537',
'\u4538',
'\u4539',
'\u453A',
'\u453B',
'\u453C',
'\u453D',
'\u453E',
'\u453F',
'\u4540',
'\u4541',
'\u4542',
'\u4543',
'\u4544',
'\u4545',
'\u4546',
'\u4547',
'\u4548',
'\u4549',
'\u454A',
'\u454B',
'\u454C',
'\u454D',
'\u454E',
'\u454F',
'\u4550',
'\u4551',
'\u4552',
'\u4553',
'\u4554',
'\u4555',
'\u4556',
'\u4557',
'\u4558',
'\u4559',
'\u455A',
'\u455B',
'\u455C',
'\u455D',
'\u455E',
'\u455F',
'\u4560',
'\u4561',
'\u4562',
'\u4563',
'\u4564',
'\u4565',
'\u4566',
'\u4567',
'\u4568',
'\u4569',
'\u456A',
'\u456B',
'\u456C',
'\u456D',
'\u456E',
'\u456F',
'\u4570',
'\u4571',
'\u4572',
'\u4573',
'\u4574',
'\u4575',
'\u4576',
'\u4577',
'\u4578',
'\u4579',
'\u457A',
'\u457B',
'\u457C',
'\u457D',
'\u457E',
'\u457F',
'\u4580',
'\u4581',
'\u4582',
'\u4583',
'\u4584',
'\u4585',
'\u4586',
'\u4587',
'\u4588',
'\u4589',
'\u458A',
'\u458B',
'\u458C',
'\u458D',
'\u458E',
'\u458F',
'\u4590',
'\u4591',
'\u4592',
'\u4593',
'\u4594',
'\u4595',
'\u4596',
'\u4597',
'\u4598',
'\u4599',
'\u459A',
'\u459B',
'\u459C',
'\u459D',
'\u459E',
'\u459F',
'\u45A0',
'\u45A1',
'\u45A2',
'\u45A3',
'\u45A4',
'\u45A5',
'\u45A6',
'\u45A7',
'\u45A8',
'\u45A9',
'\u45AA',
'\u45AB',
'\u45AC',
'\u45AD',
'\u45AE',
'\u45AF',
'\u45B0',
'\u45B1',
'\u45B2',
'\u45B3',
'\u45B4',
'\u45B5',
'\u45B6',
'\u45B7',
'\u45B8',
'\u45B9',
'\u45BA',
'\u45BB',
'\u45BC',
'\u45BD',
'\u45BE',
'\u45BF',
'\u45C0',
'\u45C1',
'\u45C2',
'\u45C3',
'\u45C4',
'\u45C5',
'\u45C6',
'\u45C7',
'\u45C8',
'\u45C9',
'\u45CA',
'\u45CB',
'\u45CC',
'\u45CD',
'\u45CE',
'\u45CF',
'\u45D0',
'\u45D1',
'\u45D2',
'\u45D3',
'\u45D4',
'\u45D5',
'\u45D6',
'\u45D7',
'\u45D8',
'\u45D9',
'\u45DA',
'\u45DB',
'\u45DC',
'\u45DD',
'\u45DE',
'\u45DF',
'\u45E0',
'\u45E1',
'\u45E2',
'\u45E3',
'\u45E4',
'\u45E5',
'\u45E6',
'\u45E7',
'\u45E8',
'\u45E9',
'\u45EA',
'\u45EB',
'\u45EC',
'\u45ED',
'\u45EE',
'\u45EF',
'\u45F0',
'\u45F1',
'\u45F2',
'\u45F3',
'\u45F4',
'\u45F5',
'\u45F6',
'\u45F7',
'\u45F8',
'\u45F9',
'\u45FA',
'\u45FB',
'\u45FC',
'\u45FD',
'\u45FE',
'\u45FF',
'\u4600',
'\u4601',
'\u4602',
'\u4603',
'\u4604',
'\u4605',
'\u4606',
'\u4607',
'\u4608',
'\u4609',
'\u460A',
'\u460B',
'\u460C',
'\u460D',
'\u460E',
'\u460F',
'\u4610',
'\u4611',
'\u4612',
'\u4613',
'\u4614',
'\u4615',
'\u4616',
'\u4617',
'\u4618',
'\u4619',
'\u461A',
'\u461B',
'\u461C',
'\u461D',
'\u461E',
'\u461F',
'\u4620',
'\u4621',
'\u4622',
'\u4623',
'\u4624',
'\u4625',
'\u4626',
'\u4627',
'\u4628',
'\u4629',
'\u462A',
'\u462B',
'\u462C',
'\u462D',
'\u462E',
'\u462F',
'\u4630',
'\u4631',
'\u4632',
'\u4633',
'\u4634',
'\u4635',
'\u4636',
'\u4637',
'\u4638',
'\u4639',
'\u463A',
'\u463B',
'\u463C',
'\u463D',
'\u463E',
'\u463F',
'\u4640',
'\u4641',
'\u4642',
'\u4643',
'\u4644',
'\u4645',
'\u4646',
'\u4647',
'\u4648',
'\u4649',
'\u464A',
'\u464B',
'\u464C',
'\u464D',
'\u464E',
'\u464F',
'\u4650',
'\u4651',
'\u4652',
'\u4653',
'\u4654',
'\u4655',
'\u4656',
'\u4657',
'\u4658',
'\u4659',
'\u465A',
'\u465B',
'\u465C',
'\u465D',
'\u465E',
'\u465F',
'\u4660',
'\u4661',
'\u4662',
'\u4663',
'\u4664',
'\u4665',
'\u4666',
'\u4667',
'\u4668',
'\u4669',
'\u466A',
'\u466B',
'\u466C',
'\u466D',
'\u466E',
'\u466F',
'\u4670',
'\u4671',
'\u4672',
'\u4673',
'\u4674',
'\u4675',
'\u4676',
'\u4677',
'\u4678',
'\u4679',
'\u467A',
'\u467B',
'\u467C',
'\u467D',
'\u467E',
'\u467F',
'\u4680',
'\u4681',
'\u4682',
'\u4683',
'\u4684',
'\u4685',
'\u4686',
'\u4687',
'\u4688',
'\u4689',
'\u468A',
'\u468B',
'\u468C',
'\u468D',
'\u468E',
'\u468F',
'\u4690',
'\u4691',
'\u4692',
'\u4693',
'\u4694',
'\u4695',
'\u4696',
'\u4697',
'\u4698',
'\u4699',
'\u469A',
'\u469B',
'\u469C',
'\u469D',
'\u469E',
'\u469F',
'\u46A0',
'\u46A1',
'\u46A2',
'\u46A3',
'\u46A4',
'\u46A5',
'\u46A6',
'\u46A7',
'\u46A8',
'\u46A9',
'\u46AA',
'\u46AB',
'\u46AC',
'\u46AD',
'\u46AE',
'\u46AF',
'\u46B0',
'\u46B1',
'\u46B2',
'\u46B3',
'\u46B4',
'\u46B5',
'\u46B6',
'\u46B7',
'\u46B8',
'\u46B9',
'\u46BA',
'\u46BB',
'\u46BC',
'\u46BD',
'\u46BE',
'\u46BF',
'\u46C0',
'\u46C1',
'\u46C2',
'\u46C3',
'\u46C4',
'\u46C5',
'\u46C6',
'\u46C7',
'\u46C8',
'\u46C9',
'\u46CA',
'\u46CB',
'\u46CC',
'\u46CD',
'\u46CE',
'\u46CF',
'\u46D0',
'\u46D1',
'\u46D2',
'\u46D3',
'\u46D4',
'\u46D5',
'\u46D6',
'\u46D7',
'\u46D8',
'\u46D9',
'\u46DA',
'\u46DB',
'\u46DC',
'\u46DD',
'\u46DE',
'\u46DF',
'\u46E0',
'\u46E1',
'\u46E2',
'\u46E3',
'\u46E4',
'\u46E5',
'\u46E6',
'\u46E7',
'\u46E8',
'\u46E9',
'\u46EA',
'\u46EB',
'\u46EC',
'\u46ED',
'\u46EE',
'\u46EF',
'\u46F0',
'\u46F1',
'\u46F2',
'\u46F3',
'\u46F4',
'\u46F5',
'\u46F6',
'\u46F7',
'\u46F8',
'\u46F9',
'\u46FA',
'\u46FB',
'\u46FC',
'\u46FD',
'\u46FE',
'\u46FF',
'\u4700',
'\u4701',
'\u4702',
'\u4703',
'\u4704',
'\u4705',
'\u4706',
'\u4707',
'\u4708',
'\u4709',
'\u470A',
'\u470B',
'\u470C',
'\u470D',
'\u470E',
'\u470F',
'\u4710',
'\u4711',
'\u4712',
'\u4713',
'\u4714',
'\u4715',
'\u4716',
'\u4717',
'\u4718',
'\u4719',
'\u471A',
'\u471B',
'\u471C',
'\u471D',
'\u471E',
'\u471F',
'\u4720',
'\u4721',
'\u4722',
'\u4723',
'\u4724',
'\u4725',
'\u4726',
'\u4727',
'\u4728',
'\u4729',
'\u472A',
'\u472B',
'\u472C',
'\u472D',
'\u472E',
'\u472F',
'\u4730',
'\u4731',
'\u4732',
'\u4733',
'\u4734',
'\u4735',
'\u4736',
'\u4737',
'\u4738',
'\u4739',
'\u473A',
'\u473B',
'\u473C',
'\u473D',
'\u473E',
'\u473F',
'\u4740',
'\u4741',
'\u4742',
'\u4743',
'\u4744',
'\u4745',
'\u4746',
'\u4747',
'\u4748',
'\u4749',
'\u474A',
'\u474B',
'\u474C',
'\u474D',
'\u474E',
'\u474F',
'\u4750',
'\u4751',
'\u4752',
'\u4753',
'\u4754',
'\u4755',
'\u4756',
'\u4757',
'\u4758',
'\u4759',
'\u475A',
'\u475B',
'\u475C',
'\u475D',
'\u475E',
'\u475F',
'\u4760',
'\u4761',
'\u4762',
'\u4763',
'\u4764',
'\u4765',
'\u4766',
'\u4767',
'\u4768',
'\u4769',
'\u476A',
'\u476B',
'\u476C',
'\u476D',
'\u476E',
'\u476F',
'\u4770',
'\u4771',
'\u4772',
'\u4773',
'\u4774',
'\u4775',
'\u4776',
'\u4777',
'\u4778',
'\u4779',
'\u477A',
'\u477B',
'\u477C',
'\u477D',
'\u477E',
'\u477F',
'\u4780',
'\u4781',
'\u4782',
'\u4783',
'\u4784',
'\u4785',
'\u4786',
'\u4787',
'\u4788',
'\u4789',
'\u478A',
'\u478B',
'\u478C',
'\u478D',
'\u478E',
'\u478F',
'\u4790',
'\u4791',
'\u4792',
'\u4793',
'\u4794',
'\u4795',
'\u4796',
'\u4797',
'\u4798',
'\u4799',
'\u479A',
'\u479B',
'\u479C',
'\u479D',
'\u479E',
'\u479F',
'\u47A0',
'\u47A1',
'\u47A2',
'\u47A3',
'\u47A4',
'\u47A5',
'\u47A6',
'\u47A7',
'\u47A8',
'\u47A9',
'\u47AA',
'\u47AB',
'\u47AC',
'\u47AD',
'\u47AE',
'\u47AF',
'\u47B0',
'\u47B1',
'\u47B2',
'\u47B3',
'\u47B4',
'\u47B5',
'\u47B6',
'\u47B7',
'\u47B8',
'\u47B9',
'\u47BA',
'\u47BB',
'\u47BC',
'\u47BD',
'\u47BE',
'\u47BF',
'\u47C0',
'\u47C1',
'\u47C2',
'\u47C3',
'\u47C4',
'\u47C5',
'\u47C6',
'\u47C7',
'\u47C8',
'\u47C9',
'\u47CA',
'\u47CB',
'\u47CC',
'\u47CD',
'\u47CE',
'\u47CF',
'\u47D0',
'\u47D1',
'\u47D2',
'\u47D3',
'\u47D4',
'\u47D5',
'\u47D6',
'\u47D7',
'\u47D8',
'\u47D9',
'\u47DA',
'\u47DB',
'\u47DC',
'\u47DD',
'\u47DE',
'\u47DF',
'\u47E0',
'\u47E1',
'\u47E2',
'\u47E3',
'\u47E4',
'\u47E5',
'\u47E6',
'\u47E7',
'\u47E8',
'\u47E9',
'\u47EA',
'\u47EB',
'\u47EC',
'\u47ED',
'\u47EE',
'\u47EF',
'\u47F0',
'\u47F1',
'\u47F2',
'\u47F3',
'\u47F4',
'\u47F5',
'\u47F6',
'\u47F7',
'\u47F8',
'\u47F9',
'\u47FA',
'\u47FB',
'\u47FC',
'\u47FD',
'\u47FE',
'\u47FF',
'\u4800',
'\u4801',
'\u4802',
'\u4803',
'\u4804',
'\u4805',
'\u4806',
'\u4807',
'\u4808',
'\u4809',
'\u480A',
'\u480B',
'\u480C',
'\u480D',
'\u480E',
'\u480F',
'\u4810',
'\u4811',
'\u4812',
'\u4813',
'\u4814',
'\u4815',
'\u4816',
'\u4817',
'\u4818',
'\u4819',
'\u481A',
'\u481B',
'\u481C',
'\u481D',
'\u481E',
'\u481F',
'\u4820',
'\u4821',
'\u4822',
'\u4823',
'\u4824',
'\u4825',
'\u4826',
'\u4827',
'\u4828',
'\u4829',
'\u482A',
'\u482B',
'\u482C',
'\u482D',
'\u482E',
'\u482F',
'\u4830',
'\u4831',
'\u4832',
'\u4833',
'\u4834',
'\u4835',
'\u4836',
'\u4837',
'\u4838',
'\u4839',
'\u483A',
'\u483B',
'\u483C',
'\u483D',
'\u483E',
'\u483F',
'\u4840',
'\u4841',
'\u4842',
'\u4843',
'\u4844',
'\u4845',
'\u4846',
'\u4847',
'\u4848',
'\u4849',
'\u484A',
'\u484B',
'\u484C',
'\u484D',
'\u484E',
'\u484F',
'\u4850',
'\u4851',
'\u4852',
'\u4853',
'\u4854',
'\u4855',
'\u4856',
'\u4857',
'\u4858',
'\u4859',
'\u485A',
'\u485B',
'\u485C',
'\u485D',
'\u485E',
'\u485F',
'\u4860',
'\u4861',
'\u4862',
'\u4863',
'\u4864',
'\u4865',
'\u4866',
'\u4867',
'\u4868',
'\u4869',
'\u486A',
'\u486B',
'\u486C',
'\u486D',
'\u486E',
'\u486F',
'\u4870',
'\u4871',
'\u4872',
'\u4873',
'\u4874',
'\u4875',
'\u4876',
'\u4877',
'\u4878',
'\u4879',
'\u487A',
'\u487B',
'\u487C',
'\u487D',
'\u487E',
'\u487F',
'\u4880',
'\u4881',
'\u4882',
'\u4883',
'\u4884',
'\u4885',
'\u4886',
'\u4887',
'\u4888',
'\u4889',
'\u488A',
'\u488B',
'\u488C',
'\u488D',
'\u488E',
'\u488F',
'\u4890',
'\u4891',
'\u4892',
'\u4893',
'\u4894',
'\u4895',
'\u4896',
'\u4897',
'\u4898',
'\u4899',
'\u489A',
'\u489B',
'\u489C',
'\u489D',
'\u489E',
'\u489F',
'\u48A0',
'\u48A1',
'\u48A2',
'\u48A3',
'\u48A4',
'\u48A5',
'\u48A6',
'\u48A7',
'\u48A8',
'\u48A9',
'\u48AA',
'\u48AB',
'\u48AC',
'\u48AD',
'\u48AE',
'\u48AF',
'\u48B0',
'\u48B1',
'\u48B2',
'\u48B3',
'\u48B4',
'\u48B5',
'\u48B6',
'\u48B7',
'\u48B8',
'\u48B9',
'\u48BA',
'\u48BB',
'\u48BC',
'\u48BD',
'\u48BE',
'\u48BF',
'\u48C0',
'\u48C1',
'\u48C2',
'\u48C3',
'\u48C4',
'\u48C5',
'\u48C6',
'\u48C7',
'\u48C8',
'\u48C9',
'\u48CA',
'\u48CB',
'\u48CC',
'\u48CD',
'\u48CE',
'\u48CF',
'\u48D0',
'\u48D1',
'\u48D2',
'\u48D3',
'\u48D4',
'\u48D5',
'\u48D6',
'\u48D7',
'\u48D8',
'\u48D9',
'\u48DA',
'\u48DB',
'\u48DC',
'\u48DD',
'\u48DE',
'\u48DF',
'\u48E0',
'\u48E1',
'\u48E2',
'\u48E3',
'\u48E4',
'\u48E5',
'\u48E6',
'\u48E7',
'\u48E8',
'\u48E9',
'\u48EA',
'\u48EB',
'\u48EC',
'\u48ED',
'\u48EE',
'\u48EF',
'\u48F0',
'\u48F1',
'\u48F2',
'\u48F3',
'\u48F4',
'\u48F5',
'\u48F6',
'\u48F7',
'\u48F8',
'\u48F9',
'\u48FA',
'\u48FB',
'\u48FC',
'\u48FD',
'\u48FE',
'\u48FF',
'\u4900',
'\u4901',
'\u4902',
'\u4903',
'\u4904',
'\u4905',
'\u4906',
'\u4907',
'\u4908',
'\u4909',
'\u490A',
'\u490B',
'\u490C',
'\u490D',
'\u490E',
'\u490F',
'\u4910',
'\u4911',
'\u4912',
'\u4913',
'\u4914',
'\u4915',
'\u4916',
'\u4917',
'\u4918',
'\u4919',
'\u491A',
'\u491B',
'\u491C',
'\u491D',
'\u491E',
'\u491F',
'\u4920',
'\u4921',
'\u4922',
'\u4923',
'\u4924',
'\u4925',
'\u4926',
'\u4927',
'\u4928',
'\u4929',
'\u492A',
'\u492B',
'\u492C',
'\u492D',
'\u492E',
'\u492F',
'\u4930',
'\u4931',
'\u4932',
'\u4933',
'\u4934',
'\u4935',
'\u4936',
'\u4937',
'\u4938',
'\u4939',
'\u493A',
'\u493B',
'\u493C',
'\u493D',
'\u493E',
'\u493F',
'\u4940',
'\u4941',
'\u4942',
'\u4943',
'\u4944',
'\u4945',
'\u4946',
'\u4947',
'\u4948',
'\u4949',
'\u494A',
'\u494B',
'\u494C',
'\u494D',
'\u494E',
'\u494F',
'\u4950',
'\u4951',
'\u4952',
'\u4953',
'\u4954',
'\u4955',
'\u4956',
'\u4957',
'\u4958',
'\u4959',
'\u495A',
'\u495B',
'\u495C',
'\u495D',
'\u495E',
'\u495F',
'\u4960',
'\u4961',
'\u4962',
'\u4963',
'\u4964',
'\u4965',
'\u4966',
'\u4967',
'\u4968',
'\u4969',
'\u496A',
'\u496B',
'\u496C',
'\u496D',
'\u496E',
'\u496F',
'\u4970',
'\u4971',
'\u4972',
'\u4973',
'\u4974',
'\u4975',
'\u4976',
'\u4977',
'\u4978',
'\u4979',
'\u497A',
'\u497B',
'\u497C',
'\u497D',
'\u497E',
'\u497F',
'\u4980',
'\u4981',
'\u4982',
'\u4983',
'\u4984',
'\u4985',
'\u4986',
'\u4987',
'\u4988',
'\u4989',
'\u498A',
'\u498B',
'\u498C',
'\u498D',
'\u498E',
'\u498F',
'\u4990',
'\u4991',
'\u4992',
'\u4993',
'\u4994',
'\u4995',
'\u4996',
'\u4997',
'\u4998',
'\u4999',
'\u499A',
'\u499B',
'\u499C',
'\u499D',
'\u499E',
'\u499F',
'\u49A0',
'\u49A1',
'\u49A2',
'\u49A3',
'\u49A4',
'\u49A5',
'\u49A6',
'\u49A7',
'\u49A8',
'\u49A9',
'\u49AA',
'\u49AB',
'\u49AC',
'\u49AD',
'\u49AE',
'\u49AF',
'\u49B0',
'\u49B1',
'\u49B2',
'\u49B3',
'\u49B4',
'\u49B5',
'\u49B6',
'\u49B7',
'\u49B8',
'\u49B9',
'\u49BA',
'\u49BB',
'\u49BC',
'\u49BD',
'\u49BE',
'\u49BF',
'\u49C0',
'\u49C1',
'\u49C2',
'\u49C3',
'\u49C4',
'\u49C5',
'\u49C6',
'\u49C7',
'\u49C8',
'\u49C9',
'\u49CA',
'\u49CB',
'\u49CC',
'\u49CD',
'\u49CE',
'\u49CF',
'\u49D0',
'\u49D1',
'\u49D2',
'\u49D3',
'\u49D4',
'\u49D5',
'\u49D6',
'\u49D7',
'\u49D8',
'\u49D9',
'\u49DA',
'\u49DB',
'\u49DC',
'\u49DD',
'\u49DE',
'\u49DF',
'\u49E0',
'\u49E1',
'\u49E2',
'\u49E3',
'\u49E4',
'\u49E5',
'\u49E6',
'\u49E7',
'\u49E8',
'\u49E9',
'\u49EA',
'\u49EB',
'\u49EC',
'\u49ED',
'\u49EE',
'\u49EF',
'\u49F0',
'\u49F1',
'\u49F2',
'\u49F3',
'\u49F4',
'\u49F5',
'\u49F6',
'\u49F7',
'\u49F8',
'\u49F9',
'\u49FA',
'\u49FB',
'\u49FC',
'\u49FD',
'\u49FE',
'\u49FF',
'\u4A00',
'\u4A01',
'\u4A02',
'\u4A03',
'\u4A04',
'\u4A05',
'\u4A06',
'\u4A07',
'\u4A08',
'\u4A09',
'\u4A0A',
'\u4A0B',
'\u4A0C',
'\u4A0D',
'\u4A0E',
'\u4A0F',
'\u4A10',
'\u4A11',
'\u4A12',
'\u4A13',
'\u4A14',
'\u4A15',
'\u4A16',
'\u4A17',
'\u4A18',
'\u4A19',
'\u4A1A',
'\u4A1B',
'\u4A1C',
'\u4A1D',
'\u4A1E',
'\u4A1F',
'\u4A20',
'\u4A21',
'\u4A22',
'\u4A23',
'\u4A24',
'\u4A25',
'\u4A26',
'\u4A27',
'\u4A28',
'\u4A29',
'\u4A2A',
'\u4A2B',
'\u4A2C',
'\u4A2D',
'\u4A2E',
'\u4A2F',
'\u4A30',
'\u4A31',
'\u4A32',
'\u4A33',
'\u4A34',
'\u4A35',
'\u4A36',
'\u4A37',
'\u4A38',
'\u4A39',
'\u4A3A',
'\u4A3B',
'\u4A3C',
'\u4A3D',
'\u4A3E',
'\u4A3F',
'\u4A40',
'\u4A41',
'\u4A42',
'\u4A43',
'\u4A44',
'\u4A45',
'\u4A46',
'\u4A47',
'\u4A48',
'\u4A49',
'\u4A4A',
'\u4A4B',
'\u4A4C',
'\u4A4D',
'\u4A4E',
'\u4A4F',
'\u4A50',
'\u4A51',
'\u4A52',
'\u4A53',
'\u4A54',
'\u4A55',
'\u4A56',
'\u4A57',
'\u4A58',
'\u4A59',
'\u4A5A',
'\u4A5B',
'\u4A5C',
'\u4A5D',
'\u4A5E',
'\u4A5F',
'\u4A60',
'\u4A61',
'\u4A62',
'\u4A63',
'\u4A64',
'\u4A65',
'\u4A66',
'\u4A67',
'\u4A68',
'\u4A69',
'\u4A6A',
'\u4A6B',
'\u4A6C',
'\u4A6D',
'\u4A6E',
'\u4A6F',
'\u4A70',
'\u4A71',
'\u4A72',
'\u4A73',
'\u4A74',
'\u4A75',
'\u4A76',
'\u4A77',
'\u4A78',
'\u4A79',
'\u4A7A',
'\u4A7B',
'\u4A7C',
'\u4A7D',
'\u4A7E',
'\u4A7F',
'\u4A80',
'\u4A81',
'\u4A82',
'\u4A83',
'\u4A84',
'\u4A85',
'\u4A86',
'\u4A87',
'\u4A88',
'\u4A89',
'\u4A8A',
'\u4A8B',
'\u4A8C',
'\u4A8D',
'\u4A8E',
'\u4A8F',
'\u4A90',
'\u4A91',
'\u4A92',
'\u4A93',
'\u4A94',
'\u4A95',
'\u4A96',
'\u4A97',
'\u4A98',
'\u4A99',
'\u4A9A',
'\u4A9B',
'\u4A9C',
'\u4A9D',
'\u4A9E',
'\u4A9F',
'\u4AA0',
'\u4AA1',
'\u4AA2',
'\u4AA3',
'\u4AA4',
'\u4AA5',
'\u4AA6',
'\u4AA7',
'\u4AA8',
'\u4AA9',
'\u4AAA',
'\u4AAB',
'\u4AAC',
'\u4AAD',
'\u4AAE',
'\u4AAF',
'\u4AB0',
'\u4AB1',
'\u4AB2',
'\u4AB3',
'\u4AB4',
'\u4AB5',
'\u4AB6',
'\u4AB7',
'\u4AB8',
'\u4AB9',
'\u4ABA',
'\u4ABB',
'\u4ABC',
'\u4ABD',
'\u4ABE',
'\u4ABF',
'\u4AC0',
'\u4AC1',
'\u4AC2',
'\u4AC3',
'\u4AC4',
'\u4AC5',
'\u4AC6',
'\u4AC7',
'\u4AC8',
'\u4AC9',
'\u4ACA',
'\u4ACB',
'\u4ACC',
'\u4ACD',
'\u4ACE',
'\u4ACF',
'\u4AD0',
'\u4AD1',
'\u4AD2',
'\u4AD3',
'\u4AD4',
'\u4AD5',
'\u4AD6',
'\u4AD7',
'\u4AD8',
'\u4AD9',
'\u4ADA',
'\u4ADB',
'\u4ADC',
'\u4ADD',
'\u4ADE',
'\u4ADF',
'\u4AE0',
'\u4AE1',
'\u4AE2',
'\u4AE3',
'\u4AE4',
'\u4AE5',
'\u4AE6',
'\u4AE7',
'\u4AE8',
'\u4AE9',
'\u4AEA',
'\u4AEB',
'\u4AEC',
'\u4AED',
'\u4AEE',
'\u4AEF',
'\u4AF0',
'\u4AF1',
'\u4AF2',
'\u4AF3',
'\u4AF4',
'\u4AF5',
'\u4AF6',
'\u4AF7',
'\u4AF8',
'\u4AF9',
'\u4AFA',
'\u4AFB',
'\u4AFC',
'\u4AFD',
'\u4AFE',
'\u4AFF',
'\u4B00',
'\u4B01',
'\u4B02',
'\u4B03',
'\u4B04',
'\u4B05',
'\u4B06',
'\u4B07',
'\u4B08',
'\u4B09',
'\u4B0A',
'\u4B0B',
'\u4B0C',
'\u4B0D',
'\u4B0E',
'\u4B0F',
'\u4B10',
'\u4B11',
'\u4B12',
'\u4B13',
'\u4B14',
'\u4B15',
'\u4B16',
'\u4B17',
'\u4B18',
'\u4B19',
'\u4B1A',
'\u4B1B',
'\u4B1C',
'\u4B1D',
'\u4B1E',
'\u4B1F',
'\u4B20',
'\u4B21',
'\u4B22',
'\u4B23',
'\u4B24',
'\u4B25',
'\u4B26',
'\u4B27',
'\u4B28',
'\u4B29',
'\u4B2A',
'\u4B2B',
'\u4B2C',
'\u4B2D',
'\u4B2E',
'\u4B2F',
'\u4B30',
'\u4B31',
'\u4B32',
'\u4B33',
'\u4B34',
'\u4B35',
'\u4B36',
'\u4B37',
'\u4B38',
'\u4B39',
'\u4B3A',
'\u4B3B',
'\u4B3C',
'\u4B3D',
'\u4B3E',
'\u4B3F',
'\u4B40',
'\u4B41',
'\u4B42',
'\u4B43',
'\u4B44',
'\u4B45',
'\u4B46',
'\u4B47',
'\u4B48',
'\u4B49',
'\u4B4A',
'\u4B4B',
'\u4B4C',
'\u4B4D',
'\u4B4E',
'\u4B4F',
'\u4B50',
'\u4B51',
'\u4B52',
'\u4B53',
'\u4B54',
'\u4B55',
'\u4B56',
'\u4B57',
'\u4B58',
'\u4B59',
'\u4B5A',
'\u4B5B',
'\u4B5C',
'\u4B5D',
'\u4B5E',
'\u4B5F',
'\u4B60',
'\u4B61',
'\u4B62',
'\u4B63',
'\u4B64',
'\u4B65',
'\u4B66',
'\u4B67',
'\u4B68',
'\u4B69',
'\u4B6A',
'\u4B6B',
'\u4B6C',
'\u4B6D',
'\u4B6E',
'\u4B6F',
'\u4B70',
'\u4B71',
'\u4B72',
'\u4B73',
'\u4B74',
'\u4B75',
'\u4B76',
'\u4B77',
'\u4B78',
'\u4B79',
'\u4B7A',
'\u4B7B',
'\u4B7C',
'\u4B7D',
'\u4B7E',
'\u4B7F',
'\u4B80',
'\u4B81',
'\u4B82',
'\u4B83',
'\u4B84',
'\u4B85',
'\u4B86',
'\u4B87',
'\u4B88',
'\u4B89',
'\u4B8A',
'\u4B8B',
'\u4B8C',
'\u4B8D',
'\u4B8E',
'\u4B8F',
'\u4B90',
'\u4B91',
'\u4B92',
'\u4B93',
'\u4B94',
'\u4B95',
'\u4B96',
'\u4B97',
'\u4B98',
'\u4B99',
'\u4B9A',
'\u4B9B',
'\u4B9C',
'\u4B9D',
'\u4B9E',
'\u4B9F',
'\u4BA0',
'\u4BA1',
'\u4BA2',
'\u4BA3',
'\u4BA4',
'\u4BA5',
'\u4BA6',
'\u4BA7',
'\u4BA8',
'\u4BA9',
'\u4BAA',
'\u4BAB',
'\u4BAC',
'\u4BAD',
'\u4BAE',
'\u4BAF',
'\u4BB0',
'\u4BB1',
'\u4BB2',
'\u4BB3',
'\u4BB4',
'\u4BB5',
'\u4BB6',
'\u4BB7',
'\u4BB8',
'\u4BB9',
'\u4BBA',
'\u4BBB',
'\u4BBC',
'\u4BBD',
'\u4BBE',
'\u4BBF',
'\u4BC0',
'\u4BC1',
'\u4BC2',
'\u4BC3',
'\u4BC4',
'\u4BC5',
'\u4BC6',
'\u4BC7',
'\u4BC8',
'\u4BC9',
'\u4BCA',
'\u4BCB',
'\u4BCC',
'\u4BCD',
'\u4BCE',
'\u4BCF',
'\u4BD0',
'\u4BD1',
'\u4BD2',
'\u4BD3',
'\u4BD4',
'\u4BD5',
'\u4BD6',
'\u4BD7',
'\u4BD8',
'\u4BD9',
'\u4BDA',
'\u4BDB',
'\u4BDC',
'\u4BDD',
'\u4BDE',
'\u4BDF',
'\u4BE0',
'\u4BE1',
'\u4BE2',
'\u4BE3',
'\u4BE4',
'\u4BE5',
'\u4BE6',
'\u4BE7',
'\u4BE8',
'\u4BE9',
'\u4BEA',
'\u4BEB',
'\u4BEC',
'\u4BED',
'\u4BEE',
'\u4BEF',
'\u4BF0',
'\u4BF1',
'\u4BF2',
'\u4BF3',
'\u4BF4',
'\u4BF5',
'\u4BF6',
'\u4BF7',
'\u4BF8',
'\u4BF9',
'\u4BFA',
'\u4BFB',
'\u4BFC',
'\u4BFD',
'\u4BFE',
'\u4BFF',
'\u4C00',
'\u4C01',
'\u4C02',
'\u4C03',
'\u4C04',
'\u4C05',
'\u4C06',
'\u4C07',
'\u4C08',
'\u4C09',
'\u4C0A',
'\u4C0B',
'\u4C0C',
'\u4C0D',
'\u4C0E',
'\u4C0F',
'\u4C10',
'\u4C11',
'\u4C12',
'\u4C13',
'\u4C14',
'\u4C15',
'\u4C16',
'\u4C17',
'\u4C18',
'\u4C19',
'\u4C1A',
'\u4C1B',
'\u4C1C',
'\u4C1D',
'\u4C1E',
'\u4C1F',
'\u4C20',
'\u4C21',
'\u4C22',
'\u4C23',
'\u4C24',
'\u4C25',
'\u4C26',
'\u4C27',
'\u4C28',
'\u4C29',
'\u4C2A',
'\u4C2B',
'\u4C2C',
'\u4C2D',
'\u4C2E',
'\u4C2F',
'\u4C30',
'\u4C31',
'\u4C32',
'\u4C33',
'\u4C34',
'\u4C35',
'\u4C36',
'\u4C37',
'\u4C38',
'\u4C39',
'\u4C3A',
'\u4C3B',
'\u4C3C',
'\u4C3D',
'\u4C3E',
'\u4C3F',
'\u4C40',
'\u4C41',
'\u4C42',
'\u4C43',
'\u4C44',
'\u4C45',
'\u4C46',
'\u4C47',
'\u4C48',
'\u4C49',
'\u4C4A',
'\u4C4B',
'\u4C4C',
'\u4C4D',
'\u4C4E',
'\u4C4F',
'\u4C50',
'\u4C51',
'\u4C52',
'\u4C53',
'\u4C54',
'\u4C55',
'\u4C56',
'\u4C57',
'\u4C58',
'\u4C59',
'\u4C5A',
'\u4C5B',
'\u4C5C',
'\u4C5D',
'\u4C5E',
'\u4C5F',
'\u4C60',
'\u4C61',
'\u4C62',
'\u4C63',
'\u4C64',
'\u4C65',
'\u4C66',
'\u4C67',
'\u4C68',
'\u4C69',
'\u4C6A',
'\u4C6B',
'\u4C6C',
'\u4C6D',
'\u4C6E',
'\u4C6F',
'\u4C70',
'\u4C71',
'\u4C72',
'\u4C73',
'\u4C74',
'\u4C75',
'\u4C76',
'\u4C77',
'\u4C78',
'\u4C79',
'\u4C7A',
'\u4C7B',
'\u4C7C',
'\u4C7D',
'\u4C7E',
'\u4C7F',
'\u4C80',
'\u4C81',
'\u4C82',
'\u4C83',
'\u4C84',
'\u4C85',
'\u4C86',
'\u4C87',
'\u4C88',
'\u4C89',
'\u4C8A',
'\u4C8B',
'\u4C8C',
'\u4C8D',
'\u4C8E',
'\u4C8F',
'\u4C90',
'\u4C91',
'\u4C92',
'\u4C93',
'\u4C94',
'\u4C95',
'\u4C96',
'\u4C97',
'\u4C98',
'\u4C99',
'\u4C9A',
'\u4C9B',
'\u4C9C',
'\u4C9D',
'\u4C9E',
'\u4C9F',
'\u4CA0',
'\u4CA1',
'\u4CA2',
'\u4CA3',
'\u4CA4',
'\u4CA5',
'\u4CA6',
'\u4CA7',
'\u4CA8',
'\u4CA9',
'\u4CAA',
'\u4CAB',
'\u4CAC',
'\u4CAD',
'\u4CAE',
'\u4CAF',
'\u4CB0',
'\u4CB1',
'\u4CB2',
'\u4CB3',
'\u4CB4',
'\u4CB5',
'\u4CB6',
'\u4CB7',
'\u4CB8',
'\u4CB9',
'\u4CBA',
'\u4CBB',
'\u4CBC',
'\u4CBD',
'\u4CBE',
'\u4CBF',
'\u4CC0',
'\u4CC1',
'\u4CC2',
'\u4CC3',
'\u4CC4',
'\u4CC5',
'\u4CC6',
'\u4CC7',
'\u4CC8',
'\u4CC9',
'\u4CCA',
'\u4CCB',
'\u4CCC',
'\u4CCD',
'\u4CCE',
'\u4CCF',
'\u4CD0',
'\u4CD1',
'\u4CD2',
'\u4CD3',
'\u4CD4',
'\u4CD5',
'\u4CD6',
'\u4CD7',
'\u4CD8',
'\u4CD9',
'\u4CDA',
'\u4CDB',
'\u4CDC',
'\u4CDD',
'\u4CDE',
'\u4CDF',
'\u4CE0',
'\u4CE1',
'\u4CE2',
'\u4CE3',
'\u4CE4',
'\u4CE5',
'\u4CE6',
'\u4CE7',
'\u4CE8',
'\u4CE9',
'\u4CEA',
'\u4CEB',
'\u4CEC',
'\u4CED',
'\u4CEE',
'\u4CEF',
'\u4CF0',
'\u4CF1',
'\u4CF2',
'\u4CF3',
'\u4CF4',
'\u4CF5',
'\u4CF6',
'\u4CF7',
'\u4CF8',
'\u4CF9',
'\u4CFA',
'\u4CFB',
'\u4CFC',
'\u4CFD',
'\u4CFE',
'\u4CFF',
'\u4D00',
'\u4D01',
'\u4D02',
'\u4D03',
'\u4D04',
'\u4D05',
'\u4D06',
'\u4D07',
'\u4D08',
'\u4D09',
'\u4D0A',
'\u4D0B',
'\u4D0C',
'\u4D0D',
'\u4D0E',
'\u4D0F',
'\u4D10',
'\u4D11',
'\u4D12',
'\u4D13',
'\u4D14',
'\u4D15',
'\u4D16',
'\u4D17',
'\u4D18',
'\u4D19',
'\u4D1A',
'\u4D1B',
'\u4D1C',
'\u4D1D',
'\u4D1E',
'\u4D1F',
'\u4D20',
'\u4D21',
'\u4D22',
'\u4D23',
'\u4D24',
'\u4D25',
'\u4D26',
'\u4D27',
'\u4D28',
'\u4D29',
'\u4D2A',
'\u4D2B',
'\u4D2C',
'\u4D2D',
'\u4D2E',
'\u4D2F',
'\u4D30',
'\u4D31',
'\u4D32',
'\u4D33',
'\u4D34',
'\u4D35',
'\u4D36',
'\u4D37',
'\u4D38',
'\u4D39',
'\u4D3A',
'\u4D3B',
'\u4D3C',
'\u4D3D',
'\u4D3E',
'\u4D3F',
'\u4D40',
'\u4D41',
'\u4D42',
'\u4D43',
'\u4D44',
'\u4D45',
'\u4D46',
'\u4D47',
'\u4D48',
'\u4D49',
'\u4D4A',
'\u4D4B',
'\u4D4C',
'\u4D4D',
'\u4D4E',
'\u4D4F',
'\u4D50',
'\u4D51',
'\u4D52',
'\u4D53',
'\u4D54',
'\u4D55',
'\u4D56',
'\u4D57',
'\u4D58',
'\u4D59',
'\u4D5A',
'\u4D5B',
'\u4D5C',
'\u4D5D',
'\u4D5E',
'\u4D5F',
'\u4D60',
'\u4D61',
'\u4D62',
'\u4D63',
'\u4D64',
'\u4D65',
'\u4D66',
'\u4D67',
'\u4D68',
'\u4D69',
'\u4D6A',
'\u4D6B',
'\u4D6C',
'\u4D6D',
'\u4D6E',
'\u4D6F',
'\u4D70',
'\u4D71',
'\u4D72',
'\u4D73',
'\u4D74',
'\u4D75',
'\u4D76',
'\u4D77',
'\u4D78',
'\u4D79',
'\u4D7A',
'\u4D7B',
'\u4D7C',
'\u4D7D',
'\u4D7E',
'\u4D7F',
'\u4D80',
'\u4D81',
'\u4D82',
'\u4D83',
'\u4D84',
'\u4D85',
'\u4D86',
'\u4D87',
'\u4D88',
'\u4D89',
'\u4D8A',
'\u4D8B',
'\u4D8C',
'\u4D8D',
'\u4D8E',
'\u4D8F',
'\u4D90',
'\u4D91',
'\u4D92',
'\u4D93',
'\u4D94',
'\u4D95',
'\u4D96',
'\u4D97',
'\u4D98',
'\u4D99',
'\u4D9A',
'\u4D9B',
'\u4D9C',
'\u4D9D',
'\u4D9E',
'\u4D9F',
'\u4DA0',
'\u4DA1',
'\u4DA2',
'\u4DA3',
'\u4DA4',
'\u4DA5',
'\u4DA6',
'\u4DA7',
'\u4DA8',
'\u4DA9',
'\u4DAA',
'\u4DAB',
'\u4DAC',
'\u4DAD',
'\u4DAE',
'\u4DAF',
'\u4DB0',
'\u4DB1',
'\u4DB2',
'\u4DB3',
'\u4DB4',
'\u4DB5',
'\u4DB6',
'\u4DB7',
'\u4DB8',
'\u4DB9',
'\u4DBA',
'\u4DBB',
'\u4DBC',
'\u4DBD',
'\u4DBE',
'\u4DBF'
]; | mit |
davidespihernandez/energy_market | public/modules/core/config/core.client.config.js | 1906 | 'use strict';
// Configuring the Core module
angular.module('core').run(['Menus',
function(Menus) {
// Add default menu entry
Menus.addMenuItem('sidebar', 'Dashboard', 'dashboard', null, '/dashboard', true, null, null, 'icon-speedometer'); //false -> non public
Menus.addSubMenuItem('sidebar', 'dashboard', 'Normal dashboard', 'dashboard');
Menus.addSubMenuItem('sidebar', 'dashboard', 'Kibana dashboard', 'kibana');
}
]).config(['$ocLazyLoadProvider', 'APP_REQUIRES', function ($ocLazyLoadProvider, APP_REQUIRES) {
// Lazy Load modules configuration
$ocLazyLoadProvider.config({
debug: false,
events: true,
modules: APP_REQUIRES.modules
});
}]).config(['$controllerProvider', '$compileProvider', '$filterProvider', '$provide',
function ( $controllerProvider, $compileProvider, $filterProvider, $provide) {
// registering components after bootstrap
angular.module('core').controller = $controllerProvider.register;
angular.module('core').directive = $compileProvider.directive;
angular.module('core').filter = $filterProvider.register;
angular.module('core').factory = $provide.factory;
angular.module('core').service = $provide.service;
angular.module('core').constant = $provide.constant;
angular.module('core').value = $provide.value;
}]).config(['$translateProvider', function ($translateProvider) {
$translateProvider.useStaticFilesLoader({
prefix : 'modules/core/i18n/',
suffix : '.json'
});
$translateProvider.preferredLanguage('en');
$translateProvider.useLocalStorage();
}])
.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
cfpLoadingBarProvider.includeBar = true;
cfpLoadingBarProvider.includeSpinner = false;
cfpLoadingBarProvider.latencyThreshold = 500;
cfpLoadingBarProvider.parentSelector = '.wrapper > section';
}]);
| mit |
roncli/FusionBot | log.js | 3902 | const util = require("util"),
queue = [];
/**
* @type {typeof import("./discord")}
*/
let Discord;
// #
// #
// # ### ## #
// # # # # #
// # # # ##
// # # # #
// ##### ### ###
// # #
// ###
/**
* A class that handles logging.
*/
class Log {
// ##
// #
// # ## ###
// # # # # #
// # # # ##
// ### ## #
// ###
/**
* Logs a message.
* @param {object} obj The object to log.
* @returns {void}
*/
static log(obj) {
queue.push({
type: "log",
date: new Date(),
obj
});
Log.output();
}
// #
//
// # # ### ### ### ## ### ###
// # # # # # # # # # # # # #
// #### # ## # # # # # # ##
// #### # # # # # ### # # #
// ###
/**
* Logs a warning.
* @param {string} message The string to log.
* @returns {void}
*/
static warning(message) {
queue.push({
type: "warning",
date: new Date(),
message
});
Log.output();
}
// # #
// #
// ## # # ## ## ### ### ## ## ###
// # ## ## # # ## # # # # # # # #
// ## ## # ## # # # # # # # #
// ## # # ## ## ### ## ### ## # #
// #
/**
* Logs an exception.
* @param {string} message The message describing the error.
* @param {object} obj The object to log.
* @returns {void}
*/
static exception(message, obj) {
queue.push({
type: "exception",
date: new Date(),
message,
obj
});
Log.output();
}
// # #
// # #
// ## # # ### ### # # ###
// # # # # # # # # # #
// # # # # # # # # # #
// ## ### ## ### ### ##
// #
/**
* Outputs the log queue.
* @returns {void}
*/
static output() {
if (!Discord) {
Discord = require("./discord");
}
if (Discord.isConnected()) {
const logChannel = Discord.findChannelByName("fusionbot-log"),
errorChannel = Discord.findChannelByName("fusionbot-errors");
queue.forEach((log) => {
const message = {
embed: {
color: log.type === "log" ? 0x80FF80 : log.type === "warning" ? 0xFFFF00 : 0xFF0000,
footer: {"icon_url": Discord.icon, text: "DescentBot"},
fields: [],
timestamp: log.date
}
};
if (log.message) {
({message: message.embed.description} = log);
}
if (log.obj) {
const msg = util.inspect(log.obj);
if (msg.length > 1024) {
Discord.queue(msg, log.type === "exception" ? errorChannel : logChannel);
return;
}
message.embed.fields.push({
name: "Message",
value: msg
});
}
Discord.richQueue(message, log.type === "exception" ? errorChannel : logChannel);
});
queue.splice(0, queue.length);
} else {
console.log(queue[queue.length - 1]);
}
}
}
module.exports = Log;
| mit |
eamodio/vscode-gitlens | src/commands/externalDiff.ts | 5305 | 'use strict';
import { env, SourceControlResourceState, Uri, window } from 'vscode';
import { ScmResource } from '../@types/vscode.git.resources';
import { ScmResourceGroupType, ScmStatus } from '../@types/vscode.git.resources.enums';
import { Container } from '../container';
import { GitRevision } from '../git/git';
import { GitUri } from '../git/gitUri';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { Arrays } from '../system';
import {
command,
Command,
CommandContext,
Commands,
getRepoPathOrPrompt,
isCommandContextViewNodeHasFileCommit,
isCommandContextViewNodeHasFileRefs,
} from './common';
interface ExternalDiffFile {
uri: Uri;
staged: boolean;
ref1?: string;
ref2?: string;
}
export interface ExternalDiffCommandArgs {
files?: ExternalDiffFile[];
}
@command()
export class ExternalDiffCommand extends Command {
constructor() {
super([Commands.ExternalDiff, Commands.ExternalDiffAll]);
}
protected override async preExecute(context: CommandContext, args?: ExternalDiffCommandArgs) {
args = { ...args };
if (isCommandContextViewNodeHasFileCommit(context)) {
const ref1 = GitRevision.isUncommitted(context.node.commit.previousFileSha)
? ''
: context.node.commit.previousFileSha;
const ref2 = context.node.commit.isUncommitted ? '' : context.node.commit.sha;
args.files = [
{
uri: GitUri.fromFile(context.node.file, context.node.file.repoPath ?? context.node.repoPath),
staged: context.node.commit.isUncommittedStaged || context.node.file.indexStatus != null,
ref1: ref1,
ref2: ref2,
},
];
return this.execute(args);
}
if (isCommandContextViewNodeHasFileRefs(context)) {
args.files = [
{
uri: GitUri.fromFile(context.node.file, context.node.file.repoPath ?? context.node.repoPath),
staged: context.node.file.indexStatus != null,
ref1: context.node.ref1,
ref2: context.node.ref2,
},
];
return this.execute(args);
}
if (args.files == null) {
if (context.type === 'scm-states') {
args.files = context.scmResourceStates.map(r => ({
uri: r.resourceUri,
staged: (r as ScmResource).resourceGroupType === ScmResourceGroupType.Index,
}));
} else if (context.type === 'scm-groups') {
args.files = Arrays.filterMap(context.scmResourceGroups[0].resourceStates, r =>
this.isModified(r)
? {
uri: r.resourceUri,
staged: (r as ScmResource).resourceGroupType === ScmResourceGroupType.Index,
}
: undefined,
);
}
}
if (context.command === Commands.ExternalDiffAll) {
if (args.files == null) {
const repoPath = await getRepoPathOrPrompt('Open All Changes (difftool)');
if (!repoPath) return undefined;
const status = await Container.instance.git.getStatusForRepo(repoPath);
if (status == null) {
return window.showInformationMessage("The repository doesn't have any changes");
}
args.files = [];
for (const file of status.files) {
if (file.indexStatus === 'M') {
args.files.push({ uri: file.uri, staged: true });
}
if (file.workingTreeStatus === 'M') {
args.files.push({ uri: file.uri, staged: false });
}
}
}
}
return this.execute(args);
}
private isModified(resource: SourceControlResourceState) {
const status = (resource as ScmResource).type;
return (
status === ScmStatus.BOTH_MODIFIED || status === ScmStatus.INDEX_MODIFIED || status === ScmStatus.MODIFIED
);
}
async execute(args?: ExternalDiffCommandArgs) {
args = { ...args };
try {
let repoPath;
if (args.files == null) {
const editor = window.activeTextEditor;
if (editor == null) return;
repoPath = await Container.instance.git.getRepoPathOrActive(undefined, editor);
if (!repoPath) return;
const uri = editor.document.uri;
const status = await Container.instance.git.getStatusForFile(repoPath, uri.fsPath);
if (status == null) {
void window.showInformationMessage("The current file doesn't have any changes");
return;
}
args.files = [];
if (status.indexStatus === 'M') {
args.files.push({ uri: status.uri, staged: true });
}
if (status.workingTreeStatus === 'M') {
args.files.push({ uri: status.uri, staged: false });
}
} else {
repoPath = await Container.instance.git.getRepoPath(args.files[0].uri.fsPath);
if (!repoPath) return;
}
const tool =
Container.instance.config.advanced.externalDiffTool ||
(await Container.instance.git.getDiffTool(repoPath));
if (!tool) {
const viewDocs = 'View Git Docs';
const result = await window.showWarningMessage(
'Unable to open changes because no Git diff tool is configured',
viewDocs,
);
if (result === viewDocs) {
void env.openExternal(
Uri.parse('https://git-scm.com/docs/git-config#Documentation/git-config.txt-difftool'),
);
}
return;
}
for (const file of args.files) {
void Container.instance.git.openDiffTool(repoPath, file.uri, {
ref1: file.ref1,
ref2: file.ref2,
staged: file.staged,
tool: tool,
});
}
} catch (ex) {
Logger.error(ex, 'ExternalDiffCommand');
void Messages.showGenericErrorMessage('Unable to open changes in diff tool');
}
}
}
| mit |
undees/justplayed | features/step_definitions/snap_steps.rb | 799 | Given /^the following snaps:$/ do
|snaps_table|
app.snaps = snaps_from_table(snaps_table, :with_timestamp)
end
Given /^a current time of (.*)$/ do
|time|
app.time = time
end
When /^I press (.*)$/ do
|station|
app.snap station
end
When /^I look up my snaps$/ do
app.lookup_snaps
end
When /^I restart the app$/ do
app.restart
end
When /^I delete all my snaps$/ do
app.delete_all
end
When /^I (.*) my choice$/ do
|pick|
app.answer('confirm' == pick)
end
Then /^the list of snaps should be empty$/ do
app.snaps.should be_empty
end
Then /^I should see the following snaps:$/ do
|snaps_table|
need_links = snaps_table.headers.include? 'link'
actual = app.snaps.map {|h| h.delete(:link) unless need_links; h}
actual.should == snaps_from_table(snaps_table)
end
| mit |
ISO-tech/sw-d8 | web/2006-1/573/573_03_ChippingAway.php | 4907 | <html>
<head>
<title>
The chipping away of abortion rights
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>
</head>
<body bgcolor="#FFFFCC" text="000000" link="990000" vlink="660000" alink="003366" leftmargin="0" topmargin="0">
<table width="744" cellspacing="0" cellpadding="0" border="0">
<tr><td width="474"><a name="Top"></a><?php include "../../legacy-includes/TopLogo.htmlf" ?></td>
<td width="270"><?php include "../../legacy-includes/TopAd.htmlf" ?>
</td></tr></table>
<table width="744" cellspacing="0" cellpadding="0" border="0">
<tr><td width="18" bgcolor="FFCC66"></td>
<td width="108" bgcolor="FFCC66" valign=top><?php include "../../legacy-includes/LeftButtons.htmlf" ?></td>
<td width="18"></td>
<td width="480" valign="top">
<?php include "../../legacy-includes/BodyInsert.htmlf" ?>
<font face="Arial, Helvetica, sans-serif" size="2"><b>WHAT WE THINK</b></font><br>
<font face="Times New Roman, Times, serif" size="5"><b>The chipping away of abortion rights</b></font><p>
<font face="Arial, Helvetica, sans-serif" size="2">January 27, 2006 | Page 3</font><p>
<font face="Times New Roman, Times, serif" size="3">WITH THE confirmation of George Bush's Supreme Court nominee Samuel Alito all but certain, liberal supporters of a women's right to choose were mourning the looming departure of Justice Sandra Day O'Connor.<p>
But last week, in what will likely be her last Supreme Court opinion, O'Connor showed why she shouldn't be remembered as a defender of the right to choose. What she demonstrated was her willingness to justify the right wing's strategy of chipping away at abortion rights with one restriction after another--while maintaining formally legal abortion.<p>
O'Connor wrote the opinion in the Court's unanimous decision to return a case involving a parental consent law to a lower court that overturned it. The justices agreed with the lower court that the law was unconstitutional because it didn't include a provision for "significant health risks" to the woman. But the Court didn't leave the law struck down. Instead, it ordered the lower court to make a more limited ruling.<p>
The New Hampshire law requires that before a doctor can perform an abortion on a woman under 18 years old, a parent must be notified, followed by a 48-hour waiting period.<p>
In her opinion explaining the Court's unanimous ruling, O'Connor objected to the lack of an exception for the woman's health, but she accepted the other restrictions.<p>
"First," O'Connor wrote, "States unquestionably have the right to require parental involvement when a minor considers terminating her pregnancy." She also took issue with the lower court's decision to strike down the law entirely, calling this a "most blunt remedy."<p>
This is in keeping with O'Connor's record--of being the "swing justice" when the question of overturning legal abortion altogether came up, but joining the right-wing majority in supporting every conceivable restriction on abortion.<p>
Right-wingers hailed the decision. "This is a great victory for the future of parental notification laws," said Tony Perkins, president of the anti-abortion Family Research Council. "This ruling is encouraging and gives great momentum to other states looking to protect parental rights and safeguard the health of underage girls." <p>
But the American Civil Liberties Union and Planned Parenthood Federation of America also hailed it. "We are relieved that the Supreme Court left in place protections for women's health and safety in abortion laws," said Planned Parenthood Interim President Karen Pearl.<p>
Actually, what this decision--and the reaction to it--shows is just how far rightward the debate over women's right to choose has swung.<p>
In the face of the Religious Right's crusade to demonize abortion, the liberal response has been to retreat. Instead of championing a woman's right to control her own body, Democratic Party leaders like Sen. Hillary Rodham Clinton and Democratic National Committee Chair Howard Dean talk about keeping abortions rare.<p>
And when anti-choice politicians push through state-level laws that carve away at abortion rights--so-called "partial birth" bans, parental consent laws and mandatory waiting periods--the Democrats go along with that, too.<p>
This explains why congressional Democrats aren't waging a real fight against super-conservative Samuel Alito--the anti-abortion right winger who will be ruling on parental consent and the futures of millions of teenage girls the next time the issue comes up in the Court.<p>
With her latest decision, O'Connor is passing the torch.<p>
<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>
<td width="12"></td>
<td width="108" valign="top">
<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>
</td>
</tr>
</table>
</body>
</html>
| mit |
Karasiq/scalajs-highcharts | src/main/scala/com/highstock/config/SeriesAreasplinerangeLabelStyle.scala | 943 | /**
* Automatically generated file. Please do not edit.
* @author Highcharts Config Generator by Karasiq
* @see [[http://api.highcharts.com/highstock]]
*/
package com.highstock.config
import scalajs.js, js.`|`
import com.highcharts.CleanJsObject
import com.highcharts.HighchartsUtils._
/**
* @note JavaScript name: <code>series<areasplinerange>-label-style</code>
*/
@js.annotation.ScalaJSDefined
class SeriesAreasplinerangeLabelStyle extends com.highcharts.HighchartsGenericObject {
val fontWeight: js.UndefOr[String] = js.undefined
}
object SeriesAreasplinerangeLabelStyle {
/**
*/
def apply(fontWeight: js.UndefOr[String] = js.undefined): SeriesAreasplinerangeLabelStyle = {
val fontWeightOuter: js.UndefOr[String] = fontWeight
com.highcharts.HighchartsGenericObject.toCleanObject(new SeriesAreasplinerangeLabelStyle {
override val fontWeight: js.UndefOr[String] = fontWeightOuter
})
}
}
| mit |
sloops77/ngForge | js/forge.js | 4593 | angular.module('ngForge', []);
angular.module('ngForge').provider('$forge', function() {
return {
testConnectionUrl: 'ping',
$get : ['$http', '$interval', '$window', '$forgeLogger', function($http, $interval, $window, $forgeLogger) {
var forgeProvider = this;
var dummyForge = {
dummy : true,
is : {
web : function () {
return true;
},
mobile : function () {
return false;
},
android : function () {
return false;
},
ios : function () {
return false;
},
orientation: {
portrait: function() {
return true;
},
landscape: function() {
return false;
}
},
connection: {
_connected: false,
connected : function () {
return this._connected;
},
wifi : function () {
return this._connected;
}
}
},
event : {
menuPressed : {
addListener : function (callback, error) {
return console.log("menu pressed event registration");
}
},
backPressed : {
addListener : function (callback, error) {
return console.log("back pressed event registration");
},
preventDefault: function (callback, error) {
return console.log('default back handling disabled');
}
},
orientationChange : {
addListener : function (callback, error) {
return console.log("orientation change event registration");
}
},
connectionStateChange: {
listeners : [],
addListener: function (callback, error) {
this.listeners.push(callback);
return console.log("connectionStateChange event registration");
}
},
messagePushed : {
addListener: function (callback, error) {
return console.log("messagePushed event registration");
}
},
appPaused : {
addListener: function (callback, error) {
return console.log("appPaused event registration");
}
},
appResumed : {
addListener: function (callback, error) {
return console.log("appResumed event registration");
}
},
statusBarTapped : {
addListener: function (callback, error) {
return console.log("statusBarTapped event registration");
}
}
},
tools: {
UUID: function() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
},
getURL: function(name, success, error) {
success(name);
}
},
testConnection: function () {
var triggerListeners;
triggerListeners = (function (_this) {
return function (connectionState) {
_this.is.connection._connected = connectionState;
return _this.event.connectionStateChange.listeners.forEach(function (l) {
return l();
});
};
})(this);
return $http.get(forgeProvider.testConnectionUrl).then((function (_this) {
return function () {
if (!_this.is.connection._connected) {
return triggerListeners(true);
}
};
})(this))["catch"]((function (_this) {
return function () {
if (_this.is.connection._connected) {
return triggerListeners(false);
}
};
})(this));
}
};
if ($window.forge) {
$forgeLogger.info("ngForge.$forge: using trigger.io");
return $window.forge;
} else {
$forgeLogger.info("ngForge.$forge: using dummy");
dummyForge.testConnection();
$interval(function () {
return dummyForge.testConnection();
}, 5000);
return dummyForge;
}
}]
}
});
| mit |
pione/pione | lib/pione/location/dropbox-location.rb | 8328 | module Pione
module Location
# DropboxLocation represents locations on Dropbox server.
class DropboxLocation < DataLocation
set_scheme "dropbox"
define(:need_caching, true)
define(:real_appendable, false)
define(:writable, true)
class << self
attr_reader :client
# Return true if Dropbox's access token cache exists.
#
# @return [Boolean]
# true if Dropbox's access token cache exists
def cached?
cache = Pathname.new("~/.pione/dropbox_api.cache").expand_path
return (cache.exist? and cache.read.size > 0)
end
# Setup Dropbox location for CUI client. This method gets Dropbox's
# access token from cache file or OAuth2.
#
# @param tuple_space [TupleSpaceServer]
# tuple space
# @return [void]
def setup_for_cui_client(tuple_space)
return if @client
access_token = nil
cache = Pathname.new("~/.pione/dropbox_api.cache").expand_path
if cache.exist?
# load access token from cache file
access_token = cache.read
else
# get access token by OAtuh2
setup_consumer_key_and_secret
flow = auth_by_oauth2flow_no_redirect
access_token, user_id = get_code_for_cui_client(flow)
# cache session
cache.open("w+") {|c| c.write access_token}
end
# make a client
@client = DropboxClient.new(access_token)
# share access token in tuple space
share_access_token(tuple_space, access_token)
end
# Enable Dropbox locations. This method get an access token from the
# tuple space and make a Dropbox client. This assumes to be called from
# task worker agents.
#
# @param tuple_space_server [TupleSpaceServer]
# tuple space server
# @return [void]
def enable(tuple_space)
tuple = TupleSpace::AttributeTuple.new("dropbox_access_token", nil)
if tuple_access_token = tuple_space.read!(tuple)
@client = DropboxClient.new(tuple_access_token.value)
else
raise DropboxLocationUnavailable.new("There is no access token.")
end
end
def rebuild(path)
Location["dropbox:%s" % path]
end
# Setup Dropbox's consumer key and secret. They are loaded from a YAML
# file "dropbox_api.yml" at PIONE's home directory.
#
# @return [void]
def setup_consumer_key_and_secret
path = Pathname.new("~/.pione/dropbox_api.yml").expand_path
if File.exist?(path)
api = YAML.load(path.read)
@consumer_key = api["key"]
@consumer_secret = api["secret"]
else
raise DropboxLocationUnavailable.new("There are no consumer key and consumer secret.")
end
end
# Authorize dropbox account by `DropboxOAuth2FlowNoRedirect`.
#
# @return [String]
# authorize URL
def auth_by_oauth2flow_no_redirect
if @consumer_key and @consumer_secret
return DropboxOAuth2FlowNoRedirect.new(@consumer_key, @consumer_secret)
else
raise DropboxLocationUnavailable.new("There are no consumer key and consumer secret.")
end
end
# Authorize dropbox account by `DropboxOAuth2Flow`.
#
# @param redirect [String]
# redirect URL
# @param session [Hash]
# session
# @return [String]
# authorize URL
def auth_by_oauth2flow(redirect, session)
if @consumer_key and @consumer_secret
return DropboxOAuth2Flow.new(@consumer_key, @consumer_secret, redirect, session, :dropbox_auth_csrf_token)
else
raise DropboxLocationUnavailabel.new("There are no consumer key and consumer secret.")
end
end
# Share dropbox's access token with PIONE agents.
#
# @param tuple_space_server [TupleSpaceServer]
# tuple space server
# @param access_token [String]
# access token
# @return [void]
def share_access_token(tuple_space_server, access_token)
tuple = TupleSpace::AttributeTuple.new("dropbox_access_token", access_token)
tuple_space_server.write(tuple)
end
# Get code for CUI client.
#
# @return [Array]
# access token and Dropbox user ID
def get_code_for_cui_client(flow)
puts '1. Go to: %s' % flow.start
puts '2. Click "Allow"'
puts '3. Copy the authorization code'
print 'Enter the authorization code here: '
code = STDIN.gets.strip
flow.finish(code)
end
end
def initialize(uri)
super(uri)
end
def create(data)
if exist?
raise ExistAlready.new(self)
else
client.put_file(@path.to_s, StringIO.new(data))
end
return self
end
def read
exist? ? client.get_file(@path.to_s) : (raise NotFound.new(self))
end
def update(data)
client.put_file(@path.to_s, StringIO.new(data), true)
return self
end
def delete
if exist?
client.file_delete(@path.to_s)
end
end
# dropbox have "modified" time only, therefore ctime is not implemented
def mtime
metadata = client.metadata(@path.to_s)
Time.parse(metadata["modified"])
end
def size
metadata = client.metadata(@path.to_s)
return metadata["bytes"]
end
def entries(option={})
rel_entries(option).map {|entry| rebuild(@path + entry)}
end
def rel_entries(option={})
list = []
raise NotFound.new(self) if not(directory?)
metadata = client.metadata(@path.to_s)
metadata["contents"].select{|entry| not(entry["is_deleted"])}.each do |entry|
list << entry["path"].sub(@path.to_s, "").sub(/^\//, "")
entry_location = rebuild(@path + File.basename(entry["path"]))
if option[:rec] and entry_location.directory?
_list = entry_location.rel_entries(option).map {|subentry| entry + subentry}
list = list + _list
end
end
return list
end
def exist?
metadata = client.metadata(@path.to_s)
return not(metadata["is_deleted"])
rescue DropboxLocationUnavailable
raise
rescue DropboxError
return false
end
def file?
begin
metadata = client.metadata(@path.to_s)
return (not(metadata["is_dir"]) and not(metadata["is_deleted"]))
rescue DropboxError
# when there exists no files and no directories
false
end
end
def directory?
begin
metadata = client.metadata(@path.to_s)
return (metadata["is_dir"] and not(metadata["is_deleted"]))
rescue DropboxError
# when there exists no files and no directories
false
end
end
def mkdir
unless exist?
client.file_create_folder(@path.to_s)
end
end
def move(dest)
if dest.scheme == scheme
client.file_move(@path.to_s, dest.path)
else
copy(dest)
delete
end
end
def copy(dest)
raise NotFound.new(self) unless exist?
if dest.scheme == scheme
client.file_copy(@path.to_s, dest.path)
else
dest.write(read)
end
end
def link(orig)
if orig.scheme == scheme
orig.copy(link)
else
update(orig.read)
end
end
def turn(dest)
copy(dest)
end
private
# Check availability of Dropbox's access token.
#
# @return [void]
def client
if self.class.client.nil?
# raise an exception when Dropbox client isn't enabled
raise DropboxLocationUnavailable.new("There is no access token.")
else
self.class.client
end
end
end
end
end
| mit |
amitkgupta/goodlearn | classifier/randomforest/randomforest_suite_test.go | 209 | package randomforest_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestRandomforest(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Randomforest Suite")
}
| mit |
emacslisp/Java | SpringFrameworkReading/src/org/springframework/core/NestedExceptionUtils.java | 2832 | /*
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core;
import org.springframework.lang.Nullable;
/**
* Helper class for implementing exception classes which are capable of holding
* nested exceptions. Necessary because we can't share a base class among
* different exception types.
*
* <p>
* Mainly for use within the framework.
*
* @author Juergen Hoeller
* @since 2.0
* @see NestedRuntimeException
* @see NestedCheckedException
* @see NestedIOException
* @see org.springframework.web.util.NestedServletException
*/
public abstract class NestedExceptionUtils {
/**
* Build a message for the given base message and root cause.
*
* @param message the base message
* @param cause the root cause
* @return the full exception message
*/
@Nullable
public static String buildMessage(@Nullable String message, @Nullable Throwable cause)
{
if (cause == null) {
return message;
}
StringBuilder sb = new StringBuilder(64);
if (message != null) {
sb.append(message).append("; ");
}
sb.append("nested exception is ").append(cause);
return sb.toString();
}
/**
* Retrieve the innermost cause of the given exception, if any.
*
* @param original the original exception to introspect
* @return the innermost exception, or {@code null} if none
* @since 4.3.9
*/
@Nullable
public static Throwable getRootCause(@Nullable Throwable original)
{
if (original == null) {
return null;
}
Throwable rootCause = null;
Throwable cause = original.getCause();
while (cause != null && cause != rootCause) {
rootCause = cause;
cause = cause.getCause();
}
return rootCause;
}
/**
* Retrieve the most specific cause of the given exception, that is, either the
* innermost cause (root cause) or the exception itself.
* <p>
* Differs from {@link #getRootCause} in that it falls back to the original
* exception if there is no root cause.
*
* @param original the original exception to introspect
* @return the most specific cause (never {@code null})
* @since 4.3.9
*/
public static Throwable getMostSpecificCause(Throwable original)
{
Throwable rootCause = getRootCause(original);
return (rootCause != null ? rootCause : original);
}
}
| mit |
ltowarek/coding-interview | 4_10_check_subtree/4_10_check_subtree.cpp | 5468 | // Check Subtree: T1 and T2 are two very large binary trees, with T1 much bigger
// than T2. Create an algorithm to determine if T2 is a subtree of T1.
// A tree T2 is a subtree of T1 if there exists a node n in T1 such that the
// subtree of n is identical to T2. That is, if you cut off the tree at node n,
// the two trees would be identical.
#include "gtest/gtest.h"
template <class T> struct Node {
Node(T _data) : data(_data), left(nullptr), right(nullptr) {}
T data;
std::unique_ptr<Node<T>> left;
std::unique_ptr<Node<T>> right;
};
template <class T>
bool MatchTree(const Node<T> *tree_1, const Node<T> *tree_2) {
if (tree_1 == nullptr && tree_2 == nullptr) {
return true;
} else if (tree_1 == nullptr || tree_2 == nullptr) {
return false;
} else if (tree_1->data != tree_2->data) {
return false;
} else {
return MatchTree(tree_1->left.get(), tree_2->left.get()) &&
MatchTree(tree_1->right.get(), tree_2->right.get());
}
}
template <class T>
bool ContainsTree(const Node<T> *tree_1, const Node<T> *tree_2) {
if (tree_1 == nullptr) {
return false;
} else if (tree_1->data == tree_2->data && MatchTree(tree_1, tree_2)) {
return true;
}
return ContainsTree(tree_1->left.get(), tree_2) ||
ContainsTree(tree_1->right.get(), tree_2);
}
template <class T>
bool CheckSubtree(const Node<T> *tree_1, const Node<T> *tree_2) {
if (tree_2 == nullptr) {
return true;
}
return ContainsTree(tree_1, tree_2);
}
TEST(check_subtree_test, EmptyTrees) {
auto tree_1 = std::unique_ptr<Node<int>>(nullptr);
auto tree_2 = std::unique_ptr<Node<int>>(nullptr);
EXPECT_EQ(CheckSubtree(tree_1.get(), tree_2.get()), true);
}
TEST(check_subtree_test, T1_Empty) {
auto tree_1 = std::unique_ptr<Node<int>>(nullptr);
auto tree_2 = std::make_unique<Node<int>>(1);
EXPECT_EQ(CheckSubtree(tree_1.get(), tree_2.get()), false);
}
TEST(check_subtree_test, T2_Empty) {
auto tree_1 = std::make_unique<Node<int>>(1);
auto tree_2 = std::unique_ptr<Node<int>>(nullptr);
EXPECT_EQ(CheckSubtree(tree_1.get(), tree_2.get()), true);
}
TEST(check_subtree_test, Depth1_Subtree) {
auto tree_1 = std::make_unique<Node<int>>(1);
auto tree_2 = std::make_unique<Node<int>>(1);
EXPECT_EQ(CheckSubtree(tree_1.get(), tree_2.get()), true);
}
TEST(check_subtree_test, Depth1_NotSubtree) {
auto tree_1 = std::make_unique<Node<int>>(1);
auto tree_2 = std::make_unique<Node<int>>(2);
EXPECT_EQ(CheckSubtree(tree_1.get(), tree_2.get()), false);
}
TEST(check_subtree_test, Depth2_Subtree_Left) {
auto tree_1_1 = std::make_unique<Node<int>>(1);
auto tree_1_2 = std::make_unique<Node<int>>(2);
auto tree_1_3 = std::make_unique<Node<int>>(3);
tree_1_1->left = std::move(tree_1_2);
tree_1_1->right = std::move(tree_1_3);
auto tree_2 = std::make_unique<Node<int>>(2);
EXPECT_EQ(CheckSubtree(tree_1_1.get(), tree_2.get()), true);
}
TEST(check_subtree_test, Depth2_Subtree_Right) {
auto tree_1_1 = std::make_unique<Node<int>>(1);
auto tree_1_2 = std::make_unique<Node<int>>(2);
auto tree_1_3 = std::make_unique<Node<int>>(3);
tree_1_1->left = std::move(tree_1_2);
tree_1_1->right = std::move(tree_1_3);
auto tree_2 = std::make_unique<Node<int>>(3);
EXPECT_EQ(CheckSubtree(tree_1_1.get(), tree_2.get()), true);
}
TEST(check_subtree_test, Depth2_Subtree_Root) {
auto tree_1_1 = std::make_unique<Node<int>>(1);
auto tree_1_2 = std::make_unique<Node<int>>(2);
auto tree_1_3 = std::make_unique<Node<int>>(3);
tree_1_1->left = std::move(tree_1_2);
tree_1_1->right = std::move(tree_1_3);
auto tree_2_1 = std::make_unique<Node<int>>(1);
auto tree_2_2 = std::make_unique<Node<int>>(2);
auto tree_2_3 = std::make_unique<Node<int>>(3);
tree_2_1->left = std::move(tree_2_2);
tree_2_1->right = std::move(tree_2_3);
EXPECT_EQ(CheckSubtree(tree_1_1.get(), tree_2_1.get()), true);
}
TEST(check_subtree_test, Depth2_NotSubtree_Leaf_Left) {
auto tree_1_1 = std::make_unique<Node<int>>(1);
auto tree_1_2 = std::make_unique<Node<int>>(2);
auto tree_1_3 = std::make_unique<Node<int>>(3);
tree_1_1->left = std::move(tree_1_2);
tree_1_1->right = std::move(tree_1_3);
auto tree_2_1 = std::make_unique<Node<int>>(1);
auto tree_2_4 = std::make_unique<Node<int>>(4);
auto tree_2_3 = std::make_unique<Node<int>>(3);
tree_2_1->left = std::move(tree_2_4);
tree_2_1->right = std::move(tree_2_3);
EXPECT_EQ(CheckSubtree(tree_1_1.get(), tree_2_1.get()), false);
}
TEST(check_subtree_test, Depth2_NotSubtree_Leaf_Right) {
auto tree_1_1 = std::make_unique<Node<int>>(1);
auto tree_1_2 = std::make_unique<Node<int>>(2);
auto tree_1_3 = std::make_unique<Node<int>>(3);
tree_1_1->left = std::move(tree_1_2);
tree_1_1->right = std::move(tree_1_3);
auto tree_2_1 = std::make_unique<Node<int>>(1);
auto tree_2_2 = std::make_unique<Node<int>>(2);
auto tree_2_4 = std::make_unique<Node<int>>(4);
tree_2_1->left = std::move(tree_2_2);
tree_2_1->right = std::move(tree_2_4);
EXPECT_EQ(CheckSubtree(tree_1_1.get(), tree_2_1.get()), false);
}
TEST(check_subtree_test, Depth2_NotSubtree_Root) {
auto tree_1_1 = std::make_unique<Node<int>>(1);
auto tree_1_2 = std::make_unique<Node<int>>(2);
auto tree_1_3 = std::make_unique<Node<int>>(3);
tree_1_1->left = std::move(tree_1_2);
tree_1_1->right = std::move(tree_1_3);
auto tree_2 = std::make_unique<Node<int>>(4);
EXPECT_EQ(CheckSubtree(tree_1_1.get(), tree_2.get()), false);
}
| mit |
Xi-Plus/Xiplus-zhWP | log-move-whatlinkshere.js | 661 | javascript:
(function() {
if (mw.config.get('wgCanonicalSpecialPageName') !== 'Log') {
return;
}
mw.loader.using(['mediawiki.util']).done(function() {
$('li.mw-logline-move>a.new:not(.mw-userlink)').each(function(_, e) {
$(document.createTextNode(")")).insertAfter(e);
var url = mw.config.get('wgScript') + '?' + $.param({
title: 'Special:WhatLinksHere',
target: mw.util.getParamValue('title', e.href),
})
$('<a href="' + url + '">連入</a>').insertAfter(e);
$(document.createTextNode(" (")).insertAfter(e);
});
});
}
)();
| mit |
lobosky/vcf4IonTorrent | inc/colesterolo.php | 2874 | <?php
/** Colesterolo.php
Author : Mauro Lobosky Donadello
Description : Open a vcf file and add a AD fields, calculating the values of SAF SAR SRF SRR to obtain
AD = X , Y
where
X = SRF+SRR
Y = SAF+SAR
the output is a file with the same name of original file but with the prefix "modified_"
v0.1
Mauro Lobosky Donadello lobosky@gmail.com
*/
if($argc < 2 ) {
usage();
}
$rFiledir = "../VCF/";
$wFiledir = "../modified_VCF/";
$rFilename = $argv[1];
$wFilename = "modified_" . $rFilename;
$rF = fopen($rFiledir.$rFilename,'r');
if(!$rF){
die("Unable to open $rFilename");
}
$wF = fopen($wFiledir.$wFilename,'w');
if(!$wF){
die("Unable to open $wFilename");
}
$header = [];
$data = [];
$debug = false;
//leggo le righe del file.
while(!feof($rF)){
//skippo le righe con ## all'inizio e le metto da parte
$line = fgets($rF);
if(preg_match_all("/^##(.*)$/m",$line,$m)) {
$header[] = $line;
continue;
}
if(preg_match_all("/^#[^#](.*)$/m",$line,$m)){
$fields = explode("\t",trim(substr($line,1)));
$header[] = $line;
fwrite($wF,implode($header));
continue;
}
//se e' arrivato qui vuol dire che sono finite le righe header
//quindi scrivo l'header nel nuovo file.
$data = [];
$info = [];
//divido per colonne la riga
$line = trim($line);
if($line ==='') continue;
$colonne = explode("\t",$line);
foreach($fields as $index=>$fieldName){
$data[$fieldName] = $colonne[$index];
}
//devo estrarre i valori di DP dalla colonna INFO
$tempinfo = explode(";",$data['INFO']);
foreach($tempinfo as $index=>$value){
$t = explode("=",$value);
$info[$t[0]]=$t[1];
}
//ora divido per sigle la colonna FORMAT
$x = intval($info['SRF'] + $info['SRR']) ;
$y = intval($info['SAF'] + $info['SAR']) ;
//estraggo l'ultima chiave dell'array data, non sapendo il nome della stessa pero'.
$lastFieldName = end(array_keys($data));
$lastFieldValue = end($data) . ':' . $x . ',' . $y;
$data[$lastFieldName] = $lastFieldValue;
$data['FORMAT'].=':AD';
//print_R($format) & $debug;
//print_r($data) & $debug;
print '***********' . "\n";
print "Chrom " . $data['CHROM'] . "\n";
print "DP = " . $info['DP'] . "\n";
print 'SRF = '. $info['SRF'] . "\n";
print 'SRR = '. $info['SRR'] . "\n";
print 'SAF = '. $info['SAF'] . "\n";
print 'SAR = '. $info['SAR'] . "\n";
print 'INFO = ' . $data['INFO'] . "\n";
print 'FORMAT = ' . $data['FORMAT'] . "\n";
print $lastFieldName . ' = ' . $lastFieldValue . "\n";
print '***********' . "\n\n";
fwrite($wF,implode("\t",array_values($data)) . "\n");
}
fclose($rF);
fclose($wF);
function debug($d="None",$m="Empty message"){
GLOBAL $debug;
print "Description:$d, $m\n" && $debug;
}
function usage(){
global $argv;
print "\nUSAGE: php " . $argv[0] . " filename.vcf\n\n" ;
exit;
}
?>
| mit |
ossimlabs/ossim-plugins | cnes/src/ossimErsSarModel.cpp | 19169 | //----------------------------------------------------------------------------
//
// "Copyright Centre National d'Etudes Spatiales"
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
//----------------------------------------------------------------------------
// $Id$
#include <ossimErsSarModel.h>
#include <otb/GalileanEphemeris.h>
#include <otb/GeographicEphemeris.h>
#include <otb/JSDDateTime.h>
#include <otb/GMSTDateTime.h>
#include <otb/CivilDateTime.h>
#include <ossim/base/ossimTrace.h>
#include <otb/RefPoint.h>
#include <erssar/ErsSarLeader.h>
#include <otb/SensorParams.h>
#include <otb/PlatformPosition.h>
#include <ossim/base/ossimKeywordNames.h>
// Static trace for debugging
static ossimTrace traceDebug("ossimErsSarModel:debug");
#include <string>
#include <algorithm>
using namespace std;
namespace ossimplugins
{
RTTI_DEF1(ossimErsSarModel, "ossimErsSarModel", ossimGeometricSarSensorModel);
ossimErsSarModel::ossimErsSarModel():
theNumberSRGR(0),
thePixelSpacing(0),
theErsSarleader(NULL)
{
theSRGRCoeffset[0][0] = 0.0;
theSRGRCoeffset[0][1] = 0.0;
theSRGRCoeffset[0][2] = 0.0;
}
ossimErsSarModel::~ossimErsSarModel()
{
if (theErsSarleader != NULL)
{
delete theErsSarleader;
theErsSarleader = NULL;
}
}
ossimString ossimErsSarModel::getClassName() const
{
return ossimString("ossimErsSarModel");
}
ossimObject* ossimErsSarModel::dup() const
{
return new ossimErsSarModel(*this);
}
double ossimErsSarModel::getSlantRangeFromGeoreferenced(double col) const
{
const double c = 2.99792458e+8;
double tn = theSRGRCoeffset[0][0] + theSRGRCoeffset[0][1] * col + theSRGRCoeffset[0][2] * col * col ;
return tn *(c / 2.0);
}
bool ossimErsSarModel::InitSensorParams(const ossimKeywordlist &kwl, const char *prefix)
{
const char* wave_length_str = kwl.find(prefix, "wave_length");
double wave_length = atof(wave_length_str);
const char* fr_str = kwl.find(prefix, "fr");
double fr = atof(fr_str) * 1e6;
const char* fa_str = kwl.find(prefix, "fa");
double fa = atof(fa_str);
ossimString time_dir_pix = kwl.find(prefix, "time_dir_pix");
time_dir_pix.upcase();
//std::transform(time_dir_pix.begin(), time_dir_pix.end(), time_dir_pix.begin(), toupper);
ossimString time_dir_lin = kwl.find(prefix, "time_dir_lin");
time_dir_lin.upcase();
//std::transform(time_dir_lin.begin(), time_dir_lin.end(), time_dir_lin.begin(), toupper);
//ellipsoid parameters
const char* ellip_maj_str = kwl.find(prefix, "ellip_maj");
double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m
const char* ellip_min_str = kwl.find(prefix, "ellip_min");
double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m
if (_sensor != NULL)
{
delete _sensor;
}
_sensor = new SensorParams();
if (strcmp(time_dir_pix.c_str(), "INCREASE") == 0)
{
_sensor->set_col_direction(1);
}
else
{
_sensor->set_col_direction(-1);
}
if (strcmp(time_dir_lin.c_str(), "INCREASE") == 0)
{
_sensor->set_lin_direction(1);
}
else
{
_sensor->set_lin_direction(-1);
}
_sensor->set_sightDirection(SensorParams::Right) ;
double nlooks_az = atof(kwl.find(prefix, "nlooks_az"));
_sensor->set_nAzimuthLook(nlooks_az);
double n_rnglok = atof(kwl.find(prefix, "n_rnglok"));
_sensor->set_nRangeLook(n_rnglok);
_sensor->set_prf(fa);
_sensor->set_sf(fr);
_sensor->set_rwl(wave_length);
_sensor->set_semiMajorAxis(ellip_maj) ;
_sensor->set_semiMinorAxis(ellip_min) ;
return true;
}
bool ossimErsSarModel::open(const ossimFilename& file)
{
static const char MODULE[] = "ossimErsSarModel::open";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered...\n"
<< "file: " << file << "\n";
}
bool result = false;
ossimFilename leaFilename = file;
/*
* Creation of the class allowing to store Leader file metadata
*/
if (theErsSarleader != NULL)
{
delete theErsSarleader;
theErsSarleader = NULL;
}
theErsSarleader = new ErsSarLeader();
if (leaFilename.exists())
{
result = isErsLeader(leaFilename);
if (result == false)
{
leaFilename = findErsLeader(file);
}
result = isErsLeader(leaFilename);
if (result == true)
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << "is ERS leader file..."
<< "Begin reading Leader file" << std::endl;
}
/*
* Leader file data reading
*/
std::ifstream leaderFile(leaFilename.c_str(), ios::in | ios::binary);
leaderFile >> *theErsSarleader;
leaderFile.close();
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "End reading Leader file" << std::endl;
}
//To initialize the whole state, reusing saveState/loadState
//FIXME: This could be at the superclass level instead
ossimKeywordlist kwl;
saveState(kwl);
loadState(kwl);
} // matches: if ( result=isErsLeader(file) == True )
} // matches: if ( file.exists() )
if (traceDebug())
{
this->print(ossimNotify(ossimNotifyLevel_DEBUG));
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " exit status = " << (result ? "true" : "false\n")
<< std::endl;
}
return result;
}
bool ossimErsSarModel::saveState(ossimKeywordlist& kwl,
const char* /* prefix */) const
{
static const char MODULE[] = "ossimErsSarModel::saveState";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
}
bool result(false);
//kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimErsSarModel", true);
if (theErsSarleader == NULL)
{
std::cout << "Error: ErsSarleader is NULL" << std::endl;
return false;
}
result = theErsSarleader->saveState(kwl);
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " exit status = " << (result ? "true" : "false\n")
<< std::endl;
}
return result;
}
bool ossimErsSarModel::loadState(const ossimKeywordlist &kwl, const char *prefix)
{
static const char MODULE[] = "ossimErsSarModel::loadState";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
}
const char* lookup = 0;
ossimString s;
// Check the type first.
lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
if (lookup)
{
s = lookup;
if (s != getClassName())
{
return false;
}
}
// Load the base class.
// bool result = ossimGeometricSarSensorModel::loadState(kwl, prefix);
bool result = false;
result = InitPlatformPosition(kwl, prefix);
if (!result)
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< MODULE
<< "\nCan't init platform position \n";
}
}
if (result)
{
result = InitSensorParams(kwl, prefix);
if (!result)
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< MODULE
<< "\nCan't init sensor parameters \n";
}
}
}
if (result)
{
result = InitRefPoint(kwl, prefix);
if (!result)
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< MODULE
<< "\nCan't init ref point \n";
}
}
}
if (result)
{
result = InitSRGR(kwl, prefix);
if (!result)
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
<< MODULE
<< "\nCan't init ref point \n";
}
}
}
return result;
}
bool ossimErsSarModel::InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix)
{
// const double PI = 3.14159265358979323846 ;
CivilDateTime ref_civil_date;
/*
* Ephemerisis reference date retrieval
*/
const char* eph_year_str = kwl.find(prefix, "eph_year");
int eph_year = atoi(eph_year_str);
const char* eph_month_str = kwl.find(prefix, "eph_month");
int eph_month = atoi(eph_month_str);
const char* eph_day_str = kwl.find(prefix, "eph_day");
int eph_day = atoi(eph_day_str);
const char* eph_sec_str = kwl.find(prefix, "eph_sec");
double eph_sec = atof(eph_sec_str);
ref_civil_date.set_year(eph_year);
ref_civil_date.set_month(eph_month);
ref_civil_date.set_day(eph_day);
ref_civil_date.set_second((int)eph_sec);
ref_civil_date.set_decimal(eph_sec - (double)((int)eph_sec));
JSDDateTime ref_jsd_date(ref_civil_date);
/*
* Ephemerisis time interval retrieval
*/
const char* eph_int_str = kwl.find(prefix, "eph_int");
double eph_int = atof(eph_int_str);
/*
* Ephemerisis number retrieval
*/
const char* neph_str = kwl.find(prefix, "neph");
int neph = atoi(neph_str);
Ephemeris** ephemeris = new Ephemeris*[neph];
/*
* Ephemerisis retrieval
*/
for (int i = 0; i < neph; i++)
{
double pos[3];
double vit[3];
char name[64];
sprintf(name, "eph%i_posX", i);
const char* px_str = kwl.find(prefix, name);
pos[0] = atof(px_str);
sprintf(name, "eph%i_posY", i);
const char* py_str = kwl.find(prefix, name);
pos[1] = atof(py_str);
sprintf(name, "eph%i_posZ", i);
const char* pz_str = kwl.find(prefix, name);
pos[2] = atof(pz_str);
sprintf(name, "eph%i_velX", i);
const char* vx_str = kwl.find(prefix, name);
vit[0] = atof(vx_str);
sprintf(name, "eph%i_velY", i);
const char* vy_str = kwl.find(prefix, name);
vit[1] = atof(vy_str);
sprintf(name, "eph%i_velZ", i);
const char* vz_str = kwl.find(prefix, name);
vit[2] = atof(vz_str);
/*
* Ephemerisis date
*/
JSDDateTime date(ref_jsd_date);
date.set_second(date.get_second() + i * eph_int);
date.NormDate();
GeographicEphemeris* eph = new GeographicEphemeris(date, pos, vit);
ephemeris[i] = eph;
}
/*
* Antenna position interpolator creation
*/
if (_platformPosition != NULL)
{
delete _platformPosition;
}
_platformPosition = new PlatformPosition(ephemeris, neph);
/*
* Free of memory used by the ephemerisis list
*/
for (int i = 0; i < neph; i++)
{
delete ephemeris[i];
}
delete[] ephemeris;
return true;
}
bool ossimErsSarModel::InitRefPoint(const ossimKeywordlist &kwl, const char *prefix)
{
const char* sc_lin_str = kwl.find(prefix, "sc_lin");
double sc_lin = atof(sc_lin_str);
const char* sc_pix_str = kwl.find(prefix, "sc_pix");
double sc_pix = atof(sc_pix_str);
const char* inp_sctim_str = kwl.find(prefix, "inp_sctim");
const char* rng_gate_str = kwl.find(prefix, "zero_dop_range_time_f_pixel");
double rng_gate = atof(rng_gate_str);
if (_refPoint == NULL)
{
_refPoint = new RefPoint();
}
_refPoint->set_pix_col(sc_pix);
_refPoint->set_pix_line(sc_lin);
char year_str[5];
for (int i = 0; i < 4; i++)
{
year_str[i] = inp_sctim_str[i];
}
year_str[4] = '\0';
char month_str[3];
for (int i = 4; i < 6; i++)
{
month_str[i-4] = inp_sctim_str[i];
}
month_str[2] = '\0';
char day_str[3];
for (int i = 6; i < 8; i++)
{
day_str[i-6] = inp_sctim_str[i];
}
day_str[2] = '\0';
char hour_str[3];
for (int i = 8; i < 10; i++)
{
hour_str[i-8] = inp_sctim_str[i];
}
hour_str[2] = '\0';
char min_str[3];
for (int i = 10; i < 12; i++)
{
min_str[i-10] = inp_sctim_str[i];
}
min_str[2] = '\0';
char sec_str[3];
for (int i = 12; i < 14; i++)
{
sec_str[i-12] = inp_sctim_str[i];
}
sec_str[2] = '\0';
char mili_str[4];
for (int i = 14; i < 17; i++)
{
mili_str[i-14] = inp_sctim_str[i];
}
mili_str[3] = '\0';
int year = atoi(year_str);
int month = atoi(month_str);
int day = atoi(day_str);
int hour = atoi(hour_str);
int min = atoi(min_str);
int sec = atoi(sec_str);
double mili = atof(mili_str);
CivilDateTime date(year, month, day, hour * 3600 + min * 60 + sec, mili / 1000.0);
if (_platformPosition != NULL)
{
Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)date);
if (ephemeris == NULL) return false ;
_refPoint->set_ephemeris(ephemeris);
delete ephemeris;
}
else
{
return false;
}
double c = 2.99792458e+8;
double distance = (rng_gate * 1e-3 + ((double)sc_pix) * _sensor->get_nRangeLook() / _sensor->get_sf()) * (c / 2.0);
_refPoint->set_distance(distance);
// in order to use ossimSensorModel::lineSampleToWorld
const char* nbCol_str = kwl.find(prefix, "num_pix");
const char* nbLin_str = kwl.find(prefix, "num_lines");
theImageSize.x = atoi(nbCol_str);
theImageSize.y = atoi(nbLin_str);
theImageClipRect = ossimDrect(0, 0, theImageSize.x - 1, theImageSize.y - 1);
// Ground Control Points extracted from the model : corner points
std::list<ossimGpt> groundGcpCoordinates ;
std::list<ossimDpt> imageGcpCoordinates ;
// first line first pix
const char* lon_str = kwl.find("first_line_first_pixel_lon");
double lon = atof(lon_str);
const char* lat_str = kwl.find("first_line_first_pixel_lat");
double lat = atof(lat_str);
if (lon > 180.0) lon -= 360.0;
ossimDpt imageGCP1(0, 0);
ossimGpt groundGCP1(lat, lon, 0.0);
groundGcpCoordinates.push_back(groundGCP1) ;
imageGcpCoordinates.push_back(imageGCP1) ;
// first line last pix
lon_str = kwl.find("first_line_last_pixel_lon");
lon = atof(lon_str);
lat_str = kwl.find("first_line_last_pixel_lat");
lat = atof(lat_str);
if (lon > 180.0) lon -= 360.0;
ossimDpt imageGCP2(theImageSize.x - 1, 0);
ossimGpt groundGCP2(lat, lon, 0.0);
groundGcpCoordinates.push_back(groundGCP2) ;
imageGcpCoordinates.push_back(imageGCP2) ;
// last line last pix
lon_str = kwl.find("last_line_last_pixel_lon");
lon = atof(lon_str);
lat_str = kwl.find("last_line_last_pixel_lat");
lat = atof(lat_str);
if (lon > 180.0) lon -= 360.0;
ossimDpt imageGCP3(theImageSize.x - 1, theImageSize.y - 1);
ossimGpt groundGCP3(lat, lon, 0.0);
groundGcpCoordinates.push_back(groundGCP3) ;
imageGcpCoordinates.push_back(imageGCP3) ;
// last line first pix
lon_str = kwl.find("last_line_first_pixel_lon");
lon = atof(lon_str);
lat_str = kwl.find("last_line_first_pixel_lat");
lat = atof(lat_str);
if (lon > 180.0) lon -= 360.0;
ossimDpt imageGCP4(0, theImageSize.y - 1);
ossimGpt groundGCP4(lat, lon, 0.0);
groundGcpCoordinates.push_back(groundGCP4) ;
imageGcpCoordinates.push_back(imageGCP4) ;
// Default optimization
optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ;
return true;
}
bool ossimErsSarModel::InitSRGR(const ossimKeywordlist &kwl, const char* /* prefix */)
{
// Product type = PRI
ossimString filename(kwl.find("filename"));
filename.upcase();
//std::transform(filename.begin(), filename.end(), filename.begin(), toupper);
string::size_type loc = filename.find("PRI");
if (loc != string::npos)
{
_isProductGeoreferenced = true;
}
else
{
_isProductGeoreferenced = false;
}
// Number of SRGR Coef
theNumberSRGR = 3;
// Range time for first mid and last pixel
double t1 = atof(kwl.find("zero_dop_range_time_f_pixel")) * 1e-3;
double t2 = atof(kwl.find("zero_dop_range_time_c_pixel")) * 1e-3;
double t3 = atof(kwl.find("zero_dop_range_time_l_pixel")) * 1e-3;
// Range pixels numbers corresponding
// Todo : check if it works with "DECREASING LINE TIME"
// double x1 = 0.0;
double x2 = atof(kwl.find("sc_pix")) - 1.0;
double x3 = 2.0 * (x2 + 1.0) - 1.0 ;
theSRGRCoeffset[0][0] = t1;
theSRGRCoeffset[0][1] = ((t2 - t1) / (x2 * x2) + (t1 - t3) / (x3 * x3)) / ((1.0 / x2) - (1.0 / x3));
theSRGRCoeffset[0][2] = ((t2 - t1) / x2 + (t1 - t3) / x3) / (x2 - x3);
return true;
}
bool ossimErsSarModel::isErsLeader(const ossimFilename& file) const
{
std::ifstream candidate(file.c_str(), ios::in | ios::binary);
char ersFileName[16];
candidate.seekg(48);
if (candidate.bad() || candidate.eof())
{
return false;
}
candidate.read(ersFileName, 16);
if (candidate.bad() || candidate.eof())
{
return false;
}
candidate.close();
ossimString ersString(ersFileName);
if ((ersString.find("ERS") == 0) &&
(ersString.find(".SAR.") == 4) &&
(ersString.find("LEAD") == 12))
{
return true;
}
else
{
return false;
}
}
ossimFilename ossimErsSarModel::findErsLeader(const ossimFilename& file) const
{
ossimFilename leaFile = file;
ossimString datString("DAT_01");
ossimString nulString("NUL_DAT");
ossimString vdfString("VDF_DAT");
ossimString leaString("LEA_01");
if ((file.fileNoExtension() == datString)
|| (file.fileNoExtension() == nulString)
|| (file.fileNoExtension() == leaString))
{
leaFile.setFile(leaString);
if (leaFile.exists())
{
return leaFile;
}
}
return file;
}
}
| mit |
Lucas-Lu/KotlinWorld | KT10/src/main/java/net/println/kt10/LazyThreadSafeSynchronized.java | 415 | package net.println.kt10;
/**
* Created by luliju on 2017/7/8.
*/
public class LazyThreadSafeSynchronized {
private static LazyThreadSafeSynchronized INSTANCE;
private LazyThreadSafeSynchronized(){}
public static synchronized LazyThreadSafeSynchronized getInstance(){
if(INSTANCE == null){
INSTANCE = new LazyThreadSafeSynchronized();
}
return INSTANCE;
}
}
| mit |
kevinoid/git-branch-is | test-bin/echo-surprise.js | 51 | 'use strict';
process.stdout.write('surprise\n');
| mit |
nayanshah/python | photos.py | 2406 | #!/c/Python27/python
import json
import os
import pickle
import sys
import time
import urllib
import facebook
ID = 'CreativeIdeass'
TOKEN = '' # access token
SAFE_CHARS = '-_() abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
def save(res, name='data'):
"""Save data to a file"""
with open('%s.lst' % name, 'w') as f:
pickle.dump(res, f)
def read(name='data'):
"""Read data from a file"""
with open('%s.lst' % name, 'r') as f:
res = pickle.load(f)
return res
def fetch(limit=1000, depth=10, last=None, id=ID, token=TOKEN):
"""Fetch the data using Facebook's Graph API"""
lst = []
graph = facebook.GraphAPI(token)
url = '%s/photos/uploaded' % id
if not last:
args = {'fields': ['source','name'], 'limit': limit}
res = graph.request('%s/photos/uploaded' % id, args)
process(lst, res['data'])
else:
res = {'paging': {'next': last}}
# continue fetching till all photos are found
for _ in xrange(depth):
if 'paging' not in res:
break
try:
url = res['paging']['next']
res = json.loads(urllib.urlopen(url).read())
process(lst, res['data'])
except:
break
save(url, 'last_url')
return lst
def process(res, dat):
"""Extract required data from a row"""
err = []
for d in dat:
if 'source' not in d:
err.append(d)
continue
src = d['source']
if 'name' in d:
name = ''.join(c for c in d['name'][:99] if c in SAFE_CHARS) + src[-4:]
else:
name = src[src.rfind('/')+1:]
res.append({'name': name, 'src': src})
if err:
print '%d errors.' % len(err)
print err
print '%d photos found.' % len(dat)
def download(res):
"""Download the list of files"""
start = time.clock()
if not os.path.isdir(ID):
os.mkdir(ID)
os.chdir(ID)
for p in res:
# try to get a higher resolution of the photo
p['src'] = p['src'].replace('_s', '_n')
urllib.urlretrieve(p['src'], p['name'])
print "Downloaded %s pictures in %.3f sec." % (len(res), time.clock()-start)
if __name__ == '__main__':
# download 500 photos, fetch details about 100 at a time
lst = fetch(limit=100, depth=5)
save(lst, 'photos')
download(lst)
| mit |
bertofer/arxivum-web | src/app/pages/files-page/files-page.service.ts | 4413 | import { SaveFile } from '../../core/downloader/downloader.actions';
import { IFile } from '../../core/files/files.interfaces';
import * as PlayerActions from '../../core/player/player.actions';
import { IDownloadingFile } from '../../core/downloader/downloader.reducer';
import { Router } from '@angular/router';
import * as DownloaderActions from '../../core/downloader/downloader.actions';
import { Observable } from 'rxjs/Rx';
import { DownloaderService } from '../../core/downloader/downloader.service';
import { UploaderService } from '../../core/uploader/uploader.service';
import * as UploaderActions from '../../core/uploader/uploader.actions';
import * as ModalsActions from '../../core/modals/modals.actions';
import { AppError } from '../../core/common/errors.actions';
import * as FoldersActions from '../../core/folders/folders.actions';
import { FilesService } from '../../core/files/files.service';
import { Store } from '@ngrx/store';
import { AppState } from '../../app.reducers';
import { Injectable } from '@angular/core';
const R = require('ramda');
@Injectable()
export class FilesPageService {
public currentFolder$ = this.store.select(state => state.currentFolder);
public authenticated$ = this.store.select(state => state.authenticated);
public downloadData$ = this.store.select(state => state.downloadData);
public downloadingList$ = this.store.select(state => state.downloading);
public uploadingList$ = this.store.select(state => state.uploading);
public uploadData$ = this.store.select(state => state.uploadData);
// private player$ = this.store.select(state => state.player);
public uploader = this.uploaderService.uploader;
// navigation
goTo(path) {
this.router.navigate(['/files/' + path])
}
goToFolder (id) {
this.store.dispatch(new FoldersActions.GoToFolder(id));
}
// folders
newFolder () {
// We take latest currentFolder value, as it's the parent.
// More reactive would be clock events as observables,
// but ng API not ready for it yet.
let parentId;
this.store
.select(state => state.currentFolder._id)
.take(1)
.subscribe(currentId => parentId = currentId);
this.store.dispatch(new ModalsActions.NewFolder(parentId));
}
editFolder (folder) {
this.store.dispatch(new ModalsActions.UpdateFolder(folder));
}
deleteFolder (folderId) {
this.store.dispatch(new ModalsActions.DeleteFolder(folderId));
}
editFile (file) {
this.store.dispatch(new ModalsActions.UpdateFile(file));
}
deleteFile (file) {
this.store.dispatch(new ModalsActions.DeleteFile(file));
}
downloadFile (file) {
Observable.fromPromise(this.downloaderService.download(file))
.subscribe(downloadingFile => {
this.store.dispatch(new DownloaderActions.AddDownloadFile(downloadingFile))
})
}
removeDownloadingFile (file) {
this.store.dispatch(new DownloaderActions.RemoveFile(file))
}
uploadFiles () {
this.store.dispatch(new UploaderActions.UploadFiles());
}
clearUploadQueue () {
this.store.dispatch(new UploaderActions.ClearQueue());
}
_getDownloadingFromId (id) {
let downloading;
this.store
.select(state => state.downloading)
.take(1)
.subscribe(
data => {
downloading = R.find(elem => elem._id === id, data.files);
}
);
return downloading;
}
// A bit messy
playFile (file: IFile) {
// Check if is already downloading
const downloading = this._getDownloadingFromId(file._id);
Observable.combineLatest(
downloading ? Observable.of(downloading) : Observable.fromPromise(this.downloaderService.download(file)),
this.filesApi.getOne(file._id)
).subscribe(([downloadingFile, fileInfo]) => {
if (!downloading) this.store.dispatch(new DownloaderActions.AddDownloadFile(downloadingFile))
this.store.dispatch(new PlayerActions.PlayFile(downloadingFile, (<IFile>fileInfo).encryption_key.data, file.size));
this.router.navigate(['player']);
})
}
saveFile(file: IFile) {
const downloading = this._getDownloadingFromId(file._id);
this.store.dispatch(new SaveFile(downloading))
}
constructor(
private store: Store<AppState>,
private filesApi: FilesService,
private uploaderService: UploaderService,
private downloaderService: DownloaderService,
private router: Router
) {}
}
| mit |
kercos/TreeGrammars | TreeGrammars/src/tsg/fragStats/FragmentFinder.java | 7341 | package tsg.fragStats;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Scanner;
import settings.Parameters;
import tsg.Label;
import tsg.TSNodeLabel;
import tsg.corpora.Wsj;
import util.file.FileUtil;
public class FragmentFinder {
public static void findInTUT() throws Exception {
File treebankFile = new File(Parameters.corpusPath + "Evalita09/Treebanks/Constituency/" +
"TUTinPENN-train.readable.notraces.quotesFixed.noSemTags.penn");
ArrayList<TSNodeLabel> treebank = TSNodeLabel.getTreebank(treebankFile, "UTF-8",Integer.MAX_VALUE);
TSNodeLabel target = new TSNodeLabel("(VMA~RE mette)");
findInTreebankAndPrint(treebank, target,100);
}
public static void findInWSJ(TSNodeLabel target) throws Exception {
File treebankFile = new File(Wsj.WsjOriginalCleanedTopSemTagsOff + "wsj-02-21.mrg");//"wsj-complete.mrg");
ArrayList<TSNodeLabel> treebank = TSNodeLabel.getTreebank(treebankFile);
//TSNodeLabel target = new TSNodeLabel("(VP * (S NP-SBJ NP-PRD))", false);
findInTreebankAndPrint(treebank, target, Integer.MAX_VALUE);
}
public static int countInTreebank(File treebankFile, TSNodeLabel frag) throws Exception {
Scanner scan = FileUtil.getScanner(treebankFile);
int count = 0;
while(scan.hasNextLine()) {
TSNodeLabel tree = new TSNodeLabel(scan.nextLine());
if (tree.containsRecursiveFragment(frag))
count++;
}
return count;
}
public static void findInTreebankAndPrint(ArrayList<TSNodeLabel> treebank, TSNodeLabel target, int hits) {
int count = 0;
for(TSNodeLabel t : treebank) {
if (t.containsRecursiveFragment(target)) {
System.out.println(t);
System.out.println("\t"+t.toFlatSentence());
count++;
if (count==hits) break;
}
}
}
public static ArrayList<TSNodeLabel> findInTreebank(ArrayList<TSNodeLabel> treebank, TSNodeLabel target) {
ArrayList<TSNodeLabel> result = new ArrayList<TSNodeLabel>();
for(TSNodeLabel t : treebank) {
if (t.containsRecursiveFragment(target)) {
result.add(t);
}
}
return result;
}
public static void findYieldInTreebankAndPrint(ArrayList<TSNodeLabel> treebank, HashSet<Label> labs) {
for(TSNodeLabel t : treebank) {
ArrayList<Label> terms = t.collectLexicalLabels();
if (terms.containsAll(labs)) System.out.println(t);
}
}
public static ArrayList<TSNodeLabel> findAdjacentLexInTreebank(ArrayList<TSNodeLabel> treebank, String words) {
ArrayList<TSNodeLabel> result = new ArrayList<TSNodeLabel>();
words = " " + words + " ";
for(TSNodeLabel t : treebank) {
String lex = " " + t.toFlatSentence() + " ";
if (lex.contains(words)) result.add(t);
}
return result;
}
public static void findShortestInTreebankAndPrint(ArrayList<TSNodeLabel> treebank, TSNodeLabel target) {
int min = Integer.MAX_VALUE;
TSNodeLabel result = null;
for(TSNodeLabel t : treebank) {
if (t.containsRecursiveFragment(target)) {
int length = t.countLexicalNodes();
if (length<min) {
min = length;
result = t;
}
}
}
if (result!=null) {
System.out.println(result);
}
}
public static void findInFragment(TSNodeLabel target) throws Exception {
String dir = Parameters.resultsPath + "TSG/TSGkernels/Wsj/KenelFragments/SemTagOff_Top/all/";
File fragmentsFile = new File(dir + "fragments_MUB_freq_all.txt");
Scanner scan = FileUtil.getScanner(fragmentsFile);
while(scan.hasNextLine()) {
String line = scan.nextLine();
if (line.equals("")) continue;
String fragmentString = line.split("\t")[0];
TSNodeLabel fragment = new TSNodeLabel(fragmentString, false);
if (fragment.containsRecursiveFragment(target)) System.out.println(line);
}
}
public static void findPartialFragment(int index, String containsWord) throws Exception {
File treebankFile = new File(Wsj.WsjOriginalCleanedTop + "wsj-02-21.mrg");
File partialFragmentFile = new File(Parameters.resultsPath +
"TSG/TSGkernels/Wsj/KenelFragments/SemTagOn/subBranch/20/correct/" +
"fragments_subBranch_MUB_freq_20_sorted_" + containsWord + "_correctCount.txt");
ArrayList<TSNodeLabel> treebank = TSNodeLabel.getTreebank(treebankFile);
TSNodeLabel tree = treebank.get(index);
System.out.println(tree + "\n");
Scanner scan = FileUtil.getScanner(partialFragmentFile);
while(scan.hasNextLine()) {
String line = scan.nextLine();
if (line.equals("")) continue;
String[] fragmentFreq = line.split("\t");
String fragmentString = fragmentFreq[0];
TSNodeLabel fragment = new TSNodeLabel(fragmentString, false);
if (tree.containsRecursivePartialFragment(fragment)) {
//if (line.indexOf(containsWord)==-1) continue;
System.out.println(line);
}
}
}
public static void filterFragmentsPresentInTree(File fragmentFile, TSNodeLabel tree,
File outputFile) throws Exception {
Scanner scan = FileUtil.getScanner(fragmentFile);
PrintWriter pw = FileUtil.getPrintWriter(outputFile);
while(scan.hasNextLine()) {
String line = scan.nextLine();
String fragString = line.split("\t")[0];
TSNodeLabel frag = new TSNodeLabel(fragString, false);
if (tree.containsRecursiveFragment(frag))
pw.println(line);
}
pw.close();
}
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
//File treebankFile = new File(Wsj.WsjOriginalCleanedTop + "wsj-02-21.mrg");//"wsj-complete.mrg");
//File treebankFile = new File(Wsj.WsjOriginalReadable + "wsj-02-21.mrg");//"wsj-complete.mrg");
//ArrayList<TSNodeLabel> treebank = TSNodeLabel.getTreebank(treebankFile);
//findInTreebankAndPrint(treebank,
// new TSNodeLabel("(VP (VBD \"gave\") NP)", false),
// Integer.MAX_VALUE);
//System.out.println("---------------");
//ArrayList<TSNodeLabel> woTrees = findInTreebank(treebank,
// new TSNodeLabel(Label.getLabel("wo"), true));
/*
ArrayList<TSNodeLabel> woTrees = findAdjacentLexInTreebank(treebank,
"wo");
ArrayList<TSNodeLabel> wontTrees = findAdjacentLexInTreebank(treebank,
"wo n't");
System.out.println(woTrees.size());
System.out.println(wontTrees.size());
woTrees.removeAll(wontTrees);
//System.out.println(woTrees);
for(TSNodeLabel t : woTrees) {
System.out.println(t);
}*/
/*
String path = System.getProperty("user.home") + "/PLTSG/WSJ_RightBin_H0V1_UK4/";
File treebankFile = new File(path + "wsj-02-21.mrg");
TSNodeLabel frag = new TSNodeLabel("(VP ADVP (VP@ VBD))", false);
int count = countInTreebank(treebankFile, frag);
System.out.println(count);
*/
String path = "/disk/scratch/fsangati/PLTSG/ToyCorpus3/";
File treeFile = new File(path+"trainTB.mrg");
TSNodeLabel tree = new TSNodeLabel(FileUtil.getScanner(treeFile).nextLine());
File fragsFileFirstLex = new File(path + "firstLexFrags.mrg");
File fragsFileFirstLexFiltered = new File(path + "firstLexFragsFiltered.mrg");
filterFragmentsPresentInTree(fragsFileFirstLex, tree, fragsFileFirstLexFiltered);
File fragsFileFirstSub = new File(path + "firstSubFrags.mrg");
File fragsFileFirstSubFiltered = new File(path + "firstSubFragsFiltered.mrg");
filterFragmentsPresentInTree(fragsFileFirstSub, tree, fragsFileFirstSubFiltered);
}
}
| mit |
pkzxs/Aurora.Music | Source/Aurora.Music/Controls/SleepTimer.xaml.cs | 1430 | // Copyright (c) Aurora Studio. All rights reserved.
//
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using Aurora.Music.Core;
using Aurora.Music.Core.Models;
using Windows.UI.Xaml.Controls;
// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“内容对话框”项模板
namespace Aurora.Music.Controls
{
public sealed partial class SleepTimer : ContentDialog
{
public SleepTimer()
{
InitializeComponent();
RequestedTheme = Settings.Current.Theme;
Time.Time = DateTime.Now.TimeOfDay + TimeSpan.FromMinutes(10);
}
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
var t = DateTime.Today;
if (Time.Time < DateTime.Now.TimeOfDay)
{
t = t.AddDays(1) + Time.Time;
}
else
{
t += Time.Time;
}
SleepAction a;
if ((bool)PlayPause.IsChecked)
{
a = SleepAction.Pause;
}
else if ((bool)Stop.IsChecked)
{
a = SleepAction.Stop;
}
else
{
a = SleepAction.Shutdown;
}
MainPage.Current.SetSleepTimer(t, a);
}
}
}
| mit |
fvasquezjatar/fermat-unused | CCP/plugin/transaction/fermat-ccp-plugin-transaction-outgoing-intra-actor-bitdubai/src/main/java/com/bitdubai/fermat_ccp_plugin/layer/transaction/outgoing_intra_actor/developer/bitdubai/version_1/interfaces/OutgoingIntraActorTransactionHandler.java | 825 | package com.bitdubai.fermat_ccp_plugin.layer.transaction.outgoing_intra_actor.developer.bitdubai.version_1.interfaces;
import com.bitdubai.fermat_api.layer.all_definition.transaction_transference_protocol.crypto_transactions.CryptoStatus;
import com.bitdubai.fermat_ccp_plugin.layer.transaction.outgoing_intra_actor.developer.bitdubai.version_1.exceptions.OutgoingIntraActorCantHandleTransactionException;
import com.bitdubai.fermat_ccp_plugin.layer.transaction.outgoing_intra_actor.developer.bitdubai.version_1.util.OutgoingIntraActorTransactionWrapper;
/**
* Created by eze on 2015.09.21..
*/
public interface OutgoingIntraActorTransactionHandler {
public void handleTransaction(OutgoingIntraActorTransactionWrapper transaction, CryptoStatus cryptoStatus) throws OutgoingIntraActorCantHandleTransactionException;
}
| mit |
deviqllc/Eventos | Eventos.Core/EventoExceptions.cs | 814 | using System;
using Eventos.Core.Interfaces;
namespace Eventos.Core.Exceptions
{
public class EventoException : Exception
{
public EventoException () : base()
{
}
public EventoException(string Message) : base(Message)
{
}
}
public class EventoExecutionPlanException : EventoException
{
public EventoExecutionPlanException() : base()
{
}
public EventoExecutionPlanException(string Message) : base(Message)
{
}
}
public class EmptyExecutionPlanException : EventoExecutionPlanException
{
public EmptyExecutionPlanException() : base("Current Execution Plan has no registered eventos.")
{
}
public EmptyExecutionPlanException(string ExecutionPlanName) : base(string.Format ("Execution Plan with name '{0}' has no registered eventos.", ExecutionPlanName))
{
}
}
}
| mit |
smihica/Fashion | compile.py | 4514 | #!/usr/bin/python -S
import sys
import os
import re
import argparse
import random
from cStringIO import StringIO
class ApplicationException(Exception):
pass
def gencharset(spec):
retval = u''
for item in re.finditer(ur'([^\\-]|\\-|\\\\)(?:-([^\\-]|\\-|\\\\))?', spec):
if item.group(2):
retval += ''.join(unichr(c) for c in range(ord(item.group(1)), ord(item.group(2)) + 1))
else:
retval += item.group(1)
return retval
class IDGenerator(object):
INITIAL_CHARS = gencharset("A-Za-z_")
SUCCEEDING_CHARS = gencharset("0-9A-Za-Z_")
def __init__(self):
self.generated = set()
def __call__(self):
retval = random.choice(self.__class__.INITIAL_CHARS)
for i in range(0, 15):
retval += random.choice(self.__class__.SUCCEEDING_CHARS)
return retval
class Processor(object):
def __init__(self):
self.included_files = set()
self.search_path = set(['.'])
self.libs = {}
self.out = StringIO()
self.idgen = IDGenerator()
def lookup_file(self, file, includer=None):
for dir in self.search_path:
if os.path.isabs(dir):
path = os.path.join(dir, file)
else:
if includer is None:
raise ApplicationException("Relative path specified but no includer given")
path = os.path.join(os.path.dirname(includer), dir, file)
if os.path.exists(path):
return os.path.normpath(path)
return None
def compose_source(self, file, out):
self.included_files.add(file)
with open(file, 'r') as f:
out.write('/** @file %s { */\n' % os.path.basename(file))
for line in f:
includes = re.findall(r'include\s*\(\"(.+?)\"\)', line)
if not includes:
def repl(match):
required_file_name = match.group(2)
required = self.lookup_file(required_file_name, file)
if required is None:
raise ApplicationException("File not found: %s" % required_file_name)
pair = self.libs.get(required)
if pair is None:
id = self.idgen()
self.libs[required] = (id, None)
out = StringIO()
self.compose_source(required, out)
pair = self.libs[required] = (id, out.getvalue())
return "__LIBS__['%s']" % pair[0]
line = re.sub(r'''require\s*\((["'])(.+)(\1)\)''', repl, line)
out.write(line)
else:
for included_file_name in includes:
included = self.lookup_file(included_file_name, file)
if included in self.included_files:
continue
if included is None:
raise ApplicationException("File not found: %s" % included_file_name)
self.compose_source(included, out)
out.write('/** @} */\n')
def read(self, file):
self.compose_source(file, self.out)
def write(self, out):
# TODO: dependency resolution
if self.libs:
out.write("(function () {\n")
out.write("var __LIBS__ = {};\n")
for path, pair in self.libs.iteritems():
out.write("__LIBS__['%s'] = (function (exports) { (function () { %s })(); return exports; })({});\n" % pair)
first = False
out.write(self.out.getvalue())
out.write("})();\n")
else:
out.write(self.out.getvalue())
def main():
argparser = argparse.ArgumentParser()
argparser.add_argument('-o', type=str)
argparser.add_argument('file', nargs='+', type=str)
options = argparser.parse_args()
if options.o is not None:
out = open(options.o, 'w')
else:
out = sys.stdout
try:
p = Processor()
for file in options.file:
p.read(os.path.abspath(file))
p.write(out)
except:
if options.o is not None:
out.close()
os.unlink(options.o)
raise
if __name__ == '__main__':
try:
main()
except ApplicationException as e:
print >>sys.stderr, e.message
| mit |
gongmingqm10/ZhihuDaily | app/src/main/java/net/gongmingqm10/zhihu/presenter/DesignersPresenter.java | 351 | package net.gongmingqm10.zhihu.presenter;
import net.gongmingqm10.zhihu.network.ZhihuApi;
public class DesignersPresenter extends Presenter<DesignersPresenter.DesignersView> {
public DesignersPresenter(DesignersView view, ZhihuApi zhihuApi) {
super(view, zhihuApi);
}
public interface DesignersView extends BaseView {
}
}
| mit |
niki-funky/Telerik_Academy | Web Development/ASP.NET MVC/TeamWork/LizardmanCinemas/LizardmanCinemas/LizardmanCinemas.Data/IRepository.cs | 350 | using System;
using System.Linq;
namespace LizardmanCinemas.Data
{
public interface IRepository<T> where T : class
{
IQueryable<T> All();
T GetById(int? id);
void Add(T entity);
void Update(T entity);
void Delete(T entity);
void Delete(int id);
void Detach(T entity);
}
}
| mit |
aL3891/RioSharp | RioSharp/RioTcpListener.cs | 6048 | using System;
using System.ComponentModel;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
namespace RioSharp
{
public class RioTcpListener : RioConnectionOrientedSocketPool
{
internal IntPtr _listenerSocket;
internal IntPtr _listenIocp;
public Action<RioSocket> OnAccepted;
public unsafe RioTcpListener(RioFixedBufferPool sendPool, RioFixedBufferPool revicePool, uint socketCount, uint maxOutstandingReceive = 2048, uint maxOutstandingSend = 2048)
: base(sendPool, revicePool, socketCount, ADDRESS_FAMILIES.AF_INET, SOCKET_TYPE.SOCK_STREAM, PROTOCOL.IPPROTO_TCP, maxOutstandingReceive, maxOutstandingSend)
{
if ((_listenerSocket = WinSock.WSASocket(adressFam, sockType, protocol, IntPtr.Zero, 0, SOCKET_FLAGS.REGISTERED_IO | SOCKET_FLAGS.WSA_FLAG_OVERLAPPED)) == IntPtr.Zero)
WinSock.ThrowLastWSAError();
int True = 1;
uint dwBytes = 0;
if (WinSock.WSAIoctlGeneral2(_listenerSocket, WinSock.SIO_LOOPBACK_FAST_PATH, &True, sizeof(int), (void*)0, 0, out dwBytes, IntPtr.Zero, IntPtr.Zero) != 0)
WinSock.ThrowLastWSAError();
if (WinSock.setsockopt(_listenerSocket, WinSock.IPPROTO_TCP, WinSock.TCP_NODELAY, &True, 4) != 0)
WinSock.ThrowLastWSAError();
if ((_listenIocp = Kernel32.CreateIoCompletionPort(_listenerSocket, _listenIocp, 0, 1)) == IntPtr.Zero)
Kernel32.ThrowLastError();
Thread AcceptIocpThread = new Thread(AcceptIocpComplete);
AcceptIocpThread.IsBackground = true;
AcceptIocpThread.Start();
}
unsafe void BeginAccept(RioConnectionOrientedSocket acceptSocket)
{
int recived = 0;
acceptSocket.ResetOverlapped();
if (!RioStatic.AcceptEx(_listenerSocket, acceptSocket.Socket, acceptSocket._adressBuffer, 0, sizeof(sockaddr_in) + 16, sizeof(sockaddr_in) + 16, out recived, acceptSocket._overlapped))
{
WinSock.ThrowLastWSAError();
}
else
{
acceptSocket.SetInUse(true);
OnAccepted(acceptSocket);
}
}
public void Listen(IPEndPoint localEP, int backlog)
{
in_addr inAddress = new in_addr();
inAddress.s_b1 = localEP.Address.GetAddressBytes()[0];
inAddress.s_b2 = localEP.Address.GetAddressBytes()[1];
inAddress.s_b3 = localEP.Address.GetAddressBytes()[2];
inAddress.s_b4 = localEP.Address.GetAddressBytes()[3];
sockaddr_in sa = new sockaddr_in();
sa.sin_family = ADDRESS_FAMILIES.AF_INET;
sa.sin_port = WinSock.htons((ushort)localEP.Port);
sa.sin_addr = inAddress;
unsafe
{
if (WinSock.bind(_listenerSocket, ref sa, sizeof(sockaddr_in)) == WinSock.SOCKET_ERROR)
WinSock.ThrowLastWSAError();
}
if (WinSock.listen(_listenerSocket, backlog) == WinSock.SOCKET_ERROR)
WinSock.ThrowLastWSAError();
foreach (var s in allSockets)
{
InitializeSocket(s);
BeginAccept(s);
}
}
unsafe void AcceptIocpComplete(object o)
{
IntPtr lpNumberOfBytes;
IntPtr lpCompletionKey;
RioNativeOverlapped* lpOverlapped = stackalloc RioNativeOverlapped[1];
while (true)
{
if (Kernel32.GetQueuedCompletionStatusRio(_listenIocp, out lpNumberOfBytes, out lpCompletionKey, out lpOverlapped, -1))
{
var res = allSockets[lpOverlapped->SocketIndex];
activeSockets.TryAdd(res.GetHashCode(), res);
void* apa = _listenerSocket.ToPointer();
if (res.SetSocketOption(SOL_SOCKET_SocketOptions.SO_UPDATE_ACCEPT_CONTEXT, &apa, IntPtr.Size) != 0)
WinSock.ThrowLastWSAError();
res.SetInUse(true);
OnAccepted(res);
}
else
{
var error = Marshal.GetLastWin32Error();
if (error == Kernel32.ERROR_ABANDONED_WAIT_0)
break;
else if (error == Kernel32.ERROR_NETNAME_DELETED)
BeginRecycle(allSockets[lpOverlapped->SocketIndex],false);
else
throw new Win32Exception(error);
}
}
}
internal override void InitializeSocket(RioConnectionOrientedSocket socket)
{
var t = TimeSpan.FromSeconds(30);
socket.SetLoopbackFastPath(true);
socket.SetTcpNoDelay(true);
socket.SendTimeout = t;
socket.ReciveTimeout = t;
}
internal override void FinalizeRecycle(RioConnectionOrientedSocket socket)
{
BeginAccept(socket);
}
protected override bool SocketIocpOk(RioConnectionOrientedSocket socket, byte status)
{
ThreadPool.QueueUserWorkItem(oo =>
{
EndRecycle((RioConnectionOrientedSocket)oo, true);
}, socket);
return false;
}
protected override bool SocketIocpError(int error, RioConnectionOrientedSocket socket, byte status)
{
if (error == Kernel32.ERROR_ABANDONED_WAIT_0)
return true;
else if (error == Kernel32.ERROR_NETNAME_DELETED)
BeginRecycle(socket,false);
else
throw new Win32Exception(error);
return false;
}
public override void Dispose()
{
Kernel32.CloseHandle(_listenIocp);
WinSock.closesocket(_listenerSocket);
base.Dispose();
}
}
}
| mit |
lupidan/Tetris | Assets/Scripts/Sounds/SoundManager.cs | 128 |
namespace Tetris
{
public interface SoundManager
{
void PlaySoundWithIdentifier(string identifier);
}
}
| mit |
CiscoUKIDCDev/HP3ParPlugin | 3PAR_Plugin/src/com/cisco/matday/ucsd/hp3par/rest/hosts/HP3ParHostList.java | 3195 | /*******************************************************************************
* Copyright (c) 2016 Cisco and/or its affiliates
* @author Matt Day
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 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.
*******************************************************************************/
package com.cisco.matday.ucsd.hp3par.rest.hosts;
import java.io.IOException;
import org.apache.commons.httpclient.HttpException;
import com.cisco.matday.ucsd.hp3par.account.HP3ParCredentials;
import com.cisco.matday.ucsd.hp3par.exceptions.InvalidHP3ParTokenException;
import com.cisco.matday.ucsd.hp3par.rest.UcsdHttpConnection;
import com.cisco.matday.ucsd.hp3par.rest.UcsdHttpConnection.httpMethod;
import com.cisco.matday.ucsd.hp3par.rest.hosts.json.HostResponse;
import com.cisco.rwhitear.threeParREST.constants.threeParRESTconstants;
import com.google.gson.Gson;
/**
* Gets a list of every host
*
* @author Matt Day
*
*/
public class HP3ParHostList {
private final HostResponse host;
private final String json;
/**
* @param loginCredentials
* Login credentials for the 3PAR system you wish to access
* @throws HttpException
* @throws IOException
* @throws InvalidHP3ParTokenException
* if the token is invalid or cannot be obtained
*/
public HP3ParHostList(HP3ParCredentials loginCredentials)
throws HttpException, IOException, InvalidHP3ParTokenException {
final UcsdHttpConnection request = new UcsdHttpConnection(loginCredentials, httpMethod.GET);
// Use defaults for GET method
request.setGetDefaults();
request.setUri(threeParRESTconstants.GET_HOSTS_URI);
request.execute();
this.json = request.getHttpResponse();
final Gson gson = new Gson();
this.host = gson.fromJson(this.json, HostResponse.class);
}
/**
* Initialise from JSON
*
* @param json
*/
public HP3ParHostList(String json) {
this.json = json;
final Gson gson = new Gson();
this.host = gson.fromJson(this.json, HostResponse.class);
}
/**
* @return Hosts information
*/
public HostResponse getHost() {
return this.host;
}
/**
* @return in JSON encoded form
*/
public String toJson() {
return this.json;
}
}
| mit |
SolidPatterns/EasySubtitle | EasySubtitle.WPF/Models/SubtitleLanguage.cs | 189 | using OSDBnet;
namespace EasySubtitle.WPF.Models
{
public class SubtitleLanguage
{
public Language Language { get; set; }
public bool Checked { get; set; }
}
} | mit |
McVago/UNO-POO | src/UNO/src/andrey/UNO/Client/Client.java | 5090 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package andrey.UNO.Client;
import andrey.UNO.Card.Card;
import andrey.UNO.Server.Action;
import andrey.UNO.Server.IServer;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
import java.util.Objects;
/**
*
* @author torre
*/
public class Client extends UnicastRemoteObject implements IClient, Runnable, Action {
private static final long serialVersionUID = 1L;
IServer server; //The server
Card card = new Card("blue", "0"); //Creates a new card to access the card's methods
private ArrayList<Card> deck = new ArrayList<>(); //Client's deck
public int ID = 0; //Unique ID for turns
private boolean playerWON = false;
private IView view;
protected Client(IServer server, IView view) throws RemoteException{
card.createCards();
this.server = server;
for(int i = 0; i < 7; i++){
deck.add(this.card.getCard());
//System.out.println(deck.get(i).value + " " + deck.get(i).color);
}
this.view = view;
view.setClient(this);
register();
}
//Registers the client into the server
private void register() throws RemoteException {
server.registerClient(this);
}
//Shows the last card played
public void retrieveCard(String color, String value) throws RemoteException {
view.retrieveCard(color, value);
}
public void retrieveDeckCount(int playerID ,int cardsLeft) throws RemoteException {
if(cardsLeft == 0){
//System.out.println("\n\n || Player " + playerID + " has won!! || ");
playerWON = true;
view.receiveMessage("El jugador "+playerID+" ha ganado!");
}
view.retrieveDeckCount(playerID, cardsLeft);
}
//Set unique ID for each client
public void setID(int ID) throws RemoteException {
this.ID = ID;
}
//Tests the card to see if it is a valid move
public boolean sendCard(String color, String value) throws RemoteException {
boolean test = server.testCard(color, value, this.ID);
for(int i = 0; i < deck.size(); i++){
if(Objects.equals(value, deck.get(i).value) && Objects.equals(value, Action.DrawFour) || Objects.equals(value, deck.get(i).value) && Objects.equals(value, Action.ColorChange)){
deck.remove(i);
break;
}
}
if(test){
int i = 0;
while(i < deck.size()){
if(Objects.equals(value, deck.get(i).value) && Objects.equals(value, Action.DrawFour) || Objects.equals(value, deck.get(i).value) && Objects.equals(value, Action.ColorChange)){
deck.remove(i);
break;
}else{
if(Objects.equals(color, deck.get(i).color) && Objects.equals(value, deck.get(i).value)){
deck.remove(i);
break;
}
}
i++;
}
server.broadcastDeckCount(deck.size());
if(deck.size() == 0)
playerWON = true;
return true;
}
return false;
}
//Recieve messages from the server (It is not your turn, Your card is not a valid move)
public void receiveMessage(String message) throws RemoteException {
view.receiveMessage(message);
}
//Add two cards to the deck
public void get2() throws RemoteException {
deck.add(card.getCard());
deck.add(card.getCard());
view.clearButtonList();
view.clearCardList();
this.printCards();
}
//Add a card to the deck
public void getnewCard() throws RemoteException {
deck.add(card.getCard());
view.clearButtonList();
view.clearCardList();
this.printCards();
}
public void printCards() throws RemoteException {
//System.out.println("\n Your Cards: ");
for(int i = 0; i < deck.size(); i++){
//System.out.println(deck.get(i).value);
view.printCards(deck.get(i).color, deck.get(i).value);
}
//System.out.println("\n\n");
}
public void skipTurn() throws RemoteException {
server.skipTurn();
}
//Run the thread for the clients
public void run() {
view.show();
try{this.printCards();}
catch(Exception e){e.printStackTrace();}
System.out.println("\nConnected, your ID is: " + ID + "\n");
while(!playerWON) {
try {
if(deck.isEmpty()){
view.gamewon();
}
view.gameloop();
}catch(Exception e) {e.printStackTrace();}
}
}
public boolean testTurn() throws RemoteException{
return server.testTurn(ID);
}
}
| mit |
georgecrawford/intro-to-docker-and-k8s-for-node-devs | demos/index.js | 5318 | const express = require('express');
const app = express();
const fs = require('fs');
const readFile = require('util').promisify(fs.readFile);
const readdir = require('util').promisify(fs.readdir);
const css = readFile('../asciinema/asciinema-player.css');
const js = readFile('../asciinema/asciinema-player.js');
const files = readdir('./')
.then(demos =>
Promise.all(
demos
.filter(demo => /\d+/.test(demo))
.map(demo => readFile(`./${demo}/out.json`))
)
)
.then(files =>
files.map((jsonString, i) => {
const json = JSON.parse(jsonString);
return {
i,
src: `<asciinema-player src="data:application/json;base64,${new Buffer(jsonString).toString('base64')}" speed="${json.speed || 1}" theme="tango" autoplay"1" preload="1" idle-time-limit="${json.idle || 1}" font-size="28px"></asciinema-player>`,
title: json.title,
};
// asciinema
// tango
// solarized-dark
// solarized-light
// monokai
})
);
app.get('*', (req, res) => {
Promise.all([
css,
js,
files,
])
.then(([css, js, files]) => {
const links = files.filter(file => file.title).map(file => {
return `<li class="link-${file.i}"><button data-index="${file.i}" href="${file.title}">${file.title}</button></li>`;
}).join('');
res.send(`
<script>window.files=${JSON.stringify(files)}</script>
<style>
body {
margin: 0;
padding: 20px;
display: flex;
align-items: center;
background-color: hotpink;
background-color: #121314;
}
.asciinema-player-wrapper:-webkit-full-screen {
background-color: #121314 !important;
}
ul {
position: absolute;
right: 0;
bottom: 0;
z-index: 1;
display: flex;
flex-direction: row;
list-style: none;
margin: 10px;
padding: 0;
width: 100%;
justify-content: space-around;
}
li button {
text-decoration: none;
color: white;
font-size: 18px;
-webkit-font-smoothing: antialiased;
font-family: Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace, 'Powerline Symbols';
color: #ccc;
padding: 3px 10px;
border-radius: 3px;
background: none;
border: none;
outline: none;
cursor: pointer;
}
li.current {
border: 1px solid #6f6d6d;
background: #222;
margin: -1px;
}
.control-bar {
display: none;
}
</style>
<ul id="links">${links}</ul>
<style>${css}</style>
<div class="container"></div>
<script>${js}</script>
<script>
const container = document.querySelector('.container');
let player;
const startDemo = i => {
const file = files.find(candidate => candidate.i === i)
container.innerHTML = file.src;
document.body.setAttribute('demo', i);
Array.from(document.querySelectorAll('li.current')).forEach(el => el.classList.remove('current'));
document.querySelector('li.link-' + i).classList.add('current');
player = container.querySelector('asciinema-player');
const wrapper = container.querySelector('.asciinema-player-wrapper');
container.status = 'playing';
player.play();
wrapper.focus();
/*wrapper.webkitRequestFullscreen();*/
player.addEventListener('play', function(e) {
console.log('play', this.currentTime, this.duration);
})
player.addEventListener('pause', function(e) {
console.log('pause', this.currentTime, this.duration);
if (this.currentTime === this.duration) {
this.dispatchEvent(new CustomEvent("end"));
}
})
player.addEventListener('end', function(e) {
container.status = 'end';
console.log('end');
})
};
const clearDemo = () => {
document.body.setAttribute('demo', 0);
container.innerHTML = '';
Array.from(document.querySelectorAll('li.current')).forEach(el => el.classList.remove('current'));
};
document.querySelector('#links').addEventListener('click', e => {
e.preventDefault();
const demo = parseInt(e.target.getAttribute('data-index'), 0);
startDemo(demo);
});
document.addEventListener('visibilitychange', () => {
console.log('visibilitychange', document.hidden)
if (container.status === 'end') {
clearDemo();
}
});
document.body.addEventListener('keydown', e => {
if (container.status !== 'playing' && e.key === ' ' && player && player.duration === player.currentTime) {
console.log('Ignoring space while video is stopped at end');
return e.preventDefault();
}
if (e.metaKey && (e.key === '[' || e.key === ']')) {
return console.log('disabled');
e.preventDefault();
const current = parseInt(document.body.getAttribute('demo'), 10) || 0;
let newDemo;
switch (e.key) {
case '[':
newDemo = current - 1;
break;
case ']':
newDemo = current + 1;
break;
}
startDemo(newDemo);
}
}, true);
</script>
`);
})
.catch(e => {
res.send(e.stack);
});
});
app.listen(5000, () => {
console.log('Listening at http://localhost:5000.');
// require('child_process').exec('"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary" --app=http://localhost:5000 --kiosk --disable-fullscreen-tab-detaching');
});
| mit |
Klaital/vitasa-web | db/migrate/20181028180519_create_work_logs.rb | 305 | class CreateWorkLogs < ActiveRecord::Migration[5.0]
def change
create_table :work_logs do |t|
t.integer :user_id
t.integer :site_id
t.datetime :start_time
t.datetime :end_time
t.boolean :approved, default: false
t.timestamps
end
end
end
| mit |
SparkartGroupInc/handlebars-helper | lib/helpers/last.js | 745 | var _isArray = require('lodash.isarray');
var _reduce = require('lodash.reduce');
module.exports = function( collection, count, options ){
options = options || count;
count = ( typeof count === 'number' ) ? count : 1;
// if collection is an object, make it an array
// otherwise we have no way to clip off the "end"
if( !_isArray( collection ) ){
var collection_array = [];
for( var key in collection ){
if( collection.hasOwnProperty( key ) ){
collection_array.push( collection[key] );
}
}
collection = collection_array;
}
var collection_last = collection.slice( -1 * count );
var result = _reduce( collection_last, function( previous, current ){
return previous + options.fn( current );
}, '' );
return result;
}; | mit |
colinmarc/impala-ruby | lib/impala/sasl_transport.rb | 3276 | require 'gssapi'
module Impala
class SASLTransport < Thrift::FramedTransport
STATUS_BYTES = 1
PAYLOAD_LENGTH_BYTES = 4
NEGOTIATION_STATUS = {
START: 0x01,
OK: 0x02,
BAD: 0x03,
ERROR: 0x04,
COMPLETE: 0x05
}
def initialize(transport, mechanism, options={})
super(transport)
@mechanism = mechanism.to_sym
@options = options
unless [:PLAIN, :GSSAPI].include? @mechanism
raise "Unknown SASL mechanism: #{@mechanism}"
end
if @mechanism == :GSSAPI
@gsscli = GSSAPI::Simple.new(@options[:host], @options[:principal])
end
end
def open
super
case @mechanism
when :PLAIN
handshake_plain!
when :GSSAPI
handshake_gssapi!
end
end
private
def handshake_plain!
username = @options.fetch(:username, 'anonymous')
password = @options.fetch(:password, 'anonymous')
token = "[PLAIN]\u0000#{username}\u0000#{password}"
write_handshake_message(NEGOTIATION_STATUS[:START], 'PLAIN')
write_handshake_message(NEGOTIATION_STATUS[:OK], token)
status, _ = read_handshake_message
case status
when NEGOTIATION_STATUS[:COMPLETE]
@open = true
when NEGOTIATION_STATUS[:OK]
raise "Failed to complete challenge exchange: only NONE supported currently"
end
end
def handshake_gssapi!
token = @gsscli.init_context
write_handshake_message(NEGOTIATION_STATUS[:START], 'GSSAPI')
write_handshake_message(NEGOTIATION_STATUS[:OK], token)
status, msg = read_handshake_message
case status
when NEGOTIATION_STATUS[:COMPLETE]
raise "Unexpected COMPLETE from server"
when NEGOTIATION_STATUS[:OK]
unless @gsscli.init_context(msg)
raise "GSSAPI: challenge provided by server could not be verified"
end
write_handshake_message(NEGOTIATION_STATUS[:OK], "")
status, msg = read_handshake_message
case status
when NEGOTIATION_STATUS[:COMPLETE]
raise "Unexpected COMPLETE from server"
when NEGOTIATION_STATUS[:OK]
unwrapped = @gsscli.unwrap_message(msg)
rewrapped = @gsscli.wrap_message(unwrapped)
write_handshake_message(NEGOTIATION_STATUS[:COMPLETE], rewrapped)
status, msg = read_handshake_message
case status
when NEGOTIATION_STATUS[:COMPLETE]
@open = true
when NEGOTIATION_STATUS[:OK]
raise "Failed to complete GSS challenge exchange"
end
end
end
end
def read_handshake_message
status, len = @transport.read(STATUS_BYTES + PAYLOAD_LENGTH_BYTES).unpack('cl>')
body = @transport.to_io.read(len)
if [NEGOTIATION_STATUS[:BAD], NEGOTIATION_STATUS[:ERROR]].include?(status)
raise "Exception from server: #{body}"
end
[status, body]
end
def write_handshake_message(status, message)
header = [status, message.length].pack('cl>')
@transport.write(header + message)
end
end
class SASLTransportFactory < Thrift::BaseTransportFactory
def get_transport(transport)
return SASLTransport.new(transport)
end
end
end
| mit |
aspose-html/Aspose.Html-for-.NET | Demos/src/Aspose.HTML.Live.Demos.UI/Controllers/BaseController.cs | 2877 | using Aspose.HTML.Live.Demos.UI.Config;
using Aspose.HTML.Live.Demos.UI.Models;
using Aspose.HTML.Live.Demos.UI.Services;
using Aspose.HTML.Live.Demos.UI.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Net.Http;
using Aspose.HTML.Live.Demos.UI.Models.Common;
using System.IO;
namespace Aspose.HTML.Live.Demos.UI.Controllers
{
public abstract class BaseController : Controller
{
/// <summary>
/// Prepare upload files and return as documents
/// </summary>
/// <param name="inputType"></param>
protected InputFiles UploadFiles(HttpRequestBase Request, string sourceFolder)
{
try
{
var pathProcessor = new PathProcessor(sourceFolder);
InputFiles documents = new InputFiles();
for (int i = 0; i < Request.Files.Count; i++)
{
HttpPostedFileBase postedFile = Request.Files[i];
if (postedFile != null)
{
// Check if File is available.
if (postedFile != null && postedFile.ContentLength > 0)
{
string _fileName = postedFile.FileName;
string _savepath = pathProcessor.SourceFolder + "\\" + System.IO.Path.GetFileName(_fileName);
postedFile.SaveAs(_savepath);
documents.Add(new InputFile(_fileName, sourceFolder, _savepath));
}
}
}
return documents;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
}
/// <summary>
/// Response when uploaded files exceed the limits
/// </summary>
protected Response BadDocumentResponse = new Response()
{
Status = "Some of your documents are corrupted",
StatusCode = 500
};
public abstract string Product { get; }
protected override void OnActionExecuted(ActionExecutedContext ctx)
{
base.OnActionExecuted(ctx);
ViewBag.Title = ViewBag.Title ?? Resources["ApplicationTitle"];
ViewBag.MetaDescription = ViewBag.MetaDescription ?? "Save time and software maintenance costs by running single instance of software, but serving multiple tenants/websites. Customization available for Joomla, Wordpress, Discourse, Confluence and other popular applications.";
}
private AsposeHTMLContext _atcContext;
/// <summary>
/// Main context object to access all the dcContent specific context info
/// </summary>
public AsposeHTMLContext AsposeHTMLContext
{
get
{
if (_atcContext == null) _atcContext = new AsposeHTMLContext(HttpContext.ApplicationInstance.Context);
return _atcContext;
}
}
private Dictionary<string, string> _resources;
/// <summary>
/// key/value pair containing all the error messages defined in resources.xml file
/// </summary>
public Dictionary<string, string> Resources
{
get
{
if (_resources == null) _resources = AsposeHTMLContext.Resources;
return _resources;
}
}
}
}
| mit |
Igor-Men/AmChartsBundle | Charts/DefaultConfigs/StackedBarChartWithNegativeValuesDefault.php | 4983 | <?php
namespace IK\AmChartsBundle\Charts\DefaultConfigs;
class StackedBarChartWithNegativeValuesDefault extends AbstractChartDefault {
protected function getChartScript() {
return '<script src="https://www.amcharts.com/lib/3/serial.js"></script>';
}
public function getDefaultJs() {
$string = '
{
"type": "serial",
"theme": "dark",
"rotate": true,
"marginBottom": 50,
"dataProvider": [{
"age": "85+",
"male": -0.1,
"female": 0.3
}, {
"age": "80-54",
"male": -0.2,
"female": 0.3
}, {
"age": "75-79",
"male": -0.3,
"female": 0.6
}, {
"age": "70-74",
"male": -0.5,
"female": 0.8
}, {
"age": "65-69",
"male": -0.8,
"female": 1.0
}, {
"age": "60-64",
"male": -1.1,
"female": 1.3
}, {
"age": "55-59",
"male": -1.7,
"female": 1.9
}, {
"age": "50-54",
"male": -2.2,
"female": 2.5
}, {
"age": "45-49",
"male": -2.8,
"female": 3.0
}, {
"age": "40-44",
"male": -3.4,
"female": 3.6
}, {
"age": "35-39",
"male": -4.2,
"female": 4.1
}, {
"age": "30-34",
"male": -5.2,
"female": 4.8
}, {
"age": "25-29",
"male": -5.6,
"female": 5.1
}, {
"age": "20-24",
"male": -5.1,
"female": 5.1
}, {
"age": "15-19",
"male": -3.8,
"female": 3.8
}, {
"age": "10-14",
"male": -3.2,
"female": 3.4
}, {
"age": "5-9",
"male": -4.4,
"female": 4.1
}, {
"age": "0-4",
"male": -5.0,
"female": 4.8
}],
"startDuration": 1,
"graphs": [{
"fillAlphas": 0.8,
"lineAlpha": 0.2,
"type": "column",
"valueField": "male",
"title": "Male",
"labelText": "[[value]]",
"clustered": false,
"labelFunction": function(item) {
return Math.abs(item.values.value);
},
"balloonFunction": function(item) {
return item.category + ": " + Math.abs(item.values.value) + "%";
}
}, {
"fillAlphas": 0.8,
"lineAlpha": 0.2,
"type": "column",
"valueField": "female",
"title": "Female",
"labelText": "[[value]]",
"clustered": false,
"labelFunction": function(item) {
return Math.abs(item.values.value);
},
"balloonFunction": function(item) {
return item.category + ": " + Math.abs(item.values.value) + "%";
}
}],
"categoryField": "age",
"categoryAxis": {
"gridPosition": "start",
"gridAlpha": 0.2,
"axisAlpha": 0
},
"valueAxes": [{
"gridAlpha": 0,
"ignoreAxisWidth": true,
"labelFunction": function(value) {
return Math.abs(value) + \'%\';
},
"guides": [{
"value": 0,
"lineAlpha": 0.2
}]
}],
"balloon": {
"fixedPosition": true
},
"chartCursor": {
"valueBalloonsEnabled": false,
"cursorAlpha": 0.05,
"fullWidth": true
},
"allLabels": [{
"text": "Male",
"x": "28%",
"y": "97%",
"bold": true,
"align": "middle"
}, {
"text": "Female",
"x": "75%",
"y": "97%",
"bold": true,
"align": "middle"
}],
"export": {
"enabled": true
}
}
';
return trim(preg_replace('/\s\s+/', ' ', $string));
}
} | mit |
weblogng/angular-weblogng | Gruntfile.js | 1709 | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: "\n\n"
},
dist: {
src: [
'src/main.js'
],
dest: 'dist/<%= pkg.name.replace(".js", "") %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name.replace(".js", "") %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name.replace(".js", "") %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
karma: {
options: {
configFile: 'karma.conf.js'
}
, unit: {
background: true
}
, continuous: {
singleRun: true, browsers: ['PhantomJS']
}
},
jshint: {
files: ['src/main.js', 'test/main.spec.js'],
options: {
globals: {
console: true,
module: true,
document: true
},
jshintrc: '.jshintrc'
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['concat', 'jshint', 'karma:continuous']
},
release: {
options: {
additionalFiles: ['bower.json']
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-release');
grunt.registerTask('test', ['jshint', 'karma:continuous']);
grunt.registerTask('default', ['concat', 'jshint', 'karma:continuous', 'uglify']);
grunt.registerTask('prerelease', ['default']);
};
| mit |
jugglinmike/es6draft | src/main/java/com/github/anba/es6draft/Executable.java | 619 | /**
* Copyright (c) 2012-2016 André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
package com.github.anba.es6draft;
import com.github.anba.es6draft.runtime.internal.RuntimeInfo;
/**
* <h1>15 ECMAScript Language: Scripts and Modules</h1>
* <ul>
* <li>15.1 Scripts
* <li>15.2 Modules
* </ul>
*/
public interface Executable {
/**
* Returns the runtime source object if available.
*
* @return the source object or {@code null} if not available
*/
RuntimeInfo.SourceObject getSourceObject();
}
| mit |
rosekrans/Lexia | src/org/lexia/core/scope/Scope.java | 2517 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.lexia.core.scope;
import org.lexia.core.format.Label;
import org.lexia.core.format.MemberListFormat;
import org.lexia.core.role.ActionRole;
/**
*
* @author genesis
*/
public class Scope {
public static final Label SCOPE = new Label("Scope");
public final ScopeName scopeName;
public final ActionRole methodRole;
protected Scope(ScopeName scopeName, ActionRole methodRole) {
this.scopeName = scopeName;
this.methodRole = methodRole;
}
public final String toURI(MemberListFormat listFormat) {
StringBuilder builder = new StringBuilder();
appendToURI(builder, listFormat);
return builder.toString();
}
public final void appendToURI(StringBuilder builder, MemberListFormat listFormat) {
listFormat.memberFormat.appendLabel(builder, SCOPE);
builder.append(listFormat.memberFormat.is);
this.appendStateToURI(builder, listFormat);
}
public final void appendStateToURI(StringBuilder builder, MemberListFormat listFormat) {
builder.append(listFormat.memberFormat.open);
this.scopeName.appendToURI(builder, listFormat.memberFormat.attributeFormat);
builder.append(listFormat.memberFormat.and);
this.methodRole.appendToURI(builder, listFormat);
builder.append(listFormat.memberFormat.close);
}
public static Scope instance(ScopeName scopeName, ActionRole methodRole) {
return new Scope(scopeName, methodRole);
}
public static final Scope A(ActionRole methodRole) {
return instance(ScopeName.A_THING, methodRole);
}
public static final Scope ALL(ActionRole methodRole) {
return instance(ScopeName.ALL_THINGS, methodRole);
}
public static final Scope ANY(ActionRole methodRole) {
return instance(ScopeName.ANY_MATCHING_THING, methodRole);
}
public static final Scope THE(ActionRole methodRole) {
return instance(ScopeName.THE_THING, methodRole);
}
public static final Scope NO(ActionRole methodRole) {
return instance(ScopeName.NO_ALLOWED_THING, methodRole);
}
public static final Scope NOT(ActionRole methodRole) {
return instance(ScopeName.NOT_THE_THING, methodRole);
}
}
| mit |
Camyul/Modul_1 | Object-Oriented-Programming/05. OOP-Principles-Part-2/02. Bank accounts/DepositAcc.cs | 1274 | namespace Bank_accounts
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class DepositAccount : Accounts, Ideposit, IWithDraw
{
public DepositAccount(Customers client, decimal balance, decimal interestRate) : base(client, balance, interestRate)
{
if (balance < 0)
{
throw new ArgumentOutOfRangeException("Deposit balans cannot be negative!");
}
}
public void AddMoney(decimal money) //Method to deposit Money
{
this.Balance += money;
}
public void WithDraw(decimal money) //Method to WithDraw Money
{
if (this.Balance - money >= 0)
{
this.Balance -= money;
}
else
{
throw new ArithmeticException("Not Enough Money!");
}
}
public override decimal CalcInterest(decimal numberMounts)
{
decimal result = 0;
if (this.Balance >= 1000)
{
result = numberMounts * this.InterestRate;
}
return result;
}
}
}
| mit |
fabiolourenzipucrs/scaling-journey | monopoly/src/test/java/edu/nsu/monopoly/PlayerTest.java | 3180 | package edu.nsu.monopoly;
import static org.junit.Assert.*;
import org.junit.*;
import edu.ncsu.monopoly.GameBoard;
import edu.ncsu.monopoly.GameMaster;
import edu.ncsu.monopoly.IOwnable;
import edu.ncsu.monopoly.MockGUI;
import edu.ncsu.monopoly.Player;
import edu.ncsu.monopoly.PropertyCell;
import edu.ncsu.monopoly.SimpleGameBoard;
public class PlayerTest {
GameMaster gameMaster;
@Before
public void setUp() throws Exception {
gameMaster = GameMaster.instance();
gameMaster.setGameBoard(new SimpleGameBoard());
gameMaster.setGUI(new MockGUI());
gameMaster.setTestMode(true);
gameMaster.reset();
}
@Test
public void testPurchaseProperty() {
gameMaster.setNumberOfPlayers(1);
gameMaster.movePlayer(0, 3);
Player player = gameMaster.getPlayer(0);
player.purchase();
assertEquals(1380, player.getMoney());
assertEquals("Blue 3", player.getProperty(0).getName());
PropertyCell cell =
(PropertyCell) gameMaster.getGameBoard().queryCell("Blue 3");
assertSame(player, cell.getTheOwner());
}
@Test
public void testSameGoCell() {
GameBoard gameboard = gameMaster.getGameBoard();
Player player1 = new Player();
Player player2 = new Player();
IOwnable go = gameboard.queryCell("Go");
assertSame(go, player1.getPosition());
assertSame(go, player2.getPosition());
}
@Test
public void testPayRentTo() {
gameMaster.setNumberOfPlayers(2);
gameMaster.movePlayer(0,4);
gameMaster.getCurrentPlayer().purchase();
gameMaster.btnEndTurnClicked();
gameMaster.movePlayer(1,4);
gameMaster.btnEndTurnClicked();
assertTrue(gameMaster.getPlayer(1).isBankrupt());
assertEquals(2800, gameMaster.getPlayer(0).getMoney());
}
@Test
public void testExchangeProperty() {
gameMaster.setNumberOfPlayers(2);
gameMaster.movePlayer(0,3);
gameMaster.getCurrentPlayer().purchase();
gameMaster.btnEndTurnClicked();
gameMaster.getPlayer(0).exchangeProperty(gameMaster.getPlayer(1));
assertEquals(1,gameMaster.getCurrentPlayer().getPropertyNumber());
}
@Test
public void testPurchaseHouse() {
gameMaster.setNumberOfPlayers(1);
gameMaster.startGame();
gameMaster.movePlayer(gameMaster.getCurrentPlayerIndex(),1);
gameMaster.getCurrentPlayer().purchase();
gameMaster.btnEndTurnClicked();
gameMaster.movePlayer(0,1);
gameMaster.getCurrentPlayer().purchase();
gameMaster.btnEndTurnClicked();
gameMaster.movePlayer(0,1);
gameMaster.getCurrentPlayer().purchase();
gameMaster.btnEndTurnClicked();
gameMaster.getCurrentPlayer().purchaseHouse("blue",2);
assertEquals("blue", gameMaster.getCurrentPlayer().getMonopolies()[0]);
assertEquals(880, gameMaster.getCurrentPlayer().getMoney());
}
@Test
public void testResetProperty() {
gameMaster.setNumberOfPlayers(1);
gameMaster.movePlayer(0,1);
gameMaster.getCurrentPlayer().purchase();
assertEquals(gameMaster.getGameBoard().getCell(1), gameMaster.getCurrentPlayer().getAllProperties()[0]);
gameMaster.getCurrentPlayer().resetProperty();
assertEquals(0,gameMaster.getCurrentPlayer().getAllProperties().length);
}
}
| mit |
adiachenko/catchy_api | app/Services/Reporters/Reporter.php | 160 | <?php
namespace App\Services\Reporters;
interface Reporter
{
public function reportMessage($message);
public function reportException($exception);
}
| mit |
Seidemann-Web/FACT-Finder-PHP-Library | src/FACTFinder/Custom/Core/XmlConfiguration.php | 1560 | <?php
namespace FACTFinder\Custom\Core;
class XmlConfiguration extends \FACTFinder\Core\XmlConfiguration
{
/**
* use user credentials of backend user instead of shop user
*
* @var bool
*/
protected $isBackendUser = false;
/**
* getChannel
*
* modified to return shop language specific channel
*
* @return string
*/
public function getChannel()
{
if(class_exists('oxRegistry')) {
$oLang = \oxRegistry::getLang();
$oConfig = \oxRegistry::getConfig();
} else {
$oLang = \oxLang::getInstance();
$oConfig = \oxConfig::getInstance();
}
$sChannel = parent::getChannel();
// #1085
if($oConfig->getConfigParam("bl_perfLoadLanguages")) {
$sChannel .= '_' . $oLang->getLanguageAbbr();
}
return $sChannel;
}
public function useBackendUser()
{
$this->isBackendUser = true;
}
public function getUserName()
{
if(!$this->isBackendUser)
return parent::getUserName();
$oConfig = class_exists('oxRegistry') ? \oxRegistry::getConfig() : \oxConfig::getInstance();
return $oConfig->getConfigParam('sSwFFAdminUser');
}
public function getPassword()
{
if(!$this->isBackendUser)
return parent::getPassword();
$oConfig = class_exists('oxRegistry') ? \oxRegistry::getConfig() : \oxConfig::getInstance();
return $oConfig->getConfigParam('sSwFFAdminPassword');
}
}
| mit |
ksdgroep/frontoffice365 | src/app/paymentinfo/paymentinfo.component.ts | 3041 | import { Component, OnInit, ViewChild } from '@angular/core';
import { Order } from '../bll/order';
import { Country } from '../bll/country';
import { Course } from '../bll/course';
import { CountryService } from '../services/country.service';
import { GlobalFunctionsService } from '../services/global-functions.service';
import { Router } from '@angular/router';
import { PostalCodeService } from '../services/postalcode.service';
import { CanComponentDeactivate } from '../validation.guard';
import { AppConfig } from '../app.config';
@Component({
moduleId: module.id,
selector: 'fo-paymentinfo',
templateUrl: './paymentinfo.component.html',
providers: [CountryService, PostalCodeService]
})
export class PaymentinfoComponent implements OnInit, CanComponentDeactivate {
order: Order;
countries: Country[];
course: Course;
formDeactivationCheck = false;
@ViewChild('contactForm') form;
constructor(protected countryService: CountryService,
protected globalFunctionsService: GlobalFunctionsService,
protected postalCodeService: PostalCodeService,
protected router: Router,
protected config: AppConfig) {
this.globalFunctionsService.showBasket(true);
this.globalFunctionsService.showTabs(true);
}
getCountries(): void {
this.countryService.getCountries().then(countries => this.countries = countries);
}
saveInfo(isValid: boolean): void {
if (isValid) {
// Show Summary
this.globalFunctionsService.enableTabs(4);
// Redirect
// TODO: Animate
window.scrollTo(0, 0);
this.router.navigate(['confirm'], {queryParamsHandling: 'merge'});
}
}
previousTab(): void {
// Redirect
// TODO: Animate
window.scrollTo(0, 0);
this.router.navigate(['students'], {queryParamsHandling: 'merge'});
}
ngOnInit(): void {
this.getCountries();
this.order = this.globalFunctionsService.getOrder();
this.course = this.globalFunctionsService.getSelectedCourse();
}
getAddress(): void {
this.postalCodeService.getAddress(this.order.InvoicePerson.PostalCode, this.order.InvoicePerson.AddressNumber)
.then(address => {
this.order.InvoicePerson.Address = address.Street;
this.order.InvoicePerson.City = address.City;
})
.catch(() => {
// Ignore Errors.
});
}
createFullName(gender: string, initials: string, middleName: string, surname: string, includeTav: boolean): string {
let fullName = includeTav ? 'T.a.v. ' : '';
if (gender) {
if (gender === 'M') {
fullName += includeTav ? 'de heer ' : 'De heer ';
} else {
fullName += includeTav ? 'mevrouw ' : 'Mevrouw ';
}
}
if (initials) {
fullName += initials + ' ';
}
if (middleName) {
fullName += middleName + ' ';
}
if (surname) {
fullName += surname;
}
return fullName;
}
canDeactivate(): boolean {
this.formDeactivationCheck = true;
return this.form.valid;
}
}
| mit |
shellyginelle/Code-With-Venus | Old/dist/extensions/extra/HTMLHinter/parser.js | 702 | define(function(require){"use strict";var slowparse=require("../../../thirdparty/slowparse/slowparse");var errorMessages=require("strings");function templatify(input,macros){if(!macros){return input.replace(new RegExp("\\[\\[[^\\]]+\\]\\]","g"),"")}return input.replace(new RegExp("\\[\\[([^\\]]+)\\]\\]","g"),function(a,b){b=b.split(".");var rep=macros[b[0]];b=b.slice(1);while(b&&b.length>0&&rep){rep=rep[b.splice(0,1)[0]]}return rep!==null&&rep!==undefined?rep:""})}function parse(input){var result=slowparse.HTML(document,input);var error;if(result.error){error={};error.message=templatify(errorMessages[result.error.type],result.error);error.cursor=result.error.cursor}return error}return parse}); | mit |
jscad/csg.js | src/primitives/arc.js | 2821 | const {EPS} = require('../math/constants')
const {radToDeg, degToRad} = require('../math/utils')
const vec2 = require('../math/vec2')
const path2 = require('../geometry/path2')
/** Construct an arc.
* @param {Object} options - options for construction
* @param {Array} [options.center=[0,0]] - center of arc
* @param {Number} [options.radius=1] - radius of arc
* @param {Number} [options.startAngle=0] - starting angle of the arc, in radians
* @param {Number} [options.endAngle=Math.PI*2] - ending angle of the arc, in radians
* @param {Number} [options.segments=16] - number of segments to create per 360 rotation
* @param {Boolean} [options.makeTangent=false] - adds line segments at both ends of the arc to ensure that the gradients at the edges are tangent
* @returns {path} new path (not closed)
*/
const arc = function (options) {
const defaults = {
center: [0, 0],
radius: 1,
startAngle: 0,
endAngle: (Math.PI * 2),
makeTangent: false,
segments: 16
}
let {center, radius, startAngle, endAngle, makeTangent, segments} = Object.assign({}, defaults, options)
if (startAngle < 0 || endAngle < 0) throw new Error('the start and end angles must be positive')
if (segments < 4) throw new Error('segments must be four or more')
startAngle = startAngle % (Math.PI * 2)
endAngle = endAngle % (Math.PI * 2)
let rotation = (Math.PI * 2)
if (startAngle < endAngle) {
rotation = endAngle - startAngle
}
if (startAngle > endAngle) {
rotation = endAngle + ((Math.PI * 2) - startAngle)
}
let minangle = Math.acos(((radius * radius) + (radius * radius) - (EPS * EPS)) / (2 * radius * radius))
let centerv = vec2.fromArray(center)
let point
let pointArray = []
if (rotation < minangle) {
// there is no rotation, just a single point
point = vec2.scale(radius, vec2.fromAngleRadians(startAngle))
vec2.add(point, point, centerv)
pointArray.push(point)
} else {
// note: add one additional step to acheive full rotation
let numsteps = Math.max(1, Math.floor(segments * (rotation / (Math.PI * 2)))) + 1
let edgestepsize = numsteps * 0.5 / rotation // step size for half a degree
if (edgestepsize > 0.25) edgestepsize = 0.25
let totalsteps = makeTangent ? (numsteps + 2) : numsteps
for (let i = 0; i <= totalsteps; i++) {
let step = i
if (makeTangent) {
step = (i - 1) * (numsteps - 2 * edgestepsize) / numsteps + edgestepsize
if (step < 0) step = 0
if (step > numsteps) step = numsteps
}
let angle = startAngle + (step * (rotation / numsteps))
point = vec2.scale(radius, vec2.fromAngleRadians(angle))
vec2.add(point, point, centerv)
pointArray.push(point)
}
}
return path2.fromPoints({close: false}, pointArray)
}
module.exports = arc
| mit |
AlfonzAlfonz/massivemanager | app/Gear/Framework/Stream.php | 1005 | <?php
namespace Gear\Framework;
class Stream extends Base
{
private static $content;
private static $handles = [];
public static function write(string $content)
{
self::$content .= $content;
foreach (self::$handles as $value)
{
fwrite($value, $content);
}
}
public static function writeLine($content)
{
$content = $content . "\n";
self::$content .= $content;
foreach (self::$handles as $value)
{
fwrite($value, $content);
}
}
public static function clear()
{
self::$content = "";
}
public static function output()
{
return self::$content;
}
public static function open($filename, $mode = "w")
{
$handle = fopen($filename, $mode);
if($handle)
{
self::$handles[] = $handle;
return true;
}
else
{
return false;
}
}
public static function close()
{
$unable = [];
foreach (self::$handles as $key => $value)
{
if(!fclose($value))
{
$unable[] = $value;
}
unset(self::$handles[$key]);
}
return $unable;
}
} | mit |
tamago-db/LinkedinImporterBundle | Form/ReceivePrivate.php | 1255 | <?php
namespace CCC\LinkedinImporterBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\EqualTo;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ReceivePrivate extends AbstractType
{
private $_liService = null;
public function __construct($li)
{
$this->_liService = $li;
}
public function configureOptions(OptionsResolverInterface $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults(array(
'csrf_protection' => false,
));
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->setMethod('GET');
$builder->add('state', HiddenType::class, array(
'constraints' => array(
new EqualTo(array('value' => $this->_liService->getState()))
),
));
$builder->add('code', HiddenType::class);
$builder->add('submit', SubmitType::class);
}
public function getBlockPrefix()
{
return '';
}
}
| mit |
koheimiya/extheano | extheano/jit.py | 7561 | '''Classes related to the auto-compilation'''
import copy
import inspect
import functools
# import types
import numpy as np
import theano
import theano.tensor as T
from .nodebuffer import UpdateCollector
class JITCompiler(object):
'''Decorator for your theano-function
You can call your theano-function without any explicit instructions to compile it. It takes a
while for the first time. Note that the type of arguments will be fixed on
the first call.
Usage:
>> f = JITCompiler( lambda x: T.sqrt((x ** 2).mean()) )
>> f([1., 2.]) # <-- implicit compilation here
array(1.5811388300841898)
>> f([3., 4., 5.]) # <-- pre-compiled function is used
array(4.08248290463863)
'''
parse = None # parser will be assigned here
def __init__(self, func, owner=None):
'''Initialize the members given the decorated function'''
functools.update_wrapper(self, func)
self.raw_func = func
self.owner = owner # owner of this instance
self.compiled_func = None # compiled function
def __call__(self, *args):
'''Call the compiled function after its compilation '''
# compile the function
if self.compiled_func is None:
self.compiled_func = Compiler().compile_with_value(
self.raw_func, args, self.owner
)
return self.compiled_func(*args)
def __get__(self, obj, objtype=None):
'''Support decorating instance methods'''
# bypass to the instance's attribute
if obj is not None:
# create the attribute for the first time
name = self.raw_func.__name__
wrapped_func = JITCompiler(self.raw_func, owner=obj)
setattr(obj, name, wrapped_func)
return wrapped_func
# work as descriptor
elif self.owner is None:
self.owner = objtype
return self
def recompile(self):
'''Lazy re-compilation'''
self.compiled_func = None
class ParsingJITCompiler(JITCompiler):
'''JITCompiler with a new feature: argument parsing
Now you can pass keyword arguments to the function
'''
def __init__(self, func, owner=None):
'''Initialize the members given the decorated function'''
functools.update_wrapper(self, func)
self.rawinfo = FuncInfo(func)
self.owner = owner # owner of this instance
self.compiled_func = None # compiled function
if owner is not None:
self.rawinfo.remove_first_key()
def __call__(self, *args, **kwargs):
'''Call the compiled function after its compilation '''
# parse the arguments with their keywords
if self.rawinfo.has_default_arg():
args = self.rawinfo.parse_args_kwargs(*args, **kwargs)
# compile the function
if self.compiled_func is None:
self.compiled_func = Compiler().compile_with_value(
self.rawinfo.func, args, self.owner
)
return self.compiled_func(*args)
def __get__(self, obj, objtype=None):
'''Support decorating instance methods'''
# bypass to the instance's attribute
if obj is not None:
# create and set the new auto-compiler as an attribute of the instance
name = self.rawinfo.func.__name__
wrapped_func = ParsingJITCompiler(self.rawinfo.func, owner=obj)
setattr(obj, name, wrapped_func)
return wrapped_func
# if the owner is a class
elif self.owner is None:
self.owner = objtype
self.rawinfo.remove_first_key()
return self
class FuncInfo(object):
'''Container of a function and its information'''
def __init__(self, func):
self.func = func
self.arginfo = self._get_keys_defdict() # arguments info
def has_default_arg(self):
'''If there are any arguments with default value or not'''
return (self.arginfo[1] is not None)
def remove_first_key(self):
'''remove the key of the first argument from arginfo'''
self.arginfo = (self.arginfo[0][1:], self.arginfo[1])
def parse_args_kwargs(self, *args, **kwargs):
'''Parse the arguments with keywords.'''
# unpack the arginfo
keys, defdict = self.arginfo
assigned = keys[:len(args)]
not_assigned = keys[len(args):]
# validate kwargs
for key in kwargs:
assert key not in assigned
assert key in keys
# integrate args and kwargs
knowns = dict(defdict, **kwargs)
parsed_args = args + tuple([knowns[key] for key in not_assigned])
return parsed_args
def _get_keys_defdict(self):
'''Get the keys and the default dictionary of the given function's
arguments
'''
# inspect argspecs
argspec = inspect.getargspec(self.func)
keys, defvals = argspec.args, argspec.defaults
# convert to (list_of_argkeys, dict_of_default_keys)
if defvals is None:
return keys, None
else:
defvals = list(defvals)
keys.reverse()
defvals.reverse()
defdict = dict(zip(keys, defvals))
keys.reverse()
return keys, defdict
class Compiler(object):
'''Compile the theano-function/method just with its arguments and owner
'''
# default options for the compilation
default_options = {'on_unused_input': 'warn'}
def compile_with_value(self, func, args=None, owner=None):
'''Compile the function with array-like objects'''
# format args
if args is None:
args = []
# cast numpy.ndarray into theano.tensor
theano_args = [self.cast2theano_var(a, 'extheano.jit.Compiler-arg-%d' % i)
for a, i in zip(args, range(len(args)))]
# compiled value with symbol
return self.compile_with_symbol(func, theano_args, owner)
def compile_with_symbol(self, func, theano_args=None, owner=None):
'''Compile the function with theano symbols'''
if theano_args is None:
theano_args = []
# initialize the shared buffers
upc = UpdateCollector()
# get the output symbols and other Theano options
theano_ret = func(*theano_args) if owner is None \
else func(owner, *theano_args)
# integrate the information of updates, givens and the other options
out = copy.copy(self.default_options)
out['outputs'] = theano_ret
out['updates'] = upc.extract_updates()
# compile the function
return theano.function(theano_args, **out)
def cast2theano_var(self, array_like, name=None):
'''Cast `numpy.ndarray` into `theano.tensor` keeping `dtype` and `ndim`
compatible
'''
# extract the information of the input value
array = np.asarray(array_like)
args = (name, array.dtype)
ndim = array.ndim
# cast with the information above
if ndim == 0:
return T.scalar(*args)
elif ndim == 1:
return T.vector(*args)
elif ndim == 2:
return T.matrix(*args)
elif ndim == 3:
return T.tensor3(*args)
elif ndim == 4:
return T.tensor4(*args)
else:
raise ValueError('extheano.jit.Compiler: Unsupported type or shape')
JITCompiler.parse = ParsingJITCompiler
| mit |
v2ray/v2ray-core | proxy/vmess/inbound/inbound.go | 10028 | // +build !confonly
package inbound
//go:generate go run v2ray.com/core/common/errors/errorgen
import (
"context"
"io"
"strings"
"sync"
"time"
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/log"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol"
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/task"
"v2ray.com/core/common/uuid"
feature_inbound "v2ray.com/core/features/inbound"
"v2ray.com/core/features/policy"
"v2ray.com/core/features/routing"
"v2ray.com/core/proxy/vmess"
"v2ray.com/core/proxy/vmess/encoding"
"v2ray.com/core/transport/internet"
)
type userByEmail struct {
sync.Mutex
cache map[string]*protocol.MemoryUser
defaultLevel uint32
defaultAlterIDs uint16
}
func newUserByEmail(config *DefaultConfig) *userByEmail {
return &userByEmail{
cache: make(map[string]*protocol.MemoryUser),
defaultLevel: config.Level,
defaultAlterIDs: uint16(config.AlterId),
}
}
func (v *userByEmail) addNoLock(u *protocol.MemoryUser) bool {
email := strings.ToLower(u.Email)
_, found := v.cache[email]
if found {
return false
}
v.cache[email] = u
return true
}
func (v *userByEmail) Add(u *protocol.MemoryUser) bool {
v.Lock()
defer v.Unlock()
return v.addNoLock(u)
}
func (v *userByEmail) Get(email string) (*protocol.MemoryUser, bool) {
email = strings.ToLower(email)
v.Lock()
defer v.Unlock()
user, found := v.cache[email]
if !found {
id := uuid.New()
rawAccount := &vmess.Account{
Id: id.String(),
AlterId: uint32(v.defaultAlterIDs),
}
account, err := rawAccount.AsAccount()
common.Must(err)
user = &protocol.MemoryUser{
Level: v.defaultLevel,
Email: email,
Account: account,
}
v.cache[email] = user
}
return user, found
}
func (v *userByEmail) Remove(email string) bool {
email = strings.ToLower(email)
v.Lock()
defer v.Unlock()
if _, found := v.cache[email]; !found {
return false
}
delete(v.cache, email)
return true
}
// Handler is an inbound connection handler that handles messages in VMess protocol.
type Handler struct {
policyManager policy.Manager
inboundHandlerManager feature_inbound.Manager
clients *vmess.TimedUserValidator
usersByEmail *userByEmail
detours *DetourConfig
sessionHistory *encoding.SessionHistory
secure bool
}
// New creates a new VMess inbound handler.
func New(ctx context.Context, config *Config) (*Handler, error) {
v := core.MustFromContext(ctx)
handler := &Handler{
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
inboundHandlerManager: v.GetFeature(feature_inbound.ManagerType()).(feature_inbound.Manager),
clients: vmess.NewTimedUserValidator(protocol.DefaultIDHash),
detours: config.Detour,
usersByEmail: newUserByEmail(config.GetDefaultValue()),
sessionHistory: encoding.NewSessionHistory(),
secure: config.SecureEncryptionOnly,
}
for _, user := range config.User {
mUser, err := user.ToMemoryUser()
if err != nil {
return nil, newError("failed to get VMess user").Base(err)
}
if err := handler.AddUser(ctx, mUser); err != nil {
return nil, newError("failed to initiate user").Base(err)
}
}
return handler, nil
}
// Close implements common.Closable.
func (h *Handler) Close() error {
return errors.Combine(
h.clients.Close(),
h.sessionHistory.Close(),
common.Close(h.usersByEmail))
}
// Network implements proxy.Inbound.Network().
func (*Handler) Network() []net.Network {
return []net.Network{net.Network_TCP}
}
func (h *Handler) GetUser(email string) *protocol.MemoryUser {
user, existing := h.usersByEmail.Get(email)
if !existing {
h.clients.Add(user)
}
return user
}
func (h *Handler) AddUser(ctx context.Context, user *protocol.MemoryUser) error {
if len(user.Email) > 0 && !h.usersByEmail.Add(user) {
return newError("User ", user.Email, " already exists.")
}
return h.clients.Add(user)
}
func (h *Handler) RemoveUser(ctx context.Context, email string) error {
if email == "" {
return newError("Email must not be empty.")
}
if !h.usersByEmail.Remove(email) {
return newError("User ", email, " not found.")
}
h.clients.Remove(email)
return nil
}
func transferResponse(timer signal.ActivityUpdater, session *encoding.ServerSession, request *protocol.RequestHeader, response *protocol.ResponseHeader, input buf.Reader, output *buf.BufferedWriter) error {
session.EncodeResponseHeader(response, output)
bodyWriter := session.EncodeResponseBody(request, output)
{
// Optimize for small response packet
data, err := input.ReadMultiBuffer()
if err != nil {
return err
}
if err := bodyWriter.WriteMultiBuffer(data); err != nil {
return err
}
}
if err := output.SetBuffered(false); err != nil {
return err
}
if err := buf.Copy(input, bodyWriter, buf.UpdateActivity(timer)); err != nil {
return err
}
if request.Option.Has(protocol.RequestOptionChunkStream) {
if err := bodyWriter.WriteMultiBuffer(buf.MultiBuffer{}); err != nil {
return err
}
}
return nil
}
func isInsecureEncryption(s protocol.SecurityType) bool {
return s == protocol.SecurityType_NONE || s == protocol.SecurityType_LEGACY || s == protocol.SecurityType_UNKNOWN
}
// Process implements proxy.Inbound.Process().
func (h *Handler) Process(ctx context.Context, network net.Network, connection internet.Connection, dispatcher routing.Dispatcher) error {
sessionPolicy := h.policyManager.ForLevel(0)
if err := connection.SetReadDeadline(time.Now().Add(sessionPolicy.Timeouts.Handshake)); err != nil {
return newError("unable to set read deadline").Base(err).AtWarning()
}
reader := &buf.BufferedReader{Reader: buf.NewReader(connection)}
svrSession := encoding.NewServerSession(h.clients, h.sessionHistory)
request, err := svrSession.DecodeRequestHeader(reader)
if err != nil {
if errors.Cause(err) != io.EOF {
log.Record(&log.AccessMessage{
From: connection.RemoteAddr(),
To: "",
Status: log.AccessRejected,
Reason: err,
})
err = newError("invalid request from ", connection.RemoteAddr()).Base(err).AtInfo()
}
return err
}
if h.secure && isInsecureEncryption(request.Security) {
log.Record(&log.AccessMessage{
From: connection.RemoteAddr(),
To: "",
Status: log.AccessRejected,
Reason: "Insecure encryption",
Email: request.User.Email,
})
return newError("client is using insecure encryption: ", request.Security)
}
if request.Command != protocol.RequestCommandMux {
ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
From: connection.RemoteAddr(),
To: request.Destination(),
Status: log.AccessAccepted,
Reason: "",
Email: request.User.Email,
})
}
newError("received request for ", request.Destination()).WriteToLog(session.ExportIDToError(ctx))
if err := connection.SetReadDeadline(time.Time{}); err != nil {
newError("unable to set back read deadline").Base(err).WriteToLog(session.ExportIDToError(ctx))
}
inbound := session.InboundFromContext(ctx)
if inbound == nil {
panic("no inbound metadata")
}
inbound.User = request.User
sessionPolicy = h.policyManager.ForLevel(request.User.Level)
ctx, cancel := context.WithCancel(ctx)
timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle)
ctx = policy.ContextWithBufferPolicy(ctx, sessionPolicy.Buffer)
link, err := dispatcher.Dispatch(ctx, request.Destination())
if err != nil {
return newError("failed to dispatch request to ", request.Destination()).Base(err)
}
requestDone := func() error {
defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly)
bodyReader := svrSession.DecodeRequestBody(request, reader)
if err := buf.Copy(bodyReader, link.Writer, buf.UpdateActivity(timer)); err != nil {
return newError("failed to transfer request").Base(err)
}
return nil
}
responseDone := func() error {
defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly)
writer := buf.NewBufferedWriter(buf.NewWriter(connection))
defer writer.Flush()
response := &protocol.ResponseHeader{
Command: h.generateCommand(ctx, request),
}
return transferResponse(timer, svrSession, request, response, link.Reader, writer)
}
var requestDonePost = task.OnSuccess(requestDone, task.Close(link.Writer))
if err := task.Run(ctx, requestDonePost, responseDone); err != nil {
common.Interrupt(link.Reader)
common.Interrupt(link.Writer)
return newError("connection ends").Base(err)
}
return nil
}
func (h *Handler) generateCommand(ctx context.Context, request *protocol.RequestHeader) protocol.ResponseCommand {
if h.detours != nil {
tag := h.detours.To
if h.inboundHandlerManager != nil {
handler, err := h.inboundHandlerManager.GetHandler(ctx, tag)
if err != nil {
newError("failed to get detour handler: ", tag).Base(err).AtWarning().WriteToLog(session.ExportIDToError(ctx))
return nil
}
proxyHandler, port, availableMin := handler.GetRandomInboundProxy()
inboundHandler, ok := proxyHandler.(*Handler)
if ok && inboundHandler != nil {
if availableMin > 255 {
availableMin = 255
}
newError("pick detour handler for port ", port, " for ", availableMin, " minutes.").AtDebug().WriteToLog(session.ExportIDToError(ctx))
user := inboundHandler.GetUser(request.User.Email)
if user == nil {
return nil
}
account := user.Account.(*vmess.MemoryAccount)
return &protocol.CommandSwitchAccount{
Port: port,
ID: account.ID.UUID(),
AlterIds: uint16(len(account.AlterIDs)),
Level: user.Level,
ValidMin: byte(availableMin),
}
}
}
}
return nil
}
func init() {
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
return New(ctx, config.(*Config))
}))
}
| mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.