code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
var Configurator = require('../lib/configurator');
var C = require('../lib/common').common();
var TestLib = require('./lib/test');
var U = require('util');
TestLib.Test( function( test, testlib, config ) {
test.testBasicSettings = function( t ) {
t.equal( config.config_file, null,
"No config file is set (testing only!)" );
// default config
t.ok( config.default_config, "There is a default config" );
t.equal( typeof( config.default_config ), 'object',
" And it's a hash" );
t.ok( Object.keys(config.default_config).length > 3,
" With keys" );
// parsed config
t.ok( config.config, "There is a parsed config" );
t.equal( typeof( config.config ), 'object',
" And it's a hash" );
t.ok( Object.keys(config.config).length > 3,
" With keys" );
// cli options
t.ok( config.opts, "Options were set" );
t.equal( typeof( config.opts ), 'object',
" And it's a hash" );
t.ok( Object.keys(config.opts ).length > 1,
" With keys" );
t.done();
};
test.testOptsToHash = function( t ) {
var hash = config._opts_to_hash([
'--int=42',
'--string=string',
'--true',
'--explicit_true=true',
'--false=false',
'-single-dash=single-dash',
'--json_hash={"foo":42}',
'--json_array=["42"]',
]);
// the above options should produce this hash
var expect = {
'int': 42,
'single-dash': 'single-dash',
'string': 'string',
'true': true,
'explicit_true': true,
'false': false,
'json_hash': {foo: 42},
'json_array': ['42'],
};
t.deepEqual( hash, expect, "Parsed hash options correctly" );
t.done();
};
testlib.run();
});
| jib/piped | test/00_configurator.js | JavaScript | mit | 2,413 |
class CreateCollections < ActiveRecord::Migration[5.0]
def change
create_table :collections do |t|
t.string :name, null: false
t.timestamps
end
end
end
| coreyja/glassy-collections | db/migrate/20161213042200_create_collections.rb | Ruby | mit | 176 |
using System;
using System.Collections.Generic;
namespace WarframeDropRatesDataParser.DropTables
{
/// <summary>
/// </summary>
[Serializable]
public sealed class MissionRewardsDropTable : DropTable
{
/// <summary>
/// </summary>
/// <param name="tableName"></param>
/// <param name="planet"></param>
/// <param name="location"></param>
/// <param name="missionType"></param>
/// <param name="items"></param>
/// <param name="isEvent"></param>
/// <param name="isExtra"></param>
public MissionRewardsDropTable(string tableName, string planet, string location, string missionType,
IEnumerable<Item> items, bool isEvent = false, bool isExtra = false)
{
TableName = tableName;
IsEvent = isEvent;
IsExtra = isExtra;
Planet = planet;
Location = location;
MissionType = missionType;
Items = items;
}
/// <summary>
/// </summary>
public override string TableName { get; }
/// <summary>
/// </summary>
public bool IsEvent { get; }
/// <summary>
/// </summary>
public bool IsExtra { get; }
/// <summary>
/// </summary>
public string Planet { get; }
/// <summary>
/// </summary>
public string Location { get; }
/// <summary>
/// </summary>
public string MissionType { get; }
/// <summary>
/// </summary>
public IEnumerable<Item> Items { get; }
/// <summary>
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj)
{
var objDropTable = obj as MissionRewardsDropTable;
if (objDropTable == null)
{
return false;
}
if (objDropTable.TableName == null || TableName == null)
{
return objDropTable.TableName == TableName;
}
return objDropTable.TableName.Equals(TableName, StringComparison.OrdinalIgnoreCase);
}
/// <summary>
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
if (string.IsNullOrEmpty(TableName))
{
return 0;
}
unchecked
{
const int hash = (int)2166136261;
return (hash * 16777619) ^ TableName.GetHashCode();
}
}
/// <summary>
/// </summary>
[Serializable]
public struct Item
{
public readonly string Rotation;
public readonly string Name;
public readonly string Rarity;
public readonly double DropChance;
public Item(string name, string rarity, double dropChance, string rotation = null)
{
Rotation = rotation;
Name = name;
Rarity = rarity;
DropChance = dropChance;
}
}
}
} | Vadim-AO/Warframe-Drop-Rates-Data | WarframeDropRatesDataParser/DropTables/MissionRewards.cs | C# | mit | 3,201 |
# Angular2 SEO
> https://github.com/angular/universal
1. Better Perceived Performance 更好的感知性能
2. Optimized for Search Engines 针对搜索引擎进行了优化
3. Site Preview 网站预览

## Angular Universal
> Server-side Rendering for Angular 2 apps
https://universal.angular.io/
## Making AJAX applications crawlable
https://developers.google.com/webmasters/ajax-crawling/docs/learn-more
https://webmasters.googleblog.com/2015/10/deprecating-our-ajax-crawling-scheme.html
http://googleresearch.blogspot.com/2009/06/speed-matters.html
## API docs
https://universal.angular.io/api/universal/index.html#typedoc-main-index
https://universal.angular.io/api/preboot/globals.html

| ufo-github/universal | Tutorials/readme.md | Markdown | mit | 994 |
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AlertModule, ButtonsModule, ModalModule } from 'ng2-bootstrap/ng2-bootstrap';
import { RegisterService } from './register.service';
import { RegisterComponent } from './register.component';
import { RegisterRoutingModule } from './register-routing.module';
import { EqualValidator } from './equal-validator.directive';
@NgModule({
declarations: [
RegisterComponent,
EqualValidator
],
imports: [
AlertModule,
ButtonsModule,
FormsModule,
HttpModule,
ModalModule,
RegisterRoutingModule
],
providers: [
RegisterService
]
})
export class RegisterModule { }
| mdwagner/cs490-egym | egym/src/main/resources/egym-ng/src/app/register/register.module.ts | TypeScript | mit | 743 |
define(function(require, exports, module) {
var template = require('template');
var Http = require('Http');
require('iscroll');
$(document).ready(function() {
var DATA = {
pageNumber: 1,
type: 2
};
var ISLOADING = false;
getDynamicList(DATA);
$('.dynamic-nav').on('tap', '.g-flex', function() {
$(this).addClass('dynamic-active');
$('.g-flex').not($(this)).removeClass('dynamic-active');
DATA.type = $(this).data('type');
DATA.pageNumber = 1;
ISLOADING = false;
initTempl();
getDynamicList(DATA);
});
function scroll() {
var docHeight = $(document).height();
var winHeight = $(window).height();
var scrTop = $('body').scrollTop();
if (scrTop >= docHeight - winHeight && ISLOADING) {
$('body').off('touchmove').append('<div class="g-loading-next"><p class="g-font-1_4em">正在加载,请稍后...</p></div>');
DATA.pageNumber++;
getDynamicList(DATA);
}
}
function getDynamicList(data) {
Http.getArticleList({
data: data,
success: function(data) {
if (data.firstPage) {
initTempl(data.list);
} else {
addList(data.list);
}
$('.g-loading-next').remove();
if (!data.lastPage) {
ISLOADING = true;
$('body').on('touchmove', scroll);
}
}
})
};
function initTempl(data) {
var html = template('dynamic_list', { list: data || [] });
$('#list').html(html);
}
function addList(data) {
var html = template('dynamic_list', { list: data || [] });
$('#list').append(html);
}
})
})
| DJinGo1201/work | LiBoHtml/js/pages/dynamic.js | JavaScript | mit | 2,057 |
<TS language="ca" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Feu clic dret per a editar l'adreça o l'etiqueta</translation>
</message>
<message>
<source>Create a new address</source>
<translation>Crea una nova adreça</translation>
</message>
<message>
<source>&New</source>
<translation>&Nova</translation>
</message>
<message>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copia l'adreça seleccionada al porta-retalls del sistema</translation>
</message>
<message>
<source>&Copy</source>
<translation>&Copia</translation>
</message>
<message>
<source>C&lose</source>
<translation>&Tanca</translation>
</message>
<message>
<source>&Copy Address</source>
<translation>&Copia l'adreça</translation>
</message>
<message>
<source>Delete the currently selected address from the list</source>
<translation>Elimina l'adreça sel·leccionada actualment de la llista</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>Exporta les dades de la pestanya actual a un fitxer</translation>
</message>
<message>
<source>&Export</source>
<translation>&Exporta</translation>
</message>
<message>
<source>&Delete</source>
<translation>&Elimina</translation>
</message>
<message>
<source>Choose the address to send coins to</source>
<translation>Trieu una adreça on voleu enviar monedes</translation>
</message>
<message>
<source>Choose the address to receive coins with</source>
<translation>Trieu l'adreça on voleu rebre monedes</translation>
</message>
<message>
<source>C&hoose</source>
<translation>T&ria</translation>
</message>
<message>
<source>Sending addresses</source>
<translation>S'estan enviant les adreces</translation>
</message>
<message>
<source>Receiving addresses</source>
<translation>S'estan rebent les adreces</translation>
</message>
<message>
<source>These are your Dotcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Aquestes són les vostres adreces de Dotcoin per enviar els pagaments. Sempre reviseu l'import i l'adreça del destinatari abans de transferir monedes.</translation>
</message>
<message>
<source>These are your Dotcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
<translation>Aquestes són les vostres adreces Dotcoin per rebre pagaments. Es recomana utilitzar una adreça nova de recepció per a cada transacció.</translation>
</message>
<message>
<source>Copy &Label</source>
<translation>Copia l'&etiqueta</translation>
</message>
<message>
<source>&Edit</source>
<translation>&Edita</translation>
</message>
<message>
<source>Export Address List</source>
<translation>Exporta la llista d'adreces</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Fitxer de separació amb comes (*.csv)</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>L'exportació ha fallat</translation>
</message>
<message>
<source>There was an error trying to save the address list to %1. Please try again.</source>
<translation>S'ha produït un error en desar la llista d'adreces a %1. Torneu-ho a provar.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<source>Label</source>
<translation>Etiqueta</translation>
</message>
<message>
<source>Address</source>
<translation>Adreça</translation>
</message>
<message>
<source>(no label)</source>
<translation>(sense etiqueta)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<source>Passphrase Dialog</source>
<translation>Diàleg de contrasenya</translation>
</message>
<message>
<source>Enter passphrase</source>
<translation>Introduïu una contrasenya</translation>
</message>
<message>
<source>New passphrase</source>
<translation>Nova contrasenya</translation>
</message>
<message>
<source>Repeat new passphrase</source>
<translation>Repetiu la nova contrasenya</translation>
</message>
<message>
<source>Encrypt wallet</source>
<translation>Encripta el moneder</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Aquesta operació requereix la contrasenya del moneder per a desbloquejar-lo.</translation>
</message>
<message>
<source>Unlock wallet</source>
<translation>Desbloqueja el moneder</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Aquesta operació requereix la contrasenya del moneder per desencriptar-lo.</translation>
</message>
<message>
<source>Decrypt wallet</source>
<translation>Desencripta el moneder</translation>
</message>
<message>
<source>Change passphrase</source>
<translation>Canvia la contrasenya</translation>
</message>
<message>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Introduïu tant la contrasenya antiga com la nova del moneder.</translation>
</message>
<message>
<source>Confirm wallet encryption</source>
<translation>Confirma l'encriptació del moneder</translation>
</message>
<message>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR DotcoinS</b>!</source>
<translation>Avís: si encripteu el vostre moneder i perdeu la contrasenya, <b>PERDREU TOTS ELS VOSTRES DotcoinS</b>!</translation>
</message>
<message>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Esteu segur que voleu encriptar el vostre moneder?</translation>
</message>
<message>
<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>IMPORTANT: Tota copia de seguretat que hàgiu realitzat hauria de ser reemplaçada pel, recentment generat, fitxer encriptat del moneder.</translation>
</message>
<message>
<source>Warning: The Caps Lock key is on!</source>
<translation>Avís: Les lletres majúscules estan activades!</translation>
</message>
<message>
<source>Wallet encrypted</source>
<translation>Moneder encriptat</translation>
</message>
<message>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Introduïu la contrasenya nova al moneder.<br/>Utilitzeu una contrasenya de <b>deu o més caràcters aleatoris</b>, o <b>vuit o més paraules</b>.</translation>
</message>
<message>
<source>Dotcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Dotcoins from being stolen by malware infecting your computer.</source>
<translation>Dotcoin es tancarà ara per acabar el procés d'encriptació. Recordeu que encriptar el moneder no protegeix completament els Dotcoins de ser robats per programari maliciós instal·lat a l'ordinador.</translation>
</message>
<message>
<source>Wallet encryption failed</source>
<translation>L'encriptació del moneder ha fallat</translation>
</message>
<message>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>L'encriptació del moneder ha fallat per un error intern. El moneder no ha estat encriptat.</translation>
</message>
<message>
<source>The supplied passphrases do not match.</source>
<translation>La contrasenya introduïda no coincideix.</translation>
</message>
<message>
<source>Wallet unlock failed</source>
<translation>El desbloqueig del moneder ha fallat</translation>
</message>
<message>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>La contrasenya introduïda per a desencriptar el moneder és incorrecta.</translation>
</message>
<message>
<source>Wallet decryption failed</source>
<translation>La desencriptació del moneder ha fallat</translation>
</message>
<message>
<source>Wallet passphrase was successfully changed.</source>
<translation>La contrasenya del moneder ha estat modificada correctament.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<source>Sign &message...</source>
<translation>Signa el &missatge...</translation>
</message>
<message>
<source>Synchronizing with network...</source>
<translation>S'està sincronitzant amb la xarxa ...</translation>
</message>
<message>
<source>&Overview</source>
<translation>&Panorama general</translation>
</message>
<message>
<source>Node</source>
<translation>Node</translation>
</message>
<message>
<source>Show general overview of wallet</source>
<translation>Mostra el panorama general del moneder</translation>
</message>
<message>
<source>&Transactions</source>
<translation>&Transaccions</translation>
</message>
<message>
<source>Browse transaction history</source>
<translation>Cerca a l'historial de transaccions</translation>
</message>
<message>
<source>E&xit</source>
<translation>S&urt</translation>
</message>
<message>
<source>Quit application</source>
<translation>Surt de l'aplicació</translation>
</message>
<message>
<source>About &Qt</source>
<translation>Quant a &Qt</translation>
</message>
<message>
<source>Show information about Qt</source>
<translation>Mostra informació sobre Qt</translation>
</message>
<message>
<source>&Options...</source>
<translation>&Opcions...</translation>
</message>
<message>
<source>&Encrypt Wallet...</source>
<translation>&Encripta el moneder...</translation>
</message>
<message>
<source>&Backup Wallet...</source>
<translation>&Realitza una còpia de seguretat del moneder...</translation>
</message>
<message>
<source>&Change Passphrase...</source>
<translation>&Canvia la contrasenya...</translation>
</message>
<message>
<source>&Sending addresses...</source>
<translation>Adreces d'e&nviament...</translation>
</message>
<message>
<source>&Receiving addresses...</source>
<translation>Adreces de &recepció</translation>
</message>
<message>
<source>Open &URI...</source>
<translation>Obre un &URI...</translation>
</message>
<message>
<source>Dotcoin Core client</source>
<translation>Client del Dotcoin Core</translation>
</message>
<message>
<source>Importing blocks from disk...</source>
<translation>S'estan important els blocs del disc...</translation>
</message>
<message>
<source>Reindexing blocks on disk...</source>
<translation>S'estan reindexant els blocs al disc...</translation>
</message>
<message>
<source>Send coins to a Dotcoin address</source>
<translation>Envia monedes a una adreça Dotcoin</translation>
</message>
<message>
<source>Modify configuration options for Dotcoin</source>
<translation>Modifica les opcions de configuració per Dotcoin</translation>
</message>
<message>
<source>Backup wallet to another location</source>
<translation>Realitza una còpia de seguretat del moneder a una altra ubicació</translation>
</message>
<message>
<source>Change the passphrase used for wallet encryption</source>
<translation>Canvia la contrasenya d'encriptació del moneder</translation>
</message>
<message>
<source>&Debug window</source>
<translation>&Finestra de depuració</translation>
</message>
<message>
<source>Open debugging and diagnostic console</source>
<translation>Obre la consola de diagnòstic i depuració</translation>
</message>
<message>
<source>&Verify message...</source>
<translation>&Verifica el missatge...</translation>
</message>
<message>
<source>Dotcoin</source>
<translation>Dotcoin</translation>
</message>
<message>
<source>Wallet</source>
<translation>Moneder</translation>
</message>
<message>
<source>&Send</source>
<translation>&Envia</translation>
</message>
<message>
<source>&Receive</source>
<translation>&Rep</translation>
</message>
<message>
<source>Show information about Dotcoin Core</source>
<translation>Mostra informació del Dotcoin Core</translation>
</message>
<message>
<source>&Show / Hide</source>
<translation>&Mostra / Amaga</translation>
</message>
<message>
<source>Show or hide the main Window</source>
<translation>Mostra o amaga la finestra principal</translation>
</message>
<message>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Encripta les claus privades pertanyents al moneder</translation>
</message>
<message>
<source>Sign messages with your Dotcoin addresses to prove you own them</source>
<translation>Signa el missatges amb la seva adreça de Dotcoin per provar que les poseeixes</translation>
</message>
<message>
<source>Verify messages to ensure they were signed with specified Dotcoin addresses</source>
<translation>Verifiqueu els missatges per assegurar-vos que han estat signats amb una adreça Dotcoin específica.</translation>
</message>
<message>
<source>&File</source>
<translation>&Fitxer</translation>
</message>
<message>
<source>&Settings</source>
<translation>&Configuració</translation>
</message>
<message>
<source>&Help</source>
<translation>&Ajuda</translation>
</message>
<message>
<source>Tabs toolbar</source>
<translation>Barra d'eines de les pestanyes</translation>
</message>
<message>
<source>Dotcoin Core</source>
<translation>Nucli de Dotcoin</translation>
</message>
<message>
<source>Request payments (generates QR codes and Dotcoin: URIs)</source>
<translation>Sol·licita pagaments (genera codis QR i Dotcoin: URI)</translation>
</message>
<message>
<source>&About Dotcoin Core</source>
<translation>&Quant al Dotcoin Core</translation>
</message>
<message>
<source>Show the list of used sending addresses and labels</source>
<translation>Mostra la llista d'adreces d'enviament i etiquetes utilitzades</translation>
</message>
<message>
<source>Show the list of used receiving addresses and labels</source>
<translation>Mostra la llista d'adreces de recepció i etiquetes utilitzades</translation>
</message>
<message>
<source>Open a Dotcoin: URI or payment request</source>
<translation>Obre una Dotcoin: sol·licitud d'URI o pagament</translation>
</message>
<message>
<source>&Command-line options</source>
<translation>Opcions de la &línia d'ordres</translation>
</message>
<message>
<source>Show the Dotcoin Core help message to get a list with possible Dotcoin command-line options</source>
<translation>Mostra el missatge d'ajuda del Dotcoin Core per obtenir una llista amb les possibles opcions de línia d'ordres de Dotcoin</translation>
</message>
<message numerus="yes">
<source>%n active connection(s) to Dotcoin network</source>
<translation><numerusform>%n connexió activa a la xarxa Dotcoin</numerusform><numerusform>%n connexions actives a la xarxa Dotcoin</numerusform></translation>
</message>
<message>
<source>No block source available...</source>
<translation>No hi ha cap font de bloc disponible...</translation>
</message>
<message numerus="yes">
<source>%n hour(s)</source>
<translation><numerusform>%n hora</numerusform><numerusform>%n hores</numerusform></translation>
</message>
<message numerus="yes">
<source>%n day(s)</source>
<translation><numerusform>%n dia</numerusform><numerusform>%n dies</numerusform></translation>
</message>
<message numerus="yes">
<source>%n week(s)</source>
<translation><numerusform>%n setmana</numerusform><numerusform>%n setmanes</numerusform></translation>
</message>
<message>
<source>%1 and %2</source>
<translation>%1 i %2</translation>
</message>
<message numerus="yes">
<source>%n year(s)</source>
<translation><numerusform>%n any</numerusform><numerusform>%n anys</numerusform></translation>
</message>
<message>
<source>%1 behind</source>
<translation>%1 darrere</translation>
</message>
<message>
<source>Last received block was generated %1 ago.</source>
<translation>El darrer bloc rebut ha estat generat fa %1.</translation>
</message>
<message>
<source>Transactions after this will not yet be visible.</source>
<translation>Les transaccions a partir d'això no seran visibles.</translation>
</message>
<message>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
<source>Warning</source>
<translation>Avís</translation>
</message>
<message>
<source>Information</source>
<translation>Informació</translation>
</message>
<message>
<source>Up to date</source>
<translation>Al dia</translation>
</message>
<message numerus="yes">
<source>Processed %n blocks of transaction history.</source>
<translation><numerusform>S'ha processat %n bloc de l'historial de transacció.</numerusform><numerusform>S'han processat %n blocs de l'historial de transacció.</numerusform></translation>
</message>
<message>
<source>Catching up...</source>
<translation>S'està posant al dia ...</translation>
</message>
<message>
<source>Sent transaction</source>
<translation>Transacció enviada</translation>
</message>
<message>
<source>Incoming transaction</source>
<translation>Transacció entrant</translation>
</message>
<message>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Data: %1\nImport: %2\n Tipus: %3\n Adreça: %4\n</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>El moneder està <b>encriptat</b> i actualment <b>desbloquejat</b></translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>El moneder està <b>encriptat</b> i actualment <b>bloquejat</b></translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<source>Network Alert</source>
<translation>Alerta de xarxa</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<source>Coin Selection</source>
<translation>Selecció de moneda</translation>
</message>
<message>
<source>Quantity:</source>
<translation>Quantitat:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Import:</translation>
</message>
<message>
<source>Priority:</source>
<translation>Prioritat:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Comissió</translation>
</message>
<message>
<source>Dust:</source>
<translation>Polsim:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Comissió posterior:</translation>
</message>
<message>
<source>Change:</source>
<translation>Canvi:</translation>
</message>
<message>
<source>(un)select all</source>
<translation>(des)selecciona-ho tot</translation>
</message>
<message>
<source>Tree mode</source>
<translation>Mode arbre</translation>
</message>
<message>
<source>List mode</source>
<translation>Mode llista</translation>
</message>
<message>
<source>Amount</source>
<translation>Import</translation>
</message>
<message>
<source>Received with label</source>
<translation>Rebut amb l'etiqueta</translation>
</message>
<message>
<source>Received with address</source>
<translation>Rebut amb l'adreça</translation>
</message>
<message>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<source>Confirmations</source>
<translation>Confirmacions</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Confirmat</translation>
</message>
<message>
<source>Priority</source>
<translation>Prioritat</translation>
</message>
<message>
<source>Copy address</source>
<translation>Copiar adreça </translation>
</message>
<message>
<source>Copy label</source>
<translation>Copiar etiqueta</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Copia l'import</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>Copiar ID de transacció</translation>
</message>
<message>
<source>Lock unspent</source>
<translation>Bloqueja sense gastar</translation>
</message>
<message>
<source>Unlock unspent</source>
<translation>Desbloqueja sense gastar</translation>
</message>
<message>
<source>Copy quantity</source>
<translation>Copia la quantitat</translation>
</message>
<message>
<source>Copy fee</source>
<translation>Copia la comissió</translation>
</message>
<message>
<source>Copy after fee</source>
<translation>Copia la comissió posterior</translation>
</message>
<message>
<source>Copy bytes</source>
<translation>Copia els bytes</translation>
</message>
<message>
<source>Copy priority</source>
<translation>Copia la prioritat</translation>
</message>
<message>
<source>Copy dust</source>
<translation>Copia el polsim</translation>
</message>
<message>
<source>Copy change</source>
<translation>Copia el canvi</translation>
</message>
<message>
<source>highest</source>
<translation>El més alt</translation>
</message>
<message>
<source>higher</source>
<translation>Més alt</translation>
</message>
<message>
<source>high</source>
<translation>Alt</translation>
</message>
<message>
<source>medium-high</source>
<translation>mig-alt</translation>
</message>
<message>
<source>medium</source>
<translation>mig</translation>
</message>
<message>
<source>low-medium</source>
<translation>baix-mig</translation>
</message>
<message>
<source>low</source>
<translation>baix</translation>
</message>
<message>
<source>lower</source>
<translation>més baix</translation>
</message>
<message>
<source>lowest</source>
<translation>el més baix</translation>
</message>
<message>
<source>(%1 locked)</source>
<translation>(%1 bloquejada)</translation>
</message>
<message>
<source>none</source>
<translation>cap</translation>
</message>
<message>
<source>Can vary +/- %1 satoshi(s) per input.</source>
<translation>Pot variar +/- %1 satoshi(s) per entrada.</translation>
</message>
<message>
<source>yes</source>
<translation>sí</translation>
</message>
<message>
<source>no</source>
<translation>no</translation>
</message>
<message>
<source>This label turns red, if the transaction size is greater than 1000 bytes.</source>
<translation>Aquesta etiqueta es posa de color vermell si la mida de la transacció és més gran de 1000 bytes.</translation>
</message>
<message>
<source>This means a fee of at least %1 per kB is required.</source>
<translation>Això comporta una comissió d'almenys %1 per kB.</translation>
</message>
<message>
<source>Can vary +/- 1 byte per input.</source>
<translation>Pot variar +/- 1 byte per entrada.</translation>
</message>
<message>
<source>Transactions with higher priority are more likely to get included into a block.</source>
<translation>Les transaccions amb una major prioritat són més propenses a ser incloses en un bloc.</translation>
</message>
<message>
<source>This label turns red, if the priority is smaller than "medium".</source>
<translation>Aquesta etiqueta es torna vermella si la prioritat és menor que «mitjana».</translation>
</message>
<message>
<source>This label turns red, if any recipient receives an amount smaller than %1.</source>
<translation>Aquesta etiqueta es torna vermella si qualsevol destinatari rep un import inferior a %1.</translation>
</message>
<message>
<source>(no label)</source>
<translation>(sense etiqueta)</translation>
</message>
<message>
<source>change from %1 (%2)</source>
<translation>canvia de %1 (%2)</translation>
</message>
<message>
<source>(change)</source>
<translation>(canvia)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<source>Edit Address</source>
<translation>Edita l'adreça</translation>
</message>
<message>
<source>&Label</source>
<translation>&Etiqueta</translation>
</message>
<message>
<source>The label associated with this address list entry</source>
<translation>L'etiqueta associada amb aquesta entrada de llista d'adreces</translation>
</message>
<message>
<source>The address associated with this address list entry. This can only be modified for sending addresses.</source>
<translation>L'adreça associada amb aquesta entrada de llista d'adreces. Només es pot modificar per a les adreces d'enviament.</translation>
</message>
<message>
<source>&Address</source>
<translation>&Adreça</translation>
</message>
<message>
<source>New receiving address</source>
<translation>Nova adreça de recepció.</translation>
</message>
<message>
<source>New sending address</source>
<translation>Nova adreça d'enviament</translation>
</message>
<message>
<source>Edit receiving address</source>
<translation>Edita les adreces de recepció</translation>
</message>
<message>
<source>Edit sending address</source>
<translation>Edita les adreces d'enviament</translation>
</message>
<message>
<source>The entered address "%1" is already in the address book.</source>
<translation>L'adreça introduïda «%1» ja és present a la llibreta d'adreces.</translation>
</message>
<message>
<source>The entered address "%1" is not a valid Dotcoin address.</source>
<translation>L'adreça introduïda «%1» no és una adreça de Dotcoin vàlida.</translation>
</message>
<message>
<source>Could not unlock wallet.</source>
<translation>No s'ha pogut desbloquejar el moneder.</translation>
</message>
<message>
<source>New key generation failed.</source>
<translation>Ha fallat la generació d'una nova clau.</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
<message>
<source>A new data directory will be created.</source>
<translation>Es crearà un nou directori de dades.</translation>
</message>
<message>
<source>name</source>
<translation>nom</translation>
</message>
<message>
<source>Directory already exists. Add %1 if you intend to create a new directory here.</source>
<translation>El directori ja existeix. Afegeix %1 si vols crear un nou directori en aquesta ubicació.</translation>
</message>
<message>
<source>Path already exists, and is not a directory.</source>
<translation>El camí ja existeix i no és cap directori.</translation>
</message>
<message>
<source>Cannot create data directory here.</source>
<translation>No es pot crear el directori de dades aquí.</translation>
</message>
</context>
<context>
<name>HelpMessageDialog</name>
<message>
<source>Dotcoin Core</source>
<translation>Nucli de Dotcoin</translation>
</message>
<message>
<source>version</source>
<translation>versió</translation>
</message>
<message>
<source>(%1-bit)</source>
<translation>(%1-bit)</translation>
</message>
<message>
<source>About Dotcoin Core</source>
<translation>Quant al Dotcoin Core</translation>
</message>
<message>
<source>Command-line options</source>
<translation>Opcions de línia d'ordres</translation>
</message>
<message>
<source>Usage:</source>
<translation>Ús:</translation>
</message>
<message>
<source>command-line options</source>
<translation>Opcions de la línia d'ordres</translation>
</message>
<message>
<source>UI options</source>
<translation>Opcions de IU</translation>
</message>
<message>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Defineix un idioma, per exemple «de_DE» (per defecte: preferències locals de sistema)</translation>
</message>
<message>
<source>Start minimized</source>
<translation>Inicia minimitzat</translation>
</message>
<message>
<source>Set SSL root certificates for payment request (default: -system-)</source>
<translation>Defineix certificats arrel SSL per a la sol·licitud de pagament (per defecte: -sistema-)</translation>
</message>
<message>
<source>Show splash screen on startup (default: 1)</source>
<translation>Mostra la finestra de benvinguda a l'inici (per defecte: 1)</translation>
</message>
<message>
<source>Choose data directory on startup (default: 0)</source>
<translation>Tria el directori de dades a l'inici (per defecte: 0)</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<source>Welcome</source>
<translation>Us donem la benviguda</translation>
</message>
<message>
<source>Welcome to Dotcoin Core.</source>
<translation>Us donem la benvinguda al Dotcoin Core.</translation>
</message>
<message>
<source>As this is the first time the program is launched, you can choose where Dotcoin Core will store its data.</source>
<translation>Atès que és la primera vegada que executeu el programa, podeu triar on emmagatzemarà el Dotcoin Core les dades.</translation>
</message>
<message>
<source>Dotcoin Core will download and store a copy of the Dotcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source>
<translation>El Dotcoin Core descarregarà i emmagatzemarà una còpia de la cadena de blocs de Dotcoin. Com a mínim s'emmagatzemaran %1 GB de dades en aquest directori, que seguiran creixent gradualment. També s'hi emmagatzemarà el moneder.</translation>
</message>
<message>
<source>Use the default data directory</source>
<translation>Utilitza el directori de dades per defecte</translation>
</message>
<message>
<source>Use a custom data directory:</source>
<translation>Utilitza un directori de dades personalitzat:</translation>
</message>
<message>
<source>Dotcoin Core</source>
<translation>Nucli de Dotcoin</translation>
</message>
<message>
<source>Error: Specified data directory "%1" cannot be created.</source>
<translation>Error: el directori de dades «%1» especificat no pot ser creat.</translation>
</message>
<message>
<source>Error</source>
<translation>Error</translation>
</message>
<message numerus="yes">
<source>%n GB of free space available</source>
<translation><numerusform>%n GB d'espai lliure disponible</numerusform><numerusform>%n GB d'espai lliure disponible</numerusform></translation>
</message>
<message numerus="yes">
<source>(of %n GB needed)</source>
<translation><numerusform>(de %n GB necessari)</numerusform><numerusform>(de %n GB necessaris)</numerusform></translation>
</message>
</context>
<context>
<name>OpenURIDialog</name>
<message>
<source>Open URI</source>
<translation>Obre un URI</translation>
</message>
<message>
<source>Open payment request from URI or file</source>
<translation>Obre una sol·licitud de pagament des d'un URI o un fitxer</translation>
</message>
<message>
<source>URI:</source>
<translation>URI:</translation>
</message>
<message>
<source>Select payment request file</source>
<translation>Selecciona un fitxer de sol·licitud de pagament</translation>
</message>
<message>
<source>Select payment request file to open</source>
<translation>Selecciona el fitxer de sol·licitud de pagament per obrir</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<source>Options</source>
<translation>Opcions</translation>
</message>
<message>
<source>&Main</source>
<translation>&Principal</translation>
</message>
<message>
<source>Automatically start Dotcoin after logging in to the system.</source>
<translation>Inicia automàticament el Dotcoin després de l'inici de sessió del sistema.</translation>
</message>
<message>
<source>&Start Dotcoin on system login</source>
<translation>&Inicia el Dotcoin a l'inici de sessió del sistema.</translation>
</message>
<message>
<source>Size of &database cache</source>
<translation>Mida de la memòria cau de la base de &dades</translation>
</message>
<message>
<source>MB</source>
<translation>MB</translation>
</message>
<message>
<source>Number of script &verification threads</source>
<translation>Nombre de fils de &verificació d'scripts</translation>
</message>
<message>
<source>Accept connections from outside</source>
<translation>Accepta connexions de fora</translation>
</message>
<message>
<source>Allow incoming connections</source>
<translation>Permet connexions entrants</translation>
</message>
<message>
<source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>
<translation>Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1)</translation>
</message>
<message>
<source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>
<translation>URL de terceres parts (p. ex. explorador de blocs) que apareix en la pestanya de transaccions com elements del menú contextual. %s en l'URL es reemplaçat pel resum de la transacció. Diferents URL estan separades per una barra vertical |.</translation>
</message>
<message>
<source>Third party transaction URLs</source>
<translation>URL de transaccions de terceres parts</translation>
</message>
<message>
<source>Active command-line options that override above options:</source>
<translation>Opcions de línies d'ordre active que sobreescriuen les opcions de dalt:</translation>
</message>
<message>
<source>Reset all client options to default.</source>
<translation>Reestableix totes les opcions del client.</translation>
</message>
<message>
<source>&Reset Options</source>
<translation>&Reestableix les opcions</translation>
</message>
<message>
<source>&Network</source>
<translation>&Xarxa</translation>
</message>
<message>
<source>(0 = auto, <0 = leave that many cores free)</source>
<translation>(0 = auto, <0 = deixa tants nuclis lliures)</translation>
</message>
<message>
<source>W&allet</source>
<translation>&Moneder</translation>
</message>
<message>
<source>Expert</source>
<translation>Expert</translation>
</message>
<message>
<source>Enable coin &control features</source>
<translation>Activa les funcions de &control de les monedes</translation>
</message>
<message>
<source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>
<translation>Si inhabiliteu la despesa d'un canvi sense confirmar, el canvi d'una transacció no pot ser utilitzat fins que la transacció no tingui com a mínim una confirmació. Això també afecta com es calcula el vostre balanç.</translation>
</message>
<message>
<source>&Spend unconfirmed change</source>
<translation>&Gasta el canvi sense confirmar</translation>
</message>
<message>
<source>Automatically open the Dotcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Obre el port del client de Dotcoin al router de forma automàtica. Això només funciona quan el router implementa UPnP i l'opció està activada.</translation>
</message>
<message>
<source>Map port using &UPnP</source>
<translation>Port obert amb &UPnP</translation>
</message>
<message>
<source>Connect to the Dotcoin network through a SOCKS5 proxy.</source>
<translation>Connecta a la xarxa Dotcoin a través d'un proxy SOCKS5.</translation>
</message>
<message>
<source>&Connect through SOCKS5 proxy (default proxy):</source>
<translation>&Connecta a través d'un proxy SOCKS5 (proxy per defecte):</translation>
</message>
<message>
<source>Proxy &IP:</source>
<translation>&IP del proxy:</translation>
</message>
<message>
<source>&Port:</source>
<translation>&Port:</translation>
</message>
<message>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Port del proxy (per exemple 9050)</translation>
</message>
<message>
<source>&Window</source>
<translation>&Finestra</translation>
</message>
<message>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Mostra només la icona de la barra en minimitzar la finestra.</translation>
</message>
<message>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimitza a la barra d'aplicacions en comptes de la barra de tasques</translation>
</message>
<message>
<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>Minimitza en comptes de sortir de la aplicació al tancar la finestra. Quan aquesta opció està activa, la aplicació només es tancarà al seleccionar Sortir al menú.</translation>
</message>
<message>
<source>M&inimize on close</source>
<translation>M&inimitza en tancar</translation>
</message>
<message>
<source>&Display</source>
<translation>&Pantalla</translation>
</message>
<message>
<source>User Interface &language:</source>
<translation>&Llengua de la interfície d'usuari:</translation>
</message>
<message>
<source>The user interface language can be set here. This setting will take effect after restarting Dotcoin.</source>
<translation>Aquí podeu definir la llengua de l'aplicació. Aquesta configuració tindrà efecte una vegada es reiniciï Dotcoin.</translation>
</message>
<message>
<source>&Unit to show amounts in:</source>
<translation>&Unitats per mostrar els imports en:</translation>
</message>
<message>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Selecciona la unitat de subdivisió per defecte per mostrar en la interfície quan s'envien monedes.</translation>
</message>
<message>
<source>Whether to show coin control features or not.</source>
<translation>Si voleu mostrar les funcions de control de monedes o no.</translation>
</message>
<message>
<source>&OK</source>
<translation>&D'acord</translation>
</message>
<message>
<source>&Cancel</source>
<translation>&Cancel·la</translation>
</message>
<message>
<source>default</source>
<translation>Per defecte</translation>
</message>
<message>
<source>none</source>
<translation>cap</translation>
</message>
<message>
<source>Confirm options reset</source>
<translation>Confirmeu el reestabliment de les opcions</translation>
</message>
<message>
<source>Client restart required to activate changes.</source>
<translation>Cal reiniciar el client per activar els canvis.</translation>
</message>
<message>
<source>Client will be shutdown, do you want to proceed?</source>
<translation>S'aturarà el client, voleu procedir?</translation>
</message>
<message>
<source>This change would require a client restart.</source>
<translation>Amb aquest canvi cal un reinici del client.</translation>
</message>
<message>
<source>The supplied proxy address is invalid.</source>
<translation>L'adreça proxy introduïda és invalida.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<source>Form</source>
<translation>Formulari</translation>
</message>
<message>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Dotcoin network after a connection is established, but this process has not completed yet.</source>
<translation>La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Dotcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara.</translation>
</message>
<message>
<source>Watch-only:</source>
<translation>Només lectura:</translation>
</message>
<message>
<source>Available:</source>
<translation>Disponible:</translation>
</message>
<message>
<source>Your current spendable balance</source>
<translation>El balanç que podeu gastar actualment</translation>
</message>
<message>
<source>Pending:</source>
<translation>Pendent:</translation>
</message>
<message>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>
<translation>Total de transaccions que encara han de confirmar-se i que encara no compten en el balanç que es pot gastar</translation>
</message>
<message>
<source>Immature:</source>
<translation>Immadur:</translation>
</message>
<message>
<source>Mined balance that has not yet matured</source>
<translation>Balanç minat que encara no ha madurat</translation>
</message>
<message>
<source>Balances</source>
<translation>Balances</translation>
</message>
<message>
<source>Total:</source>
<translation>Total:</translation>
</message>
<message>
<source>Your current total balance</source>
<translation>El balanç total actual</translation>
</message>
<message>
<source>Your current balance in watch-only addresses</source>
<translation>El vostre balanç actual en adreces de només lectura</translation>
</message>
<message>
<source>Spendable:</source>
<translation>Que es pot gastar:</translation>
</message>
<message>
<source>Recent transactions</source>
<translation>Transaccions recents</translation>
</message>
<message>
<source>Unconfirmed transactions to watch-only addresses</source>
<translation>Transaccions sense confirmar a adreces de només lectura</translation>
</message>
<message>
<source>Mined balance in watch-only addresses that has not yet matured</source>
<translation>Balanç minat en adreces de només lectura que encara no ha madurat</translation>
</message>
<message>
<source>Current total balance in watch-only addresses</source>
<translation>Balanç total actual en adreces de només lectura</translation>
</message>
<message>
<source>out of sync</source>
<translation>Fora de sincronia</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<source>URI handling</source>
<translation>Gestió d'URI</translation>
</message>
<message>
<source>Invalid payment address %1</source>
<translation>Adreça de pagament no vàlida %1</translation>
</message>
<message>
<source>Payment request rejected</source>
<translation>La sol·licitud de pagament s'ha rebutjat</translation>
</message>
<message>
<source>Payment request network doesn't match client network.</source>
<translation>La xarxa de la sol·licitud de pagament no coincideix amb la xarxa del client.</translation>
</message>
<message>
<source>Payment request has expired.</source>
<translation>La sol·licitud de pagament ha caducat.</translation>
</message>
<message>
<source>Payment request is not initialized.</source>
<translation>La sol·licitud de pagament no està inicialitzada.</translation>
</message>
<message>
<source>Requested payment amount of %1 is too small (considered dust).</source>
<translation>L'import de pagament sol·licitat %1 és massa petit (es considera polsim).</translation>
</message>
<message>
<source>Payment request error</source>
<translation>Error en la sol·licitud de pagament</translation>
</message>
<message>
<source>Cannot start Dotcoin: click-to-pay handler</source>
<translation>No es pot iniciar Dotcoin: gestor clica-per-pagar</translation>
</message>
<message>
<source>Payment request fetch URL is invalid: %1</source>
<translation>L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1</translation>
</message>
<message>
<source>URI cannot be parsed! This can be caused by an invalid Dotcoin address or malformed URI parameters.</source>
<translation>L'URI no pot ser analitzat! Això pot ser a causa d'una adreça de Dotcoin no vàlida o per paràmetres URI amb mal format.</translation>
</message>
<message>
<source>Payment request file handling</source>
<translation>Gestió de fitxers de les sol·licituds de pagament</translation>
</message>
<message>
<source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>
<translation>No es pot llegir el fitxer de la sol·licitud de pagament. Això pot ser causat per un fitxer de sol·licitud de pagament no vàlid.</translation>
</message>
<message>
<source>Unverified payment requests to custom payment scripts are unsupported.</source>
<translation>No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats.</translation>
</message>
<message>
<source>Refund from %1</source>
<translation>Reemborsament de %1</translation>
</message>
<message>
<source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>
<translation>La sol·licitud de pagament %1 és massa gran (%2 bytes, permès %3 bytes).</translation>
</message>
<message>
<source>Payment request DoS protection</source>
<translation>Protecció de DoS per a la sol·licitud de pagament</translation>
</message>
<message>
<source>Error communicating with %1: %2</source>
<translation>Error en comunicar amb %1: %2</translation>
</message>
<message>
<source>Payment request cannot be parsed!</source>
<translation>No es pot analitzar la sol·licitud de pagament!</translation>
</message>
<message>
<source>Bad response from server %1</source>
<translation>Mala resposta del servidor %1</translation>
</message>
<message>
<source>Payment acknowledged</source>
<translation>Pagament reconegut</translation>
</message>
<message>
<source>Network request error</source>
<translation>Error en la sol·licitud de xarxa</translation>
</message>
</context>
<context>
<name>PeerTableModel</name>
<message>
<source>User Agent</source>
<translation>Agent d'usuari</translation>
</message>
<message>
<source>Address/Hostname</source>
<translation>Adreça / nom de l'ordinador</translation>
</message>
<message>
<source>Ping Time</source>
<translation>Temps de ping</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Amount</source>
<translation>Import</translation>
</message>
<message>
<source>Enter a Dotcoin address (e.g. %1)</source>
<translation>Introduïu una adreça de Dotcoin (p. ex. %1)</translation>
</message>
<message>
<source>%1 d</source>
<translation>%1 d</translation>
</message>
<message>
<source>%1 h</source>
<translation>%1 h</translation>
</message>
<message>
<source>%1 m</source>
<translation>%1 m</translation>
</message>
<message>
<source>%1 s</source>
<translation>%1 s</translation>
</message>
<message>
<source>NETWORK</source>
<translation>XARXA</translation>
</message>
<message>
<source>UNKNOWN</source>
<translation>DESCONEGUT</translation>
</message>
<message>
<source>None</source>
<translation>Cap</translation>
</message>
<message>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<source>%1 ms</source>
<translation>%1 ms</translation>
</message>
</context>
<context>
<name>QRImageWidget</name>
<message>
<source>&Save Image...</source>
<translation>De&sa la imatge...</translation>
</message>
<message>
<source>&Copy Image</source>
<translation>&Copia la imatge</translation>
</message>
<message>
<source>Save QR Code</source>
<translation>Desa el codi QR</translation>
</message>
<message>
<source>PNG Image (*.png)</source>
<translation>Imatge PNG (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<source>Client name</source>
<translation>Nom del client</translation>
</message>
<message>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<source>Client version</source>
<translation>Versió del client</translation>
</message>
<message>
<source>&Information</source>
<translation>&Informació</translation>
</message>
<message>
<source>Debug window</source>
<translation>Finestra de depuració</translation>
</message>
<message>
<source>General</source>
<translation>General</translation>
</message>
<message>
<source>Using OpenSSL version</source>
<translation>Utilitzant OpenSSL versió</translation>
</message>
<message>
<source>Using BerkeleyDB version</source>
<translation>Utilitzant BerkeleyDB versió</translation>
</message>
<message>
<source>Startup time</source>
<translation>&Temps d'inici</translation>
</message>
<message>
<source>Network</source>
<translation>Xarxa</translation>
</message>
<message>
<source>Name</source>
<translation>Nom</translation>
</message>
<message>
<source>Number of connections</source>
<translation>Nombre de connexions</translation>
</message>
<message>
<source>Block chain</source>
<translation>Cadena de blocs</translation>
</message>
<message>
<source>Current number of blocks</source>
<translation>Nombre de blocs actuals</translation>
</message>
<message>
<source>Received</source>
<translation>Rebut</translation>
</message>
<message>
<source>Sent</source>
<translation>Enviat</translation>
</message>
<message>
<source>&Peers</source>
<translation>&Iguals</translation>
</message>
<message>
<source>Select a peer to view detailed information.</source>
<translation>Seleccioneu un igual per mostrar informació detallada.</translation>
</message>
<message>
<source>Direction</source>
<translation>Direcció</translation>
</message>
<message>
<source>Version</source>
<translation>Versió</translation>
</message>
<message>
<source>User Agent</source>
<translation>Agent d'usuari</translation>
</message>
<message>
<source>Services</source>
<translation>Serveis</translation>
</message>
<message>
<source>Starting Height</source>
<translation>Alçada inicial</translation>
</message>
<message>
<source>Sync Height</source>
<translation>Sincronitza l'alçada</translation>
</message>
<message>
<source>Ban Score</source>
<translation>Puntuació de bandeig</translation>
</message>
<message>
<source>Connection Time</source>
<translation>Temps de connexió</translation>
</message>
<message>
<source>Last Send</source>
<translation>Darrer enviament</translation>
</message>
<message>
<source>Last Receive</source>
<translation>Darrera recepció</translation>
</message>
<message>
<source>Bytes Sent</source>
<translation>Bytes enviats</translation>
</message>
<message>
<source>Bytes Received</source>
<translation>Bytes rebuts</translation>
</message>
<message>
<source>Ping Time</source>
<translation>Temps de ping</translation>
</message>
<message>
<source>Last block time</source>
<translation>Últim temps de bloc</translation>
</message>
<message>
<source>&Open</source>
<translation>&Obre</translation>
</message>
<message>
<source>&Console</source>
<translation>&Consola</translation>
</message>
<message>
<source>&Network Traffic</source>
<translation>Trà&nsit de la xarxa</translation>
</message>
<message>
<source>&Clear</source>
<translation>Nete&ja</translation>
</message>
<message>
<source>Totals</source>
<translation>Totals</translation>
</message>
<message>
<source>In:</source>
<translation>Dins:</translation>
</message>
<message>
<source>Out:</source>
<translation>Fora:</translation>
</message>
<message>
<source>Build date</source>
<translation>Data de compilació</translation>
</message>
<message>
<source>Debug log file</source>
<translation>Fitxer de registre de depuració</translation>
</message>
<message>
<source>Open the Dotcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Obre el fitxer de registre de depuració de Dotcoin del directori de dades actual. Això pot trigar uns quants segons per a fitxers de registre grans.</translation>
</message>
<message>
<source>Clear console</source>
<translation>Neteja la consola</translation>
</message>
<message>
<source>Welcome to the Dotcoin RPC console.</source>
<translation>Us donem la benvinguda a la consola RPC de Dotcoin</translation>
</message>
<message>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Utilitza les fletxes d'amunt i avall per navegar per l'historial, i <b>Ctrl-L<\b> per netejar la pantalla.</translation>
</message>
<message>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Escriviu <b>help<\b> per a obtenir un llistat de les ordres disponibles.</translation>
</message>
<message>
<source>%1 B</source>
<translation>%1 B</translation>
</message>
<message>
<source>%1 KB</source>
<translation>%1 KB</translation>
</message>
<message>
<source>%1 MB</source>
<translation>%1 MB</translation>
</message>
<message>
<source>%1 GB</source>
<translation>%1 GB</translation>
</message>
<message>
<source>via %1</source>
<translation>a través de %1</translation>
</message>
<message>
<source>never</source>
<translation>mai</translation>
</message>
<message>
<source>Inbound</source>
<translation>Entrant</translation>
</message>
<message>
<source>Outbound</source>
<translation>Sortint</translation>
</message>
<message>
<source>Unknown</source>
<translation>Desconegut</translation>
</message>
<message>
<source>Fetching...</source>
<translation>S'està obtenint...</translation>
</message>
</context>
<context>
<name>ReceiveCoinsDialog</name>
<message>
<source>&Amount:</source>
<translation>Im&port:</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Etiqueta:</translation>
</message>
<message>
<source>&Message:</source>
<translation>&Missatge:</translation>
</message>
<message>
<source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source>
<translation>Reutilitza una de les adreces de recepció utilitzades anteriorment. La reutilització d'adreces pot comportar problemes de seguretat i privadesa. No ho utilitzeu llevat que torneu a generar una sol·licitud de pagament feta abans.</translation>
</message>
<message>
<source>R&euse an existing receiving address (not recommended)</source>
<translation>R&eutilitza una adreça de recepció anterior (no recomanat)</translation>
</message>
<message>
<source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Dotcoin network.</source>
<translation>Un missatge opcional que s'adjuntarà a la sol·licitud de pagament, que es mostrarà quan s'obri la sol·licitud. Nota: El missatge no s'enviarà amb el pagament per la xarxa Dotcoin.</translation>
</message>
<message>
<source>An optional label to associate with the new receiving address.</source>
<translation>Una etiqueta opcional que s'associarà amb la nova adreça receptora.</translation>
</message>
<message>
<source>Use this form to request payments. All fields are <b>optional</b>.</source>
<translation>Utilitzeu aquest formulari per sol·licitar pagaments. Tots els camps són <b>opcionals</b>.</translation>
</message>
<message>
<source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>
<translation>Un import opcional per sol·licitar. Deixeu-ho en blanc o zero per no sol·licitar cap import específic.</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Esborra tots els camps del formuari.</translation>
</message>
<message>
<source>Clear</source>
<translation>Neteja</translation>
</message>
<message>
<source>Requested payments history</source>
<translation>Historial de pagaments sol·licitats</translation>
</message>
<message>
<source>&Request payment</source>
<translation>&Sol·licitud de pagament</translation>
</message>
<message>
<source>Show the selected request (does the same as double clicking an entry)</source>
<translation>Mostra la sol·licitud seleccionada (fa el mateix que el doble clic a una entrada)</translation>
</message>
<message>
<source>Show</source>
<translation>Mostra</translation>
</message>
<message>
<source>Remove the selected entries from the list</source>
<translation>Esborra les entrades seleccionades de la llista</translation>
</message>
<message>
<source>Remove</source>
<translation>Esborra</translation>
</message>
<message>
<source>Copy label</source>
<translation>Copia l'etiqueta</translation>
</message>
<message>
<source>Copy message</source>
<translation>Copia el missatge</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Copia l'import</translation>
</message>
</context>
<context>
<name>ReceiveRequestDialog</name>
<message>
<source>QR Code</source>
<translation>Codi QR</translation>
</message>
<message>
<source>Copy &URI</source>
<translation>Copia l'&URI</translation>
</message>
<message>
<source>Copy &Address</source>
<translation>Copia l'&adreça</translation>
</message>
<message>
<source>&Save Image...</source>
<translation>De&sa la imatge...</translation>
</message>
<message>
<source>Request payment to %1</source>
<translation>Sol·licita un pagament a %1</translation>
</message>
<message>
<source>Payment information</source>
<translation>Informació de pagament</translation>
</message>
<message>
<source>URI</source>
<translation>URI</translation>
</message>
<message>
<source>Address</source>
<translation>Adreça</translation>
</message>
<message>
<source>Amount</source>
<translation>Import</translation>
</message>
<message>
<source>Label</source>
<translation>Etiqueta</translation>
</message>
<message>
<source>Message</source>
<translation>Missatge</translation>
</message>
<message>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>URI resultant massa llarga, intenta reduir el text per a la etiqueta / missatge</translation>
</message>
<message>
<source>Error encoding URI into QR Code.</source>
<translation>Error en codificar l'URI en un codi QR.</translation>
</message>
</context>
<context>
<name>RecentRequestsTableModel</name>
<message>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<source>Label</source>
<translation>Etiqueta</translation>
</message>
<message>
<source>Message</source>
<translation>Missatge</translation>
</message>
<message>
<source>Amount</source>
<translation>Import</translation>
</message>
<message>
<source>(no label)</source>
<translation>(sense etiqueta)</translation>
</message>
<message>
<source>(no message)</source>
<translation>(sense missatge)</translation>
</message>
<message>
<source>(no amount)</source>
<translation>(sense import)</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<source>Send Coins</source>
<translation>Envia monedes</translation>
</message>
<message>
<source>Coin Control Features</source>
<translation>Característiques de control de les monedes</translation>
</message>
<message>
<source>Inputs...</source>
<translation>Entrades...</translation>
</message>
<message>
<source>automatically selected</source>
<translation>seleccionat automàticament</translation>
</message>
<message>
<source>Insufficient funds!</source>
<translation>Fons insuficients!</translation>
</message>
<message>
<source>Quantity:</source>
<translation>Quantitat:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Import:</translation>
</message>
<message>
<source>Priority:</source>
<translation>Prioritat:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Comissió:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Comissió posterior:</translation>
</message>
<message>
<source>Change:</source>
<translation>Canvi:</translation>
</message>
<message>
<source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>
<translation>Si s'activa això, però l'adreça de canvi està buida o bé no és vàlida, el canvi s'enviarà a una adreça generada de nou.</translation>
</message>
<message>
<source>Custom change address</source>
<translation>Personalitza l'adreça de canvi</translation>
</message>
<message>
<source>Transaction Fee:</source>
<translation>Comissió de transacció</translation>
</message>
<message>
<source>Choose...</source>
<translation>Tria...</translation>
</message>
<message>
<source>collapse fee-settings</source>
<translation>redueix els paràmetres de comissió</translation>
</message>
<message>
<source>Minimize</source>
<translation>Minimitza</translation>
</message>
<message>
<source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>
<translation>Si la comissió personalitzada es defineix a 1000 satoshis i la transacció és de només 250 bytes, llavors «per kilobyte» només es paguen 250 satoshis en una comissió, mentre que amb la de «com a mínim» es pagarien 1000 satoshis. Per a transaccions superiors al kilobyte, en tots dos casos es paga per kilobyte.</translation>
</message>
<message>
<source>per kilobyte</source>
<translation>per kilobyte</translation>
</message>
<message>
<source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>
<translation>Si la comissió personalitzada es defineix a 1000 satoshis i la transacció és de només 250 bytes, llavors «per kilobyte» només es paguen 250 satoshis en una comissió, mentre que amb la de «total com a mínim» es pagarien 1000 satoshis. Per a transaccions superiors al kilobyte, en tots dos casos es paga per kilobyte.</translation>
</message>
<message>
<source>total at least</source>
<translation>total com a mínim</translation>
</message>
<message>
<source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for Dotcoin transactions than the network can process.</source>
<translation>No hi ha cap problema en pagar només la comissió mínima sempre que hi hagi menys volum de transacció que espai en els blocs. Però tingueu present que això pot acabar en una transacció que mai es confirmi una vegada hi hagi més demanda de transaccions de Dotcoins que la xarxa pugui processar.</translation>
</message>
<message>
<source>(read the tooltip)</source>
<translation>(llegiu l'indicador de funció)</translation>
</message>
<message>
<source>Recommended:</source>
<translation>Recomanada:</translation>
</message>
<message>
<source>Custom:</source>
<translation>Personalitzada:</translation>
</message>
<message>
<source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>
<translation>(No s'ha inicialitzat encara la comissió intel·ligent. Normalment pren uns pocs blocs...)</translation>
</message>
<message>
<source>Confirmation time:</source>
<translation>Temps de confirmació:</translation>
</message>
<message>
<source>normal</source>
<translation>normal</translation>
</message>
<message>
<source>fast</source>
<translation>ràpid</translation>
</message>
<message>
<source>Send as zero-fee transaction if possible</source>
<translation>Envia com a transacció de comissió zero si és possible</translation>
</message>
<message>
<source>(confirmation may take longer)</source>
<translation>(la confirmació pot trigar més temps)</translation>
</message>
<message>
<source>Send to multiple recipients at once</source>
<translation>Envia a múltiples destinataris al mateix temps</translation>
</message>
<message>
<source>Add &Recipient</source>
<translation>Afegeix &destinatari</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Netejar tots els camps del formulari.</translation>
</message>
<message>
<source>Dust:</source>
<translation>Polsim:</translation>
</message>
<message>
<source>Clear &All</source>
<translation>Neteja-ho &tot</translation>
</message>
<message>
<source>Balance:</source>
<translation>Balanç:</translation>
</message>
<message>
<source>Confirm the send action</source>
<translation>Confirma l'acció d'enviament</translation>
</message>
<message>
<source>S&end</source>
<translation>E&nvia</translation>
</message>
<message>
<source>Confirm send coins</source>
<translation>Confirma l'enviament de monedes</translation>
</message>
<message>
<source>%1 to %2</source>
<translation>%1 a %2</translation>
</message>
<message>
<source>Copy quantity</source>
<translation>Copia la quantitat</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Copia l'import</translation>
</message>
<message>
<source>Copy fee</source>
<translation>Copia la comissió</translation>
</message>
<message>
<source>Copy after fee</source>
<translation>Copia la comissió posterior</translation>
</message>
<message>
<source>Copy bytes</source>
<translation>Copia els bytes</translation>
</message>
<message>
<source>Copy priority</source>
<translation>Copia la prioritat</translation>
</message>
<message>
<source>Copy change</source>
<translation>Copia el canvi</translation>
</message>
<message>
<source>Total Amount %1 (= %2)</source>
<translation>Import total %1 (= %2)</translation>
</message>
<message>
<source>or</source>
<translation>o</translation>
</message>
<message>
<source>The recipient address is not valid, please recheck.</source>
<translation>L'adreça de destinatari no és vàlida, si us plau comprovi-la.</translation>
</message>
<message>
<source>The amount to pay must be larger than 0.</source>
<translation>L'import a pagar ha de ser major que 0.</translation>
</message>
<message>
<source>The amount exceeds your balance.</source>
<translation>L'import supera el vostre balanç.</translation>
</message>
<message>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>El total excedeix el teu balanç quan s'afegeix la comissió a la transacció %1.</translation>
</message>
<message>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>S'ha trobat una adreça duplicada, tan sols es pot enviar a cada adreça un cop per ordre de enviament.</translation>
</message>
<message>
<source>Transaction creation failed!</source>
<translation>Ha fallat la creació de la transacció!</translation>
</message>
<message>
<source>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>S'ha rebutjat la transacció! Això pot passar si alguna de les monedes del vostre moneder ja s'han gastat; per exemple, si heu fet servir una còpia de seguretat del fitxer wallet.dat i s'haguessin gastat monedes de la còpia però sense marcar-les-hi com a gastades.</translation>
</message>
<message>
<source>A fee higher than %1 is considered an insanely high fee.</source>
<translation>Una comissió superior a %1 es considera una comissió excessiva.</translation>
</message>
<message>
<source>Pay only the minimum fee of %1</source>
<translation>Paga només la comissió mínima de %1</translation>
</message>
<message>
<source>Estimated to begin confirmation within %1 block(s).</source>
<translation>Estimat per a començar la confirmació en %1 bloc(s).</translation>
</message>
<message>
<source>Warning: Invalid Dotcoin address</source>
<translation>Avís: adreça Dotcoin no vàlida</translation>
</message>
<message>
<source>(no label)</source>
<translation>(sense etiqueta)</translation>
</message>
<message>
<source>Warning: Unknown change address</source>
<translation>Avís: adreça de canvi desconeguda</translation>
</message>
<message>
<source>Copy dust</source>
<translation>Copia el polsim</translation>
</message>
<message>
<source>Are you sure you want to send?</source>
<translation>Esteu segur que ho voleu enviar?</translation>
</message>
<message>
<source>added as transaction fee</source>
<translation>S'ha afegit una taxa de transacció</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<source>A&mount:</source>
<translation>Q&uantitat:</translation>
</message>
<message>
<source>Pay &To:</source>
<translation>Paga &a:</translation>
</message>
<message>
<source>Enter a label for this address to add it to your address book</source>
<translation>Introduïu una etiqueta per a aquesta adreça per afegir-la a la llibreta d'adreces</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Etiqueta:</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation>Escull una adreça feta servir anteriorment</translation>
</message>
<message>
<source>This is a normal payment.</source>
<translation>Això és un pagament normal.</translation>
</message>
<message>
<source>The Dotcoin address to send the payment to</source>
<translation>L'adreça Dotcoin on enviar el pagament</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alta+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Enganxar adreça del porta-retalls</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Remove this entry</source>
<translation>Elimina aquesta entrada</translation>
</message>
<message>
<source>Message:</source>
<translation>Missatge:</translation>
</message>
<message>
<source>This is a verified payment request.</source>
<translation>Aquesta és una sol·licitud de pagament verificada.</translation>
</message>
<message>
<source>Enter a label for this address to add it to the list of used addresses</source>
<translation>Introduïu una etiqueta per a aquesta adreça per afegir-la a la llista d'adreces utilitzades</translation>
</message>
<message>
<source>A message that was attached to the Dotcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Dotcoin network.</source>
<translation>Un missatge que s'ha adjuntat al Dotcoin: URI que s'emmagatzemarà amb la transacció per a la vostra referència. Nota: el missatge no s'enviarà a través de la xarxa Dotcoin.</translation>
</message>
<message>
<source>This is an unverified payment request.</source>
<translation>Aquesta és una sol·licitud de pagament no verificada.</translation>
</message>
<message>
<source>Pay To:</source>
<translation>Paga a:</translation>
</message>
<message>
<source>Memo:</source>
<translation>Memo:</translation>
</message>
</context>
<context>
<name>ShutdownWindow</name>
<message>
<source>Dotcoin Core is shutting down...</source>
<translation>S'està aturant el Dotcoin Core...</translation>
</message>
<message>
<source>Do not shut down the computer until this window disappears.</source>
<translation>No apagueu l'ordinador fins que no desaparegui aquesta finestra.</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<source>Signatures - Sign / Verify a Message</source>
<translation>Signatures - Signa / verifica un missatge</translation>
</message>
<message>
<source>&Sign Message</source>
<translation>&Signa el missatge</translation>
</message>
<message>
<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>Podeu signar missatges amb la vostra adreça per provar que són vostres. Aneu amb compte no signar qualsevol cosa, ja que els atacs de pesca electrònica (phishing) poden provar de confondre-us perquè els signeu amb la vostra identitat. Només signeu als documents completament detallats amb què hi esteu d'acord.</translation>
</message>
<message>
<source>The Dotcoin address to sign the message with</source>
<translation>L'adreça Dotcoin amb què signar el missatge</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation>Tria les adreces fetes servir amb anterioritat</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Enganxa l'adreça del porta-retalls</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Enter the message you want to sign here</source>
<translation>Introduïu aquí el missatge que voleu signar</translation>
</message>
<message>
<source>Signature</source>
<translation>Signatura</translation>
</message>
<message>
<source>Copy the current signature to the system clipboard</source>
<translation>Copia la signatura actual al porta-retalls del sistema</translation>
</message>
<message>
<source>Sign the message to prove you own this Dotcoin address</source>
<translation>Signa el missatge per provar que ets propietari d'aquesta adreça Dotcoin</translation>
</message>
<message>
<source>Sign &Message</source>
<translation>Signa el &missatge</translation>
</message>
<message>
<source>Reset all sign message fields</source>
<translation>Neteja tots els camps de clau</translation>
</message>
<message>
<source>Clear &All</source>
<translation>Neteja-ho &tot</translation>
</message>
<message>
<source>&Verify Message</source>
<translation>&Verifica el missatge</translation>
</message>
<message>
<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>Introdueixi l'adreça signant, missatge (assegura't que copies salts de línia, espais, tabuladors, etc excactament tot el text) i la signatura a sota per verificar el missatge. Per evitar ser enganyat per un atac home-entre-mig, vés amb compte de no llegir més en la signatura del que hi ha al missatge signat mateix.</translation>
</message>
<message>
<source>The Dotcoin address the message was signed with</source>
<translation>L'adreça Dotcoin amb què va ser signat el missatge</translation>
</message>
<message>
<source>Verify the message to ensure it was signed with the specified Dotcoin address</source>
<translation>Verificar el missatge per assegurar-se que ha estat signat amb una adreça Dotcoin específica</translation>
</message>
<message>
<source>Verify &Message</source>
<translation>Verifica el &missatge</translation>
</message>
<message>
<source>Reset all verify message fields</source>
<translation>Neteja tots els camps de verificació de missatge</translation>
</message>
<message>
<source>Click "Sign Message" to generate signature</source>
<translation>Feu clic a «Signa el missatge» per a generar una signatura</translation>
</message>
<message>
<source>The entered address is invalid.</source>
<translation>L'adreça introduïda no és vàlida.</translation>
</message>
<message>
<source>Please check the address and try again.</source>
<translation>Comproveu l'adreça i torneu-ho a provar.</translation>
</message>
<message>
<source>The entered address does not refer to a key.</source>
<translation>L'adreça introduïda no referencia a cap clau.</translation>
</message>
<message>
<source>Wallet unlock was cancelled.</source>
<translation>El desbloqueig del moneder ha estat cancelat.</translation>
</message>
<message>
<source>Private key for the entered address is not available.</source>
<translation>La clau privada per a la adreça introduïda no està disponible.</translation>
</message>
<message>
<source>Message signing failed.</source>
<translation>La signatura del missatge ha fallat.</translation>
</message>
<message>
<source>Message signed.</source>
<translation>Missatge signat.</translation>
</message>
<message>
<source>The signature could not be decoded.</source>
<translation>La signatura no s'ha pogut descodificar.</translation>
</message>
<message>
<source>Please check the signature and try again.</source>
<translation>Comproveu la signatura i torneu-ho a provar.</translation>
</message>
<message>
<source>The signature did not match the message digest.</source>
<translation>La signatura no coincideix amb el resum del missatge.</translation>
</message>
<message>
<source>Message verification failed.</source>
<translation>Ha fallat la verificació del missatge.</translation>
</message>
<message>
<source>Message verified.</source>
<translation>Missatge verificat.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<source>Dotcoin Core</source>
<translation>Dotcoin Core</translation>
</message>
<message>
<source>The Bitcoin Core developers</source>
<translation>Els desenvolupadors del Bitcoin Core</translation>
</message>
<message>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
</context>
<context>
<name>TrafficGraphWidget</name>
<message>
<source>KB/s</source>
<translation>KB/s</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<source>Open until %1</source>
<translation>Obert fins %1</translation>
</message>
<message>
<source>conflicted</source>
<translation>en conflicte</translation>
</message>
<message>
<source>%1/offline</source>
<translation>%1/fora de línia</translation>
</message>
<message>
<source>%1/unconfirmed</source>
<translation>%1/sense confirmar</translation>
</message>
<message>
<source>%1 confirmations</source>
<translation>%1 confirmacions</translation>
</message>
<message>
<source>Status</source>
<translation>Estat</translation>
</message>
<message numerus="yes">
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, difusió a través de %n node</numerusform><numerusform>, difusió a través de %n nodes</numerusform></translation>
</message>
<message>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<source>Source</source>
<translation>Font</translation>
</message>
<message>
<source>Generated</source>
<translation>Generat</translation>
</message>
<message>
<source>From</source>
<translation>Des de</translation>
</message>
<message>
<source>To</source>
<translation>A</translation>
</message>
<message>
<source>own address</source>
<translation>Adreça pròpia</translation>
</message>
<message>
<source>watch-only</source>
<translation>només lectura</translation>
</message>
<message>
<source>label</source>
<translation>etiqueta</translation>
</message>
<message>
<source>Credit</source>
<translation>Crèdit</translation>
</message>
<message numerus="yes">
<source>matures in %n more block(s)</source>
<translation><numerusform>disponible en %n bloc més</numerusform><numerusform>disponibles en %n blocs més</numerusform></translation>
</message>
<message>
<source>not accepted</source>
<translation>no acceptat</translation>
</message>
<message>
<source>Debit</source>
<translation>Dèbit</translation>
</message>
<message>
<source>Total debit</source>
<translation>Dèbit total</translation>
</message>
<message>
<source>Total credit</source>
<translation>Crèdit total</translation>
</message>
<message>
<source>Transaction fee</source>
<translation>Comissió de transacció</translation>
</message>
<message>
<source>Net amount</source>
<translation>Import net</translation>
</message>
<message>
<source>Message</source>
<translation>Missatge</translation>
</message>
<message>
<source>Comment</source>
<translation>Comentar</translation>
</message>
<message>
<source>Transaction ID</source>
<translation>ID de transacció</translation>
</message>
<message>
<source>Merchant</source>
<translation>Mercader</translation>
</message>
<message>
<source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "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>Les monedes generades han de madurar %1 blocs abans de poder ser gastades. Quan genereu aquest bloc, es farà saber a la xarxa per tal d'afegir-lo a la cadena de blocs. Si no pot fer-se lloc a la cadena, el seu estat canviarà a «no acceptat» i no es podrà gastar. Això pot passar ocasionalment si un altre node genera un bloc en un marge de segons respecte al vostre.</translation>
</message>
<message>
<source>Debug information</source>
<translation>Informació de depuració</translation>
</message>
<message>
<source>Transaction</source>
<translation>Transacció</translation>
</message>
<message>
<source>Inputs</source>
<translation>Entrades</translation>
</message>
<message>
<source>Amount</source>
<translation>Import</translation>
</message>
<message>
<source>true</source>
<translation>cert</translation>
</message>
<message>
<source>false</source>
<translation>fals</translation>
</message>
<message>
<source>, has not been successfully broadcast yet</source>
<translation>, encara no ha estat emès correctement</translation>
</message>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>Obre per %n bloc més</numerusform><numerusform>Obre per %n blocs més</numerusform></translation>
</message>
<message>
<source>unknown</source>
<translation>desconegut</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<source>Transaction details</source>
<translation>Detall de la transacció</translation>
</message>
<message>
<source>This pane shows a detailed description of the transaction</source>
<translation>Aquest panell mostra una descripció detallada de la transacció</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<source>Type</source>
<translation>Tipus</translation>
</message>
<message>
<source>Address</source>
<translation>Adreça</translation>
</message>
<message>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation>Immadur (%1 confirmacions, serà disponible després de %2)</translation>
</message>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>Obre per %n bloc més</numerusform><numerusform>Obre per %n blocs més</numerusform></translation>
</message>
<message>
<source>Open until %1</source>
<translation>Obert fins %1</translation>
</message>
<message>
<source>Confirmed (%1 confirmations)</source>
<translation>Confirmat (%1 confirmacions)</translation>
</message>
<message>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Aquest bloc no ha estat rebut per cap altre node i probablement no serà acceptat!</translation>
</message>
<message>
<source>Generated but not accepted</source>
<translation>Generat però no acceptat</translation>
</message>
<message>
<source>Offline</source>
<translation>Fora de línia</translation>
</message>
<message>
<source>Unconfirmed</source>
<translation>Sense confirmar</translation>
</message>
<message>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Confirmant (%1 de %2 confirmacions recomanades)</translation>
</message>
<message>
<source>Conflicted</source>
<translation>En conflicte</translation>
</message>
<message>
<source>Received with</source>
<translation>Rebut amb</translation>
</message>
<message>
<source>Received from</source>
<translation>Rebut de</translation>
</message>
<message>
<source>Sent to</source>
<translation>Enviat a</translation>
</message>
<message>
<source>Payment to yourself</source>
<translation>Pagament a un mateix</translation>
</message>
<message>
<source>Mined</source>
<translation>Minat</translation>
</message>
<message>
<source>watch-only</source>
<translation>només lectura</translation>
</message>
<message>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Estat de la transacció. Desplaceu-vos sobre aquest camp per mostrar el nombre de confirmacions.</translation>
</message>
<message>
<source>Date and time that the transaction was received.</source>
<translation>Data i hora en que la transacció va ser rebuda.</translation>
</message>
<message>
<source>Type of transaction.</source>
<translation>Tipus de transacció.</translation>
</message>
<message>
<source>Whether or not a watch-only address is involved in this transaction.</source>
<translation>Si està implicada o no una adreça només de lectura en la transacció.</translation>
</message>
<message>
<source>Destination address of transaction.</source>
<translation>Adreça del destinatari de la transacció.</translation>
</message>
<message>
<source>Amount removed from or added to balance.</source>
<translation>Import extret o afegit del balanç.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<source>All</source>
<translation>Tot</translation>
</message>
<message>
<source>Today</source>
<translation>Avui</translation>
</message>
<message>
<source>This week</source>
<translation>Aquesta setmana</translation>
</message>
<message>
<source>This month</source>
<translation>Aquest mes</translation>
</message>
<message>
<source>Last month</source>
<translation>El mes passat</translation>
</message>
<message>
<source>This year</source>
<translation>Enguany</translation>
</message>
<message>
<source>Range...</source>
<translation>Rang...</translation>
</message>
<message>
<source>Received with</source>
<translation>Rebut amb</translation>
</message>
<message>
<source>Sent to</source>
<translation>Enviat a</translation>
</message>
<message>
<source>To yourself</source>
<translation>A un mateix</translation>
</message>
<message>
<source>Mined</source>
<translation>Minat</translation>
</message>
<message>
<source>Other</source>
<translation>Altres</translation>
</message>
<message>
<source>Enter address or label to search</source>
<translation>Introduïu una adreça o una etiqueta per cercar</translation>
</message>
<message>
<source>Min amount</source>
<translation>Import mínim</translation>
</message>
<message>
<source>Copy address</source>
<translation>Copia l'adreça</translation>
</message>
<message>
<source>Copy label</source>
<translation>Copiar etiqueta</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Copia l'import</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>Copiar ID de transacció</translation>
</message>
<message>
<source>Edit label</source>
<translation>Editar etiqueta</translation>
</message>
<message>
<source>Show transaction details</source>
<translation>Mostra detalls de la transacció</translation>
</message>
<message>
<source>Export Transaction History</source>
<translation>Exporta l'historial de transacció</translation>
</message>
<message>
<source>Watch-only</source>
<translation>Només de lectura</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>L'exportació ha fallat</translation>
</message>
<message>
<source>There was an error trying to save the transaction history to %1.</source>
<translation>S'ha produït un error en provar de desar l'historial de transacció a %1.</translation>
</message>
<message>
<source>Exporting Successful</source>
<translation>Exportació amb èxit</translation>
</message>
<message>
<source>The transaction history was successfully saved to %1.</source>
<translation>L'historial de transaccions s'ha desat correctament a %1.</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Fitxer separat per comes (*.csv)</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Confirmat</translation>
</message>
<message>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<source>Type</source>
<translation>Tipus</translation>
</message>
<message>
<source>Label</source>
<translation>Etiqueta</translation>
</message>
<message>
<source>Address</source>
<translation>Adreça</translation>
</message>
<message>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<source>Range:</source>
<translation>Rang:</translation>
</message>
<message>
<source>to</source>
<translation>a</translation>
</message>
</context>
<context>
<name>UnitDisplayStatusBarControl</name>
<message>
<source>Unit to show amounts in. Click to select another unit.</source>
<translation>Unitat en què mostrar els imports. Feu clic per seleccionar una altra unitat.</translation>
</message>
</context>
<context>
<name>WalletFrame</name>
<message>
<source>No wallet has been loaded.</source>
<translation>No s'ha carregat cap moneder.</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<source>Send Coins</source>
<translation>Envia monedes</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<source>&Export</source>
<translation>&Exporta</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>Exporta les dades de la pestanya actual a un fitxer</translation>
</message>
<message>
<source>Backup Wallet</source>
<translation>Còpia de seguretat del moneder</translation>
</message>
<message>
<source>Wallet Data (*.dat)</source>
<translation>Dades del moneder (*.dat)</translation>
</message>
<message>
<source>Backup Failed</source>
<translation>Ha fallat la còpia de seguretat</translation>
</message>
<message>
<source>There was an error trying to save the wallet data to %1.</source>
<translation>S'ha produït un error en provar de desar les dades del moneder a %1.</translation>
</message>
<message>
<source>The wallet data was successfully saved to %1.</source>
<translation>S'han desat les dades del moneder correctament a %1.</translation>
</message>
<message>
<source>Backup Successful</source>
<translation>La còpia de seguretat s'ha realitzat correctament</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<source>Options:</source>
<translation>Opcions:</translation>
</message>
<message>
<source>Specify data directory</source>
<translation>Especifica el directori de dades</translation>
</message>
<message>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Connecta al node per obtenir les adreces de les connexions, i desconnecta</translation>
</message>
<message>
<source>Specify your own public address</source>
<translation>Especifiqueu la vostra adreça pública</translation>
</message>
<message>
<source>Accept command line and JSON-RPC commands</source>
<translation>Accepta la línia d'ordres i ordres JSON-RPC </translation>
</message>
<message>
<source>Run in the background as a daemon and accept commands</source>
<translation>Executa en segon pla com a programa dimoni i accepta ordres</translation>
</message>
<message>
<source>Use the test network</source>
<translation>Utilitza la xarxa de prova</translation>
</message>
<message>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Accepta connexions de fora (per defecte: 1 si no -proxy o -connect)</translation>
</message>
<message>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation>Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6</translation>
</message>
<message>
<source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>
<translation>Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici</translation>
</message>
<message>
<source>Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.</source>
<translation>Distribuït sota llicència de programari MIT. Vegeu el fitxer acompanyant COPYING o <http://www.opensource.org/licenses/mit-license.php>.</translation>
</message>
<message>
<source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source>
<translation>Entra en el mode de proves de regressió, que utilitza una cadena especial en què els blocs poden resoldre's al moment.</translation>
</message>
<message>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Executa una ordre quan una transacció del moneder canviï (%s en cmd es canvia per TxID)</translation>
</message>
<message>
<source>In this mode -genproclimit controls how many blocks are generated immediately.</source>
<translation>En aquest mode -genproclimit controla quants blocs es generen immediatament.</translation>
</message>
<message>
<source>Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)</source>
<translation>Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, <0 = deixa tants nuclis lliures, per defecte: %d)</translation>
</message>
<message>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>Aquesta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda</translation>
</message>
<message>
<source>Unable to bind to %s on this computer. Dotcoin Core is probably already running.</source>
<translation>No es pot enllaçar %s a aquest ordinador. El Dotcoin Core probablement ja estigui executant-s'hi.</translation>
</message>
<message>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Avís: el -paytxfee és molt elevat! Aquesta és la comissió de transacció que pagareu si envieu una transacció.</translation>
</message>
<message>
<source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>
<translation>Avís: la xarxa no sembla que hi estigui plenament d'acord. Alguns miners sembla que estan experimentant problemes.</translation>
</message>
<message>
<source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>Avís: sembla que no estem plenament d'acord amb els nostres iguals! Podria caler que actualitzar l'aplicació, o potser que ho facin altres nodes.</translation>
</message>
<message>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Avís: error en llegir el fitxer wallet.dat! Totes les claus es llegeixen correctament, però hi ha dades de transaccions o entrades de la llibreta d'adreces absents o bé son incorrectes.</translation>
</message>
<message>
<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>Avís: el fitxer wallet.dat és corrupte, dades rescatades! L'arxiu wallet.dat original ha estat desat com wallet.{estampa_temporal}.bak al directori %s; si el teu balanç o transaccions son incorrectes hauries de restaurar-lo de un backup.</translation>
</message>
<message>
<source>Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.</source>
<translation>Afegeix a la llista blanca els iguals que es connecten de la màscara de xarxa o adreça IP donada. Es pot especificar moltes vegades.</translation>
</message>
<message>
<source>(default: 1)</source>
<translation>(per defecte: 1)</translation>
</message>
<message>
<source><category> can be:</source>
<translation><category> pot ser:</translation>
</message>
<message>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Intenta recuperar les claus privades d'un fitxer wallet.dat corrupte</translation>
</message>
<message>
<source>Block creation options:</source>
<translation>Opcions de la creació de blocs:</translation>
</message>
<message>
<source>Connect only to the specified node(s)</source>
<translation>Connecta només al(s) node(s) especificats</translation>
</message>
<message>
<source>Connection options:</source>
<translation>Opcions de connexió:</translation>
</message>
<message>
<source>Corrupted block database detected</source>
<translation>S'ha detectat una base de dades de blocs corrupta</translation>
</message>
<message>
<source>Debugging/Testing options:</source>
<translation>Opcions de depuració/proves:</translation>
</message>
<message>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Descobreix la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip)</translation>
</message>
<message>
<source>Do not load the wallet and disable wallet RPC calls</source>
<translation>No carreguis el moneder i inhabilita les crides RPC del moneder</translation>
</message>
<message>
<source>Do you want to rebuild the block database now?</source>
<translation>Voleu reconstruir la base de dades de blocs ara?</translation>
</message>
<message>
<source>Error initializing block database</source>
<translation>Error carregant la base de dades de blocs</translation>
</message>
<message>
<source>Error initializing wallet database environment %s!</source>
<translation>Error inicialitzant l'entorn de la base de dades del moneder %s!</translation>
</message>
<message>
<source>Error loading block database</source>
<translation>Error carregant la base de dades del bloc</translation>
</message>
<message>
<source>Error opening block database</source>
<translation>Error en obrir la base de dades de blocs</translation>
</message>
<message>
<source>Error: A fatal internal error occured, see debug.log for details</source>
<translation>Error: s'ha produït un error intern fatal. Consulteu debug.log per a més detalls</translation>
</message>
<message>
<source>Error: Disk space is low!</source>
<translation>Error: Espai al disc baix!</translation>
</message>
<message>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això.</translation>
</message>
<message>
<source>If <category> is not supplied, output all debugging information.</source>
<translation>Si no se subministra <category>, mostra tota la informació de depuració.</translation>
</message>
<message>
<source>Importing...</source>
<translation>S'està important...</translation>
</message>
<message>
<source>Incorrect or no genesis block found. Wrong datadir for network?</source>
<translation>No s'ha trobat el bloc de gènesi o és incorrecte. El directori de dades de la xarxa és incorrecte?</translation>
</message>
<message>
<source>Invalid -onion address: '%s'</source>
<translation>Adreça -onion no vàlida: '%s'</translation>
</message>
<message>
<source>Not enough file descriptors available.</source>
<translation>No hi ha suficient descriptors de fitxers disponibles.</translation>
</message>
<message>
<source>Only connect to nodes in network <net> (ipv4, ipv6 or onion)</source>
<translation>Només connecta als nodes de la xarxa <net> (ipv4, ipv6 o onion)</translation>
</message>
<message>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation>Reconstrueix l'índex de la cadena de blocs dels fitxers actuals blk000??.dat</translation>
</message>
<message>
<source>Set database cache size in megabytes (%d to %d, default: %d)</source>
<translation>Defineix la mida de la memòria cau de la base de dades en megabytes (%d a %d, per defecte: %d)</translation>
</message>
<message>
<source>Set maximum block size in bytes (default: %d)</source>
<translation>Defineix la mida màxim del bloc en bytes (per defecte: %d)</translation>
</message>
<message>
<source>Specify wallet file (within data directory)</source>
<translation>Especifica un fitxer de moneder (dins del directori de dades)</translation>
</message>
<message>
<source>This is intended for regression testing tools and app development.</source>
<translation>Això es així per a eines de proves de regressió per al desenvolupament d'aplicacions.</translation>
</message>
<message>
<source>Use UPnP to map the listening port (default: %u)</source>
<translation>Utilitza UPnP per a mapejar el port d'escolta (per defecte: %u)</translation>
</message>
<message>
<source>Verifying blocks...</source>
<translation>S'estan verificant els blocs...</translation>
</message>
<message>
<source>Verifying wallet...</source>
<translation>S'està verificant el moneder...</translation>
</message>
<message>
<source>Wallet %s resides outside data directory %s</source>
<translation>El moneder %s resideix fora del directori de dades %s</translation>
</message>
<message>
<source>Wallet options:</source>
<translation>Opcions de moneder:</translation>
</message>
<message>
<source>You need to rebuild the database using -reindex to change -txindex</source>
<translation>Cal que reconstruïu la base de dades fent servir -reindex per canviar -txindex</translation>
</message>
<message>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Importa blocs de un fitxer blk000??.dat extern</translation>
</message>
<message>
<source>Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>
<translation>Permet les connexions JSON-RPC d'una font específica. Vàlid per a <ip> són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar aquesta opció moltes vegades</translation>
</message>
<message>
<source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>
<translation>Vincula l'adreça donada i posa a la llista blanca els iguals que s'hi connectin. Feu servir la notació [host]:port per a IPv6</translation>
</message>
<message>
<source>Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)</source>
<translation>Vincula a l'adreça donada per a escoltar les connexions JSON-RPC. Feu servir la notació [host]:port per a IPv6. Aquesta opció pot ser especificada moltes vegades (per defecte: vincula a totes les interfícies)</translation>
</message>
<message>
<source>Cannot obtain a lock on data directory %s. Dotcoin Core is probably already running.</source>
<translation>No es pot obtenir un bloqueig del directori de dades %s. El Dotcoin Core probablement ja s'estigui executant.</translation>
</message>
<message>
<source>Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u)</source>
<translation>Limita contínuament la freqüència de les transaccions gratuïtes a <n>*1000 bytes per minut (per defecte: %u)</translation>
</message>
<message>
<source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>
<translation>Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada)</translation>
</message>
<message>
<source>Error: Listening for incoming connections failed (listen returned error %s)</source>
<translation>Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s)</translation>
</message>
<message>
<source>Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>
<translation>Error: s'ha trobat un argument no permès de -socks. Ja no es pot definir més la versió de SOCKS, només s'accepten els proxies de SOCKS5.ç</translation>
</message>
<message>
<source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>
<translation>Executa l'ordre quan es rebi un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge)</translation>
</message>
<message>
<source>Fees (in DOT/Kb) smaller than this are considered zero fee for relaying (default: %s)</source>
<translation>Comissions (en DOT/Kb) inferiors a això es consideren de comissió zero per a la transmissió (per defecte: %s)</translation>
</message>
<message>
<source>Fees (in DOT/Kb) smaller than this are considered zero fee for transaction creation (default: %s)</source>
<translation>Comissions (en DOT/Kb) inferiors a això es consideren de comissió zero per a la creació de la transacció (per defecte: %s)</translation>
</message>
<message>
<source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>
<translation>Si no s'especifica una paytxfee (comissió de transacció de pagament), inclogueu suficient comissió per tal que les transaccions comencin a confirmar-se en una mitja de n blocs (per defecte: %u)</translation>
</message>
<message>
<source>Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>
<translation>Import no vàlid per a -maxtxfee=<amount>: '%s' (cal que sigui com a mínim la comissió de minrelay de %s per evitar que les comissions s'encallin)</translation>
</message>
<message>
<source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>
<translation>Mida màxima de les dades en les transaccions de l'operador en què confiem i en les meves (per defecte: %u)</translation>
</message>
<message>
<source>Maximum total fees to use in a single wallet transaction, setting too low may abort large transactions (default: %s)</source>
<translation>Comissions totals màximes que s'utilitzaran en una transacció d'un únic moneder. Si es defineix un valor massa baix les transaccions més grans poden interrompre's (per defecte: %s)</translation>
</message>
<message>
<source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source>
<translation>Consulta a adreces d'iguals a través de DNS, si es troba baix en adreces (per defecte: 1 a menys que -connect)</translation>
</message>
<message>
<source>Require high priority for relaying free or low-fee transactions (default:%u)</source>
<translation>Es requereix una prioritat alta per retransmetre transaccions gratuïtes o de baixa comissió (per defecte:%u)</translation>
</message>
<message>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source>
<translation>Defineix la mida màxima de transaccions d'alta prioritat / baixa comissió en bytes (per defecte: %d)</translation>
</message>
<message>
<source>Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)</source>
<translation>Defineix el nombre de fils per a la generació de moneda si està habilitat (-1 = tots els nuclis, per defecte: %d)</translation>
</message>
<message>
<source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>
<translation>Aquest producte inclou programari desenvolupat pel projecte OpenSSL per a ús a l'OpenSSL Toolkit <https://www.openssl.org/> i programari criptogràfic escrit per Eric Young i programari UPnP escrit per Thomas Bernard.</translation>
</message>
<message>
<source>To use Dotcoind, or the -server option to Dotcoin-qt, you must set an rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=Dotcoinrpc
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 "Dotcoin Alert" [email protected]
</source>
<translation>Per utilitzar Dotcoind, o l'opció de serviddor de Dotcoin-qt, heu de definir una rpcpassword en el fitxer de configuració:
%s
Es recomana que utilitzeu la contrasenya aleatòria següent:
rpcuser=Dotcoinrpc
rpcpassword=%s
(no cal que recordeu la contrasenya)
El nom d'usuari i la contrasenya NO han de ser els mateixos.
Si el fitxer no existeix, creeu-ne un amb permisos de lectura només per al seu propietari.
Es recomana definir alertnotify per tal de ser notificat de qualsevol problema;
per exemple: alertnotify=echo %%s | mail -s "Avís de Dotcoin" [email protected]</translation>
</message>
<message>
<source>Warning: -maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>
<translation>Avís: s'ha especificat un -maxtxfee molt alt! Comissions tan grans podrien pagar-se en una única transacció.</translation>
</message>
<message>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Dotcoin Core will not work properly.</source>
<translation>Avís: comproveu que la data i hora del vostre ordinador siguin correctes! Si el vostre rellotge no és correcte, el Dotcoin Core no funcionarà correctament.</translation>
</message>
<message>
<source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>
<translation>Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la</translation>
</message>
<message>
<source>Accept public REST requests (default: %u)</source>
<translation>Accepta sol·licituds REST públiques (per defecte: %u)</translation>
</message>
<message>
<source>Cannot resolve -whitebind address: '%s'</source>
<translation>No es pot resoldre l'adreça -whitebind: «%s»</translation>
</message>
<message>
<source>Connect through SOCKS5 proxy</source>
<translation>Connecta a través del proxy SOCKS5</translation>
</message>
<message>
<source>Copyright (C) 2009-%i The Bitcoin Core Developers</source>
<translation>Copyright (C) 2009-%i Els desenvolupadors del Bitcoin Core</translation>
</message>
<message>
<source>Could not parse -rpcbind value %s as network address</source>
<translation>No s'ha pogut analitzar el valor -rpcbind %s com una adreça de xarxa</translation>
</message>
<message>
<source>Error loading wallet.dat: Wallet requires newer version of Dotcoin Core</source>
<translation>Error en carregar wallet.dat: el moneder requereix una versió més nova del Dotcoin core</translation>
</message>
<message>
<source>Error reading from database, shutting down.</source>
<translation>Error en llegir la base de dades, tancant.</translation>
</message>
<message>
<source>Error: Unsupported argument -tor found, use -onion.</source>
<translation>Error: s'ha trobat un argument -tor no acceptat. Feu servir -onion.</translation>
</message>
<message>
<source>Fee (in DOT/kB) to add to transactions you send (default: %s)</source>
<translation>Comissió en (DOT/kB) per afegir a les transaccions que envieu (per defecte: %s)</translation>
</message>
<message>
<source>Information</source>
<translation>&Informació</translation>
</message>
<message>
<source>Initialization sanity check failed. Dotcoin Core is shutting down.</source>
<translation>Ha fallat la inicialització de la comprovació de validesa. El Dotcoin Core s'està aturant.</translation>
</message>
<message>
<source>Invalid amount for -maxtxfee=<amount>: '%s'</source>
<translation>Import no vàlid per a -maxtxfee=<amount>: '%s'</translation>
</message>
<message>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation>Import no vàlid per a -minrelaytxfee=<amount>: «%s»</translation>
</message>
<message>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation>Import no vàlid per a -mintxfee=<amount>: «%s»</translation>
</message>
<message>
<source>Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)</source>
<translation>Import no vàlid per a -paytxfee=<amount>: «%s» (ha de ser com a mínim %s)</translation>
</message>
<message>
<source>Invalid netmask specified in -whitelist: '%s'</source>
<translation>S'ha especificat una màscara de xarxa no vàlida a -whitelist: «%s»</translation>
</message>
<message>
<source>Keep at most <n> unconnectable transactions in memory (default: %u)</source>
<translation>Manté com a màxim <n> transaccions no connectables en memòria (per defecte: %u)</translation>
</message>
<message>
<source>Need to specify a port with -whitebind: '%s'</source>
<translation>Cal especificar un port amb -whitebind: «%s»</translation>
</message>
<message>
<source>Node relay options:</source>
<translation>Opcions de transmissió del node:</translation>
</message>
<message>
<source>RPC SSL options: (see the Dotcoin Wiki for SSL setup instructions)</source>
<translation>Opcions RPC SSL: (veieu el wiki del Dotcoin per a instruccions de configuració de l'SSL)</translation>
</message>
<message>
<source>RPC server options:</source>
<translation>Opcions del servidor RPC:</translation>
</message>
<message>
<source>RPC support for HTTP persistent connections (default: %d)</source>
<translation>Suport RPC per a connexions HTTP persistents (per defecte: %d)</translation>
</message>
<message>
<source>Randomly drop 1 of every <n> network messages</source>
<translation>Descarta a l'atzar 1 de cada <n> missatges de la xarxa</translation>
</message>
<message>
<source>Randomly fuzz 1 of every <n> network messages</source>
<translation>Introdueix incertesa en 1 de cada <n> missatges de la xarxa</translation>
</message>
<message>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Envia informació de traça/depuració a la consola en comptes del fitxer debug.log</translation>
</message>
<message>
<source>Send transactions as zero-fee transactions if possible (default: %u)</source>
<translation>Envia les transaccions com a transaccions de comissió zero sempre que sigui possible (per defecte: %u) </translation>
</message>
<message>
<source>Show all debugging options (usage: --help -help-debug)</source>
<translation>Mostra totes les opcions de depuració (ús: --help --help-debug)</translation>
</message>
<message>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Redueix el fitxer debug.log durant l'inici del client (per defecte: 1 quan no -debug)</translation>
</message>
<message>
<source>Signing transaction failed</source>
<translation>Ha fallat la signatura de la transacció</translation>
</message>
<message>
<source>This is experimental software.</source>
<translation>Això és programari experimental.</translation>
</message>
<message>
<source>Transaction amount too small</source>
<translation>Import de la transacció massa petit</translation>
</message>
<message>
<source>Transaction amounts must be positive</source>
<translation>Els imports de les transaccions han de ser positius</translation>
</message>
<message>
<source>Transaction too large for fee policy</source>
<translation>Transacció massa gran per a la política de comissions</translation>
</message>
<message>
<source>Transaction too large</source>
<translation>La transacció és massa gran</translation>
</message>
<message>
<source>Unable to bind to %s on this computer (bind returned error %s)</source>
<translation>No s'ha pogut vincular a %s en aquest ordinador (la vinculació ha retornat l'error %s)</translation>
</message>
<message>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 1 quan s'escolta)</translation>
</message>
<message>
<source>Username for JSON-RPC connections</source>
<translation>Nom d'usuari per a connexions JSON-RPC</translation>
</message>
<message>
<source>Wallet needed to be rewritten: restart Dotcoin Core to complete</source>
<translation>Cal reescriure el moneder: reiniceu el Dotcoin Core per completar-ho.</translation>
</message>
<message>
<source>Warning</source>
<translation>Avís</translation>
</message>
<message>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Avís: aquesta versió està obsoleta. És necessari actualitzar-la!</translation>
</message>
<message>
<source>Warning: Unsupported argument -benchmark ignored, use -debug=bench.</source>
<translation>Avís: s'ha ignorat l'argument no acceptat de -benchmark. Feu servir -debug=bench.</translation>
</message>
<message>
<source>Warning: Unsupported argument -debugnet ignored, use -debug=net.</source>
<translation>Avís: s'ha ignorat l'argument no acceptat de -debugnet. Feu servir -debug=net.</translation>
</message>
<message>
<source>Zapping all transactions from wallet...</source>
<translation>Se suprimeixen totes les transaccions del moneder...</translation>
</message>
<message>
<source>on startup</source>
<translation>a l'inici de l'aplicació</translation>
</message>
<message>
<source>wallet.dat corrupt, salvage failed</source>
<translation>El fitxer wallet.data és corrupte. El rescat de les dades ha fallat</translation>
</message>
<message>
<source>Password for JSON-RPC connections</source>
<translation>Contrasenya per a connexions JSON-RPC</translation>
</message>
<message>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Executa l'ordre quan el millor bloc canviï (%s en cmd es reemplaça per un resum de bloc)</translation>
</message>
<message>
<source>Upgrade wallet to latest format</source>
<translation>Actualitza el moneder a l'últim format</translation>
</message>
<message>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Reescaneja la cadena de blocs en les transaccions de moneder perdudes</translation>
</message>
<message>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Utilitza OpenSSL (https) per a connexions JSON-RPC</translation>
</message>
<message>
<source>This help message</source>
<translation>Aquest misatge d'ajuda</translation>
</message>
<message>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Permet consultes DNS per a -addnode, -seednode i -connect</translation>
</message>
<message>
<source>Loading addresses...</source>
<translation>S'estan carregant les adreces...</translation>
</message>
<message>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Error en carregar wallet.dat: Moneder corrupte</translation>
</message>
<message>
<source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>
<translation>(1 = manté les metadades de les tx, p. ex., propietari del compte i informació de sol·licitud del pagament, 2 = prescindeix de les metadades de les tx)</translation>
</message>
<message>
<source>Flush database activity from memory pool to disk log every <n> megabytes (default: %u)</source>
<translation>Buida l'activitat de la base de dades de la memòria disponible al registre del disc cada <n> megabytes (per defecte: %u)</translation>
</message>
<message>
<source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>
<translation>Com d'exhaustiva és la verificació de blocs del -checkblocks (0-4, per defecte: %u)</translation>
</message>
<message>
<source>Log transaction priority and fee per kB when mining blocks (default: %u)</source>
<translation>Enregistreu la prioritat de la transacció i la comissió per kB en minar blocs (per defecte: %u)</translation>
</message>
<message>
<source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>
<translation>Manté un índex complet de transaccions, utilitzat per la crida rpc getrawtransaction (per defecte: %u)</translation>
</message>
<message>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>
<translation>Nombre de segons necessaris perquè els iguals de comportament qüestionable puguin tornar a connectar-se (per defecte: %u)</translation>
</message>
<message>
<source>Output debugging information (default: %u, supplying <category> is optional)</source>
<translation>Informació de sortida de la depuració (per defecte: %u, proporcionar <category> és opcional)</translation>
</message>
<message>
<source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>
<translation>Utilitza un proxy SOCKS4 apart per a arribar als iguals a través de serveis ocults de Tor (per defecte: %s)</translation>
</message>
<message>
<source>(default: %s)</source>
<translation>(per defecte: %s)</translation>
</message>
<message>
<source>Acceptable ciphers (default: %s)</source>
<translation>Xifrats acceptables (per defecte: %s)</translation>
</message>
<message>
<source>Always query for peer addresses via DNS lookup (default: %u)</source>
<translation>Demana sempre les adreces dels iguals a través de consultes DNS (per defecte: %u)</translation>
</message>
<message>
<source>Disable safemode, override a real safe mode event (default: %u)</source>
<translation>Inhabilita el mode segur, sobreescriu un esdeveniment de mode segur real (per defecte: %u) </translation>
</message>
<message>
<source>Error loading wallet.dat</source>
<translation>Error en carregar wallet.dat</translation>
</message>
<message>
<source>Force safe mode (default: %u)</source>
<translation>Força el mode segur (per defecte: %u)</translation>
</message>
<message>
<source>Generate coins (default: %u)</source>
<translation>Genera monedes (per defecte: %u)</translation>
</message>
<message>
<source>How many blocks to check at startup (default: %u, 0 = all)</source>
<translation>Quants blocs per comprovar a l'inici (per defecte: %u, 0 = tots)</translation>
</message>
<message>
<source>Include IP addresses in debug output (default: %u)</source>
<translation>Inclou l'adreça IP a la sortida de depuració (per defecte: %u)</translation>
</message>
<message>
<source>Invalid -proxy address: '%s'</source>
<translation>Adreça -proxy invalida: '%s'</translation>
</message>
<message>
<source>Limit size of signature cache to <n> entries (default: %u)</source>
<translation>Limita la mida de la cau de signatura a <n> entrades (per defecte: %u)</translation>
</message>
<message>
<source>Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)</source>
<translation>Escolta les connexions JSON-RPC en <port> (per defecte: %u o testnet: %u)</translation>
</message>
<message>
<source>Listen for connections on <port> (default: %u or testnet: %u)</source>
<translation>Escolta les connexions en <port> (per defecte: %u o testnet: %u)</translation>
</message>
<message>
<source>Maintain at most <n> connections to peers (default: %u)</source>
<translation>Manté com a màxim <n> connexions a iguals (per defecte: %u)</translation>
</message>
<message>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)</source>
<translation>Memòria intermèdia màxima de recepció per connexió, <n>*1000 bytes (per defecte: %u)</translation>
</message>
<message>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: %u)</source>
<translation>Memòria intermèdia màxima d'enviament per connexió, <n>*1000 bytes (per defecte: %u)</translation>
</message>
<message>
<source>Only accept block chain matching built-in checkpoints (default: %u)</source>
<translation>Només accepta els punts de control integrats que coincideixen amb la cadena de blocs (per defecte: %u)</translation>
</message>
<message>
<source>Prepend debug output with timestamp (default: %u)</source>
<translation>Posa davant de la sortida de depuració una marca horària (per defecte: %u)</translation>
</message>
<message>
<source>Relay and mine data carrier transactions (default: %u)</source>
<translation>Retransmet i mina les transaccions de l'operador (per defecte: %u)</translation>
</message>
<message>
<source>Relay non-P2SH multisig (default: %u)</source>
<translation>Retransmet multisig no P2SH (per defecte: %u)</translation>
</message>
<message>
<source>Run a thread to flush wallet periodically (default: %u)</source>
<translation>Executa un fil per buidar el moneder periòdicament (per defecte: %u)</translation>
</message>
<message>
<source>Server certificate file (default: %s)</source>
<translation>Fitxer de certificat del servidor (per defecte: %s)</translation>
</message>
<message>
<source>Server private key (default: %s)</source>
<translation>Clau privada del servidor (per defecte: %s)</translation>
</message>
<message>
<source>Set key pool size to <n> (default: %u)</source>
<translation>Defineix la mida clau disponible a <n> (per defecte: %u)</translation>
</message>
<message>
<source>Set minimum block size in bytes (default: %u)</source>
<translation>Defineix la mida de bloc mínima en bytes (per defecte: %u)</translation>
</message>
<message>
<source>Set the number of threads to service RPC calls (default: %d)</source>
<translation>Defineix el nombre de fils a crides de servei RPC (per defecte: %d)</translation>
</message>
<message>
<source>Sets the DB_PRIVATE flag in the wallet db environment (default: %u)</source>
<translation>Defineix el senyalador DB_PRIVATE en l'entorn db del moneder (per defecte: %u)</translation>
</message>
<message>
<source>Specify configuration file (default: %s)</source>
<translation>Especifica el fitxer de configuració (per defecte: %s)</translation>
</message>
<message>
<source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>
<translation>Especifica el temps d'espera de la connexió en milisegons (mínim: 1, per defecte: %d)</translation>
</message>
<message>
<source>Specify pid file (default: %s)</source>
<translation>Especifica el fitxer pid (per defecte: %s)</translation>
</message>
<message>
<source>Spend unconfirmed change when sending transactions (default: %u)</source>
<translation>Gasta el canvi no confirmat en enviar les transaccions (per defecte: %u)</translation>
</message>
<message>
<source>Stop running after importing blocks from disk (default: %u)</source>
<translation>Atura l'execució després d'importar blocs del disc (per defecte: %u)</translation>
</message>
<message>
<source>Threshold for disconnecting misbehaving peers (default: %u)</source>
<translation>Llindar per a desconnectar els iguals de comportament qüestionable (per defecte: %u)</translation>
</message>
<message>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Xarxa desconeguda especificada a -onlynet: '%s'</translation>
</message>
<message>
<source>Cannot resolve -bind address: '%s'</source>
<translation>No es pot resoldre l'adreça -bind: '%s'</translation>
</message>
<message>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>No es pot resoldre l'adreça -externalip: '%s'</translation>
</message>
<message>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Import no vàlid per a -paytxfee=<amount>: «%s»</translation>
</message>
<message>
<source>Insufficient funds</source>
<translation>Balanç insuficient</translation>
</message>
<message>
<source>Loading block index...</source>
<translation>S'està carregant l'índex de blocs...</translation>
</message>
<message>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Afegeix un node per a connectar-s'hi i intenta mantenir-hi la connexió oberta</translation>
</message>
<message>
<source>Loading wallet...</source>
<translation>S'està carregant el moneder...</translation>
</message>
<message>
<source>Cannot downgrade wallet</source>
<translation>No es pot reduir la versió del moneder</translation>
</message>
<message>
<source>Cannot write default address</source>
<translation>No es pot escriure l'adreça per defecte</translation>
</message>
<message>
<source>Rescanning...</source>
<translation>S'està reescanejant...</translation>
</message>
<message>
<source>Done loading</source>
<translation>Ha acabat la càrrega</translation>
</message>
<message>
<source>Error</source>
<translation>Error</translation>
</message>
</context>
</TS>
| wargo32/DOTCoin | src/qt/locale/bitcoin_ca.ts | TypeScript | mit | 150,319 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="photos/bro-logo2.png">
<title>Contact Us</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-switch.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Custom styles -->
<link href="mainstyle.css" rel="stylesheet">
</head>
<body>
<div id="seperator">
<div id="content">
<!-- NAVBAR
================================================== -->
<div class="navbar-wrapper">
<div class="container">
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
<a class="navbar-brand" href="index.html"><img class="big_logo" src="photos/bro-logo2-withcaption.png" alt="BRO Logo"/></a> <a class="navbar-brand" href="index.html"><img class="small_logo" src="photos/bro-logo2-small-withcaption.png" alt="BRO Logo"/></a> </div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Home <span class="glyphicon glyphicon-home" aria-hidden="true"></span></a></li>
<li><a href="want_a_ticket.html">Want a Ticket?</a></li>
<li><a href="become_a_patron.html">Become A Patron</a></li>
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Want more Info?<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="hot_off_the_press.html">Hot off the Press</a></li>
<li><a href="our_legacy.html">Our Legacy</a></li>
<li><a href="honorary_members.html">Honorary Members</a></li>
<li><a href="say_cheese.html">Say Cheese <span class="glyphicon glyphicon-camera" aria-hidden="true"></span></a></li>
</ul>
</li>
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Members Only<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="want_to_join.html">Want to Join?</a></li>
<li><a href="staff_room.html">Staff Room</a></li>
<li><a href="pdf/nqei-rules-2010.pdf">Rules and Regulations</a></li>
<li><a href="pdf/BRO_Repertoire.pdf">Report </a></li>
</ul>
</li>
<li><a href="contact_us.html">Contact Us <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span></a></li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<!-- Insert Body Here!!!!
======================================================= -->
<h1 class="title">Want a ticket?</h1>
<div class="container" id="events">
<div class="row">
<div class="col-lg-6 event">
<h2> Queens Gardens Concert - The 1812 Again!</h2>
<table>
<tbody>
<tr>
<th>Date:</th>
<td>31st July 2016</td>
</tr>
<tr>
<th>Time:</th>
<td>15:00</td>
</tr>
<tr>
<th >Location:</th>
<td><a target="_blank" href="https://www.google.com.au/maps/place/Queens+Gardens/@-19.2522809,146.8068188,17z/data=!3m1!4b1!4m5!3m4!1s0x6bd5f8c2945256c3:0xf00eef26261eb80!8m2!3d-19.2522809!4d146.8090075">Queens Gardens, Townsville</a></td>
</tr>
<tr>
<th >Address:</th>
<td><a target="_blank" href="https://www.google.com.au/maps/place/Queens+Gardens/@-19.2522809,146.8068188,17z/data=!3m1!4b1!4m5!3m4!1s0x6bd5f8c2945256c3:0xf00eef26261eb80!8m2!3d-19.2522809!4d146.8090075">Gregory St, Townsville, Queensland 4810</a></td>
</tr>
<tr>
<th>Price:</th>
<td>Complimentary for all! </td>
</tr>
</tbody>
</table>
<a href="https://www.facebook.com/events/1061349690594712/" target="_blank" class="btn btn-lg btn-primary btn-block">Reserve Your Spot</a>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6"> <img class="img-responsive" src="photos/Queens%20Gardens%20Concert.jpg" alt="Queens Gardens Concert"> </div>
<div class="col-lg-6 col-md-6 col-sm-6">
<p>Last year was such a resounding success we had to repeat this wonderful afternoon of music in the park. Co-presented by Townsville City Council and in celebration of the 150th Anniversary of the municipality of Townsville, the program includes Vivaldi’s Spring from The Four Seasons performed by the effervescent British violinist Tasmin Little, appearances by local groups the Barrier Reef Orchestra and 1RAR band, and will finish with the audience ‘firing the cannons’ in Tchaikovsky’s 1812 Overture! Bring your picnic blanket and enjoy a truly delightful afternoon in the park.</p>
</div>
</div>
<a href="https://www.facebook.com/events/1061349690594712/" target="_blank" class="btn btn-lg btn-primary btn-block">Reserve Your Spot</a> </div>
<div class="col-lg-6 event">
<h2>Dreams and Dances</h2>
<table>
<tbody>
<tr>
<th >Date:</th>
<td>8th March 2016</td>
</tr>
<tr>
<th >Time:</th>
<td>19:30</td>
</tr>
<tr>
<th >Location:</th>
<td><a target="_blank" href="http://townsvillemusic.org.au/">Townsville Civic Theatre</a></td>
</tr>
<tr>
<th >Address:</th>
<td><a target="_blank" href="https://www.google.com.au/maps/place/The+Townsville+Community+Music+Centre/@-19.271573,146.8092138,15z/data=!4m5!3m4!1s0x0:0x65e0e205e27193b8!8m2!3d-19.271573!4d146.8092138">41 Boundary Street, Townsville, Queensland 4810</a></td>
</tr>
<tr>
<th ><a href="become_a_patron.html">Member Price:</a></th>
<td>$32</td>
</tr>
<tr>
<th >Adult:</th>
<td>$38</td>
</tr>
<tr>
<th >Concession:</th>
<td>$34</td>
</tr>
<tr>
<th >Child/ Student:</th>
<td>$15</td>
</tr>
</tbody>
</table>
<a href="https://www.facebook.com/events/1061349690594712/" target="_blank" class="btn btn-lg btn-primary btn-block">Buy Now!</a>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6"> <a href="https://whatson.townsville.qld.gov.au/categories/ticketshop" target="_blank"><img class="img-responsive center-block" src="photos/Dreams%20and%20Dances.jpg" alt="Queens Gardens Concert"></a> </div>
<div class="col-lg-6 col-md-6 col-sm-6"> <img class="img-responsive center-block" src="photos/Adam%20Lopez.JPG" alt="Queens Gardens Concert"> </div>
</div>
<a href="https://whatson.townsville.qld.gov.au/categories/ticketshop" target="_blank" class="btn btn-lg btn-primary btn-block">Buy Now!</a> </div>
</div>
<div class="row">
<div class="col-lg-6 event">
<h2>World Music Concert</h2>
<table>
<tbody>
<tr>
<th >Date:</th>
<td>1st November 2014</td>
</tr>
<tr>
<th >Time:</th>
<td>19:30</td>
</tr>
<tr>
<th >Location:</th>
<td><a target="_blank" href="https://www.townsville.qld.gov.au/facilities-and-recreation/theatres-and-galleries/townsville-civic-theatre">Civic Theatre</a></td>
</tr>
<tr>
<th >Address:</th>
<td><a target="_blank" href="https://www.google.com.au/maps/place/Townsville+Civic+Theatre/@-19.2715643,146.8070194,17z/data=!3m1!4b1!4m5!3m4!1s0x6bd5f92267e9596d:0x58cd8e35887d45e0!8m2!3d-19.2715643!4d146.8092081">41 Boundary St, South Townsville QLD 4810</a></td>
</tr>
</tbody>
</table>
<a href="https://www.facebook.com/events/1061349690594712/" target="_blank" class="btn btn-lg btn-primary btn-block">Buy A Ticket!</a>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6"> <img class="img-responsive" src="photos/world_music_concert.jpg" alt="Queens Gardens Concert"> </div>
<div class="col-lg-6 col-md-6 col-sm-6">
<p>As you travel the globe one of the standout features of so many different countries is undoubtedly their music. The World Music Concert will feature the Orchestra and several international artists performing music from Asia, the Americas, the British Isles, Europe and of course Australia. So pack away the passport, take the trip of a life time and never leave home.</p>
<p>Join Townsville’s very own Barrier Reef Orchestra in their 15th year for a World Music Concer, conducted by Andrew Ryder.</p>
Guest artists:
<ul>
<li>Singer: Adam Lopez</li>
<li>Didgeridoo: David Hudson</li>
<li>Piano-accordion: Domenico Taraborrelli</li>
<li>Musicians: 1 RAR.</li>
</ul>
</div>
</div>
<a href="https://au.patronbase.com/_TVCC/Errors/ExpiredProd?prod_id=0754" target="_blank" class="btn btn-lg btn-primary btn-block">Buy a ticket!</a> </div>
<div class="col-lg-6">
<h2>Last Night of the Proms</h2>
<table>
<tbody>
<tr>
<th >Date:</th>
<td>8th March 2016</td>
</tr>
<tr>
<th >Time:</th>
<td>19:30</td>
</tr>
<tr>
<th >Location:</th>
<td><a target="_blank" href="http://townsvillemusic.org.au/">Townsville Civic Theatre</a></td>
</tr>
<tr>
<th >Address:</th>
<td><a target="_blank" href="https://www.google.com.au/maps/place/The+Townsville+Community+Music+Centre/@-19.271573,146.8092138,15z/data=!4m5!3m4!1s0x0:0x65e0e205e27193b8!8m2!3d-19.271573!4d146.8092138">41 Boundary Street, Townsville, Queensland 4810</a></td>
</tr>
</tbody>
</table>
<a href="https://whatson.townsville.qld.gov.au/categories/ticketshop" target="_blank" class="btn btn-lg btn-primary btn-block">Buy Now!</a>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6"> <a href="https://whatson.townsville.qld.gov.au/categories/ticketshop" target="_blank" class="photolink"><img class="img-responsive center-block" src="photos/Last%20Night%20of%20the%20Proms.jpg" alt="Queens Gardens Concert"></a> </div>
<div class="col-lg-6 col-md-6 col-sm-6">
<p>Last Night at the Proms is the Barrier Reef Orchestra's not-to-be-missed final concert for 2014 at Townsville Civic Theatre, featuring all the pomp and ceremony that the annual finale to the BBC Proms Series is known and loved for. </p>
<p>We welcome back Rick McIntyre from the Canberra School of Music as our conductor and artistic director and we are also delighted to announce that we will also be joined by Company Singers from NQOMT!</p>
<p>Expect all the favourites including music from Vaughan Williams as well as the traditional Rule Britannia, Pomp and Circumstance and Jerusalem.</p>
</div>
</div>
<a href="https://whatson.townsville.qld.gov.au/categories/ticketshop" target="_blank" class="btn btn-lg btn-primary btn-block">Buy Now!</a> </div>
</div>
</div>
</div>
<!-- FOOTER -->
<footer>
<div class="footerbuttons">
<div class="col-lg-3 col-md-3 col-sm-3"> <a href="index.html" class="btn btn-primary btn-block" role="button">Home <span class="glyphicon glyphicon-home" aria-hidden="true"></span></a> </div>
<div class="col-lg-3 col-md-3 col-sm-3"> <a href="want_a_ticket.html" class="btn btn-primary btn-block" role="button">Want a Ticket?</a> </div>
<div class="col-lg-3 col-md-3 col-sm-3"> <a href="become_a_patron.html" class="btn btn-primary btn-block" role="button">Become A Patron</a> </div>
<div class="col-lg-3 col-md-3 col-sm-3"> <a href="want_to_join.html" class="btn btn-primary btn-block" role="button">Want to Join the Band?</a> </div>
</div>
<p class="pull-right"><a href="#">Back to top </a></p>
<p><a id="easter_egg_button">©</a> 2016 , Barrier Reef Orchestra. - <a href="contact_us.html">Contact Us! <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span></a> </p>
</footer>
</div>
<!-- /.container -->
<!-- /.Bill Brown -->
<textarea id="ta"></textarea >
<audio id="myMusic">
<source src="photos/Kevin_MacLeod.mp3" />
</audio>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="easter_egg.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-switch.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
| AmosLipsys/CP1406-Assignment-2 | want_a_ticket.html | HTML | mit | 15,319 |
<?php
/*
* core42
*
* @package core42
* @link https://github.com/kiwi-suite/core42
* @copyright Copyright (c) 2010 - 2017 kiwi suite (https://www.kiwi-suite.com)
* @license MIT License
* @author kiwi suite <[email protected]>
*/
namespace Core42\Form\Service;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
class FormPluginManagerFactory implements FactoryInterface
{
/**
* @param ContainerInterface $container
* @param $requestedName
* @param array|null $options
* @return FormPluginManager
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
return new FormPluginManager(
$container->get('FormElementManager')
);
}
}
| raum42/core42 | src/Form/Service/FormPluginManagerFactory.php | PHP | mit | 794 |
#ifndef TIMELAPSE
#define TIMELAPSE
#include <string>
#include <iostream>
#include <fstream>
class Timelapsed {
private:
int secondsBreak;
const char * logpath;
const char * picdir;
std::ofstream logfile;
public:
Timelapsed ( int seconds, const char * logfile, const char * picpath );
~Timelapsed ( );
bool takePicture ( );
int getBreak ( );
bool daemonize ( );
void log ( std::string message );
std::string getTimeString ( );
};
#endif
| stevejarvis/pi-time-lapse | timelapsed.h | C | mit | 491 |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using MavLinkUwp;
using Windows.Devices.SerialCommunication;
using Windows.Devices.Enumeration;
using Windows.Storage.Streams;
using Windows.Networking;
using Windows.Networking.Connectivity;
using System.ComponentModel;
using Windows.Perception.Spatial;
using GalaSoft.MvvmLight.Threading;
using Windows.Perception;
namespace UwpDrone
{
class FlightController : Bindable
{
UwpMavLink mavLink;
MSP msp;
SpatialLocator locator;
SpatialStationaryFrameOfReference referenceFrame = null;
SpatialAnchor anchor = null;
bool isArmed = false;
DispatcherTimer controlLoopTimer = new DispatcherTimer();
int currentMission = -1;
public bool IsPositionSupported
{
get
{
// for now, we only support position on mavlink.
return mavLink != null;
}
}
public int CurrentMission
{
get
{
return currentMission;
}
internal set
{
currentMission = value;
NotifyPropertyChanged("CurrentMission");
}
}
public double Voltage
{
get
{
if (mavLink != null)
{
return mavLink.getBatteryVoltage();
}
else if (msp != null)
{
return (double)msp.voltage;
}
else
{
return 50;
}
}
}
public double Altitude
{
get
{
if (mavLink != null)
{
return mavLink.getAltitudeLocal();
}
else if (msp != null)
{
return (double)msp.Altitude;
}
else
{
return 0;
}
}
}
public double Heading
{
get
{
if (mavLink != null)
{
return mavLink.getHeading();
}
else if (msp != null)
{
return msp.attitude.yaw;
}
return 0;
}
}
public double XInCM
{
get
{
if (mavLink != null)
{
// LocalX is in Meters
return mavLink.getLocalX() * 100.0;
}
else
{
return 0;
}
}
}
public double YInCM
{
get
{
if (mavLink != null)
{
// LocalY is in Meters
return mavLink.getLocalY() * 100.0;
}
else
{
return 0;
}
}
}
public double BatteryLevel
{
get
{
if (mavLink != null)
{
return mavLink.getBatteryRemaining();
}
else if (msp != null)
{
double voltage = (double)msp.voltage / 10.0;
double level = voltage / 11.1 * 100.0; // assuming 3s.
if (level > 100)
level = 100;
if (level < 0)
level = 0;
return level;
}
return 0;
}
}
public double Roll
{
get
{
if (mavLink != null)
{
return mavLink.getRoll() * 180.0 / Math.PI;
}
else if (msp != null)
{
return msp.attitude.roll;
}
return 0;
}
}
public double Pitch
{
get
{
if (mavLink != null)
{
return mavLink.getPitch() * 180.0 / Math.PI;
}
else if (msp != null)
{
return msp.attitude.pitch;
}
return 0;
}
}
public FlightController()
{
}
public async Task<bool> initialize()
{
mavLink = new UwpMavLink();
mavLink.connectToMavLink(115200);
while (true)
{
// Use the default SpatialLocator to track the motion of the device.
locator = SpatialLocator.GetDefault();
if (locator != null)
{
if (referenceFrame == null)
{
referenceFrame = locator.CreateStationaryFrameOfReferenceAtCurrentLocation();
}
// Be able to respond to changes in the positional tracking state.
locator.PositionalTrackingDeactivating += Locator_PositionalTrackingDeactivating;
locator.LocatabilityChanged += this.OnLocatabilityChanged;
break;
}
await Task.Delay(100);
}
return true;
}
void OnLocatabilityChanged(SpatialLocator sender, Object args)
{
String message = "Positional tracking is now " + sender.Locatability + ".";
Debug.WriteLine(message);
switch (sender.Locatability)
{
case SpatialLocatability.Unavailable:
// Holograms cannot be rendered.
{
DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
controlLoopTimer.Stop();
});
}
break;
// In the following three cases, it is still possible to place holograms using a
// SpatialLocatorAttachedFrameOfReference.
case SpatialLocatability.PositionalTrackingActivating:
// The system is preparing to use positional tracking.
case SpatialLocatability.OrientationOnly:
// Positional tracking has not been activated.
case SpatialLocatability.PositionalTrackingInhibited:
// Positional tracking is temporarily inhibited. User action may be required
// in order to restore positional tracking.
break;
case SpatialLocatability.PositionalTrackingActive:
// Positional tracking is active. World-locked content can be rendered.
DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
controlLoopTimer.Start();
});
break;
}
}
private void Locator_PositionalTrackingDeactivating(SpatialLocator sender, SpatialLocatorPositionalTrackingDeactivatingEventArgs args)
{
// don't die!
args.Canceled = true;
}
public async Task<bool> initializeVehicleState()
{
if (mavLink != null)
{
int oldVehicleStateVersion = mavLink.GetVehicleStateVersion();
int newVehicleStateVersion = oldVehicleStateVersion;
while (oldVehicleStateVersion == newVehicleStateVersion)
{
await Task.Delay(200);
newVehicleStateVersion = mavLink.GetVehicleStateVersion();
}
await Task.Delay(2000);
}
return true;
}
public bool initializePositioningSystem()
{
if (mavLink != null)
{
controlLoopTimer.Interval = TimeSpan.FromMilliseconds(5);
controlLoopTimer.Tick += ControlLoopTimer_Tick;
controlLoopTimer.Start();
}
return true;
}
private void ControlLoopTimer_Tick(object sender, object e)
{
SpatialLocation location = null;
var perceptionTimestamp = PerceptionTimestampHelper.FromHistoricalTargetTime(DateTime.Now);
if (anchor == null)
{
// The anchor position in the StationaryReferenceFrame.
anchor = SpatialAnchor.TryCreateRelativeTo(referenceFrame.CoordinateSystem);
}
if (anchor != null)
{
location = locator.TryLocateAtTimestamp(perceptionTimestamp, anchor.CoordinateSystem);
}
if (location != null)
{
// Need to send NED frame, but spatial is ENU
mavLink.setPosition(location.Position.X, location.Position.Y, location.Position.Z, location.Orientation.W, location.Orientation.X, location.Orientation.Y, -location.Orientation.Z);
}
}
internal async Task<bool> ConnectToMSPController()
{
msp = new MSP();
if (await msp.connect())
{
return true;
}
return false;
}
public void Proxy(string ipToProxyTo)
{
if (mavLink != null)
{
foreach (HostName localHostName in NetworkInformation.GetHostNames())
{
if (localHostName.IPInformation != null)
{
if (localHostName.Type == HostNameType.Ipv4)
{
try
{
mavLink.proxy(localHostName.ToString(), ipToProxyTo, 14550);
}
catch (Exception e)
{
Debug.WriteLine($"Exception: {e.Message} -\n {e.StackTrace}");
}
break;
}
}
}
}
}
public void Arm()
{
if (mavLink != null)
{
mavLink.arm();
}
else if (msp != null)
{
msp.Arm();
}
isArmed = true;
}
public void Disarm()
{
if (mavLink != null)
{
mavLink.disarm();
}
else if (msp != null)
{
msp.Disarm();
}
isArmed = false;
}
public void ToggleArm()
{
if (isArmed)
{
Disarm();
}
else
{
Arm();
}
}
public void flyToHeight(float heightInCM)
{
if (mavLink != null)
{
mavLink.FlyToHeight(heightInCM);
}
}
public void flyForward(double distanceInCM)
{
if (mavLink != null)
{
// goto is in meters
mavLink.Goto((float)distanceInCM / 100.0f, 0, 0);
}
}
public async Task takeoff()
{
if (mavLink != null)
{
// store this away, so we don't rotate to zero later...
mavLink.takeoff(0.5);
await Task.Delay(1000);
mavLink.Goto((float)XInCM, (float)YInCM, (float)Altitude);
}
}
public void land()
{
if (mavLink != null)
{
mavLink.land();
}
}
public async Task Mission(int mission)
{
if (CurrentMission == -1)
{
CurrentMission = mission;
await Task.Delay(0);
CurrentMission = -1;
}
}
}
}
| ooeygui/UwpDrone | UwpDrone/UwpDrone/FlightController.cs | C# | mit | 12,527 |
@extends('pages.base')
@section('header')
<title>{{ $article->title }} - {{ setting_config('title','') }}</title>
<meta name="keywords" content="{{ $article->title }},{{ setting_config('seo_key') }}" />
<meta name="description" content="{!! str_limit(preg_replace('/\s/', '',strip_tags(convert_markdown($article->content))),100) !!},{{ setting_config('seo_desc') }}">
@endsection
@section('styles')
<style type="text/css">
.ds-sync,.ds-powered-by {
display: none !important;
}
</style>
@endsection
@section('jumbotron-title')
{{ $article->title }}
@endsection
@unless(isset($isSinglePage))
@section('jumbotron-desc')
{{ str_cut(convert_markdown($article->content),40) }}
@endsection
@section('jumbotron-meta')
<span class="fa fa-calendar"></span> {{ $article->created_at->format('Y-m-d') }}
<span class="fa fa-folder-o"></span>
<a href="/category/{{ $article->category->slug }}">{{ $article->category->name }}</a>
<span class="fa fa-tags"></span>
@if ($article->tags)
@foreach($article->tags as $tag)
<a href="/tag/{{ $tag->name }}">{{ $tag->name }}</a>
@endforeach
@endif
@endsection
@endunless
@section('left')
<article class="article-content markdown-body">
{!! convert_markdown($article->content) !!}
<br>
<p>本文链接: <a href="{{ route('article.show',array('id'=>$article->slug ? $article->slug : $article->id)) }}">{{ route('article.show',array('id'=>$article->slug ? $article->slug : $article->id)) }}</a></p>
<p class="well">
<b class="text-danger">声明</b>
<br>
<br>
在转载或修改本文后发布的文章中注明原文来源信息的前提下,允许进行转载该篇文章或经修改后发布且不用告知本文作者。
</p>
</article>
<div class="share">
<div class="share-bar"></div>
</div>
<div id="disqus_thread">
评论加载中...
<br>
<br>
注:如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理。
</div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
var disqus_config = function () {
this.page.url = "{{ route('article.show',array('id'=>$article->id)) }}"; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "{{ 'article_'.$article->id }}"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//macken-stack.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
@endsection | RystLee/MackenBlog | resources/views/pages/show.blade.php | PHP | mit | 3,149 |
require 'minitest/autorun'
require 'stringio'
module Minitest
class TestCase < Test
ExampleTest = Class.new(Test) {
i_suck_and_my_tests_are_order_dependent!
def self.generate_tests!
define_method(:test_pass) { assert 'truthy' }
define_method(:test_verbosity) { assert 'truthy' }
define_method(:test_a_very_long_sentence) { assert 'truthy' }
end
}
def io
@io ||= StringIO.new
end
end
end
| teoljungberg/minitest-documentation | test/minitest/test_case.rb | Ruby | mit | 485 |
package com.vidolima.doco;
import java.util.Date;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import com.google.appengine.api.search.Document;
import com.google.appengine.api.search.Field;
import com.google.appengine.api.search.GeoPoint;
import com.googlecode.objectify.ObjectifyService;
import com.vidolima.doco.utils.AppEngineTestUtils;
//import org.apache.log4j.Logger;
@RunWith(JUnit4.class)
public class DocoTest {
// private final transient Logger logger = Logger.getLogger(DocoTest.class);
private AppEngineTestUtils testUtils = new AppEngineTestUtils();
static {
ObjectifyService.register(ObjectifyEntity.class);
}
@Before
public void setupTests() {
testUtils.setUp();
}
@After
public void teardownTests() {
testUtils.tearDown();
}
@Test
public void testConversionFromDocumentToObject() {
Foo t = new Foo();
t.setCode(1);
t.setAtomFieldTest("This is a Atom field");
t.setDateFieldTest(new Date());
t.setGeopointFieldTest(new GeoPoint(1, 0));
t.setHtmlFieldTest("<html><title>Doco</title><body>Test doco</body></html>");
t.setNumberFieldTest(1986d);
t.setTextFieldTest("Text field declararion with name and type");
t.setTextFieldWithoutName("Text field declaration without name");
t.setTextFieldWithoutType("Text field declaration without type");
t.setTextFieldWithoutTypeAndName("Simple text field deplaration without type and name");
Doco doco = new Doco();
Document doc = doco.toDocument(t);
Assert.assertEquals(Integer.valueOf(doc.getId()), t.getCode());
Assert.assertEquals(doc.getOnlyField("atomFieldTest").getAtom(), t.getAtomFieldTest());
Assert.assertEquals(doc.getOnlyField("dateFieldTest").getDate(), t.getDateFieldTest());
Assert.assertEquals(doc.getOnlyField("geopointFieldTest").getGeoPoint(), t.getGeopointFieldTest());
Assert.assertEquals(doc.getOnlyField("htmlFieldTest").getHTML(), t.getHtmlFieldTest());
Assert.assertEquals(doc.getOnlyField("numberFieldTest").getNumber(), t.getNumberFieldTest());
Assert.assertEquals(doc.getOnlyField("justText").getText(), t.getTextFieldTest());
Assert.assertEquals(doc.getOnlyField("textFieldWithoutName").getText(), t.getTextFieldWithoutName());
Assert.assertEquals(doc.getOnlyField("txtName").getText(), t.getTextFieldWithoutType());
Assert.assertEquals(doc.getOnlyField("textFieldWithoutTypeAndName").getText(),
t.getTextFieldWithoutTypeAndName());
}
@Test
public void testConversionFromObjectToDocument() {
Document doc = Document
.newBuilder()
.setId("123456")
.addField(Field.newBuilder().setName("atomFieldTest").setAtom("This is a Atom field"))
.addField(Field.newBuilder().setName("dateFieldTest").setDate(new Date()))
.addField(Field.newBuilder().setName("geopointFieldTest").setGeoPoint(new GeoPoint(1, 0)))
.addField(
Field.newBuilder().setName("htmlFieldTest")
.setHTML("<html><title>Doco</title><body>Test doco</body></html>"))
.addField(Field.newBuilder().setName("numberFieldTest").setNumber(1986))
.addField(Field.newBuilder().setName("justText").setText("Text field declararion with name and type"))
.addField(Field.newBuilder().setName("textFieldWithoutName").setText("Text field declaration without name"))
.addField(Field.newBuilder().setName("txtName").setText("Text field declaration without type"))
.addField(
Field.newBuilder().setName("textFieldWithoutTypeAndName")
.setText("Simple text field deplaration without type and name")).build();
Doco doco = new Doco();
Foo f = doco.fromDocument(doc, Foo.class);
Assert.assertEquals(Integer.valueOf(doc.getId()), f.getCode());
Assert.assertEquals(doc.getOnlyField("atomFieldTest").getAtom(), f.getAtomFieldTest());
Assert.assertEquals(doc.getOnlyField("dateFieldTest").getDate(), f.getDateFieldTest());
Assert.assertEquals(doc.getOnlyField("geopointFieldTest").getGeoPoint(), f.getGeopointFieldTest());
Assert.assertEquals(doc.getOnlyField("htmlFieldTest").getHTML(), f.getHtmlFieldTest());
Assert.assertEquals(doc.getOnlyField("numberFieldTest").getNumber(), f.getNumberFieldTest());
Assert.assertEquals(doc.getOnlyField("justText").getText(), f.getTextFieldTest());
Assert.assertEquals(doc.getOnlyField("textFieldWithoutName").getText(), f.getTextFieldWithoutName());
Assert.assertEquals(doc.getOnlyField("txtName").getText(), f.getTextFieldWithoutType());
Assert.assertEquals(doc.getOnlyField("textFieldWithoutTypeAndName").getText(),
f.getTextFieldWithoutTypeAndName());
}
/**
* Tests whether subclass can be converted to a document successfully or not.
*
* Timeout is necessary so that infinite loop can be detected.
*/
// @Test(timeout = 2000)
@Test
public void testCreateDocumentForSubclass() {
Bar bar = new Bar();
bar.setCode(10); // set id
bar.setSubClassNumberField(50L); // set a field of subclass
Doco doco = new Doco();
Document document = doco.toDocument(bar);
Assert.assertNotNull(document);
Bar retrievedBar = doco.fromDocument(document, Bar.class);
Assert.assertEquals(bar.getCode(), retrievedBar.getCode());
Assert.assertEquals(bar.getSubClassNumberField(), retrievedBar.getSubClassNumberField());
}
/**
* James Huang Test if the DocumentCollection works when converting a document back into a java object which uses the DocumentCollection Annotation
* Note: Many fields with the same name in a Document represents a multivalued property and we want to test if we can recognize a multivalued property
* and turn it into the appropriate Collection for the Java Object
*/
@Test
public void testDocummentCollectionAnnotationFromDoc(){
/**
* Step 1: Create a document with multi-valued property
*/
Document.Builder doc = Document.newBuilder();
doc.setId("123123123");
//add a collection of fields which is basically many fields with the same name but different values
for( int i = 0; i < 100; i++){
doc.addField( Field.newBuilder().setName( Foo.ARRAY_LIST_TEST ).setAtom("arrItem" + i));
}
Document docWithMVP = doc.build();
//please work
Doco doco = new Doco();
Foo f = doco.fromDocument(docWithMVP, Foo.class);
// TODO: use logger instead of println
System.out.println( f.getArrayListTest() );
Assert.assertNotNull( f.getArrayListTest() );
}
@Test
public void testDocumentCollectionToAndFromDoc(){
/**
* Step 1: Create a Foo with a list
*/
Foo foo = new Foo();
foo.setCode(111); // set the id
for( int i = 0; i< 100; i++){
foo.addToArrayListTest("fooList"+ i); // set the list property
}
//come on please deploy properly this time
/**
* Step 2: Convert it to a Document
*/
Doco doco = new Doco();
Document document = doco.toDocument(foo);
/**
* Step 3: Convert it back into Foo
*/
Foo foo2 = doco.fromDocument(document, Foo.class);
Assert.assertNotNull( foo2 );
Assert.assertNotNull( foo2.getArrayListTest() );
}
@Test
public void testEnumConversionForObjectParser(){
/**
* Step 1: Create a Foo();
*/
Foo f = new Foo();
f.setCode(111); // set the id
f.setFooEnumTest(FooEnumTest.FOO_ONE); // set fooEnumTest
/**
* Step 2: Convert it to a Document
*/
Doco doco = new Doco();
Document doc = doco.toDocument(f);
/**
* Step 3: Convert it back into Foo
*/
Foo f2 = doco.fromDocument(doc, Foo.class);
Assert.assertEquals( f2.getFooEnumTest(), f.getFooEnumTest());
}
} | huangj7/doco | src/test/java/com/vidolima/doco/DocoTest.java | Java | mit | 8,288 |
require 'rack/utils'
require 'uri'
module MobilePagination
module Utils
def query_to_hash(qs)
Rack::Utils.parse_nested_query(qs) || {}
end
def hash_to_query(hash)
URI.encode(hash.map{|k,v| "#{k}=#{v}"}.join("&"))
end
end
end
| rentpath/mobile_pagination | lib/mobile_pagination/utils.rb | Ruby | mit | 261 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
namespace ClickOnceDMService
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new Service()
};
ServiceBase.Run(ServicesToRun);
}
}
}
| jongha/clickoncedm | src/ClickOnceDMService/Program.cs | C# | mit | 497 |
package org.cyclops.integrateddynamics.core.evaluate.variable;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.util.ResourceLocation;
import org.cyclops.cyclopscore.persist.nbt.INBTProvider;
import org.cyclops.integrateddynamics.api.evaluate.variable.IValue;
import org.cyclops.integrateddynamics.api.evaluate.variable.IValueType;
import org.cyclops.integrateddynamics.api.evaluate.variable.IValueTypeListProxy;
import org.cyclops.integrateddynamics.api.evaluate.variable.IValueTypeListProxyFactoryTypeRegistry;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Factory for list proxies that implement {@link org.cyclops.cyclopscore.persist.nbt.INBTProvider}.
* @author rubensworks
*/
public class ValueTypeListProxyNBTFactory<T extends IValueType<V>, V extends IValue, P extends IValueTypeListProxy<T, V> & INBTProvider> implements IValueTypeListProxyFactoryTypeRegistry.IProxyFactory<T, V, P> {
private final ResourceLocation name;
private final Class<P> proxyClass;
private final Constructor<P> proxyClassConstructor;
public ValueTypeListProxyNBTFactory(ResourceLocation name, Class<P> proxyClass) {
this.name = name;
this.proxyClass = proxyClass;
try {
this.proxyClassConstructor = this.proxyClass.getConstructor();
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new RuntimeException(String.format(
"Could not find a default constructor for %s, while this is required for list proxies. This is a developer error.", proxyClass.getName()));
}
}
@Override
public ResourceLocation getName() {
return this.name;
}
protected Class<P> getProxyClass() {
return this.proxyClass;
}
@Override
public INBT serialize(P values) throws IValueTypeListProxyFactoryTypeRegistry.SerializationException {
CompoundNBT tag = new CompoundNBT();
values.writeGeneratedFieldsToNBT(tag);
return tag;
}
@Override
public P deserialize(INBT value) throws IValueTypeListProxyFactoryTypeRegistry.SerializationException {
try {
P proxy = this.proxyClassConstructor.newInstance();
proxy.readGeneratedFieldsFromNBT((CompoundNBT) value);
return proxy;
} catch (InvocationTargetException | InstantiationException | ClassCastException | IllegalAccessException e) {
e.printStackTrace();
throw new IValueTypeListProxyFactoryTypeRegistry.SerializationException(e.getMessage());
}
}
}
| CyclopsMC/IntegratedDynamics | src/main/java/org/cyclops/integrateddynamics/core/evaluate/variable/ValueTypeListProxyNBTFactory.java | Java | mit | 2,648 |
% matrices and vectors for linera algebra
% not intended to be compiled alone
% for vectors in 3D
% addition of vectors
\vec{u} & = (u_x, u_y, u_z) \\
\vec{v} & = (v_x, v_y, v_z) \\
\vec{u} + \vec{v} & = (u_x + v_x, u_y + v_y, u_z + v_z)
% subtraction of vectors
\vec{u} & = (u_x, u_y, u_z) \\
\vec{v} & = (v_x, v_y, v_z) \\
\vec{u} - \vec{v} & = (u_x - v_x, u_y - v_y, u_z - v_z)
% vector dot product
\vec{u} & = (u_x, u_y, u_z) \\
\vec{v} & = (v_x, v_y, v_z) \\
\vec{u} \cdot \vec{v} & = (u_x * v_x) + (u_y * v_y) + (u_z * v_z)
% vector magnitude
\vec{u} & = (u_x, u_y, u_z) \\
| \vec{u} | & = \sqrt{(u_x)^2 + (u_y)^2 + (u_z)^2}
% vector cross product
\vec{u} & = (u_x, u_y, u_z) \\
\vec{v} & = (v_x, v_y, v_z) \\
\vec{u} \times \vec{v} & = ((u_y * v_z) - (u_z * v_y), (u_z * v_x) - (u_x * v_z), (u_x * v_y) - (u_y * v_x))
% several sample matrices
\begin{align*}
\left[\begin{array}{ccc}
-1 & 0 & 0 \\
0 & -1 & 0 \\
0 & 0 & -1
\end{array}\right]
\end{align*}
\begin{align*}
\left[\begin{array}{ccc}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & -1
\end{array}\right]
\end{align*}
\begin{align*}
\left[\begin{array}{ccc}
-1 & 0 & 0 \\
0 & -1 & 0 \\
0 & 0 & 1
\end{array}\right]
\end{align*}
% matrix multiplication for 2x2 matrices
\begin{align*}
\left[\begin{array}{rr}
a & b \\
c & d
\end{array} \right]
\left[\begin{array}{rr}
e & f \\
g & h
\end{array} \right]
& =
\left[\begin{array}{rr}
a*e + b*g & a*f + b*h \\
c*e + d*g & c*f + d*h
\end{array} \right]
\end{align*}
| mckennapsean/code-examples | LaTeX/matrix.tex | TeX | mit | 1,561 |
Node = Struct.new(:left_node, :right_node,:value)
class BinaryTree
def initialize(value = nil)
@root = Node.new( nil, nil,value) if value
end
def insert(value)
node = Node.new( nil, nil,value)
unless @root
@root = node
else
add_node(@root, node)
end
end
def add_node(tree, node)
if node.value < tree.value
unless tree.left_node.nil?
add_node(tree.left_node, node)
else
tree.left_node = node
end
else
unless tree.right_node.nil?
add_node(tree.right_node, node)
else
tree.right_node = node
end
end
end
def travel_node(node, &block)
return if node.nil?
travel_node(node.left_node, &block)
yield node.value if block_given?
travel_node(node.right_node, &block)
end
def print_all
return unless @root
travel_node(@root){|x| puts x}
end
def insert_all(array)
array.each do |value|
insert(value)
end
end
end
b = BinaryTree.new
b.insert_all([3,5,1,89,23,98,34])
b.print_all | reddyonrails/ruby-algorithms | binary_search_tree.rb | Ruby | mit | 1,046 |
# rubycorns.club
The home of the rubycorns.club website
Run it!
``` bash
$ bundle install && bundle exec jekyll serve
```
Deployed via GH pages.
| rubycorns/rubycorns.club | README.md | Markdown | mit | 148 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.ServiceLocation;
using GenericCodes.Core.Repositories;
using GenericCodes.Core.UnitOfWork;
namespace Northwind.Service.Helper
{
internal static class ServiceLocatorHelper
{
#region UnitOfWork
public static IUnitOfWork NorthwindUnitOfWork
{
get
{
return ServiceLocator.Current.GetInstance<IUnitOfWork>();
}
}
#endregion
}
}
| GenericCodes/WPFCrudControl | Northwind.Service/Helper/ServiceLocatorHelper.cs | C# | mit | 583 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="canonical" href="https://pearson-ux.github.io/PAG/patterns/pag/g15/">
<link rel="icon" type="image/png" sizes="32x32" href="https://pearson-ux.github.io/PAG/images/favicon.png">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="https://pearson-ux.github.io/PAG/css/prism.css" media="none" onload="this.media='all';">
<link rel="stylesheet" type="text/css" href="https://pearson-ux.github.io/PAG/css/styles.css">
<link rel="stylesheet" type="text/css" href="https://pearson-ux.github.io/PAG/css/elements.css">
<link rel="stylesheet" type="text/css" href="https://pearson-ux.github.io/PAG/css/override.css">
<style id="inverter" media="none">
html { filter: invert(100%) }
* { background-color: inherit }
img:not([src*=".png"]), .colors, iframe, .demo-container { filter: invert(100%) }
</style>
<title>
15. Meaningful Link Text | Pearson Accessibility Guidelines
</title>
</head>
<body>
<svg style="display: none">
<symbol id="bookmark" viewBox="0 0 40 50">
<g transform="translate(2266 3206.2)">
<path style="stroke:currentColor;stroke-width:3.2637;fill:none" d="m-2262.2-3203.4-.2331 42.195 16.319-16.318 16.318 16.318.2331-42.428z"/>
</g>
</symbol>
<symbol id="w3c" viewBox="0 0 127.09899 67.763">
<text font-size="83" style="font-size:83px;font-family:Trebuchet;letter-spacing:-12;fill-opacity:0" letter-spacing="-12" y="67.609352" x="-26.782778">W3C</text>
<text font-size="83" style="font-size:83px;font-weight:bold;font-family:Trebuchet;fill-opacity:0" y="67.609352" x="153.21722" font-weight="bold">SVG</text>
<path style="fill:currentColor;image-rendering:optimizeQuality;shape-rendering:geometricPrecision" d="m33.695.377 12.062 41.016 12.067-41.016h8.731l-19.968 67.386h-.831l-12.48-41.759-12.479 41.759h-.832l-19.965-67.386h8.736l12.061 41.016 8.154-27.618-3.993-13.397h8.737z"/>
<path style="fill:currentColor;image-rendering:optimizeQuality;shape-rendering:geometricPrecision" d="m91.355 46.132c0 6.104-1.624 11.234-4.862 15.394-3.248 4.158-7.45 6.237-12.607 6.237-3.882 0-7.263-1.238-10.148-3.702-2.885-2.47-5.02-5.812-6.406-10.022l6.82-2.829c1.001 2.552 2.317 4.562 3.953 6.028 1.636 1.469 3.56 2.207 5.781 2.207 2.329 0 4.3-1.306 5.909-3.911 1.609-2.606 2.411-5.738 2.411-9.401 0-4.049-.861-7.179-2.582-9.399-1.995-2.604-5.129-3.912-9.397-3.912h-3.327v-3.991l11.646-20.133h-14.062l-3.911 6.655h-2.493v-14.976h32.441v4.075l-12.31 21.217c4.324 1.385 7.596 3.911 9.815 7.571 2.22 3.659 3.329 7.953 3.329 12.892z"/>
<path style="fill:currentColor;image-rendering:optimizeQuality;shape-rendering:geometricPrecision" d="m125.21 0 1.414 8.6-5.008 9.583s-1.924-4.064-5.117-6.314c-2.693-1.899-4.447-2.309-7.186-1.746-3.527.73-7.516 4.938-9.258 10.13-2.084 6.21-2.104 9.218-2.178 11.978-.115 4.428.58 7.043.58 7.043s-3.04-5.626-3.011-13.866c.018-5.882.947-11.218 3.666-16.479 2.404-4.627 5.954-7.404 9.114-7.728 3.264-.343 5.848 1.229 7.841 2.938 2.089 1.788 4.213 5.698 4.213 5.698l4.94-9.837z"/>
<path style="fill:currentColor;image-rendering:optimizeQuality;shape-rendering:geometricPrecision" d="m125.82 48.674s-2.208 3.957-3.589 5.48c-1.379 1.524-3.849 4.209-6.896 5.555-3.049 1.343-4.646 1.598-7.661 1.306-3.01-.29-5.807-2.032-6.786-2.764-.979-.722-3.486-2.864-4.897-4.854-1.42-2-3.634-5.995-3.634-5.995s1.233 4.001 2.007 5.699c.442.977 1.81 3.965 3.749 6.572 1.805 2.425 5.315 6.604 10.652 7.545 5.336.945 9.002-1.449 9.907-2.031.907-.578 2.819-2.178 4.032-3.475 1.264-1.351 2.459-3.079 3.116-4.108.487-.758 1.276-2.286 1.276-2.286l-1.276-6.644z"/>
</symbol>
<symbol id="tag" viewBox="0 0 177.16535 177.16535">
<g transform="translate(0 -875.2)">
<path style="fill-rule:evenodd;stroke-width:0;fill:currentColor" d="m159.9 894.3-68.79 8.5872-75.42 77.336 61.931 60.397 75.429-76.565 6.8495-69.755zm-31.412 31.835a10.813 10.813 0 0 1 1.8443 2.247 10.813 10.813 0 0 1 -3.5174 14.872l-.0445.0275a10.813 10.813 0 0 1 -14.86 -3.5714 10.813 10.813 0 0 1 3.5563 -14.863 10.813 10.813 0 0 1 13.022 1.2884z"/>
</g>
</symbol>
<symbol id="balloon" viewBox="0 0 141.73228 177.16535">
<g transform="translate(0 -875.2)">
<g>
<path style="fill:currentColor" d="m68.156 882.83-.88753 1.4269c-4.9564 7.9666-6.3764 17.321-5.6731 37.378.36584 10.437 1.1246 23.51 1.6874 29.062.38895 3.8372 3.8278 32.454 4.6105 38.459 4.6694-.24176 9.2946.2879 14.377 1.481 1.2359-3.2937 5.2496-13.088 8.886-21.623 6.249-14.668 8.4128-21.264 10.253-31.252 1.2464-6.7626 1.6341-12.156 1.4204-19.764-.36325-12.93-2.1234-19.487-6.9377-25.843-2.0833-2.7507-6.9865-7.6112-7.9127-7.8436-.79716-.20019-6.6946-1.0922-6.7755-1.0248-.02213.0182-5.0006-.41858-7.5248-.22808l-2.149-.22808h-3.3738z"/>
<path style="fill:currentColor" d="m61.915 883.28-3.2484.4497c-1.7863.24724-3.5182.53481-3.8494.63994-2.4751.33811-4.7267.86957-6.7777 1.5696-.28598 0-1.0254.20146-2.3695.58589-5.0418 1.4418-6.6374 2.2604-8.2567 4.2364-6.281 7.6657-11.457 18.43-12.932 26.891-1.4667 8.4111.71353 22.583 5.0764 32.996 3.8064 9.0852 13.569 25.149 22.801 37.517 1.3741 1.841 2.1708 2.9286 2.4712 3.5792 3.5437-1.1699 6.8496-1.9336 10.082-2.3263-1.3569-5.7831-4.6968-21.86-6.8361-33.002-.92884-4.8368-2.4692-14.322-3.2452-19.991-.68557-5.0083-.77707-6.9534-.74159-15.791.04316-10.803.41822-16.162 1.5026-21.503 1.4593-5.9026 3.3494-11.077 6.3247-15.852z"/>
<path style="fill:currentColor" d="m94.499 885.78c-.10214-.0109-.13691 0-.0907.0409.16033.13489 1.329 1.0675 2.5976 2.0723 6.7003 5.307 11.273 14.568 12.658 25.638.52519 4.1949.24765 14.361-.5059 18.523-2.4775 13.684-9.7807 32.345-20.944 53.519l-3.0559 5.7971c2.8082.76579 5.7915 1.727 8.9926 2.8441 11.562-11.691 18.349-19.678 24.129-28.394 7.8992-11.913 11.132-20.234 12.24-31.518.98442-10.02-1.5579-20.876-6.7799-28.959-.2758-.4269-.57803-.86856-.89617-1.3166-3.247-6.13-9.752-12.053-21.264-16.131-2.3687-.86369-6.3657-2.0433-7.0802-2.1166z"/>
<path style="fill:currentColor" d="m32.52 892.22c-.20090-.13016-1.4606.81389-3.9132 2.7457-11.486 9.0476-17.632 24.186-16.078 39.61.79699 7.9138 2.4066 13.505 5.9184 20.562 5.8577 11.77 14.749 23.219 30.087 38.74.05838.059.12188.1244.18052.1838 1.3166-.5556 2.5965-1.0618 3.8429-1.5199-.66408-.32448-1.4608-1.3297-3.8116-4.4602-5.0951-6.785-8.7512-11.962-13.051-18.486-5.1379-7.7948-5.0097-7.5894-8.0586-13.054-6.2097-11.13-8.2674-17.725-8.6014-27.563-.21552-6.3494.13041-9.2733 1.775-14.987 2.1832-7.5849 3.9273-10.986 9.2693-18.07 1.7839-2.3656 2.6418-3.57 2.4409-3.7003z"/>
<path style="fill:currentColor" d="m69.133 992.37c-6.2405.0309-12.635.76718-19.554 2.5706 4.6956 4.7759 9.935 10.258 12.05 12.625l4.1272 4.6202h11.493l3.964-4.4516c2.0962-2.3541 7.4804-7.9845 12.201-12.768-8.378-1.4975-16.207-2.6353-24.281-2.5955z"/>
<rect style="stroke-width:0;fill:currentColor" ry="2.0328" height="27.746" width="22.766" y="1017.7" x="60.201"/>
</g>
</g>
</symbol>
<symbol id="info" viewBox="0 0 41.667 41.667">
<g transform="translate(-37.035 -1004.6)">
<path style="stroke-linejoin:round;stroke:currentColor;stroke-linecap:round;stroke-width:3.728;fill:none" d="m76.25 1030.2a18.968 18.968 0 0 1 -23.037 13.709 18.968 18.968 0 0 1 -13.738 -23.019 18.968 18.968 0 0 1 23.001 -13.768 18.968 18.968 0 0 1 13.798 22.984"/>
<g transform="matrix(1.1146 0 0 1.1146 -26.276 -124.92)">
<path style="stroke:currentColor;stroke-linecap:round;stroke-width:3.728;fill:none" d="m75.491 1039.5v-8.7472"/>
<path style="stroke-width:0;fill:currentColor" transform="scale(-1)" d="m-73.193-1024.5a2.3719 2.3719 0 0 1 -2.8807 1.7142 2.3719 2.3719 0 0 1 -1.718 -2.8785 2.3719 2.3719 0 0 1 2.8763 -1.7217 2.3719 2.3719 0 0 1 1.7254 2.8741"/>
</g>
</g>
</symbol>
<symbol id="warning" viewBox="0 0 48.430474 41.646302">
<g transform="translate(-1.1273 -1010.2)">
<path style="stroke-linejoin:round;stroke:currentColor;stroke-linecap:round;stroke-width:4.151;fill:none" d="m25.343 1012.3-22.14 37.496h44.28z"/>
<path style="stroke:currentColor;stroke-linecap:round;stroke-width:4.1512;fill:none" d="m25.54 1027.7v8.7472"/>
<path style="stroke-width:0;fill:currentColor" d="m27.839 1042.8a2.3719 2.3719 0 0 1 -2.8807 1.7143 2.3719 2.3719 0 0 1 -1.718 -2.8785 2.3719 2.3719 0 0 1 2.8763 -1.7217 2.3719 2.3719 0 0 1 1.7254 2.8741"/>
</g>
</symbol>
<symbol id="menu" viewBox="0 0 50 50">
<rect style="stroke-width:0;fill:currentColor" height="10" width="50" y="0" x="0"/>
<rect style="stroke-width:0;fill:currentColor" height="10" width="50" y="20" x="0"/>
<rect style="stroke-width:0;fill:currentColor" height="10" width="50" y="40" x="0"/>
</symbol>
<symbol id="link" viewBox="0 0 50 50">
<g transform="translate(0 -1002.4)">
<g transform="matrix(.095670 0 0 .095670 2.3233 1004.9)">
<g>
<path style="stroke-width:0;fill:currentColor" d="m452.84 192.9-128.65 128.65c-35.535 35.54-93.108 35.54-128.65 0l-42.881-42.886 42.881-42.876 42.884 42.876c11.845 11.822 31.064 11.846 42.886 0l128.64-128.64c11.816-11.831 11.816-31.066 0-42.9l-42.881-42.881c-11.822-11.814-31.064-11.814-42.887 0l-45.928 45.936c-21.292-12.531-45.491-17.905-69.449-16.291l72.501-72.526c35.535-35.521 93.136-35.521 128.64 0l42.886 42.881c35.535 35.523 35.535 93.141-.001 128.66zm-254.28 168.51-45.903 45.9c-11.845 11.846-31.064 11.817-42.881 0l-42.884-42.881c-11.845-11.821-11.845-31.041 0-42.886l128.65-128.65c11.819-11.814 31.069-11.814 42.884 0l42.886 42.886 42.876-42.886-42.876-42.881c-35.54-35.521-93.113-35.521-128.65 0l-128.65 128.64c-35.538 35.545-35.538 93.146 0 128.65l42.883 42.882c35.51 35.54 93.11 35.54 128.65 0l72.496-72.499c-23.956 1.597-48.092-3.784-69.474-16.283z"/>
</g>
</g>
</g>
</symbol>
<symbol id="doc" viewBox="0 0 35 45">
<g transform="translate(-147.53 -539.83)">
<path style="stroke:currentColor;stroke-width:2.4501;fill:none" d="m149.38 542.67v39.194h31.354v-39.194z"/>
<g style="stroke-width:25" transform="matrix(.098003 0 0 .098003 133.69 525.96)">
<path d="m220 252.36h200" style="stroke:currentColor;stroke-width:25;fill:none"/>
<path style="stroke:currentColor;stroke-width:25;fill:none" d="m220 409.95h200"/>
<path d="m220 488.74h200" style="stroke:currentColor;stroke-width:25;fill:none"/>
<path d="m220 331.15h200" style="stroke:currentColor;stroke-width:25;fill:none"/>
</g>
</g>
</symbol>
<symbol id="tick" viewBox="0 0 177.16535 177.16535">
<g transform="translate(0 -875.2)">
<rect style="stroke-width:0;fill:currentColor" transform="rotate(30)" height="155" width="40" y="702.99" x="556.82"/>
<rect style="stroke-width:0;fill:currentColor" transform="rotate(30)" height="40" width="90.404" y="817.99" x="506.42"/>
</g>
</symbol>
</svg>
<div class="wrapper ">
<header class="intro-and-nav" role="banner">
<div>
<div class="intro">
<a class="logo" href="https://pearson-ux.github.io/PAG/" aria-label="Pearson Accessibility Guidelines home page">
<img src="https://pearson-ux.github.io/PAG/images/pearson.png" alt="">
</a>
<p class="library-desc" style="font-size:.875em; margin:0;">
Accessibility Guidelines v1.0
<a class="print" href="https://pearson-ux.github.io/PAG/print-version">
<svg viewBox="0 0 35 45" aria-hidden="true" focusable="false">
<use xlink:href="#doc"></use>
</svg>Print version
</a>
</p>
<p style="font-size:.875em; margin:0; margin-bottom:1em;">Check your markup for accessibility errors: <a href="http://159.65.64.78/#/" target="_blank">http://159.65.64.78/#/</a></p>
</div>
<nav id="patterns-nav" class="patterns" role="navigation">
<h2 class="vh">Main navigation</h2>
<button id="menu-button" aria-expanded="false">
<svg viewBox="0 0 50 50" aria-hidden="true" focusable="false">
<use xlink:href="#menu"></use>
</svg>
Menu
</button>
<ul id="patterns-list">
<li>
<h3>Pearson Accessibility Guidelines</h3>
<ul>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g1/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">1. Choosing Technologies</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g2/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">2. Time Limits</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g3/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">3. Timed Tests</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g4/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">4. Sensible Reading Order</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g5/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">5. Findable Added Content</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g6/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">6. Keyboard Access</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g7/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">7. Keyboard Access Visibility</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g8/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">8. Keyboard Access Instructions</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g9/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">9. In-page Navigation</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g10/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">10. Continuity of User's Place</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g11/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">11. Semantic Markup</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g12/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">12. Don't provide info only through text formatting</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g13/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">13. Same Info without Style Sheets</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g14/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">14. Form Field Labels</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g15/" aria-current="page">
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">15. Meaningful Link Text</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g16/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">16. Human Language</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g17/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">17. Page & Frame Titles</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g18/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">18. User Interface Instructions</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g19/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">19. Valid Markup & Spelling</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g20/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">20. UI Control Role, Name, State & Options</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g21/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">21. Encoded Text</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g22/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">22. Text Resize</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g23/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">23. No blinking/No flickering</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g25/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">25. Stationary View of Moving Content</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g26/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">26. Contrast for Text Readability</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g27/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">27. Don't Rely on Color Coding</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g28/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">28. Color Contrast in Key Images</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g29/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">29. Images that Provide Info</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g30/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">30. Image Buttons & Links</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g31/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">31. Complete Narration or Audio Description</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g32/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">32. Decorative & Redundant Images</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g33/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">33. Hidden or Dimmed Content</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g34/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">34. User Control of Audio</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g35/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">35. Audio Clarity & Contrast</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g37/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">37. Captions</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g38/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">38. Mirroring Source Materials</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g39/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">39. User Content</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g40/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">40. Publishing Options & Security</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g41/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">41. Links to Accessible Players</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/pag/g42/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">42. Document Accessibility</span>
</a>
</li>
</ul>
</li>
<li>
<h3>Accessible PowerPoints</h3>
<ul>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/powerpoints/themasterslide/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">The Master Slide</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/powerpoints/embeddedobjects/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Embedded Objects</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/powerpoints/themschecker/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">The Microsoft PowerPoint Accessibility Checker</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/powerpoints/dodonthowto/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Do, Don't, How-to</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/powerpoints/checklist/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Checklist</span>
</a>
</li>
</ul>
</li>
<li>
<h3>K-12 examples</h3>
<ul>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/k-12/checkbox/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Checkbox</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/k-12/fillintheblank/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Fill in the blank</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/k-12/multiplechoice/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Multiple choice 1</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/k-12/multiplechoice2/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Multiple choice 2</span>
</a>
</li>
<li class="pattern">
<a href="https://pearson-ux.github.io/PAG/patterns/k-12/multiplechoice3/" >
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
<span class="text">Multiple choice 3</span>
</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
</header>
<div class="main-and-footer">
<div>
<main id="main">
<h1>
<svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
15. Meaningful Link Text
</h1>
<p><h2 id="g15">Write link text that tells users where the link goes</h2>
<div class="guideline_content">
<p class="summary">
Write links so that a user who is aware of the topic of the page will understand the purpose of the link when reading <span class="with-color">one</span> of the following:
<ul class="pe-list pe-styled-lists--unordered">
<li><span class="with-color">Link Text Alone:</span> Link text out of context (preferred if possible without awkwardness or redundant text)</li>
<li><span class="with-color">Nearest Heading, Nearest Parent List Item, or Table Headers:</span> Link text and the nearest heading above the link, OR link text and the nearest parent list item in a nested list, OR link text in a data table cell and the cell’s table headers (These options are only available where semantic markup is possible as in HTML.)</li>
<li><span class="with-color">Sentence:</span> Link text and the sentence that contains the link. </li>
<li><span class="with-color">Link Pattern:</span> Link text within the context of other links preceding the link on the same page.</li>
</ul>
</p></p>
<p><h3>Rationale</h3>
<p>All users need to understand where links go without following each link. Screen reader users and users who use high magnification levels can’t take in an overview of the whole page at once the way that a typical user might. This guideline is designed to limit the amount of the page that needs to be explored each time a user attempts to identify a link of interest. This is essential for efficient use of Web content.</p>
<p>When Link Text Alone is used, users will quickly know the purpose of the link regardless of how they arrived at the link. However, in some cases, providing the full purpose of the link within the link text itself can result in a wordy experience for all users. </p>
<p>Users typically arrive at a link:</p>
<ul class="pe-list pe-styled-lists--unordered">
<li><p>When reading the text leading up to the link</p>
<p>OR</p>
</li>
<li>When reading through a list of all the links on the page</li>
</ul>
<p>As such, Nearest Heading, Sentence, and Link Pattern often provide the context needed without requiring any additional exploration of the page.</p>
<p>Also, if the information is not known when the user first arrives at the link, Nearest Heading, Sentence/Line and Link Pattern can each be easily discovered using keyboard navigation as shown in the following charts:</p></p>
<p><h4>Screen reader commands</h4>
<table class="pe-table">
<thead class="table-head">
<tr>
<th scope="col"></th>
<th scope="col">Say Sentence</th>
<th scope="col">Go to Heading Above</th>
<th scope="col">Go through Links Above</th>
<th scope="col">Return to Link from Above</th>
</tr>
</thead>
<tbody>
<tr>
<th>JAWS 7.0</th>
<td>Alt – Number Pad 5</td>
<td>Shift - H</td>
<td>Shift – Tab</td>
<td>Tab</td>
</tr>
<tr>
<th>JAWS 7.0 Laptop</th>
<td>Caps Lock – H</td>
<td>Shift - H</td>
<td>Shift – Tab</td>
<td>Tab</td>
</tr>
</tbody>
</table></p>
<p><h4>Browser commands (which can be used with zoom features)</h4>
<table class="pe-table">
<thead class="table-head">
<tr>
<th scope="col"></th>
<th scope="col">Say Sentence</th>
<th scope="col">Go to Heading Above</th>
<th scope="col">Go through Links Above</th>
<th scope="col">Return to Link from Above</th>
</tr>
</thead>
<tbody>
<tr>
<th>Firefox 3.0 with Headings Navigation Extension</th>
<td>Read text surrounding link</td>
<td>Shift - H</td>
<td>Shift – Tab</td>
<td>Tab</td>
</tr>
</tbody>
</table>
<p>Also, users with cognitive issues should not have to decode too much of the page to understand a link.</p></p>
<p><h3>General Techniques</h3>
<p>When images or portions of images are used as links, two versions of the link text need evaluation: </p>
<ul class="pe-list pe-styled-lists--unordered">
<li><p>the alt-text, which will be the face of the link for screen readers users</p>
<p>AND</p>
</li>
<li>the link as an image, which will be the face of the link for many users, including most screen magnification users</li>
</ul></p>
<p><h3>HTML & JavaScript</h3>
<h4>HTML | XHTML | CSS</h4>
<ol class="pe-list pe-styled-lists--ordered">
<li><p><strong>Link Text Alone:</strong> Write link text so that it describes the purpose of the link:</p>
<pre><code><a href=“<a href="http://www.google.com">Google</a>">http://www.google.com">Google</a></a></code></pre>
<p>OR</p>
</li>
<li><p><strong>Sentence:</strong> If the link is inside a sentence of text, screen reader users can hear the link text, and then request to hear the current sentence to get further information about the link.</p>
<p>OR</p>
</li>
<li><p><strong>Nearest Heading, Nearest Parent List Item, or Table Headers:</strong> HTML headings are an easy way to provide context for links. Keyboard access users can navigate to the heading just above the link for context.</p>
<pre><code><h1>Products</h1></p>
<p><h2>JAWS 10.0</h2>
<ul>
<li><a href=“jaws_trial.html”>Download Trial</a></li>
<li><a href=“jaws_purchase”>Purchase</a></li>
<li<a href=“about_jaws.html”>Read More</a></li>
</ul></p>
<p><h2>Zoom Text 10.0</h2>
<ul>
<li><a href=“zoom_trial.html”>Download Trial</a></li>
<li<a href=“zoom_purchase”>Purchase</a>/li>
<li<a href=“about_zoom.html”>Read More</a></li>
</ul></code></pre>
<p>Similarly, table headers and parent list items can provide context for links in html.</p>
<p>OR</p>
</li>
<li><p><strong>Link Patterns:</strong> Screen reader users and screen magnification users often navigate a page by skipping from link to link. When one link provides context for the links that follow, these users will not need additional information to understand the links. In the example below, the links “JAWS” and “ZoomText” provide context for the links that follow them.</p>
<pre><code>
<a href=“jaws_home.html”>JAWS</a></p>
<p><ul>
<li>
<a href=“jaws_trial.html” title=“JAWS Trial”>Trial</a>
</li>
<li>
<a href=“jaws_purchase” title=“Purchase JAWS”>Purchase</a>
</li>
</ul></p>
<p><br />
<a href=“zoom_home.html”>ZoomText</a></p>
<p><ul>
<li>
<a href=“zoom_trial.html” title=“ZoomText Trial”>Trial</a>
</li>
<li>
<a href=“zoom_purchase” title=“Purchase ZoomText”>Purchase</a>
</li>
</ul></code></pre>
<p>To achieve standards compliance, supplement link patterns with <code>title</code> attributes that fully describe the purpose of the link. <code>title</code> attributes aren’t well supported in assistive technologies today. But, combining link patterns and title attributes covers both practical accessibility and standards compliance.</p>
<p>Link Patterns with Titles Sample Page: <mark><a href="https://codepen.io/sarahvc/pen/jZyaBd">Link Patterns Demo</a></mark></p></li>
</ol></p>
<p><h4>JavaScript</h4>
<ol class="pe-list pe-styled-lists--ordered">
<li><p>If dynamic user options result in differing results for links, use JavaScript to update the link text as needed:</p>
<pre><code>function updateLinkText() {
document.getElementById(‘n’).childNodes[0].nodeValue=‘Skip to the advanced questions!’;
}</code></pre>
…
<pre><code><a href=“variable_URL.html” id=“n”>Read about the European Renaissance!</a></code></pre>
</li>
<li><p>If an image is used as a link, and the meaning of the link changes (e.g. plus symbol changes to minus symbol, play button changes to a pause button) update the alt-text for the image:</p>
<pre><code>document.getElementById(‘c’).alt=‘Collapse menu’;</code></pre>
…
<pre><code><img src=“plus.gif” alt=“Expand menu” id=“c” /></code></pre>
</li>
</ol></p>
<p><h3>Android Applications</h3>
<p>The approaches for descriptive link text for Android mobile applications is similar to HTML webpages. One of the following can be used: </p>
<ol class="pe-list pe-styled-lists--ordered">
<li><strong>Link Text Alone:</strong> write link text so it is unique and describes the purpose of the link</li>
<li><strong>Sentence: </strong> If the link is inside the sentence of text, the screen reader can read the sentence to the context of the link.</li>
<li><strong>Nearest Heading or Table Headers :</strong> Screen readers can jump to the heading or table headers to get the context for the link. </li>
<li><strong>Link Patterns:</strong> Screen reader and screen magnifier users often navigate a page by skipping from link to link. The previous link can provide context for the links that follow. To achieve standards compliance, use the android:contentDescription to provide descriptive link text. The contentDescription should include the full link text.</li>
</ol></p>
<p><h3>iOS Applications</h3>
<p>The approaches for descriptive link text for iOS mobile applications is similar to HTML webpages. One of the following can be used: </p>
<ol class="pe-list pe-styled-lists--ordered">
<li><strong>Link Text Alone:</strong> write link text so it is unique and describes the purpose of the link</li>
<li><strong>Sentence: </strong> If the link is inside the sentence of text, the screen reader can read the sentence to the context of the link.</li>
<li><strong>Nearest Heading or Table Headers :</strong> Screen readers can jump to the heading or table headers to get the context for the link.</li>
<li><strong>Link Patterns:</strong> Screen reader and screen magnifier users often navigate a page by skipping from link to link. The previous link can provide context for the links that follow. To achieve standards compliance, define descriptive link text by setting the label and hint to provide contextual information. The label and the hint together should be the full link text.</li>
</ol></p>
<p><h3>PDF in Acrobat</h3>
<p>The link tag is used to define hyperlinks that are either internal or external to the PDF document. The link tag can be a child of other tags such as the paragraph tag.</p>
<p>To create a link in Acrobat 9 Pro, select the text that will be used for the link text. Access the context menu and select Create Link. Select the link appearance and choose the link action. To create an internal link, select “go to a page view”. An external link can be either a file or a web page.<br>
<img alt="" width="339" height="267" src="https://pearson-ux.github.io/PAG/images/create-link-internal.jpg"></p>
<p>The next screen will specify the location of the link. For internal links, select the target view using the scrollbars, mouse and zoom. Press Set Link to create the link destination.<br>
<img alt="" width="248" height="167" src="https://pearson-ux.github.io/PAG/images/create-go-view.jpg"></p></p>
<p><h4>Screen Reader Behavior Tips</h4>
<ul class="pe-list pe-styled-lists--unordered">
<li>The tooltip created using the link dialog in Adobe Acrobat is not accessible to screen readers. The link text or the link context needs to make the purpose clear.</li>
<li>To change the text spoken by screen readers for links, set the Alternative Text for the link. Go to the properties of the Link tag and on the Tag tab set the Alternative Text.</li>
</ul></p>
<p><h3>Word</h3>
<p>As with HTML links, ensure that the text will be understood by the user in the context of the surrounding text and content structure, and that it makes sense out of context. Screen reader users can browse a list of links, so “General PDF Accessibility Guidelines” is better than “click here.” Verify that the links are active.</p>
<p>To set the text of the link, change the Text to display text in the Hyperlink properties dialog box.<br>
<img alt="The first form field in the Insert Hyperlink dialog box allows users to change the text to display for the link." width="424" height="203" src="https://pearson-ux.github.io/PAG/images/Insert_hyperlink.jpg"></p>
<p>Avoid using the URL as the display text. Listening to long URLs can be tedious for a screen reader user and could cause them to abandon the content. Concise, meaningful descriptions as link text are helpful.</p></p>
<p><h3>PowerPoint</h3>
<p>As with HTML links, ensure that the text will be understood by the user in the context of the surrounding text and content structure, and that it makes sense out of context. Screen reader users can browse a list of links, so “PowerPoint Accessibility Guidelines” is better than “click here.” Verify that the destination of each link is valid.</p>
<p>It is easier for screen reader users when links contain concise, meaningful display text rather than URLs. Listening to long URLs can be tedious for them and could cause them to abandon the content. PowerPoint will autocorrect text that clearly looks like a URL to be a link (e.g. http://… And www.) Allow it to do this or use ctrl-K or Insert > hyperlink to add links. This is better than forcing links to be in plain text. Link text should be differentiated from other content with an underline and/or a high-contrast text color.<br>
<img alt="In the Insert Hyperlink dialog box, enter the meaningful display text in the text to display textbox." width="450" height="215" src="https://pearson-ux.github.io/PAG/images/PowerPoint-links.jpg"></p></p>
<p><h3>Testing HTML</h3>
<table class="pe-table">
<thead class="pe-sr-only">
<tr>
<th scope="col">Testing technique</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Tools</th>
<td>Though you may want to look at a list of links (Web Accessibility Toolbar > Doc Info. > List Links), the simplest tool is observation.</td>
</tr>
<tr>
<th scope="row">Review</th>
<td>Especially check for those typical (meaningless) link phrases like “Click here” or “More”.</td>
</tr>
<tr>
<th scope="row">Analysis</th>
<td>The link text should indicate what the link does. Context (such as current sentence or current heading) may supply missing information in cases where including the information in the link text would be particularly awkward or repetitive.</td>
</tr>
</tbody>
</table></p>
<p><h3>Testing Mobile Applications</h3>
<table class="pe-table">
<thead class="pe-sr-only">
<tr>
<th scope="col">Testing technique</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Tools</th>
<td>Look for all links and buttons on the page. Use the built-in screen reader on the device (VoiceOver on iOS and TalkBack on Android) to listen to the link text.</td>
</tr>
<tr>
<th scope="row">Review</th>
<td><p>Note any links that do not have descriptive link text. Especially check for those typical (meaningless) link phrases like “Click here” or “More”.</p>
<p>Read the links and buttons on the page with the screen reader. Note what link text is read when the button or link gets focus.</p>
</td>
</tr>
<tr>
<th scope="row">Analysis</th>
<td><p>The link text should indicate what the link or button does. Context (such as current sentence or current heading) may supply missing information in cases where including the information in the link text would be particularly awkward or repetitive.</p>
<p>A common error is not having the visible text associated with the link or button. When the link or button gets focus, the link text and the role (e.g. button, link) should be read together.</p>
</td>
</tr>
</tbody>
</table></p>
<p><h3>Testing PDF in Acrobat</h3>
<table class="pe-table">
<thead class="pe-sr-only">
<tr>
<th scope="col">Testing technique</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Tools</th>
<td>Use the content pane and the tags panel to verify proper link text and tagging.<br>
</td>
</tr>
<tr>
<th scope="row">Output</th>
<td><p>In the document pane, verify that each link is visible.</p>
<p>Using the Select Object tool, right-click each link to check its properties. In Acrobat 9, this is under Tools > Advanced Editing > Select Object; in Acrobat 10 it is under Tools > Content. Verify that the link properties are set to visible, inset, thin underline, and that the action is set appropriately (page view, file, or web page), and for web pages, that the URL is fully qualified, using <code>http://</code>.</p>
<p>In the tags pane, verify that the link is represented within the tag for the surrounding text and as a link tag containing an object reference (OBJR) and a text container for the link display text. For example, a paragraph of text is represented by a <code><p></code> tag. There will often be at least three container elements within that tag:</p>
<ol class="pe-list pe-styled-lists--ordered">
<li>text preceding the link,</li>
<li>link element with text container for display text, and</li>
<li>text after the link.</li>
</ol>
<p>It is generally recommended that the display text for links is meaningful within the context and is not simply the URL. For example, use “office locations” rather than a lengthy URL.</p>
</td>
</tr>
<tr>
<th scope="row">Analysis</th>
<td>Make note of any links that are not visible, are not tagged properly, or which have display text that is not optimal for the context of the content.</td>
</tr>
</tbody>
</table></p>
<p><h3>Related Guidelines</h3>
<h4>WCAG 2.0 A – SC 2.4.4 Link Purpose (In Context)</h4>
<p>The purpose of each link can be determined from the link text alone, or from the link text together with its programmatically determined link context, except where the purpose of the link would be ambiguous to users in general. (Level A)</p></p>
<p><h4>WCAG 2.0 AAA – SC 2.4.9 Link Purpose (Link Only)</h4>
<p>A mechanism is available to allow the purpose of each link to be identified from link text alone, except where the purpose of the link would be ambiguous to users in general. (Level AAA)</p></p>
<p></div></p>
</main>
<footer role="contentinfo">
<div>
<label for="themer">
dark theme: <input type="checkbox" id="themer" class="vh">
<span aria-hidden="true"></span>
</label>
</div>
Powered by <strong>Cupper</strong>, a <strong>The Paciello Group</strong> project.<br>
For general enquiries, contact us on [email protected].
</footer>
</div>
</div>
</div>
<script src="https://pearson-ux.github.io/PAG/js/prism.js"></script>
<script src="https://pearson-ux.github.io/PAG/js/dom-scripts.js"></script>
</body>
</html>
| pearson-ux/PAG | docs/patterns/pag/g15/index.html | HTML | mit | 61,150 |
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- **************************************************************** -->
<!-- * PLEASE KEEP COMPLICATED EXPRESSIONS OUT OF THESE TEMPLATES, * -->
<!-- * i.e. only iterate & print data where possible. Thanks, Jez. * -->
<!-- **************************************************************** -->
<html>
<head>
<!-- Generated by groovydoc (2.4.4) on Mon Apr 25 06:16:07 CEST 2016 -->
<title>ComponentSelection (Gradle API 2.13)</title>
<meta name="date" content="2016-04-25">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../../../groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="../../../../groovy.ico" type="image/x-icon" rel="icon">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<body class="center">
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ComponentSelection (Gradle API 2.13)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<div>
<ul class="navList">
<li><a href="../../../../index.html?org/gradle/api/artifacts/ComponentSelection" target="_top">Frames</a></li>
<li><a href="ComponentSelection.html" target="_top">No Frames</a></li>
</ul>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
Nested Field <li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li> | Detail: </li>
Field <li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">Package: <strong>org.gradle.api.artifacts</strong></div>
<h2 title="[Java] Interface ComponentSelection" class="title">[Java] Interface ComponentSelection</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<p>
Represents a tuple of the component selector of a module and a candidate version
to be evaluated in a component selection rule.
</p>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== NESTED CLASS SUMMARY =========== -->
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- =========== PROPERTY SUMMARY =========== -->
<!-- =========== ELEMENT SUMMARY =========== -->
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary"><!-- --></a>
<h3>Methods Summary</h3>
<ul class="blockList">
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Methods Summary table">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Type</th>
<th class="colLast" scope="col">Name and description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href='../../../../org/gradle/api/artifacts/component/ModuleComponentIdentifier.html'>ModuleComponentIdentifier</a></strong></code></td>
<td class="colLast"><code><strong><a href="#getCandidate()">getCandidate</a></strong>()</code><br>Gets the candidate version of the module.</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</strong></code></td>
<td class="colLast"><code><strong><a href="#reject(java.lang.String)">reject</a></strong>(<a href='https://docs.oracle.com/javase/6/docs/api/java/lang/String.html' title='String'>String</a> reason)</code><br>Rejects the candidate for the resolution.</td>
</tr>
</table>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- =========== METHOD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getCandidate()"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>public <a href='../../../../org/gradle/api/artifacts/component/ModuleComponentIdentifier.html'>ModuleComponentIdentifier</a> <strong>getCandidate</strong>()</h4>
<p> Gets the candidate version of the module.
<DL><DT><B>Returns:</B></DT><DD>the candidate version of the module</DD></DL></p>
</li>
</ul>
<a name="reject(java.lang.String)"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>public void <strong>reject</strong>(<a href='https://docs.oracle.com/javase/6/docs/api/java/lang/String.html' title='String'>String</a> reason)</h4>
<p> Rejects the candidate for the resolution.
<DL><DT><B>Parameters:</B></DT><DD><code>reason</code> - The reason the candidate was rejected.</DD></DL></p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<div>
<ul class="navList">
<li><a href="../../../../index.html?org/gradle/api/artifacts/ComponentSelection" target="_top">Frames</a></li>
<li><a href="ComponentSelection.html" target="_top">No Frames</a></li>
</ul>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
Nested Field <li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li> | Detail: </li>
Field <li><a href="#method_detail">Method</a></li>
</ul>
</div>
<p>Gradle API 2.13</p>
<a name="skip-navbar_bottom">
<!-- -->
</a>
</div>
</div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| HenryHarper/Acquire-Reboot | gradle/docs/groovydoc/org/gradle/api/artifacts/ComponentSelection.html | HTML | mit | 9,795 |
/**
* -*- c++ -*-
*
* \file begin.hpp
*
* \brief The \c begin operation.
*
* Copyright (c) 2009, Marco Guazzone
*
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.lslboost.org/LICENSE_1_0.txt)
*
* \author Marco Guazzone, [email protected]
*/
#ifndef BOOST_NUMERIC_UBLAS_OPERATION_BEGIN_HPP
#define BOOST_NUMERIC_UBLAS_OPERATION_BEGIN_HPP
#include <lslboost/numeric/ublas/expression_types.hpp>
#include <lslboost/numeric/ublas/fwd.hpp>
#include <lslboost/numeric/ublas/traits/const_iterator_type.hpp>
#include <lslboost/numeric/ublas/traits/iterator_type.hpp>
namespace lslboost { namespace numeric { namespace ublas {
namespace detail {
/**
* \brief Auxiliary class for implementing the \c begin operation.
* \tparam CategoryT The expression category type (e.g., vector_tag).
* \tparam TagT The dimension type tag (e.g., tag::major).
* \tparam OrientationT The orientation category type (e.g., row_major_tag).
*/
template <typename CategoryT, typename TagT=void, typename OrientationT=void>
struct begin_impl;
/// \brief Specialization of \c begin_impl for iterating vector expressions.
template <>
struct begin_impl<vector_tag,void,void>
{
/**
* \brief Return an iterator to the first element of the given vector
* expression.
* \tparam ExprT A model of VectorExpression type.
* \param e A vector expression.
* \return An iterator over the given vector expression.
*/
template <typename ExprT>
static typename ExprT::iterator apply(ExprT& e)
{
return e.begin();
}
/**
* \brief Return a const iterator to the first element of the given vector
* expression.
* \tparam ExprT A model of VectorExpression type.
* \param e A vector expression.
* \return A const iterator to the first element of the given vector
* expression.
*/
template <typename ExprT>
static typename ExprT::const_iterator apply(ExprT const& e)
{
return e.begin();
}
};
/// \brief Specialization of \c begin_impl for iterating matrix expressions with
/// a row-major orientation over the major dimension.
template <>
struct begin_impl<matrix_tag,tag::major,row_major_tag>
{
/**
* \brief Return an iterator to the first element of the given row-major
* matrix expression over the major dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return An iterator over the major dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::iterator1 apply(ExprT& e)
{
return e.begin1();
}
/**
* \brief Return a const iterator to the first element of the given
* row-major matrix expression over the major dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return A const iterator over the major dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::const_iterator1 apply(ExprT const& e)
{
return e.begin1();
}
};
/// \brief Specialization of \c begin_impl for iterating matrix expressions with
/// a column-major orientation over the major dimension.
template <>
struct begin_impl<matrix_tag,tag::major,column_major_tag>
{
/**
* \brief Return an iterator to the first element of the given column-major
* matrix expression over the major dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return An iterator over the major dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::iterator2 apply(ExprT& e)
{
return e.begin2();
}
/**
* \brief Return a const iterator to the first element of the given
* column-major matrix expression over the major dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return A const iterator over the major dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::const_iterator2 apply(ExprT const& e)
{
return e.begin2();
}
};
/// \brief Specialization of \c begin_impl for iterating matrix expressions with
/// a row-major orientation over the minor dimension.
template <>
struct begin_impl<matrix_tag,tag::minor,row_major_tag>
{
/**
* \brief Return an iterator to the first element of the given row-major
* matrix expression over the minor dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return An iterator over the minor dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::iterator2 apply(ExprT& e)
{
return e.begin2();
}
/**
* \brief Return a const iterator to the first element of the given
* row-major matrix expression over the minor dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return A const iterator over the minor dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::const_iterator2 apply(ExprT const& e)
{
return e.begin2();
}
};
/// \brief Specialization of \c begin_impl for iterating matrix expressions with
/// a column-major orientation over the minor dimension.
template <>
struct begin_impl<matrix_tag,tag::minor,column_major_tag>
{
/**
* \brief Return an iterator to the first element of the given column-major
* matrix expression over the minor dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return An iterator over the minor dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::iterator1 apply(ExprT& e)
{
return e.begin1();
}
/**
* \brief Return a const iterator to the first element of the given
* column-major matrix expression over the minor dimension.
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return A const iterator over the minor dimension of the given matrix
* expression.
*/
template <typename ExprT>
static typename ExprT::const_iterator1 apply(ExprT const& e)
{
return e.begin1();
}
};
} // Namespace detail
/**
* \brief An iterator to the first element of the given vector expression.
* \tparam ExprT A model of VectorExpression type.
* \param e A vector expression.
* \return An iterator to the first element of the given vector expression.
*/
template <typename ExprT>
BOOST_UBLAS_INLINE
typename ExprT::iterator begin(vector_expression<ExprT>& e)
{
return detail::begin_impl<typename ExprT::type_category>::apply(e());
}
/**
* \brief A const iterator to the first element of the given vector expression.
* \tparam ExprT A model of VectorExpression type.
* \param e A vector expression.
* \return A const iterator to the first element of the given vector expression.
*/
template <typename ExprT>
BOOST_UBLAS_INLINE
typename ExprT::const_iterator begin(vector_expression<ExprT> const& e)
{
return detail::begin_impl<typename ExprT::type_category>::apply(e());
}
/**
* \brief An iterator to the first element of the given matrix expression
* according to its orientation.
* \tparam DimTagT A dimension tag type (e.g., tag::major).
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return An iterator to the first element of the given matrix expression
* according to its orientation.
*/
template <typename TagT, typename ExprT>
BOOST_UBLAS_INLINE
typename iterator_type<ExprT,TagT>::type begin(matrix_expression<ExprT>& e)
{
return detail::begin_impl<typename ExprT::type_category, TagT, typename ExprT::orientation_category>::apply(e());
}
/**
* \brief A const iterator to the first element of the given matrix expression
* according to its orientation.
* \tparam TagT A dimension tag type (e.g., tag::major).
* \tparam ExprT A model of MatrixExpression type.
* \param e A matrix expression.
* \return A const iterator to the first element of the given matrix expression
* according to its orientation.
*/
template <typename TagT, typename ExprT>
BOOST_UBLAS_INLINE
typename const_iterator_type<ExprT,TagT>::type begin(matrix_expression<ExprT> const& e)
{
return detail::begin_impl<typename ExprT::type_category, TagT, typename ExprT::orientation_category>::apply(e());
}
/**
* \brief An iterator to the first element over the dual dimension of the given
* iterator.
* \tparam IteratorT A model of Iterator type.
* \param it An iterator.
* \return An iterator to the first element over the dual dimension of the given
* iterator.
*/
template <typename IteratorT>
BOOST_UBLAS_INLINE
typename IteratorT::dual_iterator_type begin(IteratorT& it)
{
return it.begin();
}
/**
* \brief A const iterator to the first element over the dual dimension of the
* given iterator.
* \tparam IteratorT A model of Iterator type.
* \param it An iterator.
* \return A const iterator to the first element over the dual dimension of the
* given iterator.
*/
template <typename IteratorT>
BOOST_UBLAS_INLINE
typename IteratorT::dual_iterator_type begin(IteratorT const& it)
{
return it.begin();
}
}}} // Namespace lslboost::numeric::ublas
#endif // BOOST_NUMERIC_UBLAS_OPERATION_BEGIN_HPP
| gazzlab/LSL-gazzlab-branch | liblsl/external/lslboost/numeric/ublas/operation/begin.hpp | C++ | mit | 11,411 |
class Api::PagesController < ApplicationController
def index
render json: Page.where(request.query_parameters)
end
end
| ballPointPenguin/cupery | rails/app/controllers/api/pages_controller.rb | Ruby | mit | 129 |
/**
* Theme Name: Badcow Ink Template
* Author: Sam Williams
* Author URI: http://badcow.co/
* Description: Dead simple templates with Twig
* Version: 1.0
* License URI: LICENSE
*/ | samuelwilliams/Ink | tools/style.css | CSS | mit | 187 |
<html>
{% include "head.html" %}
<body>
<div class="container">
<h1 class="text-center">
<div class="pagination float-left"><a href="/"><i class="fas fa-arrow-left gohome"></i></a></div>
<font color="black">Meta</font>phors
</h1>
<div class="alert alert-warning">
<span class="font-weight-bold">Warning</span>: not all contents have been previewed and considering
trolling is part of human nature 👻 you may find NSFW material. I'm but an impartial feedback
collector 🤷.
</div>
{% if messages %}
{% for message in messages %}
<div {% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</div>
{% endfor %}
{% endif %}
{% if metaphors %}
<div class="pagination float-right">
<span class="step-links">
{% if metaphors.has_previous %}
<a href="?page=1">« first</a>
<a href="?page={{ metaphors.previous_page_number }}">previous</a>
{% endif %}
<span class="current">
Page {{ metaphors.number }} of {{ metaphors.paginator.num_pages }}.
</span>
{% if metaphors.has_next %}
<a href="?page={{ metaphors.next_page_number }}">next</a>
<a href="?page={{ metaphors.paginator.num_pages }}">last »</a>
{% endif %}
</span>
</div>
{% else %}
<p>No metaphors are available.</p>
{% endif %}
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Original</th>
<th scope="col">Metaphor</th>
<th scope="col">Votes</th>
<th scope="col">Strategy</th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
{% for metaphor in metaphors %}
<tbody>
<tr>
<td class="align-middle">{{ metaphor.sentence_text }}</a></td>
<!--<td scope="row"><a href="/metaphors/{{ metaphor.id }}/">{{ metaphor.sentence_text }}</a></td>-->
<td class="align-middle">{{ metaphor.metaphor_text }}</td>
<td class="text-center align-middle">{{ metaphor.total_votes }}</td>
<td class="align-middle">{{ metaphor.strategy }}</td>
<td class="align-middle">
<button type="submit" class="btn btn-primary up" onclick="mySubmit({{ metaphor.id }},'up');">
<i class="fas fa-arrow-up"></i>
</button>
</td>
<td class="align-middle">
<button type="submit" class="btn btn-primary down" onclick="mySubmit({{ metaphor.id }},'down');">
<i class="fas fa-arrow-down"></i>
</button>
</td>
</tr>
</tbody>
{% endfor %}
</table>
<div class="row">
<form id="vote-form" class="vote" action="vote/" method="post">
{% csrf_token %}
<input id="metaphor-id" type="hidden" name="metaphor_id">
<input id="direction" type="hidden" name="direction">
<div class="g-recaptcha" data-sitekey="6LcjLk0UAAAAAIuk3ZX7t2LqeViviSv1etBiNyT-"></div>
</form>
</div>
</div>
{% include "footer.html" %}
</body>
</html>
<script>
function mySubmit(metaphor_id, direction){
document.getElementById('metaphor-id').value = metaphor_id;
document.getElementById('direction').value = direction;
document.getElementById("vote-form").submit();
}
</script>
| guiem/metaphor | metaphor/templates/metaphors.html | HTML | mit | 4,564 |
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public enum SoundType{
MUSIC,
SFX
}
public enum SoundPlayerState{
NORMAL,
SHIFTING
}
[System.Serializable]
public class SoundPlayerConfigTool{
public AudioClip ink;
public AudioClip brush;
public AudioClip bigBrush;
public AudioClip bucket;
public AudioClip pipette;
public AudioClip roller;
}
[System.Serializable]
public class SoundPlayerConfig{
public AudioClip click;
public AudioClip openWindow;
public AudioClip closeWindow;
public AudioClip error;
public AudioClip reset;
public AudioClip savePicture;
public AudioClip scrollWheel;
public AudioClip volumeSample;
public AudioClip screenShot;
public AudioClip panelSlide; //depricated
public SoundPlayerConfigTool tools;
}
public class SoundPlayer : MonoSingleton<SoundPlayer> {
public SoundPlayerConfig config;
SoundProps mainSoundProps;
Queue<AudioSource> audioSourcePool;
SoundPlayerState state = SoundPlayerState.NORMAL;
AudioSource music1Source;
AudioSource music2Source;
AudioSource sfxSource;
#region ControllerInterface implementation
void Start () {
sfxSource = getAudioSource(SoundType.SFX);
music1Source = getAudioSource(SoundType.MUSIC);
music2Source = getAudioSource(SoundType.MUSIC);
mainSoundProps = PropertiesSingleton.instance.soundProperties;
subscribeToEvents();
updateLevels();
playRandomSong();
updateMusicStatus();
}
#endregion
void Update(){
if ((music1Source.time + PropertiesSingleton.instance.soundProperties.shiftMusicTimeInSecons > music1Source.clip.length)
&& state == SoundPlayerState.NORMAL)
StartCoroutine(shiftMusic());
}
bool doWeNeedToplayTheSameSong;
IEnumerator shiftMusic(){
state = SoundPlayerState.SHIFTING;
doWeNeedToplayTheSameSong = Random.Range(0,100) < PropertiesSingleton.instance.soundProperties.musicCycleChanceInPercent;
if (doWeNeedToplayTheSameSong){
yield return StartCoroutine( playTheSameSong ());
} else {
yield return StartCoroutine( StartDifferentSong());
}
state = SoundPlayerState.NORMAL;
}
IEnumerator StartDifferentSong(){
music2Source.enabled = true;
AudioClip clip;
do {
clip = PropertiesSingleton.instance.soundProperties.music[Random.Range(0,PropertiesSingleton.instance.soundProperties.music.Length)];
} while (clip == music1Source.clip);
music2Source.clip = clip;
music2Source.volume = 0;
music2Source.Play();
while(music1Source.isPlaying)
{
float ratio = (music1Source.clip.length - music1Source.time)/ PropertiesSingleton.instance.soundProperties.shiftMusicTimeInSecons;
music1Source.volume = PropertiesSingleton.instance.soundProperties.musicLevel * ratio;
music2Source.volume = PropertiesSingleton.instance.soundProperties.musicLevel * (1-ratio);
yield return null;
}
music1Source.enabled = false;
AudioSource tmp = music1Source;
music1Source = music2Source;
music2Source = tmp;
}
IEnumerator playTheSameSong () {
music1Source.loop = true;
Debug.Log ("changed loop");
while (music1Source.time > 10.0f) {
yield return new WaitForSeconds (1.0f);
Debug.Log ("wait 1 second");
}
Debug.Log ("changed loop back");
music1Source.loop = false;
}
public void updateLevels(){
music1Source.volume = PropertiesSingleton.instance.soundProperties.musicLevel;
music2Source.volume = PropertiesSingleton.instance.soundProperties.musicLevel;
sfxSource.volume = PropertiesSingleton.instance.soundProperties.sfxLevel;
}
public void updateMusicStatus(){
if (PropertiesSingleton.instance.soundProperties.doWeeNeedToPlayMusic){
if (isMusicPlaying())
return;
playRandomSong();
} else {
if (!isMusicPlaying())
return;
music1Source.Stop();
music2Source.Stop();
}
}
bool isMusicPlaying(){
return ((music1Source != null && music1Source.isPlaying)
|| (music2Source != null && music2Source.isPlaying));
}
bool isSfxPlaying(){
return sfxSource.isPlaying;
}
bool isPlaying(List<AudioSource> sourceList){
if (sourceList.Count > 0){
for (int i = 0; i < sourceList.Count; i++) {
if (sourceList[i].isPlaying)
return true;
}
return false;
} else {
return false;
}
}
void playRandomSong(){
AudioClip clip = PropertiesSingleton.instance.soundProperties.music[Random.Range(0,PropertiesSingleton.instance.soundProperties.music.Length)];
music2Source.enabled = false;
music1Source.clip = clip;
music1Source.Play();
}
public AudioSource getAudioSource(SoundType soundType){
AudioSource audioSource = gameObject.AddComponent<AudioSource>();
if (soundType == SoundType.MUSIC){
audioSource.volume = PropertiesSingleton.instance.soundProperties.musicLevel;
} else if (soundType == SoundType.SFX){
audioSource.volume = PropertiesSingleton.instance.soundProperties.sfxLevel;
}
return audioSource;
}
public void playSound(AudioClip clip){
if (!mainSoundProps.mute && !mainSoundProps.sfxMute && (sfxSource.enabled && sfxSource.volume>0))
sfxSource.PlayOneShot(clip);
}
void onButtonClickListener(){
playSound(config.click);
}
void onButtonClickListener(int i){
onButtonClickListener();
}
void onWindowOpenListener(){
playSound(config.openWindow);
}
void onToolButtonClickListener(ToolType toolType){
switch(toolType){
case ToolType.BRUSH:
playSound(config.tools.brush);
break;
case ToolType.BRUSH_LARGE:
playSound(config.tools.bigBrush);
break;
case ToolType.BUCKET:
playSound(config.tools.bucket);
break;
case ToolType.HAND:
playSound(config.click);
break;
case ToolType.INK:
playSound(config.tools.ink);
break;
case ToolType.PIPETTE:
case ToolType.STAMP:
playSound(config.tools.pipette);
break;
case ToolType.ROLLER:
playSound(config.tools.roller);
break;
default:
Debug.LogWarning("hmm... i don't know what to play, unkonw tool here");
break;
}
}
void onColorPickerCloseListener(Color32 color){
playSound(config.closeWindow);
}
void onStampChooseListener(int i){
playSound(PropertiesSingleton.instance.guiStampList.stampList[i].sound);
}
void onExitFromWindowListener(){
playSound(config.closeWindow);
}
void onPictureSelect(int pictureId){
playSound(config.reset);
}
void onSelectAlbum(int albumId){
playSound(config.click);
}
void onSFXChangeLevel(float level){
updateLevels();
playSound(config.volumeSample);
}
void onWrongActionListener(string errString){
playSound(config.error);
}
void subscribeToEvents(){
subscribeToSFXEvents();
WorkspaceEventManager.instance.onSoundWindowSFXLevelChange += onSFXChangeLevel;
}
void onSavePictureListener(){
playSound(config.screenShot);
}
void subscribeToSFXEvents(){
WorkspaceEventManager.instance.onWrongAction += onWrongActionListener;
WorkspaceEventManager.instance.onMenuNewPictureClick += onWindowOpenListener;
WorkspaceEventManager.instance.onSoundButtonClick += onWindowOpenListener;
WorkspaceEventManager.instance.onInfoButtonClick += onWindowOpenListener;
WorkspaceEventManager.instance.onPalleteOpenWindowClick += onWindowOpenListener;
WorkspaceEventManager.instance.onStampSelectButtonClick += onWindowOpenListener;
WorkspaceEventManager.instance.onToolButtonClick += onToolButtonClickListener;
WorkspaceEventManager.instance.onColorPickerClose += onColorPickerCloseListener;
WorkspaceEventManager.instance.onStampClickInWindow += onStampChooseListener;
WorkspaceEventManager.instance.onUndoClick += onButtonClickListener;
WorkspaceEventManager.instance.onRedoClick += onButtonClickListener;
WorkspaceEventManager.instance.onResetSheetClick += onButtonClickListener;
WorkspaceEventManager.instance.onSavePictureClick += onSavePictureListener;
WorkspaceEventManager.instance.onColorHistoryClick += onButtonClickListener;
WorkspaceEventManager.instance.onRandomActiveColorClick += onButtonClickListener;
WorkspaceEventManager.instance.onPredefinedColorClick += onButtonClickListener;
WorkspaceEventManager.instance.onDrawWithinRegionClick += onButtonClickListener;
WorkspaceEventManager.instance.onSoundWindowMusicMuteClick += onButtonClickListener;
WorkspaceEventManager.instance.onSoundWindowSFXMuteClick += onButtonClickListener;
WorkspaceEventManager.instance.onSoundWindowMuteClick += onButtonClickListener;
WorkspaceEventManager.instance.onExitFromStampChooserWindow += onExitFromWindowListener;
WorkspaceEventManager.instance.onExitFromPicChooserWindow += onExitFromWindowListener;
WorkspaceEventManager.instance.onExitFromInfoWindow += onExitFromWindowListener;
WorkspaceEventManager.instance.onExitFromSoundSettingsWindow += onExitFromWindowListener;
WorkspaceEventManager.instance.onSelectPicture += onPictureSelect;
WorkspaceEventManager.instance.onSelectAlbum += onSelectAlbum;
}
}
| nicloay/colorus | Assets/Scripts/Controllers/SoundPlayer.cs | C# | mit | 9,077 |
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Released under the MIT License https://raw.github.com/mit-cml/app-inventor/master/mitlicense.txt
package com.google.appinventor.client.editor.simple;
import com.google.common.io.Files;
import com.google.appinventor.common.testutils.TestUtils;
import com.google.appinventor.server.properties.json.ServerJsonParser;
import com.google.appinventor.shared.simple.ComponentDatabaseInterface.PropertyDefinition;
import junit.framework.TestCase;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Set;
/**
* Checks basic functionality of the component descriptor database.
*
*/
public class ComponentDatabaseTest extends TestCase {
private static final String COMPONENT_DESCRIPTOR_FILE =
"/build/components/simple_components.json";
/**
* Checks whether the component database was correctly initialized.
*/
public void testComponentDatabase() throws IOException {
// Load component descriptor file
String componentDescriptorSource = Files.toString(
new File(TestUtils.APP_INVENTOR_ROOT_DIR + COMPONENT_DESCRIPTOR_FILE),
Charset.forName("UTF8"));
// Parse the data file and check the existence of some key components
final ComponentDatabase componentDatabase = new ComponentDatabase(
new ServerJsonParser().parse(componentDescriptorSource).asArray());
Set<String> components = componentDatabase.getComponentNames();
assertTrue(components.contains("Button"));
assertTrue(components.contains("Label"));
assertTrue(components.contains("TextBox"));
// Check some properties defined for the TextBox component
List<PropertyDefinition> properties = componentDatabase.getPropertyDefinitions("TextBox");
assertEquals("boolean", find(properties, "Enabled").getEditorType());
assertEquals("non_negative_float", find(properties, "FontSize").getEditorType());
assertEquals("string", find(properties, "Hint").getEditorType());
}
/*
* Finds the property definition for the property with the given name.
*/
private static PropertyDefinition find(List<PropertyDefinition> properties, String name) {
for (PropertyDefinition property : properties) {
if (property.getName().equals(name)) {
return property;
}
}
fail("Couldn't find property \"" + name + '"');
// Will never get here...
return null;
}
}
| ajhalbleib/aicg | appinventor/appengine/tests/com/google/appinventor/client/editor/simple/ComponentDatabaseTest.java | Java | mit | 2,619 |
// Ce script a été réalisé par Maartin10, Merci de ne pas le copier ni le modifier ;)
$(document).ready(function(){
if ( $('.visitorText').children('a').find('span').attr('class') === "style2"){
alert("Script reservé aux premium pour le moment!");
return;}
var alertetxt = $('#headerMover').children('header').children('div').children('span').children('ul').children('li').eq(2).children('a').children('strong').children('span').text();
var conversationtxt = $('#headerMover').children('header').children('div').children('span').children('ul').children('li').eq(1).children('a').children('strong').children('span').text();
var alerte = parseInt(alertetxt);
var conversation = parseInt(conversationtxt);
var notification = alerte + conversation;
var titre = document.title;
var outtitre = null;
var check = null;
var refresh = null;
var message = "null";
var titree = null;
var focusout = null;
var focusoutal = null;
var focusoutco = null;
var $menu = "null";
$(window).blur(function(){
focusDesactive();
});
$(window).focus(function(){
focusActive();
});
function click() {
$.get('https://realitygaming.fr/nimportequoi/aussi.json')
setTimeout(function () {
$menu.click();
}, 1000);
};
function focusActive() {
window.clearInterval(refresh);
clearInterval(check);
clearInterval(outtitre);
titree = setTimeout(function () {
clearInterval(refresh);
clearInterval(notif);
document.title = "RealityGaming";
}, 300);
}
function focusDesactive() {
clearInterval(titree);
refresh = window.setInterval(function () {
$.get('https://realitygaming.fr/nimportequoi/aussi.json', function(data){
alertetxt = data._visitor_alertsUnread;
conversationtxt = data._visitor_conversationsUnread;});}, 30000);
check = setInterval(function () {
for (var i in alertetxt) {
alerte = parseInt(alertetxt);
notification = alerte + conversation;
}
for (var i in conversationtxt) {
conversation = parseInt(conversationtxt);
notification = alerte + conversation;
}
outtitre = setInterval(function () {
if (notification !== 0) {
document.title = ('[' + notification + '] ' + titre);
} else {
document.title = titre;
}
}, 500);
}, 5000);
focusout = notification;
focusoutal = alerte;
focusoutco = conversation;
notif = setInterval(function () {
if (notification > focusout) {
if (alerte - focusoutal !== 0) {
$menu = $('#headerMover').children('header').children('div').children('span').children('ul').children('li').eq(2).children('a').children('strong').children('span');
if (alerte - focusoutal === 1) {
message = 'Vous avez 1 nouvelle alerte!';
} else {
message = 'Vous avez ' + alerte + ' nouvelles alertes!';
}
}
if (conversation - focusoutco !== 0) {
$menu = $('#headerMover').children('header').children('div').children('span').children('ul').children('li').eq(1).children('a').children('strong').children('span');
if (conversation - focusoutco === 1) {
message = 'Vous avez 1 nouvelle conversation!';
} else {
message = 'Vous avez ' + conversation + ' nouvelles conversations!';
}
}
if (alerte - focusoutal !== 0 && conversation - focusoutco !== 0) {
$menu = $('#headerMover').children('header').children('div').children('span').children('ul').children('li').eq(2).children('a').children('strong').children('span');
message = 'Vous avez ' + alerte + ' nouvelles alertes et ' + conversation + ' nouvelles conversations!';
}
setTimeout(function () {
if (!("Notification" in window)) {
console.error("Ce navigateur ne supporte pas les notifications desktop")
} else if (Notification.permission === "granted") {
var popup = new Notification(message, {
icon : 'http://realitygaming.fr/attachments/rg-png.14121/'
})
} else if (Notification.permission !== 'denied') {
Notification.requestPermission(function (permission) {
if (!('permission' in Notification)) {
Notification.permission = permission;
}
if (permission === "granted") {
var popup = new Notification(message, {
icon : 'http://realitygaming.fr/attachments/rg-png.14121/'
})
}
});
}
popup.onclick = click;
popup.addEventListener('click', click);
setTimeout(function () {
focusout = notification;
focusoutal = alerte;
focusoutco = conversation;
}, 1000);
}, 150);
}
}, 3000);
}
});
| Maartin10/RG-Notification | Notification.js | JavaScript | mit | 4,450 |
# Fuzzy
[](https://travis-ci.org/sajari/fuzzy)
Fuzzy is a very fast spell checker and query suggester written in Golang.
Motivation:
- Sajari uses very large queries (hundreds of words) but needs to respond sub-second to these queries where possible. Common spell check algorithms are quite slow or very resource intensive.
- The aim was to achieve spell checks in sub 100usec per word (10,000 / second single core) with at least 70% accuracy and multi-language support.
- Currently we see sub 40usec per word and 68% accuracy for a Levenshtein distance of 2 chars on a 2012 macbook pro (english test set comes from Peter Norvig's article, see http://norvig.com/spell-correct.html).
- A 500 word query can be spell checked in ~0.02 sec / cpu cores, which is good enough for us.
Notes:
- It is currently executed as a single goroutine per lookup, so undoubtedly this could be much faster using multiple cores, but currently the speed is quite good.
- Accuracy is hit slightly because several correct words don't appear at all in the training text (data/big.txt).
- Fuzzy is a "Symmetric Delete Spelling Corrector", which relates to some blogs by Wolf Garbe at Faroo.com (see http://blog.faroo.com/2012/06/07/improved-edit-distance-based-spelling-correction/)
Config:
- Generally no config is required, but you can tweak the model for your application.
- `"threshold"` is the trigger point when a word becomes popular enough to build lookup keys for it. Setting this to "1" means any instance of a given word makes it a legitimate spelling. This typically corrects the most errors, but can also cause false positives if incorrect spellings exist in the training data. It also causes a much larger index to be built. By default this is set to 4.
- `"depth"` is the Levenshtein distance the model builds lookup keys for. For spelling correction, a setting of "2" is typically very good. At a distance of "3" the potential number of words is much, much larger, but adds little benefit to accuracy. For query prediction a larger number can be useful, but again is much more expensive. **A depth of "1" and threshold of "1" for the 1st Norvig test set gives 63% correction accuracy at ~5usec per check (e.g. ~200kHz)**, for many applications this will be good enough. At depths > 2, the false positives begin to hurt the accuracy.
Future improvements:
- Make some of the expensive processes concurrent.
- Add spelling checks for different languages. If you have misspellings in different languages please add them or send to us.
- Allow the term-score map to be read from an external term set (e.g. integrating this currently may double up on keeping a term count).
- Currently there is no method to delete lookup keys, so potentially this may cause bloating over time if the dictionary changes signficantly.
- Add right to left deletion beyond Levenshtein config depth (e.g. don't process all deletes accept for query predictors).
Usage:
- Below is some example code showing how to use the package.
- An example showing how to train with a static set of words is contained in the fuzzy_test.go file, which uses the "big.text" file to create an english dictionary.
- To integrate with your application (e.g. custom dictionary / word popularity), use the single word and multiword training functions shown in the example below. Each time you add a new instance of a given word, pass it to this function. The model will keep a count and
- We haven't tested with other langauges, but this should work fine. Please let us know how you go? `[email protected]`
```go
package main
import(
"github.com/sajari/fuzzy"
"fmt"
)
func main() {
model := fuzzy.NewModel()
// For testing only, this is not advisable on production
model.SetThreshold(1)
// This expands the distance searched, but costs more resources (memory and time).
// For spell checking, "2" is typically enough, for query suggestions this can be higher
model.SetDepth(5)
// Train multiple words simultaneously by passing an array of strings to the "Train" function
words := []string{"bob", "your", "uncle", "dynamite", "delicate", "biggest", "big", "bigger", "aunty", "you're"}
model.Train(words)
// Train word by word (typically triggered in your application once a given word is popular enough)
model.TrainWord("single")
// Check Spelling
fmt.Println("\nSPELL CHECKS")
fmt.Println(" Deletion test (yor) : ", model.SpellCheck("yor"))
fmt.Println(" Swap test (uncel) : ", model.SpellCheck("uncel"))
fmt.Println(" Replace test (dynemite) : ", model.SpellCheck("dynemite"))
fmt.Println(" Insert test (dellicate) : ", model.SpellCheck("dellicate"))
fmt.Println(" Two char test (dellicade) : ", model.SpellCheck("dellicade"))
// Suggest completions
fmt.Println("\nQUERY SUGGESTIONS")
fmt.Println(" \"bigge\". Did you mean?: ", model.Suggestions("bigge", false))
fmt.Println(" \"bo\". Did you mean?: ", model.Suggestions("bo", false))
fmt.Println(" \"dyn\". Did you mean?: ", model.Suggestions("dyn", false))
// Autocomplete suggestions
suggested, _ := model.Autocomplete("bi")
fmt.Printf(" \"bi\". Suggestions: %v", suggested)
}
``` | sparrc/fuzzy | README.md | Markdown | mit | 5,200 |
<?php
/*
* Copyright 2014 Google Inc.
*
* 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.
*/
/**
* Service definition for ToolResults (v1beta3).
*
* <p>
* Reads and publishes results from Firebase Test Lab.</p>
*
* <p>
* For more information about this service, see the API
* <a href="https://firebase.google.com/docs/test-lab/" target="_blank">Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_Service_ToolResults extends Google_Service
{
/** View and manage your data across Google Cloud Platform services. */
const CLOUD_PLATFORM =
"https://www.googleapis.com/auth/cloud-platform";
public $projects;
public $projects_histories;
public $projects_histories_executions;
public $projects_histories_executions_clusters;
public $projects_histories_executions_steps;
public $projects_histories_executions_steps_perfMetricsSummary;
public $projects_histories_executions_steps_perfSampleSeries;
public $projects_histories_executions_steps_perfSampleSeries_samples;
public $projects_histories_executions_steps_thumbnails;
/**
* Constructs the internal representation of the ToolResults service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client)
{
parent::__construct($client);
$this->rootUrl = 'https://www.googleapis.com/';
$this->servicePath = 'toolresults/v1beta3/projects/';
$this->batchPath = 'batch/toolresults/v1beta3';
$this->version = 'v1beta3';
$this->serviceName = 'toolresults';
$this->projects = new Google_Service_ToolResults_Resource_Projects(
$this,
$this->serviceName,
'projects',
array(
'methods' => array(
'getSettings' => array(
'path' => '{projectId}/settings',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'initializeSettings' => array(
'path' => '{projectId}:initializeSettings',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),
)
)
);
$this->projects_histories = new Google_Service_ToolResults_Resource_ProjectsHistories(
$this,
$this->serviceName,
'histories',
array(
'methods' => array(
'create' => array(
'path' => '{projectId}/histories',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'requestId' => array(
'location' => 'query',
'type' => 'string',
),
),
),'get' => array(
'path' => '{projectId}/histories/{historyId}',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'list' => array(
'path' => '{projectId}/histories',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'filterByName' => array(
'location' => 'query',
'type' => 'string',
),
'pageSize' => array(
'location' => 'query',
'type' => 'integer',
),
'pageToken' => array(
'location' => 'query',
'type' => 'string',
),
),
),
)
)
);
$this->projects_histories_executions = new Google_Service_ToolResults_Resource_ProjectsHistoriesExecutions(
$this,
$this->serviceName,
'executions',
array(
'methods' => array(
'create' => array(
'path' => '{projectId}/histories/{historyId}/executions',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'requestId' => array(
'location' => 'query',
'type' => 'string',
),
),
),'get' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'list' => array(
'path' => '{projectId}/histories/{historyId}/executions',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'pageSize' => array(
'location' => 'query',
'type' => 'integer',
),
'pageToken' => array(
'location' => 'query',
'type' => 'string',
),
),
),'patch' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}',
'httpMethod' => 'PATCH',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'requestId' => array(
'location' => 'query',
'type' => 'string',
),
),
),
)
)
);
$this->projects_histories_executions_clusters = new Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsClusters(
$this,
$this->serviceName,
'clusters',
array(
'methods' => array(
'get' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/clusters/{clusterId}',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'clusterId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'list' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/clusters',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),
)
)
);
$this->projects_histories_executions_steps = new Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsSteps(
$this,
$this->serviceName,
'steps',
array(
'methods' => array(
'create' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'requestId' => array(
'location' => 'query',
'type' => 'string',
),
),
),'get' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'getPerfMetricsSummary' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'list' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'pageSize' => array(
'location' => 'query',
'type' => 'integer',
),
'pageToken' => array(
'location' => 'query',
'type' => 'string',
),
),
),'patch' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}',
'httpMethod' => 'PATCH',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'requestId' => array(
'location' => 'query',
'type' => 'string',
),
),
),'publishXunitXmlFiles' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}:publishXunitXmlFiles',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),
)
)
);
$this->projects_histories_executions_steps_perfMetricsSummary = new Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsStepsPerfMetricsSummary(
$this,
$this->serviceName,
'perfMetricsSummary',
array(
'methods' => array(
'create' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),
)
)
);
$this->projects_histories_executions_steps_perfSampleSeries = new Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsStepsPerfSampleSeries(
$this,
$this->serviceName,
'perfSampleSeries',
array(
'methods' => array(
'create' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'get' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'sampleSeriesId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'list' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'filter' => array(
'location' => 'query',
'type' => 'string',
'repeated' => true,
),
),
),
)
)
);
$this->projects_histories_executions_steps_perfSampleSeries_samples = new Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsStepsPerfSampleSeriesSamples(
$this,
$this->serviceName,
'samples',
array(
'methods' => array(
'batchCreate' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples:batchCreate',
'httpMethod' => 'POST',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'sampleSeriesId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'list' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'sampleSeriesId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'pageSize' => array(
'location' => 'query',
'type' => 'integer',
),
'pageToken' => array(
'location' => 'query',
'type' => 'string',
),
),
),
)
)
);
$this->projects_histories_executions_steps_thumbnails = new Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsStepsThumbnails(
$this,
$this->serviceName,
'thumbnails',
array(
'methods' => array(
'list' => array(
'path' => '{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/thumbnails',
'httpMethod' => 'GET',
'parameters' => array(
'projectId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'historyId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'executionId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'stepId' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'pageSize' => array(
'location' => 'query',
'type' => 'integer',
),
'pageToken' => array(
'location' => 'query',
'type' => 'string',
),
),
),
)
)
);
}
}
| philnewman/scoutbook | includes/vendor/google/apiclient-services/src/Google/Service/ToolResults.php | PHP | mit | 25,396 |
using Beans;
using System;
namespace FlexAuth.Security.Spoofing
{
[Bean]
public sealed class SpoofArgs
{
#region Properties
[BeanProperty]
public string UserType { get; set; }
[BeanProperty]
public string CredentialsType { get; set; }
#endregion
}
}
| g3ntle/FlexAuth | src/FlexAuth/Security/Spoofing/SpoofArgs.cs | C# | mit | 320 |
# gee-gateway
[](https://www.python.org/)
[](https://opensource.org/licenses/MIT)
A REST API designed to be used by [CEO (Collect Earth Online)](https://github.com/openforis/collect-earth-online) to interface with Google Earth Engine.
## REQUIREMENTS
1. [Python 2.7](https://www.python.org/)
2. [pip (package manager)](https://github.com/pypa/pip)
3. [Earth Engine Python API](https://developers.google.com/earth-engine/python_install)
4. [virtualenv](https://pypi.python.org/pypi/virtualenv) (Optional)
## INSTALLATION
From project root directory
```bash
pip install -r requirements.txt
```
OR using **virtualenv** (Optional)
```bash
virtualenv env
source env/bin/activate
pip install -r requirements.txt
```
## CONFIGURATION
Edit the configuration file (`config.py` or `instance/config.py`)
```python
DEBUG = False # {True|False}
PORT = 8888 # flask server running port
HOST = '0.0.0.0' # flask server running host
CO_ORIGINS = '*' # origin or list of origins to allow requests from
import logging
LOGGING_LEVEL = logging.INFO # {NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL}
```
## EXECUTION
From project root directory
```bash
python run.py
```
OR using **virtualenv** (Optional)
```bash
source env/bin/activate
python run.py
```
```bash
usage: run.py [-h] [--gmaps_api_key GMAPS_API_KEY] [--ee_account EE_ACCOUNT]
[--ee_key_path EE_KEY_PATH]
optional arguments:
-h, --help show this help message and exit
--gmaps_api_key GMAPS_API_KEY
Google Maps API key
--ee_account EE_ACCOUNT
Google Earth Engine account
--ee_key_path EE_KEY_PATH
Google Earth Engine key path
```
## DOCUMENTATION
```bash
pip install sphinx
pip install sphinxcontrib-httpdomain
```
From project root directory
```bash
sphinx-build -aE -b html . static/docs
```
## STRUCTURE
├── README.md
├── license.txt
├── requirements.txt list of third party packages to install
├── config.py configuration file
├── setup.py setup script
├── run.py application start up
├── instance/ (not in version control)
├── config.py alternative configuration file (not in version control)
├── gee_gateway/ application folder
├── __init__.py blueprint initialization
├── web/
├── __init__.py
├── errors.py error handlers definition
├── routes.py blueprint routes definition
├── gee/
├── __init__.py
├── gee_exception.py
├── utils.py
├── templates/ blueprint templates
├── index.html playground
├── static/ blueprint static files
├── assets/ css, images, js, libs and fonts
├── conf.py sphinx (documentation) configuration file
├── index.rst sphinx index file
├── static/ static resources folder
├── docs/ documentation folder
├── index.html | openforis/gee-gateway | README.md | Markdown | mit | 3,492 |
/*
* @copyright: Copyright[2015]<Svetlin Penkov>
* @date: 2015-06-19
* @email: [email protected]
* @desc: The NetTransceiver class can send and received the SPL Robocup
* messages. It can recieve game controller data and answer
* appropriately; receive and send SPL standard messages;
* broadcast coach messages.
*/
#include "net/net_transceiver.hpp"
#include <string.h>
#include <arpa/inet.h>
NetTransceiver::NetTransceiver(int team_number) {
// Socket option
int yes = 1;
// Set read timeout to 1ms
struct timeval read_timeout;
read_timeout.tv_sec = 0;
read_timeout.tv_usec = 1000 * 1; // 1 ms
// Game controller socket
game_data_sd_ = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
setsockopt(game_data_sd_, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(yes));
setsockopt(game_data_sd_, SOL_SOCKET, SO_RCVTIMEO,
&read_timeout,
sizeof(read_timeout));
sockaddr_in game_data_server;
memset(&game_data_server, 0, sizeof(game_data_server));
game_data_server.sin_family = AF_INET;
game_data_server.sin_port = htons(GAMECONTROLLER_PORT);
game_data_server.sin_addr.s_addr = INADDR_ANY;
bind(game_data_sd_,
reinterpret_cast<sockaddr*>(&game_data_server),
sizeof(sockaddr));
// SPL broadcast socket
boradcast_spl_sd_ = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
setsockopt(boradcast_spl_sd_, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(yes));
setsockopt(boradcast_spl_sd_, SOL_SOCKET, SO_RCVTIMEO,
&read_timeout,
sizeof(read_timeout));
memset(&broadcast_spl_server_, 0, sizeof(broadcast_spl_server_));
broadcast_spl_server_.sin_family = AF_INET;
broadcast_spl_server_.sin_port = htons(10000 + team_number);
broadcast_spl_server_.sin_addr.s_addr = inet_addr("255.255.255.255");
bind(boradcast_spl_sd_,
reinterpret_cast<sockaddr*>(&broadcast_spl_server_),
sizeof(sockaddr));
// Coach broadcast socket
boradcast_coach_sd_ = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
setsockopt(boradcast_coach_sd_, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(yes));
setsockopt(boradcast_coach_sd_, SOL_SOCKET, SO_RCVTIMEO,
&read_timeout,
sizeof(read_timeout));
memset(&broadcast_coach_server_, 0, sizeof(broadcast_coach_server_));
broadcast_coach_server_.sin_family = AF_INET;
broadcast_coach_server_.sin_port = htons(SPL_COACH_MESSAGE_PORT);
broadcast_coach_server_.sin_addr.s_addr = inet_addr("255.255.255.255");
bind(boradcast_coach_sd_,
reinterpret_cast<sockaddr*>(&broadcast_coach_server_),
sizeof(sockaddr));
}
bool NetTransceiver::ReceiveGameData(
const RoboCupGameControlReturnData& return_data,
RoboCupGameControlData& game_data) {
sockaddr_in game_controller;
socklen_t sockaddr_len = sizeof(sockaddr);
ssize_t len;
bool data_available = false;
// Read all received messages up to the last one, otherwise
// only the first message in the queue (the oldest) will be read.
// If the function is called often enough there should always be
// only one message in the queue. The game controller broadcasts
// 5 times per second.
do {
len = recvfrom(game_data_sd_,
&game_data,
sizeof(game_data),
0,
reinterpret_cast<sockaddr*>(&game_controller),
&sockaddr_len);
if (len > 0) data_available = true;
} while (len > 0);
// If new game controller data was received
if (!data_available) {
return false;
}
// Respond to the game controller
game_controller.sin_port = htons(GAMECONTROLLER_PORT);
sendto(game_data_sd_,
&return_data,
sizeof(return_data),
0,
reinterpret_cast<sockaddr*>(&game_controller),
sizeof(sockaddr));
return true;
}
bool NetTransceiver::BroadcastSPLStandardMessage(
const SPLStandardMessage& msg) {
ssize_t len = sendto(boradcast_spl_sd_,
&msg,
sizeof(msg),
0,
reinterpret_cast<sockaddr*>(&broadcast_spl_server_),
sizeof(sockaddr));
return (len > 0);
}
bool NetTransceiver::ReceiveSPLStandardMessage(
std::vector<SPLStandardMessage>& msgs) {
sockaddr_in sender;
socklen_t sockaddr_len = sizeof(sockaddr);
ssize_t len;
SPLStandardMessage msg;
msgs.clear();
do {
len = recvfrom(boradcast_spl_sd_,
&msg,
sizeof(msg),
0,
reinterpret_cast<sockaddr*>(&sender),
&sockaddr_len);
if (len > 0) {
msgs.push_back(msg);
}
} while (len > 0);
return (msgs.size() != 0);
}
bool NetTransceiver::BroadcastSPLCoachMessage(const SPLCoachMessage& msg) {
ssize_t len = sendto(boradcast_coach_sd_,
&msg,
sizeof(msg),
0,
reinterpret_cast<sockaddr*>(&broadcast_coach_server_),
sizeof(sockaddr));
return (len > 0);
}
| edinferno/edinferno | edante/net/src/net_transceiver.cpp | C++ | mit | 5,084 |
<?php
if (isset($this->session->userdata['logged_in'])) {
$username = ($this->session->userdata['logged_in']['username']);
$email = ($this->session->userdata['logged_in']['email']);
$id = ($this->session->userdata['logged_in']['_id']);
} else {
header("location: main/login");
} ?>
<div id="page-wrapper">
<img src="<?php echo base_url(); ?>images/pipeline.png">
</div>
| joesoftheart/Metagenomic | application/views/document.php | PHP | mit | 392 |
xxClock
=======
Just a clock sample
| timxx/xxClock | README.md | Markdown | mit | 37 |
"use strict";
let datafire = require('datafire');
let openapi = require('./openapi.json');
module.exports = datafire.Integration.fromOpenAPI(openapi, "aiception"); | DataFire/Integrations | integrations/generated/aiception/index.js | JavaScript | mit | 163 |
#ifndef __MESSAGEDISPATCH_H__
#define __MESSAGEDISPATCH_H__
struct SMessage;
class CMessageDispatch
{
public:
CMessageDispatch() {}
virtual ~CMessageDispatch() {}
protected:
public:
virtual void SendMsg(const SMessage &msg);
virtual BOOL MsgDipatch(const SMessage &msg);
};
#endif
| jjuiddong/Dx3D-Study | Evos2D/SimpleEvos/messagedispatch.h | C | mit | 292 |
<HTML>
<!-- Mirrored from botanicalepithets.net/dictionary/dictionary.52.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 14 Apr 2021 18:55:27 GMT -->
<HEAD> <meta http-equiv=content-type content="text/html;charset=ISO-8859-1"> <TITLE>Dictionary of Botanical Epithets</TITLE></HEAD><BODY><H1><CENTER>Dictionary of Botanical Epithets</CENTER></H1><H2><CENTER>caelestinus - cajanoides</CENTER></H2><P><FONT FACE="Trebuchet MS">© 2019</FONT><TABLE BORDER=1 WIDTH="100%"> <TR> <TH VALIGN=top ROWSPAN=2 align=LEFT WIDTH="20%"> <P ALIGN=LEFT><A HREF="notes.html#epithet">Epithet</A> </TH><TH COLSPAN=4 align=LEFT WIDTH="80%"> <P ALIGN=LEFT><A HREF="notes.html#definition">Definition</A> </TH></TR> <TR><TH VALIGN=bottom align=LEFT WIDTH="20%"> <P ALIGN=LEFT><A HREF="notes.html#derivation">Derivation</A> </TH><TH VALIGN=bottom align=LEFT WIDTH="15%"> <P ALIGN=LEFT><A HREF="notes.html#stem">Stem</A> </TH><TH VALIGN=bottom align=LEFT WIDTH="10%"> <P ALIGN=LEFT><A HREF="notes.html#type">Type/<BR> Gender</A> </TH><TH VALIGN=bottom align=LEFT WIDTH="35%"> <P ALIGN=LEFT><A HREF="notes.html#meaning">Meaning</A> </TH></TR><TR VALIGN=TOP><TD ROWSPAN=2>caelestinus<BR>caelestini<BR>caelestinum</TD><TD COLSPAN=4>sky blue, heavenly</TD></TR><TR><TD>caelestinus</TD><TD>caelestin</TD><TD>adj</TD><TD>heavenly</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>caelestis<BR>caelestis<BR>caeleste</TD><TD COLSPAN=4>sky blue</TD></TR><TR><TD>caelestis</TD><TD>caelest</TD><TD>adj</TD><TD>heavenly, celestial</TD></TR><TR><TD COLSPAN=4>Ionactis caelestis Leary & Nesom</TD></TR><TR VALIGN=TOP><TD ROWSPAN=4>caelicolor<BR>caelicolores<BR> </TD><TD COLSPAN=4>sky blue</TD></TR><TR><TD>caelum</TD><TD>cael</TD><TD>noun/n</TD><TD>the sky, heaven</TD></TR><TR><TD>i</TD><TD>i</TD><TD>cnct</TD><TD>connective vowel used by botanical Latin</TD></TR><TR><TD>color</TD><TD>color</TD><TD>noun</TD><TD>color</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caeruleimontanus<BR>caeruleimontana<BR>caeruleimontanum</TD><TD COLSPAN=4>from the Blue Mountains, Oregon, US</TD></TR><TR><TD>caeruleus</TD><TD>caerule</TD><TD>adj</TD><TD>dark-colored, dark blue, cerulean, azure, sea-colored, sea-green</TD></TR><TR><TD>i</TD><TD>i</TD><TD>cnct</TD><TD>connective vowel used by botanical Latin</TD></TR><TR><TD>montanus</TD><TD>montan</TD><TD>adj</TD><TD>of or belonging to the mountains</TD></TR><TR><TD COLSPAN=4>Rosa caeruleimontana St. John<BR>Ligusticum caeruleimontanum St. John</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caeruleomontanus<BR>caeruleomontana<BR>caeruleomontanum</TD><TD COLSPAN=4>from the Blue Mountains, Oregon, US</TD></TR><TR><TD>caeruleus</TD><TD>caerule</TD><TD>adj</TD><TD>dark-colored, dark blue, cerulean, azure, sea-colored, sea-green</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>montanus</TD><TD>montan</TD><TD>adj</TD><TD>of or belonging to the mountains</TD></TR><TR><TD COLSPAN=4>Draba caeruleomontana Payson & St. John</TD></TR><TR VALIGN=TOP><TD ROWSPAN=4>caeruleopurpureus<BR>caeruleopurpurea<BR>caeruleopurpureum</TD><TD COLSPAN=4>bluish purple</TD></TR><TR><TD>caeruleus</TD><TD>caerule</TD><TD>adj</TD><TD>dark-colored, dark blue, cerulean, azure, sea-colored, sea-green</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>purpureus</TD><TD>purpure</TD><TD>adj</TD><TD>purple colored</TD></TR><TR VALIGN=TOP><TD ROWSPAN=6>caeruleoracemosus<BR>caeruleoracemosa<BR>caeruleoracemosum</TD><TD COLSPAN=4>with blue racemes</TD></TR><TR><TD>caeruleus</TD><TD>caerule</TD><TD>adj</TD><TD>dark-colored, dark blue, cerulean, azure, sea-colored, sea-green</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>racemus</TD><TD>racem</TD><TD>noun/m</TD><TD>the stalk of or a cluster of a bunch of grapes</TD></TR><TR><TD>osus</TD><TD>os</TD><TD>adj</TD><TD>adjective suffix for nouns: plenitude or notable development</TD></TR><TR><TD COLSPAN=4>Passiflora x caeruleoracemosa Sabine</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>caeruleus<BR>caerulea<BR>caeruleum</TD><TD COLSPAN=4>blue</TD></TR><TR><TD>caeruleus</TD><TD>caerule</TD><TD>adj</TD><TD>dark-colored, dark blue, cerulean, azure, sea-colored, sea-green</TD></TR><TR><TD COLSPAN=4>Aquilegia caerulea James<BR>Allium caeruleum Pall.<BR>Lupinus caeruleus Heller</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>caesariatus<BR>caesariata<BR>caesariatum</TD><TD COLSPAN=4>hairy or long haired</TD></TR><TR><TD>caesariatus</TD><TD>caesariat</TD><TD>adj</TD><TD>with long hair; covered with hair</TD></TR><TR><TD COLSPAN=4>Crataegus caesariata Sarg.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=4>caesiellus<BR>caesiella<BR>caesiellum</TD><TD COLSPAN=4>somewhat blue-gray</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>ellus</TD><TD>ell</TD><TD>adj</TD><TD>adjective suffix for adjective: diminutive</TD></TR><TR><TD COLSPAN=4>Graphis caesiella Vainio<BR>Leptogium caesiellum Tuck.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=4>caesifolius<BR>caesifolia<BR>caesifolium</TD><TD COLSPAN=4>blue-gray leaves</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>folius</TD><TD>foli</TD><TD>adj</TD><TD>folium<BR>leaf</TD></TR><TR><TD COLSPAN=4>Elymus caesifolius A. Love</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesiiglaucus<BR>caesiiglauca<BR>caesiiglaucum</TD><TD COLSPAN=4>bluish gray glaucescence</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>i</TD><TD>i</TD><TD>cnct</TD><TD>connective vowel used by botanical Latin</TD></TR><TR><TD>glaucus</TD><TD>glauc</TD><TD>adj</TD><TD><SPAN STYLE= "" >γλαυκοϛ</SPAN> <BR>bright, sparkling, gleaming; grayish, bluish-green (for plants, a white bloom on a leaf giving a gray-green appearance)</TD></TR><TR><TD COLSPAN=4>Acaena caesiiglauca (Bitter) Bergmans</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesioalbus<BR>caesioalba<BR>caesioalbum</TD><TD COLSPAN=4>bluish-grayish white</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>albus</TD><TD>alb</TD><TD>adj</TD><TD>white, dead white; pale; bright</TD></TR><TR><TD COLSPAN=4>Lepraria caesioalba (de Lesd.) J. R. Laundon</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesiocinereus<BR>caesiocinerea<BR>caesiocinereum</TD><TD COLSPAN=4>ashen bluish-gray</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>cinereus</TD><TD>cinere</TD><TD>adj</TD><TD>like ashes, ash colored</TD></TR><TR><TD COLSPAN=4>Aspicilia caesiocinerea (Nyl. ex Malbr.) Arnold</TD></TR><TR VALIGN=TOP><TD ROWSPAN=6>caesiocoronatus<BR>caesiocoronata<BR>caesiocoronatum</TD><TD COLSPAN=4>with a bluish-gray crown</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>corona</TD><TD>coron</TD><TD>noun/f</TD><TD><SPAN STYLE= "" >κορωνη</SPAN> <BR>wreath, garland, crown</TD></TR><TR><TD>atus</TD><TD>at</TD><TD>adj</TD><TD>adjectival suffix for nouns: possessive of or likeness of something (with, shaped, made)/ for verb participles: a completed action, -ed</TD></TR><TR><TD COLSPAN=4>Lecidea caesiocoronata Lowe</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesiofuscus<BR>caesiofusca<BR>caesiofuscum</TD><TD COLSPAN=4>dark bluish-gray</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>fuscus</TD><TD>fusc</TD><TD>adj</TD><TD>dark, dusky, swarthy</TD></TR><TR><TD COLSPAN=4>Acarospora caesiofusca (Mull. Arg.) H. Magn.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesiopruinosus<BR>caesiopruinosa<BR>caesiopruinosum</TD><TD COLSPAN=4>frosted with a bluish gray</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>pruinosus</TD><TD>pruinos</TD><TD>adj</TD><TD>frosted</TD></TR><TR><TD COLSPAN=4>Aspicilia caesiopruinosa (H. Magn.) J. W. Thomson</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesiorubellus<BR>caesiorubella<BR>caesiorubellum</TD><TD COLSPAN=4>bluish-gray and reddish</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>rubellus</TD><TD>rubell</TD><TD>adj</TD><TD>reddish</TD></TR><TR><TD COLSPAN=4>Lecanora caesiorubella Ach.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=6>caesiorufellus<BR>caesiorufella<BR>caesiorufellum</TD><TD COLSPAN=4>greyish blue and somewhat reddish</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>rufus</TD><TD>ruf</TD><TD>adj</TD><TD>reddish</TD></TR><TR><TD>ellus</TD><TD>ell</TD><TD>adj</TD><TD>adjective suffix for adjective: diminutive</TD></TR><TR><TD COLSPAN=4>Caloplaca caesiorufella (Nyl.) Zahlbr.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesiorufus<BR>caesiorufa<BR>caesiorufum</TD><TD COLSPAN=4>greyish blue and reddish</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>rufus</TD><TD>ruf</TD><TD>adj</TD><TD>reddish</TD></TR><TR><TD COLSPAN=4>Caloplaca caesiorufa (Wibel) Flagey</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>caesiosulphureus<BR>caesiosulphurea<BR>caesiosulphureum</TD><TD COLSPAN=4>bluish-gray and yellow</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD>o</TD><TD>o</TD><TD>cnct</TD><TD>connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words</TD></TR><TR><TD>sulphureus</TD><TD>sulphure</TD><TD>adj</TD><TD>sulpherous (also sulfureus)</TD></TR><TR><TD COLSPAN=4>Lecanora caesiosulphurea Vainio</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>caesius<BR>caesia<BR>caesium</TD><TD COLSPAN=4>bluish gray</TD></TR><TR><TD>caesius</TD><TD>caesi</TD><TD>adj</TD><TD>bluish gray, as in eyes</TD></TR><TR><TD COLSPAN=4>Solidago caesia L.<BR>Allium caesium Schrenk<BR>Calamus caesius Blume</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>caespiticius<BR>caespiticia<BR>caespiticium</TD><TD COLSPAN=4>growing like sod</TD></TR><TR><TD>caespiticius</TD><TD>caespitici</TD><TD>adj</TD><TD>made of sod, turf</TD></TR><TR><TD COLSPAN=4>Cladonia caespiticia (Pers.) Florke<BR>Bryum caespiticium Hedw.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=4>caespitosus<BR>caespitosa<BR>caespitosum</TD><TD COLSPAN=4>tufted, caespitose</TD></TR><TR><TD>caespes</TD><TD>caespit</TD><TD>noun/m</TD><TD>a turf, sod; field</TD></TR><TR><TD>osus</TD><TD>os</TD><TD>adj</TD><TD>adjective suffix for nouns: plenitude or notable development</TD></TR><TR><TD COLSPAN=4>Calandrinia caespitosa Gill<BR>Eriogonum caespitosum Nutt.<BR>Erigeron caespitosus Nutt.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>caffer<BR>caffra<BR>caffrum</TD><TD COLSPAN=4>of So. Africa</TD></TR><TR><TD>caffer</TD><TD>caffr</TD><TD>adj</TD><TD>kafir<BR>Arabic<BR>unbeliever, pagan</TD></TR><TR><TD COLSPAN=4>Encephalartos caffer (Thunb.) Lehm.<BR>Aberia caffra Hook. f. & Harvey<BR>Combretum caffrum (Eckl. & Zeyh.) Kuntze</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>caffri<BR>caffrorum<BR> </TD><TD COLSPAN=4>of So. Africa</TD></TR><TR><TD>caffer</TD><TD>caffr</TD><TD>adj</TD><TD>kafir<BR>Arabic<BR>unbeliever, pagan</TD></TR><TR><TD COLSPAN=4>Panicum caffrorum Retz.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>cainito<BR>cainito<BR> </TD><TD COLSPAN=4>star apple</TD></TR><TR><TD>cainito</TD><TD>cainito</TD><TD>noun</TD><TD>West Indian<BR>apple</TD></TR><TR><TD COLSPAN=4>Chrysophyllum cainito L.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=4>cairicus<BR>cairica<BR>cairicum</TD><TD COLSPAN=4>from Cairo, Egypt</TD></TR><TR><TD>cairo</TD><TD>cair</TD><TD>noun</TD><TD>Cairo<BR>English<BR>Anglicized version of Arabic: al-Qâhirah, city on the north Nile near the beginning of the delta on the Mediterranean Sea</TD></TR><TR><TD>icus</TD><TD>ic</TD><TD>adj</TD><TD><SPAN STYLE= "" >-ικοϛ</SPAN> <BR>adjective suffix for nouns: belonging to, from, of</TD></TR><TR><TD COLSPAN=4>Ipomoea cairica (L.) Sweet<BR>Convolvulus cairicus L.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=3>cajan<BR>cajan<BR> </TD><TD COLSPAN=4>pigeon tea</TD></TR><TR><TD>cajan</TD><TD>cajan</TD><TD>noun</TD><TD>Malay<BR>katjang: pigeon tea</TD></TR><TR><TD COLSPAN=4>Cajan cajan (L.) Huth</TD></TR><TR VALIGN=TOP><TD ROWSPAN=5>cajanifolius<BR>cajanifolia<BR>cajanifolium</TD><TD COLSPAN=4>leaves like pigeon tea</TD></TR><TR><TD>cajan</TD><TD>cajan</TD><TD>noun</TD><TD>Malay<BR>katjang: pigeon tea</TD></TR><TR><TD>i</TD><TD>i</TD><TD>cnct</TD><TD>connective vowel used by botanical Latin</TD></TR><TR><TD>folius</TD><TD>foli</TD><TD>adj</TD><TD>folium<BR>leaf</TD></TR><TR><TD COLSPAN=4>Crotalaria cajanifolia Kunth<BR>Desmodium cajanifolium (Kunth) DC.</TD></TR><TR VALIGN=TOP><TD ROWSPAN=4>cajanoides<BR>cajanoides<BR>cajanoides</TD><TD COLSPAN=4>like pigeon tea</TD></TR><TR><TD>cajan</TD><TD>cajan</TD><TD>noun</TD><TD>Malay<BR>katjang: pigeon tea</TD></TR><TR><TD>oides</TD><TD>oid</TD><TD>adj</TD><TD><SPAN STYLE= "" >-οειδεϛ</SPAN> <BR>adjective suffix for nouns: like, resemble</TD></TR><TR><TD COLSPAN=4>Eriosema cajanoides (Guill. & Perr.) Hook. f.</TD></TR></TABLE>
| loveencounterflow/Species-Characterum-Sinensium | botanicalepithets.net/dictionary/dictionary.52.html | HTML | mit | 15,095 |
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInitecd8c4fb9270eb60d84d00ad5cbf3d47
{
public static $files = array (
'7745382c92b7799bf1294b1f43023ba2' => __DIR__ . '/..' . '/tracy/tracy/src/shortcuts.php',
);
public static $classMap = array (
'BITbuilder\\core\\Builder' => __DIR__ . '/..' . '/brainstormit/bitbuilder/src/core/Builder.php',
'BITbuilder\\core\\Query' => __DIR__ . '/..' . '/brainstormit/bitbuilder/src/core/Query.php',
'BITbuilder\\helpers\\Arr' => __DIR__ . '/..' . '/brainstormit/bitbuilder/src/helpers/Arr.php',
'BITbuilder\\helpers\\Database' => __DIR__ . '/..' . '/brainstormit/bitbuilder/src/helpers/Database.php',
'BITbuilder\\helpers\\Str' => __DIR__ . '/..' . '/brainstormit/bitbuilder/src/helpers/Str.php',
'Tracy\\Bar' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/Bar.php',
'Tracy\\BlueScreen' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/BlueScreen.php',
'Tracy\\Bridges\\Nette\\TracyExtension' => __DIR__ . '/..' . '/tracy/tracy/src/Bridges/Nette/TracyExtension.php',
'Tracy\\Debugger' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/Debugger.php',
'Tracy\\DefaultBarPanel' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/DefaultBarPanel.php',
'Tracy\\Dumper' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/Dumper.php',
'Tracy\\FireLogger' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/FireLogger.php',
'Tracy\\Helpers' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/Helpers.php',
'Tracy\\IBarPanel' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/IBarPanel.php',
'Tracy\\ILogger' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/ILogger.php',
'Tracy\\Logger' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/Logger.php',
'Tracy\\OutputDebugger' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/OutputDebugger.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->classMap = ComposerStaticInitecd8c4fb9270eb60d84d00ad5cbf3d47::$classMap;
}, null, ClassLoader::class);
}
}
| dennisslimmers01/Snail-MVC | vendor/composer/autoload_static.php | PHP | mit | 2,211 |
#!/bin/bash
echo "Hello Shell World"
| arpanpal010/dotfiles | Templates/Shell script.sh | Shell | mit | 38 |
#![crate_name = "nickel"]
#![comment = "A expressjs inspired web framework for Rust"]
#![license = "MIT"]
#![crate_type = "rlib"]
#![feature(macro_rules, phase, slicing_syntax)]
//!Nickel is supposed to be a simple and lightweight foundation for web applications written in Rust. Its API is inspired by the popular express framework for JavaScript.
//!
//!Some of the features are:
//!
//!* Easy handlers: A handler is just a function that takes a `Request` and `ResponseWriter`
//!* Variables in routes. Just write `my/route/:someid`
//!* Easy parameter access: `request.params.get(&"someid")`
//!* simple wildcard routes: `/some/*/route`
//!* double wildcard routes: `/a/**/route`
//!* middleware
extern crate time;
extern crate http;
extern crate serialize;
extern crate regex;
extern crate anymap;
extern crate url;
extern crate mustache;
extern crate groupable;
#[phase(plugin)]
extern crate regex_macros;
#[phase(plugin, link)]
extern crate log;
pub use nickel::Nickel;
pub use request::Request;
pub use response::Response;
pub use middleware::{Action, Continue, Halt, Middleware, ErrorHandler, MiddlewareResult};
pub use static_files_handler::StaticFilesHandler;
pub use favicon_handler::FaviconHandler;
pub use default_error_handler::DefaultErrorHandler;
pub use json_body_parser::{JsonBodyParser, JsonBody};
pub use query_string::{QueryStringParser, QueryString};
pub use router::{Router, Route, RouteResult, RequestHandler, HttpRouter};
pub use nickel_error::{ NickelError, NickelErrorKind, ErrorWithStatusCode, UserDefinedError, Other };
pub use mimes::get_media_type;
pub mod router;
mod server;
mod nickel;
mod request;
mod response;
mod middleware;
mod favicon_handler;
mod static_files_handler;
mod json_body_parser;
mod mimes;
mod query_string;
mod urlencoded;
mod nickel_error;
mod default_error_handler;
| jedisct1/nickel.rs | src/lib.rs | Rust | mit | 1,827 |
<?php
/**
* Valid Variable Name Unit Test
*
* @package CodeIgniter4-Standard
* @author Louis Linehan <[email protected]>
* @copyright 2017 British Columbia Institute of Technology
* @license https://github.com/bcit-ci/CodeIgniter4-Standard/blob/master/LICENSE MIT License
*/
namespace CodeIgniter4\Tests\NamingConventions;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
class ValidVariableNameUnitTest extends AbstractSniffUnitTest
{
/**
* Returns the lines where errors should occur.
*
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
* @return array<int, int>
*/
public function getErrorList()
{
return array(
3 => 1,
4 => 1,
5 => 1,
);
}//end getErrorList()
/**
* Returns the lines where warnings should occur.
*
* The key of the array should represent the line number and the value
* should represent the number of warnings that should occur on that line.
*
* @return array<int, int>
*/
public function getWarningList()
{
return array();
}//end getWarningList()
}//end class
| louisl/CodeIgniter4-Standard | CodeIgniter4/Tests/NamingConventions/ValidVariableNameUnitTest.php | PHP | mit | 1,298 |
package com.aspose.imaging.examples.djvu;
import com.aspose.imaging.Image;
import com.aspose.imaging.examples.Logger;
import com.aspose.imaging.examples.Utils;
import com.aspose.imaging.fileformats.djvu.DjvuImage;
import com.aspose.imaging.fileformats.tiff.enums.TiffExpectedFormat;
import com.aspose.imaging.imageoptions.DjvuMultiPageOptions;
import com.aspose.imaging.imageoptions.TiffOptions;
public class ConvertDjvuToTiff
{
public static void main(String[] args)
{
Logger.startExample("ConvertDjvuToTiff");
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir() + "djvu/";
//Load a DjVu image
try (DjvuImage image = (DjvuImage) Image.load(dataDir + "Sample.djvu"))
{
//Create an instance of TiffOptions & use preset options for Black n While with Deflate compression
TiffOptions exportOptions = new TiffOptions(TiffExpectedFormat.TiffDeflateBw);
//Initialize the DjvuMultiPageOptions
exportOptions.setMultiPageOptions(new DjvuMultiPageOptions());
//Call Save method while passing instance of TiffOptions
image.save(Utils.getOutDir() + "ConvertDjvuToTiff_out.tiff", exportOptions);
// Display Status.
Logger.println("File converted");
}
Logger.endExample();
}
}
| aspose-imaging/Aspose.Imaging-for-Java | Examples/src/main/java/com/aspose/imaging/examples/djvu/ConvertDjvuToTiff.java | Java | mit | 1,413 |
/* libhs - public domain
Niels Martignène <[email protected]>
https://koromix.dev/libhs
This software is in the public domain. Where that dedication is not
recognized, you are granted a perpetual, irrevocable license to copy,
distribute, and modify this file as you see fit.
See the LICENSE file for more details. */
#include "common_priv.h"
#include <poll.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <unistd.h>
#include "device_priv.h"
#include "platform.h"
#include "serial.h"
int hs_serial_set_config(hs_port *port, const hs_serial_config *config)
{
assert(port);
assert(config);
struct termios tio;
int modem_bits;
int r;
r = tcgetattr(port->u.file.fd, &tio);
if (r < 0)
return hs_error(HS_ERROR_SYSTEM, "Unable to get serial port settings from '%s': %s",
port->path, strerror(errno));
r = ioctl(port->u.file.fd, TIOCMGET, &modem_bits);
if (r < 0)
return hs_error(HS_ERROR_SYSTEM, "Unable to get modem bits from '%s': %s",
port->path, strerror(errno));
if (config->baudrate) {
speed_t std_baudrate;
switch (config->baudrate) {
case 110: { std_baudrate = B110; } break;
case 134: { std_baudrate = B134; } break;
case 150: { std_baudrate = B150; } break;
case 200: { std_baudrate = B200; } break;
case 300: { std_baudrate = B300; } break;
case 600: { std_baudrate = B600; } break;
case 1200: { std_baudrate = B1200; } break;
case 1800: { std_baudrate = B1800; } break;
case 2400: { std_baudrate = B2400; } break;
case 4800: { std_baudrate = B4800; } break;
case 9600: { std_baudrate = B9600; } break;
case 19200: { std_baudrate = B19200; } break;
case 38400: { std_baudrate = B38400; } break;
case 57600: { std_baudrate = B57600; } break;
case 115200: { std_baudrate = B115200; } break;
case 230400: { std_baudrate = B230400; } break;
default: {
return hs_error(HS_ERROR_SYSTEM, "Unsupported baud rate value: %u",
config->baudrate);
} break;
}
cfsetispeed(&tio, std_baudrate);
cfsetospeed(&tio, std_baudrate);
}
if (config->databits) {
tio.c_cflag &= (unsigned int)~CSIZE;
switch (config->databits) {
case 5: { tio.c_cflag |= CS5; } break;
case 6: { tio.c_cflag |= CS6; } break;
case 7: { tio.c_cflag |= CS7; } break;
case 8: { tio.c_cflag |= CS8; } break;
default: {
return hs_error(HS_ERROR_SYSTEM, "Invalid data bits setting: %u",
config->databits);
} break;
}
}
if (config->stopbits) {
tio.c_cflag &= (unsigned int)~CSTOPB;
switch (config->stopbits) {
case 1: {} break;
case 2: { tio.c_cflag |= CSTOPB; } break;
default: {
return hs_error(HS_ERROR_SYSTEM, "Invalid stop bits setting: %u",
config->stopbits);
} break;
}
}
if (config->parity) {
tio.c_cflag &= (unsigned int)~(PARENB | PARODD);
#ifdef CMSPAR
tio.c_cflag &= (unsigned int)~CMSPAR;
#endif
switch (config->parity) {
case HS_SERIAL_CONFIG_PARITY_OFF: {} break;
case HS_SERIAL_CONFIG_PARITY_EVEN: { tio.c_cflag |= PARENB; } break;
case HS_SERIAL_CONFIG_PARITY_ODD: { tio.c_cflag |= PARENB | PARODD; } break;
#ifdef CMSPAR
case HS_SERIAL_CONFIG_PARITY_SPACE: { tio.c_cflag |= PARENB | CMSPAR; } break;
case HS_SERIAL_CONFIG_PARITY_MARK: { tio.c_cflag |= PARENB | PARODD | CMSPAR; } break;
#else
case HS_SERIAL_CONFIG_PARITY_MARK:
case HS_SERIAL_CONFIG_PARITY_SPACE: {
return hs_error(HS_ERROR_SYSTEM, "Mark/space parity is not supported");
} break;
#endif
default: {
return hs_error(HS_ERROR_SYSTEM, "Invalid parity setting: %d", config->parity);
} break;
}
}
if (config->rts) {
tio.c_cflag &= (unsigned int)~CRTSCTS;
modem_bits &= ~TIOCM_RTS;
switch (config->rts) {
case HS_SERIAL_CONFIG_RTS_OFF: {} break;
case HS_SERIAL_CONFIG_RTS_ON: { modem_bits |= TIOCM_RTS; } break;
case HS_SERIAL_CONFIG_RTS_FLOW: { tio.c_cflag |= CRTSCTS; } break;
default: {
return hs_error(HS_ERROR_SYSTEM, "Invalid RTS setting: %d", config->rts);
} break;
}
}
switch (config->dtr) {
case 0: {} break;
case HS_SERIAL_CONFIG_DTR_OFF: { modem_bits &= ~TIOCM_DTR; } break;
case HS_SERIAL_CONFIG_DTR_ON: { modem_bits |= TIOCM_DTR; } break;
default: {
return hs_error(HS_ERROR_SYSTEM, "Invalid DTR setting: %d", config->dtr);
} break;
}
if (config->xonxoff) {
tio.c_iflag &= (unsigned int)~(IXON | IXOFF | IXANY);
switch (config->xonxoff) {
case HS_SERIAL_CONFIG_XONXOFF_OFF: {} break;
case HS_SERIAL_CONFIG_XONXOFF_IN: { tio.c_iflag |= IXOFF; } break;
case HS_SERIAL_CONFIG_XONXOFF_OUT: { tio.c_iflag |= IXON | IXANY; } break;
case HS_SERIAL_CONFIG_XONXOFF_INOUT: { tio.c_iflag |= IXOFF | IXON | IXANY; } break;
default: {
return hs_error(HS_ERROR_SYSTEM, "Invalid XON/XOFF setting: %d", config->xonxoff);
} break;
}
}
r = ioctl(port->u.file.fd, TIOCMSET, &modem_bits);
if (r < 0)
return hs_error(HS_ERROR_SYSTEM, "Unable to set modem bits of '%s': %s",
port->path, strerror(errno));
r = tcsetattr(port->u.file.fd, TCSANOW, &tio);
if (r < 0)
return hs_error(HS_ERROR_SYSTEM, "Unable to change serial port settings of '%s': %s",
port->path, strerror(errno));
return 0;
}
int hs_serial_get_config(hs_port *port, hs_serial_config *config)
{
assert(port);
struct termios tio;
int modem_bits;
int r;
r = tcgetattr(port->u.file.fd, &tio);
if (r < 0)
return hs_error(HS_ERROR_SYSTEM, "Unable to read port settings from '%s': %s",
port->path, strerror(errno));
r = ioctl(port->u.file.fd, TIOCMGET, &modem_bits);
if (r < 0)
return hs_error(HS_ERROR_SYSTEM, "Unable to get modem bits from '%s': %s",
port->path, strerror(errno));
/* 0 is the INVALID value for all parameters, we keep that value if we can't interpret
a termios value (only a cross-platform subset of it is exposed in hs_serial_config). */
memset(config, 0, sizeof(*config));
switch (cfgetispeed(&tio)) {
case B110: { config->baudrate = 110; } break;
case B134: { config->baudrate = 134; } break;
case B150: { config->baudrate = 150; } break;
case B200: { config->baudrate = 200; } break;
case B300: { config->baudrate = 300; } break;
case B600: { config->baudrate = 600; } break;
case B1200: { config->baudrate = 1200; } break;
case B1800: { config->baudrate = 1800; } break;
case B2400: { config->baudrate = 2400; } break;
case B4800: { config->baudrate = 4800; } break;
case B9600: { config->baudrate = 9600; } break;
case B19200: { config->baudrate = 19200; } break;
case B38400: { config->baudrate = 38400; } break;
case B57600: { config->baudrate = 57600; } break;
case B115200: { config->baudrate = 115200; } break;
case B230400: { config->baudrate = 230400; } break;
}
switch (tio.c_cflag & CSIZE) {
case CS5: { config->databits = 5; } break;
case CS6: { config->databits = 6; } break;
case CS7: { config->databits = 7; } break;
case CS8: { config->databits = 8; } break;
}
if (tio.c_cflag & CSTOPB) {
config->stopbits = 2;
} else {
config->stopbits = 1;
}
// FIXME: should we detect IGNPAR here?
if (tio.c_cflag & PARENB) {
#ifdef CMSPAR
switch (tio.c_cflag & (PARODD | CMSPAR)) {
#else
switch (tio.c_cflag & PARODD) {
#endif
case 0: { config->parity = HS_SERIAL_CONFIG_PARITY_EVEN; } break;
case PARODD: { config->parity = HS_SERIAL_CONFIG_PARITY_ODD; } break;
#ifdef CMSPAR
case CMSPAR: { config->parity = HS_SERIAL_CONFIG_PARITY_SPACE; } break;
case CMSPAR | PARODD: { config->parity = HS_SERIAL_CONFIG_PARITY_MARK; } break;
#endif
}
} else {
config->parity = HS_SERIAL_CONFIG_PARITY_OFF;
}
if (tio.c_cflag & CRTSCTS) {
config->rts = HS_SERIAL_CONFIG_RTS_FLOW;
} else if (modem_bits & TIOCM_RTS) {
config->rts = HS_SERIAL_CONFIG_RTS_ON;
} else {
config->rts = HS_SERIAL_CONFIG_RTS_OFF;
}
if (modem_bits & TIOCM_DTR) {
config->dtr = HS_SERIAL_CONFIG_DTR_ON;
} else {
config->dtr = HS_SERIAL_CONFIG_DTR_OFF;
}
switch (tio.c_iflag & (IXON | IXOFF)) {
case 0: { config->xonxoff = HS_SERIAL_CONFIG_XONXOFF_OFF; } break;
case IXOFF: { config->xonxoff = HS_SERIAL_CONFIG_XONXOFF_IN; } break;
case IXON: { config->xonxoff = HS_SERIAL_CONFIG_XONXOFF_OUT; } break;
case IXOFF | IXON: { config->xonxoff = HS_SERIAL_CONFIG_XONXOFF_INOUT; } break;
}
return 0;
}
ssize_t hs_serial_read(hs_port *port, uint8_t *buf, size_t size, int timeout)
{
assert(port);
assert(port->type == HS_DEVICE_TYPE_SERIAL);
assert(port->mode & HS_PORT_MODE_READ);
assert(buf);
assert(size);
ssize_t r;
if (timeout) {
struct pollfd pfd;
uint64_t start;
pfd.events = POLLIN;
pfd.fd = port->u.file.fd;
start = hs_millis();
restart:
r = poll(&pfd, 1, hs_adjust_timeout(timeout, start));
if (r < 0) {
if (errno == EINTR)
goto restart;
return hs_error(HS_ERROR_IO, "I/O error while reading from '%s': %s", port->path,
strerror(errno));
}
if (!r)
return 0;
}
r = read(port->u.file.fd, buf, size);
if (r < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
return 0;
return hs_error(HS_ERROR_IO, "I/O error while reading from '%s': %s", port->path,
strerror(errno));
}
return r;
}
ssize_t hs_serial_write(hs_port *port, const uint8_t *buf, size_t size, int timeout)
{
assert(port);
assert(port->type == HS_DEVICE_TYPE_SERIAL);
assert(port->mode & HS_PORT_MODE_WRITE);
assert(buf);
struct pollfd pfd;
uint64_t start;
int adjusted_timeout;
size_t written;
pfd.events = POLLOUT;
pfd.fd = port->u.file.fd;
start = hs_millis();
adjusted_timeout = timeout;
written = 0;
do {
ssize_t r;
r = poll(&pfd, 1, adjusted_timeout);
if (r < 0) {
if (errno == EINTR)
continue;
return hs_error(HS_ERROR_IO, "I/O error while writing to '%s': %s", port->path,
strerror(errno));
}
if (!r)
break;
r = write(port->u.file.fd, buf + written, size - written);
if (r < 0) {
if (errno == EINTR)
continue;
return hs_error(HS_ERROR_IO, "I/O error while writing to '%s': %s", port->path,
strerror(errno));
}
written += (size_t)r;
adjusted_timeout = hs_adjust_timeout(timeout, start);
} while (written < size && adjusted_timeout);
return (ssize_t)written;
}
| Koromix/ty | src/libhs/serial_posix.c | C | mit | 11,923 |
## Polk-x
极简Hexo博客主题, 基于[polk](https://github.com/chunqiuyiyu/hexo-theme-polk)主题修改.
## Preview
[My Blog](http://www.leviathan.vip)

## Install
```shell
cd your-blog
git clone https://github.com/Leviathan1995/hexo-theme-polk-x.git themes/polk-x
```
### 修改主题
修改博客根目录下`_config.yml`
```
theme: polk-x
```
为了更好的显示效果,请将页面渲染文章数量`per_page`改为20(默认为10).
## 添加RSS订阅
* 安装RSS插件
```shell
npm install hexo-generator-feed
```
* 修改博客根目录下`_config.yml`
```yml
# RSS
rss: true
plugin:
- hexo-generator-feed
# Feed Atom
feed:
type: atom
path: atom.xml
limit: 20
target: _blank
```
* 重新部署
```shell
hexo clean
hexo g
```
## 添加评论插件
添加评论插件代码至`layout/post.ejs`的注释`<!-- 评论插件 -->`下方即可.
## 浏览器支持
- Internet Explorer 9+
- Firefox
- Opera
- Chrome
- Safari
- Edge
## Thanks
* [polk](https://github.com/chunqiuyiyu/hexo-theme-polk)
## Contribution
Issues and pull requests are welcome
## License
[MIT](LICENSE)
| Leviathan1995/Lo | README.md | Markdown | mit | 1,191 |
/**
*
*/
package videoSearch.service;
import videoSearch.domain.Video;
/**
* @author ÒÝ´Ï
*
*/
public interface VideoService {
Video add(Video video);
Video get(String name);
}
| Battleforg/videoSearch | src/videoSearch/service/VideoService.java | Java | mit | 202 |
/*
Name: Peter Corcoran, PMCORCOR
Program: corcoran.h - header for common items
Version: 1.0
Date Started: Nov 14, 2014
*/
#define BIT0 0x01
#define BIT1 0x02
#define BIT2 0x04
#define BIT3 0x08
#define BIT4 0x10
#define BIT5 0x20
#define BIT6 0x40
#define BIT7 0x80
/*
Define a boolean type
*/
typedef enum { false, true } bool;
void compliment(bool *val);
void initSystemClock(); | corcoranp/ee337 | LabIncludes/common.h | C | mit | 423 |
import { NgModule } from '@angular/core'
import { CloudtasksDirective } from './ngx-image.directive'
@NgModule({
declarations: [CloudtasksDirective],
exports: [CloudtasksDirective]
})
export class CloudtasksModule {}
| Cloudtasks/ngx-image | src/ngx-image.module.ts | TypeScript | mit | 223 |
__author__ = 'scsi'
| f0rki/cb-multios | original-challenges/Mixology/support/mixcodegen/__init__.py | Python | mit | 20 |
package server;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
public class TestTcpServer {
public static void main(String[] args) {
for (int i = 0; i < 2000; i++) {
final int j = i;
new Thread("Thread-" + i) {
public void run() {
new TestTcpServer().startNewClient(j);
};
}.start();
}
}
private void startNewClient(int i) {
try{
Socket socket=new Socket("172.30.86.29",8080);
PrintWriter os=new PrintWriter(socket.getOutputStream());
BufferedReader is=new BufferedReader(new InputStreamReader(socket.getInputStream()));
String readline = "hello world "+this+", ->"+i;
os.println(readline);
os.flush();
System.out.println("Client:"+readline);
while(!readline.equals("bye")){
readline=is.readLine();
System.out.println("Server:"+readline);
}
os.close();
is.close();
socket.close();
}catch(Exception e){
System.out.println("error "+e.toString());
}
}
}
| watson-song/SKPush-Server | src/test/scala/server/TestTcpServer.java | Java | mit | 1,009 |
var ZeroServer = require('./ZeroServer');
var ZeroStream = require('./ZeroStream');
function zero_listen (stream_url, options, callback) {
return new ZeroServer(stream_url, options, callback);
}
function zero_connect (stream_url, options, callback) {
var stream = new ZeroStream();
stream.connect(stream_url, options, callback);
return stream;
}
module.exports = {
listen: zero_listen,
connect: zero_connect
};
| gritzko/stream-url | src/zero.js | JavaScript | mit | 438 |
namespace Banicharnica.Services.Contracts
{
public interface IDbInitializerService
{
void InitializeDatabase();
}
} | stoyanov7/SoftwareUniversity | C#Development/Database/DatabasesAdvanced/AutoMappingObjects/Banicharnica.Services/Contracts/IDbInitializerService.cs | C# | mit | 144 |
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box
}
:before,
:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box
}
html,
body {
height: 100%
}
a,
a:active,
a:focus,
input:focus {
text-decoration: none!important;
outline: 0
}
::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.1)
}
:-moz-placeholder {
color: rgba(255, 255, 255, 0.1)
}
::-moz-placeholder {
color: rgba(255, 255, 255, 0.1)
}
:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.1)
}
input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
-webkit-border-radius: 0!important;
-moz-border-radius: 0!important;
border-radius: 0!important
}
.gpu-hack {
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
perspective: 1000px;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
transform: translateZ(0);
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden
}
.bg-cover {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
z-index: 0;
}
.bg-cover::after {
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: -moz-linear-gradient(270deg, rgba(29, 31, 40, 0.75) 0%, rgba(29, 31, 40, 0.95) 100%);
background: -webkit-linear-gradient(270deg, rgba(29, 31, 40, 0.75) 0%, rgba(29, 31, 40, 0.95) 100%);
background: -o-linear-gradient(270deg, rgba(29, 31, 40, 0.75) 0%, rgba(29, 31, 40, 0.95) 100%);
background: -ms-linear-gradient(270deg, rgba(29, 31, 40, 0.75) 0%, rgba(29, 31, 40, 0.95) 100%);
background: linear-gradient(180deg, rgba(29, 31, 40, 0.75) 0%, rgba(29, 31, 40, 0.95) 100%)
}
div[class^="sven-char"] {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
perspective: 1000px;
outline: 1px solid transparent
}
.abs-center {
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%)
}
.mt-0 {
margin-top: 0
}
body {
padding: 0;
margin: 0;
background: #151515;
color: #fff;
font-size: 16px;
line-height: 30px
}
.content-wrapper {
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
text-align: center;
z-index: 1
}
.content-wrapper::before {
content: '';
display: inline-block;
height: 100%;
margin-right: -.25em;
vertical-align: middle
}
.v-center {
position: relative;
display: inline-block;
width: 86%;
text-align: left;
}
.main-content {
visibility: hidden
}
p {
font-size: 1em;
line-height: 1.875em;
margin: 0;
padding: 0 0 .9375em
}
h3 {
margin-bottom: .714em;
padding: 0;
font-size: 1.333em;
line-height: 1.429em
}
p a {
color: #DDC225
}
ul {
padding: 0;
margin: 0;
font-size: .75em
}
ul li {
position: relative;
display: inline;
padding-bottom: .1875em;
margin-right: .75em
}
li a {
color: #A3A3A3;
-webkit-transition: color .5s;
-moz-transition: color .5s;
-ms-transition: color .5s;
-o-transition: color .5s;
transition: color .5s;
cursor: pointer
}
li a:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
opacity: 0;
width: 100%;
height: .125em;
background-color: #DDC225;
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s
}
li a:hover {
color: #FFF
}
li a:hover:after {
opacity: 1
}
a.btn-fill,
a.btn-bordered {
padding: .5em 1em;
border: .063em solid transparent;
border-radius: .125em;
font-weight: 700;
text-transform: uppercase
}
a.btn-fill:after,
a.btn-bordered:after {
display: none
}
a.btn-fill {
color: #00A1E0;
background: #FFD61F
}
a.btn-fill:hover {
background: #FFF;
color: #00A1E0
}
a.btn-bordered {
color: #FFF;
border-color: #FFF
}
#drifter,
#particles-js {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
overflow: hidden
}
.sven-badge {
position: fixed;
left: 0;
right: 0;
bottom: 2em;
margin: 0 auto;
width: 86%;
font-size: .438em;
line-height: 1.875em;
text-transform: uppercase;
letter-spacing: .0625em;
z-index: 10
}
.sven-badge a {
color: #707070
}
.sven-badge span {
display: inline-block;
font-weight: 700;
border-bottom: 1px dotted
}
.sven-badge:hover span {
color: #DDC225;
border-bottom: 1px dotted transparent
}
.preloader {
z-index: 100
}
.spinner {
position: relative;
width: 1em;
height: 1em;
margin: 0 auto;
border-radius: 50%;
background: #DDC225;
background: -moz-linear-gradient(top, #DDC225 10%, rgba(255, 255, 255, 0) 100%);
background: -webkit-linear-gradient(top, #DDC225 10%, rgba(255, 255, 255, 0) 100%);
background: linear-gradient(to bottom, #DDC225 10%, rgba(255, 255, 255, 0) 100%);
-webkit-animation: load 1s infinite linear;
-moz-animation: load 1s infinite linear;
animation: load 1s infinite linear
}
.spinner:before,
.spinner:after {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%
}
.spinner:before {
border-radius: 100%;
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 50%, #DDC225 50%);
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 50%, #DDC225 50%);
background: linear-gradient(to right, rgba(255, 255, 255, 0) 50%, #DDC225 50%)
}
.spinner:after {
width: 90%;
height: 90%;
margin: auto;
border-radius: 50%;
background: #151515
}
@-webkit-keyframes load {
from {
-webkit-transform: rotate(0deg)
}
to {
-webkit-transform: rotate(360deg)
}
}
@-moz-keyframes load {
from {
-moz-transform: rotate(0deg)
}
to {
-moz-transform: rotate(360deg)
}
}
@keyframes load {
from {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg)
}
to {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg)
}
}
#minimos-1 {
font-family: "Raleway", sans-serif;
background: #151515
}
#minimos-2,
#minimos-2 .spinner:after {
font-family: "Abel", sans-serif;
background: #280B29
}
#minimos-3,
#minimos-3 .spinner:after {
font-family: "Nunito", sans-serif;
background: #00A1E0
}
#minimos-3 .sven-badge a {
color: #CCC
}
#minimos-3 .sven-badge:hover span {
color: #FFD61F
}
#minimos-4,
#minimos-4 .spinner:after {
font-family: "Josefin Sans", sans-serif;
background: #F85E25
}
#minimos-4 .sven-badge a {
color: #CCC
}
#minimos-4 .sven-badge:hover span {
color: #F8EB31
}
#minimos-4 li a {
color: #E0E0E0
}
#minimos-4 li a:hover {
color: #FFF
}
#cafe1 {
font-family: "Crimson Text", serif;
color: #FFF
}
#cafe1 h3 {
font-family: 'Alegreya', serif;
font-weight: 700;
color: #D08E25
}
#cafe1 .bg-image {
background-image: url(cafe1-bg.jpg)
}
#cafe2 {
font-family: "Cormorant Infant", serif;
color: #FFF
}
#cafe2 h3 {
font-family: 'Muli', serif;
font-weight: 700;
color: #D08E25
}
#cafe2 .bg-image {
background-image: url(../images/cafe2-bg.jpg)
}
#cafe1 .spinner::after,
#cafe2 .spinner::after {
background: transparent
}
.layout-center ,
.layout-center .sven-badge {
text-align: center
}
.layout-center .main-content {
margin: 0 auto
}
@media only screen and (min-width: 768px) {
body {
font-size: 22px;
line-height: 48px
}
.main-content {
width: 80%
}
}
@media only screen and (min-width: 1200px) {
body {
font-size: 26px;
line-height: 48px
}
}
@media only screen and (min-width: 1824px) {
body {
font-size: 32px;
line-height: 60px
}
} | soumithr/react-simple-boilerplate2 | thanks.css | CSS | mit | 8,761 |
/**
* Smart Auto Complete plugin
*
* Copyright (c) 2011 Lakshan Perera (laktek.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
*
*/
/*
Requirements: jQuery 1.5 or above
Usage:
$(target).smartAutoComplete({options})
Options:
minCharLimit: (integer) minimum characters user have to type before invoking the autocomplete (default: 1)
maxCharLimit: (integer) maximum characters user can type while invoking the autocomplete (default: null (unlimited))
maxResults: (integer) maximum number of results to return (default: null (unlimited))
delay: (integer) delay before autocomplete starts (default: 0)
disabled: (boolean) whether autocomplete disabled on the field (default: false)
forceSelect: (boolean) If set to true, field will be always filled with best matching result, without leaving the custom input.
Better to enable this option, if you want autocomplete field to behave similar to a HTML select field. (Check Example 2 in the demo)
(default: false)
typeAhead: (boolean) If set to true, it will offer the best matching result in grey within the field; that can be auto-completed by pressing the right arrow-key or enter.
This is similar to behaviour in Google Instant Search's query field (Check Example 3 in the demo)
(default: false)
source: (string/array) you can supply an array with items or a string containing a URL to fetch items for the source
this is optional if you prefer to have your own filter method
filter: (function) define a custom function that would return matching items to the entered text (this will override the default filtering algorithm)
should return an array or a Deferred object (ajax call)
parameters available: term, source
resultFormatter: (function) the function you supply here will be called to format the output of an individual result.
should return a string
parameters available: result
resultsContainer: (selector) to which element(s) the result should be appended.
resultElement: (selector) references to the result elements collection (e.g. li, div.result)
Events:
keyIn: fires when user types into the field (parameters: query)
resultsReady: fires when the filter function returns (parameters: results)
showResults: fires when results are shown (parameters: results)
noResults: fires when filter returns an empty array
itemSelect: fires when user selects an item from the result list (paramters: item)
itemFocus: fires when user highlights an item with mouse or arrow keys (paramters: item)
itemUnfocus: fires when user moves out from an highlighted item (paramters: item)
lostFocus: fires when autocomplete field loses focus by user clicking outside of the field or focusing on another field. Also, this event is fired when a value is selected
})
*/
(function($){
$.fn.smartAutoComplete = function(){
if(arguments.length < 1){
// get the smart autocomplete object of the first element and return
var first_element = this[0];
return $(first_element).data("smart-autocomplete")
}
var default_filter_matcher = function(term, source, context){
var matcher = new RegExp(term.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "i" );
return $.grep(source, function(value) {
return matcher.test( value );
});
}
var default_options = {
minCharLimit: 1,
maxCharLimit: null,
maxResults: null,
delay: 0,
disabled: false,
forceSelect: false,
typeAhead: false,
resultElement: "li",
resultFormatter: function(r){ return ("<li>" + r + "</li>"); },
filter: function(term, source){
var context = this;
var options = $(context).data('smart-autocomplete');
//when source is an array
if($.type(source) === "array") {
// directly map
var results = default_filter_matcher(term, source, context);
return results;
}
//when source is a string
else if($.type(source) === "string"){
// treat the string as a URL endpoint
// pass the query as 'term'
return $.Deferred(function(dfd){
$.ajax({
url: source,
data: {"term": term},
dataType: "json"
}).success( function(data){
dfd.resolve( default_filter_matcher(term, data, context) );
});
}).promise();
}
},
alignResultsContainer: false,
clearResults: function(){
//remove type ahead field
var type_ahead_field = $(this.context).prev(".smart_autocomplete_type_ahead_field");
$(this.context).css({ background: type_ahead_field.css("background") });
type_ahead_field.remove();
//clear results div
$(this.resultsContainer).html("");
},
setCurrentSelectionToContext: function(){
if(this.rawResults.length > 0 && this.currentSelection >= 0)
$(this.context).val(this.rawResults[(this.currentSelection)]);
},
setItemSelected: function(val){
this.itemSelected = val;
},
autocompleteFocused: false,
setAutocompleteFocused: function(val){
this.autocompleteFocused = val;
}
};
//define the default events
$.event.special.keyIn = {
setup: function(){ return false; },
_default: function(ev){
var context = ev.target;
var options = $(context).data("smart-autocomplete");
var source = options.source || null;
var filter = options.filter;
var maxChars = (options.maxCharLimit > 0 ? options.maxCharLimit : Number.POSITIVE_INFINITY)
//event specific data
var query = ev.smartAutocompleteData.query;
if(options.disabled || (query.length > maxChars)){
return false;
}
//set item selected property
options.setItemSelected(false);
//set autocomplete focused
options.setAutocompleteFocused(true);
//call the filter function with delay
setTimeout(function(){
$.when( filter.apply(options, [query, options.source]) ).done(function( results ){
//do the trimming
var trimmed_results = (options.maxResults > 0 ? results.splice(0, options.maxResults) : results);
$(context).trigger('resultsReady', [trimmed_results]);
});
}, options.delay);
}
};
$.event.special.resultsReady = {
setup: function(){ return false },
_default: function(ev){
var context = ev.target;
var options = $(context).data("smart-autocomplete");
//event specific data
var results = ev.smartAutocompleteData.results;
//exit if smart complete is disabled
if(options.disabled)
return false;
//clear all previous results
$(context).smartAutoComplete().clearResults();
//save the raw results
options.rawResults = results;
//fire the no match event and exit if no matching results
if(results.length < 1){
$(context).trigger('noResults');
return false
}
//call the results formatter function
var formatted_results = $.map(results, function(result){
return options.resultFormatter.apply(options, [result]);
});
var formatted_results_html = formatted_results.join("");
//append the results to the container
if(options.resultsContainer)
$(options.resultsContainer).append(formatted_results_html);
//trigger results ready event
$(context).trigger('showResults', [results]);
}
};
$.event.special.showResults = {
setup: function(){ return false },
_default: function(ev){
var context = ev.target;
var options = $(context).data("smart-autocomplete");
var results_container = $(options.resultsContainer);
//event specific data
var raw_results = ev.smartAutocompleteData.results;
//type ahead
if(options.typeAhead && (raw_results[0].substr(0, $(context).val().length) == $(context).val()) ){
var suggestion = raw_results[0]; //options.typeAheadExtractor($(context).val(), raw_results[0]);
//add new typeAhead field
$(context).before("<input class='smart_autocomplete_type_ahead_field' type='text' autocomplete='off' disabled='disabled' value='" + suggestion + "'/>");
$(context).css({
position: "relative",
zIndex: 2,
background: 'transparent'
});
var typeAheadField = $(context).prev("input");
typeAheadField.css({
position: "absolute",
zIndex: 1,
overflow: 'hidden',
background: $(context).css("background"),
borderColor: 'transparent',
width: $(context).width(),
color: 'silver'
});
//trigger item over for first item
options.currentSelection = 0;
if(results_container)
$(context).trigger('itemFocus', results_container.children()[options.currentSelection]);
}
//show the results container after aligning it with the field
if(results_container){
if(options.alignResultsContainer){
results_container.css({
position: "absolute",
top: function(){ return $(context).offset().top + $(context).height(); },
left: function(){ return $(context).offset().left; },
width: function(){ return $(context).width(); },
zIndex: 1000
})
}
results_container.show();
}
}
};
$.event.special.noResults = {
setup: function(){ return false },
_default: function(ev){
var context = ev.target;
var options = $(context).data("smart-autocomplete");
var result_container = $(options.resultsContainer);
if(result_container){
//clear previous results
options.clearResults();
}
}
};
$.event.special.itemSelect = {
setup: function(){ return false },
_default: function(ev){
var context = ev.target;
var options = $(context).data("smart-autocomplete");
//event specific data
var selected_item = ev.smartAutocompleteData.item;
//get the text from selected item
var selected_value = $(selected_item).text() || $(selected_item).val();
//set it as the value of the autocomplete field
$(context).val(selected_value);
//set item selected property
options.setItemSelected(true);
//set number of current chars in field
options.originalCharCount = $(context).val().length;
//trigger lost focus
$(context).trigger('lostFocus');
}
};
$.event.special.itemFocus = {
setup: function(){ return false },
_default: function(ev){
//event specific data
var item = ev.smartAutocompleteData.item;
$(item).addClass("smart_autocomplete_highlight");
}
};
$.event.special.itemUnfocus = {
setup: function(){ return false },
_default: function(ev){
//event specific data
var item = ev.smartAutocompleteData.item;
$(item).removeClass("smart_autocomplete_highlight");
}
}
$.event.special.lostFocus = {
setup: function(){ return false },
_default: function(ev){
var context = ev.target;
var options = $(context).data("smart-autocomplete");
//if force select is selected and no item is selected, clear currently entered text
if(options.forceSelect && !options.itemSelected)
$(options.context).val("");
//unset autocomplete focused
options.setAutocompleteFocused(false);
//clear results
options.clearResults();
//hide the results container
if(options.resultsContainer)
$(options.resultsContainer).hide();
//set current selection to null
options.currentSelection = null;
}
};
var passed_options = arguments[0];
return this.each(function(i) {
//set the options
var options = $.extend(default_options, $(this).data("smart-autocomplete"), passed_options);
//set the context
options['context'] = this;
//if a result container is not defined
if($.type(options.resultsContainer) === 'undefined' ){
//define the default result container if it is already not defined
var default_container = $("<ul class='smart_autocomplete_container' style='display:none'></ul>");
default_container.appendTo("body");
options.resultsContainer = default_container;
options.alignResultsContainer = true;
}
$(this).data("smart-autocomplete", options);
// bind user events
$(this).keyup(function(ev){
//get the options
var options = $(this).data("smart-autocomplete");
//up arrow
if(ev.keyCode == '38'){
if(options.resultsContainer){
var current_selection = options.currentSelection || 0;
var result_suggestions = $(options.resultsContainer).children();
if(current_selection >= 0)
$(options.context).trigger('itemUnfocus', result_suggestions[current_selection] );
if(--current_selection <= 0)
current_selection = 0;
options['currentSelection'] = current_selection;
$(options.context).trigger('itemFocus', [ result_suggestions[current_selection] ] );
}
}
//down arrow
else if(ev.keyCode == '40'){
if(options.resultsContainer && options.resultsContainer.is(':visible')){
var current_selection = options.currentSelection;
var result_suggestions = $(options.resultsContainer).children();
if(current_selection >= 0)
$(options.context).trigger('itemUnfocus', result_suggestions[current_selection] );
if(isNaN(current_selection) || null == current_selection || (++current_selection >= result_suggestions.length) )
current_selection = 0;
options['currentSelection'] = current_selection;
$(options.context).trigger('itemFocus', [ result_suggestions[current_selection] ] );
}
//trigger keyIn event on down key
else {
$(options.context).trigger('keyIn', [$(this).val()]);
}
}
//right arrow & enter key
else if(ev.keyCode == '39' || ev.keyCode == '13'){
var type_ahead_field = $(options.context).prev('.smart_autocomplete_type_ahead_field');
if(options.resultsContainer && $(options.resultsContainer).is(':visible')){
var current_selection = options.currentSelection;
var result_suggestions = $(options.resultsContainer).children();
$(options.context).trigger('itemSelect', [ result_suggestions[current_selection] ] );
}
else if(options.typeAhead && type_ahead_field.is(':visible'))
$(options.context).trigger('itemSelect', [ type_ahead_field ] );
return false;
}
else {
var current_char_count = $(options.context).val().length;
//check whether the string has modified
if(options.originalCharCount == current_char_count)
return;
//check minimum and maximum number of characters are typed
if(current_char_count >= options.minCharLimit){
$(options.context).trigger('keyIn', [$(this).val()]);
}
else{
if(options.autocompleteFocused){
options.currentSelection = null;
$(options.context).trigger('lostFocus');
}
}
}
});
$(this).focus(function(){
//if the field is in a form capture the return key event
$(this).closest("form").bind("keydown.block_for_smart_autocomplete", function(ev){
var type_ahead_field = $(options.context).prev('.smart_autocomplete_type_ahead_field');
if(ev.keyCode == '13'){
if(options.resultsContainer && $(options.resultsContainer).is(':visible')){
var current_selection = options.currentSelection;
var result_suggestions = $(options.resultsContainer).children();
$(options.context).trigger('itemSelect', [ result_suggestions[current_selection] ] );
return false;
}
else if(options.typeAhead && type_ahead_field.is(':visible') ){
$(options.context).trigger('itemSelect', [ type_ahead_field ] );
return false;
}
}
});
if(options.forceSelect){
$(this).select();
}
});
//check for loosing focus on smart complete field and results container
//$(this).blur(function(ev){
$(document).bind("focusin click", function(ev){
if(options.autocompleteFocused){
var elemIsParent = $.contains(options.resultsContainer[0], ev.target);
if(ev.target == options.resultsContainer[0] || ev.target == options.context || elemIsParent) return
$(options.context).closest("form").unbind("keydown.block_for_smart_autocomplete");
$(options.context).trigger('lostFocus');
}
});
//bind events to results container
$(options.resultsContainer).delegate(options.resultElement, 'mouseenter.smart_autocomplete', function(){
var current_selection = options.currentSelection || 0;
var result_suggestions = $(options.resultsContainer).children();
options['currentSelection'] = $(this).prevAll().length;
$(options.context).trigger('itemFocus', [this] );
});
$(options.resultsContainer).delegate(options.resultElement, 'mouseleave.smart_autocomplete', function(){
$(options.context).trigger('itemUnfocus', [this] );
});
$(options.resultsContainer).delegate(options.resultElement, 'click.smart_autocomplete', function(){
$(options.context).trigger('itemSelect', [this]);
return false
});
//bind plugin specific events
$(this).bind({
keyIn: function(ev, query){ ev.smartAutocompleteData = {'query': query }; },
resultsReady: function(ev, results){ ev.smartAutocompleteData = {'results': results }; },
showResults: function(ev, results){ ev.smartAutocompleteData = {'results': results } },
noResults: function(){},
lostFocus: function(){},
itemSelect: function(ev, item){ ev.smartAutocompleteData = {'item': item }; },
itemFocus: function(ev, item){ ev.smartAutocompleteData = {'item': item }; },
itemUnfocus: function(ev, item){ ev.smartAutocompleteData = {'item': item }; }
});
});
}
})(jQuery);
| nikmeiser/temboo-geocode | node_modules/brackets/brackets-src/src/thirdparty/smart-auto-complete/jquery.smart_autocomplete.js | JavaScript | mit | 21,294 |
module Cryptoexchange::Exchanges
module Incorex
module Services
class OrderBook < Cryptoexchange::Services::Market
class << self
def supports_individual_ticker_query?
true
end
end
def fetch(market_pair)
output = super(ticker_url(market_pair))
adapt(output, market_pair)
end
def ticker_url(market_pair)
"#{Cryptoexchange::Exchanges::Incorex::Market::API_URL}/order_book/?pair=#{market_pair.base}_#{market_pair.target}"
end
def adapt(output, market_pair)
order_book = Cryptoexchange::Models::OrderBook.new
order_book.base = market_pair.base
order_book.target = market_pair.target
order_book.market = Incorex::Market::NAME
order_book.asks = adapt_orders output.values.first['ask']
order_book.bids = adapt_orders output.values.first['bid']
order_book.timestamp = Time.now.to_i
order_book.payload = output.values.first
order_book
end
def adapt_orders(orders)
orders.collect do |order_entry|
price, quantity, amount = order_entry
Cryptoexchange::Models::Order.new(price: price,
amount: quantity,
timestamp: nil)
end
end
end
end
end
end
| coingecko/cryptoexchange | lib/cryptoexchange/exchanges/incorex/services/order_book.rb | Ruby | mit | 1,450 |
#ifndef BITCOINUNITS_H
#define BITCOINUNITS_H
#include <QString>
#include <QAbstractListModel>
/** Bitcoin unit definitions. Encapsulates parsing and formatting
and serves as list model for drop-down selection boxes.
*/
class BitcoinUnits: public QAbstractListModel
{
Q_OBJECT
public:
explicit BitcoinUnits(QObject *parent);
/** Bitcoin units.
@note Source: https://en.bitcoin.it/wiki/Units . Please add only sensible ones
*/
enum Unit
{
THD,
cTHD,
mTHD
};
//! @name Static API
//! Unit conversion and formatting
///@{
//! Get list of units, for drop-down box
static QList<Unit> availableUnits();
//! Is unit ID valid?
static bool valid(int unit);
//! Short name
static QString name(int unit);
//! Longer description
static QString description(int unit);
//! Number of Satoshis (1e-8) per unit
static qint64 factor(int unit);
//! Number of amount digits (to represent max number of coins)
static int amountDigits(int unit);
//! Number of decimals left
static int decimals(int unit);
//! Format as string
static QString format(int unit, qint64 amount, bool plussign=false);
//! Format as string (with unit)
static QString formatWithUnit(int unit, qint64 amount, bool plussign=false);
//! Parse string to coin amount
static bool parse(int unit, const QString &value, qint64 *val_out);
///@}
//! @name AbstractListModel implementation
//! List model for unit drop-down selection box.
///@{
enum RoleIndex {
/** Unit identifier */
UnitRole = Qt::UserRole
};
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
///@}
private:
QList<BitcoinUnits::Unit> unitlist;
};
typedef BitcoinUnits::Unit BitcoinUnit;
#endif // BITCOINUNITS_H
| thundercc/thundercoin | src/qt/bitcoinunits.h | C | mit | 1,965 |
'use strict';
var fs = require('fs');
var path = require('path');
var expect = require('expect.js');
var resolveRc = require('../lib/resolve-rc.js');
var exists = require('../lib/helpers/exists.js');
var read = require('../lib/helpers/read.js');
describe('ResolveRc', function() {
it('should find the .babelrc file', function() {
var start = path.resolve(__dirname, 'fixtures/babelrc-test/1/2/3');
var result = resolveRc(start);
expect(result).to.be.a('string');
});
});
describe('exists', function() {
var cache = {};
var files = {
existent: path.resolve(__dirname, 'fixtures/basic.js'),
fake: path.resolve(__dirname, 'fixtures/nonExistentFile.js'),
};
it('should return boolean if file exists', function() {
var realFile = exists(cache)(files.existent);
var fakeFile = exists(cache)(files.fake);
expect(realFile).to.equal(true);
expect(fakeFile).to.equal(false);
});
it('should keep cache of if previous results', function() {
expect(cache[files.existent]).to.equal(true);
expect(cache[files.fake]).to.equal(false);
});
});
describe('read', function() {
var cache = {};
var files = {
existent: path.resolve(__dirname, 'fixtures/basic.js'),
fake: path.resolve(__dirname, 'fixtures/nonExistentFile.js'),
};
var content = fs.readFileSync(files.existent, 'utf8');
it('should return contents if file exists', function() {
var realFile = read(cache)(files.existent);
expect(realFile).to.equal(content);
});
it('should keep cache of if previous results', function() {
expect(cache[files.existent]).to.equal(content);
});
});
| STRML/babel-loader | test/resolverc.test.js | JavaScript | mit | 1,637 |
<?php
header("Content-type: text/html; charset=gbk");
$mobile = $_GET['mobile'];
// $mobile = 18032067618;
// print_r($mobile);
$url = "https://chongzhi.jd.com/json/order/search_searchPhone.action?mobile=".$mobile."&_=1494492818590";
echo $msg = file_get_contents($url);
| 7fe/guide | ajax/day3/demo/api/guishudi.php | PHP | mit | 272 |
//
// SwiftHub.h
// SwiftHub
//
// Created by Ben Chatelain on 8/4/15.
// Copyright © 2015 phatblat. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for SwiftHub.
FOUNDATION_EXPORT double SwiftHubVersionNumber;
//! Project version string for SwiftHub.
FOUNDATION_EXPORT const unsigned char SwiftHubVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SwiftHub/PublicHeader.h>
| phatblat/SwiftHub | SwiftHub/SwiftHub.h | C | mit | 487 |
---
layout: single
title: "La incomunicación"
redirect_from: /node/35
categories:
tags: []
comments:
---
<div style="text-align: center;">
“Ya no es necesario que los fines justifiquen los medios.
Ahora, los medios, los medios masivos de comunicación,
justifican los fines de un sistema de poder
que impone sus valores en escala plantearía.
El Ministerio de Educación del gobierno mundial está en pocas manos.
Nunca tantos habían sido incomunicados por tan pocos”
de _Eduardo Galeano_
Haz clic en la imagen para saber más

</div>
| esclapes/esclapes.github.com | _posts/2010-02-28-la-incomunicacion.md | Markdown | mit | 628 |
---
layout: post
title: "Measuring the prevalence of documentation, testing and continuous integration in Julia packages"
tags: [julia, testing, documentation, ci, registry]
---
[Documentation](https://en.wikipedia.org/wiki/Software_documentation),
[testing](https://en.wikipedia.org/wiki/Software_testing), and [continuous
integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) are some
of the key ingredients to make software maintainable and reliable in the long
term. During the first part of my (short) career in academia, when my daily
software tools were C, Fortran and IDL, I barely knew these practices (probably
didn't know continuous integration at all), and never applied them in practice.
Some time around 5 years ago I started my journey with the Julia programming
language, and I learned to value and use these principles.
I have the general feeling that Julia makes documentation and testing very
simple and lowers the entry barriers for newcomers. Today, the Julia ecosystem
offers many tools about this:
* [`Documenter.jl`](https://github.com/JuliaDocs/Documenter.jl): a package to
generate HTML and PDF versions of the documentation
* the [`Test`](https://docs.julialang.org/en/v1/stdlib/Test/) standard library
provides very basic tools for testing, but it's also extremely simple to use:
you don't have a good reason for not testing your code
* in addition to `Test`, there are third-party packages which offer more
advanced testing frameworks. Some of them are:
* [`Jive.jl`](https://github.com/wookay/Jive.jl)
* [`ReTest.jl`](https://github.com/JuliaTesting/ReTest.jl)
* [`SafeTestsets.jl`](https://github.com/YingboMa/SafeTestsets.jl)
* [`TestSetExtensions.jl`](https://github.com/ssfrr/TestSetExtensions.jl)
* [`XUnit.jl`](https://github.com/RelationalAI-oss/XUnit.jl)
* packages like [`PkgTemplates.jl`](https://github.com/invenia/PkgTemplates.jl)
and [`PkgSkeleton.jl`](https://github.com/tpapp/PkgSkeleton.jl) lets you
easily generate a new package with minimal setup for documentation, testing,
and continuous integration.
If you're looking for tips about testing workflow in Julia, see [these best
testing practices with
Julia](https://erik-engheim.medium.com/julia-v1-5-testing-best-practices-3ca8780e6336)
by Erik Engheim.
## Analysing Julia packages in the General registry
Is my feeling that Julia makes documentation and testing easy actually true?
Prompted by the recent [analysis of the prevalence of continuous integration in
JOSS](http://blog.jamiejquinn.com/analysing-ci-in-joss) made by my colleague
Jamie Quinn, I decided to look how Julia packages in the [General
registry](https://github.com/JuliaRegistries/General) fare with regard to
documentation, testing and continuous integration. I quickly wrote a Julia
package, [`AnalyzeRegistry.jl`](https://github.com/giordano/AnalyzeRegistry.jl)
for this task: it clones all packages in the registry (only the last commit of
the default branch, to save time and bandwidth) and looks for some specific
files to decide whether a package uses documentation, testing and, continuous
integration.
The usage of the package is described in its
[`README.md`](https://github.com/giordano/AnalyzeRegistry.jl/blob/fe93b158f551cdb5849b48c03a8a656959749ed0/README.md)
(yes, I haven't set up proper documentation, yet!). I ran the analysis with 8
threads, it took less than 30 minutes to analyse the entire General registry (I
was mainly limited by my Internet connection, using some threads less wouldn't
have changed much):
```
julia> using AnalyzeRegistry
julia> @time report = analyze(find_packages());
1567.008404 seconds (7.41 M allocations: 857.636 MiB, 0.01% gc time, 0.00% compilation time)
```
`analyze` returns a vector of a data structure, `Package`, which describes a
package:
* name
* URL of the git repository
* can the repository be cloned? Some repositories have been deleted or made
private, so it can be accessed from the public anymore
* does it have documentation? This is the hardest criterion: I looked for the
file `docs/make.jl`, or `doc/make.jl`, which is used to generate the
documentation with `Documenter.jl`, but many packages may do something else,
see more in the comments below
* does it have the `test/runtests.jl` file? This is what the `Test` standard
library uses to launch the tests
* does it use GitHub Actions?
* does it use Travis CI?
* does it use AppVeyor?
* does it use Cirrus CI?
* does it use Circle CI?
* does it use Drone CI?
* does it use Buildkite?
* does it use Azure Pipelines?
* does it use GitLab Pipeline?
## Report of the analysis on 2021-01-23
Before summarising my findings, I saved the [results of the
analysis](https://github.com/giordano/AnalyzeRegistry.jl/releases/download/report-2021-01-23/report-2021-01-23.jld2)
in a [JLD2](https://github.com/JuliaIO/JLD2.jl) archive, so that anyone can look
into them.
Now, some statistics:
* total number of packages: 4312 (note: I excluded [JLL
packages](https://docs.binarybuilder.org/stable/jll/), which are automatically
generated, and not very useful to measure whether humans follow best
programming practices);
* packages hosted on GitHub: 4296
* packages hosted on GitLab: 16
* packages that could be cloned: 4287 (99.4% of the total). The rest of
percentages will refer to this number, since I could look for documentation
and testing only if I could actually clone the repository of a package;
* packages using `Documenter.jl` to publish documentation: 1887 (44%)
* packages with testing: 4139 (96.5%)
* packages using any of the CI services below: 4105 (95.8%)
* packages using GitHub Actions: 3240 (75.6%)
* packages using Travis CI: 2512 (58.6%)
* packages using AppVeyor: 783 (18.3%)
* packages using Cirrus CI: 60 (1.4%)
* packages using Circle CI: 13 (0.3%)
* packages using Drone CI: 43 (1%)
* packages using Buildkite: 29 (0.7%)
* packages using Azure Pipelines: 7 (0.2%)
* packages using GitLab Pipeline: 85 (1.9%)
I ran the analysis on 2020-01-23, on [this revision of the General
registry](https://github.com/JuliaRegistries/General/commit/824e39a809b2932f029866f5169930c0306c70fc).
## Comments
* The [General registry](https://github.com/JuliaRegistries/General) _is not_ a
curated list of Julia packages and at the moment there is no requirement to
have documentation, nor testing, nor continuous integration to be accepted.
The question here is: do Julia users apply these principles even if they
aren't mandatory?
* The results are biased by the criteria I've chosen to determine whether a
package "has documentation", or "has tests" and should be taken _cum grano
salis_: these criteria aren't bullet-proof, also an empty `test/runtests.jl`
would count as "has tests", but see below. If you change the criteria a bit
you may find different numbers, but I hope I got the orders of magnitude
right;
* the goal of this analysis was _not_ to measure the goodness of documentation
or testing, but rather to see whether users apply these principles at all.
It's also very difficult to accurately measure them. [Line code
coverage](https://en.wikipedia.org/wiki/Code_coverage) is often used to
measure degree of testing of the code, but I don't think it's says the whole
story: it's often easy to have 100% _lines_ coverage, but have a poor _paths_
coverage (if you have many conditionals, loops, etc... you can hit the same
lines from different directions), also, in very elaborated code-bases it may
be good enough to have high coverage of the core of the software, while some
other extra features may be less important to test, or may be too complicated
to test because require sophisticated external setups;
* **about 44% of packages are set up to use `Documenter.jl` to publish
documentation**. While this fraction doesn't look particularly high, consider
that many packages don't keep the documentation within the repository but it
may be stored somewhere else (very notable examples are
[`DifferentialEquations.jl`](https://github.com/SciML/DifferentialEquations.jl)
and [`Plots.jl`](https://github.com/JuliaPlots/Plots.jl)), or they are so
simple that the entire documentation is written down in the `README` file (for
example [`Tar.jl`](https://github.com/JuliaIO/Tar.jl)) or the wiki.
* I looked at a random sample of 43 packages (1% of total) "without
documentation", of this
* 4 didn't have any documentation, docstrings, or examples of uses
whatsoever (but 2 of them still had meaningful tests!)
* 1 didn't have documentation nor examples, but only docstrings
* 1 only had an `examples` directory, with poorly commented samples of code
* all the others had documentation in the `README`, in the wiki, or anyway
published on a different website.
To summarise, 6 packages out of 43 (14%) had a _very_ poor or completely
missing meaningful documentation for users. Assuming this was a
representative sample, my conclusion is that about 8% of packages in the
registry have a lacking documentation, while the **rest of the packages (92%)
have some documentation to get users started**, and a bit less than half of
the total are set up to use `Documenter.jl` to publish documentation;
* an overwhelming majority of packages, 96.5%, have tests!
* packages like the above mentioned `PkgTemplates.jl` and `PkgSkeleton.jl`
creates for you a `test/runtests.jl` file when you generate a new package,
but this script doesn't actually contain any test at all, or just a dummy
assertion like `@test 1 == 1`. I looked at a random sample of 43 packages
"with tests", to check whether they actually run some real tests, related to
package: only two of them (4.7%) had a dummy `test/runtests.jl` file. As
already explained above, here I'm not judging the goodness of the tests or
whether they cover enough code of the package, but most of the packages I've
seen had very extensive test suites. If the sample I analysed was
representative of all Julia packages in the General registry, we can say
that **about 92% of Julia packages do test their code**. Interestingly
enough, this is about the same fraction of packages with some documentation;
* **almost all packages with testing also set up continuous integration
(95.8%)**, even though a small fraction is probably running dummy tests. If
compared to the about 80% of papers in JOSS found by Jamie not to have any
obvious CI setup, the uptake of CI among Julia packages is remarkable (the
audience of authors of JOSS paper and Julia packages has a large overlap, so I
believe it makes sense to look at them together);
* GitHub Actions is the most used CI service (75.6%), followed by Travis
(58.6%). Note that measuring usage of GitHub Actions for CI is tricky,
because, differently from all the other services, there isn't a single
standard name for the configuration script, and GitHub Actions is also often
used for other tasks than pure CI. For example, I didn't consider files for
[CompatHelper](https://github.com/JuliaRegistries/CompatHelper.jl/) or
[TagBot](https://github.com/JuliaRegistries/TagBot). It would have been
interesting to look at these statistics before last November, when [the new
Travis pricing
model](https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing) pushed
many open-source users away from their services.
My take-away message is that despite the General registry not being curated and
not enforcing specific styles or best practices, **a large fraction of Julia
packages does embrace documentation, testing, and continuous integration**,
showing that the ecosystem provides easy-to-use tools for these practices.
<!-- Local Variables: -->
<!-- ispell-local-dictionary: "british" -->
<!-- End: -->
| giordano/giordano.github.io | _posts/2021-01-23-documentation-testing-julia.md | Markdown | mit | 11,808 |
from setuptools import setup
config = {
'description': 'Automatic rule based Linux Time Tracker',
'author': 'Anton',
'author_email': '[email protected]',
'url': 'https://github.com/Settis/cloudNirvana',
'install_requires': ['argparse', 'argcomplete', 'PyYAML', 'pexpect'],
'packages': ['cloudNirvana'],
'scripts': ['bin/cn'],
'version': '0.6',
'name': 'cloudNirvana'
}
setup(**config)
| Settis/cloudNirvana | setup.py | Python | mit | 430 |
var group___t_i_m___clear_input___polarity =
[
[ "TIM_CLEARINPUTPOLARITY_INVERTED", "group___t_i_m___clear_input___polarity.html#ga02e0d10a2cf90016d1a8be1931c6c67e", null ],
[ "TIM_CLEARINPUTPOLARITY_NONINVERTED", "group___t_i_m___clear_input___polarity.html#ga53e02f7692e6996389b462219572f2a9", null ]
]; | team-diana/nucleo-dynamixel | docs/html/group___t_i_m___clear_input___polarity.js | JavaScript | mit | 313 |
---
layout: post
title: reminder-chicago-net-developers-forum-meetup
---
Chicago .NET Developers Forum Meetup
Rock Bottom Brewery @ State and Grand
Tuesday, May 19th
6:00ish
Topic: How do you use XML?
This is just an idea, if you have any ideas you would like recommend
visit:
[http://chidotnet.com/forums/Forum.aspx?forumId=7](http://chidotnet.com/forums/Forum.aspx?forumId=7)
| rrinaldi/rrinaldi.github.com | _posts/2008-7-18-reminder-chicago-net-developers-forum-meetup.markdown | Markdown | mit | 384 |
#Acquire server name. Loop if name does not match.
Do{
$SVR_NAME = Read-Host -Prompt "Enter computer name of affected computer."
$SVR_NAME2 = Read-Host -Prompt "Confirm computer name of affected computer."
If ("$SVR_NAME" -notlike "$SVR_NAME2"){Echo "Name does not match."}
}
While ("$SVR_NAME" -notlike "$SVR_NAME2")
#Acquire printer name. Loop if name does not match.
Do{
$PRT_NAME = Read-Host -Prompt "Enter username of affected user."
$PRT_NAME2 = Read-Host -Prompt "Confirm username of affected user."
If ("$PRT_NAME" -notlike "$PRT_NAME2"){Echo "Name does not match."}
}
While ("$PRT_NAME" -notlike "$PRT_NAME2")
#Adds printer connection
Add-Printer -ConnectionName \\$SVR_NAME\$PRT_NAME
| goodchit/Add_Printers | Add_Printer.ps1 | PowerShell | mit | 702 |
<!DOCTYPE html>
<html class="extend extend-zt-19cpcnc2">
<head>
<meta charset="utf-8" />
<meta name="publishid" content="11115811.0.49.0" />
<meta name="description" content=" " />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<title> 雄安新区是创新的高地,不是炒房淘金的地方 -新华网 </title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-title" content="人物访谈-新华网" />
<link rel="apple-touch-icon-precomposed" href="bundle/logo.wechat.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<!-- <script>
BROWSER_JUMPTO = '#';
</script> -->
<!-- browser 1.0 -->
<!-- <script src="local/browser.1.min.js" id="BROWSER_NOJUMP"></script> -->
<!-- browser 2.0 -->
<script src="bundle/browser.js"></script>
<!-- <link rel="stylesheet" href="http://www.xinhuanet.com/interview/20161202/bundle/index.min.css" /> -->
<link rel="stylesheet" href="bundle/index.css" />
<link rel="stylesheet" href="bundle/extend-red.css" />
<link rel="stylesheet" href="bundle/extend-zt-19cpcnc2.css" />
<script src="lib/jq/jq.js"></script>
</head>
<body>
<!-- helper-donkey {{name:“市委书记谈信访”系列访谈1, date:2017-07-19 03:29:22}} BEGIN -->
<!-- 页面控制项 BEGIN -->
<div class="mobile-cover hide" id="mobile-cover">
<i></i>
<!-- 封面控制节点 -->
<img src="http://www.xinhuanet.com/legal/titlepic/112052/1120525207_1487922241483_title0h.jpg" width="735" height="1334" alt="昌江保突村制陶体验" />
</div>
<div class="no-portrait hide" id="no-portrait">
<!-- 头像控制节点 -->
<!---->
</div>
<h1 class="main-title hide" id="main-title">
<!-- 主标题控制节点: 首屏 -->
打造"枫桥经验"升级版 把矛盾化解在基层
</h1>
<!-- 页面控制项 END -->
<div class="pc-top-nav"><a href="http://www.news.cn/" target="_blank"> 新华网首页</a><a href="http://www.news.cn/politics/" target="_blank">时政</a>
<a href="http://www.news.cn/world/" target="_blank">国际</a><a href="http://www.news.cn/fortune/" target="_blank">财经</a>
<a href="http://www.news.cn/politics/leaders/" target="_blank">高层</a><a href="http://www.news.cn/politics/xhll.htm" target="_blank">理论</a><a href="http://forum.home.news.cn/index.jsp" target="_blank">论坛</a><a href="http://sike.news.cn/" target="_blank">思客</a>
<a href="http://www.news.cn/info/" target="_blank">信息化</a><a href="http://www.news.cn/house/index.htm" target="_blank">房产</a><a href="http://www.news.cn/mil/" target="_blank">军事</a><a href="http://www.news.cn/gangao/" target="_blank">港澳</a>
<a href="http://www.news.cn/tw/" target="_blank">台湾</a> <a href="http://www.news.cn/photo/index.htm" target="_blank">图片</a><a href="http://www.news.cn/video/index.htm" target="_blank">视频</a><a href="http://ent.news.cn/" target="_blank">娱乐</a>
<a href="http://www.news.cn/fashion/" target="_blank">时尚</a> <a href="http://www.news.cn/sports/" target="_blank">体育</a> <a href="http://www.news.cn/auto/" target="_blank">汽车</a><a href="http://www.news.cn/tech/" target="_blank">科技</a><a href="http://www.news.cn/food/"
target="_blank">食品</a>
</div>
<div class="all">
<img src="http://www.xinhuanet.com/talking/interview/bundle/logo.wechat.png" width="300" height="300" class="hide" />
<div id="parallax-scene" class="banner-box">
<a href="http://www.xinhuanet.com" target="_blank" title="点击访问新华网">
<div class="pc-xinhuanet-logo"> <span class="hide">新华网</span></div>
</a>
<div class="banner" style="">
<div class="part-in-banner" style="">
<div data-depth="-0.06" class="layer layer-z16" style="">
<div class="banner-title" style="">
<!-- { mod: 0, name: 首屏, attr:普通, rpt:0 } BEGIN -->
<h1 class="banner-big-title" style=""> 彭佳学 </h1>
<h2 class="banner-subtitle1" style=""> 浙江省绍兴市委书记 </h2>
<h2 class="banner-subtitle2" style=""> 打造"枫桥经验"升级版 把矛盾化解在基层 </h2>
<!-- mod: 0 END -->
</div>
<div data-depth="0.07" class="layer layer-z14">
<div class="part-in-box pc-banner-logo"></div>
</div>
<div data-depth="-0.10" class="layer layer-z12">
<div class="part-in-box pc-banner-light2"></div>
</div>
<div data-depth="0.09" class="layer layer-z10">
<div class="part-in-box pc-banner-logo-line"></div>
</div>
<div data-depth="-0.02" class="layer layer-z3">
<div class="person-img">
<!-- { mod: 0, name: 首屏, attr:图片, rpt:0 } BEGIN -->
<img src="http://www.xinhuanet.com/legal/titlepic/112137/1121376812_1501223965032_title0h.png" width="auto" height="100%">
<!-- mod: 0 END -->
</div>
</div>
<div data-depth="0.60" class="layer layer-z2">
<div class="part-in-box pc-banner-light-bg"></div>
</div>
</div>
</div>
</div>
<div data-depth="0.10" class="layer layer-z2 pointer-events-none">
<!-- { mod: 0, name: 首屏, attr:普通, rpt:0 } BEGIN -->
<div class="part-video pointer-events-visible dialog-media">
<img src="http://www.xinhuanet.com/legal/titlepic/112137/1121376878_1501229128703_title0h.jpg" width="100%">
<div class="title-string hide"> 打造"枫桥经验"升级版 把矛盾化解在基层 </div>
<div class="src-string hide"> </div>
<div data-depth="0.3" class="layer layer-z1">
<div class="video-shadow"> </div>
</div>
</div>
<!-- mod: 0 END -->
</div>
</div>
<div id="part" class="part">
<div class="part-pc-main">
<div class="part-pc-abs-box">
<div kill class="part-pc-abs-box-in">
<!-- { mod: 0, name: 首屏, attr:普通, rpt:0 } BEGIN -->
<div class="abs"> 7月26日,国家信访局与新华网联合推出“市委书记谈信访”系列访谈,第一期访谈邀请浙江省绍兴市委书记彭佳学同志,就绍兴市信访工作取得的主要成效和经验做法与网友作一个面对面的访谈交流。
<a href="http://news.xinhuanet.com/legal/2017-07/28/c_129666271.htm " target="_blank">》》点击进入实录</a>
</div>
<!-- mod: 0 END -->
</div>
<div class="part-pc-abs-icon1"></div>
<div class="part-pc-abs-icon2"></div>
</div>
<div class="part-col-title-big">精彩观点</div>
<div id="part-avatar-imgs" class="hide">
<!-- { mod: 0, name: 头像, nodeid:11155069, attr:普通, rpt:20 } BEGIN -->
<img src="http://www.xinhuanet.com/legal/titlepic/112138/1121389153_1501133212801_title0h.jpg" width="93" height="93">
<!-- mod: 0 END -->
</div>
<!-- { mod: 0, name: 精彩观点, attr:普通, rpt:20 } BEGIN -->
<div class="part-item">
<div class="part-avatar">
<div class="part-avatar-img-num"> 1 </div>
<div class="part-avatar-text subTile"> 彭佳学 </div>
</div>
<div class="part-title">
<h2> <a href="http://news.xinhuanet.com/legal/2017-07/28/c_129664369.htm"> 绍兴市是人文之城、生态之城 去年GDP达4710亿元 </a> </h2>
</div>
<div class="part-text">
<div class="dialog-media">
<img src="../../titlepic/112139/1121395713_1501224173120_title0h.jpg" width="100%" alt="绍兴市是人文之城、生态之城 去年GDP达4710亿元" />
<div class="title-string hide"> 绍兴市是人文之城、生态之城 去年GDP达4710亿元 </div>
<div class="src-string hide"> </div>
</div>
<div class="abs"> 绍兴这座城市的包容性很强,既有厚重的历史,也有现代文明与繁荣。具体来说有四个方面。<br />首先,综合实力较强。我们2016年底统计数据,全市的GDP达到了4710亿元,今年完全可以进入5千亿行列,人均GDP已经超过了10万人民币,而且公共财政收入也超过了400亿。尤其是城乡居民收入也比较高,收入比较均衡。我们城市居民收入已经超过了5万,农村居民可望达到3万,收入比1.8:1左右,体现了整体的均衡性。<br />第二,产业体系完善。以纺织业为代表的传统优势产业,已经形成了比较完整的产业链,应该说在全球都有比较好的话语权,我们有自己的定价体系,发布相关的指数。同时,包括生物医药、环保装备,以及通用航空为代表的一些战略性新兴产业蓬勃发展,占制造业比达到35%。绍兴的制造业去年已经突破了1万亿产值。同时,我们以量子通信、增材制造为代表的未来产业,绍兴已进行积极布局。尤其是绍兴是一座文化山水都非常独特的厚重的自然城市,市委市政府把文化旅游、生命健康,作为新兴现代服务业,转型发展的动力已在绍兴形成。<br
/>第三,市场主体活跃。全市拥有67家上市公司。去年统计数据表明,我们有7家民营企业进入了中国500强,有25家企业进入“中国民营企业500强”。市场主体多元化,同时整个专业市场交易规模超过1亿元的有65家,其中10亿以上11家、100亿以上7家。<br />第四,可以用开放程度较高来表明它的活力。我们去年成功举办了国际友城大会,与全球38个城市建立了友城关系,而且我们有10多家优秀的民营企业进行了跨国并购,实现了全球布局。同时,我们大力推动文化“走出去”,开展“大师对话”、“越剧全球巡演”等活动,向世界传播了中国文化、绍兴文化。
</div>
</div>
</div>
<div class="part-item">
<div class="part-avatar">
<div class="part-avatar-img-num"> 1 </div>
<div class="part-avatar-text subTile"> 彭佳学 </div>
</div>
<div class="part-title">
<h2> <a href="http://news.xinhuanet.com/legal/2017-07/28/c_129664400.htm"> 解决转型阵痛的关键在于坚持生态统领 </a> </h2>
</div>
<div class="part-text">
<div class="dialog-media">
<img src="../../titlepic/112139/1121395729_1501224169384_title0h.jpg" width="100%" alt="解决转型阵痛的关键在于坚持生态统领" />
<div class="title-string hide"> 解决转型阵痛的关键在于坚持生态统领 </div>
<div class="src-string hide"> </div>
</div>
<div class="abs"> 绍兴市经过分析和研究这些信访问题发现,还是建设强度、发展理念和追求目标的问题。按照当地的老百姓话来讲,在发展过程中碰到的“城市之痛”“产业之痛”,从而带来了“环境之痛”。 “城市之痛”就是感觉到城市碎片化,“产业之痛”就是一些安全性问题,一些污染问题,已经危及了正常利益。这两者反过来形成了环境生态的问题,所以三个“痛”中关键是前面两个“痛”。<br />十八大以来,绍兴市坚决贯彻习近平总书记提出的五大发展理念,提出了坚持以生态统领,建设品质绍兴。<br
/>彭佳学表示,从目前情况看呈现了比较好的势头,基本上形成了“三升一降”的态势,经济质量得到了持续的提升,生态环境得到了持续的提升,城市的能级得到了持续的提升,信访的量在减少,信访需求的结构在改善。这主要缘于注重在四个方面做了工作。一个是注重大局,注重统筹,维护群众的切身利益。第二,就是着眼长远,注重改革创新,维护市场主体的公平正义。第三,着眼和谐,注重生态,切实维护人民群众最根本的利益。包括生态、空气和水。第四,着眼基层、注重党建,来维护民心、民意。
</div>
</div>
</div>
<div class="part-item">
<div class="part-avatar">
<div class="part-avatar-img-num"> 1 </div>
<div class="part-avatar-text subTile"> 彭佳学 </div>
</div>
<div class="part-title">
<h2> <a href="http://news.xinhuanet.com/legal/2017-07/28/c_129664466.htm"> 绍兴市总体信访量下降幅度近30% </a> </h2>
</div>
<div class="part-text">
<div class="dialog-media">
<div class="title-string hide"> 绍兴市总体信访量下降幅度近30% </div>
<div class="src-string hide"> </div>
</div>
<div class="abs"> 现在看来,主要的成效有三个方面。一个是找到了一条传统产业转型发展改造提升的路子。省委和省政府把我们绍兴列为全省的传统产业改造升级的试点,也希望我们能够进行更好的探索,形成可复制、可推广的一些好的经验措施和办法,让传统产业再造新优势、再创新辉煌。<br />二是全市的空气环境的质量大为改观,因为我们进行这些产业的改造提升,可望到明年年底除个别大型热电厂以外,绍兴实现无煤化,这样排放量就完全改变了,所以我们的空气质量一下子一个大的跃升,我们去年空气质量优良率达到了80%,特别是优质的天数增加了50天。同时水环境质量得到了全面提升,基本上全面消灭了劣V类水体,三类以上的水质水体达到了85%。<br
/>三是广大的企业家,在安全生产、环境生态保护,特别是创新的意识形成了非常好的强烈的共识。也正是全社会上下一起,形成了这么一个好的共识,所以我们带来了信访工作非常好的效果,总体信访量呈下降的态势,下降幅度大概将近30%。
</div>
</div>
</div>
<div class="part-item">
<div class="part-avatar">
<div class="part-avatar-img-num"> 1 </div>
<div class="part-avatar-text subTile"> 彭佳学 </div>
</div>
<div class="part-title">
<h2> <a href="http://news.xinhuanet.com/legal/2017-07/28/c_129664496.htm"> 打造“枫桥经验”升级版和平安中国示范区 </a> </h2>
</div>
<div class="part-text">
<div class="dialog-media">
<div class="title-string hide"> 打造“枫桥经验”升级版和平安中国示范区 </div>
<div class="src-string hide"> </div>
</div>
<div class="abs"> 绍兴市紧紧围绕着八个字这样一个目标来构建我们新的工作体系,来形成基层治理体系和基层治理能力的现代化。这八个字:平安、文明、富裕、活力。围绕着平安建设,文明创建,富裕美丽的村容村貌,活力四射的发展态势,在这个过程中牢牢把握坚持党的领导,发挥政府主导,各方参与的要求,强化党建的引领作用,把法治、德治和自治有机地结合起来,积极探索新时期基层治理的新模式,来打造“枫桥经验”的升级版和平安中国的示范区。<br />同时绍兴市还按照标准化、集成化和智慧化的要求,来构建乡镇到村的一个服务体系。也就是我们现在讲的“四个平台”的建设,来完善全科网格功能,把一些信息化技术整合到其中,把我们基层的“七站八所”有机整合起来,形成重心向下、关口前移、及时就地化解矛盾,把矛盾化解在基层一线的这么一个问题解决处理的方式。
</div>
</div>
</div>
<div class="part-item">
<div class="part-avatar">
<div class="part-avatar-img-num"> 1 </div>
<div class="part-avatar-text subTile"> 彭佳学 </div>
</div>
<div class="part-title">
<h2> <a href="http://news.xinhuanet.com/legal/2017-07/28/c_129664498.htm"> 2015年以来积案化解率达到了85% </a> </h2>
</div>
<div class="part-text">
<div class="dialog-media">
<img src="../../titlepic/112139/1121395828_1501224279926_title0h.jpg" width="100%" alt="2015年以来积案化解率达到了85%" />
<div class="title-string hide"> 2015年以来积案化解率达到了85% </div>
<div class="src-string hide"> </div>
</div>
<div class="abs"> 首先积案不是一天形成的,它也是有一个过程。对于积案的化解,我们讲本着两个方面:一个方面是营造一个地方的整个发展环境和一些治理环境。另一个方面,也是真正地体现以人民为中心的发展思想。所以,应该分析研究,真正地弄清这些积案是怎么形成的,为什么会这样。所以,我们近年来在这个方面也是抓住了省里给我们营造的解决疑难问题的好环境、好氛围,来把握解决疑难问题的一个好的机会,来完善相应的体系、体制和机制。我们还是希望积极地把这些积案能够全面进行化解,努力创建“无积案市”。<br
/>经过全市上下的共同努力,信访秩序趋于稳定,信访工作也呈现出信访总量、重复访量、越级访量“三下降”的良好态势。2015年以来,信访总量下降了5%,重复访下降了30%左右,积案化解率达到了85%。
</div>
</div>
</div>
<div class="part-item">
<div class="part-avatar">
<div class="part-avatar-img-num"> 1 </div>
<div class="part-avatar-text subTile"> 彭佳学 </div>
</div>
<div class="part-title">
<h2> <a href="http://news.xinhuanet.com/legal/2017-07/28/c_129664510.htm"> 今后将从三个方面把信访工作做得更好 </a> </h2>
</div>
<div class="part-text">
<div class="dialog-media">
<img src="../../titlepic/112139/1121395892_1501224528883_title0h.jpg" width="100%" alt="今后将从三个方面把信访工作做得更好" />
<div class="title-string hide"> 今后将从三个方面把信访工作做得更好 </div>
<div class="src-string hide"> </div>
</div>
<div class="abs"> 习近平总书记将信访工作定位为了解民情、集中民智、维护民利、凝聚民心,要求我们各级党委政府和各级领导干部要“千方百计为群众排忧解难”。这无疑是对信访工作最根本、最核心的概括,也对信访为民的方向做了深刻的定位。所以,我们一定要认真学习、深刻领会,坚决贯彻好、落实好。<br />一是一定要强化为民意识。自觉践行党的群众路线,通过继续做好定期接访,尤其是带案下访,重点约访,包括一些走进群众中间,走进家门等等一些形式,真正地察民情。<br />二是一定要强化一种责任担当,要全面落实信访工作的责任,尤其要提升分析研判能力和把握能力,要强化督查问责的机制,把责任落实落到实处,真正推进问题的解决。<br
/>三是一定要坚持法治意识,要把握好决策的源头,科学决策、民主决策、依法决策,从源头上有效防范不应该产生的信访问题。要积极推进法治信访,引导群众从整体的利益看问题。在全社会真正形成一种团结奋发向上的秩序和环境。当下,要通过我们扎扎实实地务实的落实、务实的工作,为党的十九大胜利召开,营造好良好的氛围。
</div>
</div>
</div>
<!-- mod: 0 END -->
</div>
<div class="part-pc-sidebar">
<div class="part-item">
<div class="part-col-title"><a href="#">嘉宾简介</a></div>
<!-- { mod: 0, name: 嘉宾简介, attr:普通, rpt:4 } BEGIN -->
<div class="part-intro">
<img src="http://www.xinhuanet.com/legal/titlepic/112137/1121376771_1501229719195_title0h.jpg" width="89" height="114">
<div class="part-intro-title"><strong>彭佳学</strong></div>
<div class="part-intro-text abs">浙江省绍兴市委书记</div>
</div>
<!-- mod: 0 END -->
</div>
<div class="part-item isNoIE9">
<div class="part-col-title"><a href="#">系列访谈</a></div>
<div id="part-item-pic" class="swiper-container part-item-pic">
<div class="swiper-wrapper">
<!-- { mod: 0, name: 系列访谈, attr:普通, rpt:6 } BEGIN -->
<!---->
<!-- mod: 0 END -->
</div>
<div class="swiper-button-prev swiper-button-white"></div>
<div class="swiper-button-next swiper-button-white"></div>
<div class="swiper-pagination"></div>
</div>
</div>
<div class="part-item">
<div class="part-col-title"><a href="#">往期对话</a></div>
<!-- { mod: 0, name: 往期对话, attr:默认, rpt:6 } BEGIN -->
<ul class="part-list">
<li><a href="http://www.gjxfj.gov.cn/wszb/zhibo17/index.htm">江苏省金湖县委书记张志勇谈信访</a></li>
<li><a href="http://www.gjxfj.gov.cn/wszb/zhibo14/index.htm">江西省余干县委书记胡伟谈信访 </a></li>
<li><a href="http://www.gjxfj.gov.cn/wszb/zhibo13/index.htm">内蒙古自治区翁牛特旗委书记南振虎谈信访 </a></li>
<li><a href="http://www.gjxfj.gov.cn/wszb/zhibo10/index.htm">贵州省贵定县委书记莫春开谈信访</a></li>
<li><a href="http://www.gjxfj.gov.cn/wszb/zhibo1/index.htm">浙江省浦江县县委书记施振强谈信访</a></li>
</ul>
<!-- mod: 0 END -->
</div>
<!-- part-item-nav @St. 2017-04-10 -->
<div class="part-item part-item-nav hide">
<a href="http://www.xinhuanet.com/talking/"> <img src="http://www.xinhuanet.com/talking/interview/bundle/xinhua-talking-logo.png" /></a>
<div class="part-item-nav-item"> <a href="http://www.xinhuanet.com/talking/#1">最热访</a> <a href="http://www.xinhuanet.com/talking/#2">会客厅</a> <a href="http://www.xinhuanet.com/talking/#3">系列谈</a> <a href="http://www.xinhuanet.com/talking/#4">发布厅</a> <a href="http://www.xinhuanet.com/talking/#5">现场感</a></div>
</div>
<!-- part-item-nav END -->
</div>
</div>
<div id="dialog-video" title="" class="hide"></div>
</div>
<!-- <script src="bundle/isAboveIE9.swiper.min.js"></script> -->
<!-- <script src="bundle/isAboveIE9.jquery.parallax.min.js"></script> -->
<!-- <script src="bundle/jquery-ui.min.js"></script> -->
<!-- <script src="bundle/jquery.qrcode.min.js"></script> -->
<!-- <script src="http://www.xinhuanet.com/interview/20161202/bundle/index.all.min.js"></script> -->
<script src="bundle/index.js"></script>
<script src="bundle/extend.js"></script>
<!-- <script src="bundle/footer.js"></script> -->
<!-- <div style="display:none"><div id="fwl">010020100020000000000000011200000000000000</div><script type="text/javascript" src="http://webd.home.news.cn/webdig.js?z=1"></script><script type="text/javascript">wd_paramtracker("_wdxid=010020100020000000000000011200000000000000")</script><noscript><img src="http://webd.home.news.cn/1.gif?z=1&_wdxid=010020100020000000000000011200000000000000" border="0" /></noscript></div> -->
</body>
</html> | xinhuaRadioLAB/xinhuaTalking-interview | bk/19cpcnc2.html | HTML | mit | 27,096 |
# -*- coding: utf-8 -*-
from gi.repository import GObject, GtkSource, GLib
import os
from gettext import gettext as _
from glob import glob
import re
try:
import json
except ImportError:
import simplejson as json
class PHPProposal(GObject.Object, GtkSource.CompletionProposal):
def __init__(self, proposal):
GObject.Object.__init__(self)
self.proposal = proposal
def do_get_text(self):
text = self.proposal['name']
if self.is_constant() or self.is_interface():
return text
required, optional = self.format_params()
# we only care about required params if any
return '%s(%s)' % (text, required)
def do_get_label(self):
label = self.proposal['name']
if self.is_constant() or self.is_interface():
return label
params = ''
required, optional = self.format_params()
if required:
params = required
if optional:
if required:
params = '%s %s' % (params, optional)
else:
# str is immutable
option = list(optional)
# no need for first ', ' characters
del option[1:3]
optional = ''.join(option)
params = optional
return '%s(%s)' % (label, params)
def do_get_info(self):
info = self.proposal['info']
if info:
return GLib.markup_escape_text(info)
return _('Info is not available')
def format_params(self):
params = self.proposal.get('params', '')
required = optional = ''
if 'required' in params:
required = ', '.join(params['required'])
if 'optional' in params:
optional = ['[, %s]' % option for option in params['optional']]
optional = ' '.join(optional)
return required, optional
def is_constant(self):
return self.proposal.get('type', '') == 'constant'
def is_interface(self):
return self.proposal.get('type', '') == 'interface'
class PHPProvider(GObject.Object, GtkSource.CompletionProvider):
MARK_NAME = 'PHPProviderCompletionMark'
BUNDLES = {}
def __init__(self, plugin):
GObject.Object.__init__(self)
self.mark = None
self._plugin = plugin
self.bundles_root = os.path.join(os.getenv('HOME'), '.reflextor',
'bundles')
def do_get_name(self):
return _('PHP')
def do_get_activation(self):
return GtkSource.CompletionActivation.USER_REQUESTED
def do_activate_proposal(self, proposal, textiter):
buff = textiter.get_buffer()
buff.begin_user_action()
text = proposal.do_get_text()
start, word = self.get_word(textiter)
text = '%s' % re.sub(r'^%s' % word, '', text)
buff.insert_at_cursor(text)
start = buff.get_iter_at_mark(buff.get_insert())
if '(' in text:
while not start.get_char() == '(':
start.backward_char()
start.forward_char()
buff.place_cursor(start)
buff.end_user_action()
return True
def do_match(self, context):
lang = context.get_iter().get_buffer().get_language()
if not lang or lang.get_id() != 'php':
return False
return True
def do_populate(self, context):
textiter = context.get_iter()
buff = textiter.get_buffer()
start, word = self.get_word(textiter)
if not word:
context.add_proposals(self, [], True)
else:
self.move_mark(buff, start)
context.add_proposals(self, self.get_proposals(word), True)
def move_mark(self, buff, start):
mark = buff.get_mark(self.MARK_NAME)
if not mark:
buff.create_mark(self.MARK_NAME, start, True)
else:
buff.move_mark(mark, start)
def get_proposals(self, keyword):
bundle = 'php_internal.bundle'
bundlepath = os.path.join(self.bundles_root, bundle)
if not bundle in self.BUNDLES:
self.BUNDLES[bundle] = {}
if not self.BUNDLES[bundle]:
filepaths = glob(os.path.join(bundlepath, '*.json'))
for filepath in filepaths:
try:
f = open(filepath)
self.BUNDLES[bundle][os.path.basename(filepath)] = json.load(f)
f.close()
except IOError:
pass
proposals = []
candidates = self.BUNDLES[bundle].iteritems()
for key, itemlist in candidates:
try:
for item in itemlist:
if item['name'].startswith(keyword) is True:
proposals.append(PHPProposal(item))
except KeyError:
pass
return proposals
def get_word(self, textiter):
if not textiter.ends_word or textiter.get_char() == '_':
return None, None
start = textiter.copy()
while True:
if start.starts_line():
break
start.backward_char()
ch = start.get_char()
if not (ch.isalnum() or ch == '_' or ch == ':'):
start.forward_char()
break
if start.equal(textiter):
return None, None
while (not start.equal(textiter)) and start.get_char().isdigit():
start.forward_char()
if start.equal(textiter):
return None, None
return start, start.get_text(textiter)
GObject.type_fundamental(PHPProposal)
GObject.type_fundamental(PHPProvider)
| iromli/gedit-phpkit | phpkit/completion.py | Python | mit | 5,681 |
<?php
// src/Acme/UserBundle/Entity/User.php
namespace Web\BackBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table()
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
public function __construct()
{
parent::__construct();
}
}
| seekmas/makoto.refactor | src/Web/BackBundle/Entity/User.php | PHP | mit | 435 |
graphapiclone
=============
Application to implement a Proof of Concept based on Facebook's graph api.
It Uses 2 libs for it:
[gaegraph](https://github.com/renzon/gaegraph)
[gaebusiness](https://github.com/renzon/gaebusiness)
The project is hosted at http://graphapiclone.appspot.com
| renzon/graphapiclone | README.md | Markdown | mit | 292 |
//
// RACSubject.h
// ReactiveObjC
//
// Created by Josh Abernathy on 3/9/12.
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//
#import <RACObjC/RACSignal.h>
#import <RACObjC/RACSubscriber.h>
NS_ASSUME_NONNULL_BEGIN
/// A subject can be thought of as a signal that you can manually control by
/// sending next, completed, and error.
///
/// They're most helpful in bridging the non-RAC world to RAC, since they let you
/// manually control the sending of events.
@interface RACSubject<ValueType> : RACSignal<ValueType> <RACSubscriber>
/// Returns a new subject.
+ (instancetype)subject;
// Redeclaration of the RACSubscriber method. Made in order to specify a generic type.
- (void)sendNext:(nullable ValueType)value;
@end
NS_ASSUME_NONNULL_END
| sdkdimon/kms-ios-client | KMSClient/Pods/RACObjC/Core/RACObjC/Classes/Subject/RACSubject.h | C | mit | 765 |
module PowerShop
# Controller represents methods for cart
class CartController < PowerShop::ApplicationController
skip_before_filter :verify_authenticity_token
# Public: add products to shopping cart
# if request is simple post redirects back
# if request is ajax respond with json message
#
# Returns text/html or text/json
def add_product
@product = product_resource
cart.add(@product, @product.price, params.fetch(:quantity, 1).to_i)
if request.xhr?
render_json_cart
else
redirect_to :back
end
end
def destroy
# TODO: 99 - its hack for remove all items :)
cart.remove(product_resource, 99)
redirect_to :back
end
# Pubclic: show cart page
# TODO: preload associations
#
# Returns text/html
def show
@cart = cart
end
def update
end
protected
def product_resource
::Product.find(params[:product_id])
end
# Internal: render json response with cart params
#
# Returns text/json
def render_json_cart
render :json => {
total_items: cart.total_unique_items,
subtotal: cart.subtotal
}.to_json
end
end
end
| artofhuman/power_shop | app/controllers/power_shop/cart_controller.rb | Ruby | mit | 1,222 |
/* =========================================================
* bootstrap-datepicker.js
* Repo: https://github.com/eternicode/bootstrap-datepicker/
* Demo: http://eternicode.github.io/bootstrap-datepicker/
* Docs: http://bootstrap-datepicker.readthedocs.org/
* Forked from http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Started by Stefan Petre; improvements by Andrew Rowls + contributors
*
* 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.
* ========================================================= */
(function($, undefined){
var $window = $(window);
function UTCDate(){
return new Date(Date.UTC.apply(Date, arguments));
}
function UTCToday(){
var today = new Date();
return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
}
function alias(method){
return function(){
return this[method].apply(this, arguments);
};
}
var DateArray = (function(){
var extras = {
get: function(i){
return this.slice(i)[0];
},
contains: function(d){
// Array.indexOf is not cross-browser;
// $.inArray doesn't work with Dates
var val = d && d.valueOf();
for (var i=0, l=this.length; i < l; i++)
if (this[i].valueOf() === val)
return i;
return -1;
},
remove: function(i){
this.splice(i,1);
},
replace: function(new_array){
if (!new_array)
return;
if (!$.isArray(new_array))
new_array = [new_array];
this.clear();
this.push.apply(this, new_array);
},
clear: function(){
this.length = 0;
},
copy: function(){
var a = new DateArray();
a.replace(this);
return a;
}
};
return function(){
var a = [];
a.push.apply(a, arguments);
$.extend(a, extras);
return a;
};
})();
// Picker object
var Datepicker = function(element, options){
this.dates = new DateArray();
this.viewDate = UTCToday();
this.focusDate = null;
this._process_options(options);
this.element = $(element);
this.isInline = false;
this.isInput = this.element.is('input');
this.component = this.element.is('.date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;
this.hasInput = this.component && this.element.find('input').length;
if (this.component && this.component.length === 0)
this.component = false;
this.picker = $(DPGlobal.template);
this._buildEvents();
this._attachEvents();
if (this.isInline){
this.picker.addClass('datepicker-inline').appendTo(this.element);
}
else {
this.picker.addClass('datepicker-dropdown dropdown-menu');
}
if (this.o.rtl){
this.picker.addClass('datepicker-rtl');
}
this.viewMode = this.o.startView;
if (this.o.calendarWeeks)
this.picker.find('tfoot th.today, tfoot th.clear')
.attr('colspan', function(i, val){
return parseInt(val) + 1;
});
this._allow_update = false;
this.setStartDate(this._o.startDate);
this.setEndDate(this._o.endDate);
this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);
this.fillDow();
this.fillMonths();
this._allow_update = true;
this.update();
this.showMode();
if (this.isInline){
this.show();
}
};
Datepicker.prototype = {
constructor: Datepicker,
_process_options: function(opts){
// Store raw options for reference
this._o = $.extend({}, this._o, opts);
// Processed options
var o = this.o = $.extend({}, this._o);
// Check if "de-DE" style date is available, if not language should
// fallback to 2 letter code eg "de"
var lang = o.language;
if (!dates[lang]){
lang = lang.split('-')[0];
if (!dates[lang])
lang = defaults.language;
}
o.language = lang;
switch (o.startView){
case 2:
case 'decade':
o.startView = 2;
break;
case 1:
case 'year':
o.startView = 1;
break;
default:
o.startView = 0;
}
switch (o.minViewMode){
case 1:
case 'months':
o.minViewMode = 1;
break;
case 2:
case 'years':
o.minViewMode = 2;
break;
default:
o.minViewMode = 0;
}
o.startView = Math.max(o.startView, o.minViewMode);
// true, false, or Number > 0
if (o.multidate !== true){
o.multidate = Number(o.multidate) || false;
if (o.multidate !== false)
o.multidate = Math.max(0, o.multidate);
else
o.multidate = 1;
}
o.multidateSeparator = String(o.multidateSeparator);
o.weekStart %= 7;
o.weekEnd = ((o.weekStart + 6) % 7);
var format = DPGlobal.parseFormat(o.format);
if (o.startDate !== -Infinity){
if (!!o.startDate){
if (o.startDate instanceof Date)
o.startDate = this._local_to_utc(this._zero_time(o.startDate));
else
o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
}
else {
o.startDate = -Infinity;
}
}
if (o.endDate !== Infinity){
if (!!o.endDate){
if (o.endDate instanceof Date)
o.endDate = this._local_to_utc(this._zero_time(o.endDate));
else
o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
}
else {
o.endDate = Infinity;
}
}
o.daysOfWeekDisabled = o.daysOfWeekDisabled||[];
if (!$.isArray(o.daysOfWeekDisabled))
o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);
o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d){
return parseInt(d, 10);
});
var plc = String(o.orientation).toLowerCase().split(/\s+/g),
_plc = o.orientation.toLowerCase();
plc = $.grep(plc, function(word){
return (/^auto|left|right|top|bottom$/).test(word);
});
o.orientation = {x: 'auto', y: 'auto'};
if (!_plc || _plc === 'auto')
; // no action
else if (plc.length === 1){
switch (plc[0]){
case 'top':
case 'bottom':
o.orientation.y = plc[0];
break;
case 'left':
case 'right':
o.orientation.x = plc[0];
break;
}
}
else {
_plc = $.grep(plc, function(word){
return (/^left|right$/).test(word);
});
o.orientation.x = _plc[0] || 'auto';
_plc = $.grep(plc, function(word){
return (/^top|bottom$/).test(word);
});
o.orientation.y = _plc[0] || 'auto';
}
},
_events: [],
_secondaryEvents: [],
_applyEvents: function(evs){
for (var i=0, el, ch, ev; i < evs.length; i++){
el = evs[i][0];
if (evs[i].length === 2){
ch = undefined;
ev = evs[i][1];
}
else if (evs[i].length === 3){
ch = evs[i][1];
ev = evs[i][2];
}
el.on(ev, ch);
}
},
_unapplyEvents: function(evs){
for (var i=0, el, ev, ch; i < evs.length; i++){
el = evs[i][0];
if (evs[i].length === 2){
ch = undefined;
ev = evs[i][1];
}
else if (evs[i].length === 3){
ch = evs[i][1];
ev = evs[i][2];
}
el.off(ev, ch);
}
},
_buildEvents: function(){
if (this.isInput){ // single input
this._events = [
[this.element, {
focus: $.proxy(this.show, this),
keyup: $.proxy(function(e){
if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
this.update();
}, this),
keydown: $.proxy(this.keydown, this)
}]
];
}
else if (this.component && this.hasInput){ // component: input + button
this._events = [
// For components that are not readonly, allow keyboard nav
[this.element.find('input'), {
focus: $.proxy(this.show, this),
keyup: $.proxy(function(e){
if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
this.update();
}, this),
keydown: $.proxy(this.keydown, this)
}],
[this.component, {
click: $.proxy(this.show, this)
}]
];
}
else if (this.element.is('div')){ // inline datepicker
this.isInline = true;
}
else {
this._events = [
[this.element, {
click: $.proxy(this.show, this)
}]
];
}
this._events.push(
// Component: listen for blur on element descendants
[this.element, '*', {
blur: $.proxy(function(e){
this._focused_from = e.target;
}, this)
}],
// Input: listen for blur on element
[this.element, {
blur: $.proxy(function(e){
this._focused_from = e.target;
}, this)
}]
);
this._secondaryEvents = [
[this.picker, {
click: $.proxy(this.click, this)
}],
[$(window), {
resize: $.proxy(this.place, this)
}],
[$(document), {
'mousedown touchstart': $.proxy(function(e){
// Clicked outside the datepicker, hide it
if (!(
this.element.is(e.target) ||
this.element.find(e.target).length ||
this.picker.is(e.target) ||
this.picker.find(e.target).length
)){
this.hide();
}
}, this)
}]
];
},
_attachEvents: function(){
this._detachEvents();
this._applyEvents(this._events);
},
_detachEvents: function(){
this._unapplyEvents(this._events);
},
_attachSecondaryEvents: function(){
this._detachSecondaryEvents();
this._applyEvents(this._secondaryEvents);
},
_detachSecondaryEvents: function(){
this._unapplyEvents(this._secondaryEvents);
},
_trigger: function(event, altdate){
var date = altdate || this.dates.get(-1),
local_date = this._utc_to_local(date);
this.element.trigger({
type: event,
date: local_date,
dates: $.map(this.dates, this._utc_to_local),
format: $.proxy(function(ix, format){
if (arguments.length === 0){
ix = this.dates.length - 1;
format = this.o.format;
}
else if (typeof ix === 'string'){
format = ix;
ix = this.dates.length - 1;
}
format = format || this.o.format;
var date = this.dates.get(ix);
return DPGlobal.formatDate(date, format, this.o.language);
}, this)
});
},
show: function(){
if (!this.isInline)
this.picker.appendTo('body');
this.picker.show();
this.place();
this._attachSecondaryEvents();
this._trigger('show');
},
hide: function(){
if (this.isInline)
return;
if (!this.picker.is(':visible'))
return;
this.focusDate = null;
this.picker.hide().detach();
this._detachSecondaryEvents();
this.viewMode = this.o.startView;
this.showMode();
if (
this.o.forceParse &&
(
this.isInput && this.element.val() ||
this.hasInput && this.element.find('input').val()
)
)
this.setValue();
this._trigger('hide');
},
remove: function(){
this.hide();
this._detachEvents();
this._detachSecondaryEvents();
this.picker.remove();
delete this.element.data().datepicker;
if (!this.isInput){
delete this.element.data().date;
}
},
_utc_to_local: function(utc){
return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000));
},
_local_to_utc: function(local){
return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
},
_zero_time: function(local){
return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
},
_zero_utc_time: function(utc){
return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));
},
getDates: function(){
return $.map(this.dates, this._utc_to_local);
},
getUTCDates: function(){
return $.map(this.dates, function(d){
return new Date(d);
});
},
getDate: function(){
return this._utc_to_local(this.getUTCDate());
},
getUTCDate: function(){
return new Date(this.dates.get(-1));
},
setDates: function(){
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
this.update.apply(this, args);
this._trigger('changeDate');
this.setValue();
},
setUTCDates: function(){
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
this.update.apply(this, $.map(args, this._utc_to_local));
this._trigger('changeDate');
this.setValue();
},
setDate: alias('setDates'),
setUTCDate: alias('setUTCDates'),
setValue: function(){
var formatted = this.getFormattedDate();
if (!this.isInput){
if (this.component){
this.element.find('input').val(formatted).change();
}
}
else {
this.element.val(formatted).change();
}
},
getFormattedDate: function(format){
if (format === undefined)
format = this.o.format;
var lang = this.o.language;
return $.map(this.dates, function(d){
return DPGlobal.formatDate(d, format, lang);
}).join(this.o.multidateSeparator);
},
setStartDate: function(startDate){
this._process_options({startDate: startDate});
this.update();
this.updateNavArrows();
},
setEndDate: function(endDate){
this._process_options({endDate: endDate});
this.update();
this.updateNavArrows();
},
setDaysOfWeekDisabled: function(daysOfWeekDisabled){
this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
this.update();
this.updateNavArrows();
},
place: function(){
if (this.isInline)
return;
var calendarWidth = this.picker.outerWidth(),
calendarHeight = this.picker.outerHeight(),
visualPadding = 10,
windowWidth = $window.width(),
windowHeight = $window.height(),
scrollTop = $window.scrollTop();
var parentsZindex = [];
this.element.parents().each(function() {
var itemZIndex = $(this).css('z-index');
if ( itemZIndex !== 'auto' && itemZIndex !== 0 ) parentsZindex.push( parseInt( itemZIndex ) );
});
var zIndex = Math.max.apply( Math, parentsZindex ) + 10;
var offset = this.component ? this.component.parent().offset() : this.element.offset();
var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
var left = offset.left,
top = offset.top;
this.picker.removeClass(
'datepicker-orient-top datepicker-orient-bottom '+
'datepicker-orient-right datepicker-orient-left'
);
if (this.o.orientation.x !== 'auto'){
this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
if (this.o.orientation.x === 'right')
left -= calendarWidth - width;
}
// auto x orientation is best-placement: if it crosses a window
// edge, fudge it sideways
else {
// Default to left
this.picker.addClass('datepicker-orient-left');
if (offset.left < 0)
left -= offset.left - visualPadding;
else if (offset.left + calendarWidth > windowWidth)
left = windowWidth - calendarWidth - visualPadding;
}
// auto y orientation is best-situation: top or bottom, no fudging,
// decision based on which shows more of the calendar
var yorient = this.o.orientation.y,
top_overflow, bottom_overflow;
if (yorient === 'auto'){
top_overflow = -scrollTop + offset.top - calendarHeight;
bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight);
if (Math.max(top_overflow, bottom_overflow) === bottom_overflow)
yorient = 'top';
else
yorient = 'bottom';
}
this.picker.addClass('datepicker-orient-' + yorient);
if (yorient === 'top')
top += height;
else
top -= calendarHeight + parseInt(this.picker.css('padding-top'));
this.picker.css({
top: top,
left: left,
zIndex: zIndex
});
},
_allow_update: true,
update: function(){
if (!this._allow_update)
return;
var oldDates = this.dates.copy(),
dates = [],
fromArgs = false;
if (arguments.length){
$.each(arguments, $.proxy(function(i, date){
if (date instanceof Date)
date = this._local_to_utc(date);
dates.push(date);
}, this));
fromArgs = true;
}
else {
dates = this.isInput
? this.element.val()
: this.element.data('date') || this.element.find('input').val();
if (dates && this.o.multidate)
dates = dates.split(this.o.multidateSeparator);
else
dates = [dates];
delete this.element.data().date;
}
dates = $.map(dates, $.proxy(function(date){
return DPGlobal.parseDate(date, this.o.format, this.o.language);
}, this));
dates = $.grep(dates, $.proxy(function(date){
return (
date < this.o.startDate ||
date > this.o.endDate ||
!date
);
}, this), true);
this.dates.replace(dates);
if (this.dates.length)
this.viewDate = new Date(this.dates.get(-1));
else if (this.viewDate < this.o.startDate)
this.viewDate = new Date(this.o.startDate);
else if (this.viewDate > this.o.endDate)
this.viewDate = new Date(this.o.endDate);
if (fromArgs){
// setting date by clicking
this.setValue();
}
else if (dates.length){
// setting date by typing
if (String(oldDates) !== String(this.dates))
this._trigger('changeDate');
}
if (!this.dates.length && oldDates.length)
this._trigger('clearDate');
this.fill();
},
fillDow: function(){
var dowCnt = this.o.weekStart,
html = '<tr>';
if (this.o.calendarWeeks){
var cell = '<th class="cw"> </th>';
html += cell;
this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);
}
while (dowCnt < this.o.weekStart + 7){
html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';
}
html += '</tr>';
this.picker.find('.datepicker-days thead').append(html);
},
fillMonths: function(){
var html = '',
i = 0;
while (i < 12){
html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>';
}
this.picker.find('.datepicker-months td').html(html);
},
setRange: function(range){
if (!range || !range.length)
delete this.range;
else
this.range = $.map(range, function(d){
return d.valueOf();
});
this.fill();
},
getClassNames: function(date){
var cls = [],
year = this.viewDate.getUTCFullYear(),
month = this.viewDate.getUTCMonth(),
today = new Date();
if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
cls.push('old');
}
else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
cls.push('new');
}
if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
cls.push('focused');
// Compare internal UTC date with local today, not UTC today
if (this.o.todayHighlight &&
date.getUTCFullYear() === today.getFullYear() &&
date.getUTCMonth() === today.getMonth() &&
date.getUTCDate() === today.getDate()){
cls.push('today');
}
if (this.dates.contains(date) !== -1)
cls.push('active');
if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||
$.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1){
cls.push('disabled');
}
if (this.range){
if (date > this.range[0] && date < this.range[this.range.length-1]){
cls.push('range');
}
if ($.inArray(date.valueOf(), this.range) !== -1){
cls.push('selected');
}
}
return cls;
},
fill: function(){
var d = new Date(this.viewDate),
year = d.getUTCFullYear(),
month = d.getUTCMonth(),
startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
todaytxt = dates[this.o.language].today || dates['en'].today || '',
cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
tooltip;
if (isNaN(year) || isNaN(month)) return;
this.picker.find('.datepicker-days thead th.datepicker-switch')
.text(dates[this.o.language].months[month]+' '+year);
this.picker.find('tfoot th.today')
.text(todaytxt)
.toggle(this.o.todayBtn !== false);
this.picker.find('tfoot th.clear')
.text(cleartxt)
.toggle(this.o.clearBtn !== false);
this.updateNavArrows();
this.fillMonths();
var prevMonth = UTCDate(year, month-1, 28),
day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
prevMonth.setUTCDate(day);
prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
var nextMonth = new Date(prevMonth);
nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
nextMonth = nextMonth.valueOf();
var html = [];
var clsName;
while (prevMonth.valueOf() < nextMonth){
if (prevMonth.getUTCDay() === this.o.weekStart){
html.push('<tr>');
if (this.o.calendarWeeks){
// ISO 8601: First week contains first thursday.
// ISO also states week starts on Monday, but we can be more abstract here.
var
// Start of current week: based on weekstart/current date
ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),
// Thursday of this week
th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
// First Thursday of year, year from thursday
yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5),
// Calendar week: ms between thursdays, div ms per day, div 7 days
calWeek = (th - yth) / 864e5 / 7 + 1;
html.push('<td class="cw">'+ calWeek +'</td>');
}
}
clsName = this.getClassNames(prevMonth);
clsName.push('day');
if (this.o.beforeShowDay !== $.noop){
var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
if (before === undefined)
before = {};
else if (typeof(before) === 'boolean')
before = {enabled: before};
else if (typeof(before) === 'string')
before = {classes: before};
if (before.enabled === false)
clsName.push('disabled');
if (before.classes)
clsName = clsName.concat(before.classes.split(/\s+/));
if (before.tooltip)
tooltip = before.tooltip;
}
clsName = $.unique(clsName);
html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');
tooltip = null;
if (prevMonth.getUTCDay() === this.o.weekEnd){
html.push('</tr>');
}
prevMonth.setUTCDate(prevMonth.getUTCDate()+1);
}
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
var months = this.picker.find('.datepicker-months')
.find('th:eq(1)')
.text(year)
.end()
.find('span').removeClass('active');
$.each(this.dates, function(i, d){
if (d.getUTCFullYear() === year)
months.eq(d.getUTCMonth()).addClass('active');
});
if (year < startYear || year > endYear){
months.addClass('disabled');
}
if (year === startYear){
months.slice(0, startMonth).addClass('disabled');
}
if (year === endYear){
months.slice(endMonth+1).addClass('disabled');
}
html = '';
year = parseInt(year/10, 10) * 10;
var yearCont = this.picker.find('.datepicker-years')
.find('th:eq(1)')
.text(year + '-' + (year + 9))
.end()
.find('td');
year -= 1;
var years = $.map(this.dates, function(d){
return d.getUTCFullYear();
}),
classes;
for (var i = -1; i < 11; i++){
classes = ['year'];
if (i === -1)
classes.push('old');
else if (i === 10)
classes.push('new');
if ($.inArray(year, years) !== -1)
classes.push('active');
if (year < startYear || year > endYear)
classes.push('disabled');
html += '<span class="' + classes.join(' ') + '">'+year+'</span>';
year += 1;
}
yearCont.html(html);
},
updateNavArrows: function(){
if (!this._allow_update)
return;
var d = new Date(this.viewDate),
year = d.getUTCFullYear(),
month = d.getUTCMonth();
switch (this.viewMode){
case 0:
if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()){
this.picker.find('.prev').css({visibility: 'hidden'});
}
else {
this.picker.find('.prev').css({visibility: 'visible'});
}
if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()){
this.picker.find('.next').css({visibility: 'hidden'});
}
else {
this.picker.find('.next').css({visibility: 'visible'});
}
break;
case 1:
case 2:
if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()){
this.picker.find('.prev').css({visibility: 'hidden'});
}
else {
this.picker.find('.prev').css({visibility: 'visible'});
}
if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()){
this.picker.find('.next').css({visibility: 'hidden'});
}
else {
this.picker.find('.next').css({visibility: 'visible'});
}
break;
}
},
click: function(e){
e.preventDefault();
var target = $(e.target).closest('span, td, th'),
year, month, day;
if (target.length === 1){
switch (target[0].nodeName.toLowerCase()){
case 'th':
switch (target[0].className){
case 'datepicker-switch':
this.showMode(1);
break;
case 'prev':
case 'next':
var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1);
switch (this.viewMode){
case 0:
this.viewDate = this.moveMonth(this.viewDate, dir);
this._trigger('changeMonth', this.viewDate);
break;
case 1:
case 2:
this.viewDate = this.moveYear(this.viewDate, dir);
if (this.viewMode === 1)
this._trigger('changeYear', this.viewDate);
break;
}
this.fill();
break;
case 'today':
var date = new Date();
date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
this.showMode(-2);
var which = this.o.todayBtn === 'linked' ? null : 'view';
this._setDate(date, which);
break;
case 'clear':
var element;
if (this.isInput)
element = this.element;
else if (this.component)
element = this.element.find('input');
if (element)
element.val("").change();
this.update();
this._trigger('changeDate');
if (this.o.autoclose)
this.hide();
break;
}
break;
case 'span':
if (!target.is('.disabled')){
this.viewDate.setUTCDate(1);
if (target.is('.month')){
day = 1;
month = target.parent().find('span').index(target);
year = this.viewDate.getUTCFullYear();
this.viewDate.setUTCMonth(month);
this._trigger('changeMonth', this.viewDate);
if (this.o.minViewMode === 1){
this._setDate(UTCDate(year, month, day));
}
}
else {
day = 1;
month = 0;
year = parseInt(target.text(), 10)||0;
this.viewDate.setUTCFullYear(year);
this._trigger('changeYear', this.viewDate);
if (this.o.minViewMode === 2){
this._setDate(UTCDate(year, month, day));
}
}
this.showMode(-1);
this.fill();
}
break;
case 'td':
if (target.is('.day') && !target.is('.disabled')){
day = parseInt(target.text(), 10)||1;
year = this.viewDate.getUTCFullYear();
month = this.viewDate.getUTCMonth();
if (target.is('.old')){
if (month === 0){
month = 11;
year -= 1;
}
else {
month -= 1;
}
}
else if (target.is('.new')){
if (month === 11){
month = 0;
year += 1;
}
else {
month += 1;
}
}
this._setDate(UTCDate(year, month, day));
}
break;
}
}
if (this.picker.is(':visible') && this._focused_from){
$(this._focused_from).focus();
}
delete this._focused_from;
},
_toggle_multidate: function(date){
var ix = this.dates.contains(date);
if (!date){
this.dates.clear();
}
if (this.o.multidate === 1 && ix === 0){
// single datepicker, don't remove selected date
}
else if (ix !== -1){
this.dates.remove(ix);
}
else {
this.dates.push(date);
}
if (typeof this.o.multidate === 'number')
while (this.dates.length > this.o.multidate)
this.dates.remove(0);
},
_setDate: function(date, which){
if (!which || which === 'date')
this._toggle_multidate(date && new Date(date));
if (!which || which === 'view')
this.viewDate = date && new Date(date);
this.fill();
this.setValue();
this._trigger('changeDate');
var element;
if (this.isInput){
element = this.element;
}
else if (this.component){
element = this.element.find('input');
}
if (element){
element.change();
}
if (this.o.autoclose && (!which || which === 'date')){
this.hide();
}
},
moveMonth: function(date, dir){
if (!date)
return undefined;
if (!dir)
return date;
var new_date = new Date(date.valueOf()),
day = new_date.getUTCDate(),
month = new_date.getUTCMonth(),
mag = Math.abs(dir),
new_month, test;
dir = dir > 0 ? 1 : -1;
if (mag === 1){
test = dir === -1
// If going back one month, make sure month is not current month
// (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
? function(){
return new_date.getUTCMonth() === month;
}
// If going forward one month, make sure month is as expected
// (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
: function(){
return new_date.getUTCMonth() !== new_month;
};
new_month = month + dir;
new_date.setUTCMonth(new_month);
// Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
if (new_month < 0 || new_month > 11)
new_month = (new_month + 12) % 12;
}
else {
// For magnitudes >1, move one month at a time...
for (var i=0; i < mag; i++)
// ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
new_date = this.moveMonth(new_date, dir);
// ...then reset the day, keeping it in the new month
new_month = new_date.getUTCMonth();
new_date.setUTCDate(day);
test = function(){
return new_month !== new_date.getUTCMonth();
};
}
// Common date-resetting loop -- if date is beyond end of month, make it
// end of month
while (test()){
new_date.setUTCDate(--day);
new_date.setUTCMonth(new_month);
}
return new_date;
},
moveYear: function(date, dir){
return this.moveMonth(date, dir*12);
},
dateWithinRange: function(date){
return date >= this.o.startDate && date <= this.o.endDate;
},
keydown: function(e){
if (this.picker.is(':not(:visible)')){
if (e.keyCode === 27) // allow escape to hide and re-show picker
this.show();
return;
}
var dateChanged = false,
dir, newDate, newViewDate,
focusDate = this.focusDate || this.viewDate;
switch (e.keyCode){
case 27: // escape
if (this.focusDate){
this.focusDate = null;
this.viewDate = this.dates.get(-1) || this.viewDate;
this.fill();
}
else
this.hide();
e.preventDefault();
break;
case 37: // left
case 39: // right
if (!this.o.keyboardNavigation)
break;
dir = e.keyCode === 37 ? -1 : 1;
if (e.ctrlKey){
newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
newViewDate = this.moveYear(focusDate, dir);
this._trigger('changeYear', this.viewDate);
}
else if (e.shiftKey){
newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
newViewDate = this.moveMonth(focusDate, dir);
this._trigger('changeMonth', this.viewDate);
}
else {
newDate = new Date(this.dates.get(-1) || UTCToday());
newDate.setUTCDate(newDate.getUTCDate() + dir);
newViewDate = new Date(focusDate);
newViewDate.setUTCDate(focusDate.getUTCDate() + dir);
}
if (this.dateWithinRange(newDate)){
this.focusDate = this.viewDate = newViewDate;
this.setValue();
this.fill();
e.preventDefault();
}
break;
case 38: // up
case 40: // down
if (!this.o.keyboardNavigation)
break;
dir = e.keyCode === 38 ? -1 : 1;
if (e.ctrlKey){
newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
newViewDate = this.moveYear(focusDate, dir);
this._trigger('changeYear', this.viewDate);
}
else if (e.shiftKey){
newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
newViewDate = this.moveMonth(focusDate, dir);
this._trigger('changeMonth', this.viewDate);
}
else {
newDate = new Date(this.dates.get(-1) || UTCToday());
newDate.setUTCDate(newDate.getUTCDate() + dir * 7);
newViewDate = new Date(focusDate);
newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7);
}
if (this.dateWithinRange(newDate)){
this.focusDate = this.viewDate = newViewDate;
this.setValue();
this.fill();
e.preventDefault();
}
break;
case 32: // spacebar
// Spacebar is used in manually typing dates in some formats.
// As such, its behavior should not be hijacked.
break;
case 13: // enter
focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;
if (this.o.keyboardNavigation) {
this._toggle_multidate(focusDate);
dateChanged = true;
}
this.focusDate = null;
this.viewDate = this.dates.get(-1) || this.viewDate;
this.setValue();
this.fill();
if (this.picker.is(':visible')){
e.preventDefault();
if (this.o.autoclose)
this.hide();
}
break;
case 9: // tab
this.focusDate = null;
this.viewDate = this.dates.get(-1) || this.viewDate;
this.fill();
this.hide();
break;
}
if (dateChanged){
if (this.dates.length)
this._trigger('changeDate');
else
this._trigger('clearDate');
var element;
if (this.isInput){
element = this.element;
}
else if (this.component){
element = this.element.find('input');
}
if (element){
element.change();
}
}
},
showMode: function(dir){
if (dir){
this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir));
}
this.picker
.find('>div')
.hide()
.filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName)
.css('display', 'block');
this.updateNavArrows();
}
};
var DateRangePicker = function(element, options){
this.element = $(element);
this.inputs = $.map(options.inputs, function(i){
return i.jquery ? i[0] : i;
});
delete options.inputs;
$(this.inputs)
.datepicker(options)
.bind('changeDate', $.proxy(this.dateUpdated, this));
this.pickers = $.map(this.inputs, function(i){
return $(i).data('datepicker');
});
this.updateDates();
};
DateRangePicker.prototype = {
updateDates: function(){
this.dates = $.map(this.pickers, function(i){
return i.getUTCDate();
});
this.updateRanges();
},
updateRanges: function(){
var range = $.map(this.dates, function(d){
return d.valueOf();
});
$.each(this.pickers, function(i, p){
p.setRange(range);
});
},
dateUpdated: function(e){
// `this.updating` is a workaround for preventing infinite recursion
// between `changeDate` triggering and `setUTCDate` calling. Until
// there is a better mechanism.
if (this.updating)
return;
this.updating = true;
var dp = $(e.target).data('datepicker'),
new_date = dp.getUTCDate(),
i = $.inArray(e.target, this.inputs),
l = this.inputs.length;
if (i === -1)
return;
$.each(this.pickers, function(i, p){
if (!p.getUTCDate())
p.setUTCDate(new_date);
});
if (new_date < this.dates[i]){
// Date being moved earlier/left
while (i >= 0 && new_date < this.dates[i]){
this.pickers[i--].setUTCDate(new_date);
}
}
else if (new_date > this.dates[i]){
// Date being moved later/right
while (i < l && new_date > this.dates[i]){
this.pickers[i++].setUTCDate(new_date);
}
}
this.updateDates();
delete this.updating;
},
remove: function(){
$.map(this.pickers, function(p){ p.remove(); });
delete this.element.data().datepicker;
}
};
function opts_from_el(el, prefix){
// Derive options from element data-attrs
var data = $(el).data(),
out = {}, inkey,
replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
prefix = new RegExp('^' + prefix.toLowerCase());
function re_lower(_,a){
return a.toLowerCase();
}
for (var key in data)
if (prefix.test(key)){
inkey = key.replace(replace, re_lower);
out[inkey] = data[key];
}
return out;
}
function opts_from_locale(lang){
// Derive options from locale plugins
var out = {};
// Check if "de-DE" style date is available, if not language should
// fallback to 2 letter code eg "de"
if (!dates[lang]){
lang = lang.split('-')[0];
if (!dates[lang])
return;
}
var d = dates[lang];
$.each(locale_opts, function(i,k){
if (k in d)
out[k] = d[k];
});
return out;
}
var old = $.fn.datepicker;
$.fn.datepicker = function(option){
var args = Array.apply(null, arguments);
args.shift();
var internal_return;
this.each(function(){
var $this = $(this),
data = $this.data('datepicker'),
options = typeof option === 'object' && option;
if (!data){
var elopts = opts_from_el(this, 'date'),
// Preliminary otions
xopts = $.extend({}, defaults, elopts, options),
locopts = opts_from_locale(xopts.language),
// Options priority: js args, data-attrs, locales, defaults
opts = $.extend({}, defaults, locopts, elopts, options);
if ($this.is('.input-daterange') || opts.inputs){
var ropts = {
inputs: opts.inputs || $this.find('input').toArray()
};
$this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));
}
else {
$this.data('datepicker', (data = new Datepicker(this, opts)));
}
}
if (typeof option === 'string' && typeof data[option] === 'function'){
internal_return = data[option].apply(data, args);
if (internal_return !== undefined)
return false;
}
});
if (internal_return !== undefined)
return internal_return;
else
return this;
};
var defaults = $.fn.datepicker.defaults = {
autoclose: false,
beforeShowDay: $.noop,
calendarWeeks: false,
clearBtn: false,
daysOfWeekDisabled: [],
endDate: Infinity,
forceParse: true,
format: 'dd/mm/yyyy',
keyboardNavigation: true,
language: 'en',
minViewMode: 0,
multidate: false,
multidateSeparator: ',',
orientation: "auto",
rtl: false,
startDate: -Infinity,
startView: 0,
todayBtn: false,
todayHighlight: false,
weekStart: 0
};
var locale_opts = $.fn.datepicker.locale_opts = [
'format',
'rtl',
'weekStart'
];
$.fn.datepicker.Constructor = Datepicker;
var dates = $.fn.datepicker.dates = {
en: {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: "Today",
clear: "Clear"
}
};
var DPGlobal = {
modes: [
{
clsName: 'days',
navFnc: 'Month',
navStep: 1
},
{
clsName: 'months',
navFnc: 'FullYear',
navStep: 1
},
{
clsName: 'years',
navFnc: 'FullYear',
navStep: 10
}],
isLeapYear: function(year){
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
},
getDaysInMonth: function(year, month){
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
},
validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
parseFormat: function(format){
// IE treats \0 as a string end in inputs (truncating the value),
// so it's a bad format delimiter, anyway
var separators = format.replace(this.validParts, '\0').split('\0'),
parts = format.match(this.validParts);
if (!separators || !separators.length || !parts || parts.length === 0){
throw new Error("Invalid date format.");
}
return {separators: separators, parts: parts};
},
parseDate: function(date, format, language){
if (!date)
return undefined;
if (date instanceof Date)
return date;
if (typeof format === 'string')
format = DPGlobal.parseFormat(format);
var part_re = /([\-+]\d+)([dmwy])/,
parts = date.match(/([\-+]\d+)([dmwy])/g),
part, dir, i;
if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){
date = new Date();
for (i=0; i < parts.length; i++){
part = part_re.exec(parts[i]);
dir = parseInt(part[1]);
switch (part[2]){
case 'd':
date.setUTCDate(date.getUTCDate() + dir);
break;
case 'm':
date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
break;
case 'w':
date.setUTCDate(date.getUTCDate() + dir * 7);
break;
case 'y':
date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
break;
}
}
return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
}
parts = date && date.match(this.nonpunctuation) || [];
date = new Date();
var parsed = {},
setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
setters_map = {
yyyy: function(d,v){
return d.setUTCFullYear(v);
},
yy: function(d,v){
return d.setUTCFullYear(2000+v);
},
m: function(d,v){
if (isNaN(d))
return d;
v -= 1;
while (v < 0) v += 12;
v %= 12;
d.setUTCMonth(v);
while (d.getUTCMonth() !== v)
d.setUTCDate(d.getUTCDate()-1);
return d;
},
d: function(d,v){
return d.setUTCDate(v);
}
},
val, filtered;
setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
setters_map['dd'] = setters_map['d'];
date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var fparts = format.parts.slice();
// Remove noop parts
if (parts.length !== fparts.length){
fparts = $(fparts).filter(function(i,p){
return $.inArray(p, setters_order) !== -1;
}).toArray();
}
// Process remainder
function match_part(){
var m = this.slice(0, parts[i].length),
p = parts[i].slice(0, m.length);
return m === p;
}
if (parts.length === fparts.length){
var cnt;
for (i=0, cnt = fparts.length; i < cnt; i++){
val = parseInt(parts[i], 10);
part = fparts[i];
if (isNaN(val)){
switch (part){
case 'MM':
filtered = $(dates[language].months).filter(match_part);
val = $.inArray(filtered[0], dates[language].months) + 1;
break;
case 'M':
filtered = $(dates[language].monthsShort).filter(match_part);
val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
break;
}
}
parsed[part] = val;
}
var _date, s;
for (i=0; i < setters_order.length; i++){
s = setters_order[i];
if (s in parsed && !isNaN(parsed[s])){
_date = new Date(date);
setters_map[s](_date, parsed[s]);
if (!isNaN(_date))
date = _date;
}
}
}
return date;
},
formatDate: function(date, format, language){
if (!date)
return '';
if (typeof format === 'string')
format = DPGlobal.parseFormat(format);
var val = {
d: date.getUTCDate(),
D: dates[language].daysShort[date.getUTCDay()],
DD: dates[language].days[date.getUTCDay()],
m: date.getUTCMonth() + 1,
M: dates[language].monthsShort[date.getUTCMonth()],
MM: dates[language].months[date.getUTCMonth()],
yy: date.getUTCFullYear().toString().substring(2),
yyyy: date.getUTCFullYear()
};
val.dd = (val.d < 10 ? '0' : '') + val.d;
val.mm = (val.m < 10 ? '0' : '') + val.m;
date = [];
var seps = $.extend([], format.separators);
for (var i=0, cnt = format.parts.length; i <= cnt; i++){
if (seps.length)
date.push(seps.shift());
date.push(val[format.parts[i]]);
}
return date.join('');
},
headTemplate: '<thead>'+
'<tr>'+
'<th class="prev">«</th>'+
'<th colspan="5" class="datepicker-switch"></th>'+
'<th class="next">»</th>'+
'</tr>'+
'</thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
footTemplate: '<tfoot>'+
'<tr>'+
'<th colspan="7" class="today"></th>'+
'</tr>'+
'<tr>'+
'<th colspan="7" class="clear"></th>'+
'</tr>'+
'</tfoot>'
};
DPGlobal.template = '<div class="datepicker">'+
'<div class="datepicker-days">'+
'<table class=" table-condensed">'+
DPGlobal.headTemplate+
'<tbody></tbody>'+
DPGlobal.footTemplate+
'</table>'+
'</div>'+
'<div class="datepicker-months">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
DPGlobal.footTemplate+
'</table>'+
'</div>'+
'<div class="datepicker-years">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
DPGlobal.footTemplate+
'</table>'+
'</div>'+
'</div>';
$.fn.datepicker.DPGlobal = DPGlobal;
/* DATEPICKER NO CONFLICT
* =================== */
$.fn.datepicker.noConflict = function(){
$.fn.datepicker = old;
return this;
};
/* DATEPICKER DATA-API
* ================== */
$(document).on(
'focus.datepicker.data-api click.datepicker.data-api',
'[data-provide="datepicker"]',
function(e){
var $this = $(this);
if ($this.data('datepicker'))
return;
e.preventDefault();
// component click requires us to explicitly show it
$this.datepicker('show');
}
);
$(function(){
$('[data-provide="datepicker-inline"]').datepicker();
});
}(window.jQuery));
| travelex-dev/discrepancy | discrepancy-dev/public/assets/js/libs/bootstrap-datepicker/bootstrap-datepicker.js | JavaScript | mit | 47,205 |
<?php
class Contacts extends CI_Controller
{
public function __construct()
{
parent::__construct();
//check hei or ro
$this->session;
$utype = $this->session->userdata('usertype');
if($utype=='Encoder'){
redirect('login');
}
$this->load->model('contacts_model');
$this->data = array(
'title' => 'Contacts Directory',
'heiclass' => '',
'heilist' => '',
'programlist' => '',
'deanslist' => '',
'programapplication' => '',
'accounts' => '',
'contacts' => 'active',
'permits' => '',
'scholarship' => '',
'scholarslist' => '',
'accreditedhei' => '',
'scholarshipapplicant' => '',
'paymentlist' => '',
'settingsclass' => '',
'voucherlist' => '',
'breadcrumb' =>array('bc'=>"Contact Directory")
);
$this->js = array(
'jsfile' => 'contacts.js'
);
}
public function index()
{
$data = $this->data;
$js = $this->js;
$data['page'] = "index";
$data['details'] =array('instname'=>"Contact Directory") ;
$data['contact_list'] = $this->contacts_model->get();
$data['hei_list'] = $this->contacts_model->gethei();
$data['account_list'] = $this->contacts_model->getaccount();
//print_r($data['details']);
$this->load->view('inc/header_view');
$this->load->view('heidirectory/contacts_view',$data);
$this->load->view('inc/footer_view',$js);
}
public function institution($instcode){
$data = $this->data;
$js = $this->js;
$data['page'] = "institution";
$data['details'] = $this->heidirectory_model->getinstname($instcode)->row();
//if($data['details']->result=='0'){
//echo 'none';
//}else{
$data['programs'] = $this->heidirectory_model->getprograms($instcode);
$data['deans'] = $this->heidirectory_model->getdeans($instcode);
$data['formernames'] = $this->heidirectory_model->getformernames($instcode);
//$data['subnavtitle'] = $data['instname'];
//$data['heidirectory'] = $result->result();
$this->load->view('inc/header_view');
$this->load->view('heidirectory/heidirectorydetails_view',$data);
$this->load->view('heidirectory/mapheader_view');
$this->load->view('inc/footer_view',$js);
//print_r($data);
//}
}
public function editcontact(){
$contactid = $this->input->post('contactid');
$contact_details = $this->contacts_model->editcontact($contactid);
echo json_encode($contact_details[0]);
}
public function updatesinglecontact(){
$contactid = $this->input->post('contactid');
$instcode = $this->input->post('instcode');
$accountid = $this->input->post('accountid');
$contactname = $this->input->post('contactname');
$email = $this->input->post('email');
$telno = $this->input->post('telno');
$address = $this->input->post('address');
$position = $this->input->post('position');
$fax = $this->input->post('fax');
$website = $this->input->post('website');
$this->contacts_model->updatesinglecontact($contactid,$instcode,$accountid,$contactname,$email,$telno,$address,$position,$fax,$website);
}
//save contact from Contacts Menu
public function savesinglecontact(){
$instcode = $this->input->post('instcode');
$accountid = $this->input->post('accountid');
$contactname = $this->input->post('contactname');
$email = $this->input->post('email');
$telno = $this->input->post('telno');
$address = $this->input->post('address');
$position = $this->input->post('position');
$fax = $this->input->post('fax');
$website = $this->input->post('website');
$this->contacts_model->savesinglecontact($instcode,$accountid,$contactname,$email,$telno,$address,$position,$fax,$website);
}
public function deletecontact($contactid){
$this->contacts_model->deletecontact($contactid);
}
} | elvincasem/crm_ch | application/controllers/contacts.php | PHP | mit | 3,790 |
define( [ 'angular' ] , function( angular ){
return angular.module( 'filters' , [] );
}); | michalgraczyk/calculus | web/js/baranek/app/scripts/filters/filters.js | JavaScript | mit | 99 |
/**
* iPac
* @authors Jack.Chan ([email protected])
* @date 2015-05-05 12:33:22
* @update 2015-05-14 16:32:28
* @version 1.2
*/
/*
function FindProxyForURL(url, host){
var d = 'DIRECT';
if(shExpMatch(host, '10.[0-9]+.[0-9]+.[0-9]+')) return d;
if(shExpMatch(host, '172.[0-9]+.[0-9]+.[0-9]+')) return d;
if(shExpMatch(host, '192.168.[0-9]+.[0-9]+')) return d;
if(shExpMatch(host, '127.0.0.1')) return d;
if(shExpMatch(host, 'localhost')) return d;
}
*/
chrome.browserAction.setPopup({
popup:'popup.html'
});
window.iPac = {};
iPac.mode = 'system';
iPac.data = {
pac_url: '',
pac_script: ''
};
iPac.db = {
get: function(k){
return localStorage.getItem(k);
},
set: function(k, v){
localStorage.setItem(k, v);
},
remove: function(k){
localStorage.removeItem(k);
},
clear: function(){
localStorage.clear();
}
};
iPac.setIcon = function(mode){
chrome.browserAction.setIcon({
path:{
'19': 'images/s28/ipac_'+ mode +'-s28.png',
'38': 'images/s38/ipac_'+ mode +'-s38.png'
}
});
};
iPac.refresh = function(){
chrome.tabs.getSelected(null, function(tab){
chrome.tabs.reload(tab.id);
});
};
iPac.clear = function(){
chrome.proxy.settings.clear({});
};
iPac.setPac = function(pac){
};
iPac.switch = function(mode, data){
mode = mode || this.mode;
data = data || '';
console.log('switch');
console.log('mode:'+ mode);
console.log('data:');
console.log(data);
this.setIcon(mode);
this.mode = mode;
this.db.set('mode', mode);
var config = {
mode: (mode=='pac_url') ? 'pac_script' : mode
};
switch(mode){
case 'pac_url':
this.data.pac_url = data || this.data.pac_url;
this.db.set(mode, this.data.pac_url);
config.pacScript = {url: this.data.pac_url};
break;
case 'pac_script':
this.data.pac_script = data || this.data.pac_script;
this.db.set(mode, this.data.pac_script);
config.pacScript = {data: this.data.pac_script};
break;
default:
break;
};
chrome.proxy.settings.set(
{
value: config,
scope: 'regular'
},
function(msg){
if(msg)console.log(msg);
}
);
};
iPac.init = function(){
console.clear();
console.log('init');
this.mode = this.db.get('mode') || this.mode;
this.data.pac_url = this.db.get('pac_url');
this.data.pac_script = this.db.get('pac_script');
if(this.mode=='pac_url' && !this.data.pac_url)this.mode = 'system';
if(this.mode=='pac_script' && !this.data.pac_script)this.mode = 'system';
this.switch();
};
iPac.init();
| fulicat/iPac | src/bg.js | JavaScript | mit | 2,581 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Reflection;
namespace DDCloud.Platform.WebApi
{
/// <summary>
/// Extension methods for <see cref="HttpRequestBuilder"/>.
/// </summary>
public static class RequestBuilderExtensions
{
/// <summary>
/// Build and configure a new HTTP request message.
/// </summary>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="method">
/// The HTTP request method to use.
/// </param>
/// <param name="requestBody">
/// An optional object representing representing the request body.
/// </param>
/// <param name="mediaType">
/// The request body's media type.
///
/// Required if <paramref name="requestBody"/> is not <c>null</c>.
/// </param>
/// <param name="baseUri">
/// An optional base URI to use if the request builder does not already have an absolute request URI.
/// </param>
/// <returns>
/// The configured <see cref="HttpRequestMessage"/>.
/// </returns>
public static HttpRequestMessage BuildRequestMessage(this IHttpRequestBuilder requestBuilder, HttpMethod method, object requestBody, string mediaType, Uri baseUri = null)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (method == null)
throw new ArgumentNullException("method");
HttpContent requestContent = null;
try
{
if (requestBody != null)
{
if (String.IsNullOrWhiteSpace(mediaType))
throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'contentType'.", "mediaType");
MediaTypeFormatter mediaTypeFormatter = requestBuilder.GetMediaTypeFormatter(mediaType);
if (mediaTypeFormatter == null)
{
throw new InvalidOperationException(
String.Format(
"None of the configured media-type formatters can handle content of type '{0}'.",
mediaType
)
);
}
requestContent = new ObjectContent(
requestBody.GetType(),
requestBody,
mediaTypeFormatter,
mediaType
);
}
return requestBuilder.BuildRequestMessage(method, requestContent, baseUri);
}
catch
{
using (requestContent)
{
throw;
}
}
}
/// <summary>
/// Build and configure a new HTTP request message.
/// </summary>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="method">
/// The HTTP request method to use.
/// </param>
/// <param name="body">
/// Optional <see cref="HttpContent"/> representing representing the request body.
/// </param>
/// <param name="baseUri">
/// An optional base URI to use if the request builder does not already have an absolute request URI.
/// </param>
/// <returns>
/// The configured <see cref="HttpRequestMessage"/>.
/// </returns>
public static HttpRequestMessage BuildRequestMessage(this IHttpRequestBuilder<Unit> requestBuilder, HttpMethod method, HttpContent body = null, Uri baseUri = null)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (method == null)
throw new ArgumentNullException("method");
return requestBuilder.BuildRequestMessage(method, Unit.Value, body, baseUri);
}
#region Configuration
/// <summary>
/// Create a copy of the request builder, but with the specified request-configuration action.
/// </summary>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="requestConfiguration">
/// A delegate that configures outgoing request messages.
/// </param>
/// <returns>
/// The new HTTP request builder.
/// </returns>
public static HttpRequestBuilder<Unit> WithRequestConfiguration(this HttpRequestBuilder<Unit> requestBuilder, Action<HttpRequestMessage> requestConfiguration)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (requestConfiguration == null)
throw new ArgumentNullException("requestConfiguration");
return requestBuilder.WithRequestConfiguration(
(request, _) => requestConfiguration(request)
);
}
/// <summary>
/// Create a copy of the request builder that adds a header to each request.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="headerName">
/// The header name.
/// </param>
/// <param name="headerValue">
/// The header value.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithHeader<TContext>(this HttpRequestBuilder<TContext> requestBuilder, string headerName, string headerValue)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (String.IsNullOrWhiteSpace(headerName))
throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'name'.", "headerName");
if (headerValue == null)
throw new ArgumentNullException("headerValue");
return requestBuilder.WithHeader(
headerName,
context => headerValue
);
}
/// <summary>
/// Create a copy of the request builder that adds a header with its value obtained from the specified delegate.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="headerName">
/// The header name.
/// </param>
/// <param name="getValue">
/// A delegate that returns the header value for each request.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithHeader<TContext>(this HttpRequestBuilder<TContext> requestBuilder, string headerName, Func<string> getValue)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (String.IsNullOrWhiteSpace(headerName))
throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'name'.", "headerName");
if (getValue == null)
throw new ArgumentNullException("getValue");
return requestBuilder.WithHeader(
headerName,
context => getValue()
);
}
/// <summary>
/// Create a copy of the request builder that adds a header with its value obtained from the specified delegate.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="headerName">
/// The header name.
/// </param>
/// <param name="getValue">
/// A delegate that returns the header value for each request.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithHeader<TContext>(this HttpRequestBuilder<TContext> requestBuilder, string headerName, Func<TContext, string> getValue)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (String.IsNullOrWhiteSpace(headerName))
throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'name'.", "headerName");
if (getValue == null)
throw new ArgumentNullException("getValue");
return requestBuilder.WithRequestConfiguration(
(request, context) =>
{
request.Headers.Remove(headerName);
string headerValue = getValue(context);
if (headerValue == null)
return;
request.Headers.Add(headerName, headerValue);
}
);
}
/// <summary>
/// Create a copy of the request builder with the specified request URI template parameter.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <typeparam name="T">
/// The parameter data-type.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="name">
/// The parameter name.
/// </param>
/// <param name="value">
/// The parameter value.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithTemplateParameter<TContext, T>(this HttpRequestBuilder<TContext> requestBuilder, string name, T value)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (String.IsNullOrWhiteSpace(name))
throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'name'.", "name");
return requestBuilder.WithTemplateParameter(
name,
getValue: context => value
);
}
/// <summary>
/// Create a copy of the request builder, but with the specified template parameters.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <typeparam name="TParameters">
/// The type whose public properties are used as template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="parameters">
/// An object whose properties are used as template parameters.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithTemplateParameters<TContext, TParameters>(this HttpRequestBuilder<TContext> requestBuilder, TParameters parameters)
where TParameters : class
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (parameters == null)
throw new ArgumentNullException("parameters");
IDictionary<string, Func<TContext, string>> templateParameters = parameters.ToDeferredParameterDictionary<TContext, TParameters>();
return requestBuilder.WithTemplateParameters(templateParameters);
}
/// <summary>
/// Create a copy of the request builder that is configured to expect JSON responses.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="onlyJson">
/// Only expect JSON?
///
/// If <c>true</c>, all other Accept header values will be removed.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> ExpectJson<TContext>(this HttpRequestBuilder<TContext> requestBuilder, bool onlyJson = false)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
return requestBuilder.WithRequestConfiguration(
(request, context) =>
{
if (request.Headers.Accept.Any(accept => accept.MediaType == "application/json"))
return;
if (onlyJson)
request.Headers.Accept.Clear();
request.Headers.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json")
);
}
);
}
/// <summary>
/// Create a copy of the request builder that is configured to expect XML responses.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="onlyXml">
/// Only expect XML?
///
/// If <c>true</c>, all other Accept header values will be removed.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> ExpectXml<TContext>(this HttpRequestBuilder<TContext> requestBuilder, bool onlyXml = false)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
return requestBuilder.WithRequestConfiguration(
(request, context) =>
{
if (request.Headers.Accept.Any(accept => accept.MediaType == "text/xml"))
return;
if (onlyXml)
request.Headers.Accept.Clear();
request.Headers.Accept.Add(
new MediaTypeWithQualityHeaderValue("text/xml")
);
}
);
}
/// <summary>
/// Create a copy of the request builder that is configured to use JSON for requests and responses.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="jsonFormatter">
/// An optional JSON media-type formatter to use.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> UseJson<TContext>(this HttpRequestBuilder<TContext> requestBuilder, JsonMediaTypeFormatter jsonFormatter = null)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (jsonFormatter == null)
jsonFormatter = HttpRequestBuilder.DefaultMediaTypeFormatterFactories.Json();
if (jsonFormatter == null)
throw new InvalidOperationException("DefaultMediaTypeFormatterFactories.Json returned null.");
return
requestBuilder
.WithMediaTypeFormatters(jsonFormatter)
.ExpectJson(onlyJson: true);
}
/// <summary>
/// Create a copy of the request builder that is configured to use XML for requests and responses.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="xmlFormatter">
/// An optional XML media-type formatter to use.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> UseXml<TContext>(this HttpRequestBuilder<TContext> requestBuilder, XmlMediaTypeFormatter xmlFormatter = null)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (xmlFormatter == null)
xmlFormatter = HttpRequestBuilder.DefaultMediaTypeFormatterFactories.Xml();
if (xmlFormatter == null)
throw new InvalidOperationException("DefaultMediaTypeFormatterFactories.Xml returned null.");
return
requestBuilder
.WithMediaTypeFormatters(xmlFormatter)
.ExpectXml(onlyXml: true);
}
/// <summary>
/// Create a copy of the request builder with the specified query parameter.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <typeparam name="T">
/// The parameter value type.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="name">
/// The query parameter name.
/// </param>
/// <param name="value">
/// The query parameter value.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithQueryParameter<TContext, T>(this HttpRequestBuilder<TContext> requestBuilder, string name, T value)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (String.IsNullOrWhiteSpace(name))
throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'name'.", "name");
string parameterValue = value != null ? value.ToString() : null;
return requestBuilder.WithQueryParameter(
name,
getValue: () => parameterValue
);
}
/// <summary>
/// Create a copy of the request builder, but with the specified query parameters.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <typeparam name="TParameters">
/// The type whose public properties are used as query parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="parameters">
/// An object whose properties are used as query parameters.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithQueryParameters<TContext, TParameters>(this HttpRequestBuilder<TContext> requestBuilder, TParameters parameters)
where TParameters : class
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (parameters == null)
throw new ArgumentNullException("parameters");
IDictionary<string, Func<TContext, string>> queryParameters = parameters.ToDeferredParameterDictionary<TContext, TParameters>();
return requestBuilder.WithQueryParameters(queryParameters);
}
/// <summary>
/// Create a copy of the request builder, but with the default media-type formatters.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithDefaultMediaTypeFormatters<TContext>(this HttpRequestBuilder<TContext> requestBuilder)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
return requestBuilder.WithMediaTypeFormatters(
HttpRequestBuilder.DefaultMediaTypeFormatterFactories.All.Select(
mediaTypeFormatterFactory => mediaTypeFormatterFactory()
)
);
}
/// <summary>
/// Create a copy of the request builder, but with no media-type formatters.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithNoMediaTypeFormatters<TContext>(this HttpRequestBuilder<TContext> requestBuilder)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
return requestBuilder.WithMediaTypeFormatters(
Enumerable.Empty<MediaTypeFormatter>()
);
}
/// <summary>
/// Create a copy of the request builder, but with the specified media-type formatters.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="mediaTypeFormatters">
/// The media-type formatters to use.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithMediaTypeFormatters<TContext>(this HttpRequestBuilder<TContext> requestBuilder, params MediaTypeFormatter[] mediaTypeFormatters)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (mediaTypeFormatters == null)
throw new ArgumentNullException("mediaTypeFormatters");
return requestBuilder.WithMediaTypeFormatters(mediaTypeFormatters);
}
/// <summary>
/// Create a copy of the request builder, but with the specified media-type formatters appended to its existing list of media-type formatters.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="mediaTypeFormatters">
/// The media-type formatters to use.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithAdditionalMediaTypeFormatters<TContext>(this HttpRequestBuilder<TContext> requestBuilder, params MediaTypeFormatter[] mediaTypeFormatters)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (mediaTypeFormatters == null)
throw new ArgumentNullException("mediaTypeFormatters");
return requestBuilder.WithAdditionalMediaTypeFormatters(mediaTypeFormatters);
}
/// <summary>
/// Create a copy of the request builder, but without the specified media-type formatters.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="mediaTypeFormatters">
/// The media-type formatters to remove.
/// </param>
/// <returns>
/// The new <see cref="HttpRequestBuilder{TContext}"/>.
/// </returns>
public static HttpRequestBuilder<TContext> WithoutMediaTypeFormatters<TContext>(this HttpRequestBuilder<TContext> requestBuilder, params MediaTypeFormatter[] mediaTypeFormatters)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (mediaTypeFormatters == null)
throw new ArgumentNullException("mediaTypeFormatters");
return requestBuilder.WithoutMediaTypeFormatters(mediaTypeFormatters);
}
#endregion // Configuration
#region Media type formatters
/// <summary>
/// Get the first media-type formatter that can handle the specified media type.
/// </summary>
/// <param name="requestBuilder">
/// The HTTP request builder.
/// </param>
/// <param name="mediaType">
/// The media type to match.
/// </param>
/// <returns>
/// The media-type formatter, or <c>null</c> if none of the request builder's configured media-type formatters can handle the specified media type.
/// </returns>
public static MediaTypeFormatter GetMediaTypeFormatter(this IHttpRequestBuilder requestBuilder, string mediaType)
{
if (requestBuilder == null)
throw new ArgumentNullException("requestBuilder");
if (String.IsNullOrWhiteSpace(mediaType))
throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'mediaType'.", "mediaType");
return requestBuilder.MediaTypeFormatters.FirstOrDefault(
formatter => formatter.MediaTypeMappings.Any(
mapping => mapping.MediaType.MediaType == mediaType
)
);
}
#endregion // Media type formatters
#region Helpers
/// <summary>
/// Convert the specified object to a deferred parameter dictionary.
/// </summary>
/// <typeparam name="TContext">
/// The type of object used by the request builder when resolving deferred template parameters.
/// </typeparam>
/// <typeparam name="TParameters">
/// The type of object whose properties will form the parameters.
/// </typeparam>
/// <param name="parameters">
/// The object whose properties will form the parameters.
/// </param>
/// <returns>
/// The returned dictionary is case-insensitive.
/// </returns>
static IDictionary<string, Func<TContext, string>> ToDeferredParameterDictionary<TContext, TParameters>(this TParameters parameters)
{
if (parameters == null)
throw new ArgumentNullException("parameters");
Dictionary<string, Func<TContext, string>> parameterDictionary = new Dictionary<string, Func<TContext, string>>(StringComparer.OrdinalIgnoreCase);
foreach (PropertyInfo property in typeof(TParameters).GetProperties(BindingFlags.Instance | BindingFlags.Public))
{
// Ignore write-only properties.
if (!property.CanRead)
continue;
parameterDictionary[property.Name] = context =>
{
object value = property.GetValue(parameters);
return value != null ? value.ToString() : null;
};
}
return parameterDictionary;
}
#endregion // Helpers
}
}
| DDCloud/DDCloud.Platform.WebAPI | Platform.WebApi/RequestBuilderExtensions.cs | C# | mit | 25,763 |
//---------------------------------------------------------------------------
// HEADER FILES:
//---------------------------------------------------------------------------
#include "UnitTest.h"
#include "MathEngine.h"
#define eq Util::isEqual
#define MATH_TOLERANCE 0.0001f
//---------------------------------------------------------------------------
// TESTS:
//---------------------------------------------------------------------------
TEST( Matrix_SET_Identity, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 17.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
A.set(IDENTITY);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 0.0f );
CHECK( A[m2] == 0.0f );
CHECK( A[m3] == 0.0f );
CHECK( A[m4] == 0.0f );
CHECK( A[m5] == 1.0f );
CHECK( A[m6] == 0.0f );
CHECK( A[m7] == 0.0f );
CHECK( A[m8] == 0.0f );
CHECK( A[m9] == 0.0f );
CHECK( A[m10] == 1.0f );
CHECK( A[m11] == 0.0f );
CHECK( A[m12] == 0.0f );
CHECK( A[m13] == 0.0f );
CHECK( A[m14] == 0.0f );
CHECK( A[m15] == 1.0f );
}
TEST( Matrix_SET_Zero, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 17.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
A.set(ZERO);
CHECK( A[m0] == 0.0f );
CHECK( A[m1] == 0.0f );
CHECK( A[m2] == 0.0f );
CHECK( A[m3] == 0.0f );
CHECK( A[m4] == 0.0f );
CHECK( A[m5] == 0.0f );
CHECK( A[m6] == 0.0f );
CHECK( A[m7] == 0.0f );
CHECK( A[m8] == 0.0f );
CHECK( A[m9] == 0.0f );
CHECK( A[m10] == 0.0f );
CHECK( A[m11] == 0.0f );
CHECK( A[m12] == 0.0f );
CHECK( A[m13] == 0.0f );
CHECK( A[m14] == 0.0f );
CHECK( A[m15] == 0.0f );
}
TEST( Matrix_SET_Trans_vect, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 17.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect transVect( 2.0f, 3.0f, 4.0f);
A.set(TRANS, transVect );
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 0.0f );
CHECK( A[m2] == 0.0f );
CHECK( A[m3] == 0.0f );
CHECK( A[m4] == 0.0f );
CHECK( A[m5] == 1.0f );
CHECK( A[m6] == 0.0f );
CHECK( A[m7] == 0.0f );
CHECK( A[m8] == 0.0f );
CHECK( A[m9] == 0.0f );
CHECK( A[m10] == 1.0f );
CHECK( A[m11] == 0.0f );
CHECK( A[m12] == 2.0f );
CHECK( A[m13] == 3.0f );
CHECK( A[m14] == 4.0f );
CHECK( A[m15] == 1.0f );
}
TEST( Matrix_SET_Trans, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 17.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
A.set(TRANS, 2.0f, 3.0f, 4.0f);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 0.0f );
CHECK( A[m2] == 0.0f );
CHECK( A[m3] == 0.0f );
CHECK( A[m4] == 0.0f );
CHECK( A[m5] == 1.0f );
CHECK( A[m6] == 0.0f );
CHECK( A[m7] == 0.0f );
CHECK( A[m8] == 0.0f );
CHECK( A[m9] == 0.0f );
CHECK( A[m10] == 1.0f );
CHECK( A[m11] == 0.0f );
CHECK( A[m12] == 2.0f );
CHECK( A[m13] == 3.0f );
CHECK( A[m14] == 4.0f );
CHECK( A[m15] == 1.0f );
}
TEST( Matrix_SET_SCALE_vect, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 17.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect scaleVect( 2.0f, 3.0f, 4.0f);
A.set(SCALE, scaleVect);
CHECK( A[m0] == 2.0f );
CHECK( A[m1] == 0.0f );
CHECK( A[m2] == 0.0f );
CHECK( A[m3] == 0.0f );
CHECK( A[m4] == 0.0f );
CHECK( A[m5] == 3.0f );
CHECK( A[m6] == 0.0f );
CHECK( A[m7] == 0.0f );
CHECK( A[m8] == 0.0f );
CHECK( A[m9] == 0.0f );
CHECK( A[m10] == 4.0f );
CHECK( A[m11] == 0.0f );
CHECK( A[m12] == 0.0f );
CHECK( A[m13] == 0.0f );
CHECK( A[m14] == 0.0f );
CHECK( A[m15] == 1.0f );
}
TEST( Matrix_SET_SCALE, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 17.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
A.set(SCALE, 2.0f, 3.0f, 4.0f);
CHECK( A[m0] == 2.0f );
CHECK( A[m1] == 0.0f );
CHECK( A[m2] == 0.0f );
CHECK( A[m3] == 0.0f );
CHECK( A[m4] == 0.0f );
CHECK( A[m5] == 3.0f );
CHECK( A[m6] == 0.0f );
CHECK( A[m7] == 0.0f );
CHECK( A[m8] == 0.0f );
CHECK( A[m9] == 0.0f );
CHECK( A[m10] == 4.0f );
CHECK( A[m11] == 0.0f );
CHECK( A[m12] == 0.0f );
CHECK( A[m13] == 0.0f );
CHECK( A[m14] == 0.0f );
CHECK( A[m15] == 1.0f );
}
TEST( RotX_SET, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix Rx(V0,V1,V2,V3);
CHECK( Rx[m0] == 17.0f );
CHECK( Rx[m1] == 2.0f );
CHECK( Rx[m2] == 3.0f );
CHECK( Rx[m3] == 4.0f );
CHECK( Rx[m4] == 5.0f );
CHECK( Rx[m5] == 6.0f );
CHECK( Rx[m6] == 7.0f );
CHECK( Rx[m7] == 8.0f );
CHECK( Rx[m8] == 9.0f );
CHECK( Rx[m9] == 10.0f );
CHECK( Rx[m10] == 11.0f );
CHECK( Rx[m11] == 12.0f );
CHECK( Rx[m12] == 13.0f );
CHECK( Rx[m13] == 14.0f );
CHECK( Rx[m14] == 15.0f );
CHECK( Rx[m15] == 16.0f );
// Rot_X Type Constructor:
Rx.set(ROT_X, 1.0471975512f );
CHECK( Rx[m0] == 1.0f );
CHECK( Rx[m1] == 0.0f );
CHECK( Rx[m2] == 0.0f );
CHECK( Rx[m3] == 0.0f );
CHECK( Rx[m4] == 0.0f );
CHECK( eq(Rx[m5], 0.5f, MATH_TOLERANCE) );
CHECK( eq(Rx[m6], 0.866f, MATH_TOLERANCE) );
CHECK( Rx[m7] == 0.0f );
CHECK( Rx[m8] == 0.0f );
CHECK( eq(Rx[m9],-0.866f, MATH_TOLERANCE) );
CHECK( eq(Rx[m10],0.5f , MATH_TOLERANCE) );
CHECK( Rx[m11] == 0.0f );
CHECK( Rx[m12] == 0.0f );
CHECK( Rx[m13] == 0.0f );
CHECK( Rx[m14] == 0.0f );
CHECK( Rx[m15] == 1.0f );
}
TEST( RotY_SET, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix Ry(V0,V1,V2,V3);
CHECK( Ry[m0] == 17.0f );
CHECK( Ry[m1] == 2.0f );
CHECK( Ry[m2] == 3.0f );
CHECK( Ry[m3] == 4.0f );
CHECK( Ry[m4] == 5.0f );
CHECK( Ry[m5] == 6.0f );
CHECK( Ry[m6] == 7.0f );
CHECK( Ry[m7] == 8.0f );
CHECK( Ry[m8] == 9.0f );
CHECK( Ry[m9] == 10.0f );
CHECK( Ry[m10] == 11.0f );
CHECK( Ry[m11] == 12.0f );
CHECK( Ry[m12] == 13.0f );
CHECK( Ry[m13] == 14.0f );
CHECK( Ry[m14] == 15.0f );
CHECK( Ry[m15] == 16.0f );
Ry.set(ROT_Y, 1.0471975512f );
CHECK( eq(Ry[m0],0.5f, MATH_TOLERANCE) );
CHECK( Ry[m1] == 0.0f );
CHECK( eq(Ry[m2],-0.866f,MATH_TOLERANCE) );
CHECK( Ry[m3] == 0.0f );
CHECK( Ry[m4] == 0.0f );
CHECK( Ry[m5] == 1.0f );
CHECK( Ry[m6] == 0.0f );
CHECK( Ry[m7] == 0.0f );
CHECK( eq(Ry[m8],0.866f,MATH_TOLERANCE) );
CHECK( Ry[m9] == 0.0f );
CHECK( eq(Ry[m10],0.5f, MATH_TOLERANCE) );
CHECK( Ry[m11] == 0.0f );
CHECK( Ry[m12] == 0.0f );
CHECK( Ry[m13] == 0.0f );
CHECK( Ry[m14] == 0.0f );
CHECK( Ry[m15] == 1.0f );
}
TEST( RotZ_SET, matrix_tests )
{
Vect V0(17.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix Rz(V0,V1,V2,V3);
CHECK( Rz[m0] == 17.0f );
CHECK( Rz[m1] == 2.0f );
CHECK( Rz[m2] == 3.0f );
CHECK( Rz[m3] == 4.0f );
CHECK( Rz[m4] == 5.0f );
CHECK( Rz[m5] == 6.0f );
CHECK( Rz[m6] == 7.0f );
CHECK( Rz[m7] == 8.0f );
CHECK( Rz[m8] == 9.0f );
CHECK( Rz[m9] == 10.0f );
CHECK( Rz[m10] == 11.0f );
CHECK( Rz[m11] == 12.0f );
CHECK( Rz[m12] == 13.0f );
CHECK( Rz[m13] == 14.0f );
CHECK( Rz[m14] == 15.0f );
CHECK( Rz[m15] == 16.0f );
Rz.set(ROT_Z, 1.0471975512f);
CHECK( eq(Rz[m0],0.5f, MATH_TOLERANCE) );
CHECK( eq(Rz[m1],0.866f,MATH_TOLERANCE) );
CHECK( Rz[m2] == 0.0f );
CHECK( Rz[m3] == 0.0f );
CHECK( eq(Rz[m4],-0.866f,MATH_TOLERANCE) );
CHECK( eq(Rz[m5],0.5f, MATH_TOLERANCE) );
CHECK( Rz[m6] == 0.0f );
CHECK( Rz[m7] == 0.0f );
CHECK( Rz[m8] == 0.0f );
CHECK( Rz[m9] == 0.0f );
CHECK( Rz[m10] == 1.0f );
CHECK( Rz[m11] == 0.0f );
CHECK( Rz[m12] == 0.0f );
CHECK( Rz[m13] == 0.0f );
CHECK( Rz[m14] == 0.0f );
CHECK( Rz[m15] == 1.0f );
}
TEST( set_ROW_0, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
A.set(ROW_0, V);
CHECK( A[m0] == 20.0f );
CHECK( A[m1] == 30.0f );
CHECK( A[m2] == 40.0f );
CHECK( A[m3] == 50.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( set_ROW_1, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
A.set(ROW_1, V);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 20.0f );
CHECK( A[m5] == 30.0f );
CHECK( A[m6] == 40.0f );
CHECK( A[m7] == 50.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( set_ROW_2, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
A.set(ROW_2, V);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 20.0f );
CHECK( A[m9] == 30.0f );
CHECK( A[m10] == 40.0f );
CHECK( A[m11] == 50.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( set_ROW_3, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
A.set(ROW_3, V);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 20.0f );
CHECK( A[m13] == 30.0f );
CHECK( A[m14] == 40.0f );
CHECK( A[m15] == 50.0f );
}
TEST( get_ROW_0, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
V = A.get(ROW_0);
CHECK( V[x] == 1.0f);
CHECK( V[y] == 2.0f);
CHECK( V[z] == 3.0f);
CHECK( V[w] == 4.0f);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( get_ROW_1, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
V = A.get(ROW_1);
CHECK( V[x] == 5.0f);
CHECK( V[y] == 6.0f);
CHECK( V[z] == 7.0f);
CHECK( V[w] == 8.0f);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( get_ROW_2, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
V = A.get(ROW_2);
CHECK( V[x] == 9.0f);
CHECK( V[y] == 10.0f);
CHECK( V[z] == 11.0f);
CHECK( V[w] == 12.0f);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( get_ROW_3, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
Vect V(20.0f, 30.0f, 40.0, 50.0f);
V = A.get(ROW_3);
CHECK( V[x] == 13.0f);
CHECK( V[y] == 14.0f);
CHECK( V[z] == 15.0f);
CHECK( V[w] == 16.0f);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( set_Vectors, matrix_tests )
{
Vect V0(1.0f,2.0f,3.0f,4.0f);
Vect V1(5.0f,6.0f,7.0f,8.0f);
Vect V2(9.0f,10.0f,11.0f,12.0f);
Vect V3(13.0f,14.0f,15.0f,16.0f);
Matrix A(ZERO);
CHECK( A[m0] == 0.0f );
CHECK( A[m1] == 0.0f );
CHECK( A[m2] == 0.0f );
CHECK( A[m3] == 0.0f );
CHECK( A[m4] == 0.0f );
CHECK( A[m5] == 0.0f );
CHECK( A[m6] == 0.0f );
CHECK( A[m7] == 0.0f );
CHECK( A[m8] == 0.0f );
CHECK( A[m9] == 0.0f );
CHECK( A[m10] == 0.0f );
CHECK( A[m11] == 0.0f );
CHECK( A[m12] == 0.0f );
CHECK( A[m13] == 0.0f );
CHECK( A[m14] == 0.0f );
CHECK( A[m15] == 0.0f );
A.set(V0,V1,V2,V3);
CHECK( A[m0] == 1.0f );
CHECK( A[m1] == 2.0f );
CHECK( A[m2] == 3.0f );
CHECK( A[m3] == 4.0f );
CHECK( A[m4] == 5.0f );
CHECK( A[m5] == 6.0f );
CHECK( A[m6] == 7.0f );
CHECK( A[m7] == 8.0f );
CHECK( A[m8] == 9.0f );
CHECK( A[m9] == 10.0f );
CHECK( A[m10] == 11.0f );
CHECK( A[m11] == 12.0f );
CHECK( A[m12] == 13.0f );
CHECK( A[m13] == 14.0f );
CHECK( A[m14] == 15.0f );
CHECK( A[m15] == 16.0f );
}
TEST( RotXYZ_SET, matrix_tests )
{
Matrix Rx;
Matrix Ry;
Matrix Rz;
// Rot_X Type Constructor:
Rx.set( ROT_X, MATH_PI3);
CHECK( Rx[m0] == 1.0f );
CHECK( Rx[m1] == 0.0f );
CHECK( Rx[m2] == 0.0f );
CHECK( Rx[m3] == 0.0f );
CHECK( Rx[m4] == 0.0f );
CHECK( eq(Rx[m5], 0.5f, MATH_TOLERANCE) );
CHECK( eq(Rx[m6], 0.866f, MATH_TOLERANCE) );
CHECK( Rx[m7] == 0.0f );
CHECK( Rx[m8] == 0.0f );
CHECK( eq(Rx[m9],-0.866f, MATH_TOLERANCE) );
CHECK( eq(Rx[m10],0.5f , MATH_TOLERANCE) );
CHECK( Rx[m11] == 0.0f );
CHECK( Rx[m12] == 0.0f );
CHECK( Rx[m13] == 0.0f );
CHECK( Rx[m14] == 0.0f );
CHECK( Rx[m15] == 1.0f );
Ry.set(ROT_Y, MATH_7PI8);
CHECK( eq(Ry[m0],-0.9238f, MATH_TOLERANCE) );
CHECK( Ry[m1] == 0.0f );
CHECK( eq(Ry[m2],-0.3826f,MATH_TOLERANCE) );
CHECK( Ry[m3] == 0.0f );
CHECK( Ry[m4] == 0.0f );
CHECK( Ry[m5] == 1.0f );
CHECK( Ry[m6] == 0.0f );
CHECK( Ry[m7] == 0.0f );
CHECK( eq(Ry[m8],0.3826f,MATH_TOLERANCE) );
CHECK( Ry[m9] == 0.0f );
CHECK( eq(Ry[m10],-0.9238f, MATH_TOLERANCE) );
CHECK( Ry[m11] == 0.0f );
CHECK( Ry[m12] == 0.0f );
CHECK( Ry[m13] == 0.0f );
CHECK( Ry[m14] == 0.0f );
CHECK( Ry[m15] == 1.0f );
Rz.set(ROT_Z, MATH_PI2);
CHECK( eq(Rz[m0],0.0f, MATH_TOLERANCE) );
CHECK( eq(Rz[m1],1.0f, MATH_TOLERANCE) );
CHECK( Rz[m2] == 0.0f );
CHECK( Rz[m3] == 0.0f );
CHECK( eq(Rz[m4],-1.0f, MATH_TOLERANCE) );
CHECK( eq(Rz[m5], 0.0f, MATH_TOLERANCE) );
CHECK( Rz[m6] == 0.0f );
CHECK( Rz[m7] == 0.0f );
CHECK( Rz[m8] == 0.0f );
CHECK( Rz[m9] == 0.0f );
CHECK( Rz[m10] == 1.0f );
CHECK( Rz[m11] == 0.0f );
CHECK( Rz[m12] == 0.0f );
CHECK( Rz[m13] == 0.0f );
CHECK( Rz[m14] == 0.0f );
CHECK( Rz[m15] == 1.0f );
Matrix Rxyz;
Rxyz = Rx * Ry * Rz;
Matrix mTmp;
mTmp.set(ROT_XYZ, MATH_PI3,MATH_7PI8, MATH_PI2);
CHECK( eq( Rxyz[m0], mTmp[m0], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m1], mTmp[m1], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m2], mTmp[m2], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m3], mTmp[m3], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m4], mTmp[m4], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m5], mTmp[m5], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m6], mTmp[m6], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m7], mTmp[m7], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m8], mTmp[m8], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m9], mTmp[m9], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m10], mTmp[m10], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m11], mTmp[m11], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m12], mTmp[m12], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m13], mTmp[m13], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m14], mTmp[m14], MATH_TOLERANCE) );
CHECK( eq( Rxyz[m15], mTmp[m15], MATH_TOLERANCE) );
}
TEST( MatrixRotAxisAngle_set, matrix_tests )
{
// Axis and Angle Type Constructor:
Vect v11( 2.0f, 53.0f, 24.0f);
Matrix m54;
m54.set( ROT_AXIS_ANGLE, v11, MATH_PI3 );
// => Vect v11( 2.0f, 53.0f, 24.0f); \n"););
// => Matrix m54(ROT_AXIS_ANGLE, v11, MATH_PI3 );\n"););
CHECK( eq(m54[m0], 0.5005f, MATH_TOLERANCE) );
CHECK( eq(m54[m1], 0.3726f, MATH_TOLERANCE) );
CHECK( eq(m54[m2],-0.7813f, MATH_TOLERANCE) );
CHECK( m54[m3] == 0.0f );
CHECK( eq(m54[m4],-0.3413f, MATH_TOLERANCE) );
CHECK( eq(m54[m5], 0.9144f, MATH_TOLERANCE) );
CHECK( eq(m54[m6], 0.2174f, MATH_TOLERANCE) );
CHECK( (m54[m7] == 0.0f) );
CHECK( eq(m54[m8], 0.7955f, MATH_TOLERANCE) );
CHECK( eq(m54[m9], 0.1579f, MATH_TOLERANCE) );
CHECK( eq(m54[m10], 0.5849f, MATH_TOLERANCE) );
CHECK( (m54[m11] == 0.0f) );
CHECK( (m54[m12] == 0.0f) );
CHECK( (m54[m13] == 0.0f) );
CHECK( (m54[m14] == 0.0f) );
CHECK( (m54[m15] == 1.0f) );
}
TEST( MatrixRotOrient_set, matrix_tests )
{
// Orientation Type Constructor:
Vect v15( 2.0f, 53.0f, 24.0f);
Vect v16( 0.0f, -24.0f, 53.0f);
Matrix m56;
m56.set(ROT_ORIENT, v15, v16 );
CHECK( eq(m56[m0],-0.9994f, MATH_TOLERANCE) );
CHECK( eq(m56[m1], 0.0313f, MATH_TOLERANCE) );
CHECK( eq(m56[m2], 0.0142f, MATH_TOLERANCE) );
CHECK( (m56[m3] == 0.0f) );
CHECK( eq(m56[m4], 0.0000f, MATH_TOLERANCE) );
CHECK( eq(m56[m5],-0.4125f, MATH_TOLERANCE) );
CHECK( eq(m56[m6], 0.9110f, MATH_TOLERANCE) );
CHECK( (m56[m7] == 0.0f) );
CHECK( eq(m56[m8], 0.0344f, MATH_TOLERANCE) );
CHECK( eq(m56[m9], 0.9104f, MATH_TOLERANCE) );
CHECK( eq(m56[m10], 0.4123f, MATH_TOLERANCE) );
CHECK( (m56[m11] == 0.0f) );
CHECK( (m56[m12] == 0.0f) );
CHECK( (m56[m13] == 0.0f) );
CHECK( (m56[m14] == 0.0f) );
CHECK( (m56[m15] == 1.0f) );
}
TEST( MatrixRotInverseOrient_set,matrix_tests )
{
// Orientation Type Constructor:
Vect v17( 2.0f, 53.0f, 24.0f);
Vect v18( 0.0f, -24.0f, 53.0f);
Matrix m57;
m57.set(ROT_INVERSE_ORIENT, v17, v18 );
CHECK( eq(m57[m0],-0.9994f, MATH_TOLERANCE) );
CHECK( eq(m57[m1], 0.0000f, MATH_TOLERANCE) );
CHECK( eq(m57[m2], 0.0344f, MATH_TOLERANCE) );
CHECK( (m57[m3] == 0.0f) );
CHECK( eq(m57[m4], 0.0313f, MATH_TOLERANCE) );
CHECK( eq(m57[m5],-0.4125f, MATH_TOLERANCE) );
CHECK( eq(m57[m6], 0.9104f, MATH_TOLERANCE) );
CHECK( (m57[m7] == 0.0f) );
CHECK( eq(m57[m8], 0.0142f, MATH_TOLERANCE) );
CHECK( eq(m57[m9], 0.9110f, MATH_TOLERANCE) );
CHECK( eq(m57[m10], 0.4123f, MATH_TOLERANCE) );
CHECK( (m57[m11] == 0.0f) );
CHECK( (m57[m12] == 0.0f) );
CHECK( (m57[m13] == 0.0f) );
CHECK( (m57[m14] == 0.0f) );
CHECK( (m57[m15] == 1.0f) );
}
TEST( MatrixQuaternion_set, matrix_tests )
{
// Quaternion Type Constructor:
Matrix Rxyz1(ROT_XYZ, MATH_PI3, MATH_5PI8, MATH_PI4 );
Quat Qxyz1(Rxyz1);
Matrix Mxyz1;
Mxyz1.set( Qxyz1 );
CHECK( eq(Mxyz1[m0],-0.2705f,MATH_TOLERANCE) );
CHECK( eq(Mxyz1[m1],-0.2705f,MATH_TOLERANCE) );
CHECK( eq(Mxyz1[m2],-0.9238f,MATH_TOLERANCE) );
CHECK( (Mxyz1[m3] == 0.0f) );
CHECK( eq(Mxyz1[m4], 0.2122f,MATH_TOLERANCE) );
CHECK( eq(Mxyz1[m5], 0.9193f,MATH_TOLERANCE) );
CHECK( eq(Mxyz1[m6],-0.3314f,MATH_TOLERANCE) );
CHECK( (Mxyz1[m7] == 0.0f) );
CHECK( eq(Mxyz1[m8], 0.9390f,MATH_TOLERANCE) );
CHECK( eq(Mxyz1[m9],-0.2857f,MATH_TOLERANCE) );
CHECK( eq(Mxyz1[m10],-0.1913f,MATH_TOLERANCE) );
CHECK( (Mxyz1[m11] == 0.0f) );
CHECK( (Mxyz1[m12] == 0.0f) );
CHECK( (Mxyz1[m13] == 0.0f) );
CHECK( (Mxyz1[m14] == 0.0f) );
CHECK( (Mxyz1[m15] == 1.0f) );
} | Norseman055/immaterial-engine | libs/dev/Math/MathEngineTest/Matrix_set.cpp | C++ | mit | 26,519 |
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {AST, AttrAst, Attribute, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, CssSelector, DirectiveAst, Element, ElementAst, EmbeddedTemplateAst, ImplicitReceiver, NAMED_ENTITIES, NgContentAst, Node as HtmlAst, ParseSpan, PropertyRead, ReferenceAst, SelectorMatcher, TagContentType, TemplateAst, TemplateAstVisitor, Text, TextAst, VariableAst, getHtmlTagDefinition, splitNsName, templateVisitAll} from '@angular/compiler';
import {AstResult, AttrInfo, SelectorInfo, TemplateInfo} from './common';
import {getExpressionCompletions, getExpressionScope} from './expressions';
import {attributeNames, elementNames, eventNames, propertyNames} from './html_info';
import {HtmlAstPath} from './html_path';
import {NullTemplateVisitor, TemplateAstChildVisitor, TemplateAstPath} from './template_path';
import {BuiltinType, Completion, Completions, Span, Symbol, SymbolDeclaration, SymbolTable, TemplateSource} from './types';
import {flatten, getSelectors, hasTemplateReference, inSpan, removeSuffix, spanOf, uniqueByName} from './utils';
const TEMPLATE_ATTR_PREFIX = '*';
const hiddenHtmlElements = {
html: true,
script: true,
noscript: true,
base: true,
body: true,
title: true,
head: true,
link: true,
};
export function getTemplateCompletions(templateInfo: TemplateInfo): Completions|undefined {
let result: Completions|undefined = undefined;
let {htmlAst, templateAst, template} = templateInfo;
// The templateNode starts at the delimiter character so we add 1 to skip it.
if (templateInfo.position != null) {
let templatePosition = templateInfo.position - template.span.start;
let path = new HtmlAstPath(htmlAst, templatePosition);
let mostSpecific = path.tail;
if (path.empty || !mostSpecific) {
result = elementCompletions(templateInfo, path);
} else {
let astPosition = templatePosition - mostSpecific.sourceSpan.start.offset;
mostSpecific.visit(
{
visitElement(ast) {
let startTagSpan = spanOf(ast.sourceSpan);
let tagLen = ast.name.length;
if (templatePosition <=
startTagSpan.start + tagLen + 1 /* 1 for the opening angle bracked */) {
// If we are in the tag then return the element completions.
result = elementCompletions(templateInfo, path);
} else if (templatePosition < startTagSpan.end) {
// We are in the attribute section of the element (but not in an attribute).
// Return the attribute completions.
result = attributeCompletions(templateInfo, path);
}
},
visitAttribute(ast) {
if (!ast.valueSpan || !inSpan(templatePosition, spanOf(ast.valueSpan))) {
// We are in the name of an attribute. Show attribute completions.
result = attributeCompletions(templateInfo, path);
} else if (ast.valueSpan && inSpan(templatePosition, spanOf(ast.valueSpan))) {
result = attributeValueCompletions(templateInfo, templatePosition, ast);
}
},
visitText(ast) {
// Check if we are in a entity.
result = entityCompletions(getSourceText(template, spanOf(ast)), astPosition);
if (result) return result;
result = interpolationCompletions(templateInfo, templatePosition);
if (result) return result;
let element = path.first(Element);
if (element) {
let definition = getHtmlTagDefinition(element.name);
if (definition.contentType === TagContentType.PARSABLE_DATA) {
result = voidElementAttributeCompletions(templateInfo, path);
if (!result) {
// If the element can hold content Show element completions.
result = elementCompletions(templateInfo, path);
}
}
} else {
// If no element container, implies parsable data so show elements.
result = voidElementAttributeCompletions(templateInfo, path);
if (!result) {
result = elementCompletions(templateInfo, path);
}
}
},
visitComment(ast) {},
visitExpansion(ast) {},
visitExpansionCase(ast) {}
},
null);
}
}
return result;
}
function attributeCompletions(info: TemplateInfo, path: HtmlAstPath): Completions|undefined {
let item = path.tail instanceof Element ? path.tail : path.parentOf(path.tail);
if (item instanceof Element) {
return attributeCompletionsForElement(info, item.name, item);
}
return undefined;
}
function attributeCompletionsForElement(
info: TemplateInfo, elementName: string, element?: Element): Completions {
const attributes = getAttributeInfosForElement(info, elementName, element);
// Map all the attributes to a completion
return attributes.map<Completion>(attr => ({
kind: attr.fromHtml ? 'html attribute' : 'attribute',
name: nameOfAttr(attr),
sort: attr.name
}));
}
function getAttributeInfosForElement(
info: TemplateInfo, elementName: string, element?: Element): AttrInfo[] {
let attributes: AttrInfo[] = [];
// Add html attributes
let htmlAttributes = attributeNames(elementName) || [];
if (htmlAttributes) {
attributes.push(...htmlAttributes.map<AttrInfo>(name => ({name, fromHtml: true})));
}
// Add html properties
let htmlProperties = propertyNames(elementName);
if (htmlProperties) {
attributes.push(...htmlProperties.map<AttrInfo>(name => ({name, input: true})));
}
// Add html events
let htmlEvents = eventNames(elementName);
if (htmlEvents) {
attributes.push(...htmlEvents.map<AttrInfo>(name => ({name, output: true})));
}
let {selectors, map: selectorMap} = getSelectors(info);
if (selectors && selectors.length) {
// All the attributes that are selectable should be shown.
const applicableSelectors =
selectors.filter(selector => !selector.element || selector.element == elementName);
const selectorAndAttributeNames =
applicableSelectors.map(selector => ({selector, attrs: selector.attrs.filter(a => !!a)}));
let attrs = flatten(selectorAndAttributeNames.map<AttrInfo[]>(selectorAndAttr => {
const directive = selectorMap.get(selectorAndAttr.selector) !;
const result = selectorAndAttr.attrs.map<AttrInfo>(
name => ({name, input: name in directive.inputs, output: name in directive.outputs}));
return result;
}));
// Add template attribute if a directive contains a template reference
selectorAndAttributeNames.forEach(selectorAndAttr => {
const selector = selectorAndAttr.selector;
const directive = selectorMap.get(selector);
if (directive && hasTemplateReference(directive.type) && selector.attrs.length &&
selector.attrs[0]) {
attrs.push({name: selector.attrs[0], template: true});
}
});
// All input and output properties of the matching directives should be added.
let elementSelector = element ?
createElementCssSelector(element) :
createElementCssSelector(new Element(elementName, [], [], null !, null, null));
let matcher = new SelectorMatcher();
matcher.addSelectables(selectors);
matcher.match(elementSelector, selector => {
let directive = selectorMap.get(selector);
if (directive) {
attrs.push(...Object.keys(directive.inputs).map(name => ({name, input: true})));
attrs.push(...Object.keys(directive.outputs).map(name => ({name, output: true})));
}
});
// If a name shows up twice, fold it into a single value.
attrs = foldAttrs(attrs);
// Now expand them back out to ensure that input/output shows up as well as input and
// output.
attributes.push(...flatten(attrs.map(expandedAttr)));
}
return attributes;
}
function attributeValueCompletions(
info: TemplateInfo, position: number, attr: Attribute): Completions|undefined {
const path = new TemplateAstPath(info.templateAst, position);
const mostSpecific = path.tail;
if (mostSpecific) {
const visitor =
new ExpressionVisitor(info, position, attr, () => getExpressionScope(info, path, false));
mostSpecific.visit(visitor, null);
if (!visitor.result || !visitor.result.length) {
// Try allwoing widening the path
const widerPath = new TemplateAstPath(info.templateAst, position, /* allowWidening */ true);
if (widerPath.tail) {
const widerVisitor = new ExpressionVisitor(
info, position, attr, () => getExpressionScope(info, widerPath, false));
widerPath.tail.visit(widerVisitor, null);
return widerVisitor.result;
}
}
return visitor.result;
}
}
function elementCompletions(info: TemplateInfo, path: HtmlAstPath): Completions|undefined {
let htmlNames = elementNames().filter(name => !(name in hiddenHtmlElements));
// Collect the elements referenced by the selectors
let directiveElements = getSelectors(info)
.selectors.map(selector => selector.element)
.filter(name => !!name) as string[];
let components =
directiveElements.map<Completion>(name => ({kind: 'component', name, sort: name}));
let htmlElements = htmlNames.map<Completion>(name => ({kind: 'element', name: name, sort: name}));
// Return components and html elements
return uniqueByName(htmlElements.concat(components));
}
function entityCompletions(value: string, position: number): Completions|undefined {
// Look for entity completions
const re = /&[A-Za-z]*;?(?!\d)/g;
let found: RegExpExecArray|null;
let result: Completions|undefined = undefined;
while (found = re.exec(value)) {
let len = found[0].length;
if (position >= found.index && position < (found.index + len)) {
result = Object.keys(NAMED_ENTITIES)
.map<Completion>(name => ({kind: 'entity', name: `&${name};`, sort: name}));
break;
}
}
return result;
}
function interpolationCompletions(info: TemplateInfo, position: number): Completions|undefined {
// Look for an interpolation in at the position.
const templatePath = new TemplateAstPath(info.templateAst, position);
const mostSpecific = templatePath.tail;
if (mostSpecific) {
let visitor = new ExpressionVisitor(
info, position, undefined, () => getExpressionScope(info, templatePath, false));
mostSpecific.visit(visitor, null);
return uniqueByName(visitor.result);
}
}
// There is a special case of HTML where text that contains a unclosed tag is treated as
// text. For exaple '<h1> Some <a text </h1>' produces a text nodes inside of the H1
// element "Some <a text". We, however, want to treat this as if the user was requesting
// the attributes of an "a" element, not requesting completion in the a text element. This
// code checks for this case and returns element completions if it is detected or undefined
// if it is not.
function voidElementAttributeCompletions(info: TemplateInfo, path: HtmlAstPath): Completions|
undefined {
let tail = path.tail;
if (tail instanceof Text) {
let match = tail.value.match(/<(\w(\w|\d|-)*:)?(\w(\w|\d|-)*)\s/);
// The position must be after the match, otherwise we are still in a place where elements
// are expected (such as `<|a` or `<a|`; we only want attributes for `<a |` or after).
if (match &&
path.position >= (match.index || 0) + match[0].length + tail.sourceSpan.start.offset) {
return attributeCompletionsForElement(info, match[3]);
}
}
}
class ExpressionVisitor extends NullTemplateVisitor {
private getExpressionScope: () => SymbolTable;
result: Completions;
constructor(
private info: TemplateInfo, private position: number, private attr?: Attribute,
getExpressionScope?: () => SymbolTable) {
super();
this.getExpressionScope = getExpressionScope || (() => info.template.members);
}
visitDirectiveProperty(ast: BoundDirectivePropertyAst): void {
this.attributeValueCompletions(ast.value);
}
visitElementProperty(ast: BoundElementPropertyAst): void {
this.attributeValueCompletions(ast.value);
}
visitEvent(ast: BoundEventAst): void { this.attributeValueCompletions(ast.handler); }
visitElement(ast: ElementAst): void {
if (this.attr && getSelectors(this.info) && this.attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) {
// The value is a template expression but the expression AST was not produced when the
// TemplateAst was produce so
// do that now.
const key = this.attr.name.substr(TEMPLATE_ATTR_PREFIX.length);
// Find the selector
const selectorInfo = getSelectors(this.info);
const selectors = selectorInfo.selectors;
const selector =
selectors.filter(s => s.attrs.some((attr, i) => i % 2 == 0 && attr == key))[0];
const templateBindingResult =
this.info.expressionParser.parseTemplateBindings(key, this.attr.value, null);
// find the template binding that contains the position
if (!this.attr.valueSpan) return;
const valueRelativePosition = this.position - this.attr.valueSpan.start.offset - 1;
const bindings = templateBindingResult.templateBindings;
const binding =
bindings.find(
binding => inSpan(valueRelativePosition, binding.span, /* exclusive */ true)) ||
bindings.find(binding => inSpan(valueRelativePosition, binding.span));
const keyCompletions = () => {
let keys: string[] = [];
if (selector) {
const attrNames = selector.attrs.filter((_, i) => i % 2 == 0);
keys = attrNames.filter(name => name.startsWith(key) && name != key)
.map(name => lowerName(name.substr(key.length)));
}
keys.push('let');
this.result = keys.map(key => <Completion>{kind: 'key', name: key, sort: key});
};
if (!binding || (binding.key == key && !binding.expression)) {
// We are in the root binding. We should return `let` and keys that are left in the
// selector.
keyCompletions();
} else if (binding.keyIsVar) {
const equalLocation = this.attr.value.indexOf('=');
this.result = [];
if (equalLocation >= 0 && valueRelativePosition >= equalLocation) {
// We are after the '=' in a let clause. The valid values here are the members of the
// template reference's type parameter.
const directiveMetadata = selectorInfo.map.get(selector);
if (directiveMetadata) {
const contextTable =
this.info.template.query.getTemplateContext(directiveMetadata.type.reference);
if (contextTable) {
this.result = this.symbolsToCompletions(contextTable.values());
}
}
} else if (binding.key && valueRelativePosition <= (binding.key.length - key.length)) {
keyCompletions();
}
} else {
// If the position is in the expression or after the key or there is no key, return the
// expression completions
if ((binding.expression && inSpan(valueRelativePosition, binding.expression.ast.span)) ||
(binding.key &&
valueRelativePosition > binding.span.start + (binding.key.length - key.length)) ||
!binding.key) {
const span = new ParseSpan(0, this.attr.value.length);
this.attributeValueCompletions(
binding.expression ? binding.expression.ast :
new PropertyRead(span, new ImplicitReceiver(span), ''),
valueRelativePosition);
} else {
keyCompletions();
}
}
}
}
visitBoundText(ast: BoundTextAst) {
const expressionPosition = this.position - ast.sourceSpan.start.offset;
if (inSpan(expressionPosition, ast.value.span)) {
const completions = getExpressionCompletions(
this.getExpressionScope(), ast.value, expressionPosition, this.info.template.query);
if (completions) {
this.result = this.symbolsToCompletions(completions);
}
}
}
private attributeValueCompletions(value: AST, position?: number) {
const symbols = getExpressionCompletions(
this.getExpressionScope(), value, position == null ? this.attributeValuePosition : position,
this.info.template.query);
if (symbols) {
this.result = this.symbolsToCompletions(symbols);
}
}
private symbolsToCompletions(symbols: Symbol[]): Completions {
return symbols.filter(s => !s.name.startsWith('__') && s.public)
.map(symbol => <Completion>{kind: symbol.kind, name: symbol.name, sort: symbol.name});
}
private get attributeValuePosition() {
if (this.attr && this.attr.valueSpan) {
return this.position - this.attr.valueSpan.start.offset - 1;
}
return 0;
}
}
function getSourceText(template: TemplateSource, span: Span): string {
return template.source.substring(span.start, span.end);
}
function nameOfAttr(attr: AttrInfo): string {
let name = attr.name;
if (attr.output) {
name = removeSuffix(name, 'Events');
name = removeSuffix(name, 'Changed');
}
let result = [name];
if (attr.input) {
result.unshift('[');
result.push(']');
}
if (attr.output) {
result.unshift('(');
result.push(')');
}
if (attr.template) {
result.unshift('*');
}
return result.join('');
}
const templateAttr = /^(\w+:)?(template$|^\*)/;
function createElementCssSelector(element: Element): CssSelector {
const cssSelector = new CssSelector();
let elNameNoNs = splitNsName(element.name)[1];
cssSelector.setElement(elNameNoNs);
for (let attr of element.attrs) {
if (!attr.name.match(templateAttr)) {
let [_, attrNameNoNs] = splitNsName(attr.name);
cssSelector.addAttribute(attrNameNoNs, attr.value);
if (attr.name.toLowerCase() == 'class') {
const classes = attr.value.split(/s+/g);
classes.forEach(className => cssSelector.addClassName(className));
}
}
}
return cssSelector;
}
function foldAttrs(attrs: AttrInfo[]): AttrInfo[] {
let inputOutput = new Map<string, AttrInfo>();
let templates = new Map<string, AttrInfo>();
let result: AttrInfo[] = [];
attrs.forEach(attr => {
if (attr.fromHtml) {
return attr;
}
if (attr.template) {
let duplicate = templates.get(attr.name);
if (!duplicate) {
result.push({name: attr.name, template: true});
templates.set(attr.name, attr);
}
}
if (attr.input || attr.output) {
let duplicate = inputOutput.get(attr.name);
if (duplicate) {
duplicate.input = duplicate.input || attr.input;
duplicate.output = duplicate.output || attr.output;
} else {
let cloneAttr: AttrInfo = {name: attr.name};
if (attr.input) cloneAttr.input = true;
if (attr.output) cloneAttr.output = true;
result.push(cloneAttr);
inputOutput.set(attr.name, cloneAttr);
}
}
});
return result;
}
function expandedAttr(attr: AttrInfo): AttrInfo[] {
if (attr.input && attr.output) {
return [
attr, {name: attr.name, input: true, output: false},
{name: attr.name, input: false, output: true}
];
}
return [attr];
}
function lowerName(name: string): string {
return name && (name[0].toLowerCase() + name.substr(1));
}
| diestrin/angular | packages/language-service/src/completions.ts | TypeScript | mit | 20,022 |
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Markdown } from '@appearhere/bloom';
import guide from './markdown-guide.md';
storiesOf('Markdown', module).add('<Markdown />', () => <Markdown>{guide}</Markdown>);
| appearhere/bloom | packages/playground/stories/Markdown.story.js | JavaScript | mit | 250 |
using LiNGS.Common.Network;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace LiNGS.Server
{
internal class Router
{
private LiNGSServer server;
public Router(LiNGSServer server)
{
this.server = server;
}
public void RouteMessage(NetworkMessage message)
{
if (message == null)
{
return;
}
switch (message.Type)
{
case NetworkMessage.MessageType.Connect:
server.Manager.ClientConnecting(message);
break;
case NetworkMessage.MessageType.Disconnect:
server.Manager.ClientDisconnecting(message);
break;
case NetworkMessage.MessageType.Ack:
server.Manager.ClientConnection(message);
break;
case NetworkMessage.MessageType.Data:
server.Manager.ClientConnection(message);
server.GameLogicProcessor.ReceiveDataMessage(message);
break;
case NetworkMessage.MessageType.Game:
server.Manager.ClientConnection(message);
server.GameLogicProcessor.ReceiveGameMessage(message);
break;
case NetworkMessage.MessageType.Event:
server.Manager.ClientConnection(message);
server.GameLogicProcessor.ReceiveEventMessage(message);
break;
case NetworkMessage.MessageType.ErrorConnect:
server.Manager.ClientConnection(message);
break;
case NetworkMessage.MessageType.Error:
server.Manager.ClientConnection(message);
server.GameLogicProcessor.ReceiveErrorMessage(message);
break;
case NetworkMessage.MessageType.Heartbeat:
server.Manager.ClientConnection(message);
break;
}
}
}
}
| valterc/lings | LiNGSServer/Router.cs | C# | mit | 2,184 |
import React from 'react';
import { Switch, Route } from 'react-router';
import Drawer from 'material-ui/Drawer';
import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar';
import IconButton from 'material-ui/IconButton';
import NavigationClose from 'material-ui/svg-icons/navigation/close';
import { List } from 'material-ui/List';
import Divider from 'material-ui/Divider';
import SelectedUnprotectedActionsWithData from './toolbarActions/unprotected/SelectedUnprotectedActionsWithData';
import SelectedProtectedActionsWithData from './toolbarActions/protected/SelectedProtectedActionsWithData';
import SelectedClientActionsWithData from './toolbarActions/client/SelectedClientActionsWithData';
import RemoveUnprotectedNameButton from './toolbarActions/unprotected/RemoveUnprotectedNameButton';
import RemoveProtectedNameButton from './toolbarActions/protected/RemoveProtectedNameButton';
import RemoveClientButton from './toolbarActions/client/RemoveClientButton';
import NameDetails from './NameDetails';
import CompanyDetails from './CompanyDetails';
import Comments from './comments/CommentsWithData';
import LoadingSpinner from '../../shared/LoadingSpinner';
export default ({
name,
match: {
params: { nameListType },
},
closeNameDetails,
}) => (
<Drawer
containerStyle={{ zIndex: '1100' }}
width={250}
openSecondary
open={Boolean(name)}
>
{name ? (
<div id="selectedName">
<Toolbar>
<ToolbarGroup firstChild>
<IconButton onClick={() => closeNameDetails(nameListType)}>
<NavigationClose />
</IconButton>
</ToolbarGroup>
<Switch>
<Route
path="/account/names/unprotected"
render={() => <SelectedUnprotectedActionsWithData name={name} />}
/>
<Route
path="/account/names/(protected|metWithProtected)"
render={() => <SelectedProtectedActionsWithData name={name} />}
/>
<Route
path="/account/names/clients"
render={() => <SelectedClientActionsWithData name={name} />}
/>
</Switch>
<ToolbarGroup lastChild>
<Switch>
<Route
path={`/account/names/unprotected`}
render={() => <RemoveUnprotectedNameButton name={name} />}
/>
<Route
path={`/account/names/(protected|metWithProtected)`}
render={() => <RemoveProtectedNameButton name={name} />}
/>
<Route
path={`/account/names/clients`}
render={() => <RemoveClientButton name={name} />}
/>
</Switch>
</ToolbarGroup>
</Toolbar>
<List>
<NameDetails
isProtected={
nameListType === 'protected' ||
nameListType === 'metWithProtected' ||
nameListType === 'client'
}
name={{
id: name.id,
firstName: name.firstName,
lastName: name.lastName,
phone: name.phone,
}}
/>
<Divider />
<CompanyDetails company={name.company} />
<Divider />
<Comments
id={name.id}
firstName={name.firstName}
lastName={name.lastName}
/>
</List>
</div>
) : (
<LoadingSpinner />
)}
</Drawer>
);
| VasilyShelkov/ClientRelationshipManagerUI | src/names/selected/SelectedName.js | JavaScript | mit | 3,515 |
# Changelog
## 1.2.0 (2014-10-29)
- [#2](https://github.com/yous/sawarineko/issues/2): Add encoding support to Converter (UTF-8, UTF-16BE, UTF-16LE, EUC-JP, Shift_JIS, EUC-KR, CP949)
- [#2](https://github.com/yous/sawarineko/issues/2): Add `-e/--encoding` option to CLI
## 1.1.0 (2014-10-28)
- Add `Sawarineko.nya`
- Make `Converter#convert` to get the source as argument
## 1.0.0 (2014-10-27)
- Fix crash in `Converter#convert`
## 0.2.0 (2014-10-12)
- Add katakana support
## 0.1.0 (2014-10-12)
- First release
| yous/sawarineko | CHANGELOG.md | Markdown | mit | 522 |
//=====> EXTERNAL CONSTANTS
var USERNAME = window.USERNAME;
var NO_ACTION_MESSAGE = {};
var CATEGORY_TITLE = {};
var CATEGORY_ICON = {};
var CONTENT_PER_PAGE = 5;
var pages = {
starred: 1,
watching: 1
};
//=====> HELPER FUNCTIONS
function getStarsPanel(action) {
return $('.panel-user-info[data-action=' + action + ']');
}
function getStarsFooter(action) {
return getStarsPanel(action).find('.panel-footer');
}
function loadActions(increment, action) {
pages[action] += increment;
var offset = (pages[action] - 1) * CONTENT_PER_PAGE;
apiV2Request('users/' + USERNAME + '/' + action + '?offset=' + offset + '&limit=' + CONTENT_PER_PAGE).then(function (result) {
//TODO: Use pagination info
var tbody = getStarsPanel(action).find('.panel-body').find('tbody');
var content = [];
if(result.pagination.count === 0) {
content.push($("<tr>").append($("<td>").append($("<i class='minor'>").text(NO_ACTION_MESSAGE[action]))));
}
else {
for (var project of result.result) {
var link = $("<a>").attr("href", '/' + project.namespace.owner + '/' + project.namespace.slug).text(project.namespace.owner + '/').append($("<strong>").text(project.namespace.slug));
var versionDiv = $("<div class='pull-right'>");
if (project.recommended_version) {
versionDiv.append($("<span class='minor'>").text(project.recommended_version.version));
}
var versionIcon = $("<i>");
versionIcon.attr("title", CATEGORY_TITLE[project.category]);
versionIcon.addClass('fas fa-fw').addClass(CATEGORY_ICON[project.category]);
versionDiv.append(versionIcon);
content.push($("<tr>").append($("<td>").append(link, versionDiv)));
}
}
// Done loading, set the table to the result
tbody.empty();
tbody.append(content);
var footer = getStarsFooter(action);
var prev = footer.find('.prev');
// Check if there is a last page
if (pages[action] > 1) {
prev.show();
} else {
prev.hide();
}
// Check if there is a next page
var next = footer.find('.next');
if (result.pagination.count > pages[action] * CONTENT_PER_PAGE) {
next.show();
} else {
next.hide();
}
});
}
function formAsync(form, route, onSuccess) {
form.submit(function (e) {
e.preventDefault();
var formData = new FormData(this);
var spinner = $(this).find('.fa-spinner').show();
$.ajax({
url: route,
data: formData,
cache: false,
contentType: false,
processData: false,
type: 'post',
dataType: 'json',
complete: function () {
spinner.hide();
},
success: onSuccess
});
});
}
function setupAvatarForm() {
$('.btn-got-it').click(function () {
var prompt = $(this).closest('.prompt');
$.ajax({
type: 'post',
url: 'prompts/read/' + prompt.data('prompt-id')
});
prompt.fadeOut('fast');
});
$('.organization-avatar').hover(function () {
$('.edit-avatar').fadeIn('fast');
}, function (e) {
if (!$(e.relatedTarget).closest("div").hasClass("edit-avatar")) {
$('.edit-avatar').fadeOut('fast');
}
});
var avatarModal = $('#modal-avatar');
avatarModal.find('.alert').hide();
var avatarForm = avatarModal.find('#form-avatar');
avatarForm.find('input[name="avatar-method"]').change(function () {
avatarForm.find('input[name="avatar-file"]').prop('disabled', $(this).val() !== 'by-file');
});
formAsync(avatarForm, 'organizations/' + USERNAME + '/settings/avatar', function (json) {
if (json.hasOwnProperty('errors')) {
var alert = avatarForm.find('.alert-danger');
alert.find('.error').text(json['errors'][0]);
alert.fadeIn('slow');
} else {
avatarModal.modal('hide');
var success = $('.alert-success');
success.find('.success').text('Avatar successfully updated!');
success.fadeIn('slow');
$('.user-avatar[title="' + USERNAME + '"]')
.prop('src', json['avatarTemplate'].replace('{size}', '200'));
}
});
}
//=====> DOCUMENT READY
$(function () {
for (let action of ['starred', 'watching']) {
var footer = getStarsFooter(action);
loadActions(0, action);
footer.find('.next').click(function () {
loadActions(1, action);
});
footer.find('.prev').click(function () {
loadActions(-1, action);
});
}
setupAvatarForm();
});
| SpongePowered/Ore | ore/public/javascripts/userPage.js | JavaScript | mit | 4,941 |
Ti=DEFINITIONS
0.sec=Aux fins du présent contrat, les définitions suivantes (des termes indiqués en italique dans le texte) sont applicables:
auteur.sec=«{_auteur}»: toute personne physique qui contribue à la production du {_résultat};
back_office.sec=«{_back_office}»: le(s) système(s) interne(s) utilisé(s) par les parties pour traiter les factures électroniques;
conflit_d’intérêts.sec=«{_conflit_d’intérêts}»: situation dans laquelle l’exécution impartiale et objective du contrat par le contractant est compromise pour des motifs familiaux, affectifs, d’affinité politique ou nationale, d’intérêt économique, pour tout autre intérêt personnel direct ou indirect ou pour tout autre motif de communauté d’intérêt avec le pouvoir adjudicateur ou un tiers en rapport avec l’objet du contrat;
document_de_contrôle_des_interfaces.sec=«{_document_de_contrôle_des_interfaces}»: document d’orientation qui énonce les spécifications techniques, les normes de messagerie, les normes de sécurité, les règles syntaxiques et sémantiques, etc., pour faciliter la connexion de machine à machine. Ce document est mis à jour régulièrement;
droit_préexistant.sec=«{_droit_préexistant}»: tout droit de propriété industrielle et intellectuelle sur un {_matériel_préexistant}; il peut s’agir d’un droit de propriété, d’un droit de licence et/ou d’un droit d’utilisation appartenant au contractant, à l’{_auteur}, au pouvoir adjudicateur ainsi qu’à tout tiers;
e-PRIOR.sec=«{_e-PRIOR}»: plateforme de communication axée sur le service, qui fournit une série de services web et permet l’échange de messages et de documents électroniques normalisés entre les parties. Cet échange se fait au moyen de services web, avec une connexion de machine à machine entre les systèmes de {_back_office} des parties (messages EDI), ou au moyen d’une application web (le {_portail_fournisseurs}). La plateforme peut être utilisée pour l’échange entre les parties des documents électroniques tels que les demandes électroniques de services, les contrats spécifiques électroniques et l’acceptation électronique des services ou les factures électroniques;
exécution_du_contrat.sec=«{_exécution_du_contrat}»: exécution de tâches et prestation par le contractant des services achetés pour le pouvoir adjudicateur;
faute_professionnelle_grave.sec=«{_faute_professionnelle_grave}»: violation des dispositions législatives ou réglementaires applicables ou des normes de déontologie de la profession à laquelle appartient un contractant ou une {_personne_liée}, y compris toute conduite donnant lieu à une exploitation ou des abus sexuels ou autres, ou toute conduite fautive du contractant ou d’une {_personne_liée} qui a une incidence sur sa crédibilité professionnelle, dès lors que cette conduite dénote une intention fautive ou une négligence grave;
force_majeure.sec=«{_force_majeure}»: toute situation ou tout événement imprévisible et exceptionnel, indépendant de la volonté des parties, qui empêche l’une d’entre elles d’exécuter une ou plusieurs de ses obligations découlant du contrat. La situation ou l’événement ne doit pas être imputable à la faute ou à la négligence de l’une des parties ou d’un sous-traitant, et doit se révéler inévitable en dépit de toute la diligence employée. Une défaillance dans une prestation, le défaut des équipements, du matériel ou des matériaux ou leur mise à disposition tardive, les conflits de travail, les grèves et les difficultés financières ne peuvent être invoqués comme cas de {_force_majeure}, sauf si cette situation est la conséquence directe d’un cas de {_force_majeure} établi;
fraude.sec=«{_fraude}»: acte ou omission en vue, pour son auteur ou une autre personne, de réaliser un gain illicite en causant un préjudice aux intérêts financiers de l'Union, et relatif: i) à l'utilisation ou à la présentation de déclarations ou de documents faux, inexacts ou incomplets, ayant pour effet le détournement ou la rétention indue de fonds ou d'avoirs provenant du budget de l'Union, ii) à la non-communication d'une information en violation d'une obligation spécifique, ayant le même effet, ou iii) au détournement de tels fonds ou avoirs à des fins autres que celles pour lesquelles ils ont été initialement accordés, qui porte atteinte aux intérêts financiers de l'Union;
information_ou_document_confidentiel.sec=«{_information_ou_document_confidentiel}»: toute information ou tout document reçu par chaque partie de la part de l’autre partie, ou auquel chaque partie a accès dans le cadre de l'{_exécution_du_contrat}, que l’une d’entre elles a désigné par écrit comme étant confidentiel. Les informations et documents confidentiels ne comprennent pas d'informations accessibles au public;
intérêts_à_caractère_professionnel_contradictoires.sec=«{_intérêts_à_caractère_professionnel_contradictoires}»: situation dans laquelle les activités professionnelles précédentes ou actuelles du contractant portent atteinte à sa capacité d’exécuter le contrat selon une norme de qualité appropriée;
irrégularité.sec=«{_irrégularité}»: toute violation d’une disposition du droit de l’Union résultant d’un acte ou d’une omission d’un opérateur économique qui a ou aurait pour effet de porter préjudice au budget de l’Union;
matériel_préexistant.sec=«{_matériel_préexistant}»: tout matériel, document, technologie ou savoir-faire qui existe avant son utilisation par le contractant pour la production d’un {_résultat} dans le cadre de l'{_exécution_du_contrat};
message_EDI.sec=«{_message_EDI}» (échange de données informatisé): message créé et échangé par transfert électronique, d’ordinateur à ordinateur, de données commerciales et administratives au moyen d’une norme convenue;
notification.sec=«{_notification}» (ou «notifier»): forme de communication entre les parties établie par écrit, y compris par voie électronique;
notification_formelle.sec=«{_notification_formelle}» (ou «notifier formellement»): forme de communication entre les parties établie par écrit par courrier postal ou par courrier électronique, qui fournit à l’expéditeur la preuve irréfutable que le message a été livré au destinataire spécifié;
personne_liée.sec=«{_personne_liée}»: toute personne physique ou morale qui est membre de l’organe d’administration, de direction ou de surveillance du contractant ou qui possède des pouvoirs de représentation, de décision ou de contrôle à l’égard de ce contractant;
personnel.sec=«{_personnel}»: personnes employées directement ou indirectement par le contractant, ou ayant conclu un contrat avec celui-ci, pour exécuter le contrat;
portail_fournisseurs.sec=«{_portail_fournisseurs}»: portail {_e-PRIOR}, qui permet au contractant d’échanger des documents commerciaux sur support électronique, tels que les factures, au moyen d’une interface utilisateur graphique;
résultat.sec=«{_résultat}»: tout produit escompté de l’{_exécution_du_contrat}, quelle que soit sa forme ou sa nature. Un {_résultat} peut également être défini dans le présent contrat comme un élément livrable. Un {_résultat} peut, en plus du matériel nouvellement créé produit spécifiquement pour le pouvoir adjudicateur par le contractant ou à sa demande, inclure également du {_matériel_préexistant};
violation_d’obligations.sec=«{_violation_d’obligations}»: non-exécution, par le contractant, d’une ou de plusieurs de ses obligations contractuelles.
xlist=<ul type="none"><li>{auteur.sec}<li>{back_office.sec}<li>{conflit_d’intérêts.sec}<li>{document_de_contrôle_des_interfaces.sec}<li>{droit_préexistant.sec}<li>{e-PRIOR.sec}<li>{exécution_du_contrat.sec}<li>{faute_professionnelle_grave.sec}<li>{force_majeure.sec}<li>{fraude.sec}<li>{information_ou_document_confidentiel.sec}<li>{intérêts_à_caractère_professionnel_contradictoires.sec}<li>{irrégularité.sec}<li>{matériel_préexistant.sec}<li>{message_EDI.sec}<li>{notification.sec}<li>{notification_formelle.sec}<li>{personne_liée.sec}<li>{personnel.sec}<li>{portail_fournisseurs.sec}<li>{résultat.sec}<li>{violation_d’obligations.sec}</ul>
=[G/Z/ol/Base] | CommonAccord/Cmacc-Org | Doc/G/EU_Europa_EC_Conditions_General/FR/Sec/Def/0.md | Markdown | mit | 8,418 |
/*
* eXist Open Source Native XML Database
* Copyright (C) 2001-2015 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.exist.executor;
import org.exist.xquery.AbstractInternalModule;
import org.exist.xquery.FunctionDef;
import org.exist.xquery.XPathException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.*;
/**
* @author <a href="mailto:[email protected]">Dmitriy Shabanov</a>
*
*/
public class Module extends AbstractInternalModule {
public final static String NAMESPACE_URI = "http://exist-db.org/executor";
public final static String PREFIX = "executor";
private final static String RELEASED_IN_VERSION = "eXist-2.1";
private final static String DESCRIPTION = "Module provides a way of decoupling task submission from the mechanics of how each task will be run, including details of thread use, scheduling, etc..";
private final static FunctionDef[] functions = {
new FunctionDef(Exec.signatures[0], Exec.class),
new FunctionDef(Exec.signatures[1], Exec.class),
new FunctionDef(Exec.signatures[2], Exec.class),
new FunctionDef(Exec.signatures[3], Exec.class),
new FunctionDef(Exec.signatures[4], Exec.class),
new FunctionDef(Submit.signatures[0], Submit.class),
new FunctionDef(Submit.signatures[1], Submit.class),
new FunctionDef(Schedule.signatures[0], Schedule.class),
new FunctionDef(Schedule.signatures[1], Schedule.class),
new FunctionDef(GetDelay.signatures[0], GetDelay.class),
new FunctionDef(IsCanceled.signatures[0], IsCanceled.class),
new FunctionDef(IsDone.signatures[0], IsDone.class),
new FunctionDef(Cancel.signatures[0], Cancel.class),
};
public Module(Map<String, List<? extends Object>> parameters) {
super(functions, parameters);
}
public String getDefaultPrefix() {
return PREFIX;
}
public String getDescription() {
return DESCRIPTION;
}
public String getNamespaceURI() {
return NAMESPACE_URI;
}
public String getReleaseVersion() {
return RELEASED_IN_VERSION;
}
protected final static Map<String, ExecutorService> executors = new HashMap<>();
public static synchronized boolean newSingleThreadExecutor(String name) throws XPathException {
if (executors.get(name) != null) return false;
executors.put(name, Executors.newSingleThreadExecutor());
return true;
}
public static synchronized boolean newFixedThreadPool(String name, int nThreads) throws XPathException {
if (executors.get(name) != null) return false;
executors.put(name, Executors.newFixedThreadPool(nThreads));
return true;
}
public static synchronized boolean newCachedThreadPool(String name) throws XPathException {
if (executors.get(name) != null) return false;
executors.put(name, Executors.newCachedThreadPool());
return true;
}
public static synchronized boolean newSingleThreadScheduledExecutor(String name) throws XPathException {
if (executors.get(name) != null) return false;
executors.put(name, Executors.newSingleThreadScheduledExecutor());
return true;
}
public static synchronized boolean newScheduledThreadPool(String name, int corePoolSize) throws XPathException {
if (executors.get(name) != null) return false;
executors.put(name, Executors.newScheduledThreadPool(corePoolSize));
return true;
}
protected final static Map<String, Future> futures = new HashMap<>();
public static boolean submit(String name, RunFunction task) throws XPathException {
if (executors.containsKey(task.id)) return false;
ExecutorService executor = executors.get(name);
if (executor == null) throw new XPathException("Unknown executor name: " + name);
Future future = executor.submit(task);
futures.put(task.id, future);
return true;
}
public static boolean schedule(String name, RunFunction task, long t) throws XPathException {
if (executors.containsKey(task.id)) return false;
ExecutorService executor = executors.get(name);
if (executor == null) throw new XPathException("Unknown scheduler name: " + name);
if (!(executor instanceof ScheduledExecutorService)) return false;
ScheduledExecutorService scheduler = (ScheduledExecutorService) executor;
ScheduledFuture future = scheduler.schedule(task, t, TimeUnit.MILLISECONDS);
futures.put(task.id, future);
return true;
}
}
| shabanovd/eXecutor | src/main/java/org/exist/executor/Module.java | Java | mit | 5,461 |
package me.dzhmud.euler.pack0;
import me.dzhmud.euler.EulerSolution;
import me.dzhmud.euler.util.CommonUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
/**
*
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
*
* @author dzhmud
*/
public class Problem04 implements EulerSolution {
public static void main(String[] args) {
EulerSolution.measureTime(new Problem04()::getAnswer);
}
@Override
public String getAnswer() {
List<Integer> palindroms = new ArrayList<>();
int temp;
for (int f1 = 900; f1 < 1000; f1++) {
for (int f2 = 900; f2 < 1000; f2++) {
temp = f1*f2;
if (CommonUtils.isPalindromic(temp))
palindroms.add(temp);
}
}
palindroms.sort(Comparator.reverseOrder());
return palindroms.get(0) + "";
}
}
| dzhmud/euler | src/main/java/me/dzhmud/euler/pack0/Problem04.java | Java | mit | 956 |
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
//conta numero de arestas a partir do numero de relacionamento enviado no arquivo txt 3 coluna
void criaMatrizUm(int **matrizUm, int *tamanhoUm,int *numArestaUm){
int i, j, origem, destino, relacionamento, verticesUm;
*numArestaUm=0;
FILE *p=fopen("oi1.txt", "r+");
printf("Digite a quantidade de vértices: ");
scanf("%i",&verticesUm);
*tamanhoUm=verticesUm;
printf("\n");
matrizUm=(int**)malloc(*tamanhoUm * sizeof(int*));
for(i=0;i<*tamanhoUm;i++){
matrizUm[i]= (int*) malloc(*tamanhoUm*sizeof(int)); //cria matriz de adjacencia
for(j=0;j<*tamanhoUm;j++){
matrizUm[i][j]=0; //inicializa adjacencia
}
}
while(fscanf(p, "%i %i %i", &origem, &destino, &relacionamento)!=EOF){ //mesmo que a anterior porem quando o grafo for direcionado
matrizUm[origem-1][destino-1]= relacionamento;
matrizUm[destino-1][origem-1]= relacionamento;
*numArestaUm=(*numArestaUm)+(relacionamento); //conta numero de arestas para matriz incidencia
printf("aresta: %i \n", *numArestaUm);
}
printf("\nNúmero de Arestas Matriz Um:%i \n \n", *numArestaUm);
for(i=0;i<*tamanhoUm;i++){ //percorre matriz e mostra
for(j=0;j<*tamanhoUm;j++){
if(matrizUm[i][j]!= -10){
printf("%i ",matrizUm[i][j]);
}
}
printf("\n");
}
fclose(p);
}
void criaMatrizDois(int **matrizDois, int *tamanhoDois,int *numArestaDois){
int i, j, origem, destino, verticesDois, relacionamento;
FILE *p=fopen("oi2.txt", "r");
*numArestaDois=0; //Número de relacionamentos 3ª coluna
printf("\nDigite a quantidade de vértices: ");
scanf("%i",&verticesDois);
*tamanhoDois=verticesDois;
printf("\n");
matrizDois=(int**)malloc(*tamanhoDois * sizeof(int*));
for(i=0;i<*tamanhoDois;i++){
matrizDois[i]= (int*) malloc(*tamanhoDois*sizeof(int)); //cria matriz de adjacencia
for(j=0;j<*tamanhoDois;j++){
matrizDois[i][j]=0; //inicializa adjacencia
}
}
while(fscanf(p, "%i %i %i", &origem, &destino, &relacionamento)!=EOF){ //direcionado
matrizDois[origem-1][destino-1]= relacionamento;
matrizDois[destino-1][origem-1]= relacionamento;
*numArestaDois=(*numArestaDois)+(relacionamento); //para matriz incidencia
printf("aresta: %i \n", *numArestaDois);
}
printf("\nNúmero de Arestas Matriz Dois:%i \n \n", *numArestaDois);
for(i=0;i<*tamanhoDois;i++){ //percorre matriz e mostra
for(j=0;j<*tamanhoDois;j++){
if(matrizDois[i][j]!= -10){
printf("%i ",matrizDois[i][j]);
}
}
printf("\n");
}
fclose(p);
}
//grava cada grau respectivamente com seu vertice num vetor
void GrauUm(int **matrizUm, int tamanhoUm, int *grauUm){
int i, j, cont=0;
printf("\nMatriz Um: \n");
for(i=0;i<tamanhoUm;i++){
for(j=0;j<tamanhoUm;j++){
if (matrizUm[i][j]!=0){ //matriz é simetrica (nao direcionada) leio só uma linha
cont+=matrizUm[i][j];
grauUm[i]=cont;
}
}
printf("O grau do nó %i eh: %i\n", i+1, cont);
cont=0;
}
for(i=0;i<tamanhoUm;i++){
printf(" %i | ", grauUm[i]);
}
printf("\n");
}
void GrauDois(int **matrizDois, int tamanhoDois, int *grauDois){
int i, j, cont=0;
printf("\nMatriz Dois: \n");
for(i=0;i<tamanhoDois;i++){
for(j=0;j<tamanhoDois;j++){
if (matrizDois[i][j]!=0){ //matriz é simetrica (nao direcionada) leio só uma linha
cont+=matrizDois[i][j];
grauDois[i]=cont;
}
}
printf("O grau do nó %i é: %i\n", i+1, cont);
cont=0;
}
for(i=0;i<tamanhoDois;i++){
printf(" %i | ", grauDois[i]);
}
printf("\n");
}
//compara vetores
//se forem todos iguais ao outros, isomorfo alem da condicao de vertices e arestas
void ComparaMatrizes(int *grauUm, int *grauDois, int tamanho){
int visto[tamanho], i, j, combi = 0;
for (i = 0; i < tamanho; i++) {
visto[i] = 0;
}
for(i = 0; i < tamanho; i++) {
for(j = 0; j < tamanho; j++) {
if (!(visto[j])) {
if (grauUm[i] == grauDois[j]) {
visto[j] = 1;
combi++;
break; //começo o for novamente...
}
}
}
}
if (combi == tamanho) {
printf("São isomorfos!\n");
}
else {
printf("Nao são isomorfos!\n");
}
}
int main()
{
setlocale(LC_ALL,"");
int **matrizUm=NULL, **matrizDois=NULL;
int tamanhoUm, tamanhoDois, numArestaUm, numArestaDois;
criaMatrizUm(matrizUm, &tamanhoUm, &numArestaUm);
criaMatrizDois(matrizDois, &tamanhoDois, &numArestaDois);
if ((tamanhoUm == tamanhoDois) && (numArestaUm == numArestaDois)) {
int grauUm[tamanhoUm], grauDois[tamanhoUm];
GrauUm(matrizUm, tamanhoUm, grauUm);
GrauDois(matrizDois, tamanhoUm, grauDois);
ComparaMatrizes(grauUm, grauDois, tamanhoUm);
}
else {
printf("Nao são isomorfos!\n");
}
return 0;
}
| Olorin-Narya/UDESC | TEG/Tarefa_05_Extra_Isomorfos.cpp | C++ | mit | 5,918 |
package com.blazeroni.reddit.util;
public class Objects {
@SuppressWarnings("unchecked")
public static <T> T ensureClass(Object obj, Class<T> clazz) {
if (!clazz.isInstance(obj)) {
throw new IllegalArgumentException("object is not an instance of class [" + clazz.getCanonicalName() + "]");
}
return (T) obj;
}
}
| blazeroni/redditastic | src/com/blazeroni/reddit/util/Objects.java | Java | mit | 361 |
/**
*
*/
package com.jarp.tutorials.bigranchprohects.ch19;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import com.jarp.tutorials.bigranchprohects.R;
/**
* @author JARP
*
*/
public abstract class SingleFragmentActivity extends FragmentActivity {
protected abstract Fragment createFragment();
@Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.ch19_activity_fragment);
FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentById(R.id.ch19_fragmentContainer);
if(fragment==null)
{
fragment = createFragment();
fm.beginTransaction()
.add(R.id.ch19_fragmentContainer, fragment)
.commit();
}
}
}
| imjarp/big-ranch-examples | src/com/jarp/tutorials/bigranchprohects/ch19/SingleFragmentActivity.java | Java | mit | 901 |
package data
import "fmt"
// Channel is short channel description
type Channel struct {
// Channel's ID
ID string
// Channel name
Name string
}
// Converts Channel into string
func (c *Channel) String() string {
return fmt.Sprintf("ID='%s' name='%s'", c.ID, c.Name)
}
// NewChannel creates a new instance of Channel
func NewChannel(id, name string) *Channel {
return &Channel{
ID: id,
Name: name,
}
}
| kapitanov/slack-cli | data/channel.go | GO | mit | 418 |
@import url("//fonts.googleapis.com/css?family=Lato:400,700,900,400italic");
@font-face {
font-family: "Flat-UI-Icons-16";
src: url("../fonts/Flat-UI-Icons-16.eot");
src: url("../fonts/Flat-UI-Icons-16.eot?#iefix") format("embedded-opentype"), url("../fonts/Flat-UI-Icons-16.woff") format("woff"), url("../fonts/Flat-UI-Icons-16.ttf") format("truetype"), url("../fonts/Flat-UI-Icons-16.svg#Flat-UI-Icons-16") format("svg");
font-weight: normal;
font-style: normal; }
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
font-family: "Flat-UI-Icons-16";
content: attr(data-icon);
speak: none;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased; }
/* Use the following CSS code if you want to have a class per icon */
/*Instead of a list of all class selectors,
*you can use the generic selector below, but it's slower:
*[class*="fui-"]:before { */
.fui-man-16:before, .fui-lock-16:before {
font-family: "Flat-UI-Icons-16";
speak: none;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased; }
.fui-man-16:before {
content: "\e007"; }
.fui-lock-16:before {
content: "\e009"; }
@font-face {
font-family: "Flat-UI-Icons-24";
src: url("../fonts/Flat-UI-Icons-24.eot");
src: url("../fonts/Flat-UI-Icons-24.eot?#iefix") format("embedded-opentype"), url("../fonts/Flat-UI-Icons-24.woff") format("woff"), url("../fonts/Flat-UI-Icons-24.ttf") format("truetype"), url("../fonts/Flat-UI-Icons-24.svg#Flat-UI-Icons-24") format("svg");
font-weight: normal;
font-style: normal; }
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
font-family: "Flat-UI-Icons-24";
content: attr(data-icon);
speak: none;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased; }
/* Use the following CSS code if you want to have a class per icon */
/*Instead of a list of all class selectors,
*you can use the generic selector below, but it's slower:
*[class*="fui-"]:before { */
.fui-man-24:before, .fui-lock-24:before {
font-family: "Flat-UI-Icons-24";
speak: none;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased; }
.fui-man-24:before {
content: "\e007"; }
.fui-lock-24:before {
content: "\e009"; }
body {
color: #34495e;
font: 14px/1.231 "Lato", sans-serif;
}
a {
color: #1abc9c;
text-decoration: none;
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-o-transition: 0.25s;
transition: 0.25s;
-webkit-backface-visibility: hidden; }
a:hover {
color: #2ecc71;
text-decoration: none; }
h3 {
font-size: 24px;
font-weight: 700;
margin-bottom: 4px;
margin-top: 2px; }
h4 {
color: #fff;
}
.messege {
font-size: 15px;
color: red;
}
.center-position {
margin: 7% 35%;
}
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 3 / 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 2) {}
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
border: 2px solid #dce4ec;
color: #34495e;
font-family: "Lato", sans-serif;
font-size: 14px;
padding: 8px 0 9px 10px;
text-indent: 1px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
textarea:-moz-placeholder,
input[type="text"]:-moz-placeholder,
input[type="password"]:-moz-placeholder,
input[type="datetime"]:-moz-placeholder,
input[type="datetime-local"]:-moz-placeholder,
input[type="date"]:-moz-placeholder,
input[type="month"]:-moz-placeholder,
input[type="time"]:-moz-placeholder,
input[type="week"]:-moz-placeholder,
input[type="number"]:-moz-placeholder,
input[type="email"]:-moz-placeholder,
input[type="url"]:-moz-placeholder,
input[type="search"]:-moz-placeholder,
input[type="tel"]:-moz-placeholder,
input[type="color"]:-moz-placeholder,
.uneditable-input:-moz-placeholder {
color: #acb6c0; }
textarea::-webkit-input-placeholder,
input[type="text"]::-webkit-input-placeholder,
input[type="password"]::-webkit-input-placeholder,
input[type="datetime"]::-webkit-input-placeholder,
input[type="datetime-local"]::-webkit-input-placeholder,
input[type="date"]::-webkit-input-placeholder,
input[type="month"]::-webkit-input-placeholder,
input[type="time"]::-webkit-input-placeholder,
input[type="week"]::-webkit-input-placeholder,
input[type="number"]::-webkit-input-placeholder,
input[type="email"]::-webkit-input-placeholder,
input[type="url"]::-webkit-input-placeholder,
input[type="search"]::-webkit-input-placeholder,
input[type="tel"]::-webkit-input-placeholder,
input[type="color"]::-webkit-input-placeholder,
.uneditable-input::-webkit-input-placeholder {
color: #acb6c0; }
textarea.placeholder,
input[type="text"].placeholder,
input[type="password"].placeholder,
input[type="datetime"].placeholder,
input[type="datetime-local"].placeholder,
input[type="date"].placeholder,
input[type="month"].placeholder,
input[type="time"].placeholder,
input[type="week"].placeholder,
input[type="number"].placeholder,
input[type="email"].placeholder,
input[type="url"].placeholder,
input[type="search"].placeholder,
input[type="tel"].placeholder,
input[type="color"].placeholder,
.uneditable-input.placeholder {
color: #acb6c0; }
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
border-color: #1abc9c;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.error textarea, .control-group.error
input[type="text"], .control-group.error
input[type="password"], .control-group.error
input[type="datetime"], .control-group.error
input[type="datetime-local"], .control-group.error
input[type="date"], .control-group.error
input[type="month"], .control-group.error
input[type="time"], .control-group.error
input[type="week"], .control-group.error
input[type="number"], .control-group.error
input[type="email"], .control-group.error
input[type="url"], .control-group.error
input[type="search"], .control-group.error
input[type="tel"], .control-group.error
input[type="color"], .control-group.error
.uneditable-input {
border-color: #e74c3c;
color: #e74c3c;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.error textarea:focus, .control-group.error
input[type="text"]:focus, .control-group.error
input[type="password"]:focus, .control-group.error
input[type="datetime"]:focus, .control-group.error
input[type="datetime-local"]:focus, .control-group.error
input[type="date"]:focus, .control-group.error
input[type="month"]:focus, .control-group.error
input[type="time"]:focus, .control-group.error
input[type="week"]:focus, .control-group.error
input[type="number"]:focus, .control-group.error
input[type="email"]:focus, .control-group.error
input[type="url"]:focus, .control-group.error
input[type="search"]:focus, .control-group.error
input[type="tel"]:focus, .control-group.error
input[type="color"]:focus, .control-group.error
.uneditable-input:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.success textarea, .control-group.success
input[type="text"], .control-group.success
input[type="password"], .control-group.success
input[type="datetime"], .control-group.success
input[type="datetime-local"], .control-group.success
input[type="date"], .control-group.success
input[type="month"], .control-group.success
input[type="time"], .control-group.success
input[type="week"], .control-group.success
input[type="number"], .control-group.success
input[type="email"], .control-group.success
input[type="url"], .control-group.success
input[type="search"], .control-group.success
input[type="tel"], .control-group.success
input[type="color"], .control-group.success
.uneditable-input {
border-color: #2ecc71;
color: #2ecc71;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.success textarea:focus, .control-group.success
input[type="text"]:focus, .control-group.success
input[type="password"]:focus, .control-group.success
input[type="datetime"]:focus, .control-group.success
input[type="datetime-local"]:focus, .control-group.success
input[type="date"]:focus, .control-group.success
input[type="month"]:focus, .control-group.success
input[type="time"]:focus, .control-group.success
input[type="week"]:focus, .control-group.success
input[type="number"]:focus, .control-group.success
input[type="email"]:focus, .control-group.success
input[type="url"]:focus, .control-group.success
input[type="search"]:focus, .control-group.success
input[type="tel"]:focus, .control-group.success
input[type="color"]:focus, .control-group.success
.uneditable-input:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.warning textarea, .control-group.warning
input[type="text"], .control-group.warning
input[type="password"], .control-group.warning
input[type="datetime"], .control-group.warning
input[type="datetime-local"], .control-group.warning
input[type="date"], .control-group.warning
input[type="month"], .control-group.warning
input[type="time"], .control-group.warning
input[type="week"], .control-group.warning
input[type="number"], .control-group.warning
input[type="email"], .control-group.warning
input[type="url"], .control-group.warning
input[type="search"], .control-group.warning
input[type="tel"], .control-group.warning
input[type="color"], .control-group.warning
.uneditable-input {
border-color: #f1c40f;
color: #f1c40f;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.warning textarea:focus, .control-group.warning
input[type="text"]:focus, .control-group.warning
input[type="password"]:focus, .control-group.warning
input[type="datetime"]:focus, .control-group.warning
input[type="datetime-local"]:focus, .control-group.warning
input[type="date"]:focus, .control-group.warning
input[type="month"]:focus, .control-group.warning
input[type="time"]:focus, .control-group.warning
input[type="week"]:focus, .control-group.warning
input[type="number"]:focus, .control-group.warning
input[type="email"]:focus, .control-group.warning
input[type="url"]:focus, .control-group.warning
input[type="search"]:focus, .control-group.warning
input[type="tel"]:focus, .control-group.warning
input[type="color"]:focus, .control-group.warning
.uneditable-input:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.info textarea, .control-group.info
input[type="text"], .control-group.info
input[type="password"], .control-group.info
input[type="datetime"], .control-group.info
input[type="datetime-local"], .control-group.info
input[type="date"], .control-group.info
input[type="month"], .control-group.info
input[type="time"], .control-group.info
input[type="week"], .control-group.info
input[type="number"], .control-group.info
input[type="email"], .control-group.info
input[type="url"], .control-group.info
input[type="search"], .control-group.info
input[type="tel"], .control-group.info
input[type="color"], .control-group.info
.uneditable-input {
border-color: #3498db;
color: #3498db;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.control-group.info textarea:focus, .control-group.info
input[type="text"]:focus, .control-group.info
input[type="password"]:focus, .control-group.info
input[type="datetime"]:focus, .control-group.info
input[type="datetime-local"]:focus, .control-group.info
input[type="date"]:focus, .control-group.info
input[type="month"]:focus, .control-group.info
input[type="time"]:focus, .control-group.info
input[type="week"]:focus, .control-group.info
input[type="number"]:focus, .control-group.info
input[type="email"]:focus, .control-group.info
input[type="url"]:focus, .control-group.info
input[type="search"]:focus, .control-group.info
input[type="tel"]:focus, .control-group.info
input[type="color"]:focus, .control-group.info
.uneditable-input:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
input[disabled],
input[readonly],
textarea[disabled],
textarea[readonly] {
background-color: #eaeded;
border-color: transparent;
color: #cad2d3;
cursor: default; }
input,
textarea,
.uneditable-input {
width: 192px; }
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 3 / 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 2) {}
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 3 / 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 2) {}
.login-form {
background-color: #eceff1;
border-radius: 6px;
padding: 24px 23px 1px;
position: relative;
margin: 5% 35%;
width: 317px; }
.login-form .control-group {
margin-bottom: 6px;
position: relative; }
.login-form .login-field {
border-color: transparent;
font-size: 17px;
padding-bottom: 11px;
padding-top: 11px;
text-indent: 3px;
width: 299px; }
.login-form .login-field:focus + .login-field-icon {
color: #1abc9c; }
.login-form .login-field-icon {
color: #bfc9ca;
font-size: 16px;
position: absolute;
right: 13px;
top: 14px;
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-o-transition: 0.25s;
transition: 0.25s;
-webkit-backface-visibility: hidden; }
.login-link {
color: #bfc9ca;
display: block;
font-size: 13px;
margin-top: 15px;
text-align: center; }
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 3 / 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 2) {}
.ptn, .pvn, .pan {
padding-top: 0; }
.ptx, .pvx, .pax {
padding-top: 3px; }
.pts, .pvs, .pas {
padding-top: 5px; }
.ptm, .pvm, .pam {
padding-top: 10px; }
.ptl, .pvl, .pal {
padding-top: 20px; }
.prn, .phn, .pan {
padding-right: 0; }
.prx, .phx, .pax {
padding-right: 3px; }
.prs, .phs, .pas {
padding-right: 5px; }
.prm, .phm, .pam {
padding-right: 10px; }
.prl, .phl, .pal {
padding-right: 20px; }
.pbn, .pvn, .pan {
padding-bottom: 0; }
.pbx, .pvx, .pax {
padding-bottom: 3px; }
.pbs, .pvs, .pas {
padding-bottom: 5px; }
.pbm, .pvm, .pam {
padding-bottom: 10px; }
.pbl, .pvl, .pal {
padding-bottom: 20px; }
.pln, .phn, .pan {
padding-left: 0; }
.plx, .phx, .pax {
padding-left: 3px; }
.pls, .phs, .pas {
padding-left: 5px; }
.plm, .phm, .pam {
padding-left: 10px; }
.pll, .phl, .pal {
padding-left: 20px; }
.mtn, .mvn, .man {
margin-top: 0px; }
.mtx, .mvx, .max {
margin-top: 3px; }
.mts, .mvs, .mas {
margin-top: 5px; }
.mtm, .mvm, .mam {
margin-top: 10px; }
.mtl, .mvl, .mal {
margin-top: 20px; }
.mrn, .mhn, .man {
margin-right: 0px; }
.mrx, .mhx, .max {
margin-right: 3px; }
.mrs, .mhs, .mas {
margin-right: 5px; }
.mrm, .mhm, .mam {
margin-right: 10px; }
.mrl, .mhl, .mal {
margin-right: 20px; }
.mbn, .mvn, .man {
margin-bottom: 0px; }
.mbx, .mvx, .max {
margin-bottom: 3px; }
.mbs, .mvs, .mas {
margin-bottom: 5px; }
.mbm, .mvm, .mam {
margin-bottom: 10px; }
.mbl, .mvl, .mal {
margin-bottom: 20px; }
.mln, .mhn, .man {
margin-left: 0px; }
.mlx, .mhx, .max {
margin-left: 3px; }
.mls, .mhs, .mas {
margin-left: 5px; }
.mlm, .mhm, .mam {
margin-left: 10px; }
.mll, .mhl, .mal {
margin-left: 20px; }
| hamedabdy/l3o2 | public/css/flat-ui.css | CSS | mit | 17,760 |
"use strict";
// What is an Adapter?
// ---
// What isn't an Adapter?
// It's not a Controller.
//
// TODO
// ---
// 2014/05/22 - Peter will add some comments
// Dependencies
// ---
var _ = require('lodash');
var Promise = require('bluebird');
var Backbone = require('backbone');
var request = require('request');
module.exports = Backbone.Model.extend({
urlRoot: "",
baseUrl: function() {
return this.urlRoot;
},
// Build the request options config object
buildRequestOptions: function(options) {
var err;
options = options || {};
// Validate options
if (!options.url && !options.path) {
options.path = "";
}
// Computed Base URL
var baseUrl = (typeof(this.baseUrl) === "function") ? this.baseUrl() : this.baseUrl;
// Prepare the request
var requestOptions = {
method: options.method || 'GET',
url: options.url || baseUrl + options.path,
qs: options.qs || {},
headers: {}
};
if (!_.isNull(options.json) && !_.isUndefined(options.json)) {
requestOptions.json = options.json;
} else {
requestOptions.json = true;
}
if (options.access_token) {
requestOptions.access_token = options.access_token;
}
// Optionally attach access_token
var access_token = options.access_token || this.get("access_token");
if (access_token) {
requestOptions.access_token = access_token;
_.defaults(requestOptions.headers, {
"Authorization": "Bearer: " + access_token
});
}
var oauth_token = options.oauth_token || this.get("oauth_token");
if (oauth_token) {
requestOptions.oauth_token = oauth_token;
_.defaults(requestOptions.headers, {
"Authorization": "OAuth " + oauth_token
});
}
var authorization_token = options.authorization_token || this.get("authorization_token");
if (authorization_token) {
requestOptions.authorization_token = authorization_token;
_.defaults(requestOptions.headers, {
"Authorization": authorization_token
});
}
// Optionally include FORM or BODY
if (options.form) {
requestOptions.form = options.form;
requestOptions.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8";
} else if (options.body) {
requestOptions.body = options.body;
}
if (options.headers) {
_.defaults(requestOptions.headers, options.headers);
}
// auth for affirm
if (options.auth) {
requestOptions.auth = options.auth;
}
return requestOptions;
},
// Send the http request
sendRequest: function(options, callback) {
// Create a promise to defer to later
var deferred = Promise.defer();
var requestOptions = this.buildRequestOptions(options);
// Fire the request
request(requestOptions, function(error, response, body) {
this.LAST_REQUEST = requestOptions;
this.LAST_ERROR = error;
this.LAST_RESPONSE = response;
this.LAST_BODY = body;
if (error) {
var message = error.message || response.meta && response.meta.error_message;
console.warn("Request error: %s", message);
if (callback) {
callback(error);
}
return deferred.reject(error);
} else if (response.statusCode >= 400) {
error = new Error(this.extractError(body));
error.code = response.statusCode;
console.warn("Request failed with code: %d and message: %s", error.code, error.message);
if (callback) {
callback(error);
}
return deferred.reject(error);
}
if (callback) {
callback(null, body);
}
return deferred.resolve(body);
}.bind(this));
return deferred.promise;
},
// If there's an error, try your damndest to find it. APIs hide errors in all sorts of places these days
extractError: function(body) {
if (_.isString(body)) {
return body;
} else if (_.isObject(body) && _.isString(body.error)) {
return body.error;
} else if (_.isObject(body) && _.isString(body.msg)) {
return body.msg;
} else if (_.isObject(body) && _.isObject(body.error)) {
return this.extractError(body.error);
} else if (_.isObject(body) && _.isString(body.message)) {
return body.message;
} else if (_.isObject(body) && body.meta && _.isString(body.meta.error_message)) {
return body.meta.error_message;
} else {
return "Unknown Error";
}
},
});
| badave/bootie | adapter.js | JavaScript | mit | 4,504 |
package com.iheartradio.m3u8;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import com.iheartradio.m3u8.data.Playlist;
import com.iheartradio.m3u8.data.StartData;
class ExtLineParser implements LineParser {
private final IExtTagParser mTagParser;
ExtLineParser(IExtTagParser tagParser) {
mTagParser = tagParser;
}
@Override
public void parse(String line, ParseState state) throws ParseException {
if (mTagParser.hasData()) {
if (line.indexOf(Constants.EXT_TAG_END) != mTagParser.getTag().length() + 1) {
throw ParseException.create(ParseExceptionType.MISSING_EXT_TAG_SEPARATOR, mTagParser.getTag(), line);
}
}
}
static final IExtTagParser EXTM3U_HANDLER = new IExtTagParser() {
@Override
public String getTag() {
return Constants.EXTM3U_TAG;
}
@Override
public boolean hasData() {
return false;
}
@Override
public void parse(String line, ParseState state) throws ParseException {
if (state.isExtended()) {
throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
}
state.setExtended();
}
};
static final IExtTagParser EXT_UNKNOWN_HANDLER = new IExtTagParser() {
@Override
public String getTag() {
return null;
}
@Override
public boolean hasData() {
return false;
}
@Override
public void parse(String line, ParseState state) throws ParseException {
state.unknownTags.add(line);
}
};
static final IExtTagParser EXT_X_VERSION_HANDLER = new IExtTagParser() {
private final ExtLineParser lineParser = new ExtLineParser(this);
@Override
public String getTag() {
return Constants.EXT_X_VERSION_TAG;
}
@Override
public boolean hasData() {
return true;
}
@Override
public void parse(String line, ParseState state) throws ParseException {
lineParser.parse(line, state);
final Matcher matcher = ParseUtil.match(Constants.EXT_X_VERSION_PATTERN, line, getTag());
if (state.getCompatibilityVersion() != ParseState.NONE) {
throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
}
final int compatibilityVersion = ParseUtil.parseInt(matcher.group(1), getTag());
if (compatibilityVersion < Playlist.MIN_COMPATIBILITY_VERSION) {
throw ParseException.create(ParseExceptionType.INVALID_COMPATIBILITY_VERSION, getTag(), line);
}
if (compatibilityVersion > Constants.MAX_COMPATIBILITY_VERSION) {
throw ParseException.create(ParseExceptionType.UNSUPPORTED_COMPATIBILITY_VERSION, getTag(), line);
}
state.setCompatibilityVersion(compatibilityVersion);
}
};
static final IExtTagParser EXT_X_START = new IExtTagParser() {
private final LineParser lineParser = new ExtLineParser(this);
private final Map<String, AttributeParser<StartData.Builder>> HANDLERS = new HashMap<>();
{
HANDLERS.put(Constants.TIME_OFFSET, new AttributeParser<StartData.Builder>() {
@Override
public void parse(Attribute attribute, StartData.Builder builder, ParseState state) throws ParseException {
builder.withTimeOffset(ParseUtil.parseFloat(attribute.value, getTag()));
}
});
HANDLERS.put(Constants.PRECISE, new AttributeParser<StartData.Builder>() {
@Override
public void parse(Attribute attribute, StartData.Builder builder, ParseState state) throws ParseException {
builder.withPrecise(ParseUtil.parseYesNo(attribute, getTag()));
}
});
}
@Override
public String getTag() {
return Constants.EXT_X_START_TAG;
}
@Override
public boolean hasData() {
return true;
}
@Override
public void parse(String line, ParseState state) throws ParseException {
if (state.startData != null) {
throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
}
final StartData.Builder builder = new StartData.Builder();
lineParser.parse(line, state);
ParseUtil.parseAttributes(line, builder, state, HANDLERS, getTag());
state.startData = builder.build();
}
};
}
| iheartradio/open-m3u8 | src/main/java/com/iheartradio/m3u8/ExtLineParser.java | Java | mit | 4,833 |
#! /bin/sh -e
[[ "$DEBUG" == "true" ]] && set -x
exec "$@" | bertuss/docker-transmission | entrypoint.sh | Shell | mit | 60 |
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* *
* 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. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___PROPERTYOWNER___H__
#define __OPENSPACE_CORE___PROPERTYOWNER___H__
#include <openspace/documentation/documentationgenerator.h>
#include <map>
#include <string>
#include <vector>
namespace openspace::properties {
class Property;
/**
* A PropertyOwner can own Propertys or other PropertyOwner and provide access to both in
* a unified way. The <code>identifier</code>s and <code>name</code>s of Propertys and
* sub-owners must be unique to this PropertyOwner. A Property cannot have the same name
* as a PropertyOwner owned by this PropertyOwner.
* Propertys can be added using the Property::addProperty methods and be removed by the
* Property::removeProperty method. The same holds true for sub-owners
* (Property::addPropertySubOwner, Property::removePropertySubOwner). These methods will
* inform the passed object about the new ownership automatically.
* Stored properties can be accessed using the Property::properties method or the
* Property::property method, providing an URI for the location of the property. If the
* URI contains separators (<code>.</code>), the first name before the separator will be
* used as a subOwner's name and the search will proceed recursively.
*/
class PropertyOwner : public DocumentationGenerator {
public:
/// The separator that is used while accessing the properties and/or sub-owners
static const char URISeparator = '.';
struct PropertyOwnerInfo {
std::string identifier;
std::string guiName = "";
std::string description = "";
};
/**
* The constructor of PropertyOwner.
*
* \param info The PropertyOwnerInfo struct that contains the
* #PropertyOwnerInfo::identifier, #PropertyOwnerInfo::guiName, and
* #PropertyOwnerInfo::description of this PropertyOwner.
*
* \pre The \p info 's #PropertyOwnerInfo::identifier must not contain any whitespaces
* \pre The \p info 's #PropertyOwnerInfo::identifier must not contain any
* <code>.</code>
*/
PropertyOwner(PropertyOwnerInfo info);
/**
* The destructor will remove all Propertys and PropertyOwners it owns along with
* itself.
*/
virtual ~PropertyOwner();
/**
* Sets the identifier for this PropertyOwner. If the PropertyOwner does not have an
* owner itself, the identifier must be globally unique. If the PropertyOwner has an
* owner, the identifier must be unique to the owner (including the owner's
* properties). No uniqueness check will be preformed here, but rather in the
* PropertyOwner::addProperty and PropertyOwner::addPropertySubOwner methods).
*
* \param identifier The identifier of this PropertyOwner. It must not contain any
* <code>.</code>s or whitespaces
*
* \pre \p identifier must not contain any whitespaces
* \pre \p identifier must not contain any <code>.</code>
*/
void setIdentifier(std::string identifier);
/**
* Returns the identifier of this PropertyOwner.
*
* \return The identifier of this PropertyOwner
*/
const std::string& identifier() const;
/**
* Sets the user-facing name of this PropertyOwner. This name does not have to be
* unique, but it is recommended to be.
*
* \param guiName The new user-facing name for this PropertyOwner
*/
void setGuiName(std::string guiName);
/**
* Returns the current user-facing name for this PropertyOwner.
*
* \return The current user-facing name for this PropertyOwner
*/
const std::string& guiName() const;
void setDescription(std::string description);
const std::string& description() const;
/**
* Returns a list of all Propertys directly owned by this PropertyOwner. This list not
* include Propertys owned by other sub-owners.
*
* \return A list of all Propertys directly owned by this PropertyOwner
*/
const std::vector<Property*>& properties() const;
/**
* Returns a list of all Propertys directly or indirectly owned by this PropertyOwner.
*
* \return A list of all Propertys directly or indirectly owned by this PropertyOwner
*/
std::vector<Property*> propertiesRecursive() const;
/**
* Retrieves a Property identified by \p uri from this PropertyOwner. If \p uri does
* not contain a <code>.</code> the identifier must refer to a Property directly owned
* by this PropertyOwner. If the identifier contains one or more <code>.</code>, the
* first part of the name will be recursively extracted and used as a name for a
* sub-owner and only the last part of the identifier is referring to a Property owned
* by PropertyOwner named by the second-but-last name.
*
* \param uri The identifier of the Property that should be extracted
* \return If the Property cannot be found, \c nullptr is returned, otherwise the
* pointer to the Property is returned
*/
Property* property(const std::string& uri) const;
/**
* This method checks if a Property with the provided \p uri exists in this
* PropertyOwner (or any sub-owner). If the identifier contains one or more
* <code>.</code>, the first part of the name will be recursively extracted and is
* used as a name for a sub-owner and only the last part of the identifier is
* referring to a Property owned by PropertyOwner named by the second-but-last name.
*
* \return \c true if the \p uri refers to a Property; \c false otherwise.
*/
bool hasProperty(const std::string& uri) const;
/**
* This method checks if a Property exists in this PropertyOwner.
* \return <code>true</code> if the Property existed, <code>false</code> otherwise.
*/
bool hasProperty(const Property* prop) const;
void setPropertyOwner(PropertyOwner* owner) { _owner = owner; }
PropertyOwner* owner() const { return _owner; }
/**
* Returns a list of all sub-owners this PropertyOwner has. Each name of a sub-owner
* has to be unique with respect to other sub-owners as well as Property's owned by
* this PropertyOwner.
*
* \return A list of all sub-owners this PropertyOwner has
*/
const std::vector<PropertyOwner*>& propertySubOwners() const;
/**
* This method returns the direct sub-owner of this PropertyOwner with the provided
* \p identifier. This means that <code>identifier</code> cannot contain any
* <code>.</code> as this character is not allowed in PropertyOwner names. If the
* \p name does not name a valid sub-owner of this PropertyOwner, a \c nullptr will be
* returned.
*
* \param identifier The identifier of the sub-owner that should be returned
* \return The PropertyOwner with the given \p name, or \c nullptr
*/
PropertyOwner* propertySubOwner(const std::string& identifier) const;
/**
* Returns \c true if this PropertyOwner owns a sub-owner with the provided
* \p identifier; returns \c false otherwise.
*
* \param identifier The identifier of the sub-owner that should be looked up
* \return \c true if this PropertyOwner owns a sub-owner with the provided
* \p identifier; returns \c false otherwise
*/
bool hasPropertySubOwner(const std::string& identifier) const;
/**
* This method converts a provided \p groupID, used by the Propertys, into a
* human-readable \p identifier which can be used by some external application.
*
* \param groupID The group identifier whose human-readable identifier should be set
* \param identifier The human-readable name for the group identifier
*/
void setPropertyGroupName(std::string groupID, std::string identifier);
/**
* Returns the human-readable name for the \p groupID for the Propertys of this
* PropertyOwner.
*
* \param groupID The group identifier whose human-readable name should be returned
* \return The human readable name for the Propertys identified by \p groupID
*/
std::string propertyGroupName(const std::string& groupID) const;
/**
* Assigns the Property \p prop to this PropertyOwner. This method will check if the
* name of the Property is unique amongst Propertys and sub-owners in this
* PropertyOwner. This method will also inform the Property about the change in
* ownership by calling the Property::setPropertyOwner method.
*
* \param prop The Property whose ownership is changed.
*/
void addProperty(Property* prop);
/// \see Property::addProperty(Property*)
void addProperty(Property& prop);
/**
* Adds the provided PropertyOwner to the list of sub-owners for this PropertyOwner.
* This means that the name of the \p owner has to be unique amonst the direct
* Property's as well as other PropertyOwner's that this PropertyOwner owns. This
* uniqueness will be tested in this method.
*
* \param owner The owner that should be assigned to this PropertyOwner
*/
void addPropertySubOwner(PropertyOwner* owner);
/// \see PropertyOwner::addPropertySubOwner(PropertyOwner*)
void addPropertySubOwner(PropertyOwner& owner);
/**
* Removes the Property from this PropertyOwner. Notifies the Property about this
* change by calling the Property::setPropertyOwner method with a \c nullptr as
* parameter.
*
* \param prop The Property that should be removed from this PropertyOwner
*/
void removeProperty(Property* prop);
/// \see PropertyOwner::removeProperty(Property*)
void removeProperty(Property& prop);
/**
* Removes the sub-owner from this PropertyOwner.
*
* \param owner The PropertyOwner that should be removed
*/
void removePropertySubOwner(PropertyOwner* owner);
/// \see PropertyOwner::removePropertySubOwner(PropertyOwner*)
void removePropertySubOwner(PropertyOwner& owner);
/**
* Returns a list of all tags that have been assigned to the Property. Useful for
* trying to find a match for a desired batch operation on Properties.
*
* \return Pointer to vector of string tags that were assigned to the Property
*/
const std::vector<std::string>& tags() const;
/**
* Adds a tag to the PropertyOwner's list of assigned tags. Tags are useful for
* creating oups of Properties that can be used in batch operations or to mark up
* PropertyOwners for other usages (such signalling to GUI applications).
*
* \param tag The string that is to be assigned to the Property
*/
void addTag(std::string tag);
/**
* Removes a tag from this PropertyOwner. No error is reported if the tag does not
* exist.
*
* \param tag The tag is that is to be removed from this PropertyOwner
*/
void removeTag(const std::string& tag);
// Generate JSON for documentation
std::string generateJson() const override;
protected:
/// The unique identifier of this PropertyOwner
std::string _identifier;
/// The user-facing GUI name for this PropertyOwner
std::string _guiName;
/// The description for this PropertyOwner
std::string _description;
/// The owner of this PropertyOwner
PropertyOwner* _owner = nullptr;
/// A list of all registered Property's
std::vector<Property*> _properties;
/// A list of all sub-owners
std::vector<PropertyOwner*> _subOwners;
/// The associations between group identifiers of Property's and human-readable names
std::map<std::string, std::string> _groupNames;
/// Collection of string tag(s) assigned to this property
std::vector<std::string> _tags;
};
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___PROPERTYOWNER___H__
| OpenSpace/OpenSpace | include/openspace/properties/propertyowner.h | C | mit | 13,993 |
package com.kotkovets.fines.modules.launcher.view;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.kotkovets.fines.R;
/**
* A placeholder fragment containing a simple view.
*/
public class LauncherActivityFragment extends Fragment {
public LauncherActivityFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_launcher, container, false);
}
}
| igorkotkovets/android-auto-fines | app/src/main/java/com/kotkovets/fines/modules/launcher/view/LauncherActivityFragment.java | Java | mit | 642 |
module Trigger
class Event
attr_reader :data
def initialize(name, data={})
@event_name = EventName.new(name)
@data = data
@data = Hash.new unless @data.is_a?(Hash)
end
def name
@event_name.name
end
def namespace
@event_name.namespace
end
def full_name
@event_name.full_name
end
# convenience method to access data properties
# event[key] is just a shortcut for event.data[key]
def [](key)
@data[key]
end
end
class EventName
attr_accessor :name, :namespace
def initialize(name)
@name, @namespace = self.class.parse(name)
end
def full_name
return @name if @namespace.nil?
[@name, @namespace].join(':')
end
def self.parse(name)
name, namespace = name.to_s.split(':')
namespace = namespace || namespace
namespace = nil if namespace == ''
return name, namespace
end
end
class Subscriber
attr_accessor :event
def initialize(event_or_name, data={})
if Event === event_or_name
@event = event_or_name
else
@event = Event.new(event_or_name, data)
end
end
def perform
raise "Subscriber#perform not implemented"
end
def self.receive(event)
new(event).perform
end
end
module Client
# convenience method for creating a new client module
# effectively the same as:
# module SomeModule
# extend Trigger::Client
# end
def self.create
client = self
Module.new { extend client }
end
def subscribers
@subscribers ||= Hash.new { |h,k| h[k] = [] }
end
# returns all subscribers for given event name
# if the name is namespaced e.g.
# subscribers_for(:greet) #=> all :greet subscribers, tag ignored
# subscribers_for(:greet, 'spanish') #=> only :greet subscribers with tag 'spanish'
def subscribers_for(name)
event_name = EventName.new(name)
name = event_name.name.to_sym
namespace = event_name.namespace
result = subscribers[name]
result = result.map do |e|
e[:class] if namespace.nil? || e[:namespace] == namespace
end.compact
end
def create_inline_subscriber(&block)
Class.new do
define_singleton_method :receive, block
end
end
# creates a new subscriber for the given event name,
# which can be namespaced if desired using name:namespace
#
# the provided block, which is called whenever the subscribed
# event gets triggered, should accept a single parameter,
# commonly named +event+, which will be an instance of an
# Event object:
#
# client = Trigger::Client.new
# client.subscribe "greet" do |event|
# # handle event
# end
def subscribe(name, *args, &block)
if block_given?
# we received a block, so create a new subscriber inline
# and optional tag form args
subscriber = create_inline_subscriber(&block)
else
# no block, so the last argument is assumed to be a
# callback class
klass = args.pop
subscriber = klass
raise "Subscriber class must repond to .receive" unless subscriber.respond_to?(:receive)
end
name, namespace = EventName.parse(name)
subscribers[name.to_sym] << { :class => subscriber, :namespace => namespace }
subscriber
end
# build a new Event object for the given event name, tag and data
def build_event(name, data)
Event.new(name, data)
end
# triggers the given event name which will invoke +receive+ on
# all applicable subscribers
#
# arguments:
# name (required) -> event name
# tag (optional) -> tag for event filtering
# data (optional) -> data hash for event
#
# trigger(:greet, :name => "Chris") #=> name, data
# trigger(:greet, 'spanish', :name => "Chris") #=> name, tag, data
def trigger(name, data={})
event = build_event(name, data)
subscribers_for(event.full_name).each do |subscriber|
subscriber.receive(event)
end
end
# publish just invokes the trigger immediately
# subclasses may override this method to perform
# more advanced processing (such as queueing the event
# for later triggering)
def publish(name, data={})
trigger(name, data)
end
end
end
| scharfie/trigger | lib/trigger.rb | Ruby | mit | 4,400 |
<!doctype html><html lang="en"><head><title>LEAVES FROM LIFE >> artwork by Tessa D. Rice</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"><link rel="shortcut icon" href="favicon.ico"><link href="app.ceced8c5422f0cd69a0ed5cd1d6cad66.css" rel="stylesheet"></head><body><div id="root" style="height: 100%"></div><script src="vendor.817fabf8cc329141ceeb.js"></script><script src="app.d857e69b3e9279698246.js"></script></body></html> | alfonsoperez/tessa | dist/index.html | HTML | mit | 575 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.