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
// // MainPage.xaml.h // Declaration of the MainPage class. // #pragma once #include "MainPage.g.h" namespace AccelerometerAndSimpleOrientation { public ref class MainPage sealed { private: Windows::Devices::Sensors::Accelerometer^ accelerometer; Windows::Devices::Sensors::SimpleOrientationSensor^ simpleOrientationSensor; Windows::Foundation::EventRegistrationToken accelerometerEventToken; Windows::Foundation::EventRegistrationToken orientationEventToken; public: MainPage(); protected: virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; private: void OnMainPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args); void OnAccelerometerReadingChanged(Windows::Devices::Sensors::Accelerometer^ sender, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^ args); void SetAccelerometerText(Windows::Devices::Sensors::AccelerometerReading^ accelerometerReading); Platform::String^ Format(double number, int decimals); void OnSimpleOrientationChanged(Windows::Devices::Sensors::SimpleOrientationSensor^ sender, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs^ args); void SetOrientationSensorText(Windows::Devices::Sensors::SimpleOrientation simpleOrientation); }; }
nnaabbcc/exercise
windows/pw6e.official/CPlusPlus/Chapter18/AccelerometerAndSimpleOrientation/AccelerometerAndSimpleOrientation/MainPage.xaml.h
C
mit
1,624
<?php /* @WebProfiler/Profiler/base_js.html.twig */ class __TwigTemplate_d40c7b75ebadb9f8f53e2d9bd231acc992d57bed739a2b816abea4d1ec342b87 extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 1 echo "<script>/*<![CDATA[*/ Sfjs = (function() { \"use strict\"; var noop = function() {}, profilerStorageKey = 'sf2/profiler/', request = function(url, onSuccess, onError, payload, options) { var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); options = options || {}; options.maxTries = options.maxTries || 0; xhr.open(options.method || 'GET', url, true); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.onreadystatechange = function(state) { if (4 !== xhr.readyState) { return null; } if (xhr.status == 404 && options.maxTries > 1) { setTimeout(function(){ options.maxTries--; request(url, onSuccess, onError, payload, options); }, 500); return null; } if (200 === xhr.status) { (onSuccess || noop)(xhr); } else { (onError || noop)(xhr); } }; xhr.send(payload || ''); }, hasClass = function(el, klass) { return el.className && el.className.match(new RegExp('\\\\b' + klass + '\\\\b')); }, removeClass = function(el, klass) { if (el.className) { el.className = el.className.replace(new RegExp('\\\\b' + klass + '\\\\b'), ' '); } }, addClass = function(el, klass) { if (!hasClass(el, klass)) { el.className += \" \" + klass; } }, getPreference = function(name) { if (!window.localStorage) { return null; } return localStorage.getItem(profilerStorageKey + name); }, setPreference = function(name, value) { if (!window.localStorage) { return null; } localStorage.setItem(profilerStorageKey + name, value); }, requestStack = [], renderAjaxRequests = function() { var requestCounter = document.querySelectorAll('.sf-toolbar-ajax-requests'); if (!requestCounter.length) { return; } var tbodies = document.querySelectorAll('.sf-toolbar-ajax-request-list'); var state = 'ok'; if (tbodies.length) { var tbody = tbodies[0]; var rows = document.createDocumentFragment(); if (requestStack.length) { for (var i = 0; i < requestStack.length; i++) { var request = requestStack[i]; var row = document.createElement('tr'); rows.appendChild(row); var methodCell = document.createElement('td'); methodCell.textContent = request.method; row.appendChild(methodCell); var pathCell = document.createElement('td'); pathCell.className = 'sf-ajax-request-url'; pathCell.textContent = request.url; pathCell.setAttribute('title', request.url); row.appendChild(pathCell); var durationCell = document.createElement('td'); durationCell.className = 'sf-ajax-request-duration'; if (request.duration) { durationCell.textContent = request.duration + \"ms\"; } else { durationCell.textContent = '-'; } row.appendChild(durationCell); row.appendChild(document.createTextNode(' ')); var profilerCell = document.createElement('td'); if (request.profilerUrl) { var profilerLink = document.createElement('a'); profilerLink.setAttribute('href', request.profilerUrl); profilerLink.textContent = request.profile; profilerCell.appendChild(profilerLink); } else { profilerCell.textContent = 'n/a'; } row.appendChild(profilerCell); var requestState = 'ok'; if (request.error) { requestState = 'error'; if (state != \"loading\" && i > requestStack.length - 4) { state = 'error'; } } else if (request.loading) { requestState = 'loading'; state = 'loading' } row.className = 'sf-ajax-request sf-ajax-request-' + requestState; } var infoSpan = document.querySelectorAll(\".sf-toolbar-ajax-info\")[0]; var children = Array.prototype.slice.call(tbody.children); for (var i = 0; i < children.length; i++) { tbody.removeChild(children[i]); } tbody.appendChild(rows); if (infoSpan) { var text = requestStack.length + ' call' + (requestStack.length > 1 ? 's' : ''); infoSpan.textContent = text; } } else { var cell = document.createElement('td'); cell.setAttribute('colspan', '4'); cell.textContent = \"No AJAX requests yet.\"; var row = document.createElement('tr'); row.appendChild(cell); tbody.appendChild(row); } } requestCounter[0].textContent = requestStack.length; var className = 'sf-toolbar-ajax-requests sf-toolbar-status'; if (state == 'ok') { className += ' sf-toolbar-status-green'; } else if (state == 'error') { className += ' sf-toolbar-status-red'; } else { className += ' sf-ajax-request-loading'; } requestCounter[0].className = className; }; "; // line 174 if (array_key_exists("excluded_ajax_paths", $context)) { // line 175 echo " var proxied = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function(method, url, async, user, pass) { var self = this; /* prevent logging AJAX calls to static and inline files, like templates */ if (url.substr(0, 1) === '/' && !url.match(new RegExp(\""; // line 181 echo twig_escape_filter($this->env, (isset($context["excluded_ajax_paths"]) ? $context["excluded_ajax_paths"] : $this->getContext($context, "excluded_ajax_paths")), "html", null, true); echo "\"))) { var stackElement = { loading: true, error: false, url: url, method: method, start: new Date() }; requestStack.push(stackElement); this.addEventListener(\"readystatechange\", function() { if (self.readyState == 4) { stackElement.duration = new Date() - stackElement.start; stackElement.loading = false; stackElement.error = self.status < 200 || self.status >= 400; stackElement.profile = self.getResponseHeader(\"X-Debug-Token\"); stackElement.profilerUrl = self.getResponseHeader(\"X-Debug-Token-Link\"); Sfjs.renderAjaxRequests(); } }, false); Sfjs.renderAjaxRequests(); } proxied.apply(this, Array.prototype.slice.call(arguments)); }; "; } // line 210 echo " return { hasClass: hasClass, removeClass: removeClass, addClass: addClass, getPreference: getPreference, setPreference: setPreference, request: request, renderAjaxRequests: renderAjaxRequests, load: function(selector, url, onSuccess, onError, options) { var el = document.getElementById(selector); if (el && el.getAttribute('data-sfurl') !== url) { request( url, function(xhr) { el.innerHTML = xhr.responseText; el.setAttribute('data-sfurl', url); removeClass(el, 'loading'); (onSuccess || noop)(xhr, el); }, function(xhr) { (onError || noop)(xhr, el); }, '', options ); } return this; }, toggle: function(selector, elOn, elOff) { var i, style, tmp = elOn.style.display, el = document.getElementById(selector); elOn.style.display = elOff.style.display; elOff.style.display = tmp; if (el) { el.style.display = 'none' === tmp ? 'none' : 'block'; } return this; } } })(); /*]]>*/</script> "; } public function getTemplateName() { return "@WebProfiler/Profiler/base_js.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 236 => 210, 204 => 181, 196 => 175, 194 => 174, 19 => 1,); } }
AradhanaR/SymfApp2
app/cache/dev/twig/d4/0c/7b75ebadb9f8f53e2d9bd231acc992d57bed739a2b816abea4d1ec342b87.php
PHP
mit
11,476
# GData Plus Extending GData to provide a nicer, ruby-like interface to certain APIs. This is currently just a meagre prototype. Beware, this is my first exploration of Nokogiri, although I'm quite seasoned with GData. ## Example require 'rubygems' require 'gdata' require 'gdataplus' service = Google::Client::Spreadsheets.new service.clientlogin '[email protected]', 'my-password' spreadsheets = service.spreadsheets spreadsheet = spreadsheets.first worksheet = spreadsheet.first worksheet.title => "My Fabulous Worksheet" worksheet[2, 2] => "Cell contents" worksheet[2, 1] = "See:" worksheet[2, 2] = "New content" worksheet[2, 2] => "New content" worksheet.save => true ## Copying Whatever. See LICENSE.
sj26/gdataplus
README.md
Markdown
mit
783
import winston from 'winston'; import winstonExpressMiddleWare from 'winston-express-middleware'; import 'winston-logstash'; winstonExpressMiddleWare.requestWhitelist.push('connection.remoteAddress'); // console logger with custom formatting to handle request visualization const transports = [ new winston.transports.Console({ colorize: true, label: 'login', formatter: (options) => { const hasMeta = options.meta && Object.keys(options.meta).length; const isAccessLog = hasMeta && options.meta.req && options.meta.res; const label = (options.label ? options.label : ''); const message = (options.message ? options.message : ''); const metaData = (hasMeta && !isAccessLog ? `\n\t ${JSON.stringify(options.meta)}` : ''); return `${options.level.toUpperCase()} [${label}] ${message} ${metaData}`; }, }), ]; // TODO: make this configurable via command line if (process.env.LOGSTASH_SERVICE_HOST) { transports.push( new (winston.transports.Logstash)({ port: process.env.LOGSTASH_SERVICE_PORT, label: 'login', host: process.env.LOGSTASH_SERVICE_HOST, timeout_connect_retries: 10000, // retry after 10 seconds max_connect_retries: 10, // retry 10 times }) ); } // logging instance for HTTP access logs export const accessLogger = winstonExpressMiddleWare.logger({ transports, ignoreRoute: (req, res) => { // use the error logger for 500's, that adds the stack trace if (res.statusCode === 500) { return true; } return false; }, statusLevels: true, expressFormat: true, }); // logging instance for HTTP error logs export const errorLogger = winstonExpressMiddleWare.errorLogger({ transports, }); // logging instance for general purpose logging export const logger = new (winston.Logger)({ transports, });
hharnisc/login-service
service/src/logging.js
JavaScript
mit
1,839
#pragma once #include "Entity.hpp" #include "EntityManager.hpp" #include "Point.hpp" namespace kengine::CameraHelper { struct ViewportInfo { Entity::ID camera = Entity::INVALID_ID; putils::Point2f pixel = { -1.f, -1.f }; // [0,1] }; ViewportInfo getViewportForPixel(EntityManager & em, Entity::ID windowID, const putils::Point2ui & pixel); }
phiste/kengine
helpers/CameraHelper.hpp
C++
mit
352
.fillcont { background: #f9ffcf; } .container { max-width: 1094px; /* or 950px */ } .container.superwide{ max-width: 1094px; /* or 950px */ width: 100%; } .stopbox{ margin-left: auto; white-space: nowrap; width: 94vw; height: 42vw; max-width: 1094px; max-height: 547px; } .box{ position: relative; width: 100%; height: 100%; } .box2{ display: inline-block; position: relative; margin-left: auto; width: 50%; height: 100%; white-space: nowrap; max-width: 547px; max-height: 547px; } .sbncontent{ position: absolute; top: 0; left: 0; bottom: 0; right: 0; border-style: solid; border-width: 2px; } .centered{ text-align: center; } .stopboxdyn{ margin-left: auto; white-space: nowrap; width: 94vw; max-width: 1094px; max-height: 648px; } circle { stroke-width: 1.5px; } line { stroke: #999; stroke-opacity:.6; } #ex1Slider .slider-selection { background: red; } #ex13Slider{ width: 75% !important; } #ex13Slider .slider-track { background: #FFDDAA; } #ex13Slider .slider-tick { background: #FF9933; } #ex13Slider.ranged .slider-tick.in-selection { background: #009933; } #ex13Slider.discreet .slider-selection { background-image: none; background: none; } #ex13Slider.ranged .slider-selection { background-image: linear-gradient(to bottom,#149bdf 0,#0480be 100%); } .methodParam{ border-bottom: 1px dotted #000; } div.tooltip { position: absolute; text-align: left; padding: 2px; font: 12px sans-serif; background: lightsteelblue; border: 0px; border-radius: 8px; pointer-events: none; } div.tooltip.link { background: #99cc99; } div.nodeLabelp { z-index: 999; } .sdev{ color: #67a9cf; } .infsys{ color: #ef8a62; } .coolImg{ width:100%; height:100%; }
dooglz/TemporalD3
css/game.css
CSS
mit
1,855
/** * Created by Tarnos on 2017-01-07. */ lotfw.factory('itemDrop', function(Game, itemTable, logService){ function ItemDrop(){ this.rarityMod = [0.75, 1, 1.25, 1.5, 2, 2.5, 3, 4, 5, 10]; } ItemDrop.prototype.getRarity = function(item){ var min = 0; var max = 1000; if(item.iLvl <= 20){ max = 800; }else if(item.iLvl <= 30){ max = 9000 }else if(item.iLvl <= 40){ min = 500; max = 950; }else if(item.iLvl <= 50){ min = 650; max = 10000; }else if (item.iLvl <= 60){ min = 800; max = 10000; } var random = Math.floor(Math.random() * 1000) + 1; var index = random > 9990 ? 6 : random > 9500 ? 5 : random > 9000 ? 4 : random > 800 ? 3 : random > 650 ? 2: random > 500 ? 1: 0; return index; }; ItemDrop.prototype.filterByName = function(value) { return function (element) { return element.name === value; }; }; ItemDrop.prototype.filterByLevel = function(level) { return function (element) { return ((element.ilvl + 3) >= level && (element.ilvl - 3) <= level); } }; //finds an item which is equal or less than a level specified ItemDrop.prototype.closestLevel = function(arr, level){ var curr = arr[0].ilvl; var diff = Math.abs(level - curr); for(var i = 0; i < arr.length; i++){ var newdiff = Math.abs(level - arr[i].ilvl); if(newdiff < diff){ diff = newdiff; curr = i; } } return arr[curr]; }; //search for an item based on the name. ItemDrop.prototype.dropItemByName = function(itemType){ for(var type in itemTable.items.equipment){ if(itemTable.items.equipment.hasOwnProperty(type)){ for(var item in itemTable.items.equipment[type]){ if(itemTable.items.equipment[type].hasOwnProperty(item)){ var arr = itemTable.items.equipment[type][item]; var items = arr.filter(this.filterByName(itemType)); if(items.length >0) { return items[0]; } } } } } }; ItemDrop.prototype.searchItemType = function(prop, obj) { obj = obj || itemTable.items; var val = obj[prop]; if (obj[prop] !== undefined) { return val; } if (!(Object.prototype.toString.call(obj) === '[object Array]')) { for (var key in obj) { if (obj.hasOwnProperty(key)) { var result = this.searchItemType(prop, obj[key]); if (result !== undefined) { return result; } } } }else{ for(var i = 0; i < obj.length; i++){ if(obj[i].name === prop){ return obj[i]; } } } return undefined; }; //random item based on a property we give //for example "equipment" will pick any random item, weapon/armor/accessory/potion //might add some additional conditions such as "near level" ItemDrop.prototype.randomItemNearLevel = function(obj, level){ var item = []; var name = obj; var prop = ""; //picks random item type based on "obj" we pass, ex. We pass "weapon", it will pick random type(sword/axe etc) //if we pass "equipment" it will choose random weapon/armor/accessory/ etc, until it reach axe/helmet/ring //which is an array while(!(Object.prototype.toString.call(name) === '[object Array]')){ prop = pickRandomProperty(name); name = name[prop]; } item = name.filter(this.filterByLevel(level)); if(item.length < 1){ //find closest item if filter above fails when selected level is too small in range to the item levels. item = this.closestLevel(name, level); }else{ //choose random item if an array have more than 1 item = item[Math.floor(Math.random()*item.length)]; } return item; }; ItemDrop.prototype.dropItem = function(val, level, chance){ var rand = Math.random() * 100; var item = {}; var itemType = {}; if(rand > chance){ logService.log("Failed to drop an item: " + chance + "%" + " chance to drop"); return; } itemType = this.searchItemType(val); if(itemType.name){ item = itemType; }else{ item = this.randomItemNearLevel(itemType, level); } return deepClone(this.createStats(item)); }; ItemDrop.prototype.createStats = function(item){ var rarityIndex = this.getRarity(item); var rarityMod = this.rarityMod[rarityIndex]; item.rarity = itemTable.itemRarities[rarityIndex];//random for now item.stats = {}; for(var i = 0; i< 2 + rarityIndex;i++){ var rand = Math.floor(Math.random() * 5) + 1; var randStat = Game.stats[Math.floor(Math.random()*Game.stats.length)]; var randomMult = 1 + (Math.floor(Math.random() * 50) + 1) / 100; if(rand > 2){ for(var j = 0; j < item.preferedStat.length; j++){ if(item.stats[item.preferedStat[j]]){ item.stats[item.preferedStat[j]] += Math.round(item.ilvl * rarityMod * randomMult); }else{ item.stats[item.preferedStat[j]] = Math.round(item.ilvl * rarityMod * randomMult); } } }else{ if(item.stats[randStat]){ item.stats[randStat] += Math.round(item.ilvl * rarityMod * randomMult); }else{ item.stats[randStat] = Math.round(item.ilvl * rarityMod * randomMult); } } } return item; }; return new ItemDrop(); });
tarnos12/project2
js/services/itemDrop.js
JavaScript
mit
6,359
--- title: 'Nestydí se je nazývat bratry' date: 17/01/2022 --- > <p></p> > A on, který posvěcuje, i ti, kdo jsou posvěcováni, jsou z téhož Otce. Proto se nestydí nazývat je svými bratry... (Žd 2,11) > <p></p> > 24Mojžíš věřil, a proto, když dospěl, odepřel nazývat se synem faraónovy dcery. 25Raději chtěl snášet příkoří s Božím lidem než na čas žít příjemně v hříchu; 26a Kristovo pohanění pokládal za větší bohatství než všechny poklady Egypta, neboť upíral svou mysl k budoucí odplatě. (Žd 11,24–26) **Osobní studium** List Židům říká, že se Ježíš nestyděl nazývat nás svými bratry (Žd 2,11). Přestože byl Ježíš jedno s Bohem, přijal nás za součást své rodiny. Tato solidarita je v kontrastu s posměšky ze strany veřejnosti, kterými čtenáři listu trpěli ve svých komunitách (Žd 10,33). `V čem jsou podle úvodních veršů (Žd 11,24–26) Mojžíšova rozhodnutí příkladem toho, co pro nás Ježíš udělal?` Můžeš si představit, co to znamenalo pro Mojžíše, když ho nazývali „synem faraónovy dcery“? Zastával významné postavení v nejmocnější říši tehdejší doby. Získal nejvyšší civilní a vojenské vzdělání. Štěpán říká, že Mojžíš byl „mocný v slovech i činech“ (Sk 7,22). Ellen G. Whiteová také říká, že se stal „miláčkem egyptské armády“ a že se faraón „rozhodl, že svého adoptivního vnuka učiní následníkem trůnu“ (PP 245; NUD 116). Přesto se Mojžíš vzdal všech těchto privilegií, když se rozhodl ztotožnit se s Izraelity, s lidem otroků bez vzdělání a moci. **Co od nás Bůh požaduje podle následujících textů?** `Mt 10,32.33` `2Tm 1,8.12` `Žd 13,12–15` Toto byl pro čtenáře listu Židům problém. Po pronásledování a odmítnutí většinovou společností se mnozí z nich začali za Ježíše stydět. Někteří svými skutky Ježíše vystavovali hanbě namísto toho, aby jej ctili (Žd 6,6). Pavel proto opakovaně vyzývá čtenáře: „držme se toho, co vyznáváme“ (Žd 4,14; Žd 10,23). Bůh chce, abychom Ježíše Krista uznali za svého Boha a také za bratra. Ježíš jako náš Vykupitel zaplatil náš dluh. Jako náš bratr nám Ježíš ukázal, jak bychom měli žít, abychom „přijali podobu jeho Syna, tak aby byl prvorozený mezi mnoha bratřími“ (Ř 8,29). **Aplikace** `Zamysli se chvíli nad rozhodnutím, která musel Ježíš udělat, aby nás přijal jako „sourozence“. Proč bylo to, co Ježíš udělal, mnohem větším projevem milosti než Mojžíšovo rozhodnutí? Co se z toho můžeme naučit o Boží lásce k nám?` --- #### Dodatečné otázky k diskuzi `Co prožívali první křesťané od svých rodin, když přijali Ježíše?` `Setkal se někdo z vás po svém křtu se zhoršením vztahů s rodinou? Pokud ano, jak jste reagovali?` `Proč Pavel považuje Mojžíše za „předobraz“ Ježíše Krista? V čem se mu podobal?` `Jak moc tě ovlivňují vztahy v rodině?` `Co pro tebe znamená skutečnost, že jsi součástí Ježíšovy rodiny?` `Má Ježíš nějaký důvod k tomu, aby se za nás styděl? Jaký?` `Jak to, že se za nás Ježíš nestydí, i když mu k tomu dáváme tolik důvodů?` `Styděl ses někdy za Ježíše nebo svou víru? Proč?`
Adventech/sabbath-school-lessons
src/cs/2022-01/04/03.md
Markdown
mit
3,363
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using MetroLog.Internal; using MetroLog.Targets; using Xunit; namespace MetroLog.Tests { public class LogManagerBaseTests { [Fact] public void TestGetLogger() { var manager = new LogManagerBase(new LoggingConfiguration()); var logger = manager.GetLogger("Foobar"); Assert.NotNull(logger); } [Fact] public void TestGetLoggerByType() { var manager = new LogManagerBase(new LoggingConfiguration()); var logger = manager.GetLogger<LogManagerBaseTests>(); Assert.NotNull(logger); } [Fact] public void TestLoggerCreated() { bool called = false; var manager = new LogManagerBase(new LoggingConfiguration()); manager.LoggerCreated += (sender, args) => { called = true; }; // call... var logger = manager.GetLogger<LogManagerBaseTests>(); // check... Assert.True(called); } [Fact] public async Task TestGetZipNetFile() { var manager = new LogManagerBase(LogManagerFactory.CreateLibraryDefaultSettings()); manager.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); var logger = (ILoggerAsync)manager.GetLogger("test"); // send through a log entry... await logger.DebugAsync("Test Message"); var str = await manager.GetCompressedLogs(); var file = new FileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory, Environment.SpecialFolderOption.None), "logs.zip")); using (var stream = file.Create()) { await str.CopyToAsync(stream); } } } }
thomasgalliker/MetroLog
MetroLog.Tests/Tests/LogManagerTests.cs
C#
mit
2,053
# sdFormValidators Collection of angularjs form validators
sdum/sdFormValidators
README.md
Markdown
mit
59
import axios from '../../src/index' axios({ url: '/extend/post', method: 'post', data: { msg: 'hi' } }) axios.request({ url: '/extend/post', method: 'post', data: { msg: 'hello' } }) axios.get('/extend/get') axios.options('/extend/options') axios.delete('/extend/delete') axios.head('/extend/head') axios.post('/extend/post', { msg: 'post' }) axios.put('/extend/put', { msg: 'put' }) axios.patch('/extend/patch', { msg: 'patch' }) axios({ url: '/extend/post', method: 'post', data: { msg: 'hi' } }) axios('/extend/post', { method: 'post', data: { msg: 'hello' } }) interface ResponseData<T = any> { code: number result: T message: string } interface User { name: string age: number } function getUser<T>() { return axios<ResponseData<T>>('/extend/user') .then(res => res.data) .catch(err => console.error(err)) } async function test() { const user = await getUser<User>() if (user) { console.log(user.result.name) } } test()
csxiaoyaojianxian/JavaScriptStudy
18-TypeScript/axios/ts-axios/examples/extend/app.ts
TypeScript
mit
1,018
#!/bin/sh yum update -y # Required so that kernel sources are the same version as the running kernel, otherwise VirtualBox Additions could fail shutdown -r now sleep 60
lfrancke/packer-templates
scripts/centos/update.sh
Shell
mit
171
version https://git-lfs.github.com/spec/v1 oid sha256:261d4a02c2f96b26578ef32b1e55e041f778f5d23fa49e709bac8025fb09b55e size 15524
yogeshsaroya/new-cdnjs
ajax/libs/SlickNav/1.0.1/jquery.slicknav.js
JavaScript
mit
130
class ChangeRecipientToAlternateOnContest < ActiveRecord::Migration def change rename_column :contests, :recipient_id, :alternate_recipient_id end end
wrekatlanta/wrektranet
db/migrate/20130913030655_change_recipient_to_alternate_on_contest.rb
Ruby
mit
159
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./6c37de948c341472b97d1b05f16ff745d27726297473802311e54ff09507bcff.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/781add10b877f08b16d412320f95fcd626d1633620d332a6d980fa5762535173.html
HTML
mit
550
#M35 Measuring rotation periods in M35
RuthAngus/M35
README.md
Markdown
mit
40
/* * MIT License * * Copyright (c) 2014 Klemm Software Consulting, Mirko Klemm * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.kscs.util.plugins.xjc; import java.lang.reflect.Method; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Deque; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.JAXB; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchema; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; import javax.xml.transform.dom.DOMSource; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import com.kscs.util.jaxb.Buildable; import com.kscs.util.jaxb.Copyable; import com.kscs.util.jaxb.PartialCopyable; import com.kscs.util.jaxb.PropertyTree; import com.kscs.util.jaxb.PropertyTreeUse; import com.kscs.util.plugins.xjc.codemodel.JDirectInnerClassRef; import com.kscs.util.plugins.xjc.codemodel.JTypedInvocation; import com.kscs.util.plugins.xjc.outline.PropertyOutline; import com.sun.codemodel.JAssignmentTarget; import com.sun.codemodel.JBlock; import com.sun.codemodel.JCatchBlock; import com.sun.codemodel.JClass; import com.sun.codemodel.JCodeModel; import com.sun.codemodel.JConditional; import com.sun.codemodel.JExpr; import com.sun.codemodel.JExpression; import com.sun.codemodel.JFieldVar; import com.sun.codemodel.JForEach; import com.sun.codemodel.JInvocation; import com.sun.codemodel.JMethod; import com.sun.codemodel.JPackage; import com.sun.codemodel.JTryBlock; import com.sun.codemodel.JType; import com.sun.codemodel.JVar; import com.sun.codemodel.fmt.JStaticJavaFile; import com.sun.tools.xjc.Options; import com.sun.tools.xjc.Plugin; import com.sun.tools.xjc.model.CCustomizable; import com.sun.tools.xjc.model.CPluginCustomization; import com.sun.tools.xjc.outline.ClassOutline; import com.sun.tools.xjc.outline.EnumOutline; import com.sun.tools.xjc.outline.FieldOutline; import com.sun.tools.xjc.outline.Outline; import com.sun.xml.xsom.XSDeclaration; /** * Common context for all plugins implemented by this * plugin package */ public class PluginContext extends Plugin { public static final String FLUENT_CLASS_NAME = "Fluent"; public static final String FLUENT_INTERFACE_NAME = "FluentSupport"; public static final String BUILDER_CLASS_NAME = "Builder"; public static final String BUILDER_INTERFACE_NAME = "BuildSupport"; public static final String WRAPPER_CLASS_NAME = "Wrapper"; public static final String MODIFIER_CLASS_NAME = "Modifier"; public static final String WRAPPER_INTERFACE_NAME = "WrapSupport"; public static final String MODIFIER_INTERFACE_NAME = "ModifySupport"; public static final String BUILD_METHOD_NAME = "build"; public static final String MODIFY_METHOD_NAME = "apply"; public static final String INIT_METHOD_NAME = "init"; public static final String ADD_METHOD_PREFIX = "add"; public static final String WITH_METHOD_PREFIX = "with"; public static final String NEW_OBJECT_VAR_NAME = "_newObject"; public static final String ADD_ALL = "addAll"; public static final String CLONE_METHOD_NAME = "clone"; public static final String COPY_METHOD_NAME = "createCopy"; public static final String COPY_EXCEPT_METHOD_NAME = "copyExcept"; public static final String COPY_ONLY_METHOD_NAME = "copyOnly"; public static final String BUILD_COPY_METHOD_NAME = "copyOf"; public static final String NEW_BUILDER_METHOD_NAME = "builder"; public static final String NEW_MODIFIER_METHOD_NAME = "modifier"; public static final String NEW_COPY_BUILDER_METHOD_NAME = "newCopyBuilder"; public static final String COPY_TO_METHOD_NAME = "copyTo"; private static final String AS_LIST = "asList"; private static final String UNMODIFIABLE_LIST = "unmodifiableList"; public final JCodeModel codeModel; public final JClass arrayListClass; public final JClass listClass; public final JClass iterableClass; public final JClass collectionClass; public final Options opt; public final JClass cloneableInterface; public final Outline outline; public final ErrorHandler errorHandler; public final Map<QName, ClassOutline> classesBySchemaComponent; public final JClass partialCopyableInterface; public final JClass copyableInterface; public final JClass stringClass; public final JClass voidClass; public final JType voidType; public final JClass buildableClass; public final JClass buildableInterface; public final JClass cloneGraphClass; public final JExpression excludeConst; public final JExpression includeConst; public final String cloneMethodName; public final String copyMethodName; public final String copyExceptMethodName; public final String copyOnlyMethodName; public final String buildCopyMethodName; public final String newBuilderMethodName; public final String newModifierMethodName; public final String newCopyBuilderMethodName; public final String newObjectVarName; private final JClass collectionsClass; private final JClass arraysClass; private final Map<String, ClassOutline> classes; private final Map<String, EnumOutline> enums; private PluginContext(final Outline outline, final Options opt, final ErrorHandler errorHandler) { this.outline = outline; this.errorHandler = errorHandler; this.codeModel = outline.getCodeModel(); this.opt = opt; this.arrayListClass = this.codeModel.ref(ArrayList.class); this.listClass = this.codeModel.ref(List.class); this.iterableClass = this.codeModel.ref(Iterable.class); this.collectionClass = this.codeModel.ref(Collection.class); this.collectionsClass = this.codeModel.ref(Collections.class); this.arraysClass = this.codeModel.ref(Arrays.class); this.cloneableInterface = this.codeModel.ref(Cloneable.class); this.partialCopyableInterface = this.codeModel.ref(PartialCopyable.class); this.copyableInterface = this.codeModel.ref(Copyable.class); this.classes = new HashMap<>(outline.getClasses().size()); this.classesBySchemaComponent = new HashMap<>(outline.getClasses().size()); this.enums = new HashMap<>(outline.getEnums().size()); this.cloneGraphClass = this.codeModel.ref(PropertyTree.class); this.stringClass = this.codeModel.ref(String.class); this.voidClass = this.codeModel.ref(Void.class); this.voidType = this.codeModel.VOID; for (final ClassOutline classOutline : this.outline.getClasses()) { this.classes.put(classOutline.implClass.fullName(), classOutline); this.classesBySchemaComponent.put(classOutline.target.getTypeName(), classOutline); } for (final EnumOutline classOutline : this.outline.getEnums()) { this.enums.put(classOutline.clazz.fullName(), classOutline); } this.excludeConst = this.codeModel.ref(PropertyTreeUse.class).staticRef("EXCLUDE"); this.includeConst = this.codeModel.ref(PropertyTreeUse.class).staticRef("INCLUDE"); this.cloneMethodName = PluginContext.CLONE_METHOD_NAME; this.copyMethodName = PluginContext.COPY_METHOD_NAME; this.copyExceptMethodName = PluginContext.COPY_EXCEPT_METHOD_NAME; this.copyOnlyMethodName = PluginContext.COPY_ONLY_METHOD_NAME; this.buildCopyMethodName = PluginContext.BUILD_COPY_METHOD_NAME; this.newBuilderMethodName = PluginContext.NEW_BUILDER_METHOD_NAME; this.newModifierMethodName = PluginContext.NEW_MODIFIER_METHOD_NAME; this.newCopyBuilderMethodName = PluginContext.NEW_COPY_BUILDER_METHOD_NAME; this.newObjectVarName = PluginContext.NEW_OBJECT_VAR_NAME; this.buildableInterface = this.codeModel.ref(Buildable.class); this.buildableClass = this.codeModel.ref(Buildable.PrimitiveBuildable.class); } public static PluginContext get(final Outline outline, final Options opt, final ErrorHandler errorHandler) { PluginContext context = findPlugin(opt.getAllPlugins(), PluginContext.class); if (context == null) { context = new PluginContext(outline, opt, errorHandler); opt.getAllPlugins().add(context); } return context; } public static <T> T coalesce(final T... args) { for (final T t : args) { if (t != null) { return t; } } return null; } public static Class<?> findInnerClass(final Class<?> outer, final String name) { for (final Class<?> innerClass : outer.getDeclaredClasses()) { if (name.equals(innerClass.getSimpleName())) { return innerClass; } } return null; } public static QName getQName(final XSDeclaration declaration) { return new QName(declaration.getTargetNamespace(), declaration.getName()); } public static QName getQName(final Class<?> boundClass) { return new QName(getNamespaceUri(boundClass), getLocalName(boundClass)); } private static String getNamespaceUri(final Class<?> boundClass) { final XmlRootElement elementAnnotation = boundClass.getAnnotation(XmlRootElement.class); if (elementAnnotation != null && !"##default".equals(elementAnnotation.namespace())) { return elementAnnotation.namespace(); } else { final XmlType xmlTypeAnnotation = boundClass.getAnnotation(XmlType.class); if (xmlTypeAnnotation != null && !"##default".equals(xmlTypeAnnotation.namespace())) { return xmlTypeAnnotation.namespace(); } else { return getNamespaceUri(boundClass.getPackage()); } } } private static String getLocalName(final Class<?> boundClass) { final XmlRootElement elementAnnotation = boundClass.getAnnotation(XmlRootElement.class); if (elementAnnotation != null && !"##default".equals(elementAnnotation.name())) { return elementAnnotation.name(); } else { final XmlType xmlTypeAnnotation = boundClass.getAnnotation(XmlType.class); if (xmlTypeAnnotation != null && !"##default".equals(xmlTypeAnnotation.name())) { return xmlTypeAnnotation.name(); } else { return boundClass.getSimpleName(); } } } private static String getNamespaceUri(final Package pkg) { final XmlSchema xmlSchemaAnnotation = pkg.getAnnotation(XmlSchema.class); return xmlSchemaAnnotation != null && !"##default".equals(xmlSchemaAnnotation.namespace()) ? xmlSchemaAnnotation.namespace() : null; } public static JMethod findGetter(final FieldOutline field) { final ClassOutline classOutline = field.parent(); String propertyName = field.getPropertyInfo().getName(true); if ("Any".equals(propertyName)) { propertyName = "Content"; } String getterName = "get" + propertyName; JMethod m = classOutline.implClass.getMethod(getterName, new JType[0]); if (m == null) { getterName = "is" + propertyName; m = classOutline.implClass.getMethod(getterName, new JType[0]); } return m; } public static JMethod findSetter(final FieldOutline field) { final ClassOutline classOutline = field.parent(); String propertyName = field.getPropertyInfo().getName(true); if ("Any".equals(propertyName)) { propertyName = "Content"; } final String setterName = "set" + propertyName; for (final JMethod method : classOutline.implClass.methods()) { if (method.name().equals(setterName) && method.listParams().length == 1) { return method; } } return null; } @SuppressWarnings("unchecked") public static <P extends Plugin> P findPlugin(final Options opt, final Class<P> pluginClass) { return findPlugin(opt.activePlugins, pluginClass); } @SuppressWarnings("unchecked") public static <P extends Plugin> P findPlugin(final Iterable<Plugin> pluginCollection, final Class<P> pluginClass) { for (final Plugin plugin : pluginCollection) { if (pluginClass.isInstance(plugin)) { return (P) plugin; } } return null; } private boolean cloneThrows(final Class<? extends Cloneable> cloneableClass) { if (cloneableClass.getSuperclass() == null) { // java.lang.Object.clone() throws CloneNotSupportedException return true; } else { try { final Method cloneMethod = cloneableClass.getMethod(this.cloneMethodName); final Class<?>[] exceptionTypes = cloneMethod.getExceptionTypes(); return (exceptionTypes.length > 0 && CloneNotSupportedException.class.isAssignableFrom(exceptionTypes[0])); } catch (final NoSuchMethodException e) { return false; } } } public JInvocation asList(final JExpression expression) { return this.arraysClass.staticInvoke(PluginContext.AS_LIST).arg(expression); } public JInvocation unmodifiableList(final JExpression expression) { return this.collectionsClass.staticInvoke(PluginContext.UNMODIFIABLE_LIST).arg(expression); } public boolean hasPlugin(final Class<? extends Plugin> pluginClass) { for (final Plugin plugin : this.opt.activePlugins) { if (pluginClass.isInstance(plugin)) { return true; } } return false; } public <P extends Plugin> P findPlugin(final Class<P> pluginClass) { return findPlugin(this.opt, pluginClass); } public boolean canInstantiate(final JType type) { return getClassOutline(type) != null && !((JClass) type).isAbstract(); } public JExpression castOnDemand(final JType fieldType, final JExpression expression) { return this.classes.containsKey(fieldType.fullName()) ? expression : JExpr.cast(fieldType, expression); } public ClassOutline getClassOutline(final JType typeSpec) { return this.classes.get(typeSpec.fullName()); } EnumOutline getEnumOutline(final JType typeSpec) { return this.enums.get(typeSpec.fullName()); } public JForEach loop(final JBlock block, final JExpression source, final JType sourceElementType, final JAssignmentTarget target, final JType targetElementType) { final JConditional ifNull = block._if(source.eq(JExpr._null())); ifNull._then().assign(target, JExpr._null()); ifNull._else().assign(target, JExpr._new(this.arrayListClass.narrow(targetElementType))); return ifNull._else().forEach(sourceElementType, "_item", source); } public JInvocation newArrayList(final JClass elementType) { return JExpr._new(this.arrayListClass.narrow(elementType)); } public JDirectInnerClassRef ref(final JClass outer, final String name, final boolean isInterface, final boolean isAbstract, final JClass superClass) { return new JDirectInnerClassRef(outer, name, isInterface, isAbstract, superClass); } public JDirectInnerClassRef ref(final JClass outer, final String name, final boolean isInterface) { return new JDirectInnerClassRef(outer, name, isInterface, false, null); } public JDirectInnerClassRef ref(final JClass outer, final String name) { return new JDirectInnerClassRef(outer, name, false, false, null); } public JTypedInvocation invoke(final JExpression lhs, final String method) { return new JTypedInvocation(lhs, method); } public JTypedInvocation invoke(final JType lhs, final String method) { return new JTypedInvocation(lhs, method); } public JTypedInvocation invoke(final String method) { return new JTypedInvocation(method); } public JTypedInvocation _super() { return invoke("super"); } public CopyGenerator createCopyGenerator(final JMethod method, final boolean partial) { return partial ? new PartialCopyGenerator(this, method) : new FullCopyGenerator(); } public void writeSourceFile(final Class<?> classToBeWritten) { final String resourcePath = "/" + classToBeWritten.getName().replace('.', '/') + ".java"; final JPackage jPackage = this.outline.getCodeModel()._package(classToBeWritten.getPackage().getName()); final JStaticJavaFile javaFile = new JStaticJavaFile(jPackage, classToBeWritten.getSimpleName(), PluginContext.class.getResource(resourcePath), null); jPackage.addResourceFile(javaFile); } public void generateImmutableFieldInit(final JBlock body, final JExpression object, final JFieldVar field) { final ImmutablePlugin immutablePlugin = findPlugin(ImmutablePlugin.class); if (immutablePlugin != null) { immutablePlugin.immutableInit(this, body, object, field); } } public void generateImmutableFieldInit(final JBlock body, final JExpression object, final PropertyOutline propertyOutline) { final ImmutablePlugin immutablePlugin = findPlugin(ImmutablePlugin.class); if (immutablePlugin != null) { immutablePlugin.immutableInit(this, body, object, propertyOutline); } } @SuppressWarnings("unchecked") JBlock catchCloneNotSupported(final JBlock body, final JClass elementType) { final Class<? extends Cloneable> elementRuntimeClass; try { elementRuntimeClass = (Class<? extends Cloneable>) Class.forName(elementType.binaryName()); } catch (final ClassNotFoundException e) { return body; } if (!cloneThrows(elementRuntimeClass)) { return body; } else { final JTryBlock tryBlock = body._try(); final JCatchBlock catchBlock = tryBlock._catch(this.codeModel.ref(CloneNotSupportedException.class)); final JVar exceptionVar = catchBlock.param("e"); catchBlock.body()._throw(JExpr._new(this.codeModel.ref(RuntimeException.class)).arg(exceptionVar)); return tryBlock.body(); } } boolean mustCatch(final JClass fieldType) { final Class<? extends Cloneable> elementRuntimeClass; try { elementRuntimeClass = (Class<? extends Cloneable>) Class.forName(fieldType.binaryName()); } catch (final ClassNotFoundException e) { return false; } return cloneThrows(elementRuntimeClass); } public <T> T getCustomization(final Class<T> customizationClass, final Deque<CCustomizable> schemaComponents) { final QName qName = getQName(customizationClass); if (!schemaComponents.isEmpty()) { final CCustomizable schemaComponent = schemaComponents.pop(); final CPluginCustomization pluginCustomization = schemaComponent.getCustomizations().find(qName.getNamespaceURI(), qName.getLocalPart()); if (pluginCustomization == null) { return getCustomization(customizationClass, schemaComponents); } else { pluginCustomization.markAsAcknowledged(); return JAXB.unmarshal(new DOMSource(pluginCustomization.element), customizationClass); } } else { final CPluginCustomization pluginCustomization = this.outline.getModel().getCustomizations().find(qName.getNamespaceURI(), qName.getLocalPart()); if (pluginCustomization != null) { pluginCustomization.markAsAcknowledged(); return JAXB.unmarshal(new DOMSource(pluginCustomization.element), customizationClass); } else { return null; } } } public <T> T getCustomization(final Class<T> customizationClass, final CCustomizable... schemaComponents) { final Deque<CCustomizable> schemaComponentDeque = new ArrayDeque<>(Arrays.asList(schemaComponents)); return getCustomization(customizationClass, schemaComponentDeque); } public <T> T getCustomization(final Class<T> customizationClass, final T defaultValue, final CCustomizable... schemaComponents) { final T val = getCustomization(customizationClass, schemaComponents); return val == null ? defaultValue : val; } @Override public String getOptionName() { return "-X_pluginContext_"; } @Override public String getUsage() { return ""; } @Override public boolean run(final Outline outline, final Options opt, final ErrorHandler errorHandler) throws SAXException { return true; } public JTypedInvocation _new(final JClass type) { return new JTypedInvocation(type); } }
JulianPaoloThiry/jaxb2-rich-contract-plugin
src/main/java/com/kscs/util/plugins/xjc/PluginContext.java
Java
mit
20,116
import { Routes, RouterModule } from '@angular/router'; import { DashboardsComponent } from './dashboards.component'; export const routes: Routes = [ { path: 'dashboards', component: DashboardsComponent } ]; export const dashboardsRouting = RouterModule.forChild(routes);
guidefreitas/dashup
client/modules/dashboards/dashboards.routing.ts
TypeScript
mit
277
/* convert.c -- functions for converting between VCF/BCF and related formats. Copyright (C) 2013-2018 Genome Research Ltd. Author: Petr Danecek <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <stdio.h> #include <unistd.h> #include <getopt.h> #include <ctype.h> #include <string.h> #include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <inttypes.h> #include <math.h> #include <htslib/vcf.h> #include <htslib/synced_bcf_reader.h> #include <htslib/vcfutils.h> #include "bcftools.h" #include "convert.h" #define T_CHROM 1 #define T_POS 2 #define T_ID 3 #define T_REF 4 #define T_ALT 5 #define T_QUAL 6 #define T_FILTER 7 #define T_INFO 8 #define T_FORMAT 9 #define T_SAMPLE 10 #define T_SEP 11 #define T_IS_TS 12 #define T_TYPE 13 #define T_MASK 14 #define T_GT 15 #define T_TGT 16 #define T_LINE 17 #define T_CHROM_POS_ID 18 // not publicly advertised #define T_GT_TO_PROB3 19 // not publicly advertised #define T_PL_TO_PROB3 20 // not publicly advertised #define T_GP_TO_PROB3 21 // not publicly advertised #define T_FIRST_ALT 22 // not publicly advertised #define T_IUPAC_GT 23 #define T_GT_TO_HAP 24 // not publicly advertised #define T_GT_TO_HAP2 25 // not publicly advertised #define T_TBCSQ 26 #define T_END 27 #define T_POS0 28 #define T_END0 29 typedef struct _fmt_t { int type, id, is_gt_field, ready, subscript; char *key; bcf_fmt_t *fmt; void *usr; // user data (optional) void (*handler)(convert_t *, bcf1_t *, struct _fmt_t *, int, kstring_t *); void (*destroy)(void*); // clean user data (optional) } fmt_t; struct _convert_t { fmt_t *fmt; int nfmt, mfmt; int nsamples, *samples; bcf_hdr_t *header; int max_unpack; char *format_str; bcf_srs_t *readers; // required only for %MASK int nreaders; void *dat; int ndat; char *undef_info_tag; int allow_undef_tags; uint8_t **subset_samples; }; typedef struct { kstring_t hap1,hap2; char **str; int n, m; } bcsq_t; static void process_chrom(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputs(convert->header->id[BCF_DT_CTG][line->rid].key, str); } static void process_pos(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputw(line->pos+1, str); } static void process_pos0(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputw(line->pos, str); } static void process_end(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputw(line->pos+line->rlen, str); } static void process_end0(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputw(line->pos+line->rlen-1, str); } static void process_id(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputs(line->d.id, str); } static void process_ref(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputs(line->d.allele[0], str); } static void process_alt(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { int i; if ( line->n_allele==1 ) { kputc('.', str); return; } if ( fmt->subscript>=0 ) { if ( line->n_allele > fmt->subscript+1 ) kputs(line->d.allele[fmt->subscript+1], str); else kputc('.', str); return; } for (i=1; i<line->n_allele; i++) { if ( i>1 ) kputc(',', str); kputs(line->d.allele[i], str); } } static void process_first_alt(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( line->n_allele==1 ) kputc('.', str); else kputs(line->d.allele[1], str); } static void process_qual(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( bcf_float_is_missing(line->qual) ) kputc('.', str); else kputd(line->qual, str); } static void process_filter(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { int i; if ( line->d.n_flt ) { for (i=0; i<line->d.n_flt; i++) { if (i) kputc(';', str); kputs(convert->header->id[BCF_DT_ID][line->d.flt[i]].key, str); } } else kputc('.', str); } static inline int32_t bcf_array_ivalue(void *bcf_array, int type, int idx) { if ( type==BCF_BT_INT8 ) { int8_t val = ((int8_t*)bcf_array)[idx]; if ( val==bcf_int8_missing ) return bcf_int32_missing; if ( val==bcf_int8_vector_end ) return bcf_int32_vector_end; return val; } if ( type==BCF_BT_INT16 ) { int16_t val = ((int16_t*)bcf_array)[idx]; if ( val==bcf_int16_missing ) return bcf_int32_missing; if ( val==bcf_int16_vector_end ) return bcf_int32_vector_end; return val; } return ((int32_t*)bcf_array)[idx]; } static inline void _copy_field(char *src, uint32_t len, int idx, kstring_t *str) { int n = 0, ibeg = 0; while ( src[ibeg] && ibeg<len && n < idx ) { if ( src[ibeg]==',' ) n++; ibeg++; } if ( ibeg==len ) { kputc('.', str); return; } int iend = ibeg; while ( src[iend] && src[iend]!=',' && iend<len ) iend++; if ( iend>ibeg ) kputsn(src+ibeg, iend-ibeg, str); else kputc('.', str); } static void process_info(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( fmt->id<0 ) { kputc('.', str); return; } int i; for (i=0; i<line->n_info; i++) if ( line->d.info[i].key == fmt->id ) break; // output "." if the tag is not present if ( i==line->n_info ) { kputc('.', str); return; } bcf_info_t *info = &line->d.info[i]; // if this is a flag, output 1 if ( info->len <=0 ) { kputc('1', str); return; } if ( info->len == 1 ) { switch (info->type) { case BCF_BT_INT8: if ( info->v1.i==bcf_int8_missing ) kputc('.', str); else kputw(info->v1.i, str); break; case BCF_BT_INT16: if ( info->v1.i==bcf_int16_missing ) kputc('.', str); else kputw(info->v1.i, str); break; case BCF_BT_INT32: if ( info->v1.i==bcf_int32_missing ) kputc('.', str); else kputw(info->v1.i, str); break; case BCF_BT_FLOAT: if ( bcf_float_is_missing(info->v1.f) ) kputc('.', str); else kputd(info->v1.f, str); break; case BCF_BT_CHAR: kputc(info->v1.i, str); break; default: fprintf(stderr,"todo: type %d\n", info->type); exit(1); break; } } else if ( fmt->subscript >=0 ) { if ( info->len <= fmt->subscript ) { kputc('.', str); return; } #define BRANCH(type_t, is_missing, is_vector_end, kprint) { \ type_t val = ((type_t *) info->vptr)[fmt->subscript]; \ if ( is_missing || is_vector_end ) kputc('.',str); \ else kprint; \ } switch (info->type) { case BCF_BT_INT8: BRANCH(int8_t, val==bcf_int8_missing, val==bcf_int8_vector_end, kputw(val, str)); break; case BCF_BT_INT16: BRANCH(int16_t, val==bcf_int16_missing, val==bcf_int16_vector_end, kputw(val, str)); break; case BCF_BT_INT32: BRANCH(int32_t, val==bcf_int32_missing, val==bcf_int32_vector_end, kputw(val, str)); break; case BCF_BT_FLOAT: BRANCH(float, bcf_float_is_missing(val), bcf_float_is_vector_end(val), kputd(val, str)); break; case BCF_BT_CHAR: _copy_field((char*)info->vptr, info->vptr_len, fmt->subscript, str); break; default: fprintf(stderr,"todo: type %d\n", info->type); exit(1); break; } #undef BRANCH } else bcf_fmt_array(str, info->len, info->type, info->vptr); } static void init_format(convert_t *convert, bcf1_t *line, fmt_t *fmt) { fmt->id = bcf_hdr_id2int(convert->header, BCF_DT_ID, fmt->key); if ( !bcf_hdr_idinfo_exists(convert->header,BCF_HL_FMT,fmt->id) ) fmt->id = -1; fmt->fmt = NULL; if ( fmt->id >= 0 ) { int i; for (i=0; i<(int)line->n_fmt; i++) if ( line->d.fmt[i].id==fmt->id ) { fmt->fmt = &line->d.fmt[i]; break; } } else if ( !convert->allow_undef_tags ) error("Error: no such tag defined in the VCF header: FORMAT/%s\n", fmt->key); fmt->ready = 1; } static void process_format(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( !fmt->ready ) init_format(convert, line, fmt); if ( fmt->fmt==NULL ) { kputc('.', str); return; } else if ( fmt->subscript >=0 ) { if ( fmt->fmt->n <= fmt->subscript ) { kputc('.', str); return; } if ( fmt->fmt->type == BCF_BT_FLOAT ) { float *ptr = (float*)(fmt->fmt->p + isample*fmt->fmt->size); if ( bcf_float_is_missing(ptr[fmt->subscript]) || bcf_float_is_vector_end(ptr[fmt->subscript]) ) kputc('.', str); else kputd(ptr[fmt->subscript], str); } else if ( fmt->fmt->type != BCF_BT_CHAR ) { int32_t ival = bcf_array_ivalue(fmt->fmt->p+isample*fmt->fmt->size,fmt->fmt->type,fmt->subscript); if ( ival==bcf_int32_missing || ival==bcf_int32_vector_end ) kputc('.', str); else kputw(ival, str); } else if ( fmt->fmt->type == BCF_BT_CHAR ) _copy_field((char*)(fmt->fmt->p + isample*fmt->fmt->size), fmt->fmt->size, fmt->subscript, str); else error("TODO: %s:%d .. fmt->type=%d\n", __FILE__,__LINE__, fmt->fmt->type); } else bcf_fmt_array(str, fmt->fmt->n, fmt->fmt->type, fmt->fmt->p + isample*fmt->fmt->size); } static void process_gt(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( !fmt->ready ) init_format(convert, line, fmt); if ( fmt->fmt==NULL ) { kputc('.', str); return; } bcf_format_gt(fmt->fmt, isample, str); } static void process_tgt(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( !fmt->ready ) init_format(convert, line, fmt); if ( fmt->fmt==NULL ) { kputc('.', str); return; } assert( fmt->fmt->type==BCF_BT_INT8 ); int l; int8_t *x = (int8_t*)(fmt->fmt->p + isample*fmt->fmt->size); // FIXME: does not work with n_alt >= 64 for (l = 0; l < fmt->fmt->n && x[l] != bcf_int8_vector_end; ++l) { if (l) kputc("/|"[x[l]&1], str); if (x[l]>>1) { int ial = (x[l]>>1) - 1; kputs(line->d.allele[ial], str); } else kputc('.', str); } if (l == 0) kputc('.', str); } static void destroy_tbcsq(void *usr) { if ( !usr ) return; bcsq_t *csq = (bcsq_t*) usr; free(csq->hap1.s); free(csq->hap2.s); if ( csq->n ) free(csq->str[0]); free(csq->str); free(csq); } static void process_tbcsq(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( !fmt->ready ) { init_format(convert, line, fmt); bcsq_t *csq; if ( fmt->usr ) { csq = (bcsq_t*) fmt->usr; if ( csq->n ) free(csq->str[0]); csq->n = 0; } else csq = (bcsq_t*) calloc(1,sizeof(bcsq_t)); fmt->usr = csq; int i=0, len = 0; char *tmp = NULL; if ( bcf_get_info_string(convert->header,line,fmt->key,&tmp,&len)<0 ) { csq->n = 0; return; } do { csq->n++; hts_expand(char*, csq->n, csq->m, csq->str); csq->str[ csq->n-1 ] = tmp + i; while ( i<len && tmp[i]!=',' ) i++; if ( i<len && tmp[i]==',' ) tmp[i++] = 0; } while ( i<len ); } bcsq_t *csq = (bcsq_t*)fmt->usr; if ( fmt->fmt==NULL || !csq->n ) return; csq->hap1.l = 0; csq->hap2.l = 0; int mask = fmt->subscript==0 ? 3 : 1; // merge both haplotypes if subscript==0 #define BRANCH(type_t, nbits) { \ type_t *x = (type_t*)(fmt->fmt->p + isample*fmt->fmt->size); \ int i,j; \ if ( fmt->subscript<=0 || fmt->subscript==1 ) \ { \ for (j=0; j < fmt->fmt->n; j++) \ { \ type_t val = x[j]; \ if ( !val ) continue; \ for (i=0; i<nbits; i+=2) \ if ( val & (mask<<i) ) { kputs(csq->str[(j*32+i)/2], &csq->hap1); kputc_(',', &csq->hap1); } \ } \ } \ if ( fmt->subscript<0 || fmt->subscript==2 ) \ { \ for (j=0; j < fmt->fmt->n; j++) \ { \ type_t val = x[j]; \ if ( !val ) continue; \ for (i=1; i<nbits; i+=2) \ if ( val & (1<<i) ) { kputs(csq->str[(j*32+i)/2], &csq->hap2); kputc_(',', &csq->hap2); } \ } \ } \ } switch (fmt->fmt->type) { case BCF_BT_INT8: BRANCH(uint8_t, 8); break; case BCF_BT_INT16: BRANCH(uint16_t,16); break; case BCF_BT_INT32: BRANCH(uint32_t,32); break; default: error("Unexpected type: %d\n", fmt->fmt->type); exit(1); break; } #undef BRANCH if ( !csq->hap1.l && !csq->hap2.l ) return; if ( csq->hap1.l ) csq->hap1.s[--csq->hap1.l] = 0; if ( csq->hap2.l ) csq->hap2.s[--csq->hap2.l] = 0; if ( fmt->subscript<0 ) { kputs(csq->hap1.l?csq->hap1.s:".", str); kputc_('\t', str); kputs(csq->hap2.l?csq->hap2.s:".", str); } else if ( fmt->subscript<2 ) kputs(csq->hap1.l?csq->hap1.s:".", str); else kputs(csq->hap2.l?csq->hap2.s:".", str); } static void init_format_iupac(convert_t *convert, bcf1_t *line, fmt_t *fmt) { init_format(convert, line, fmt); if ( fmt->fmt==NULL ) return; // Init mapping between alleles and IUPAC table hts_expand(uint8_t, line->n_allele, convert->ndat, convert->dat); int8_t *dat = (int8_t*)convert->dat; int i; for (i=0; i<line->n_allele; i++) { if ( line->d.allele[i][1] ) dat[i] = -1; else { switch (line->d.allele[i][0]) { case 'A': dat[i] = 0; break; case 'C': dat[i] = 1; break; case 'G': dat[i] = 2; break; case 'T': dat[i] = 3; break; case 'a': dat[i] = 0; break; case 'c': dat[i] = 1; break; case 'g': dat[i] = 2; break; case 't': dat[i] = 3; break; default: dat[i] = -1; } } } } static void process_iupac_gt(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( !fmt->ready ) init_format_iupac(convert, line, fmt); if ( fmt->fmt==NULL ) { kputc('.', str); return; } assert( fmt->fmt->type==BCF_BT_INT8 ); static const char iupac[4][4] = { {'A','M','R','W'},{'M','C','S','Y'},{'R','S','G','K'},{'W','Y','K','T'} }; int8_t *dat = (int8_t*)convert->dat; int8_t *x = (int8_t*)(fmt->fmt->p + isample*fmt->fmt->size); // FIXME: does not work with n_alt >= 64 int l = 0; while ( l<fmt->fmt->n && x[l]!=bcf_int8_vector_end && x[l]!=bcf_int8_missing ) l++; if ( l==2 ) { // diploid int ia = (x[0]>>1) - 1, ib = (x[1]>>1) - 1; if ( ia>=0 && ia<line->n_allele && ib>=0 && ib<line->n_allele && dat[ia]>=0 && dat[ib]>=0 ) { kputc(iupac[dat[ia]][dat[ib]], str); return; } } for (l = 0; l < fmt->fmt->n && x[l] != bcf_int8_vector_end; ++l) { if (l) kputc("/|"[x[l]&1], str); if (x[l]>>1) { int ial = (x[l]>>1) - 1; kputs(line->d.allele[ial], str); } else kputc('.', str); } if (l == 0) kputc('.', str); } static void process_sample(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { kputs(convert->header->samples[isample], str); } static void process_sep(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if (fmt->key) kputs(fmt->key, str); } static void process_is_ts(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { int is_ts = 0; if ( bcf_get_variant_types(line) & (VCF_SNP|VCF_MNP) ) is_ts = abs(bcf_acgt2int(*line->d.allele[0])-bcf_acgt2int(*line->d.allele[1])) == 2 ? 1 : 0; kputc(is_ts ? '1' : '0', str); } static void process_type(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { int line_type = bcf_get_variant_types(line); int i = 0; if ( line_type == VCF_REF ) { kputs("REF", str); i++; } if ( line_type & VCF_SNP ) { if (i) kputc(',',str); kputs("SNP", str); i++; } if ( line_type & VCF_MNP ) { if (i) kputc(',',str); kputs("MNP", str); i++; } if ( line_type & VCF_INDEL ) { if (i) kputc(',',str); kputs("INDEL", str); i++; } if ( line_type & VCF_OTHER ) { if (i) kputc(',',str); kputs("OTHER", str); i++; } if ( line_type & VCF_BND ) { if (i) kputc(',',str); kputs("BND", str); i++; } } static void process_line(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { vcf_format1(convert->header, line, str); } static void process_chrom_pos_id(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { if ( line->d.id[0]!='.' || line->d.id[1] ) { // ID is present kputs(line->d.id, str); } else { // use CHROM:POS instead of ID kputs(convert->header->id[BCF_DT_CTG][line->rid].key, str); kputc(':', str); kputw(line->pos+1, str); } } static void process_gt_to_prob3(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { int m,n,i; m = convert->ndat / sizeof(int32_t); n = bcf_get_genotypes(convert->header,line,&convert->dat,&m); convert->ndat = m * sizeof(int32_t); if ( n<=0 ) { // Throw an error or silently proceed? // // for (i=0; i<convert->nsamples; i++) kputs(" 0.33 0.33 0.33", str); // return; error("Error parsing GT tag at %s:%d\n", bcf_seqname(convert->header,line),line->pos+1); } n /= convert->nsamples; for (i=0; i<convert->nsamples; i++) { int32_t *ptr = (int32_t*)convert->dat + i*n; int j; for (j=0; j<n; j++) if ( ptr[j]==bcf_int32_vector_end ) break; if ( j==2 ) { // diploid if ( bcf_gt_is_missing(ptr[0]) ) kputs(" 0.33 0.33 0.33", str); else if ( bcf_gt_allele(ptr[0])!=bcf_gt_allele(ptr[1]) ) kputs(" 0 1 0", str); // HET else if ( bcf_gt_allele(ptr[0])==1 ) kputs(" 0 0 1", str); // ALT HOM, first ALT allele else kputs(" 1 0 0", str); // REF HOM or something else than first ALT } else if ( j==1 ) { // haploid if ( bcf_gt_is_missing(ptr[0]) ) kputs(" 0.5 0.0 0.5", str); else if ( bcf_gt_allele(ptr[0])==1 ) kputs(" 0 0 1", str); // first ALT allele else kputs(" 1 0 0", str); // REF or something else than first ALT } else error("FIXME: not ready for ploidy %d\n", j); } } static void process_pl_to_prob3(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { int m,n,i; m = convert->ndat / sizeof(int32_t); n = bcf_get_format_int32(convert->header,line,"PL",&convert->dat,&m); convert->ndat = m * sizeof(int32_t); if ( n<=0 ) { // Throw an error or silently proceed? // // for (i=0; i<convert->nsamples; i++) kputs(" 0.33 0.33 0.33", str); // return; error("Error parsing PL tag at %s:%d\n", bcf_seqname(convert->header,line),line->pos+1); } n /= convert->nsamples; for (i=0; i<convert->nsamples; i++) { int32_t *ptr = (int32_t*)convert->dat + i*n; int j; float sum = 0; for (j=0; j<n; j++) { if ( ptr[j]==bcf_int32_vector_end ) break; sum += pow(10,-0.1*ptr[j]); } if ( j==line->n_allele ) { // haploid kputc(' ',str); ksprintf(str,"%f",pow(10,-0.1*ptr[0])/sum); kputs(" 0 ", str); ksprintf(str,"%f",pow(10,-0.1*ptr[1])/sum); } else { // diploid kputc(' ',str); ksprintf(str,"%f",pow(10,-0.1*ptr[0])/sum); kputc(' ',str); ksprintf(str,"%f",pow(10,-0.1*ptr[1])/sum); kputc(' ',str); ksprintf(str,"%f",pow(10,-0.1*ptr[2])/sum); } } } static void process_gp_to_prob3(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { int m,n,i; m = convert->ndat / sizeof(float); n = bcf_get_format_float(convert->header,line,"GP",&convert->dat,&m); convert->ndat = m * sizeof(float); if ( n<=0 ) { // Throw an error or silently proceed? // // for (i=0; i<convert->nsamples; i++) kputs(" 0.33 0.33 0.33", str); // return; error("Error parsing GP tag at %s:%d\n", bcf_seqname(convert->header,line),line->pos+1); } n /= convert->nsamples; for (i=0; i<convert->nsamples; i++) { float sum = 0, *ptr = (float*)convert->dat + i*n; int j; for (j=0; j<n; j++) { if ( ptr[j]==bcf_int32_vector_end ) break; if ( ptr[j]==bcf_int32_missing ) { ptr[j]=0; continue; } if ( ptr[j]<0 || ptr[j]>1 ) error("[%s:%d:%f] GP value outside range [0,1]; bcftools convert expects the VCF4.3+ spec for the GP field encoding genotype posterior probabilities", bcf_seqname(convert->header,line),line->pos+1,ptr[j]); sum+=ptr[j]; } if ( j==line->n_allele ) ksprintf(str," %f %f %f",ptr[0],0.,ptr[1]); // haploid else ksprintf(str," %f %f %f",ptr[0],ptr[1],ptr[2]); // diploid } } static void process_gt_to_hap(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { // https://mathgen.stats.ox.ac.uk/impute/impute_v2.html#-known_haps_g // File containing known haplotypes for the study cohort. The format // is the same as the output format from IMPUTE2's -phase option: // five header columns (as in the -g file) followed by two columns // (haplotypes) per individual. Allowed values in the haplotype // columns are 0, 1, and ?. // If your study dataset is fully phased, you can replace the -g file // with a -known_haps_g file. This will cause IMPUTE2 to perform // haploid imputation, although it will still report diploid imputation // probabilities in the main output file. If any genotypes are missing, // they can be marked as '? ?' (two question marks separated by one // space) in the input file. (The program does not allow just one // allele from a diploid genotype to be missing.) If the reference // panels are also phased, IMPUTE2 will perform a single, fast // imputation step rather than its standard MCMC module this is how // the program imputes into pre-phased GWAS haplotypes. // The -known_haps_g file can also be used to specify study // genotypes that are "partially" phased, in the sense that some // genotypes are phased relative to a fixed reference point while // others are not. We anticipate that this will be most useful when // trying to phase resequencing data onto a scaffold of known // haplotypes. To mark a known genotype as unphased, place an // asterisk immediately after each allele, with no space between // the allele (0/1) and the asterisk (*); e.g., "0* 1*" for a // heterozygous genotype of unknown phase. int i, gt_id = bcf_hdr_id2int(convert->header, BCF_DT_ID, "GT"); if ( !bcf_hdr_idinfo_exists(convert->header,BCF_HL_FMT,gt_id) ) error("FORMAT/GT tag not present at %s:%d\n", bcf_seqname(convert->header, line), line->pos+1); if ( !(line->unpacked & BCF_UN_FMT) ) bcf_unpack(line, BCF_UN_FMT); bcf_fmt_t *fmt_gt = NULL; for (i=0; i<line->n_fmt; i++) if ( line->d.fmt[i].id==gt_id ) { fmt_gt = &line->d.fmt[i]; break; } if ( !fmt_gt ) error("FORMAT/GT tag not present at %s:%d\n", bcf_seqname(convert->header, line), line->pos+1); // Alloc all memory in advance to avoid kput routines. The biggest allowed allele index is 99 if ( line->n_allele > 100 ) error("Too many alleles (%d) at %s:%d\n", line->n_allele, bcf_seqname(convert->header, line), line->pos+1); if ( ks_resize(str, str->l+convert->nsamples*8) != 0 ) error("Could not alloc %"PRIu64" bytes\n", (uint64_t)(str->l + convert->nsamples*8)); if ( fmt_gt->type!=BCF_BT_INT8 ) // todo: use BRANCH_INT if the VCF is valid error("Uh, too many alleles (%d) or redundant BCF representation at %s:%d\n", line->n_allele, bcf_seqname(convert->header, line), line->pos+1); if ( fmt_gt->n!=1 && fmt_gt->n!=2 ) error("Uh, ploidy of %d not supported, see %s:%d\n", fmt_gt->n, bcf_seqname(convert->header, line), line->pos+1); int8_t *ptr = ((int8_t*) fmt_gt->p) - fmt_gt->n; for (i=0; i<convert->nsamples; i++) { ptr += fmt_gt->n; if ( fmt_gt->n==1 ) // haploid genotypes { if ( ptr[0]==2 ) /* 0 */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '-'; str->s[str->l++] = ' '; } else if ( ptr[0]==bcf_int8_missing ) /* . */ { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '?'; str->s[str->l++] = ' '; } else if ( ptr[0]==4 ) /* 1 */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; str->s[str->l++] = '-'; str->s[str->l++] = ' '; } else { kputw(bcf_gt_allele(ptr[0]),str); str->s[str->l++] = ' '; str->s[str->l++] = '-'; str->s[str->l++] = ' '; } } else if ( ptr[0]==2 ) { if ( ptr[1]==3 ) /* 0|0 */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = ' '; } else if ( ptr[1]==5 ) /* 0|1 */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = ' '; } else if ( ptr[1]==bcf_int8_vector_end ) /* 0 */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '-'; str->s[str->l++] = ' '; } else if ( ptr[1]==2 ) /* 0/0 */ { str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( ptr[1]==4 ) /* 0/1 */ { str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_missing(ptr[1]) ) /* 0/. */ { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '?'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_phased(ptr[1]) ) /* 0|x */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = ' '; } else /* 0/x */ { str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = '*'; str->s[str->l++] = ' '; } } else if ( ptr[0]==4 ) { if ( ptr[1]==3 ) /* 1|0 */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = ' '; } else if ( ptr[1]==5 ) /* 1|1 */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = ' '; } else if ( ptr[1]==bcf_int8_vector_end ) /* 1 */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; str->s[str->l++] = '-'; str->s[str->l++] = ' '; } else if ( ptr[1]==2 ) /* 1/0 */ { str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( ptr[1]==4 ) /* 1/1 */ { str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_missing(ptr[1]) ) /* 1/. */ { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '?'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_phased(ptr[1]) ) /* 1|x */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = ' '; } else /* 1/x */ { str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = '*'; str->s[str->l++] = ' '; } } else if ( bcf_gt_is_missing(ptr[0]) ) { if ( ptr[1]==bcf_int8_vector_end ) { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '-'; str->s[str->l++] = ' '; } else { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '?'; str->s[str->l++] = ' '; } } else if ( ptr[1]==bcf_int8_vector_end ) { /* use REF for something else than first ALT */ str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '-'; str->s[str->l++] = ' '; } else { kputw(bcf_gt_allele(ptr[0]),str); if ( bcf_gt_is_phased(ptr[1]) ) str->s[str->l++] = '*'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); if ( bcf_gt_is_phased(ptr[1]) ) str->s[str->l++] = '*'; str->s[str->l++] = ' '; } } str->s[--str->l] = 0; // delete the last space } static void process_gt_to_hap2(convert_t *convert, bcf1_t *line, fmt_t *fmt, int isample, kstring_t *str) { // same as process_gt_to_hap but converts haploid genotypes into diploid int i, gt_id = bcf_hdr_id2int(convert->header, BCF_DT_ID, "GT"); if ( !bcf_hdr_idinfo_exists(convert->header,BCF_HL_FMT,gt_id) ) error("FORMAT/GT tag not present at %s:%d\n", bcf_seqname(convert->header, line), line->pos+1); if ( !(line->unpacked & BCF_UN_FMT) ) bcf_unpack(line, BCF_UN_FMT); bcf_fmt_t *fmt_gt = NULL; for (i=0; i<line->n_fmt; i++) if ( line->d.fmt[i].id==gt_id ) { fmt_gt = &line->d.fmt[i]; break; } if ( !fmt_gt ) error("FORMAT/GT tag not present at %s:%d\n", bcf_seqname(convert->header, line), line->pos+1); // Alloc all memory in advance to avoid kput routines. The biggest allowed allele index is 99 if ( line->n_allele > 100 ) error("Too many alleles (%d) at %s:%d\n", line->n_allele, bcf_seqname(convert->header, line), line->pos+1); if ( ks_resize(str, str->l+convert->nsamples*8) != 0 ) error("Could not alloc %"PRIu64" bytes\n", (uint64_t)(str->l + convert->nsamples*8)); if ( fmt_gt->type!=BCF_BT_INT8 ) // todo: use BRANCH_INT if the VCF is valid error("Uh, too many alleles (%d) or redundant BCF representation at %s:%d\n", line->n_allele, bcf_seqname(convert->header, line), line->pos+1); int8_t *ptr = ((int8_t*) fmt_gt->p) - fmt_gt->n; for (i=0; i<convert->nsamples; i++) { ptr += fmt_gt->n; if ( ptr[0]==2 ) { if ( ptr[1]==3 ) /* 0|0 */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = ' '; } else if ( ptr[1]==5 ) /* 0|1 */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = ' '; } else if ( ptr[1]==bcf_int8_vector_end ) /* 0 -> 0|0 */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = ' '; } else if ( ptr[1]==2 ) /* 0/0 */ { str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( ptr[1]==4 ) /* 0/1 */ { str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_missing(ptr[1]) ) /* 0/. */ { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '?'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_phased(ptr[1]) ) /* 0|x */ { str->s[str->l++] = '0'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = ' '; } else /* 0/x */ { str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = '*'; str->s[str->l++] = ' '; } } else if ( ptr[0]==4 ) { if ( ptr[1]==3 ) /* 1|0 */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = ' '; } else if ( ptr[1]==5 ) /* 1|1 */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = ' '; } else if ( ptr[1]==bcf_int8_vector_end ) /* 1 -> 1|1 */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = ' '; } else if ( ptr[1]==2 ) /* 1/0 */ { str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( ptr[1]==4 ) /* 1/1 */ { str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_missing(ptr[1]) ) /* 1/. */ { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '?'; str->s[str->l++] = ' '; } else if ( bcf_gt_is_phased(ptr[1]) ) /* 1|x */ { str->s[str->l++] = '1'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = ' '; } else /* 1/x */ { str->s[str->l++] = '1'; str->s[str->l++] = '*'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); str->s[str->l++] = '*'; str->s[str->l++] = ' '; } } else if ( bcf_gt_is_missing(ptr[0]) ) { str->s[str->l++] = '?'; str->s[str->l++] = ' '; str->s[str->l++] = '?'; str->s[str->l++] = ' '; } else if ( ptr[1]==bcf_int8_vector_end ) { /* use REF for something else than first ALT */ str->s[str->l++] = '0'; str->s[str->l++] = ' '; str->s[str->l++] = '0'; str->s[str->l++] = ' '; } else { kputw(bcf_gt_allele(ptr[0]),str); if ( bcf_gt_is_phased(ptr[1]) ) str->s[str->l++] = '*'; str->s[str->l++] = ' '; kputw(bcf_gt_allele(ptr[1]),str); if ( bcf_gt_is_phased(ptr[1]) ) str->s[str->l++] = '*'; str->s[str->l++] = ' '; } } str->s[--str->l] = 0; // delete the last space } static fmt_t *register_tag(convert_t *convert, int type, char *key, int is_gtf) { convert->nfmt++; if ( convert->nfmt > convert->mfmt ) { convert->mfmt += 10; convert->fmt = (fmt_t*) realloc(convert->fmt, convert->mfmt*sizeof(fmt_t)); } fmt_t *fmt = &convert->fmt[ convert->nfmt-1 ]; fmt->type = type; fmt->key = key ? strdup(key) : NULL; fmt->is_gt_field = is_gtf; fmt->subscript = -1; fmt->usr = NULL; fmt->destroy = NULL; // Allow non-format tags, such as CHROM, INFO, etc., to appear amongst the format tags. if ( key ) { int id = bcf_hdr_id2int(convert->header, BCF_DT_ID, key); if ( fmt->type==T_FORMAT && !bcf_hdr_idinfo_exists(convert->header,BCF_HL_FMT,id) ) { if ( !strcmp("CHROM",key) ) { fmt->type = T_CHROM; } else if ( !strcmp("POS",key) ) { fmt->type = T_POS; } else if ( !strcmp("POS0",key) ) { fmt->type = T_POS0; } else if ( !strcmp("END",key) ) { fmt->type = T_END; } else if ( !strcmp("END0",key) ) { fmt->type = T_END0; } else if ( !strcmp("ID",key) ) { fmt->type = T_ID; } else if ( !strcmp("REF",key) ) { fmt->type = T_REF; } else if ( !strcmp("ALT",key) ) { fmt->type = T_ALT; } else if ( !strcmp("FIRST_ALT",key) ) { fmt->type = T_FIRST_ALT; } else if ( !strcmp("QUAL",key) ) { fmt->type = T_QUAL; } else if ( !strcmp("FILTER",key) ) { fmt->type = T_FILTER; } else if ( !strcmp("_CHROM_POS_ID",key) ) { fmt->type = T_CHROM_POS_ID; } else if ( id>=0 && bcf_hdr_idinfo_exists(convert->header,BCF_HL_INFO,id) ) { fmt->type = T_INFO; fprintf(stderr,"Warning: Assuming INFO/%s\n", key); } } } switch (fmt->type) { case T_FIRST_ALT: fmt->handler = &process_first_alt; break; case T_CHROM_POS_ID: fmt->handler = &process_chrom_pos_id; break; case T_GT_TO_PROB3: fmt->handler = &process_gt_to_prob3; break; case T_PL_TO_PROB3: fmt->handler = &process_pl_to_prob3; break; case T_GP_TO_PROB3: fmt->handler = &process_gp_to_prob3; break; case T_CHROM: fmt->handler = &process_chrom; break; case T_POS: fmt->handler = &process_pos; break; case T_POS0: fmt->handler = &process_pos0; break; case T_END: fmt->handler = &process_end; break; case T_END0: fmt->handler = &process_end0; break; case T_ID: fmt->handler = &process_id; break; case T_REF: fmt->handler = &process_ref; break; case T_ALT: fmt->handler = &process_alt; break; case T_QUAL: fmt->handler = &process_qual; break; case T_FILTER: fmt->handler = &process_filter; convert->max_unpack |= BCF_UN_FLT; break; case T_INFO: fmt->handler = &process_info; convert->max_unpack |= BCF_UN_INFO; break; case T_FORMAT: fmt->handler = &process_format; convert->max_unpack |= BCF_UN_FMT; break; case T_SAMPLE: fmt->handler = &process_sample; break; case T_SEP: fmt->handler = &process_sep; break; case T_IS_TS: fmt->handler = &process_is_ts; break; case T_TYPE: fmt->handler = &process_type; break; case T_MASK: fmt->handler = NULL; break; case T_GT: fmt->handler = &process_gt; convert->max_unpack |= BCF_UN_FMT; break; case T_TGT: fmt->handler = &process_tgt; convert->max_unpack |= BCF_UN_FMT; break; case T_IUPAC_GT: fmt->handler = &process_iupac_gt; convert->max_unpack |= BCF_UN_FMT; break; case T_GT_TO_HAP: fmt->handler = &process_gt_to_hap; convert->max_unpack |= BCF_UN_FMT; break; case T_GT_TO_HAP2: fmt->handler = &process_gt_to_hap2; convert->max_unpack |= BCF_UN_FMT; break; case T_TBCSQ: fmt->handler = &process_tbcsq; fmt->destroy = &destroy_tbcsq; convert->max_unpack |= BCF_UN_FMT; break; case T_LINE: fmt->handler = &process_line; convert->max_unpack |= BCF_UN_FMT; break; default: error("TODO: handler for type %d\n", fmt->type); } if ( key && fmt->type==T_INFO ) { fmt->id = bcf_hdr_id2int(convert->header, BCF_DT_ID, key); if ( !bcf_hdr_idinfo_exists(convert->header,BCF_HL_INFO,fmt->id) ) { fmt->id = -1; convert->undef_info_tag = strdup(key); } } return fmt; } static int parse_subscript(char **p) { char *q = *p; if ( *q!='{' ) return -1; q++; while ( *q && *q!='}' && isdigit(*q) ) q++; if ( *q!='}' ) return -1; int idx = atoi((*p)+1); *p = q+1; return idx; } static char *parse_tag(convert_t *convert, char *p, int is_gtf) { char *q = ++p; while ( *q && (isalnum(*q) || *q=='_' || *q=='.') ) q++; kstring_t str = {0,0,0}; if ( q-p==0 ) error("Could not parse format string: %s\n", convert->format_str); kputsn(p, q-p, &str); if ( is_gtf ) { if ( !strcmp(str.s, "SAMPLE") ) register_tag(convert, T_SAMPLE, "SAMPLE", is_gtf); else if ( !strcmp(str.s, "GT") ) register_tag(convert, T_GT, "GT", is_gtf); else if ( !strcmp(str.s, "TGT") ) register_tag(convert, T_TGT, "GT", is_gtf); else if ( !strcmp(str.s, "TBCSQ") ) { fmt_t *fmt = register_tag(convert, T_TBCSQ, "BCSQ", is_gtf); fmt->subscript = parse_subscript(&q); if ( fmt->subscript==-1 ) { if ( !strncmp(q,"{*}",3) ) { fmt->subscript = 0; q += 3; } } else fmt->subscript++; } else if ( !strcmp(str.s, "IUPACGT") ) register_tag(convert, T_IUPAC_GT, "GT", is_gtf); else if ( !strcmp(str.s, "INFO") ) { if ( *q!='/' ) error("Could not parse format string: %s\n", convert->format_str); p = ++q; str.l = 0; while ( *q && (isalnum(*q) || *q=='_' || *q=='.') ) q++; if ( q-p==0 ) error("Could not parse format string: %s\n", convert->format_str); kputsn(p, q-p, &str); fmt_t *fmt = register_tag(convert, T_INFO, str.s, is_gtf); fmt->subscript = parse_subscript(&q); } else { fmt_t *fmt = register_tag(convert, T_FORMAT, str.s, is_gtf); fmt->subscript = parse_subscript(&q); } } else { if ( !strcmp(str.s, "CHROM") ) register_tag(convert, T_CHROM, str.s, is_gtf); else if ( !strcmp(str.s, "POS") ) register_tag(convert, T_POS, str.s, is_gtf); else if ( !strcmp(str.s, "POS0") ) register_tag(convert, T_POS0, str.s, is_gtf); else if ( !strcmp(str.s, "END") ) register_tag(convert, T_END, str.s, is_gtf); else if ( !strcmp(str.s, "END0") ) register_tag(convert, T_END0, str.s, is_gtf); else if ( !strcmp(str.s, "ID") ) register_tag(convert, T_ID, str.s, is_gtf); else if ( !strcmp(str.s, "REF") ) register_tag(convert, T_REF, str.s, is_gtf); else if ( !strcmp(str.s, "ALT") ) { fmt_t *fmt = register_tag(convert, T_ALT, str.s, is_gtf); fmt->subscript = parse_subscript(&q); } else if ( !strcmp(str.s, "FIRST_ALT") ) register_tag(convert, T_FIRST_ALT, str.s, is_gtf); else if ( !strcmp(str.s, "QUAL") ) register_tag(convert, T_QUAL, str.s, is_gtf); else if ( !strcmp(str.s, "FILTER") ) register_tag(convert, T_FILTER, str.s, is_gtf); else if ( !strcmp(str.s, "QUAL") ) register_tag(convert, T_QUAL, str.s, is_gtf); else if ( !strcmp(str.s, "IS_TS") ) register_tag(convert, T_IS_TS, str.s, is_gtf); else if ( !strcmp(str.s, "TYPE") ) register_tag(convert, T_TYPE, str.s, is_gtf); else if ( !strcmp(str.s, "MASK") ) register_tag(convert, T_MASK, str.s, is_gtf); else if ( !strcmp(str.s, "LINE") ) register_tag(convert, T_LINE, str.s, is_gtf); else if ( !strcmp(str.s, "_CHROM_POS_ID") ) register_tag(convert, T_CHROM_POS_ID, str.s, is_gtf); else if ( !strcmp(str.s, "_GT_TO_PROB3") ) register_tag(convert, T_GT_TO_PROB3, str.s, is_gtf); else if ( !strcmp(str.s, "_PL_TO_PROB3") ) register_tag(convert, T_PL_TO_PROB3, str.s, is_gtf); else if ( !strcmp(str.s, "_GP_TO_PROB3") ) register_tag(convert, T_GP_TO_PROB3, str.s, is_gtf); else if ( !strcmp(str.s, "_GT_TO_HAP") ) register_tag(convert, T_GT_TO_HAP, str.s, is_gtf); else if ( !strcmp(str.s, "_GT_TO_HAP2") ) register_tag(convert, T_GT_TO_HAP2, str.s, is_gtf); else if ( !strcmp(str.s, "INFO") ) { if ( *q!='/' ) error("Could not parse format string: %s\n", convert->format_str); p = ++q; str.l = 0; while ( *q && (isalnum(*q) || *q=='_' || *q=='.') ) q++; if ( q-p==0 ) error("Could not parse format string: %s\n", convert->format_str); kputsn(p, q-p, &str); fmt_t *fmt = register_tag(convert, T_INFO, str.s, is_gtf); fmt->subscript = parse_subscript(&q); } else { fmt_t *fmt = register_tag(convert, T_INFO, str.s, is_gtf); fmt->subscript = parse_subscript(&q); } } free(str.s); return q; } static char *parse_sep(convert_t *convert, char *p, int is_gtf) { char *q = p; kstring_t str = {0,0,0}; while ( *q && *q!='[' && *q!=']' && *q!='%' ) { if ( *q=='\\' ) { q++; if ( *q=='n' ) kputc('\n', &str); else if ( *q=='t' ) kputc('\t', &str); else kputc(*q, &str); } else kputc(*q, &str); q++; } if ( !str.l ) error("Could not parse format string: %s\n", convert->format_str); register_tag(convert, T_SEP, str.s, is_gtf); free(str.s); return q; } convert_t *convert_init(bcf_hdr_t *hdr, int *samples, int nsamples, const char *format_str) { convert_t *convert = (convert_t*) calloc(1,sizeof(convert_t)); convert->header = hdr; convert->format_str = strdup(format_str); convert->max_unpack = BCF_UN_STR; int i, is_gtf = 0; char *p = convert->format_str; while ( *p ) { //fprintf(stderr,"<%s>\n", p); switch (*p) { case '[': is_gtf = 1; p++; break; case ']': is_gtf = 0; register_tag(convert, T_SEP, NULL, 0); p++; break; case '%': p = parse_tag(convert, p, is_gtf); break; default: p = parse_sep(convert, p, is_gtf); break; } } if ( is_gtf ) error("Could not parse the format string, missing the square bracket \"]\": %s\n", convert->format_str); if ( nsamples ) { convert->nsamples = nsamples; convert->samples = (int*) malloc(sizeof(int)*nsamples); for (i=0; i<convert->nsamples; i++) convert->samples[i] = samples[i]; } else { convert->nsamples = bcf_hdr_nsamples(convert->header); convert->samples = (int*) malloc(sizeof(int)*convert->nsamples); for (i=0; i<convert->nsamples; i++) convert->samples[i] = i; } return convert; } void convert_destroy(convert_t *convert) { int i; for (i=0; i<convert->nfmt; i++) { if ( convert->fmt[i].destroy ) convert->fmt[i].destroy(convert->fmt[i].usr); free(convert->fmt[i].key); } free(convert->fmt); free(convert->undef_info_tag); free(convert->dat); free(convert->samples); free(convert->format_str); free(convert); } int convert_header(convert_t *convert, kstring_t *str) { int i, icol = 0, l_ori = str->l; bcf_hdr_t *hdr = convert->header; // Supress the header output if LINE is present for (i=0; i<convert->nfmt; i++) if ( convert->fmt[i].type == T_LINE ) break; if ( i!=convert->nfmt ) return str->l - l_ori; kputs("# ", str); for (i=0; i<convert->nfmt; i++) { // Genotype fields if ( convert->fmt[i].is_gt_field ) { int j = i, js, k; while ( convert->fmt[j].is_gt_field ) j++; for (js=0; js<convert->nsamples; js++) { int ks = convert->samples[js]; for (k=i; k<j; k++) { if ( convert->fmt[k].type == T_SEP ) { if ( convert->fmt[k].key ) kputs(convert->fmt[k].key, str); } else if ( convert->fmt[k].type == T_SAMPLE ) ksprintf(str, "[%d]%s", ++icol, convert->fmt[k].key); else ksprintf(str, "[%d]%s:%s", ++icol, hdr->samples[ks], convert->fmt[k].key); } } i = j-1; continue; } // Fixed fields if ( convert->fmt[i].type == T_SEP ) { if ( convert->fmt[i].key ) kputs(convert->fmt[i].key, str); continue; } ksprintf(str, "[%d]%s", ++icol, convert->fmt[i].key); } return str->l - l_ori; } int convert_line(convert_t *convert, bcf1_t *line, kstring_t *str) { if ( !convert->allow_undef_tags && convert->undef_info_tag ) error("Error: no such tag defined in the VCF header: INFO/%s. FORMAT fields must be in square brackets, e.g. \"[ %s]\"\n", convert->undef_info_tag,convert->undef_info_tag); int l_ori = str->l; bcf_unpack(line, convert->max_unpack); int i, ir; str->l = 0; for (i=0; i<convert->nfmt; i++) { // Genotype fields. if ( convert->fmt[i].is_gt_field ) { int j = i, js, k; while ( j<convert->nfmt && convert->fmt[j].is_gt_field ) { convert->fmt[j].ready = 0; j++; } for (js=0; js<convert->nsamples; js++) { // Skip samples when filtering was requested if ( *convert->subset_samples && !(*convert->subset_samples)[js] ) continue; // Here comes a hack designed for TBCSQ. When running on large files, // such as 1000GP, there are too many empty fields in the output and // it's very very slow. Therefore in case the handler does not add // anything to the string, we trim all genotype fields enclosed in square // brackets here. This may be changed in future, time will show... size_t l_start = str->l; int ks = convert->samples[js]; for (k=i; k<j; k++) { if ( convert->fmt[k].type == T_MASK ) { for (ir=0; ir<convert->nreaders; ir++) kputc(bcf_sr_has_line(convert->readers,ir)?'1':'0', str); } else if ( convert->fmt[k].handler ) { size_t l = str->l; convert->fmt[k].handler(convert, line, &convert->fmt[k], ks, str); if ( l==str->l ) { str->l = l_start; break; } // only TBCSQ does this } } } i = j-1; continue; } // Fixed fields if ( convert->fmt[i].type == T_MASK ) { for (ir=0; ir<convert->nreaders; ir++) kputc(bcf_sr_has_line(convert->readers,ir)?'1':'0', str); } else if ( convert->fmt[i].handler ) convert->fmt[i].handler(convert, line, &convert->fmt[i], -1, str); } return str->l - l_ori; } int convert_set_option(convert_t *convert, enum convert_option opt, ...) { int ret = 0; va_list args; va_start(args, opt); switch (opt) { case allow_undef_tags: convert->allow_undef_tags = va_arg(args, int); break; case subset_samples: convert->subset_samples = va_arg(args, uint8_t**); break; default: ret = -1; } va_end(args); return ret; } int convert_max_unpack(convert_t *convert) { return convert->max_unpack; }
kyleabeauchamp/pysam
bcftools/convert.c
C
mit
54,286
using System; namespace RabbitBus.Configuration { public interface IQueueConfiguration { INegatableQueueConfiguration Not { get; } IQueueConfiguration AutoDelete(); IQueueConfiguration Durable(); IQueueConfiguration AutoAcknowledge(); IQueueConfiguration UnacknowledgeLimit(ushort count); IQueueConfiguration WithExpiration(TimeSpan expirationTimeSpan); } }
derekgreer/rabbitBus
src/RabbitBus/Configuration/IQueueConfiguration.cs
C#
mit
386
/*global define*/ define([ 'jquery', 'underscore', 'backbone', 'templates' ], function ($, _, Backbone, JST) { 'use strict'; var BoardProjectsView = Backbone.View.extend({ template: JST['app/scripts/templates/boardProjects.ejs'], initialize: function(){ console.log('Projects & Issues view initialized!'); }, render: function(){ this.$el.html(this.template()); return this; }, destroy: function(){ console.log('Projects & Issues view DESTROYED - BUM!!!!'); this.remove(); }, }); return BoardProjectsView; });
erikmajlath/redmine-modern
app/scripts/views/boardProjects.js
JavaScript
mit
649
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test for -rpcbind, as well as -rpcallowip and -rpcconnect from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.netutil import * class RPCBindTest(BitcoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 1 def setup_network(self): pass def setup_nodes(self): pass def run_bind_test(self, allow_ips, connect_to, addresses, expected): ''' Start a node with requested rpcallowip and rpcbind parameters, then try to connect, and check if the set of bound addresses matches the expected set. ''' expected = [(addr_to_hex(addr), port) for (addr, port) in expected] base_args = ['-disablewallet', '-nolisten'] if allow_ips: base_args += ['-rpcallowip=' + x for x in allow_ips] binds = ['-rpcbind='+addr for addr in addresses] self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [base_args + binds], connect_to) try: pid = bitcoind_processes[0].pid assert_equal(set(get_bind_addrs(pid)), set(expected)) finally: stop_nodes(self.nodes) wait_bitcoinds() def run_allowip_test(self, allow_ips, rpchost, rpcport): ''' Start a node with rpcallow IP, and request getnetworkinfo at a non-localhost IP. ''' base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips] self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [base_args]) try: # connect to node through non-loopback interface node = get_rpc_proxy(rpc_url(0, "%s:%d" % (rpchost, rpcport)), 0) node.getnetworkinfo() finally: node = None # make sure connection will be garbage collected and closed stop_nodes(self.nodes) wait_bitcoinds() def run_test(self): # due to OS-specific network stats queries, this test works only on Linux assert(sys.platform.startswith('linux')) # find the first non-loopback interface for testing non_loopback_ip = None for name,ip in all_interfaces(): if ip != '127.0.0.1': non_loopback_ip = ip break if non_loopback_ip is None: assert(not 'This test requires at least one non-loopback IPv4 interface') print("Using interface %s for testing" % non_loopback_ip) defaultport = rpc_port(0) # check default without rpcallowip (IPv4 and IPv6 localhost) self.run_bind_test(None, '127.0.0.1', [], [('127.0.0.1', defaultport), ('::1', defaultport)]) # check default with rpcallowip (IPv6 any) self.run_bind_test(['127.0.0.1'], '127.0.0.1', [], [('::0', defaultport)]) # check only IPv4 localhost (explicit) self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1'], [('127.0.0.1', defaultport)]) # check only IPv4 localhost (explicit) with alternative port self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171'], [('127.0.0.1', 32171)]) # check only IPv4 localhost (explicit) with multiple alternative ports on same host self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171', '127.0.0.1:32172'], [('127.0.0.1', 32171), ('127.0.0.1', 32172)]) # check only IPv6 localhost (explicit) self.run_bind_test(['[::1]'], '[::1]', ['[::1]'], [('::1', defaultport)]) # check both IPv4 and IPv6 localhost (explicit) self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1', '[::1]'], [('127.0.0.1', defaultport), ('::1', defaultport)]) # check only non-loopback interface self.run_bind_test([non_loopback_ip], non_loopback_ip, [non_loopback_ip], [(non_loopback_ip, defaultport)]) # Check that with invalid rpcallowip, we are denied self.run_allowip_test([non_loopback_ip], non_loopback_ip, defaultport) try: self.run_allowip_test(['1.1.1.1'], non_loopback_ip, defaultport) assert(not 'Connection not denied by rpcallowip as expected') except JSONRPCException: pass if __name__ == '__main__': RPCBindTest().main()
realzzt/BitCoin2013
qa/rpc-tests/rpcbind_test.py
Python
mit
4,774
<?xml version="1.0" ?><!DOCTYPE TS><TS language="es_DO" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About BCPcoin</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;BCPcoin&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The BlackCoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or &lt;a href=&quot;http://www.opensource.org/licenses/mit-license.php&quot;&gt;http://www.opensource.org/licenses/mit-license.php&lt;/a&gt;. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (&lt;a href=&quot;https://www.openssl.org/&quot;&gt;https://www.openssl.org/&lt;/a&gt;) and cryptographic software written by Eric Young (&lt;a href=&quot;mailto:[email protected]&quot;&gt;[email protected]&lt;/a&gt;) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Haga doble clic para editar una dirección o etiqueta</translation> </message> <message> <location line="+24"/> <source>Create a new address</source> <translation>Crear una nueva dirección</translation> </message> <message> <location line="+10"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copiar la dirección seleccionada al portapapeles del sistema</translation> </message> <message> <location line="-7"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-43"/> <source>These are your BCPcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar dirección</translation> </message> <message> <location line="+7"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign a message to prove you own a BCPcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Delete the currently selected address from the list</source> <translation>Borrar de la lista la dirección seleccionada</translation> </message> <message> <location line="-10"/> <source>Verify a message to ensure it was signed with a specified BCPcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Delete</source> <translation>&amp;Eliminar</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;etiqueta</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Archivos de columnas separadas por coma (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+145"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Diálogo de contraseña</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Introducir contraseña</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nueva contraseña</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita la nueva contraseña</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+38"/> <source>Encrypt wallet</source> <translation>Cifrar la cartera</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Esta operación requiere su contraseña para desbloquear la cartera</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear cartera</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Esta operación requiere su contraseña para descifrar la cartera.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Descifrar la certare</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Cambiar contraseña</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Introduzca la contraseña anterior de la cartera y la nueva. </translation> </message> <message> <location line="+45"/> <source>Confirm wallet encryption</source> <translation>Confirmar cifrado de la cartera</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>¿Seguro que desea cifrar su monedero?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANTE: Cualquier copia de seguridad que haya realizado previamente de su archivo de monedero debe reemplazarse con el nuevo archivo de monedero cifrado. Por razones de seguridad, las copias de seguridad previas del archivo de monedero no cifradas serán inservibles en cuanto comience a usar el nuevo monedero cifrado.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Aviso: ¡La tecla de bloqueo de mayúsculas está activada!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Monedero cifrado</translation> </message> <message> <location line="-140"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>BCPcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Ha fallado el cifrado del monedero</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Ha fallado el cifrado del monedero debido a un error interno. El monedero no ha sido cifrado.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Las contraseñas no coinciden.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>Ha fallado el desbloqueo del monedero</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>La contraseña introducida para descifrar el monedero es incorrecta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Ha fallado el descifrado del monedero</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Se ha cambiado correctamente la contraseña del monedero.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+297"/> <source>Sign &amp;message...</source> <translation>Firmar &amp;mensaje...</translation> </message> <message> <location line="-64"/> <source>Show general overview of wallet</source> <translation>Mostrar vista general del monedero</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transacciones</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Examinar el historial de transacciones</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>E&amp;xit</source> <translation>&amp;Salir</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Salir de la aplicación</translation> </message> <message> <location line="+4"/> <source>Show information about BCPcoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Acerca de &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostrar información acerca de Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opciones...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Cifrar monedero…</translation> </message> <message> <location line="+2"/> <source>&amp;Backup Wallet...</source> <translation>Copia de &amp;respaldo del monedero...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Cambiar la contraseña…</translation> </message> <message> <location line="+9"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-55"/> <source>Send coins to a BCPcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>Modify configuration options for BCPcoin</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Backup wallet to another location</source> <translation>Copia de seguridad del monedero en otra ubicación</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Cambiar la contraseña utilizada para el cifrado del monedero</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>Ventana de &amp;depuración</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir la consola de depuración y diagnóstico</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensaje...</translation> </message> <message> <location line="-214"/> <location line="+551"/> <source>BCPcoin</source> <translation type="unfinished"/> </message> <message> <location line="-551"/> <source>Wallet</source> <translation>Monedero</translation> </message> <message> <location line="+193"/> <source>&amp;About BCPcoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>Mo&amp;strar/ocultar</translation> </message> <message> <location line="+8"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Archivo</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Configuración</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>A&amp;yuda</translation> </message> <message> <location line="+17"/> <source>Tabs toolbar</source> <translation>Barra de pestañas</translation> </message> <message> <location line="+46"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+58"/> <source>BCPcoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to BCPcoin network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+488"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message> <location line="-808"/> <source>&amp;Dashboard</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+273"/> <source>Up to date</source> <translation>Actualizado</translation> </message> <message> <location line="+43"/> <source>Catching up...</source> <translation>Actualizando...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Transacción enviada</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Transacción entrante</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Fecha: %1 Cantidad: %2 Tipo: %3 Dirección: %4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid BCPcoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Wallet is &lt;b&gt;not encrypted&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation> </message> <message> <location line="+24"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+91"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+433"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message> <location line="-456"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+27"/> <location line="+433"/> <source>%n day(s)</source> <translation><numerusform>%n día</numerusform><numerusform>%n días</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+6"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+0"/> <source>%1 and %2</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+0"/> <source>%n year(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+324"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+104"/> <source>A fatal error occurred. BCPcoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+110"/> <source>Network Alert</source> <translation>Alerta de red</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>Cantidad:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Cuantía:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Prioridad:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Tasa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Envío pequeño:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+552"/> <source>no</source> <translation>no</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>Después de tasas:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>Cambio:</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>(des)selecciona todos</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Modo arbol</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Modo lista</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Confirmaciones</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Prioridad</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Copiar dirección</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Copiar cantidad</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Copiar identificador de transacción</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>Copiar cantidad</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Copiar donación</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copiar después de aplicar donación</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copiar prioridad</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copiar envío pequeño</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copiar cambio</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>lo más alto</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>alto</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>medio-alto</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>medio</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>bajo-medio</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>bajo</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>lo más bajo</translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation>si</translation> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <location line="+66"/> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>Enviar desde %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(cambio)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Dirección</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Etiqueta</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Dirección</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nueva dirección de recepción</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nueva dirección de envío</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar dirección de recepción</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar dirección de envío</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>La dirección introducida &quot;%1&quot; ya está presente en la libreta de direcciones.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid BCPcoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>No se pudo desbloquear el monedero.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Ha fallado la generación de la nueva clave.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+426"/> <location line="+12"/> <source>BCPcoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opciones</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Comisión de &amp;transacciones</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start BCPcoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start BCPcoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Red</translation> </message> <message> <location line="+6"/> <source>Automatically open the BCPcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear el puerto usando &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the BCPcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>Dirección &amp;IP del proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Puerto:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Puerto del servidor proxy (ej. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versión SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versión del proxy SOCKS (ej. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Ventana</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Minimizar la ventana a la bandeja de iconos del sistema.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar a la bandeja en vez de a la barra de tareas</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimizar en lugar de salir de la aplicación al cerrar la ventana. Cuando esta opción está activa, la aplicación solo se puede cerrar seleccionando Salir desde el menú.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar al cerrar</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Interfaz</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>I&amp;dioma de la interfaz de usuario</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting BCPcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>Mostrar las cantidades en la &amp;unidad:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían monedas.</translation> </message> <message> <location line="+9"/> <source>Whether to show coin control features or not.</source> <translation>Mostrar o no características de control de moneda</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Whether to select the coin outputs randomly or with minimal coin age.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Minimize weight consumption (experimental)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use black visual theme (requires restart)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;Aceptar</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>predeterminado</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting BCPcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>La dirección proxy indicada es inválida.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Desde</translation> </message> <message> <location line="+46"/> <location line="+247"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the BCPcoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-173"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Unconfirmed:</source> <translation>No confirmado(s):</translation> </message> <message> <location line="-113"/> <source>Wallet</source> <translation>Monedero</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Su balance actual gastable</translation> </message> <message> <location line="+80"/> <source>Immature:</source> <translation>No disponible:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Saldo recién minado que aún no está disponible.</translation> </message> <message> <location line="+23"/> <source>Total:</source> <translation>Total:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Su balance actual total</translation> </message> <message> <location line="+50"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Movimientos recientes&lt;/b&gt;</translation> </message> <message> <location line="-118"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-32"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>desincronizado</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start BCPcoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nombre del cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <source>N/A</source> <translation>N/D</translation> </message> <message> <location line="-194"/> <source>Client version</source> <translation>Versión del cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Información</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Utilizando la versión OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Hora de inicio</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Red</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Número de conexiones</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Cadena de bloques</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Número actual de bloques</translation> </message> <message> <location line="+197"/> <source>&amp;Network Traffic</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Clear</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Totals</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>In:</source> <translation type="unfinished"/> </message> <message> <location line="+80"/> <source>Out:</source> <translation type="unfinished"/> </message> <message> <location line="-383"/> <source>Last block time</source> <translation>Hora del último bloque</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the BCPcoin-Qt help message to get a list with possible BCPcoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Consola</translation> </message> <message> <location line="-237"/> <source>Build date</source> <translation>Fecha de compilación</translation> </message> <message> <location line="-104"/> <source>BCPcoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>BCPcoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+256"/> <source>Debug log file</source> <translation>Archivo de registro de depuración</translation> </message> <message> <location line="+7"/> <source>Open the BCPcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Borrar consola</translation> </message> <message> <location filename="../rpcconsole.cpp" line="+325"/> <source>Welcome to the BCPcoin RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use las flechas arriba y abajo para navegar por el historial y &lt;b&gt;Control+L&lt;/b&gt; para limpiar la pantalla.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Escriba &lt;b&gt;help&lt;/b&gt; para ver un resumen de los comandos disponibles.</translation> </message> <message> <location line="+127"/> <source>%1 B</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 KB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 MB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 GB</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>%1 m</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>%1 h</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 h %2 m</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+181"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Enviar monedas</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Características de control de la moneda</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Entradas...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>Seleccionado automaticamente</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Fondos insuficientes!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>Cantidad:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Cuantía:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BCP</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation>Prioridad:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>Tasa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Envío pequeño:</translation> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>Después de tasas:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Enviar a múltiples destinatarios de una vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Añadir &amp;destinatario</translation> </message> <message> <location line="+16"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Limpiar &amp;todo</translation> </message> <message> <location line="+24"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+16"/> <source>123.456 BCP</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirmar el envío</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a BCPcoin address (e.g. JgZaH1DdikpMTYc2x1Xb6eFBkKGibjmPb9)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>Copiar cantidad</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Copiar donación</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copiar después de aplicar donación</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copiar prioridad</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copiar envío pequeño</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copiar Cambio</translation> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirmar el envío de monedas</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>La dirección de recepción no es válida, compruébela de nuevo.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>La cantidad por pagar tiene que ser mayor de 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>La cantidad sobrepasa su saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>El total sobrepasa su saldo cuando se incluye la tasa de envío de %1</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Se ha encontrado una dirección duplicada. Solo se puede enviar a cada dirección una vez por operación de envío.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+247"/> <source>WARNING: Invalid BCPcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Ca&amp;ntidad:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Pagar a:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. JgZaH1DdikpMTYc2x1Xb6eFBkKGibjmPb9)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Etiquete esta dirección para añadirla a la libreta</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Pegar dirección desde portapapeles</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a BCPcoin address (e.g. JgZaH1DdikpMTYc2x1Xb6eFBkKGibjmPb9)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Firmas - Firmar / verificar un mensaje</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Firmar mensaje</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Puede firmar mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle para suplantar su identidad. Firme solo declaraciones totalmente detalladas con las que usted esté de acuerdo.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. JgZaH1DdikpMTYc2x1Xb6eFBkKGibjmPb9)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Pegar dirección desde portapapeles</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Introduzca el mensaje que desea firmar aquí</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar la firma actual al portapapeles del sistema</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this BCPcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Limpiar todos los campos de la firma de mensaje</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Limpiar &amp;todo</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar mensaje</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. JgZaH1DdikpMTYc2x1Xb6eFBkKGibjmPb9)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified BCPcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Limpiar todos los campos de la verificación de mensaje</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a BCPcoin address (e.g. JgZaH1DdikpMTYc2x1Xb6eFBkKGibjmPb9)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Haga clic en &quot;Firmar mensaje&quot; para generar la firma</translation> </message> <message> <location line="+3"/> <source>Enter BCPcoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>La dirección introducida es inválida.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Verifique la dirección e inténtelo de nuevo.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>La dirección introducida no corresponde a una clave.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Se ha cancelado el desbloqueo del monedero. </translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>No se dispone de la clave privada para la dirección introducida.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Ha fallado la firma del mensaje.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensaje firmado.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>No se puede decodificar la firma.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Compruebe la firma e inténtelo de nuevo.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>La firma no coincide con el resumen del mensaje.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>La verificación del mensaje ha fallado.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensaje verificado.</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <location filename="../trafficgraphwidget.cpp" line="+75"/> <source>KB/s</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+25"/> <source>Open until %1</source> <translation>Abierto hasta %1</translation> </message> <message> <location line="+6"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/fuera de línea</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/no confirmado</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmaciones</translation> </message> <message> <location line="+17"/> <source>Status</source> <translation>Estado</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, transmitir a través de %n nodo</numerusform><numerusform>, transmitir a través de %n nodos</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Fuente</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generado</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>dirección propia</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>etiqueta</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>disponible en %n bloque más</numerusform><numerusform>disponible en %n bloques más</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>no aceptada</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Comisión de transacción</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Cantidad neta</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensaje</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Comentario</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>Identificador de transacción</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Información de depuración</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transacción</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>entradas</translation> </message> <message> <location line="+21"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadero</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, todavía no se ha sido difundido satisfactoriamente</translation> </message> <message numerus="yes"> <location line="-36"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+71"/> <source>unknown</source> <translation>desconocido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalles de transacción</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Esta ventana muestra información detallada sobre la transacción</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+231"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+52"/> <source>Open until %1</source> <translation>Abierto hasta %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmado (%1 confirmaciones)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para %n bloque más</numerusform><numerusform>Abrir para %n bloques más</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generado pero no aceptado</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Recibido con</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recibidos de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado a</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pago propio</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minado</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(nd)</translation> </message> <message> <location line="+194"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Estado de transacción. Pasa el ratón sobre este campo para ver el número de confirmaciones.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Fecha y hora en que se recibió la transacción.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transacción.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Dirección de destino de la transacción.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Cantidad retirada o añadida al saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+54"/> <location line="+17"/> <source>All</source> <translation>Todo</translation> </message> <message> <location line="-16"/> <source>Today</source> <translation>Hoy</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mes</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mes pasado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este año</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Rango...</translation> </message> <message> <location line="+12"/> <source>Received with</source> <translation>Recibido con</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviado a</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>A usted mismo</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minado</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Otra</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Introduzca una dirección o etiqueta que buscar</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Cantidad mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar dirección</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar identificador de transacción</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar etiqueta</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalles de la transacción</translation> </message> <message> <location line="+138"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Archivos de columnas separadas por coma (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Rango:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>para</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+208"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+173"/> <source>BCPcoin version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or BCPcoind</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Muestra comandos </translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Recibir ayuda para un comando </translation> </message> <message> <location line="-147"/> <source>Options:</source> <translation>Opciones: </translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: BCPcoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: BCPcoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>Especificar archivo de monedero (dentro del directorio de datos)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar directorio para los datos</translation> </message> <message> <location line="-25"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=BCPcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;BCPcoin Alert&quot; [email protected] </source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Establecer el tamaño de caché de la base de datos en megabytes (predeterminado: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 16814 or testnet: 26814)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Mantener como máximo &lt;n&gt; conexiones a pares (predeterminado: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Especifique su propia dirección pública</translation> </message> <message> <location line="+4"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Always query for peer addresses via DNS lookup (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Umbral para la desconexión de pares con mal comportamiento (predeterminado: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400)</translation> </message> <message> <location line="-37"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ha ocurrido un error al configurar el puerto RPC %u para escucha en IPv4: %s</translation> </message> <message> <location line="+65"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 16815 or testnet: 26815)</source> <translation type="unfinished"/> </message> <message> <location line="-17"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceptar comandos consola y JSON-RPC </translation> </message> <message> <location line="+1"/> <source>Run in the background as a daemon and accept commands</source> <translation>Ejecutar en segundo plano como daemon y aceptar comandos </translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Usar la red de pruebas </translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ha ocurrido un error al configurar el puerto RPC %u para escuchar mediante IPv6. Recurriendo a IPv4: %s</translation> </message> <message> <location line="+96"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción.</translation> </message> <message> <location line="-103"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong BCPcoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+132"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Aviso: ¡Error al leer wallet.dat! Todas las claves se han leído correctamente, pero podrían faltar o ser incorrectos los datos de transacciones o las entradas de la libreta de direcciones.</translation> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Aviso: ¡Recuperados datos de wallet.dat corrupto! El wallet.dat original se ha guardado como wallet.{timestamp}.bak en %s; si hubiera errores en su saldo o transacciones, deberá restaurar una copia de seguridad.</translation> </message> <message> <location line="-31"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Intento de recuperar claves privadas de un wallet.dat corrupto</translation> </message> <message> <location line="+5"/> <source>Block creation options:</source> <translation>Opciones de creación de bloques:</translation> </message> <message> <location line="-69"/> <source>Connect only to the specified node(s)</source> <translation>Conectar sólo a los nodos (o nodo) especificados</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descubrir dirección IP propia (predeterminado: 1 al escuchar sin -externalip)</translation> </message> <message> <location line="+101"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.</translation> </message> <message> <location line="-91"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+89"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Búfer de recepción máximo por conexión, &lt;n&gt;*1000 bytes (predeterminado: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Búfer de recepción máximo por conexión, , &lt;n&gt;*1000 bytes (predeterminado: 1000)</translation> </message> <message> <location line="-17"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Conectarse solo a nodos de la red &lt;net&gt; (IPv4, IPv6 o Tor)</translation> </message> <message> <location line="+31"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Opciones SSL: (ver la Bitcoin Wiki para instrucciones de configuración SSL)</translation> </message> <message> <location line="-81"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log</translation> </message> <message> <location line="+5"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+30"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Establecer tamaño mínimo de bloque en bytes (predeterminado: 0)</translation> </message> <message> <location line="-35"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation> </message> <message> <location line="-43"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000)</translation> </message> <message> <location line="+116"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-86"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para asignar el puerto de escucha (predeterminado: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para asignar el puerto de escucha (predeterminado: 1 al escuchar)</translation> </message> <message> <location line="-26"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Username for JSON-RPC connections</source> <translation>Nombre de usuario para las conexiones JSON-RPC </translation> </message> <message> <location line="+51"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Aviso: Esta versión es obsoleta, actualización necesaria!</translation> </message> <message> <location line="-54"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupto. Ha fallado la recuperación.</translation> </message> <message> <location line="-56"/> <source>Password for JSON-RPC connections</source> <translation>Contraseña para las conexiones JSON-RPC </translation> </message> <message> <location line="-32"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&lt;category&gt; can be:</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir conexiones JSON-RPC desde la dirección IP especificada </translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comando al nodo situado en &lt;ip&gt; (predeterminado: 127.0.0.1) </translation> </message> <message> <location line="+1"/> <source>Wait for RPC server to start</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se sustituye por el hash de bloque)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Actualizar el monedero al último formato</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Ajustar el número de claves en reserva &lt;n&gt; (predeterminado: 100) </translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Volver a examinar la cadena de bloques en busca de transacciones del monedero perdidas</translation> </message> <message> <location line="+3"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para las conexiones JSON-RPC </translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Certificado del servidor (predeterminado: server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Clave privada del servidor (predeterminado: server.pem) </translation> </message> <message> <location line="+10"/> <source>Initialization sanity check failed. BCPcoin is shutting down.</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-174"/> <source>This help message</source> <translation>Este mensaje de ayuda </translation> </message> <message> <location line="+104"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>No es posible conectar con %s en este sistema (bind ha dado el error %d, %s)</translation> </message> <message> <location line="-133"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir búsquedas DNS para -addnode, -seednode y -connect</translation> </message> <message> <location line="+126"/> <source>Loading addresses...</source> <translation>Cargando direcciones...</translation> </message> <message> <location line="-12"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error al cargar wallet.dat: el monedero está dañado</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of BCPcoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart BCPcoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Error al cargar wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Dirección -proxy inválida: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>La red especificada en -onlynet &apos;%s&apos; es desconocida</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Solicitada versión de proxy -socks desconocida: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>No se puede resolver la dirección de -bind: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>No se puede resolver la dirección de -externalip: &apos;%s&apos;</translation> </message> <message> <location line="-23"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Cantidad inválida para -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+60"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Cuantía no válida</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Fondos insuficientes</translation> </message> <message> <location line="-40"/> <source>Loading block index...</source> <translation>Cargando el índice de bloques...</translation> </message> <message> <location line="-110"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Añadir un nodo al que conectarse y tratar de mantener la conexión abierta</translation> </message> <message> <location line="+125"/> <source>Unable to bind to %s on this computer. BCPcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-101"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Minimize weight consumption (experimental) (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>How many blocks to check at startup (default: 500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Keep at most &lt;n&gt; unconnectable blocks in memory (default: %u)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. BCPcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Loading wallet...</source> <translation>Cargando monedero...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>No se puede rebajar el monedero</translation> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>No se puede escribir la dirección predeterminada</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Reexplorando...</translation> </message> <message> <location line="+2"/> <source>Done loading</source> <translation>Generado pero no aceptado</translation> </message> <message> <location line="-161"/> <source>To use the %s option</source> <translation>Para utilizar la opción %s</translation> </message> <message> <location line="+188"/> <source>Error</source> <translation>Error</translation> </message> <message> <location line="-18"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Tiene que establecer rpcpassword=&lt;contraseña&gt; en el fichero de configuración: ⏎ %s ⏎ Si el archivo no existe, créelo con permiso de lectura solamente del propietario.</translation> </message> </context> </TS>
buycoin-dev/BCP_Coin
src/qt/locale/bitcoin_es_DO.ts
TypeScript
mit
120,951
<div class='w-row'> <div class='w-col w-col-6 col-box-left'> <div class='box-bg'> <div class='home-box-header'> <h2 class='h2-categories'> Popular Outdoor Lighting </h2> </div> <div class='box-content'> <ul class='w-list-unstyled popular-ul'> <li class='popular-list'> <a class='link' href='/led-outdoor-lights'>Led Outdoor</a> </li> <li class='popular-list'> <a class='link' href='/spot-flood-lights'>Spot &amp; Flood</a> </li> <li class='popular-list'> <a class='link' href='/in-ground-well-lights'>In Ground &amp; Well</a> </li> <li class='popular-list'> <a class='link' href='/underwater-fountain-lights-1'>Underwater &amp; Fountains</a> </li> <li class='popular-list'> <a class='link' href='/sign-lights-gooseneck-lights'>Gooseneck &amp; Straight Arm</a> </li> </ul> </div> </div> </div> <div class='w-col w-col-6 col-box-right'> <div class='box-bg'> <div class='home-box-header'> <h2 class='h2-categories'> Popular Indoor Lighting </h2> </div> <div class='box-content'> <ul class='w-list-unstyled popular-ul'> <li class='popular-list first-child'> <a class='link' href='/under-counter-under-cabinet-lighting'>Counter Top &amp; Undercabinet</a> </li> <li class='popular-list'> <a class='link' href='/recessed-housings-trims'>Recessed Housing &amp; Trims</a> </li> <li class='popular-list'> <a class='link' href='/monorail-track-lights'>Monorail &amp; Track</a> </li> <li class='popular-list'> <a class='link' href='/low-voltage-indoor-transformers'>Indoor Transformers</a> </li> <li class='popular-list'> <a class='link' href='/switches-dimmers'>Switches &amp; Dimmers</a> </li> </ul> </div> </div> </div> </div>
royjulien/stencil
templates/components/common/homePopCategory2.html
HTML
mit
2,058
using Microsoft.Data.Sqlite; using System; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Security.Cryptography; using System.Text; namespace MyRainbow.DBProviders { internal class SqliteHasher : DbHasher, IDisposable { private SqliteConnection Conn { get; set; } private SqliteTransaction Tran { get; set; } public SqliteHasher(string connectionString) { Conn = new SqliteConnection(connectionString); Conn.Open(); Tran = null; } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { //free managed resources if (Conn != null) { if (Conn.State != ConnectionState.Closed) Conn.Close(); Conn.Dispose(); } } // free native resources if there are any. } public override void EnsureExist() { string table_name = "hashes"; string cmd_text = $@"CREATE TABLE IF NOT EXISTS {table_name} ( [key] varchar(20) NOT NULL PRIMARY KEY, hashMD5 char(32) NOT NULL, hashSHA256 char(64) NOT NULL );"/* + $@" CREATE INDEX IF NOT EXISTS IX_MD5 ON {table_name}(hashMD5); CREATE INDEX IF NOT EXISTS IX_SHA256 ON {table_name}(hashSHA256);"*/; using (var cmd = new SqliteCommand(cmd_text, Conn, Tran)) { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } public override void Generate(IEnumerable<IEnumerable<char>> tableOfTableOfChars, MD5 hasherMD5, SHA256 hasherSHA256, Func<string, string, string, long, long, bool> shouldBreakFunc, Stopwatch stopwatch = null, int batchInsertCount = 50, int batchTransactionCommitCount = 200) { string last_key_entry = GetLastKeyEntry(); double? nextPause = null; if (stopwatch != null) { stopwatch.Start(); nextPause = stopwatch.Elapsed.TotalMilliseconds + 1000;//next check after 1sec } long counter = 0, last_pause_counter = 0, tps = 0; var tran = Conn.BeginTransaction(); SqliteCommand cmd = new SqliteCommand("", Conn, tran); cmd.CommandType = CommandType.Text; int param_counter = 0; foreach (var chars_table in tableOfTableOfChars) { var key = string.Concat(chars_table); if (!string.IsNullOrEmpty(last_key_entry) && last_key_entry.CompareTo(key) >= 0) continue; var hashMD5 = BitConverter.ToString(hasherMD5.ComputeHash(Encoding.UTF8.GetBytes(key))).Replace("-", "").ToLowerInvariant(); var hashSHA256 = BitConverter.ToString(hasherSHA256.ComputeHash(Encoding.UTF8.GetBytes(key))).Replace("-", "").ToLowerInvariant(); //dbase.Insert(value, hash); cmd.CommandText += $"insert into hashes([key], hashMD5, hashSHA256)" + $"values(@key{param_counter}, @MD5{param_counter}, @SHA256{param_counter});{Environment.NewLine}"; SqliteParameter param; if (cmd.Parameters.Contains($"@key{param_counter}")) { param = cmd.Parameters[$"@key{param_counter}"]; param.Value = key; } else { param = new SqliteParameter($"@key{param_counter}", SqliteType.Text, 20); param.Value = key; cmd.Parameters.Add(param); } if (cmd.Parameters.Contains($"@MD5{param_counter}")) { param = cmd.Parameters[$"@MD5{param_counter}"]; param.Value = hashMD5; } else { param = new SqliteParameter($"@MD5{param_counter}", SqliteType.Text, 32); param.Value = hashMD5; cmd.Parameters.Add(param); } if (cmd.Parameters.Contains($"@SHA256{param_counter}")) { param = cmd.Parameters[$"@SHA256{param_counter}"]; param.Value = hashSHA256; } else { param = new SqliteParameter($"@SHA256{param_counter}", SqliteType.Text, 64); param.Value = hashSHA256; cmd.Parameters.Add(param); } param_counter++; if (counter % batchInsertCount == 0) { //cmd.Prepare(); cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); cmd.Dispose(); cmd.CommandText = ""; cmd.Connection = Conn; cmd.Transaction = tran; param_counter = 0; } if (counter % batchTransactionCommitCount == 0) { if (cmd != null && !string.IsNullOrEmpty(cmd.CommandText)) { //cmd.Prepare(); cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); cmd.Dispose(); cmd.CommandText = ""; cmd.Connection = Conn; cmd.Transaction = tran; param_counter = 0; } tran.Commit(); tran.Dispose(); tran = null; //Console.WriteLine($"MD5({key})={hashMD5},SHA256({key})={hashSHA256},counter={counter},tps={tps}"); //if (Console.KeyAvailable) // break; if (shouldBreakFunc(key, hashMD5, hashSHA256, counter, tps)) break; cmd.Transaction = tran = Conn.BeginTransaction(); } if (stopwatch != null && stopwatch.Elapsed.TotalMilliseconds >= nextPause) { if (last_pause_counter > 0) { tps = counter - last_pause_counter; nextPause = stopwatch.Elapsed.TotalMilliseconds + 1000; } last_pause_counter = counter; } counter++; } if (cmd != null && !string.IsNullOrEmpty(cmd.CommandText)) { //cmd.Prepare(); cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); cmd.Dispose(); } if (tran != null) { tran.Commit(); tran.Dispose(); } } public override string GetLastKeyEntry() { using (var cmd = new SqliteCommand("SELECT [key] FROM hashes ORDER BY 1 DESC LIMIT 1", Conn, Tran)) { cmd.CommandType = System.Data.CommandType.Text; var str = cmd.ExecuteScalar(); return str == null ? null : (string)str; } } public override void Purge() { using (var cmd = new SqliteCommand("DELETE FROM hashes", Conn, Tran)) { cmd.CommandType = System.Data.CommandType.Text; cmd.ExecuteNonQuery(); } } public override void Verify() { using (var cmd = new SqliteCommand("SELECT * FROM hashes WHERE hashMD5 = @hashMD5", Conn, Tran)) { cmd.CommandType = System.Data.CommandType.Text; var param_key = new SqliteParameter("@hashMD5", SqliteType.Text, 32); param_key.Value = "b25319faaaea0bf397b2bed872b78c45"; cmd.Parameters.Add(param_key); using (var rdr = cmd.ExecuteReader()) { while (rdr.Read()) { Console.WriteLine("key={0} md5={1} sha256={2}", rdr["key"], rdr["hashMD5"], rdr["hashSHA256"]); } } } } public override void PostGenerateExecute() { string table_name = "hashes"; string cmd_text = $@" CREATE INDEX IF NOT EXISTS IX_MD5 ON {table_name}(hashMD5); CREATE INDEX IF NOT EXISTS IX_SHA256 ON {table_name}(hashSHA256);"; Console.Write("Creating indexes..."); using (var cmd = new SqliteCommand(cmd_text, Conn, Tran)) { cmd.CommandTimeout = 0; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } Console.WriteLine("done"); } } }
ChaosEngine/MyRainbow
src/MyRainbow/DBProviders/SqliteHasher.cs
C#
mit
6,835
._1pr1{background:#262626;height:140px}._1pr2{border-radius:4px;cursor:pointer;display:inline-block;left:8px;padding:5px 4px 3px;position:absolute;top:7px;transition:.1s all linear}._1pr5:hover ._1pr2{text-decoration:none}._1pr2 .img{vertical-align:middle}._1pr3{color:#fff;-webkit-font-smoothing:antialiased}._1pr4 ._1pr3{visibility:hidden}._1pr5:hover ._1pr2._1pr4,._1pr2:focus._1pr4{background:rgba(0, 0, 0, .8)}._1pr5:hover ._1pr3,._1pr2:focus ._1pr3{visibility:visible}._1pr6._1pr6{display:none;left:17px;position:absolute;top:17px}._1pr7 ._1pr2{display:none}._1pr7 ._1pr6{display:block} ._5k7c{align-items:center;background:#fff;border-radius:4px;display:flex;justify-content:center} ._4-1o{color:#b2b2b2}._4a8m{display:none;padding-left:4px}._4a8m:focus,._4a8n:hover ._4a8m{display:inline-block}._4a8m:focus~._2gnz,._4a8n:hover ._4a8m~._2gnz{display:none} ._27as,._4q7f{position:relative}._27as::before,._4q7f::before{border:1px solid rgba(0, 0, 0, .1);bottom:-1px;content:'';display:block;left:-1px;position:absolute;right:-1px;top:-1px;z-index:-1}._27as .profilePicThumb{display:block;line-height:0}._27as .profilePic{height:180px;width:180px}._27as .fbTimelineProfilePicSelector{bottom:0;position:absolute;width:100%;z-index:1}._1qlz{height:52px}._3_fa .fbTimelineUnit{margin:0 0 12px}._1qm0 .escapeHatchMinimal{margin:0}._1qm0:empty{margin-top:-12px} #bootloader_AhtAn{height:42px;}.bootloader_AhtAn{display:block!important;}
opiumind/PuzzleSeeing
textures/patterns/(1) Phong Tran_files/2HyJB23zp0Z.css
CSS
mit
1,437
import React from 'react'; import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; import Switch from '@material-ui/core/Switch'; import Paper from '@material-ui/core/Paper'; import Fade from '@material-ui/core/Fade'; import FormControlLabel from '@material-ui/core/FormControlLabel'; const useStyles = makeStyles((theme: Theme) => createStyles({ root: { height: 180, }, container: { display: 'flex', }, paper: { margin: theme.spacing(1), }, svg: { width: 100, height: 100, }, polygon: { fill: theme.palette.common.white, stroke: theme.palette.divider, strokeWidth: 1, }, }), ); export default function SimpleFade() { const classes = useStyles(); const [checked, setChecked] = React.useState(false); const handleChange = () => { setChecked((prev) => !prev); }; return ( <div className={classes.root}> <FormControlLabel control={<Switch checked={checked} onChange={handleChange} />} label="Show" /> <div className={classes.container}> <Fade in={checked}> <Paper elevation={4} className={classes.paper}> <svg className={classes.svg}> <polygon points="0,100 50,00, 100,100" className={classes.polygon} /> </svg> </Paper> </Fade> </div> </div> ); }
lgollut/material-ui
docs/src/pages/components/transitions/SimpleFade.tsx
TypeScript
mit
1,399
#!/usr/bin/env python # -*- coding: utf-8 -*- # # MIT License # # Copyright (c) 2018 Miha Purg <[email protected]> # # 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. # # # """ This module contains the QStruct class for handling Q structure files (PDB, mol2). Additionally, it implements methods for finding and replacing atom placeholders (e.g. $1.N$) """ from __future__ import absolute_import, unicode_literals, division from six.moves import map import re import logging from collections import namedtuple from Qpyl.common import raise_or_log logger = logging.getLogger(__name__) PosVector = namedtuple("PosVector", ["x", "y", "z"]) _PLACEHOLDER_RE = re.compile("\$\S+\.\S+\$") _COMMENTS_RE = re.compile(r"[#\!].*") def find_placeholders(inputstring): """Find atom placeholders of the form $514.C3$ It ignores comments (characters following # or !) See also QStruct.convert_placeholders """ tmp = re.sub(_COMMENTS_RE, "", inputstring) return _PLACEHOLDER_RE.findall(tmp) class QStructError(Exception): pass class QStruct(object): """ Class for processing the structure (coordinates) Args: filename (path to the structure file) filetype (type of structure file: 'pdb' or 'mol2') ignore_errors (boolean): Optional, default is False.\ If set to True, some non-vital\ exceptions are logged instead. In contrast to QLib and QPrm, the 'read' methods in this class should not be called since the object should contain data from only one structure file. The structure data is stored in three lists: atoms, residues, molecules which contain _StructAtom, _StructResidue and _StructMolecule objects. """ def __init__(self, filename, filetype, ignore_errors=False): self.ignore_errors = ignore_errors FILE_TYPES = {'pdb': self._read_pdb, 'mol2': self._read_mol2} self.filetype = filetype.lower() if self.filetype not in FILE_TYPES: raise QStructError("Filetype {} not supported. Use {}" .format(filetype, " or ".join(FILE_TYPES))) self.atoms = [] self.residues = [] self.molecules = [] self.filename = filename # TODO: some sort of lookup hashes if needed # run the parser function FILE_TYPES[self.filetype](filename) # check if we actually got something for t in ["atoms", "residues", "molecules"]: if len(self.__dict__[t]) == 0: raise QStructError("No {} found, check file '{}' and" " filetype '{}'".format(t, self.filename, self.filetype)) def _read_mol2(self, mol2_file): """ Read and parse a mol2 file for coordinates. Args: mol2_file (string): name/path of file """ molecule = None residue = None aindex, old_aindex = None, None section = None for line in open(mol2_file, 'r').readlines(): if line.startswith("@<TRIPOS>"): section = line.replace("@<TRIPOS>", "").strip() if section == "MOLECULE": if molecule != None: self.molecules.append(molecule) molecule = _StructMolecule(self) continue if section == "ATOM": if aindex != None: old_aindex = aindex lf = line.split() aindex, aname = int(lf[0]), lf[1] x, y, z = map(float, lf[2:5]) rindex = int(lf[6]) rname = lf[7][0:3].upper() if old_aindex != None and aindex - old_aindex != 1: raise_or_log("Bad Mol2 format - atom " "index {} followed by {}" .format(old_aindex, aindex), QStructError, logger, self.ignore_errors) if not residue or residue.index_struct != rindex: if residue and rindex - residue.index_struct != 1: raise_or_log("Bad Mol2 format - residue " "index {} followed by {}" .format(residue.index_struct, rindex), QStructError, logger, self.ignore_errors) residue = _StructResidue(rindex, rname, molecule, self) self.residues.append(residue) molecule.add_residue(residue) atom = _StructAtom(aindex, aname, x, y, z, residue, self) self.atoms.append(atom) residue.add_atom(atom) # append last one after parsing if molecule != None and len(molecule.residues) > 0: self.molecules.append(molecule) def _read_pdb(self, pdb_file): """ Read and parse a PDB file for coordinates. Args: pdb_file (string): name/path of file """ # make a new _StructMolecule object molecule = _StructMolecule(self) # parse the PDB file residue = None aindex, old_aindex = None, None for line in open(pdb_file, 'r').readlines(): if line.startswith("ATOM") or line.startswith("HETATM"): if aindex != None: old_aindex = aindex aindex = int(line[6:12]) if old_aindex != None and aindex - old_aindex != 1: raise_or_log("Bad PDB format - atom " "index {} followed by {}" .format(old_aindex, aindex), QStructError, logger, self.ignore_errors) aname = line[12:17].strip() rname = line[17:20].strip().upper() rindex = int(line[22:26]) x, y, z = map(float, (line[30:38], line[38:46], line[46:54])) if not residue or residue.index_struct != rindex: if residue and rindex - residue.index_struct != 1: raise_or_log("Bad PDB format - residue " "index {} followed by {}" .format(residue.index_struct, rindex), QStructError, logger, self.ignore_errors) residue = _StructResidue(rindex, rname, molecule, self) self.residues.append(residue) molecule.add_residue(residue) if aname in [a.name for a in residue.atoms]: raise_or_log("Bad PDB format - two atoms with same name " "({}) in residue {}.{}" "".format(aname, rname, rindex), QStructError, logger, self.ignore_errors) atom = _StructAtom(aindex, aname, x, y, z, residue, self) self.atoms.append(atom) residue.add_atom(atom) elif line.startswith("TER") or line.startswith("GAP"): self.molecules.append(molecule) residue = None molecule = _StructMolecule(self) # append last one if it didn't gave a TER/GAP if molecule != None and len(molecule.residues) > 0: self.molecules.append(molecule) def convert_placeholders(self, inputstring): """Convert atom placeholders ($514.C3$) to indexes. Placeholders are a combination of the residue id and atom name, encapsulated in $$ - $RESID.ATOM_NAME$ In addition,there are some special values: $LAST.ID$ - id of last atom in the system Arguments: inputstring (string): string with placeholders (input file contents) Returns: outputstring (string): converted string """ id_map = {"{}.{}".format(a.residue.index, a.name): str(a.index) for a in self.atoms} last_id = "{}.{}".format(self.atoms[-1].residue.index, self.atoms[-1].name) outputstring = "" for line in inputstring.split("\n"): comment = "" if "#" in line: i = line.index("#") line, comment = line[:i], line[i:] c = find_placeholders(line) for pid in c: pid = pid.strip("$") pid2 = pid.replace("LAST.ID", last_id) try: padding = (len(pid2)+2 - len(id_map[pid2])) * " " except KeyError: raise QStructError("Atom '${}$' does not exist in the pdb " "structure.".format(pid2)) line = re.sub("\$" + pid + "\$", id_map[pid2] + padding, line) outputstring += line + comment + "\n" return outputstring class _StructAtom(object): """Contains structural information for an atom. Arguments: index_struct (int): index as written in pdb or mol2 name (string): atom name x,y,z (float): coordinates residue (_StructResidue): parent residue object structure (_QStruct): parent structure object Property 'index' (int) is the actual 1-based index of the atom in the atom list (as opposed to index_struct which was read from the file). It should correspond to the index in the generated topology. """ def __init__(self, index_struct, name, x, y, z, residue, structure): self.index_struct = int(index_struct) self.name = name self.coordinates = PosVector(float(x), float(y), float(z)) self.residue = residue self.structure = structure @property def index(self): return self.structure.atoms.index(self) + 1 def __repr__(self): res = self.residue mol = res.molecule return "_StructAtom: {}.{}.{}".format(mol.index, res.index, self.index) class _StructResidue(object): """Contains structural information for a residue. Arguments: index_struct (int): index as written in pdb or mol2 name (string): residue name molecule (_StructMolecule): parent molecule object structure (_QStruct): parent structure object Property 'index' (int) is the actual 1-based index of the residue in the residue list (as opposed to index_struct which was read from the file). It should correspond to the index in the generated topology. """ def __init__(self, index_struct, name, molecule, structure): self.atoms = [] self.index_struct = int(index_struct) self.name = name self.molecule = molecule self.structure = structure @property def index(self): return self.structure.residues.index(self) + 1 def add_atom(self, atom): self.atoms.append(atom) def __repr__(self): mol = self.molecule return "_StructResidue: {}.{}{}".format(mol.index, self.name, self.index) class _StructMolecule(object): """Contains structural information for a molecule. Arguments: structure (_QStruct): parent structure object Special property is 'index' (int). It is the actual 1-based index of the molecule in the residue list (as it was appended). This should corresponds to the index in the generated topology. """ def __init__(self, structure): self.residues = [] self.structure = structure @property def index(self): return self.structure.molecules.index(self) + 1 def add_residue(self, residue): self.residues.append(residue) def __repr__(self): return "_StructMolecule: {}".format(self.index)
mpurg/qtools
packages/Qpyl/core/qstructure.py
Python
mit
13,331
/* * Copyright (c) 2016, Pycom Limited. * * This software is licensed under the GNU GPL version 3 or any * later version, with permitted additional terms. For more information * see the Pycom Licence v1.0 document supplied with this file, or * available at https://www.pycom.io/opensource/licensing */ #include <stdint.h> #include <string.h> #include "py/mpstate.h" #include "py/runtime.h" #include "bufhelper.h" #include "heap_alloc_caps.h" #include "sdkconfig.h" #include "esp_system.h" #include "esp_spi_flash.h" #include "nvs_flash.h" #include "esp_event.h" #include "esp_types.h" #include "esp_attr.h" #include "esp_intr.h" #include "soc/dport_reg.h" #include "soc/gpio_sig_map.h" #include "analog.h" #include "pybadc.h" #include "mpexception.h" #include "mpsleep.h" #include "machpin.h" #include "pins.h" /****************************************************************************** DECLARE CONSTANTS ******************************************************************************/ #define PYB_ADC_NUM_CHANNELS (ADC1_CH_MAX) /****************************************************************************** DEFINE TYPES ******************************************************************************/ typedef struct { mp_obj_base_t base; bool enabled; } pyb_adc_obj_t; typedef struct { mp_obj_base_t base; pin_obj_t *pin; uint8_t channel; uint8_t id; uint8_t attn; bool enabled; } pyb_adc_channel_obj_t; /****************************************************************************** DECLARE PRIVATE DATA ******************************************************************************/ STATIC pyb_adc_channel_obj_t pyb_adc_channel_obj[PYB_ADC_NUM_CHANNELS] = { {.pin = &PIN_MODULE_P13, .channel = ADC1_CH0_GPIO36, .id = 0, .enabled = false}, {.pin = &PIN_MODULE_P14, .channel = ADC1_CH1_GPIO37, .id = 1, .enabled = false}, {.pin = &PIN_MODULE_P15, .channel = ADC1_CH2_GPIO38, .id = 2, .enabled = false}, {.pin = &PIN_MODULE_P16, .channel = ADC1_CH3_GPIO39, .id = 3, .enabled = false}, {.pin = &PIN_MODULE_P17, .channel = ADC1_CH7_GPIO35, .id = 4, .enabled = false}, {.pin = &PIN_MODULE_P18, .channel = ADC1_CH6_GPIO34, .id = 5, .enabled = false}, {.pin = &PIN_MODULE_P19, .channel = ADC1_CH4_GPIO32, .id = 6, .enabled = false}, {.pin = &PIN_MODULE_P20, .channel = ADC1_CH5_GPIO33, .id = 7, .enabled = false} }; STATIC pyb_adc_obj_t pyb_adc_obj = {.enabled = false}; STATIC const mp_obj_type_t pyb_adc_channel_type; /****************************************************************************** DECLARE PRIVATE FUNCTIONS ******************************************************************************/ STATIC mp_obj_t adc_channel_deinit(mp_obj_t self_in); /****************************************************************************** DEFINE PUBLIC FUNCTIONS ******************************************************************************/ STATIC void pyb_adc_init (pyb_adc_obj_t *self) { self->enabled = true; } STATIC void pyb_adc_check_init(void) { // not initialized if (!pyb_adc_obj.enabled) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_request_not_possible)); } } STATIC void pyb_adc_channel_init (pyb_adc_channel_obj_t *self) { // the ADC block must be enabled first pyb_adc_check_init(); // configure the pin in analog mode // pin_config (self->pin, -1, PIN_TYPE_ANALOG, PIN_TYPE_STD, -1, PIN_STRENGTH_2MA); // // enable the ADC channel // MAP_ADCChannelEnable(ADC_BASE, self->channel); self->enabled = true; } // STATIC void pyb_adc_deinit_all_channels (void) { // for (int i = 0; i < PYB_ADC_NUM_CHANNELS; i++) { // adc_channel_deinit(&pyb_adc_channel_obj[i]); // } // } /******************************************************************************/ /* Micro Python bindings : adc object */ STATIC void adc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_adc_obj_t *self = self_in; if (self->enabled) { mp_printf(print, "ADC(0, bits=12)"); } else { mp_printf(print, "ADC(0)"); } } STATIC const mp_arg_t pyb_adc_init_args[] = { { MP_QSTR_id, MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_bits, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 12} }, }; STATIC mp_obj_t adc_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *all_args) { // parse args mp_map_t kw_args; mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args); mp_arg_val_t args[MP_ARRAY_SIZE(pyb_adc_init_args)]; mp_arg_parse_all(n_args, all_args, &kw_args, MP_ARRAY_SIZE(args), pyb_adc_init_args, args); // check the peripheral id if (args[0].u_int != 0) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable)); } // check the number of bits if (args[1].u_int != 12) { nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_value_invalid_arguments)); } // setup the object pyb_adc_obj_t *self = &pyb_adc_obj; self->base.type = &pyb_adc_type; // initialize and register with the sleep module pyb_adc_init(self); //pyb_sleep_add ((const mp_obj_t)self, (WakeUpCB_t)pyb_adc_init); return self; } STATIC mp_obj_t adc_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { // parse args mp_arg_val_t args[MP_ARRAY_SIZE(pyb_adc_init_args) - 1]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(args), &pyb_adc_init_args[1], args); // check the number of bits if (args[0].u_int != 12) { nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_value_invalid_arguments)); } pyb_adc_init(pos_args[0]); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(adc_init_obj, 1, adc_init); STATIC mp_obj_t adc_deinit(mp_obj_t self_in) { pyb_adc_obj_t *self = self_in; self->enabled = false; // unregister it with the sleep module // pyb_sleep_remove ((const mp_obj_t)self); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(adc_deinit_obj, adc_deinit); STATIC mp_obj_t adc_channel(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { STATIC const mp_arg_t pyb_adc_channel_args[] = { { MP_QSTR_id, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_attn, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, }; // parse args mp_arg_val_t args[MP_ARRAY_SIZE(pyb_adc_channel_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(args), pyb_adc_channel_args, args); int32_t ch_id = -1; if (args[0].u_obj != MP_OBJ_NULL) { ch_id = mp_obj_get_int(args[0].u_obj); if (ch_id >= PYB_ADC_NUM_CHANNELS) { nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_os_resource_not_avaliable)); } else if (args[2].u_obj != mp_const_none) { if (pyb_adc_channel_obj[ch_id].pin != pin_find(args[2].u_obj)) { nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_value_invalid_arguments)); } } } else { pin_obj_t *_pin = pin_find(args[2].u_obj); for (int i = 0; i < PYB_ADC_NUM_CHANNELS; i++) { if (pyb_adc_channel_obj[i].pin == _pin) { ch_id = i; break; } } if (ch_id < 0) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable)); } } if (args[1].u_int < ADC_ATTEN_0DB || args[1].u_int > ADC_ATTEN_12DB) { nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_value_invalid_arguments)); } // setup the object pyb_adc_channel_obj_t *self = &pyb_adc_channel_obj[ch_id]; self->base.type = &pyb_adc_channel_type; self->attn = args[1].u_int; pyb_adc_channel_init (self); // register it with the sleep module // pyb_sleep_add ((const mp_obj_t)self, (WakeUpCB_t)pyb_adc_channel_init); return self; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(adc_channel_obj, 1, adc_channel); STATIC const mp_map_elem_t adc_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_init), (mp_obj_t)&adc_init_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&adc_deinit_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_channel), (mp_obj_t)&adc_channel_obj }, }; STATIC MP_DEFINE_CONST_DICT(adc_locals_dict, adc_locals_dict_table); const mp_obj_type_t pyb_adc_type = { { &mp_type_type }, .name = MP_QSTR_ADC, .print = adc_print, .make_new = adc_make_new, .locals_dict = (mp_obj_t)&adc_locals_dict, }; STATIC void adc_channel_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_adc_channel_obj_t *self = self_in; if (self->enabled) { mp_printf(print, "ADCChannel(%u, pin=%q)", self->id, self->pin->name); } else { mp_printf(print, "ADCChannel(%u)", self->id); } } STATIC mp_obj_t adc_channel_init(mp_obj_t self_in) { pyb_adc_channel_obj_t *self = self_in; // re-enable it pyb_adc_channel_init(self); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(adc_channel_init_obj, adc_channel_init); STATIC mp_obj_t adc_channel_deinit(mp_obj_t self_in) { pyb_adc_channel_obj_t *self = self_in; // // unregister it with the sleep module // pyb_sleep_remove ((const mp_obj_t)self); self->enabled = false; return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(adc_channel_deinit_obj, adc_channel_deinit); STATIC mp_obj_t adc_channel_value(mp_obj_t self_in) { pyb_adc_channel_obj_t *self = self_in; uint32_t value; // the channel must be enabled if (!self->enabled) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_request_not_possible)); } value = analog_adc1_read(self->channel, self->attn); return MP_OBJ_NEW_SMALL_INT(value); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(adc_channel_value_obj, adc_channel_value); STATIC mp_obj_t adc_channel_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 0, false); return adc_channel_value (self_in); } STATIC const mp_map_elem_t adc_channel_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_init), (mp_obj_t)&adc_channel_init_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&adc_channel_deinit_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_value), (mp_obj_t)&adc_channel_value_obj }, }; STATIC MP_DEFINE_CONST_DICT(adc_channel_locals_dict, adc_channel_locals_dict_table); STATIC const mp_obj_type_t pyb_adc_channel_type = { { &mp_type_type }, .name = MP_QSTR_ADCChannel, .print = adc_channel_print, .call = adc_channel_call, .locals_dict = (mp_obj_t)&adc_channel_locals_dict, };
jmarcelino/pycom-micropython
esp32/mods/pybadc.c
C
mit
11,608
from readSerials import * def test_pin_line_matches(): assert SerialMonitor.line_is_about_pins('pin0=123') assert SerialMonitor.line_is_about_pins('pin A0 = 0') assert SerialMonitor.line_is_about_pins('pin 13 = 4000008\n') assert SerialMonitor.line_is_about_pins('asdf= 123') assert not SerialMonitor.line_is_about_pins('') assert not SerialMonitor.line_is_about_pins('pinA1= 123 asd ') assert SerialMonitor.line_is_about_pins('pina1=4') def test_pin_values(): assert SerialMonitor.pin_and_value('pina1=4') == ('A1', 4) assert SerialMonitor.pin_and_value('pinA0 = 55') == ('A0', 55) assert SerialMonitor.pin_and_value('pin 0 = 3000') == ('0', 3000) def test_non_pins(): assert SerialMonitor.pin_and_value('asdef = 23') == ('asdef', 23)
niccokunzmann/Arduino-Monitor
ArduinoMonitor_py/test_readSerials.py
Python
mit
788
////////////////////////////////////////////////////////////////////////// #pragma once #include "IO/Globbing.hpp" #include "String.hpp" TEST(Globbing, Match) { using namespace CPF; using namespace IO; const String simple("test.test"); EXPECT_TRUE(Glob("*.test", simple.c_str())); EXPECT_TRUE(Glob("test.*", simple.c_str())); EXPECT_FALSE(Glob("*.xx", simple.c_str())); EXPECT_FALSE(Glob("temp.*", simple.c_str())); }
All8Up/cpf
Cpf/Libraries/Platform/IO/UnitTest/Test_Globbing.hpp
C++
mit
428
package com.github.twitch4j.kraken.domain; import lombok.Data; import java.util.List; @Data public class KrakenSubscriptionList { private List<KrakenSubscription> subscriptions; }
PhilippHeuer/twitch4j
rest-kraken/src/main/java/com/github/twitch4j/kraken/domain/KrakenSubscriptionList.java
Java
mit
186
import React, { Component } from 'react'; import ReactTransitionGroup from 'react-addons-transition-group' import TransitionGroup from 'react-transition-group/TransitionGroup'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; // ES6 import styles from './styles.js'; import transitionCss from '../../css/transition.css' import Mask from '../mask/index'; import PickerCore from '../picker-core/index.js'; import PropTypes from 'prop-types' import PullTransition from '../transition/pull' import FadeTransition from '../transition/fade' class Picker extends Component{ static PropTypes = { hidden:PropTypes.bool, } constructor(props){ super(props); this.state={ hidden:this.props.hidden, // hidden:true } this._current = this.props.current; this.onCancel=this.onCancel.bind(this); this.onConfirm = this.onConfirm.bind(this); } onCancel(e){ this.setState({ hidden:true }); this.props.onCancel && this.props.onCancel(); } onConfirm(e){ this.setState({ hidden:true }); this.props.onConfirm(this._current); } componentDidMount(){ } componentWillMount() { } componentWillReceiveProps(nextProps){ // console.info('nextProps.hidden:'+nextProps.hidden); // console.info('props.hidden:'+this.props.hidden); // if(nextProps.hidden !== this.props.hidden){ this.setState({ hidden:nextProps.hidden }); // } } componentWillAppear(){ console.info('componentWillEnter'); } render(){ return ( <div > <Mask hidden={this.state.hidden} onClick={this.onCancel} /> <TransitionGroup style={{...styles.group}}> {!this.state.hidden &&<PullTransition > <div ref="container" style={{...styles.container}}> <div style={styles.header}> <div style={{flex:'1',textAlign:'left'}} onClick={this.onCancel} >取消</div> <div style={{flex:'1',textAlign:'right'}} onClick={this.onConfirm} >确定</div> </div> <PickerCore dataSource={this.props.dataSource} current={this.props.current} onChanged={(d)=>{this._current=d;}} /> </div> </PullTransition>} </TransitionGroup> </div> ); } } export default Picker;
summerstream/react-practise
src/components/picker/index.js
JavaScript
mit
2,588
--- layout: post title: 'The HourSchool Blog: How can companies ask better questions?' date: '2012-05-24T13:00:30-05:00' tags: permalink: /post/23677215057/the-hourschool-blog-how-can-companies-ask-better --- <a href="http://blog.hourschool.com/post/23634405396/how-can-companies-ask-better-questions">The HourSchool Blog: How can companies ask better questions?</a><br/><p><a href="http://blog.hourschool.com/post/23634405396/how-can-companies-ask-better-questions" class="tumblr_blog">hourschool</a>:</p> <blockquote> <p>One core pillar of <a href="http://en.wikipedia.org/wiki/User-centered_design">human-centered design</a> is the idea of seeing the world through other people’s eyes, gaining empathy for their worldview, and meeting them where they are. Many companies are getting on board with the idea of putting the user or customer at the center of their business and design&#8230;</p></blockquote>
tjschuck/schneems
_posts/tumblr/2012-05-24-the-hourschool-blog-how-can-companies-ask-better.html
HTML
mit
911
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>RDoc Documentation</title> <link href="./fonts.css" rel="stylesheet"> <link href="./rdoc.css" rel="stylesheet"> <script type="text/javascript"> var rdoc_rel_prefix = "./"; </script> <script src="./js/jquery.js"></script> <script src="./js/navigation.js"></script> <script src="./js/search_index.js"></script> <script src="./js/search.js"></script> <script src="./js/searcher.js"></script> <script src="./js/darkfish.js"></script> <body id="top" role="document" class="file"> <nav role="navigation"> <div id="project-navigation"> <div id="home-section" role="region" title="Quick navigation" class="nav-section"> <h2> <a href="./index.html" rel="home">Home</a> </h2> <div id="table-of-contents-navigation"> <a href="./table_of_contents.html#pages">Pages</a> <a href="./table_of_contents.html#classes">Classes</a> <a href="./table_of_contents.html#methods">Methods</a> </div> </div> <div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> <div id="search-field-wrapper"> <input id="search-field" role="combobox" aria-label="Search" aria-autocomplete="list" aria-controls="search-results" type="text" name="search" placeholder="Search" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"> </div> <ul id="search-results" aria-label="Search Results" aria-busy="false" aria-expanded="false" aria-atomic="false" class="initially-hidden"></ul> </form> </div> </div> <div id="project-metadata"> <div id="fileindex-section" class="nav-section"> <h3>Pages</h3> <ul class="link-list"> <li><a href="./Examenes_gemspec.html">Examenes.gemspec</a> <li><a href="./Gemfile.html">Gemfile</a> <li><a href="./Gemfile_lock.html">Gemfile.lock</a> <li><a href="./Guardfile.html">Guardfile</a> <li><a href="./LICENSE_txt.html">LICENSE</a> <li><a href="./README_md.html">README</a> <li><a href="./Rakefile.html">Rakefile</a> <li><a href="./doc/Examenes_html.html">Examenes.html</a> <li><a href="./doc/Examenes/ExamenCompleto_html.html">ExamenCompleto.html</a> <li><a href="./doc/Examenes/List_html.html">List.html</a> <li><a href="./doc/Examenes/PreguntaSimple_html.html">PreguntaSimple.html</a> <li><a href="./doc/Examenes/UI_html.html">UI.html</a> <li><a href="./doc/Examenes/VerdaderoFalso_html.html">VerdaderoFalso.html</a> <li><a href="./doc/Examenes_gemspec_html.html">Examenes_gemspec.html</a> <li><a href="./doc/Gemfile_html.html">Gemfile.html</a> <li><a href="./doc/Gemfile_lock_html.html">Gemfile_lock.html</a> <li><a href="./doc/Guardfile_html.html">Guardfile.html</a> <li><a href="./doc/LICENSE_txt_html.html">LICENSE_txt.html</a> <li><a href="./doc/Object_html.html">Object.html</a> <li><a href="./doc/README_md_html.html">README_md.html</a> <li><a href="./doc/Rakefile_html.html">Rakefile.html</a> <li><a href="./doc/doc/Examenes/ExamenCompleto_html_html.html">ExamenCompleto_html.html</a> <li><a href="./doc/doc/Examenes/List_html_html.html">List_html.html</a> <li><a href="./doc/doc/Examenes/PreguntaSimple_html_html.html">PreguntaSimple_html.html</a> <li><a href="./doc/doc/Examenes/UI_html_html.html">UI_html.html</a> <li><a href="./doc/doc/Examenes/VerdaderoFalso_html_html.html">VerdaderoFalso_html.html</a> <li><a href="./doc/doc/Examenes_gemspec_html_html.html">Examenes_gemspec_html.html</a> <li><a href="./doc/doc/Examenes_html_html.html">Examenes_html.html</a> <li><a href="./doc/doc/Gemfile_html_html.html">Gemfile_html.html</a> <li><a href="./doc/doc/Gemfile_lock_html_html.html">Gemfile_lock_html.html</a> <li><a href="./doc/doc/Guardfile_html_html.html">Guardfile_html.html</a> <li><a href="./doc/doc/LICENSE_txt_html_html.html">LICENSE_txt_html.html</a> <li><a href="./doc/doc/Object_html_html.html">Object_html.html</a> <li><a href="./doc/doc/README_md_html_html.html">README_md_html.html</a> <li><a href="./doc/doc/Rakefile_html_html.html">Rakefile_html.html</a> <li><a href="./doc/doc/created_rid_html.html">created_rid.html</a> <li><a href="./doc/doc/doc/Examenes/ExamenCompleto_html_html_html.html">ExamenCompleto_html_html.html</a> <li><a href="./doc/doc/doc/Examenes/List_html_html_html.html">List_html_html.html</a> <li><a href="./doc/doc/doc/Examenes/PreguntaSimple_html_html_html.html">PreguntaSimple_html_html.html</a> <li><a href="./doc/doc/doc/Examenes/UI_html_html_html.html">UI_html_html.html</a> <li><a href="./doc/doc/doc/Examenes/VerdaderoFalso_html_html_html.html">VerdaderoFalso_html_html.html</a> <li><a href="./doc/doc/doc/Examenes_gemspec_html_html_html.html">Examenes_gemspec_html_html.html</a> <li><a href="./doc/doc/doc/Examenes_html_html_html.html">Examenes_html_html.html</a> <li><a href="./doc/doc/doc/Gemfile_html_html_html.html">Gemfile_html_html.html</a> <li><a href="./doc/doc/doc/Gemfile_lock_html_html_html.html">Gemfile_lock_html_html.html</a> <li><a href="./doc/doc/doc/Guardfile_html_html_html.html">Guardfile_html_html.html</a> <li><a href="./doc/doc/doc/LICENSE_txt_html_html_html.html">LICENSE_txt_html_html.html</a> <li><a href="./doc/doc/doc/Object_html_html_html.html">Object_html_html.html</a> <li><a href="./doc/doc/doc/README_md_html_html_html.html">README_md_html_html.html</a> <li><a href="./doc/doc/doc/Rakefile_html_html_html.html">Rakefile_html_html.html</a> <li><a href="./doc/doc/doc/created_rid_html_html.html">created_rid_html.html</a> <li><a href="./doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html.html">ExamenCompleto_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Examenes/List_html_html_html_html.html">List_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html.html">PreguntaSimple_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Examenes/UI_html_html_html_html.html">UI_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html.html">VerdaderoFalso_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Examenes_gemspec_html_html_html_html.html">Examenes_gemspec_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Examenes_html_html_html_html.html">Examenes_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Gemfile_html_html_html_html.html">Gemfile_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Gemfile_lock_html_html_html_html.html">Gemfile_lock_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Guardfile_html_html_html_html.html">Guardfile_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/LICENSE_txt_html_html_html_html.html">LICENSE_txt_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Object_html_html_html_html.html">Object_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/README_md_html_html_html_html.html">README_md_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/Rakefile_html_html_html_html.html">Rakefile_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/created_rid_html_html_html.html">created_rid_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html_html.html">ExamenCompleto_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Examenes/List_html_html_html_html_html.html">List_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html_html.html">PreguntaSimple_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Examenes/UI_html_html_html_html_html.html">UI_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html_html.html">VerdaderoFalso_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Examenes_gemspec_html_html_html_html_html.html">Examenes_gemspec_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Examenes_html_html_html_html_html.html">Examenes_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Gemfile_html_html_html_html_html.html">Gemfile_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Gemfile_lock_html_html_html_html_html.html">Gemfile_lock_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Guardfile_html_html_html_html_html.html">Guardfile_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/LICENSE_txt_html_html_html_html_html.html">LICENSE_txt_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Object_html_html_html_html_html.html">Object_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/README_md_html_html_html_html_html.html">README_md_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/Rakefile_html_html_html_html_html.html">Rakefile_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/created_rid_html_html_html_html.html">created_rid_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html_html_html.html">ExamenCompleto_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Examenes/List_html_html_html_html_html_html.html">List_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html_html_html.html">PreguntaSimple_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Examenes/UI_html_html_html_html_html_html.html">UI_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html_html_html.html">VerdaderoFalso_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Examenes_gemspec_html_html_html_html_html_html.html">Examenes_gemspec_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Examenes_html_html_html_html_html_html.html">Examenes_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Gemfile_html_html_html_html_html_html.html">Gemfile_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Gemfile_lock_html_html_html_html_html_html.html">Gemfile_lock_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Guardfile_html_html_html_html_html_html.html">Guardfile_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/LICENSE_txt_html_html_html_html_html_html.html">LICENSE_txt_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Object_html_html_html_html_html_html.html">Object_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/README_md_html_html_html_html_html_html.html">README_md_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/Rakefile_html_html_html_html_html_html.html">Rakefile_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/created_rid_html_html_html_html_html.html">created_rid_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html_html_html_html.html">ExamenCompleto_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Examenes/List_html_html_html_html_html_html_html.html">List_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html_html_html_html.html">PreguntaSimple_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Examenes/UI_html_html_html_html_html_html_html.html">UI_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html_html_html_html.html">VerdaderoFalso_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Examenes_gemspec_html_html_html_html_html_html_html.html">Examenes_gemspec_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Examenes_html_html_html_html_html_html_html.html">Examenes_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Gemfile_html_html_html_html_html_html_html.html">Gemfile_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Gemfile_lock_html_html_html_html_html_html_html.html">Gemfile_lock_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Guardfile_html_html_html_html_html_html_html.html">Guardfile_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/LICENSE_txt_html_html_html_html_html_html_html.html">LICENSE_txt_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Object_html_html_html_html_html_html_html.html">Object_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/README_md_html_html_html_html_html_html_html.html">README_md_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/Rakefile_html_html_html_html_html_html_html.html">Rakefile_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/created_rid_html_html_html_html_html_html.html">created_rid_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html_html_html_html_html.html">ExamenCompleto_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Examenes/List_html_html_html_html_html_html_html_html.html">List_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html_html_html_html_html.html">PreguntaSimple_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Examenes/UI_html_html_html_html_html_html_html_html.html">UI_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html_html_html_html_html.html">VerdaderoFalso_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Examenes_gemspec_html_html_html_html_html_html_html_html.html">Examenes_gemspec_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Examenes_html_html_html_html_html_html_html_html.html">Examenes_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_html_html_html_html_html_html_html_html.html">Gemfile_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_lock_html_html_html_html_html_html_html_html.html">Gemfile_lock_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Guardfile_html_html_html_html_html_html_html_html.html">Guardfile_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/LICENSE_txt_html_html_html_html_html_html_html_html.html">LICENSE_txt_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Object_html_html_html_html_html_html_html_html.html">Object_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/README_md_html_html_html_html_html_html_html_html.html">README_md_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/Rakefile_html_html_html_html_html_html_html_html.html">Rakefile_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/created_rid_html_html_html_html_html_html_html.html">created_rid_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html_html_html_html_html_html.html">ExamenCompleto_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/List_html_html_html_html_html_html_html_html_html.html">List_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html_html_html_html_html_html.html">PreguntaSimple_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/UI_html_html_html_html_html_html_html_html_html.html">UI_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html_html_html_html_html_html.html">VerdaderoFalso_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes_gemspec_html_html_html_html_html_html_html_html_html.html">Examenes_gemspec_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes_html_html_html_html_html_html_html_html_html.html">Examenes_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_html_html_html_html_html_html_html_html_html.html">Gemfile_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_lock_html_html_html_html_html_html_html_html_html.html">Gemfile_lock_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Guardfile_html_html_html_html_html_html_html_html_html.html">Guardfile_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/LICENSE_txt_html_html_html_html_html_html_html_html_html.html">LICENSE_txt_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Object_html_html_html_html_html_html_html_html_html.html">Object_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/README_md_html_html_html_html_html_html_html_html_html.html">README_md_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/Rakefile_html_html_html_html_html_html_html_html_html.html">Rakefile_html_html_html_html_html_html_html_html.html</a> <<<<<<< HEAD ======= <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html_html_html_html_html_html_html.html">ExamenCompleto_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/List_html_html_html_html_html_html_html_html_html_html.html">List_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html_html_html_html_html_html_html.html">PreguntaSimple_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/UI_html_html_html_html_html_html_html_html_html_html.html">UI_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html_html_html_html_html_html_html.html">VerdaderoFalso_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes_gemspec_html_html_html_html_html_html_html_html_html_html.html">Examenes_gemspec_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes_html_html_html_html_html_html_html_html_html_html.html">Examenes_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_html_html_html_html_html_html_html_html_html_html.html">Gemfile_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_lock_html_html_html_html_html_html_html_html_html_html.html">Gemfile_lock_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Guardfile_html_html_html_html_html_html_html_html_html_html.html">Guardfile_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/LICENSE_txt_html_html_html_html_html_html_html_html_html_html.html">LICENSE_txt_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Object_html_html_html_html_html_html_html_html_html_html.html">Object_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/README_md_html_html_html_html_html_html_html_html_html_html.html">README_md_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Rakefile_html_html_html_html_html_html_html_html_html_html.html">Rakefile_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/ExamenCompleto_html_html_html_html_html_html_html_html_html_html_html.html">ExamenCompleto_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/List_html_html_html_html_html_html_html_html_html_html_html.html">List_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/PreguntaSimple_html_html_html_html_html_html_html_html_html_html_html.html">PreguntaSimple_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/UI_html_html_html_html_html_html_html_html_html_html_html.html">UI_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes/VerdaderoFalso_html_html_html_html_html_html_html_html_html_html_html.html">VerdaderoFalso_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes_gemspec_html_html_html_html_html_html_html_html_html_html_html.html">Examenes_gemspec_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Examenes_html_html_html_html_html_html_html_html_html_html_html.html">Examenes_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_html_html_html_html_html_html_html_html_html_html_html.html">Gemfile_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Gemfile_lock_html_html_html_html_html_html_html_html_html_html_html.html">Gemfile_lock_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Guardfile_html_html_html_html_html_html_html_html_html_html_html.html">Guardfile_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/LICENSE_txt_html_html_html_html_html_html_html_html_html_html_html.html">LICENSE_txt_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Object_html_html_html_html_html_html_html_html_html_html_html.html">Object_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/README_md_html_html_html_html_html_html_html_html_html_html_html.html">README_md_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/Rakefile_html_html_html_html_html_html_html_html_html_html_html.html">Rakefile_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/fonts_css_html_html_html_html_html_html_html_html_html_html.html">fonts_css_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/index_html_html_html_html_html_html_html_html_html_html_html.html">index_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/darkfish_js_html_html_html_html_html_html_html_html_html_html.html">darkfish_js_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/jquery_js_html_html_html_html_html_html_html_html_html_html.html">jquery_js_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/navigation_js_html_html_html_html_html_html_html_html_html_html.html">navigation_js_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/search_index_js_html_html_html_html_html_html_html_html_html_html.html">search_index_js_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/search_js_html_html_html_html_html_html_html_html_html_html.html">search_js_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/searcher_js_html_html_html_html_html_html_html_html_html_html.html">searcher_js_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/rdoc_css_html_html_html_html_html_html_html_html_html_html.html">rdoc_css_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/table_of_contents_html_html_html_html_html_html_html_html_html_html_html.html">table_of_contents_html_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/fonts_css_html_html_html_html_html_html_html_html_html.html">fonts_css_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/index_html_html_html_html_html_html_html_html_html_html.html">index_html_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/darkfish_js_html_html_html_html_html_html_html_html_html.html">darkfish_js_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/jquery_js_html_html_html_html_html_html_html_html_html.html">jquery_js_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/navigation_js_html_html_html_html_html_html_html_html_html.html">navigation_js_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/search_index_js_html_html_html_html_html_html_html_html_html.html">search_index_js_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/search_js_html_html_html_html_html_html_html_html_html.html">search_js_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/js/searcher_js_html_html_html_html_html_html_html_html_html.html">searcher_js_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/rdoc_css_html_html_html_html_html_html_html_html_html.html">rdoc_css_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/doc/table_of_contents_html_html_html_html_html_html_html_html_html_html.html">table_of_contents_html_html_html_html_html_html_html_html_html.html</a> >>>>>>> 1797b52ab4f7c1e3ea54433b8ce1e4efdd762e99 <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/fonts_css_html_html_html_html_html_html_html_html.html">fonts_css_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/index_html_html_html_html_html_html_html_html_html.html">index_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/js/darkfish_js_html_html_html_html_html_html_html_html.html">darkfish_js_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/js/jquery_js_html_html_html_html_html_html_html_html.html">jquery_js_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/js/navigation_js_html_html_html_html_html_html_html_html.html">navigation_js_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/js/search_index_js_html_html_html_html_html_html_html_html.html">search_index_js_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/js/search_js_html_html_html_html_html_html_html_html.html">search_js_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/js/searcher_js_html_html_html_html_html_html_html_html.html">searcher_js_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/rdoc_css_html_html_html_html_html_html_html_html.html">rdoc_css_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/doc/table_of_contents_html_html_html_html_html_html_html_html_html.html">table_of_contents_html_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/fonts_css_html_html_html_html_html_html_html.html">fonts_css_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/index_html_html_html_html_html_html_html_html.html">index_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/js/darkfish_js_html_html_html_html_html_html_html.html">darkfish_js_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/js/jquery_js_html_html_html_html_html_html_html.html">jquery_js_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/js/navigation_js_html_html_html_html_html_html_html.html">navigation_js_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/js/search_index_js_html_html_html_html_html_html_html.html">search_index_js_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/js/search_js_html_html_html_html_html_html_html.html">search_js_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/js/searcher_js_html_html_html_html_html_html_html.html">searcher_js_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/rdoc_css_html_html_html_html_html_html_html.html">rdoc_css_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/doc/table_of_contents_html_html_html_html_html_html_html_html.html">table_of_contents_html_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/fonts_css_html_html_html_html_html_html.html">fonts_css_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/index_html_html_html_html_html_html_html.html">index_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/js/darkfish_js_html_html_html_html_html_html.html">darkfish_js_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/js/jquery_js_html_html_html_html_html_html.html">jquery_js_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/js/navigation_js_html_html_html_html_html_html.html">navigation_js_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/js/search_index_js_html_html_html_html_html_html.html">search_index_js_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/js/search_js_html_html_html_html_html_html.html">search_js_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/js/searcher_js_html_html_html_html_html_html.html">searcher_js_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/rdoc_css_html_html_html_html_html_html.html">rdoc_css_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/doc/table_of_contents_html_html_html_html_html_html_html.html">table_of_contents_html_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/fonts_css_html_html_html_html_html.html">fonts_css_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/index_html_html_html_html_html_html.html">index_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/js/darkfish_js_html_html_html_html_html.html">darkfish_js_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/js/jquery_js_html_html_html_html_html.html">jquery_js_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/js/navigation_js_html_html_html_html_html.html">navigation_js_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/js/search_index_js_html_html_html_html_html.html">search_index_js_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/js/search_js_html_html_html_html_html.html">search_js_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/js/searcher_js_html_html_html_html_html.html">searcher_js_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/rdoc_css_html_html_html_html_html.html">rdoc_css_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/doc/table_of_contents_html_html_html_html_html_html.html">table_of_contents_html_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/fonts_css_html_html_html_html.html">fonts_css_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/index_html_html_html_html_html.html">index_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/js/darkfish_js_html_html_html_html.html">darkfish_js_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/js/jquery_js_html_html_html_html.html">jquery_js_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/js/navigation_js_html_html_html_html.html">navigation_js_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/js/search_index_js_html_html_html_html.html">search_index_js_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/js/search_js_html_html_html_html.html">search_js_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/js/searcher_js_html_html_html_html.html">searcher_js_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/rdoc_css_html_html_html_html.html">rdoc_css_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/doc/table_of_contents_html_html_html_html_html.html">table_of_contents_html_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/fonts_css_html_html_html.html">fonts_css_html_html.html</a> <li><a href="./doc/doc/doc/doc/index_html_html_html_html.html">index_html_html_html.html</a> <li><a href="./doc/doc/doc/doc/js/darkfish_js_html_html_html.html">darkfish_js_html_html.html</a> <li><a href="./doc/doc/doc/doc/js/jquery_js_html_html_html.html">jquery_js_html_html.html</a> <li><a href="./doc/doc/doc/doc/js/navigation_js_html_html_html.html">navigation_js_html_html.html</a> <li><a href="./doc/doc/doc/doc/js/search_index_js_html_html_html.html">search_index_js_html_html.html</a> <li><a href="./doc/doc/doc/doc/js/search_js_html_html_html.html">search_js_html_html.html</a> <li><a href="./doc/doc/doc/doc/js/searcher_js_html_html_html.html">searcher_js_html_html.html</a> <li><a href="./doc/doc/doc/doc/rdoc_css_html_html_html.html">rdoc_css_html_html.html</a> <li><a href="./doc/doc/doc/doc/table_of_contents_html_html_html_html.html">table_of_contents_html_html_html.html</a> <li><a href="./doc/doc/doc/fonts_css_html_html.html">fonts_css_html.html</a> <li><a href="./doc/doc/doc/index_html_html_html.html">index_html_html.html</a> <li><a href="./doc/doc/doc/js/darkfish_js_html_html.html">darkfish_js_html.html</a> <li><a href="./doc/doc/doc/js/jquery_js_html_html.html">jquery_js_html.html</a> <li><a href="./doc/doc/doc/js/navigation_js_html_html.html">navigation_js_html.html</a> <li><a href="./doc/doc/doc/js/search_index_js_html_html.html">search_index_js_html.html</a> <li><a href="./doc/doc/doc/js/search_js_html_html.html">search_js_html.html</a> <li><a href="./doc/doc/doc/js/searcher_js_html_html.html">searcher_js_html.html</a> <li><a href="./doc/doc/doc/rdoc_css_html_html.html">rdoc_css_html.html</a> <li><a href="./doc/doc/doc/table_of_contents_html_html_html.html">table_of_contents_html_html.html</a> <li><a href="./doc/doc/fonts_css_html.html">fonts_css.html</a> <li><a href="./doc/doc/index_html_html.html">index_html.html</a> <li><a href="./doc/doc/js/darkfish_js_html.html">darkfish_js.html</a> <li><a href="./doc/doc/js/jquery_js_html.html">jquery_js.html</a> <li><a href="./doc/doc/js/navigation_js_html.html">navigation_js.html</a> <li><a href="./doc/doc/js/search_index_js_html.html">search_index_js.html</a> <li><a href="./doc/doc/js/search_js_html.html">search_js.html</a> <li><a href="./doc/doc/js/searcher_js_html.html">searcher_js.html</a> <li><a href="./doc/doc/rdoc_css_html.html">rdoc_css.html</a> <li><a href="./doc/doc/table_of_contents_html_html.html">table_of_contents_html.html</a> <li><a href="./doc/fonts_css.html">fonts.css</a> <li><a href="./doc/index_html.html">index.html</a> <li><a href="./doc/js/darkfish_js.html">darkfish.js</a> <li><a href="./doc/js/jquery_js.html">jquery.js</a> <li><a href="./doc/js/navigation_js.html">navigation.js</a> <li><a href="./doc/js/search_js.html">search.js</a> <li><a href="./doc/js/search_index_js.html">search_index.js</a> <li><a href="./doc/js/searcher_js.html">searcher.js</a> <li><a href="./doc/rdoc_css.html">rdoc.css</a> <li><a href="./doc/table_of_contents_html.html">table_of_contents.html</a> </ul> </div> <div id="classindex-section" class="nav-section"> <h3>Class and Module Index</h3> <ul class="link-list"> <li><a href="./Examenes.html">Examenes</a> <li><a href="./Examenes/ExamenCompleto.html">Examenes::ExamenCompleto</a> <li><a href="./Examenes/List.html">Examenes::List</a> <li><a href="./Examenes/PreguntaSimple.html">Examenes::PreguntaSimple</a> <li><a href="./Examenes/UI.html">Examenes::UI</a> <li><a href="./Examenes/VerdaderoFalso.html">Examenes::VerdaderoFalso</a> <li><a href="./Object.html">Object</a> </ul> </div> </div> </nav> <main role="main"> <p>This is the API documentation for RDoc Documentation. </main> <footer id="validator-badges" role="contentinfo"> <p><a href="http://validator.w3.org/check/referer">Validate</a> <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2. <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer>
alu0100600582/pract8_LPP
doc/index.html
HTML
mit
40,350
#include "portswidget.h" #include "../sysex/retcommandlist.h" #include "../sysex/retsetmidiinfo.h" #include "portdisplayhelper.h" #include "portfilterwidget.h" #include "portinfowidget.h" #include "portremapwidget.h" #include "portroutingwidget.h" #include <QLabel> #include <QListWidgetItem> #include <QScrollArea> PortsWidget::PortsWidget(MioMain *parent, Device *device, QString windowTitle) : MultiInfoWidget(parent, device, windowTitle) { infoSections = new std::vector<MultiInfoListEntry *>(); if (device->getCommands()->isCommandSupported( Command::GET_MIDI_PORT_INFO)) { getMidiPortSections(device); } } PortsWidget::~PortsWidget() { /* if (infoSections != nullptr) { infoSections->clear(); delete infoSections; }*/ } void PortsWidget::getMidiPorts( std::vector<std::shared_ptr<RetSetMidiPortInfo>> *midiPortInfos) { std::vector<std::shared_ptr<RetSetMidiPortInfo>>::iterator it; for (it = midiPortInfos->begin(); it != midiPortInfos->end(); ++it) { std::shared_ptr<RetSetMidiPortInfo> midiPortInfo = *it; MultiInfoListEntry *entry = new MultiInfoListEntry( MultiInfoListEntry::PORT_ROUTING, midiPortInfo->getPortName()); entry->icon = PortDisplayHelper::getPortIcon(midiPortInfo->getPortType()); entry->message = midiPortInfo; // TODO: mark port as disabled // entry->enabled = midiPortInfo->getInputEnabled(); infoSections->push_back(entry); } } void PortsWidget::getMidiPortSections(Device *device) { MidiPortInfos *midiPortInfoSections = device->getMidiPortInfos(); std::map<int, std::vector<std::shared_ptr<RetSetMidiPortInfo>> *>::iterator it; for (it = midiPortInfoSections->begin(); it != midiPortInfoSections->end(); ++it) { int section = it->first; int jack = section & 255; MidiPortType portType = static_cast<MidiPortType>(section >> 8); std::string portTypeName = PortDisplayHelper::getMidiPortTypeName(portType); if (jack > 0) portTypeName += " " + std::to_string(jack); infoSections->push_back( new MultiInfoListEntry(MultiInfoListEntry::SECTION, portTypeName)); std::vector<std::shared_ptr<RetSetMidiPortInfo>> *midiPortInfos = it->second; getMidiPorts(midiPortInfos); } } QWidget *PortsWidget::createWidget(MultiInfoListEntry *entry) { std::cout << "create PortsWidget" << std::endl; std::shared_ptr<RetSetMidiPortInfo> midiPortInfo = std::dynamic_pointer_cast<RetSetMidiPortInfo>(entry->message); int portNumber = static_cast<int>(midiPortInfo->getPortId()); QTabWidget *portTabWidget = new QTabWidget(this); PortInfoWidget *portInfoWidget = new PortInfoWidget(midiPortInfo); connect(portInfoWidget, &PortInfoWidget::changePortName, entry, &MultiInfoListEntry::changeName); portTabWidget->addTab(portInfoWidget, "MIDI-Port Info"); if (device->getCommands()->isCommandSupported( Command::GET_MIDI_PORT_ROUTE)) { PortRoutingWidget *w = new PortRoutingWidget(device, portNumber, this->parentWidget()); QScrollArea *a = new QScrollArea(portTabWidget); a->setWidget(w); portTabWidget->addTab(a, tr("MIDI-Port Routing")); } // TODO: smart_pointer if (device->getCommands()->isCommandSupported( Command::GET_MIDI_PORT_FILTER)) { PortFilterWidget *portFilterWidget = new PortFilterWidget(device, portNumber, this->parentWidget()); portTabWidget->addTab(portFilterWidget, tr("MIDI-Port Filter")); } if (device->getCommands()->isCommandSupported( Command::GET_MIDI_PORT_REMAP)) { PortRemapWidget *portRemapWidget = new PortRemapWidget(device, portNumber, this->parentWidget()); portTabWidget->addTab(portRemapWidget, tr("MIDI-Port Remap")); } return portTabWidget; }
dehnhardt/mioconfig
src/widgets/portswidget.cpp
C++
mit
3,619
#!/bin/bash psql -f create_ddl.sql psql -f load_raw.sql psql -f process_2014.sql psql -f process_2012.sql psql -f process_2010.sql
Bauer312/election-data
Model/create.sh
Shell
mit
133
using NUnit.Core.Extensibility; namespace Raging.Toolbox.Testing.FakeItEasy { [NUnitAddin] public class LocalAddin : Ploeh.AutoFixture.NUnit2.Addins.Addin { } }
RagingKore/Raging.Toolbox
Raging.Toolbox.Testing.FakeItEasy/LocalAddin.cs
C#
mit
180
#!/usr/bin/env node // Copyright (c) 2016 Uber Technologies, Inc. // // 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. /* global console, process */ /* eslint no-console: [0] */ /* eslint no-process-exit: [0] */ 'use strict'; var EXIT_CODES = require('./exit-codes'); module.exports = Logger; function Logger() { var self = this; self.exitCode = 0; } Logger.prototype.log = function log(message) { // We only want valid response objects on stdout console.error(message); }; Logger.prototype.error = function error(err) { var self = this; if (typeof err === 'string') { console.error(err); return; } console.error(err.name + ': ' + err.message); if (err.message.lastIndexOf('no peer available', 0) === 0) { console.error('This likely means that the service you are trying to reach ' + 'is not advertising to Hyperbahn.'); } self.exitCode = err.errorCode; console.log(JSON.stringify({ ok: false, name: err.name, message: err.message, isError: true, isErrorFrame: err.isErrorFrame || false, errorCode: err.errorCode, type: err.type, fullType: err.fullType })); }; Logger.prototype.response = function response(res, req, opts) { var self = this; if (!res.ok) { self.exitCode = self.exitCode | EXIT_CODES.RESPONSE_NOT_OK; } if (opts.raw) { process.stdout.write(res.arg3); } else { console.log(JSON.stringify(res)); } }; Logger.prototype.exit = function exit() { var self = this; process.exit(self.exitCode); };
uber/tcurl
logger.js
JavaScript
mit
2,651
# MET-Oracle: Weather Prediction to Improve Smart City Resilience --- __*MET-Oracle*__ is a tool to improve the lives of citizens and increase infrastructure's resilience, in Trinidad and Tobago, by helping us predict and prepare for adverse weather conditions brought on by Global Warming, and quantifying the effect it will have on our country's climate. It is a linear regression model built in Python using Tensorflow and our web interface uses the Google Maps API. --- --- Met-Oracle is a regressor based on recurrent networks, using tensorflow. Our objective is to predict continuous weather values, based on previous observations using the LSTM architecture. This build is dependant on tensorflow-1.1.0 and the polyaxon library. (https://github.com/polyaxon/polyaxon) --- ## Install and Run ### Create a Virtual Environment A virtual env is recommended as this build is very dependant on the package versions listed in requirements.txt python3 ``` $ mkvirtualenv -p python3 ltsm (ltsm) $ ``` python2 ``` $ mkvirtualenv ltsm (ltsm) $ ``` ### Install Requirements #### Requirements for tensorflow-1.1.0 and polyaxon ``` (ltsm) $ pip install -r ./requirements.txt ```
irontarkus95/MET-Oracle-lstm-weather-prediction
LSTM_RCNN/Readme.md
Markdown
mit
1,184
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_31) on Wed Dec 17 20:48:29 PST 2014 --> <title>Uses of Class javax.management.ImmutableDescriptor (Java Platform SE 8 )</title> <meta name="date" content="2014-12-17"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class javax.management.ImmutableDescriptor (Java Platform SE 8 )"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <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><a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;8</strong></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?javax/management/class-use/ImmutableDescriptor.html" target="_top">Frames</a></li> <li><a href="ImmutableDescriptor.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class javax.management.ImmutableDescriptor" class="title">Uses of Class<br>javax.management.ImmutableDescriptor</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">ImmutableDescriptor</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#javax.management">javax.management</a></td> <td class="colLast"> <div class="block">Provides the core classes for the Java Management Extensions.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="javax.management"> <!-- --> </a> <h3>Uses of <a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">ImmutableDescriptor</a> in <a href="../../../javax/management/package-summary.html">javax.management</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../javax/management/package-summary.html">javax.management</a> declared as <a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">ImmutableDescriptor</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">ImmutableDescriptor</a></code></td> <td class="colLast"><span class="typeNameLabel">ImmutableDescriptor.</span><code><span class="memberNameLink"><a href="../../../javax/management/ImmutableDescriptor.html#EMPTY_DESCRIPTOR">EMPTY_DESCRIPTOR</a></span></code> <div class="block">An empty descriptor.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../javax/management/package-summary.html">javax.management</a> that return <a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">ImmutableDescriptor</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">ImmutableDescriptor</a></code></td> <td class="colLast"><span class="typeNameLabel">ImmutableDescriptor.</span><code><span class="memberNameLink"><a href="../../../javax/management/ImmutableDescriptor.html#union-javax.management.Descriptor...-">union</a></span>(<a href="../../../javax/management/Descriptor.html" title="interface in javax.management">Descriptor</a>...&nbsp;descriptors)</code> <div class="block">Return an <code>ImmutableDescriptor</code> whose contents are the union of the given descriptors.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <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><a href="../../../javax/management/ImmutableDescriptor.html" title="class in javax.management">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;8</strong></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?javax/management/class-use/ImmutableDescriptor.html" target="_top">Frames</a></li> <li><a href="ImmutableDescriptor.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://download.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="../../../../legal/cpyr.html">Copyright</a> &#x00a9; 1993, 2015, Oracle and/or its affiliates. All rights reserved. </font></small></p> </body> </html>
fbiville/annotation-processing-ftw
doc/java/jdk8/javax/management/class-use/ImmutableDescriptor.html
HTML
mit
8,450
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_51) on Sun Oct 20 23:53:21 BST 2013 --> <TITLE> Uses of Class com.textrazor.annotations.Custom.BoundVariable.LinkedAnnotation </TITLE> <META NAME="date" CONTENT="2013-10-20"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.textrazor.annotations.Custom.BoundVariable.LinkedAnnotation"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../com/textrazor/annotations/Custom.BoundVariable.LinkedAnnotation.html" title="class in com.textrazor.annotations"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/textrazor/annotations//class-useCustom.BoundVariable.LinkedAnnotation.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Custom.BoundVariable.LinkedAnnotation.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>com.textrazor.annotations.Custom.BoundVariable.LinkedAnnotation</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../com/textrazor/annotations/Custom.BoundVariable.LinkedAnnotation.html" title="class in com.textrazor.annotations">Custom.BoundVariable.LinkedAnnotation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.textrazor.annotations"><B>com.textrazor.annotations</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.textrazor.annotations"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../com/textrazor/annotations/Custom.BoundVariable.LinkedAnnotation.html" title="class in com.textrazor.annotations">Custom.BoundVariable.LinkedAnnotation</A> in <A HREF="../../../../com/textrazor/annotations/package-summary.html">com.textrazor.annotations</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../com/textrazor/annotations/package-summary.html">com.textrazor.annotations</A> that return types with arguments of type <A HREF="../../../../com/textrazor/annotations/Custom.BoundVariable.LinkedAnnotation.html" title="class in com.textrazor.annotations">Custom.BoundVariable.LinkedAnnotation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.List&lt;<A HREF="../../../../com/textrazor/annotations/Custom.BoundVariable.LinkedAnnotation.html" title="class in com.textrazor.annotations">Custom.BoundVariable.LinkedAnnotation</A>&gt;</CODE></FONT></TD> <TD><CODE><B>Custom.BoundVariable.</B><B><A HREF="../../../../com/textrazor/annotations/Custom.BoundVariable.html#getLinks()">getLinks</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../com/textrazor/annotations/Custom.BoundVariable.LinkedAnnotation.html" title="class in com.textrazor.annotations"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/textrazor/annotations//class-useCustom.BoundVariable.LinkedAnnotation.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Custom.BoundVariable.LinkedAnnotation.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
TextRazor/textrazor-java
doc/com/textrazor/annotations/class-use/Custom.BoundVariable.LinkedAnnotation.html
HTML
mit
8,232
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>hammer: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.10.0 / hammer - 1.0.9+8.8.1</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> hammer <small> 1.0.9+8.8.1 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-12-07 06:33:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-07 06:33:16 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.10.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/lukaszcz/coqhammer&quot; dev-repo: &quot;git+https://github.com/lukaszcz/coqhammer.git&quot; bug-reports: &quot;https://github.com/lukaszcz/coqhammer/issues&quot; license: &quot;LGPL 2.1&quot; build: [ [make &quot;-j%{jobs}%&quot; {ocaml:version &gt;= &quot;4.06&quot;}] [make &quot;tests&quot;] {with-test} ] install: [ make &quot;install&quot; ] depends: [ &quot;ocaml&quot; &quot;conf-g++&quot; {build} &quot;coq&quot; {&gt;= &quot;8.8.1&quot; &amp; &lt; &quot;8.9~&quot;} ] tags: [ &quot;keyword:automation&quot; &quot;category:Miscellaneous/Coq Extensions&quot; &quot;date:2018-08-22&quot; ] authors: [ &quot;Lukasz Czajka &lt;[email protected]&gt;&quot; &quot;Cezary Kaliszyk &lt;[email protected]&gt;&quot; &quot;Burak Ekici &lt;[email protected]&gt;&quot; ] synopsis: &quot;Automation for Dependent Type Theory&quot; url { src: &quot;https://github.com/lukaszcz/coqhammer/archive/v1.0.9-coq8.8.1.tar.gz&quot; checksum: &quot;md5=525fffc2e9e07ec87e12ced8104c33b1&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-hammer.1.0.9+8.8.1 coq.8.10.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0). The following dependencies couldn&#39;t be met: - coq-hammer -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-hammer.1.0.9+8.8.1</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.07.1-2.0.6/released/8.10.0/hammer/1.0.9+8.8.1.html
HTML
mit
6,788
#pragma once class StkIpDlgMsg { public: StkIpDlgMsg(void); public: ~StkIpDlgMsg(void); static int StopStkIpDlg(HWND); static int NetworkConfigAcquisitionError(HWND); static int TooMuchIPFoundError(HWND); static int NetworkConfigChangeError(HWND); static int NoNetworkAdapterFoundError(HWND); static int ParameterError(HWND); static int TakeALongTime(HWND); };
s-takeuchi/YaizuNetTool
src/stk_ip_dlg/StkIpDlgMsg.h
C
mit
371
package sorm.test.types import org.scalatest.{FunSuite, Matchers} import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import sorm._ import samples._ import sorm.test.MultiInstanceSuite @RunWith(classOf[JUnitRunner]) class SeqOfSeqsSupportSuite extends FunSuite with Matchers with MultiInstanceSuite { import SeqOfSeqsSupportSuite._ def entities = Set() + Entity[A]() instancesAndIds foreach { case (db, dbId) => val a1 = db.save(A( Seq() )) val a2 = db.save(A( Seq( Seq(2, 3), Seq(), Seq(7) ) )) val a3 = db.save(A( Seq( Seq() ) )) val a4 = db.save(A( Seq( Seq(78) ) )) val a5 = db.save(A( Seq() )) test(dbId + " - Empty Seq matches empty Seq and not Seq of empty Seq"){ db.query[A] .whereEqual("a", Seq()) .fetch() .should( contain (a1) and contain (a5) and not contain (a3) ) } test(dbId + " - An empty item Seq does not match inexistent one"){ db.query[A] .whereEqual("a.item", Seq()) .fetch() .should( not contain (a1) and not contain (a5) ) } test(dbId + " - A partially matching seq with container seq containing other seq of same size"){ db.query[A] .whereEqual("a.item", Seq(2)) .fetch() .should( not contain (a2) ) } } } object SeqOfSeqsSupportSuite { case class A ( a : Seq[Seq[Int]] ) }
pjfanning/sorm
src/test/scala/sorm/test/types/SeqOfSeqsSupportSuite.scala
Scala
mit
1,434
--- title: Blog - Konstantinos Gavriil description: Personal blog with various notes. layout: default --- <div class="blog"> <h1>Blog Posts</h1> <br> <ul> {% for post in site.categories.blog %} <li><p> <a href="{{ post.url }}" class="title_link">{{ post.title }}</a> <br> {{ post.excerpt }} <span class="date">{{ post.date | date: '%b %Y' }}</span> </p></li> {% endfor %} </ul> </div>
konstantg/konstantg.github.io
blog/index.html
HTML
mit
464
<?php namespace Algatux\Repository\Exceptions; /** * Class RepositoryException * @package Algatux\Repository\Exceptions */ class RepositoryException extends \Exception { /** * @param string $message * @param int $code * @param \Exception $previous */ public function __construct($message = "", $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); } }
Algatux/laravel-repository
src/Exceptions/RepositoryException.php
PHP
mit
441
ActiveRecord::Schema.define(:version=>0) do create_table :people, :force=>true do |t| t.string :name t.binary :ssn_b, :picture end end
jmckible/lucifer
test/schema.rb
Ruby
mit
147
<?php namespace App; use Illuminate\Database\Eloquent\Model; class ItemProgress extends Model { protected $fillable = [ 'item_id', 'flow_no', 'progress_status', 'progress_memo', 'status', 'rgster', 'updter' ]; protected $touches = array('item'); //item_progresses->item public function item(){ return $this->belongsTo('App\Item', 'item_id', 'id'); } }
hibriiiiidge/LaravelProject
myProject/app/ItemProgress.php
PHP
mit
399
'use strict'; const expect = require('chai').expect; const SQLBuilder = require('../../index'); const SQLQuery = require('../../lib/sqlquery'); var sqlbuilder = new SQLBuilder(); describe('ANSI Query Operators', function() { describe('$update: { ... }', function() { describe('$set: { ... }', function() { it('should return UPDATE `table-identifier` SET col1 = value1, ...', function() { var query = sqlbuilder.build({ $update: { $table: 'people', $set: { first_name: 'John', last_name: 'Doe' } } }); //expect(query).to.be.instanceOf(SQLQuery); expect(query.sql).to.equal('UPDATE `people` SET `first_name` = ?, `last_name` = ?'); expect(query.values.length).to.equal(2); expect(query.values[0]).to.equal('John'); expect(query.values[1]).to.equal('Doe'); }); it('should return UPDATE `table-identifier` SET col1 = value1, ... WHERE ...', function() { var query = sqlbuilder.build({ $update: { $table: 'people', $set: { first_name: 'John', last_name: 'Doe' }, $where: { age: { $gte: 18 } } } }); //expect(query).to.be.instanceOf(SQLQuery); expect(query.sql).to.equal('UPDATE `people` SET `first_name` = ?, `last_name` = ? WHERE `age` >= ?'); expect(query.values.length).to.equal(3); expect(query.values[0]).to.equal('John'); expect(query.values[1]).to.equal('Doe'); expect(query.values[2]).to.equal(18); }); }); }); });
planetarydev/json-sql-builder
test/ansi/update.js
JavaScript
mit
1,516
class AddAvatarToMingleInstagramPhotos < ActiveRecord::Migration def change add_column :mingle_instagram_photos, :avatar_id, :string end end
hyperoslo/mingle
db/migrate/20150304091341_add_avatar_to_mingle_instagram_photos.rb
Ruby
mit
149
/* * Dawn Engine * Written by David Avedissian (c) 2012-2019 ([email protected]) */ #include "Core.h" using namespace dw; class Viewer : public App { public: DW_OBJECT(Viewer); Viewer() : App("Viewer", DW_VERSION_STR) { } void init(const CommandLine&) override { } void shutdown() override { } }; DW_IMPLEMENT_MAIN(Viewer);
davedissian/dawnengine
src/viewer/Main.cpp
C++
mit
355
/** * Copyright (C) 2010-18 diirt developers. See COPYRIGHT.TXT * All rights reserved. Use is subject to license terms. See LICENSE.TXT */ package org.diirt.datasource.sample.services.math; import java.util.HashMap; import java.util.Map; import org.diirt.service.ServiceMethod; import org.diirt.service.ServiceRegistry; import org.diirt.vtype.ValueFactory; /** * Locates a service method and executes it synchronously (i.e. waits for the * call to finish). * * @author asbarber */ public class SynchonousMethodExecutionExample { /** * Sample execution of Math services. * * @param args ignored */ public static void main(String[] args) { System.out.println("Locating service method..."); ServiceMethod method = ServiceRegistry.getDefault().findServiceMethod("math/add"); System.out.println("Service method found: " + method); System.out.println("Preparing arguments..."); Map<String, Object> arguments = new HashMap<>(); arguments.put("arg1", ValueFactory.newVDouble(1.0)); arguments.put("arg2", ValueFactory.newVDouble(2.0)); System.out.println("Arguments: " + arguments); System.out.println("Executing service..."); Map<String, Object> result = method.executeSync(arguments); System.out.println("Result: " + result); } }
diirt/diirt
pvmanager/datasource-sample/src/main/java/org/diirt/datasource/sample/services/math/SynchonousMethodExecutionExample.java
Java
mit
1,357
#ifndef PERSON_H_INCLUDED #define PERSON_H_INCLUDED #include <cstdint> #include <vector> #include <SFML/System/Vector2.hpp> using data_t = uint16_t; using MoveVector = sf::Vector2<int8_t>; class Person; enum class MoveState : uint8_t { Walking, Swimming, }; //Simply, this is a struct for new people aka "children" struct ChildData { data_t strength; data_t colony; data_t isDiseased; operator Person() const; }; //Represents one person on the map class Person { public: Person& init (const ChildData& data); void update(); void startSwim(const MoveVector& dir); void endSwim(); void kill(); void giveDisease(); void fight(Person& other); MoveVector getNextMove() const; ChildData getChild(); data_t getAge () const { return m_age; } data_t getStrength () const { return m_strength; } data_t getProduction() const { return m_productionCount; } data_t getColony () const { return m_colony; } data_t getKills () const { return m_kills; } bool isAlive () const { return m_isAlive; } bool isDiseased () const { return m_isDiseased; } void setAge (data_t age) { m_age = age; } void setStrength (data_t str) { m_strength = str; } void setProduction (data_t pro) { m_productionCount = pro; } void setKills (data_t kil) { m_kills = kil; } Person& operator=(const ChildData& data) { return init(data); } MoveState getMoveState () const { return m_moveState; } private: data_t m_age = 0; data_t m_strength = 0; data_t m_colony = 0; data_t m_productionCount = 0; data_t m_kills = 0; MoveVector m_swimVector; MoveState m_moveState = MoveState::Walking; bool m_isDiseased = false; bool m_isAlive = false; }; #endif // PERSON_H_INCLUDED
Spartan322/Empire
Source/Sim/Person.h
C
mit
2,132
var utils = require('utils'); var casper = require('casper').create({ //waitTimeout: 30000, stepTimeout: 50000, verbose: false, pageSettings: { loadImages: true, // The WebPage instance used by Casper will loadPlugins: true, // use these settings viewportSize: { width: 1024, height: 768 }, userAgent: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36' } }); var results = {}; var s, e; casper.resourceTimeout = 25000; casper.onResourceTimeout = function(err) { results.error = err; console.log(JSON.stringify(results)); this.exit(1); }; casper.on('error', function(err) { results.error = err; console.log(JSON.stringify(results)); this.exit(1); }); casper.on('onTimeout', function() { results.error = "timeout"; }); casper.on('load.failed', function(obj) { results.error = err; console.log(JSON.stringify(results)); this.exit(1); }); casper.on('url.changed', function(url) { results.redirectURL = url; }); casper.on('step.error', function(err) { results.error = err; console.log(JSON.stringify(results)); this.exit(1); }); casper.on('step.timeout', function(err) { results.error = err; console.log(JSON.stringify(results)); this.exit(1); }); casper.on('load.started', function(requestData, request) { //console.log("request url " + requestData.url); if (typeof s === 'undefined'){ s = new Date().getTime(); } }); casper.on('load.finished', function(response) { //console.log("response url " + response.url); e = new Date().getTime(); results.loadtime = (e - s); results.http = this.currentResponse; }); casper.start(casper.cli.get("url")); casper.run(function() { var self = this; var xpath = casper.cli.get("xpath"); if (xpath) { try { xpath = xpath.split(';'); xpath.forEach(function(xp) { results.content = self.evaluate(function(xp) { var elements = __utils__.getElementsByXPath(xp); return [].map.call(elements, function(element) { return element.innerText; }); }, xpath); }); } catch (err) { results.error = err; } } else { results.content = self.page.content; } setTimeout(function() { console.log(JSON.stringify(results)); self.exit(); }, 2000); });
ckir/njsagent-rsscollector
php/Rss/Feed/Reader/html.js
JavaScript
mit
2,549
import React from 'react'; import { connect } from 'react-redux'; import { array, bool, func } from 'prop-types'; import NewScoreFormContainer from './NewScoreFormContainer'; import RecentScores from '../components/recentScores'; import { loadPlayers } from '../actions/playerActions'; import { loadScorePage, deleteScore } from '../actions/scoreActions'; class ScoresContainer extends React.Component { static propTypes = { loadScorePage: func.isRequired, loadPlayers: func.isRequired, deleteScore: func.isRequired, scores: array, hasMoreScores: bool, players: array } constructor(props) { super(props); this.onDeleteScore = this.onDeleteScore.bind(this); this.onMoreScoresClick = this.onMoreScoresClick.bind(this); } componentDidMount() { this.props.loadScorePage(1); this.props.loadPlayers(); } onMoreScoresClick() { this.props.loadScorePage(); } onDeleteScore(id) { if (confirm('Are you sure?')) { this.props.deleteScore(id); } } render() { return ( <div className="scores"> <div className="col-md-6"> <div className="panel panel-default"> <div className="panel-heading"> <h4>Score History</h4> </div> <RecentScores scores={this.props.scores} onDeleteScoreClick={this.onDeleteScore} /> <div className="panel-footer text-right"> <button className="btn btn-default btn-sm" onClick={this.onMoreScoresClick} disabled={!this.props.hasMoreScores}>More scores <span className="glyphicon glyphicon-menu-down"></span></button> </div> </div> </div> <div className="col-md-6"> <NewScoreFormContainer players={this.props.players} /> </div> </div> ); } } function mapStateToProps(state) { return { scores: state.paginatedScores, players: state.players, hasMoreScores: state.hasMoreScores }; } function mapDispatchToProps(dispatch) { return { loadScorePage: (page) => { dispatch(loadScorePage(page)); }, loadPlayers: () => { dispatch(loadPlayers()); }, deleteScore: (id) => { dispatch(deleteScore(id)); } }; } export default connect(mapStateToProps, mapDispatchToProps)(ScoresContainer);
alexzherdev/foosballtracker
src/js/containers/ScoresContainer.js
JavaScript
mit
2,382
package com.aberigle.android.sliderview; import android.content.Context; import android.graphics.Color; import android.graphics.Typeface; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; import android.util.AttributeSet; import android.util.TypedValue; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.widget.HorizontalScrollView; import android.widget.TextView; /** * Created by aberigle on 06/04/15. */ public class SlidingTabLayout extends HorizontalScrollView { private static final float DEFAULT_TAB_VIEW_PADDING_DIPS = 16; private final SlidingTabStrip strip; private final int selectedTextColor; private final int defaultTextColor; private int textColor; private ViewPager viewpager; private PagerChangeListener pagerListener; private ViewPager.OnPageChangeListener onPageChangeListener; private ActionBar bar; private ColorDrawable barBackground; private int customTabViewId; private int customTabViewTextViewId; public SlidingTabLayout(Context context) { this(context, null); } public SlidingTabLayout(Context context, AttributeSet attributes) { super(context, attributes); setHorizontalScrollBarEnabled(false); setFillViewport(true); textColor = -1; selectedTextColor = context.getResources().getColor(R.color.white); defaultTextColor = context.getResources().getColor(R.color.bright_foreground_dark_disabled); strip = new SlidingTabStrip(context, Color.WHITE); addView(strip); } public void refreshViews() { populateFromPager(); } public void setBorderIndicatorThicknessDPS(int dps) { strip.setBorderThicknessDPS(dps); strip.invalidate(); } @Override public void setElevation(float elevation) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) super.setElevation(elevation); else ViewCompat.setElevation(this, elevation); } private void populateFromPager() { PagerAdapter adapter = viewpager.getAdapter(); View tab; strip.removeAllViews(); if (adapter != null) for (int i = 0; i < adapter.getCount(); i++) { final int index = i; tab = getTabView(adapter.getPageTitle(i)); tab.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { viewpager.setCurrentItem(index); } }); strip.addView(tab); } } public View getTitleView(int position) { return strip.getChildAt(position); } public void setCustomTabView(int tabViewId, int textViewId) { this.customTabViewId = tabViewId; this.customTabViewTextViewId = textViewId; textColor = -1; } private View getTabView(CharSequence title) { if (customTabViewId == 0) return getDefaultTabView(title); else return getCustomTabView(title); } private View getCustomTabView(CharSequence title) { LayoutInflater inflater = LayoutInflater.from(getContext()); View tabView = inflater.inflate(customTabViewId, strip, false); TextView text = (TextView) tabView.findViewById(customTabViewTextViewId); if (text != null) { text.setText(title); if (textColor == -1) textColor = text.getCurrentTextColor(); } return tabView; } private View getDefaultTabView(CharSequence title) { int padding = (int) (DEFAULT_TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density); if (textColor == -1) textColor = defaultTextColor; TextView tab = new TextView(getContext()); tab.setGravity(Gravity.CENTER); tab.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); tab.setTypeface(Typeface.DEFAULT_BOLD); tab.setTextColor(textColor); tab.setAllCaps(true); tab.setText(title); tab.setPadding(padding, padding, padding, padding); return tab; } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (viewpager != null) { pagerListener.onPageSelected(viewpager.getCurrentItem()); scrollToTab(viewpager.getCurrentItem(), 0); } } @Override public void setBackgroundColor(int color) { super.setBackgroundColor(color); if (bar != null) ((ColorDrawable) barBackground.mutate()).setColor(color); } private void scrollToTab(int index, float positionOffset) { final int childCount = strip.getChildCount(); if (childCount == 0 || index < 0 || index >= childCount) return; View selectedChild = strip.getChildAt(index); if (selectedChild != null) { int left = selectedChild.getLeft(); if (index < (childCount - 1)) { View nextTitle = strip.getChildAt(index + 1); left = (int) (positionOffset * nextTitle.getLeft() + (1.0f - positionOffset) * left); } int targetScrollX = left + (selectedChild.getWidth() / 2) - (getWidth() / 2); scrollTo(targetScrollX, 0); } } public void setViewpager(ViewPager pager) { if (pager != null) { viewpager = pager; pager.setOnPageChangeListener(pagerListener = new PagerChangeListener()); populateFromPager(); } } public void setOnPageChangeListener(ViewPager.OnPageChangeListener onPageChangeListener) { this.onPageChangeListener = onPageChangeListener; } public void attachToActionBar(ActionBar bar) { this.bar = bar; if (bar != null) { bar.setElevation(0); barBackground = new ColorDrawable(((ColorDrawable) getBackground()).getColor()); bar.setBackgroundDrawable(barBackground); } } public void setDefaultTabView() { setCustomTabView(0, 0); } private class PagerChangeListener implements ViewPager.OnPageChangeListener { private TextView oldPos; @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { strip.onViewPagerChanged(position, positionOffset); scrollToTab(position, positionOffset); if (onPageChangeListener != null) onPageChangeListener.onPageScrolled(position, positionOffset, positionOffsetPixels); } @Override public void onPageSelected(int position) { TextView selected; View view = strip.getChildAt(position); if (customTabViewId == 0) selected = (TextView) view; else selected = (TextView) view.findViewById(customTabViewTextViewId); if (oldPos != null) if (!oldPos.equals(selected)) oldPos.setTextColor(textColor); oldPos = selected; selected.setTextColor(selectedTextColor); if (onPageChangeListener != null) onPageChangeListener.onPageSelected(position); } @Override public void onPageScrollStateChanged(int state) { if (onPageChangeListener != null) onPageChangeListener.onPageScrollStateChanged(state); } } }
aberigle/android-sliderview
sliderview/src/main/java/com/aberigle/android/sliderview/SlidingTabLayout.java
Java
mit
7,623
<!DOCTYPE html> <html lang="en"> <head> <title>three.js webgl - adaptive tone-mapping</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <style> body { background:#000; color:#fff; padding:0; margin:0; overflow:hidden; font-family:georgia; text-align:center; } a { color:skyblue; text-decoration:none } canvas { pointer-events:none; z-index:0; position:relative; } .label { background-color: black; position: absolute; z-index: 100; padding: 5px } </style> </head> <body> <div id="d"> <div id="info"> <a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> webgl demo : Earth diffuse and city lights by <a href="http://seanward.org" target="_blank" rel="noopener">Sean Ward</a> : </div> <div class="label" style="position: absolute;left: 12%;bottom: 10%;">Low Dynamic Range</div> <div class="label" style="position: absolute;left: 12%;bottom: 5%;">Static Tone Mapping</div> <div class="label" style="position: absolute;left: 45%;bottom: 10%;">High Dynamic Range</div> <div class="label" style="position: absolute;left: 45%;bottom: 5%;">Static Tone Mapping</div> <div class="label" style="position: absolute;left: 80%;bottom: 10%;">High Dynamic Range</div> <div class="label" style="position: absolute;left: 80%;bottom: 5%;">Adaptive Tone Mapping</div> </div> <script src="../build/three.js"></script> <script src="js/WebGL.js"></script> <script src="js/libs/dat.gui.min.js"></script> <script src="js/shaders/CopyShader.js"></script> <script src="js/shaders/LuminosityShader.js"></script> <script src="js/shaders/ConvolutionShader.js"></script> <script src="js/shaders/ToneMapShader.js"></script> <script src="js/shaders/GammaCorrectionShader.js"></script> <script src="js/postprocessing/EffectComposer.js"></script> <script src="js/postprocessing/RenderPass.js"></script> <script src="js/postprocessing/MaskPass.js"></script> <script src="js/postprocessing/ShaderPass.js"></script> <script src="js/postprocessing/BloomPass.js"></script> <script src="js/postprocessing/AdaptiveToneMappingPass.js"></script> <script src="js/controls/OrbitControls.js"></script> <script> if ( WEBGL.isWebGLAvailable() === false ) { document.body.appendChild( WEBGL.getWebGLErrorMessage() ); } var container; var bloomPass, adaptToneMappingPass, ldrToneMappingPass, hdrToneMappingPass; var params; var camera, scene, renderer, dynamicHdrEffectComposer, hdrEffectComposer, ldrEffectComposer; var cameraCube, sceneCube; var cameraBG, debugScene; var adaptiveLuminanceMat, currentLuminanceMat; var directionalLight; var orbitControls; var windowHalfX = window.innerWidth / 2; var windowHalfY = window.innerHeight / 2; var windowThirdX = window.innerWidth / 3; init(); animate(); function init() { params = { bloomAmount: 1.0, sunLight: 4.0, enabled: true, avgLuminance: 0.7, middleGrey: 0.04, maxLuminance: 16, adaptionRate: 2.0 }; container = document.createElement( 'div' ); document.body.appendChild( container ); // CAMERAS camera = new THREE.PerspectiveCamera( 70, windowThirdX / window.innerHeight, 0.1, 100000 ); camera.position.x = 700; camera.position.y = 400; camera.position.z = 800; cameraCube = new THREE.PerspectiveCamera( 70, windowThirdX / window.innerHeight, 1, 100000 ); cameraBG = new THREE.OrthographicCamera( - windowHalfX, windowHalfX, windowHalfY, - windowHalfY, - 10000, 10000 ); cameraBG.position.z = 100; orbitControls = new THREE.OrbitControls( camera, container ); orbitControls.autoRotate = true; orbitControls.autoRotateSpeed = 1; // SCENE scene = new THREE.Scene(); sceneCube = new THREE.Scene(); debugScene = new THREE.Scene(); // LIGHTS var ambient = new THREE.AmbientLight( 0x050505 ); scene.add( ambient ); directionalLight = new THREE.DirectionalLight( 0xffffff, params.sunLight ); directionalLight.position.set( 2, 0, 10 ).normalize(); scene.add( directionalLight ); var atmoShader = { side: THREE.BackSide, // blending: THREE.AdditiveBlending, transparent: true, lights: true, uniforms: THREE.UniformsUtils.merge( [ THREE.UniformsLib[ "common" ], THREE.UniformsLib[ "lights" ] ] ), vertexShader: [ "varying vec3 vViewPosition;", "varying vec3 vNormal;", "void main() {", THREE.ShaderChunk[ "beginnormal_vertex" ], THREE.ShaderChunk[ "defaultnormal_vertex" ], " vNormal = normalize( transformedNormal );", "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", "vViewPosition = -mvPosition.xyz;", "gl_Position = projectionMatrix * mvPosition;", "}" ].join( "\n" ), fragmentShader: [ THREE.ShaderChunk[ "common" ], THREE.ShaderChunk[ "bsdfs" ], THREE.ShaderChunk[ "lights_pars_begin" ], THREE.ShaderChunk[ "lights_phong_pars_fragment" ], "void main() {", "vec3 normal = normalize( -vNormal );", "vec3 viewPosition = normalize( vViewPosition );", "#if NUM_DIR_LIGHTS > 0", "vec3 dirDiffuse = vec3( 0.0 );", "for( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {", "vec4 lDirection = viewMatrix * vec4( directionalLights[i].direction, 0.0 );", "vec3 dirVector = normalize( lDirection.xyz );", "float dotProduct = dot( viewPosition, dirVector );", "dotProduct = 1.0 * max( dotProduct, 0.0 ) + (1.0 - max( -dot( normal, dirVector ), 0.0 ));", "dotProduct *= dotProduct;", "dirDiffuse += max( 0.5 * dotProduct, 0.0 ) * directionalLights[i].color;", "}", "#endif", //Fade out atmosphere at edge "float viewDot = abs(dot( normal, viewPosition ));", "viewDot = clamp( pow( viewDot + 0.6, 10.0 ), 0.0, 1.0);", "vec3 color = vec3( 0.05, 0.09, 0.13 ) * dirDiffuse;", "gl_FragColor = vec4( color, viewDot );", "}" ].join( "\n" ) }; var earthAtmoMat = new THREE.ShaderMaterial( atmoShader ); var earthMat = new THREE.MeshPhongMaterial( { color: 0xffffff, shininess: 200 } ); var textureLoader = new THREE.TextureLoader(); textureLoader.load( 'textures/planets/earth_atmos_4096.jpg', function ( tex ) { earthMat.map = tex; earthMat.needsUpdate = true; } ); textureLoader.load( 'textures/planets/earth_specular_2048.jpg', function ( tex ) { earthMat.specularMap = tex; earthMat.needsUpdate = true; } ); // var earthNormal = textureLoader.load( 'textures/planets/earth-new-normal-2048.jpg', function( tex ) { // earthMat.normalMap = tex; // earthMat.needsUpdate = true; // } ); var earthLights = textureLoader.load( 'textures/planets/earth_lights_2048.png' ); var earthLightsMat = new THREE.MeshBasicMaterial( { color: 0xffffff, blending: THREE.AdditiveBlending, transparent: true, depthTest: false, map: earthLights, } ); var clouds = textureLoader.load( 'textures/planets/earth_clouds_2048.png' ); var earthCloudsMat = new THREE.MeshLambertMaterial( { color: 0xffffff, blending: THREE.NormalBlending, transparent: true, depthTest: false, map: clouds } ); var earthGeo = new THREE.SphereBufferGeometry( 600, 24, 24 ); var sphereMesh = new THREE.Mesh( earthGeo, earthMat ); scene.add( sphereMesh ); var sphereLightsMesh = new THREE.Mesh( earthGeo, earthLightsMat ); scene.add( sphereLightsMesh ); var sphereCloudsMesh = new THREE.Mesh( earthGeo, earthCloudsMat ); scene.add( sphereCloudsMesh ); var sphereAtmoMesh = new THREE.Mesh( earthGeo, earthAtmoMat ); sphereAtmoMesh.scale.set( 1.05, 1.05, 1.05 ); scene.add( sphereAtmoMesh ); var vBGShader = [ // "attribute vec2 uv;", "varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}" ].join( "\n" ); var pBGShader = [ "uniform sampler2D map;", "varying vec2 vUv;", "void main() {", "vec2 sampleUV = vUv;", "vec4 color = texture2D( map, sampleUV, 0.0 );", "gl_FragColor = vec4( color.xyz, 1.0 );", "}" ].join( "\n" ); // Skybox adaptiveLuminanceMat = new THREE.ShaderMaterial( { uniforms: { "map": { value: null } }, vertexShader: vBGShader, fragmentShader: pBGShader, depthTest: false, // color: 0xffffff blending: THREE.NoBlending } ); currentLuminanceMat = new THREE.ShaderMaterial( { uniforms: { "map": { value: null } }, vertexShader: vBGShader, fragmentShader: pBGShader, depthTest: false // color: 0xffffff // blending: THREE.NoBlending } ); var quadBG = new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.1, 0.1 ), currentLuminanceMat ); quadBG.position.z = - 500; quadBG.position.x = - window.innerWidth * 0.5 + window.innerWidth * 0.05; quadBG.scale.set( window.innerWidth, window.innerHeight, 1 ); debugScene.add( quadBG ); quadBG = new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.1, 0.1 ), adaptiveLuminanceMat ); quadBG.position.z = - 500; quadBG.position.x = - window.innerWidth * 0.5 + window.innerWidth * 0.15; quadBG.scale.set( window.innerWidth, window.innerHeight, 1 ); debugScene.add( quadBG ); var r = "textures/cube/MilkyWay/"; var urls = [ r + "dark-s_px.jpg", r + "dark-s_nx.jpg", r + "dark-s_py.jpg", r + "dark-s_ny.jpg", r + "dark-s_pz.jpg", r + "dark-s_nz.jpg" ]; var textureCube = new THREE.CubeTextureLoader().load( urls ); textureCube.format = THREE.RGBFormat; sceneCube.background = textureCube; renderer = new THREE.WebGLRenderer(); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.autoClear = false; renderer.gammaInput = true; renderer.gammaOutput = false; container.appendChild( renderer.domElement ); // var width = window.innerWidth || 1; var height = window.innerHeight || 1; var parameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat, stencilBuffer: false }; var regularRenderTarget = new THREE.WebGLRenderTarget( windowThirdX, height, parameters ); ldrEffectComposer = new THREE.EffectComposer( renderer, regularRenderTarget ); if ( renderer.extensions.get( 'OES_texture_half_float_linear' ) ) { parameters.type = THREE.FloatType; } var hdrRenderTarget = new THREE.WebGLRenderTarget( windowThirdX, height, parameters ); dynamicHdrEffectComposer = new THREE.EffectComposer( renderer, hdrRenderTarget ); dynamicHdrEffectComposer.setSize( window.innerWidth, window.innerHeight ); hdrEffectComposer = new THREE.EffectComposer( renderer, hdrRenderTarget ); var debugPass = new THREE.RenderPass( debugScene, cameraBG ); debugPass.clear = false; var scenePass = new THREE.RenderPass( scene, camera, undefined, undefined, undefined ); var skyboxPass = new THREE.RenderPass( sceneCube, cameraCube ); scenePass.clear = false; adaptToneMappingPass = new THREE.AdaptiveToneMappingPass( true, 256 ); adaptToneMappingPass.needsSwap = true; ldrToneMappingPass = new THREE.AdaptiveToneMappingPass( false, 256 ); hdrToneMappingPass = new THREE.AdaptiveToneMappingPass( false, 256 ); bloomPass = new THREE.BloomPass(); var gammaCorrectionPass = new THREE.ShaderPass( THREE.GammaCorrectionShader ); gammaCorrectionPass.renderToScreen = true; dynamicHdrEffectComposer.addPass( skyboxPass ); dynamicHdrEffectComposer.addPass( scenePass ); dynamicHdrEffectComposer.addPass( adaptToneMappingPass ); // dynamicHdrEffectComposer.addPass( debugPass ); dynamicHdrEffectComposer.addPass( bloomPass ); dynamicHdrEffectComposer.addPass( gammaCorrectionPass ); hdrEffectComposer.addPass( skyboxPass ); hdrEffectComposer.addPass( scenePass ); hdrEffectComposer.addPass( hdrToneMappingPass ); hdrEffectComposer.addPass( bloomPass ); hdrEffectComposer.addPass( gammaCorrectionPass ); ldrEffectComposer.addPass( skyboxPass ); ldrEffectComposer.addPass( scenePass ); ldrEffectComposer.addPass( ldrToneMappingPass ); ldrEffectComposer.addPass( bloomPass ); ldrEffectComposer.addPass( gammaCorrectionPass ); // var gammaPass = new THREE.ShaderPass( GammaShader ); // gammaPass.renderToScreen = true; // ldrEffectComposer.addPass( gammaPass ); var gui = new dat.GUI(); // dynamicHdrGui.add( params, 'projection', { 'From cam to mesh': 'camera', 'Normal to mesh': 'normal' } ); var sceneGui = gui.addFolder( 'Scenes' ); var toneMappingGui = gui.addFolder( 'ToneMapping' ); var staticToneMappingGui = gui.addFolder( 'StaticOnly' ); var adaptiveToneMappingGui = gui.addFolder( 'AdaptiveOnly' ); sceneGui.add( params, 'bloomAmount', 0.0, 10.0 ); sceneGui.add( params, 'sunLight', 0.1, 12.0 ); toneMappingGui.add( params, 'enabled' ); toneMappingGui.add( params, 'middleGrey', 0, 12 ); toneMappingGui.add( params, 'maxLuminance', 1, 30 ); staticToneMappingGui.add( params, 'avgLuminance', 0.001, 2.0 ); adaptiveToneMappingGui.add( params, 'adaptionRate', 0.0, 10.0 ); gui.open(); window.addEventListener( 'resize', onWindowResize, false ); } function onWindowResize() { windowHalfX = window.innerWidth / 2; windowHalfY = window.innerHeight / 2; windowThirdX = window.innerWidth / 3; camera.aspect = windowThirdX / window.innerHeight; camera.updateProjectionMatrix(); cameraCube.aspect = windowThirdX / window.innerHeight; cameraCube.updateProjectionMatrix(); renderer.setSize( window.innerWidth, window.innerHeight ); } function animate() { requestAnimationFrame( animate ); if ( bloomPass ) { bloomPass.copyUniforms[ "opacity" ].value = params.bloomAmount; } if ( adaptToneMappingPass ) { adaptToneMappingPass.setAdaptionRate( params.adaptionRate ); adaptiveLuminanceMat.uniforms[ "map" ].value = adaptToneMappingPass.luminanceRT; currentLuminanceMat.uniforms[ "map" ].value = adaptToneMappingPass.currentLuminanceRT; adaptToneMappingPass.enabled = params.enabled; adaptToneMappingPass.setMaxLuminance( params.maxLuminance ); adaptToneMappingPass.setMiddleGrey( params.middleGrey ); hdrToneMappingPass.enabled = params.enabled; hdrToneMappingPass.setMaxLuminance( params.maxLuminance ); hdrToneMappingPass.setMiddleGrey( params.middleGrey ); if ( hdrToneMappingPass.setAverageLuminance ) { hdrToneMappingPass.setAverageLuminance( params.avgLuminance ); } ldrToneMappingPass.enabled = params.enabled; ldrToneMappingPass.setMaxLuminance( params.maxLuminance ); ldrToneMappingPass.setMiddleGrey( params.middleGrey ); if ( ldrToneMappingPass.setAverageLuminance ) { ldrToneMappingPass.setAverageLuminance( params.avgLuminance ); } } directionalLight.intensity = params.sunLight; orbitControls.update(); render(); } function render() { camera.lookAt( scene.position ); cameraCube.rotation.copy( camera.rotation ); renderer.setViewport( 0, 0, windowThirdX, window.innerHeight ); ldrEffectComposer.render( 0.017 ); renderer.setViewport( windowThirdX, 0, windowThirdX, window.innerHeight ); hdrEffectComposer.render( 0.017 ); renderer.setViewport( windowThirdX * 2, 0, windowThirdX, window.innerHeight ); dynamicHdrEffectComposer.render( 0.017 ); } </script> </body> </html>
framelab/three.js
examples/webgl_shaders_tonemapping.html
HTML
mit
15,949
using System.Collections.Generic; using Newtonsoft.Json; using SharpCaster.JsonConverters; using SharpCaster.Models.Enums; using SharpCaster.Models.MediaStatus; namespace SharpCaster.Models.Metadata { //Fields: https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata public class MovieMediaMetadata : IMetadata { public MovieMediaMetadata() { metadataType = MetadataTypeEnum.MOVIE; } public List<ChromecastImage> images { get; set; } [JsonConverter(typeof(MetadataTypeEnumConverter))] public MetadataTypeEnum metadataType { get; set; } public string releaseDate { get; set; } public string subtitle { get; set; } public string title { get; set; } } }
tapanila/SharpCaster
SharpCaster/Models/Metadata/MovieMediaMetadata.cs
C#
mit
793
// taken from https://code.google.com/p/wsdl-go package main import "encoding/xml" type definitions struct { XMLName xml.Name `xml:"definitions"` TargetNamespace string `xml:"targetNamespace,attr"` Name string `xml:"name,attr"` Types xmlType `xml:"types"` Messages []message `xml:"message"` PortType portType `xml:"portType"` Binding []binding `xml:"binding"` Service service `xml:"service"` } type xmlType struct { Schemas []schema `xml:"schema"` } type message struct { Name string `xml:"name,attr"` Part part `xml:"part"` } type part struct { Name string `xml:"name,attr"` Element string `xml:"element,attr"` } type portType struct { Name string `xml:"name,attr"` Operations []portTypeOperation `xml:"operation"` } type portTypeOperation struct { Name string `xml:"name,attr"` Input portTypeOperationMessage `xml:"input"` Output portTypeOperationMessage `xml:"output"` Fault portTypeOperationMessage `xml:"fault"` } type portTypeOperationMessage struct { Name string `xml:"name,attr,omitempty"` Message string `xml:"message,attr"` } type binding struct { Name string `xml:"name,attr"` Type string `xml:"type,attr"` SoapBinding soapBinding `xml:"binding"` Operations []bindingOperation `xml:"operation"` } type soapBinding struct { XMLName xml.Name `xml:"binding"` Transport string `xml:"transport,attr"` Style string `xml:"style,attr"` } type bindingOperation struct { Name string `xml:"name,attr"` SoapOperation soapOperation `xml:"operation"` Input soapBodyIO `xml:"input"` Output soapBodyIO `xml:"output"` Fault soapBody `xml:"fault>fault"` } type soapOperation struct { SoapAction string `xml:"soapAction,attr"` } type soapBodyIO struct { SoapBody soapBody `xml:"body"` } type soapBody struct { Name string `xml:"name,attr,omitempty"` Use string `xml:"use,attr"` } type service struct { Name string `xml:"name,attr"` Port servicePort `xml:"port"` } type servicePort struct { XMLName xml.Name `xml:"port"` Name string `xml:"name,attr"` Binding string `xml:"binding,attr"` Address serviceAddress `xml:"address"` } type serviceAddress struct { XMLName xml.Name `xml:"address"` Location string `xml:"location,attr"` }
peter-edge/flightaware
go/internal/cmd/gen-flightaware/wsdl.go
GO
mit
2,444
main.main { height: 100vh; width: 100vh; display: flex; flex-direction: row; }
alaphao/obk-web
client/src/app/containers/main.component.css
CSS
mit
87
--- layout: null --- $(document).ready(function() { $('a.blog-button').click(function(e) { $(".content-wrapper").html(getContentFromURL("{{ site.baseurl }}")); setAnimation(); }) $('a.about-button').click(function(e) { $(".content-wrapper").html(getContentFromURL("{{ site.baseurl }}about/")); setAnimation(); }) $('a.speaking-button').click(function(e) { $(".content-wrapper").html(getContentFromURL("{{ site.baseurl }}speaking/")); setAnimation(); }) if (window.location.hash && window.location.hash == '#about') { $(".content-wrapper").html(getContentFromURL("{{ site.baseurl}}about/")); $('.panel-cover').addClass('panel-cover--collapsed') } if (window.location.hash && window.location.hash == '#blog') { $(".content-wrapper").html(getContentFromURL("{{ site.baseurl}}")); $('.panel-cover').addClass('panel-cover--collapsed') } if (window.location.hash && window.location.hash == '#speaking') { $(".content-wrapper").html(getContentFromURL("{{ site.baseurl}}speaking/")); $('.panel-cover').addClass('panel-cover--collapsed') } if (window.location.pathname !== "/" || window.location.hash !== "") { $('.panel-cover').addClass('panel-cover--collapsed') } $('.btn-mobile-menu').click(function() { $('.navigation-wrapper').toggleClass('visible animated bounceInDown') $('.btn-mobile-menu__icon').toggleClass('icon-list icon-x-circle animated fadeIn') }) $('.navigation-wrapper .blog-button').click(function() { $('.navigation-wrapper').toggleClass('visible') $('.btn-mobile-menu__icon').toggleClass('icon-list icon-x-circle animated fadeIn') }) }) var getContentFromURL = function(url) { var result = null; $.ajax({ url: url, type: 'get', dataType: 'html', async: false, success: function(data) { result = data; } }); var elements = $(result); var found_content = $(".content-wrapper__inner", elements); return found_content; } var setAnimation = function() { if ($('.panel-cover').hasClass('panel-cover--collapsed')) { return } currentWidth = $('.panel-cover').width() if (currentWidth < 960) { $('.panel-cover').addClass('panel-cover--collapsed') $('.content-wrapper').addClass('animated slideInRight') } else { $('.panel-cover').addClass('panel-cover--collapsed') $('.panel-cover').css('max-width', currentWidth) $('.panel-cover').animate({ 'max-width': '530px', 'width': '40%' }, 400, swing = 'swing', function() {}) } }
karl-henrik/karl-henrik.github.io
js/main.js
JavaScript
mit
2,854
<div class="commune_descr limited"> <p> Daglan est un village localisé dans le département de Dordogne en Aquitaine. On dénombrait 540 habitants en 2008.</p> <p>À Daglan, le prix moyen à la vente d'un appartement se situe à 4&nbsp;770 &euro; du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1&nbsp;868 &euro; du m². À la location la valeur moyenne se situe à 0 &euro; du m² par mois.</p> <p>La ville propose quelques équipements, elle dispose, entre autres, de un terrain de tennis et un terrain de sport.</p> <p>À proximité de Daglan sont situées les villes de <a href="{{VLROOT}}/immobilier/florimont-gaumier_24184/">Florimont-Gaumier</a> à 6&nbsp;km, 140 habitants, <a href="{{VLROOT}}/immobilier/saint-aubin-de-nabirat_24375/">Saint-Aubin-de-Nabirat</a> située à 7&nbsp;km, 125 habitants, <a href="{{VLROOT}}/immobilier/saint-martial-de-nabirat_24450/">Saint-Martial-de-Nabirat</a> à 5&nbsp;km, 614 habitants, <a href="{{VLROOT}}/immobilier/campagnac-les-quercy_24075/">Campagnac-lès-Quercy</a> à 5&nbsp;km, 307 habitants, <a href="{{VLROOT}}/immobilier/saint-pompont_24488/">Saint-Pompont</a> localisée à 3&nbsp;km, 426 habitants, <a href="{{VLROOT}}/immobilier/cenac-et-saint-julien_24091/">Cénac-et-Saint-Julien</a> située à 6&nbsp;km, 1&nbsp;193 habitants, entre autres. De plus, Daglan est située à seulement 16&nbsp;km de <a href="{{VLROOT}}/immobilier/sarlat-la-caneda_24520/">Sarlat-la-Canéda</a>.</p> <p>Si vous envisagez de venir habiter à Daglan, vous pourrez facilement trouver une maison à vendre. </p> <p>Le parc d'habitations, à Daglan, se décomposait en 2011 en 34 appartements et 484 maisons soit un marché plutôt équilibré.</p> </div>
donaldinou/frontend
src/Viteloge/CoreBundle/Resources/descriptions/24150.html
HTML
mit
1,734
--- layout: post title: 画像を使った魅せるグラフの2つの例(ggplot2) --- <CENTER> <img width="600" alt="IrisScatterPlot.png" src="https://mrunadon.github.io/images/IrisScatterPlot.png"><br/> <font size="2">author: Mr.Unadon</font><br/> <font size="2">動作環境:Mac OS Sierra 10.12.1; R version3.3.1; rstan 2.10.1</font><br/> </CENTER> <CENTER> <!-- twitter-share -->  <a href="https://twitter.com/share" class="twitter-share-button" data-count="none">まずはTwitterでこの記事をシェアする</a> </CENTER> <hr> ## はじめに <hr> Rを使えば、画像を使った様々なグラフを描くことができます。 グラフの目的は伝えること。 シンプルで、美しく、直感的に分かる、そんなグラフはとっても魅力的です。 このとき、画像をうまく使うことができれば、 グラフをより美しく、より直感的なものに仕上げられると考えられます。 <br/> <hr> ## 日本における画像+グラフの課題 <hr> しかしながら本邦では、次のような誤解が蔓延しています(たぶん)。 <font size="5">「Rで画像って、”タカヤナギ=サン”を描画するやつでしょ?」</font> 僕も、ついさっきまでそう思っていました(本当に)。 代表作がこちらです(<A Href="http://blog.hoxo-m.com/2017/04/10/imager/">引用元</A>)。 <CENTER> <img width="300" alt="takayanagi_san_plot.png" src="https://mrunadon.github.io/images/takayanagi_san_plot.png"><br/> Figure.1 タカヤナギ=サン </CENTER> <br/> 「あ、"タカヤナギ=サン"だ!」とわかる、とてもシンプルで、直感的なグラフです。 <br/> 素敵ですね(初めて見た時爆笑しました)。 この作品ホント大好きなんですが、 今回はタカヤナギ=サンを使わない描画例をご紹介致します。 使用するパッケージはggplot2。 詳細な解説記事は、<A Href="http://notchained.hatenablog.com/entry/2015/12/06/203400">こちら</A>をご参照ください。 <br/> <hr> ## アヤメの画像 + Iris Scatter Plot <hr> さて、 まずは画像+散布図の例をご紹介します。 これまで散々plotされてきたIrisを、アヤメの画像とともに出力してみましょう。 簡単な説明をコメントとしてコードにふしております。 なお、途中でggThemeAssistというワードが出てきますが、使い方は<A Href="https://github.com/calligross/ggthemeassist">こちら</A>をご参照ください。 とっても簡単にggplotの調整ができるパッケージ(Addin)です。 ``` invisible({rm(list=ls());gc();gc()}) ##################################################### # ggplot2 + image: sample graphics # Author: Mr.Unadon ##################################################### library(tidyverse) #データ成形系パッケージ群(ggplot2も入ってる) library(png) #pngファイルの読み込みや書き出し #グラフテーマの初期設定 ggplot()+theme_set(theme_light(base_size = 14,base_family = "Hiragino Mincho Pro W3")) # # Irisの散布図+image # #画像のダウンロード download.file("mrunadon.github.io/images/ayame.png", destfile = "ayame.png") #カラーパレットの用意 Colors=c("#CFC1F7", "#FFFFFF", "#C9F0CF") #画像の読み込み irisImage<-png::readPNG("ayame.png") #ggplot gg1<-ggplot(iris,aes(x=Sepal.Length,y=Petal.Length,colour=Species)) + #x軸y軸と色の塗り分け指定 annotation_raster(irisImage, -Inf, Inf, -Inf, Inf)+#画像の表示、xy軸一杯に図を表示 geom_vline(xintercept = c(5,6,7,8),linetype=1,size=0.3,colour="gray60")+ #図の上にgrid縦線 geom_hline(yintercept = c(2,4,6),linetype=1,size=0.3,colour="gray60")+#図の上にgrid横線 geom_vline(xintercept = c(4.5,5.5,6.5,7.5),linetype=2,size=0.2,colour="gray50")+ #図の上にgrid縦線(linetype=2:点線) geom_hline(yintercept = c(3,5),linetype=2,size=0.2,colour="gray50")+#図の上にgrid横線(linetype=2:点線) geom_point(size=3,alpha=0.7)+ #ここで散布図の点を geom_text(aes(x=5.5,y=6),label="Virginica",size=10,family='Hiragino Mincho Pro W3',colour="#C9F0CF")+ #アヤメ種の名前 geom_text(aes(x=7.0,y=3.6),label="Versicolor",size=10,family='Hiragino Mincho Pro W3',colour="#FFFFFF")+#アヤメ種の名前 geom_text(aes(x=6.5,y=1.5),label="Setosa",size=10,family='Hiragino Mincho Pro W3',colour="#CFC1F7")+#アヤメ種の名前 scale_colour_manual(values = Colors)+ #ggThemeAssistantを使って以下は調整したもの theme(plot.subtitle = element_text(family = "serif", vjust = 1), plot.caption = element_text(vjust = 1), axis.title = element_text(family = "serif", size = 16), axis.text = element_text(family = "serif", size = 14), plot.title = element_text(family = "serif", size = 22), legend.text = element_text(family = "serif", colour = "gray95"), legend.title = element_text(family = "serif", colour = "gray95"), legend.key = element_rect(fill = "gray40"), legend.background = element_rect(fill = "gray40"), legend.position = "bottom", legend.direction = "horizontal") +labs(title = "Iris Scatter plot: petal and sepal length", subtitle = "Iris is a genus of about 260–300, species of flowering plants with showy flowers. It takes its name from the Greek word for a rainbow, which is also the name for the Greek goddess of the rainbow, Iris. ") plot(gg1) ``` <CENTER> <img width="600" alt="IrisScatterPlot.png" src="https://mrunadon.github.io/images/IrisScatterPlot.png"><br/> Figure.2 アヤメの花弁とがく片の長さの散布図(種別) </CENTER> <br/> まぁまぁ、いい感じですね。 <br/> <hr> ## ベリーの画像+折れ線グラフ <hr> いま睡魔と戦っていますが、もういっちょ、行きます。 次は折れ線グラフと画像をつかったもの。 グラフ分割のfacet_wrap()や帯の描画geom_ribbon()を組み合わせました。 乱数データでミックスベリーの廃棄率的な、 なにかそういう適当なデータを作って、時系列グラフを出してみます。 ``` # # Mix Berry Example (乱数でデータ生成) # #画像のダウンロード download.file("mrunadon.github.io/images/fruit_rouge.png", destfile = "fruit_rouge.png") #画像の読み込み fruit_rouge<-png::readPNG("fruit_rouge.png") #カラーパレットの準備 Colors2=c("#FF69B4", "#EE30A7", "#D02090", "#C71585", "#9A32CD", "#8A2BE2") #データの生成(6種の何かのベリーの何かの廃棄率の時系列データみたいな何か) df_line<-data.frame(WastedRate=c(rbeta(100,21,11),rbeta(100,16,16),rbeta(100,11,21)))%>% #乱数でデータ生成        dplyr::mutate(mup=WastedRate+0.05,#帯の上限1 mlo=WastedRate-0.05, #帯の下限1 hup=WastedRate+0.1, #帯の上限2 hlo=WastedRate-0.1, #帯の下限2                  TimePoint=(1:length(WastedRate)), #タイムポイントを整数であたえて時系列情報を付与                  Group=as.factor(rep(c("BerryA","BerryB","BerryC","BerryD","BerryE","BerryF"),50)))#グループ変数 #ggplot gg2<-ggplot(df_line,aes(x=TimePoint,y=WastedRate))+ #x軸とy軸指定 annotation_raster(fruit_rouge, -Inf, Inf, -Inf, Inf)+ #画像を範囲一杯に描画 geom_ribbon(aes(ymax=1,ymin=0.75),alpha=0.6,fill="gray40")+ #最上段1/4を塗りつぶし geom_ribbon(aes(ymax=0.75,ymin=0.5),alpha=0.6,fill="gray60")+#上段1/4を塗りつぶし geom_ribbon(aes(ymax=0.5,ymin=0.25),alpha=0.4,fill="gray80")+#下段1/4を塗りつぶし #塗りつぶしで4分割した範囲の説明テキスト geom_text(aes(x=250,y=0.875),label="High Score",size=3.5,colour="gray20",family='Hiragino Mincho Pro W3')+ geom_text(aes(x=250,y=0.625),label="Moderate High",size=3.5,colour="gray20",family='Hiragino Mincho Pro W3')+ geom_text(aes(x=50,y=0.375),label="Moderate Low",size=3.5,colour="gray20",family='Hiragino Mincho Pro W3')+ geom_text(aes(x=50,y=0.128),label="Low Score",size=3.5,colour="gray20",family='Hiragino Mincho Pro W3')+ #時系列の帯を描画 geom_ribbon(aes(ymax=hup,ymin=hlo,colour=Group,fill=Group),size=0.1,alpha=0.3)+ geom_ribbon(aes(ymax=mup,ymin=mlo,colour=Group,fill=Group),size=0.1,alpha=0.15)+ #時系列のメイン値をgeom_lineの折れ線グラフで geom_line(aes(colour=Group))+ #Groupごとに分割して描画 facet_wrap(~Group,ncol=2)+ #色と塗りつぶし色をマニュアル指定 scale_color_manual(values=Colors2)+ scale_fill_manual(values=Colors2)+ #グラフの描画範囲をツメツメに scale_x_continuous(expand=c(0,0))+ scale_y_continuous(expand=c(0,0))+    #以下はggThemeAssistantで調整したもの。GUIで調整後、コードが吐き出されるのでそれを使用。    theme(plot.subtitle = element_text(family = "serif", vjust = 1), plot.caption = element_text(vjust = 1), axis.title = element_text(family = "serif", size = 14), axis.text = element_text(family = "serif", size = 12), plot.title = element_text(family = "serif", size = 20), legend.text = element_text(family = "serif", colour = "gray20"), legend.title = element_text(family = "serif", colour = "gray20"), legend.key = element_rect(fill = "gray90"), legend.background = element_rect(fill = "gray90"), legend.position = "bottom", legend.direction = "horizontal") + labs(title = "Mix Berry Line (Example): Wasted Rate", subtitle = "In everyday language, a berry is a small, pulpy, and often edible fruit. Berries are usually juicy, rounded, brightly colored, sweet or sour, and do not have a stone or pit, although many pips or seeds may be present. ") #描画 plot(gg2) ``` よいしょ。 <br/> <CENTER> <img width="600" alt="MixBerryLine.png" src="https://mrunadon.github.io/images/MixBerryLine.png"><br/> Figure.3 ミックスベリーの廃棄率推移(種別) </CENTER> <br/> むむむ。ベリーの鮮やかさが活かしきれていませんね。 あと、X軸が明瞭じゃないので、何を読み取ればよいかパッとつかめませんね。 <hr> ## 最後に <hr> MixBerryのほうは、もうちょっとキレイにいけたかな。 眠気で力尽きました。 みなさんも、 作図を見やすく分かりやすく、そして美しくなるよう、 (あとやっぱりタカヤナギ=サンを使って) どんどん画像を使ったグラフの工夫してみてくださいね。 それでは、 # Enjoy!! <!-- twitter-share -->  <a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Twitterでこの記事をシェアする</a>
MrUnadon/mrunadon.github.io
_posts/2017-05-22-ggplot2_Image.md
Markdown
mit
10,953
//[Kores](../../index.md)/[com.github.jonathanxd.kores.type](../index.md)/[GenericType](index.md)/[isVirtual](is-virtual.md) # isVirtual [jvm] Content open override val [isVirtual](is-virtual.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) More info True if is a Virtual Type (Virtual Types = Types that were not loaded by JVM)
JonathanxD/CodeAPI
docs/-kores/com.github.jonathanxd.kores.type/-generic-type/is-virtual.md
Markdown
mit
390
# Balzac This is forked from [minimal mistakes](http://mademistakes.com). I needed some type of framework to build off as I have no experience with Jekyll. Michael set up an awesome dev environment for this which really helped speed up my progress. He also already wrote up an incredibly comprehensive readme.md so I basically copied all of it and replaced what was necessary. The design itself is my own and I cannot let you sell this or tweak the design for resale, unless I you [contact me](mailto:[email protected]). If you'd like give me credit somewhere on your blog or tweet a shout out to [@twnsndco](https://twitter.com/twnsndco), that would be pretty sweet. If you feel like donating — [Give it a thought.](http://gtat.me/balzac/donate) --- ![Balzac for Jekyll](http://cl.ly/Qdzo/Screen%20Shot%202013-08-05%20at%205.35.11%20PM.jpg) ![Balzac for Jekyll](http://cl.ly/Qdyh/Screen%20Shot%202013-08-05%20at%205.30.01%20PM.jpg) ## Features: - flexible, uses max-width for responsive goodness - responsive drop down menu - retina images using @2x - post loop in the footer showing 3 latest posts - custom portfolio page for case studies ## Basic Setup 1. [Install Jekyll](http://jekyllrb.com) if you haven't already. 2. Download this bad boy. 3. Fork the [Balzac repo](http://github.com/coletownsend/balzac-for-jekyll/) 4. Twerk it out so it's just for you. 5. ??? 6. Profit ## [Preview the Theme](http://jekyll.gtat.me) ``` bash balzac-for-jekyll/ ├── _includes | ├── footer.html //site footer | ├── head.html //site head | ├── head-dark.html //dark site head for light pages ├── _layouts | ├── home.html //homepage layout | ├── page.html //page layout | ├── post-index.html //post listing layout | └── post.html //post layout | ├── post-no-feature.html //feature image-less post layout ├── _posts ├── assets | ├── css //preprocessed less styles. good idea to minify | ├── img //images and graphics used in css and js | ├── js | | ├── main.js //jQuery plugins and settings | | └── vendor //all 3rd party scripts | └── sass ├── images //images for posts and pages ├── about.md //about page ├── articles.md //lists all posts from latest to oldest └── index.md //homepage. lists 5 most recent posts ``` # Customization ## _config.yml Most of the variables found here are used in the .html files found in `_includes` if you need to add or remove anything. A good place to start would be to change the title, tagline, description, and url of your site. When working locally comment out `url` or else you will get a bunch of broken links because they are absolute and prefixed with `{{ site.url }}` in the various `_includes` and `_layouts`. Just remember to uncomment `url` when building for deployment or pushing to **gh-pages**... ### Owner/Author Information Change your name, bio, Twitter url, email, Dribbble URL, etc. ### Top Navigation Links Edit page/post titles and URLs to include in the site's navigation. For external links add `external: true`. ``` yaml # sample top navigation links links: - title: About Page url: /about - title: Other Page url: /other-page - title: External Page url: http://coletownsend.com external: true ``` ## Other Stuff The rest is just your average Jekyll config settings. Nothing too crazy here... ### _includes For the most part you can leave these as is since the author/owner details are pulled from `_config.yml`. That said you'll probably want to customize the copyright stuff in `footer.html` to your liking. ### Adding Posts and Pages There are two main content layouts: `post.html` (for posts) and `page.html` (for pages). Both have large **feature images** that span the full-width of the screen, and both are meant for text heavy blog posts (or articles). ### Feature Images A good rule of thumb is to keep feature images nice and wide so you don't push the body text too far down. An image cropped around around 1024 x 256 pixels will keep file size down with an acceptable resolution for most devices. ``` yaml image: # local image feature: feature-image-filename.jpg # link image feature: "http(s)://image.domain.com/feature-image-filename.jpg" ``` This makes the assumption that the feature image is in the *images* folder unless it has a link address. To add a feature image to a post or page just include the filename in the front matter like so. You can "serve" images responsively with retina.js. All you need to do is have a file with @2x before the file type. That should be placed in the *images* folder. You literally don't have to do anything other than that. 2 copies. One is linked. That's it. Ex: `[email protected]` **There is a default feature image that will show up for and posts. It isn't retina or anything. It's just there in case you want one but forget <3* #### If you don't want a feature image …just say so in the front-matter. Go to your-post-name.md and make sure it has this guy up top. ``` layout: post-no-feature ``` ### Categories In the sample `_posts` folder you may have noticed `category: articles` in the front matter. I like keeping all posts grouped in the same folder. If you decide to rename or add categories you will need to modify the permalink in `articles.md` along with the filename (if renaming). For example. Say you want to group all your posts under `blog/` instead of `articles/`. In your post add `category: blog` to the front matter, rename or duplicate `articles.md` to `blog.md` and change the permalink in that file to `permalink: /blog/index.html`. If done correctly `/blog` should be a page listing all the site's posts. ## License This is free to use, fork, do whatever you want. You *cannot* sell this design though. You don't need to link me to it, but please contact me if you intend to market this theme. I am releasing premium versions of this design for select CMS's.
alinastanciu/alinastanciu.github.io
README.md
Markdown
mit
6,058
<?php /** * PHP version 5 * * This source file is subject to the license that is bundled with this package in the file LICENSE. */ namespace App\Model\Gateway\Cache; use Mandragora\Gateway\Decorator\CacheAbstract; class State extends CacheAbstract { /** * @return array */ public function findAll() { $states = $this->getCache()->load('states'); if (!$states) { $states = $this->gateway->findAll(); $this->getCache()->save($states, 'states'); } return $states; } }
MontealegreLuis/edeco
src/App/Model/Gateway/Cache/State.php
PHP
mit
553
<?php namespace Nemundo\Package\Bootstrap\Navbar; use Nemundo\Html\Hyperlink\AbstractHyperlink; use Nemundo\Web\WebConfig; class BootstrapNavbarBrand extends AbstractHyperlink { public function getContent() { $this->addCssClass('navbar-brand'); $this->href = WebConfig::$webUrl; return parent::getContent(); } }
nemundo/framework
src/Package/Bootstrap/Navbar/BootstrapNavbarBrand.php
PHP
mit
356
Imports SistFoncreagro.BussinessEntities Imports System.Data.SqlClient Imports System.Data Imports System.Data.Common Public Class AprobarOrdenCompraRepository : Inherits MasterDataAccess : Implements IAprobarOrdenCompraRepository Dim aRol As IRolRepository Sub New() aRol = New RolRepository End Sub Public Function GetAllFromNivelesAprobarOrdenCompra() As System.Collections.Generic.List(Of BussinessEntities.AprobarOrdenCompra) Implements IAprobarOrdenCompraRepository.GetAllFromNivelesAprobarOrdenCompra Dim command As SqlCommand = MyBase.CreateSPCommand("GetAllFromNivelesAprobarOrdenCompra") Return SelectObjectFactory(command) End Function Private Function SelectObjectFactory(ByVal command As SqlCommand) As List(Of AprobarOrdenCompra) Dim listaAprobarOc As New List(Of AprobarOrdenCompra) Using reader As SqlDataReader = MyBase.ExecuteReader(command) While reader.Read() Dim aprobarOc As New AprobarOrdenCompra With aprobarOc .IdAprobarOrdenCompra = reader.GetInt32(0) .IdRol = reader.GetInt32(1) .Orden = reader.GetInt32(2) .AreaProyecto = reader.GetBoolean(3) End With aprobarOc.aRol = aRol.GetROLByIdRol(reader.GetInt32(1)) listaAprobarOc.Add(aprobarOc) End While End Using Return listaAprobarOc End Function Public Function DeleteNivelAprobarOrdenCompra(ByVal IdAprobarOc As Integer) As Boolean Implements IAprobarOrdenCompraRepository.DeleteNivelAprobarOrdenCompra Dim command As SqlCommand = MyBase.CreateSPCommand("DeleteNivelAprobarOrdenCompra") Dim resPuestaSql As Boolean Dim parametroBase As DbParameter = command.CreateParameter() parametroBase.ParameterName = "Resultado" parametroBase.Direction = ParameterDirection.Output parametroBase.Value = resPuestaSql command.Parameters.Add(parametroBase) command.Parameters.AddWithValue("IdAprobarOrdenCompra", IdAprobarOc) MyBase.ExecuteNonQuery(command) resPuestaSql = parametroBase.Value Return resPuestaSql End Function Public Function SaveNivelAprobarOrdenCompra(ByVal aprobarOc As BussinessEntities.AprobarOrdenCompra) As Integer Implements IAprobarOrdenCompraRepository.SaveNivelAprobarOrdenCompra Dim command As SqlCommand = MyBase.CreateSPCommand("SaveNivelAprobarOrdenCompra") Dim resultado As Int32 Dim parametroBase As DbParameter = command.CreateParameter() parametroBase.ParameterName = "Resultado" parametroBase.Direction = ParameterDirection.Output parametroBase.Value = resultado command.Parameters.Add(parametroBase) command.Parameters.AddWithValue("IdRol", aprobarOc.IdRol) command.Parameters.AddWithValue("Orden", aprobarOc.Orden) command.Parameters.AddWithValue("AreaProyecto", aprobarOc.AreaProyecto) MyBase.ExecuteNonQuery(command) resultado = parametroBase.Value Return resultado End Function Public Function UpdateNivelAprobarOrdenCompra(ByVal aprobarOc As BussinessEntities.AprobarOrdenCompra) As Integer Implements IAprobarOrdenCompraRepository.UpdateNivelAprobarOrdenCompra Dim command As SqlCommand = MyBase.CreateSPCommand("UpdateNivelAprobarOrdenCompra") Dim resultado As Int32 Dim parametroBase As DbParameter = command.CreateParameter() parametroBase.ParameterName = "Resultado" parametroBase.Direction = ParameterDirection.Output parametroBase.Value = resultado command.Parameters.Add(parametroBase) command.Parameters.AddWithValue("IdAprobarOrdenCompra", aprobarOc.IdAprobarOrdenCompra) command.Parameters.AddWithValue("IdRol", aprobarOc.IdRol) command.Parameters.AddWithValue("Orden", aprobarOc.Orden) command.Parameters.AddWithValue("AreaProyecto", aprobarOc.AreaProyecto) MyBase.ExecuteNonQuery(command) resultado = parametroBase.Value Return resultado End Function End Class
crackper/SistFoncreagro
SistFoncreagro.DataAccess/AprobarOrdenCompraRepository.vb
Visual Basic
mit
4,186
import numpy as np import pandas as pd import random from sklearn.preprocessing import LabelEncoder from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import matplotlib from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA from collections import OrderedDict import operator from scipy.stats import zscore # high level functions def load_data(mmPfad='../data/Messmatrix.csv', cor_th=0.8, verbose=True): pd.options.mode.chained_assignment = None # high level functions def load_data(mmPfad, cor_th=0.8): # Rohe Daten einladen df = pd.read_csv(mmPfad) if verbose: print("Rohe Daten: \n") print("Anzahl der Kennwerte: "+str(df.shape[1])) print("Anzahl der vermessenen Rohre: "+str(df.shape[0])) print("Anzahl der gefahrenen Produkte: "+str(df.groupby(["Header_Leitguete","Header_Soll_AD","Header_Soll_WD"])["Header_Pseudonummer"].agg(["count"]).shape[0])) print("Anzahl der Walzlose: "+str(len(pd.unique(df["Header_Walzlos"])))) # Vorberarbeitung, beseitigen von NaNs dfVV2 = preprocess(df) if verbose: print("\nDaten nach Vorverarbeitung: \n") print("Anzahl der Kennwerte: "+str(dfVV2.shape[1])) print("Anzahl der vermessenen Rohre: "+str(dfVV2.shape[0])) print("Anzahl der gefahrenen Produkte: "+str(dfVV2.groupby(["Header_Leitguete","Header_Soll_AD","Header_Soll_WD"])["Header_Pseudonummer"].agg(["count"]).shape[0])) print("Anzahl der Walzlose: "+str(len(pd.unique(dfVV2["Header_Walzlos"])))) # Korrelierte Merkmale entfernen print("\nKorrelierte Merkmale entfernen\n") dfNoCor, _ = dropCorrelatedColumns((dfVV2[dfVV2.columns[6:]], dfVV2[dfVV2.columns[6:]]), cor_th) dfVV2 = pd.concat((dfVV2[dfVV2.columns[:6]], dfNoCor), axis=1) return dfVV2 def extract_product(df, product_id=0, min_num_walzlos=100): # get product groupby_list, product = get_product(df, product_id) df_prod = df.query(" & ".join(["({} == {})".format(name, param) for name, param in zip(groupby_list, product)])) df_walzlos = df_prod.groupby(["Header_Walzlos"])["Header_Pseudonummer"].agg(["count"]) # drop walzlose_to_drop = df_walzlos[(df_walzlos['count'] < min_num_walzlos)].index.tolist() for walzlos in walzlose_to_drop: df_prod.drop(df_prod[df_prod["Header_Walzlos"] == walzlos].index, inplace=True) return df_prod def plot_lda(X_lda, y, title, ax=None): if ax: ax = ax else: fig = plt.figure(figsize=(10,5)) ax = fig.add_subplot(111, projection='3d') for color, label in enumerate(np.unique(y)): min_val = 0 max_val = len(np.unique(y)) my_cmap = plt.cm.get_cmap('rainbow') # or any other one norm = matplotlib.colors.Normalize(min_val, max_val) # the color maps work for [0, 1] color_i = my_cmap(norm(color)) # returns an rgba value ax.scatter(X_lda[:,0][y==label], X_lda[:,1][y==label], X_lda[:,2][y==label], marker='*', color=color_i, label=label, alpha=1) ax.set_xlabel('Komponente 1') ax.set_ylabel('Komponente 2') ax.set_zlabel('Komponente 3') ax.set_title(title) #ax.legend() ax.grid() # basic functions def dropCorrelatedColumns(sets, covBound): from scipy import stats ## suche hohe Werte in Kovarianz-Matrix if covBound < 0: text = "korrelieren negativ" kovBool = pd.DataFrame(np.cov((stats.zscore(sets[0]).T)) < covBound) else: text = "korrelieren positiv" kovBool = pd.DataFrame(np.cov((stats.zscore(sets[0]).T)) > covBound) ## suche diejenigen, die nicht auf Diagonale liegen korr = [] for a,b in zip(np.where(kovBool)[0], np.where(kovBool)[1]): if (a != b): korr.append([a,b]) ## sortiere diese und finde einzigartige korr = [sorted(i) for i in korr] korrWD = [] for i in korr: if i not in korrWD: korrWD.append(i) print(sets[0].columns[i[0]]," und ",sets[1].columns[i[1]],text) ## erhalte Indizes der korrelierenden Spalten drop = [] for i in korrWD: drop.append(i[1]) ## lösche diese aus den vorliegenden Sets retTrainingSet = sets[0].drop(sets[0].columns[drop], axis=1) retTestSet = sets[1].drop(sets[1].columns[drop], axis=1) return(retTrainingSet, retTestSet) def preprocess(df, spaltenSchranke=15, zeilenSchranke=5): relNaNsCol = np.sum(np.isnan(df))/df.shape[0]*100 # schmeiße zunächst alle Spalten heraus, die mehr als bestimmte Prozent an NaNs haben keep = [i for i in np.arange(len(relNaNsCol)) if relNaNsCol[i] <= spaltenSchranke] dfVV = df[df.columns[keep]] # extrahiere Spalten # gleiches auf Zeilen anwenden relNaNsRow = dfVV.isnull().sum(axis=1)/dfVV.shape[1]*100 keep = [i for i in np.arange(len(relNaNsRow)) if relNaNsRow[i] <= zeilenSchranke] dfVV2 = dfVV.iloc[keep] #extraheire Zeilen #übrige NaNs mit Mittelwert aus Spalten auffüllen dfVV2 = dfVV2.fillna(dfVV2.mean()) return dfVV2 def get_product(df, index): groupby_list = ["Header_Leitguete","Header_Soll_AD","Header_Soll_WD"] products = list(df.groupby(groupby_list)[groupby_list].groups.keys()) return groupby_list, products[index] def get_lda_data(df, test_frac=0.2): label_encoder = LabelEncoder().fit(df["Header_Walzlos"]) train_set = {'data': [], 'label': []} test_set = {'data': [], 'label': []} df_walzlos = df.groupby(["Header_Walzlos"])["Header_Pseudonummer"].agg(["count"]) df_without_header = df[df.columns[6:]] for walzlos in np.unique(df["Header_Walzlos"]): num_walzlos = np.int(df_walzlos.ix[walzlos]) a = df_without_header.ix[df["Header_Walzlos"] == walzlos] test_num = int(num_walzlos * test_frac) train_num = num_walzlos - test_num rows = random.sample(list(a.index), test_num) test_split = a.ix[rows] train_split = a.drop(rows) label = label_encoder.transform(walzlos) train_set['data'].extend(np.asarray(train_split)) train_set['label'] += train_num*[label] test_set['data'].extend(np.asarray(test_split)) test_set['label'] += test_num*[label] train_set['data'] = np.asarray(train_set['data']) test_set['data'] = np.asarray(test_set['data']) return train_set, test_set def biplot(score,coeff,pcax,pcay,labels=None): pca1=pcax-1 pca2=pcay-1 xs = score[:,pca1] ys = score[:,pca2] n=score.shape[1] scalex = 1.0/(xs.max()- xs.min()) scaley = 1.0/(ys.max()- ys.min()) plt.scatter(xs*scalex,ys*scaley) for i in range(n): plt.arrow(0, 0, coeff[i,pca1], coeff[i,pca2],color='r',alpha=0.5) if labels is None: plt.text(coeff[i,pca1]* 1.15, coeff[i,pca2] * 1.15, "Var"+str(i+1), color='g', ha='center', va='center') else: plt.text(coeff[i,pca1]* 1.15, coeff[i,pca2] * 1.15, labels[i], color='g', ha='center', va='center') plt.xlim(-1,1) plt.ylim(-1,1) plt.xlabel("PC{}".format(pcax)) plt.ylabel("PC{}".format(pcay)) plt.grid() def mv_features(df_all_prod): features = list(df_all_prod[0].columns[6:]) feature_dict = OrderedDict((feature,0) for feature in features) for product_id in range(len(df_all_prod)): df_prod = df_all_prod[product_id] if len(pd.unique(df_prod["Header_Walzlos"])) < 15: continue # train and test set test_frac = 0.05 train_set, test_set = get_lda_data(df_prod, test_frac=test_frac) # zscore data train_set['data'] = zscore(train_set['data']) test_set['data'] = zscore(test_set['data']) # extract data and label X_train, y_train = train_set['data'], train_set['label'] # LDA object sklearn_LDA = LDA(solver='eigen') # fit with train data sklearn_LDA = sklearn_LDA.fit(X_train, y_train) ew_ratio = sklearn_LDA.explained_variance_ratio_ eigvecs = sklearn_LDA.scalings_ for index_vec, eig_vec in enumerate(eigvecs.T): for index_feat, feature in enumerate(features): feature_dict[feature] += ew_ratio[index_vec] * np.abs(eig_vec[index_feat]) sorted_feature_dict = sorted(feature_dict.items(), key=operator.itemgetter(1), reverse=True) return sorted_feature_dict
stefanpede/KSS
multiDatenanalyse.py
Python
mit
8,548
package sharedconfig import ( "encoding/json" "fmt" "io/ioutil" "os" "sync" "testing" "time" ) func TestReadConfig(t *testing.T) { cfg := map[string]string{ "height": "180", "weight": "77", } fnm, err := writeTestConfig(cfg) if err != nil { t.Fatal("can't write test config: ", err) } sc, err := New(fnm) if err != nil { t.Fatal("can't read test config: ", err) } defer sc.Close() for k, v := range cfg { if scv := sc.Get(k); scv != v { t.Fatalf("expected %s got %s", v, scv) } } } func TestMultiReadConfig(t *testing.T) { cfg := map[string]string{ "height": "180", "weight": "77", } fnm, err := writeTestConfig(cfg) if err != nil { t.Fatal("can't write test config: ", err) } rdr := func(id int, sc *SharedConfig, cfg map[string]string, wg *sync.WaitGroup, doit chan struct{}) { select { case <-doit: for i := 0; i < 100000; i++ { for k, v := range cfg { if scv := sc.Get(k); scv != v { t.Fatal("expected %s got %s", v, scv) } } } } wg.Done() } sc, err := New(fnm) if err != nil { t.Fatal("can't read test config: ", err) } defer sc.Close() var wg sync.WaitGroup doit := make(chan struct{}) wg.Add(6) go rdr(1, sc, cfg, &wg, doit) go rdr(2, sc, cfg, &wg, doit) go rdr(3, sc, cfg, &wg, doit) go rdr(4, sc, cfg, &wg, doit) go rdr(5, sc, cfg, &wg, doit) go rdr(6, sc, cfg, &wg, doit) close(doit) wg.Wait() } func TestConfigChange(t *testing.T) { cfg := map[string]string{ "height": "180", "weight": "77", } fnm, err := writeTestConfig(cfg) if err != nil { t.Fatal("can't write test config: ", err) } sc, err := New(fnm) if err != nil { t.Fatal("can't read test config: ", err) } done := make(chan chan bool) go func(sc *SharedConfig, cfg map[string]string, done chan chan bool) { var changed bool GetLoop: for { select { case rch := <-done: rch <- changed break GetLoop default: for k, v := range cfg { if scv := sc.Get(k); scv != v { changed = true } } } } }(sc, cfg, done) time.Sleep(2 * time.Second) cfg = map[string]string{ "height": "180", "weight": "85", } f, err := os.Create(fnm) if err != nil { t.Fatal("can't open config file: ", err) } defer f.Close() ec := json.NewEncoder(f) if ec == nil { t.Fatal("can't create encoder") } if err = ec.Encode(&cfg); err != nil { t.Fatal("can't encode new config: ", err) } time.Sleep(2 * time.Second) rch := make(chan bool) done <- rch if changed := <-rch; !changed { t.Fatal("didn't detect change") } } func writeTestConfig(config map[string]string) (string, error) { f, err := ioutil.TempFile("/tmp", "sctest") if err != nil { return "", err } defer f.Close() ec := json.NewEncoder(f) if ec == nil { return "", fmt.Errorf("can't create encoder") } if err := ec.Encode(&config); err != nil { return "", err } return f.Name(), nil }
wkharold/sharedconfig
sc_test.go
GO
mit
2,925
require 'spec_helper' describe Node do subject { Node.new(name: "Lucas", id: '1', age: 20) } context "#new" do it "returns its attributes" do expect(subject[:name]).to eq("Lucas") expect(subject[:id]).to eq('1') expect(subject[:age]).to eq(20) end it "knows it degree" do expect(subject.degree).to eq(0) end end context "#has_neighbour" do it "recognizes its neighbour" do n1 = Node.new(id: 1) n2 = Node.new(id: 1) n1.neighbours << n2 expect(n1.has_neighbour?(n2)).to be true end end end
michelboaventura/rgraph
spec/rgraph/node_spec.rb
Ruby
mit
573
require 'rails_helper' # Specs in this file have access to a helper object that includes # the MatchsetsHelper. For example: # # describe MatchsetsHelper do # describe "string concat" do # it "concats two strings with spaces" do # expect(helper.concat_strings("this","that")).to eq("this that") # end # end # end RSpec.describe MatchsetsHelper, type: :helper do pending "add some examples to (or delete) #{__FILE__}" end
alexdaesikkim/bracket
spec/helpers/matchsets_helper_spec.rb
Ruby
mit
442
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using DotNet.RevitUI.MVVM; using Test.DotNet.RevitUI.ViewModel; namespace Test.DotNet.RevitUI.View { /// <summary> /// MainSplitWall.xaml 的交互逻辑 /// </summary> public partial class MainDeleteMatchElement : Window { internal const string ClosedToken = "ClosedToken"; public MainDeleteMatchElement() { InitializeComponent(); Messenger.Default.Register<DeleteElementViewModel>(this, ClosedToken, m => this.Close()); } } }
HeZhongHao/DotNet.Revit
DotNet.Revit/Test.DotNet.RevitUI (2016)/View/MainDeleteMatchElement.xaml.cs
C#
mit
930
// lazyload config angular.module('babyApp') .constant('MODULE_CONFIG', [ { name: 'ui.select', module: true, files: [ 'libraries/libs/angular/angular-ui-select/dist/select.min.js', 'libraries/libs/angular/angular-ui-select/dist/select.min.css' ] }, { name: 'textAngular', module: true, files: [ 'libraries/libs/angular/textAngular/dist/textAngular-sanitize.min.js', 'libraries/libs/angular/textAngular/dist/textAngular.min.js' ] }, { name: 'vr.directives.slider', module: true, files: [ 'libraries/libs/angular/venturocket-angular-slider/build/angular-slider.min.js', 'libraries/libs/angular/venturocket-angular-slider/angular-slider.css' ] }, { name: 'angularBootstrapNavTree', module: true, files: [ 'libraries/libs/angular/angular-bootstrap-nav-tree/dist/abn_tree_directive.js', 'libraries/libs/angular/angular-bootstrap-nav-tree/dist/abn_tree.css' ] }, { name: 'angularFileUpload', module: true, files: [ 'libraries/libs/angular/angular-file-upload/angular-file-upload.js' ] }, { name: 'ngImgCrop', module: true, files: [ 'libraries/libs/angular/ngImgCrop/compile/minified/ng-img-crop.js', 'libraries/libs/angular/ngImgCrop/compile/minified/ng-img-crop.css' ] }, { name: 'smart-table', module: true, files: [ 'libraries/libs/angular/angular-smart-table/dist/smart-table.min.js' ] }, { name: 'ui.map', module: true, files: [ 'libraries/libs/angular/angular-ui-map/ui-map.js' ] }, { name: 'ngGrid', module: true, files: [ 'libraries/libs/angular/ng-grid/build/ng-grid.min.js', 'libraries/libs/angular/ng-grid/ng-grid.min.css', 'libraries/libs/angular/ng-grid/ng-grid.bootstrap.css' ] }, { name: 'ui.grid', module: true, files: [ 'libraries/libs/angular/angular-ui-grid/ui-grid.min.js', 'libraries/libs/angular/angular-ui-grid/ui-grid.min.css', 'libraries/libs/angular/angular-ui-grid/ui-grid.bootstrap.css' ] }, { name: 'xeditable', module: true, files: [ 'libraries/libs/angular/angular-xeditable/dist/js/xeditable.min.js', 'libraries/libs/angular/angular-xeditable/dist/css/xeditable.css' ] }, { name: 'smart-table', module: true, files: [ 'libraries/libs/angular/angular-smart-table/dist/smart-table.min.js' ] }, { name: 'dataTable', module: false, files: [ 'libraries/libs/jquery/datatables/media/js/jquery.dataTables.min.js', 'libraries/libs/jquery/plugins/integration/bootstrap/3/dataTables.bootstrap.js', 'libraries/libs/jquery/plugins/integration/bootstrap/3/dataTables.bootstrap.css' ] }, { name: 'footable', module: false, files: [ 'libraries/libs/jquery/footable/dist/footable.all.min.js', 'libraries/libs/jquery/footable/css/footable.core.css' ] }, { name: 'easyPieChart', module: false, files: [ 'libraries/libs/jquery/jquery.easy-pie-chart/dist/jquery.easypiechart.fill.js' ] }, { name: 'sparkline', module: false, files: [ 'libraries/libs/jquery/jquery.sparkline/dist/jquery.sparkline.retina.js' ] }, { name: 'plot', module: false, files: [ 'libraries/libs/jquery/flot/jquery.flot.js', 'libraries/libs/jquery/flot/jquery.flot.resize.js', 'libraries/libs/jquery/flot/jquery.flot.pie.js', 'libraries/libs/jquery/flot.tooltip/js/jquery.flot.tooltip.min.js', 'libraries/libs/jquery/flot-spline/js/jquery.flot.spline.min.js', 'libraries/libs/jquery/flot.orderbars/js/jquery.flot.orderBars.js' ] }, { name: 'vectorMap', module: false, files: [ 'libraries/libs/jquery/bower-jvectormap/jquery-jvectormap-1.2.2.min.js', 'libraries/libs/jquery/bower-jvectormap/jquery-jvectormap.css', 'libraries/libs/jquery/bower-jvectormap/jquery-jvectormap-world-mill-en.js', 'libraries/libs/jquery/bower-jvectormap/jquery-jvectormap-us-aea-en.js' ] }, { name: 'moment', module: false, files: [ 'libraries/libs/jquery/moment/moment.js' ] } ] ) .config(['$ocLazyLoadProvider', 'MODULE_CONFIG', function($ocLazyLoadProvider, MODULE_CONFIG) { $ocLazyLoadProvider.config({ debug: false, events: false, modules: MODULE_CONFIG }); }]);
mkcschauhan/Baby2Family
public/libraries/scripts/config.lazyload.js
JavaScript
mit
5,427
using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Linq; namespace PlaidWallpaper { public class PlaidGrid { public static byte[] CreateGridImage(GridInfo gridInfo, IEnumerable<Color> paletteIe) { var palette = paletteIe.ToArray(); using (var bmp = new Bitmap(gridInfo.MaxXCells * gridInfo.BoxSize + 1, gridInfo.MaxYCells * gridInfo.BoxSize + 1)) { using (Graphics g = Graphics.FromImage(bmp)) { g.Clear(Color.White); Pen pen = new Pen(palette.First()) { Color = palette.First(), Width = gridInfo.BoxSize }; if (gridInfo.VerticalLine) //Draw vert lines for (int i = 0; i <= gridInfo.MaxXCells; i++) { pen.Color = palette[i % (palette.Length)]; g.DrawLine(pen, (i * gridInfo.BoxSize), 0, i * gridInfo.BoxSize, gridInfo.BoxSize * gridInfo.MaxYCells + 1); } if (gridInfo.HorizontalLine) //Draw oriz lines for (int i = 0; i <= gridInfo.MaxYCells; i++) { pen.Color = palette[i % (palette.Length)]; g.DrawLine(pen, 0, (i * gridInfo.BoxSize), gridInfo.BoxSize * gridInfo.MaxXCells + 1, i * gridInfo.BoxSize); } } var memStream = new MemoryStream(); bmp.Save(memStream, ImageFormat.Png); return memStream.ToArray(); } } public class GridInfo { public GridInfo() { } public bool VerticalLine { get; set; } public bool HorizontalLine { get; set; } public int BoxSize { get; set; } public int MaxXCells { get; set; } public int MaxYCells { get; set; } } public static byte[] CreateGridImage(IEnumerable<Color> palette) { var gridInfo = new GridInfo() //todo add random grindinfo type { MaxXCells = 16, MaxYCells = 5, BoxSize = 20, VerticalLine = true, HorizontalLine = true }; return CreateGridImage(gridInfo, palette); } } }
maborg/PlaidWallpaper
PlaidWallpaper/PlaidGrid.cs
C#
mit
2,197
<!DOCTYPE html> <html lang="en-gb" dir="ltr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>抽屉 - UIkit 中文文档</title> <meta name="description" content="利用UIkit抽屉组件(Off-canvas)可以轻松的创建一个可以平滑地滑入滑出页面的侧边栏画布。该抽屉组件完美适配移动网页导航,效果类似许多流行的原生移动应用那样,用一个左上角的按钮触发带菜单栏的抽屉式侧边栏。"> <meta name="author" content="UIkit中文网"> <meta name="keywords" content="UIKit抽屉组件,左上角菜单栏,抽屉边栏,抽屉式导航,抽屉式面板,Off-canvas"> <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon"> <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png"> <link id="data-uikit-theme" rel="stylesheet" href="css/uikit.docs.min.css"> <link rel="stylesheet" href="css/docs.css"> <link rel="stylesheet" href="../vendor/highlight/highlight.css"> <script src="../vendor/jquery.js"></script> <script src="js/uikit.min.js"></script> <script src="../vendor/highlight/highlight.js"></script> <script src="js/docs.js"></script> </head> <body class="tm-background"> <nav class="tm-navbar uk-navbar uk-navbar-attached"> <div class="uk-container uk-container-center"> <a class="uk-navbar-brand uk-hidden-small" href="../index.html"><img class="uk-margin uk-margin-remove" src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></a> <ul class="uk-navbar-nav uk-hidden-small"> <li><a href="documentation_get-started.html">开始使用</a></li> <li class="uk-active"><a href="core.html">核心组件</a></li> <li><a href="components.html">附加组件</a></li> <li><a href="customizer.html">定制工具</a></li> <li><a href="../showcase/index.html">案例展示</a></li> <li><a href="tutorials.html">视频教程</a></li> </ul> <a href="#tm-offcanvas" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas></a> <div class="uk-navbar-brand uk-navbar-center uk-visible-small"><img src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></div> </div> </nav> <div class="tm-middle"> <div class="uk-container uk-container-center"> <div class="uk-grid" data-uk-grid-margin> <div class="tm-sidebar uk-width-medium-1-4 uk-hidden-small"> <ul class="tm-nav uk-nav" data-uk-nav> <li class="uk-nav-header">默认</li> <li><a href="base.html">基础</a></li> <li><a href="print.html">打印</a></li> <li class="uk-nav-header">布局类组件</li> <li><a href="grid.html">网格</a></li> <li><a href="panel.html">面板</a></li> <li><a href="block.html">块</a></li> <li><a href="article.html">文章</a></li> <li><a href="comment.html">评论</a></li> <li><a href="utility.html">效果</a></li> <li><a href="flex.html">Flex</a></li> <li><a href="cover.html">覆盖</a></li> <li class="uk-nav-header">导航类组件</li> <li><a href="nav.html">导航菜单</a></li> <li><a href="navbar.html">导航栏</a></li> <li><a href="subnav.html">二级导航</a></li> <li><a href="breadcrumb.html">面包屑</a></li> <li><a href="pagination.html">分页</a></li> <li><a href="tab.html">选项卡</a></li> <li><a href="thumbnav.html">Thumbnav</a></li> <li class="uk-nav-header">页面元素</li> <li><a href="list.html">列表</a></li> <li><a href="description-list.html">描述列表</a></li> <li><a href="table.html">表格</a></li> <li><a href="form.html">表单</a></li> <li class="uk-nav-header">常用组件</li> <li><a href="button.html">按钮</a></li> <li><a href="icon.html">图标</a></li> <li><a href="close.html">关闭</a></li> <li><a href="badge.html">徽章</a></li> <li><a href="alert.html">提示框</a></li> <li><a href="thumbnail.html">缩略图</a></li> <li><a href="overlay.html">遮罩</a></li> <li><a href="text.html">文本</a></li> <li><a href="animation.html">动画</a></li> <li><a href="contrast.html">对比</a></li> <li class="uk-nav-header">JavaScript组件</li> <li><a href="dropdown.html">下拉菜单</a></li> <li><a href="modal.html">模态对话框</a></li> <li class="uk-active"><a href="offcanvas.html">抽屉</a></li> <li><a href="switcher.html">切换器</a></li> <li><a href="toggle.html">拨动器</a></li> <li><a href="scrollspy.html">滚动监听</a></li> <li><a href="smooth-scroll.html">平滑滚动</a></li> </ul> </div> <div class="tm-main uk-width-medium-3-4"> <article class="uk-article"> <h1 class="uk-article-title">抽屉/Off-canvas</h1> <p class="uk-article-lead">创建一个可以在页面上平滑地滑入滑出的抽屉。</p> <p>抽屉完美适用于构建移动端导航,与那些颇受欢迎的许多原生手机应用类似,在其左上角用一个按钮来开关带有菜单的侧边栏。</p> <h2 id="usage"><a href="#usage" class="uk-link-reset">用法</a></h2> <p>抽屉组件由一个遮罩层和一个弹出边栏组成。</p> <div class="uk-overflow-container"> <table class="uk-table"> <thead> <tr> <th>Class</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><code>.uk-offcanvas</code></td> <td>添加该类至一个<code>&lt;div&gt;</code>元素来创建隐藏在页面外的边栏容器和覆盖层。id也需要添加,使抽屉可被打开或关闭。</td> </tr> <tr> <td><code>.uk-offcanvas-bar</code></td> <td>添加该类至一个子级 <code>&lt;div&gt;</code> 元素来创建抽屉式边栏。</td> </tr> </tbody> </table> </div> <p>你可以使用任何元素来切换抽屉式侧边栏。 <code>&lt;a&gt;</code>元素需要链接至抽屉容器的id。为了使必要的JavaScript生效,仅需添加<code>data-uk-offcanvas</code>属性即可。如果你使用了其他元素,比如按钮,仅需添加 <code>data-uk-offcanvas="{target:'#ID'}"</code> 属性指向抽屉容器的id。</p> <h3 class="tm-article-subtitle">示例</h3> <button class="uk-button" data-uk-offcanvas="{target:'#offcanvas-1'}">打开</button> <a href="#offcanvas-1" data-uk-offcanvas>打开</a> <div id="offcanvas-1" class="uk-offcanvas"> <div class="uk-offcanvas-bar"> <div class="uk-panel">Lorem ipsum dolor sit amet, <a href="#">consectetur</a> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> <div class="uk-panel">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> </div> </div> <h3 class="tm-article-subtitle">Code</h3> <pre><code>&lt;!-- 这是开关抽屉式边栏的锚 --&gt; &lt;a href="#my-id" data-uk-offcanvas&gt;...&lt;/a&gt; &lt;!-- 这是开关抽屉式边栏的按钮 --&gt; &lt;button class="uk-button" data-uk-offcanvas="{target:'#my-id'}"&gt;...&lt;/button&gt; &lt;!-- 抽屉式边栏 --&gt; &lt;div id="my-id" class="uk-offcanvas"&gt; &lt;div class="uk-offcanvas-bar"&gt;...&lt;/div&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2 id="flip-modifier"><a href="#flip-modifier" class="uk-link-reset">翻转修饰</a></h2> <p>添加 <code>.uk-offcanvas-bar-flip</code> 类至抽屉式边栏,使之从右侧滑出。</p> <h3 class="tm-article-subtitle">示例</h3> <button class="uk-button" data-uk-offcanvas="{target:'#offcanvas-2'}">右侧</button> <div id="offcanvas-2" class="uk-offcanvas"> <div class="uk-offcanvas-bar uk-offcanvas-bar-flip"> <div class="uk-panel">Lorem ipsum dolor sit amet, <a href="#">consectetur</a> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> <div class="uk-panel">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> </div> </div> <h3 class="tm-article-subtitle">Code</h3> <pre><code>&lt;div id="my-id" class="uk-offcanvas"&gt; &lt;div class="uk-offcanvas-bar uk-offcanvas-bar-flip"&gt;...&lt;/div&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2 id="off-canvas-navs"><a href="#off-canvas-navs" class="uk-link-reset">抽屉式导航</a></h2> <p>抽屉式侧边栏可以包含<a href="nav.html">导航栏</a>。添加<code>.uk-nav-offcanvas</code>类来根据抽屉的上下文定义导航菜单的样式。</p> <h3 class="tm-article-subtitle">示例</h3> <div class="uk-button-group"> <button class="uk-button" data-uk-offcanvas="{target:'#offcanvas-3'}">左侧</button> <button class="uk-button" data-uk-offcanvas="{target:'#offcanvas-4'}">右侧</button> </div> <div id="offcanvas-3" class="uk-offcanvas"> <div class="uk-offcanvas-bar"> <ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav> <li><a href="">Item</a></li> <li class="uk-active"><a href="">Active</a></li> <li class="uk-parent"> <a href="#">Parent</a> <ul class="uk-nav-sub"> <li><a href="">Sub item</a></li> <li><a href="">Sub item</a> <ul> <li><a href="">Sub item</a></li> <li><a href="">Sub item</a></li> </ul> </li> </ul> </li> <li class="uk-parent"> <a href="#">Parent</a> <ul class="uk-nav-sub"> <li><a href="">Sub item</a></li> <li><a href="">Sub item</a></li> </ul> </li> <li><a href="">Item</a></li> <li class="uk-nav-header">Header</li> <li class="uk-parent"><a href=""><i class="uk-icon-star"></i> Parent</a></li> <li><a href=""><i class="uk-icon-twitter"></i> Item</a></li> <li class="uk-nav-divider"></li> <li><a href=""><i class="uk-icon-rss"></i> Item</a></li> </ul> </div> </div> <div id="offcanvas-4" class="uk-offcanvas"> <div class="uk-offcanvas-bar uk-offcanvas-bar-flip"> <ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav> <li><a href="">Item</a></li> <li class="uk-active"><a href="">Active</a></li> <li class="uk-parent"> <a href="#">Parent</a> <ul class="uk-nav-sub"> <li><a href="">Sub item</a></li> <li><a href="">Sub item</a> <ul> <li><a href="">Sub item</a></li> <li><a href="">Sub item</a></li> </ul> </li> </ul> </li> <li class="uk-parent"> <a href="#">Parent</a> <ul class="uk-nav-sub"> <li><a href="">Sub item</a></li> <li><a href="">Sub item</a></li> </ul> </li> <li><a href="">Item</a></li> <li class="uk-nav-header">Header</li> <li class="uk-parent"><a href=""><i class="uk-icon-star"></i> Parent</a></li> <li><a href=""><i class="uk-icon-twitter"></i> Item</a></li> <li class="uk-nav-divider"></li> <li><a href=""><i class="uk-icon-rss"></i> Item</a></li> </ul> </div> </div> <h3 class="tm-article-subtitle">Code</h3> <pre><code>&lt;!-- 这是用来触发抽屉式边栏的按钮 --&gt; &lt;button class="uk-button" data-uk-offcanvas="{target:'#my-id'}"&gt;...&lt;/button&gt; &lt;!-- 抽屉式边栏 --&gt; &lt;div id="my-id" class="uk-offcanvas"&gt; &lt;div class="uk-offcanvas-bar"&gt; &lt;ul class="uk-nav uk-nav-offcanvas" data-uk-nav&gt;...&lt;/ul&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2 id="off-canvas-panels"><a href="#off-canvas-panels" class="uk-link-reset">抽屉式面板</a></h2> <p>你可以在抽屉式边栏的内部放置任何自定义内容。仅需将其包裹在带有<code>.uk-panel</code>类的<code>&lt;div&gt;</code>元素中即可。</p> <h3 class="tm-article-subtitle">示例</h3> <button class="uk-button" data-uk-offcanvas="{target:'#offcanvas-5'}">打开</button> <div id="offcanvas-5" class="uk-offcanvas"> <div class="uk-offcanvas-bar"> <div class="uk-panel"> <h3 class="uk-panel-title">Panel title</h3> Lorem ipsum dolor sit amet, <a href="#">consectetur</a> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> <div class="uk-panel"> <h3 class="uk-panel-title">Panel title</h3> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> </div> </div> <h3 class="tm-article-subtitle">Code</h3> <pre><code>&lt;!-- 这是用来触发抽屉式边栏的按钮 --&gt; &lt;button class="uk-button" data-uk-offcanvas="{target:'#my-id'}"&gt;...&lt;/button&gt; &lt;!-- 这是抽屉式边栏 --&gt; &lt;div id="my-id" class="uk-offcanvas"&gt; &lt;div class="uk-offcanvas-bar"&gt; &lt;div class="uk-panel"&gt;...&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2 id="javascript"><a href="#javascript" class="uk-link-reset">JavaScript</a></h2> <p>可以通过JavaScript来打开或关闭抽屉:</p> <pre><code class="javascript">// 通过CSS选择器匹配抽屉显示状态 $.UIkit.offcanvas.show('#my-id'); // 隐藏当前所有抽屉。如果你不需要任何动画效果,设置为 true。 $.UIkit.offcanvas.hide([force = false]) </code></pre> <h3>事件</h3> <div class="uk-overflow-container"> <table class="uk-table uk-table-striped uk-text-nowrap"> <thead> <tr> <th>事件名称</th> <th>参数</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><code>show.uk.offcanvas</code></td> <td>event, panel, bar</td> <td>抽屉显示时触发</td> </tr> <tr> <td><code>hide.uk.offcanvas</code></td> <td>event, panel, bar</td> <td>抽屉隐藏时触发</td> </tr> </tbody> </table> </div> </article> </div> </div> </div> </div> <div class="tm-footer"> <div class="uk-container uk-container-center uk-text-center"> <ul class="uk-subnav uk-subnav-line uk-flex-center"> <li><a href="http://github.com/uikit/uikit">GitHub</a></li> <li><a href="http://github.com/uikit/uikit/issues">Issues</a></li> <li><a href="http://github.com/uikit/uikit/blob/master/CHANGELOG.md">Changelog</a></li> <li><a href="https://twitter.com/getuikit">Twitter</a></li> </ul> <div class="uk-panel"> <p>Made by <a href="http://www.yootheme.com">YOOtheme</a> with love and caffeine.<br>Licensed under <a href="http://opensource.org/licenses/MIT">MIT license</a>.</p> <a href="../index.html"><img src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></a> </div> </div> </div> <div id="tm-offcanvas" class="uk-offcanvas"> <div class="uk-offcanvas-bar"> <ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav="{multiple:true}"> <li class="uk-parent"><a href="#">UIkit 中文文档</a> <ul class="uk-nav-sub"> <li><a href="documentation_get-started.html">开始使用</a></li> <li><a href="documentation_how-to-customize.html">如何定制</a></li> <li><a href="documentation_layouts.html">布局示例</a></li> <li><a href="core.html">核心组件</a></li> <li><a href="components.html">附加组件</a></li> <li><a href="documentation_project-structure.html">项目结构</a></li> <li><a href="documentation_less-sass.html">Less &amp; Sass 文件</a></li> <li><a href="documentation_create-a-theme.html">创建主题</a></li> <li><a href="documentation_create-a-style.html">创建样式</a></li> <li><a href="documentation_customizer-json.html">Customizer.json</a></li> <li><a href="documentation_javascript.html">JavaScript</a></li> <li><a href="documentation_custom-prefix.html">自定义前缀</a></li> </ul> </li> <li class="uk-nav-header">Core</li> <li class="uk-parent"><a href="#"><i class="uk-icon-wrench"></i> 默认</a> <ul class="uk-nav-sub"> <li><a href="base.html">基础</a></li> <li><a href="print.html">打印</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-th-large"></i>布局类组件</a> <ul class="uk-nav-sub"> <li><a href="grid.html">网格</a></li> <li><a href="panel.html">面板</a></li> <li><a href="block.html">块</a></li> <li><a href="article.html">文章</a></li> <li><a href="comment.html">评论</a></li> <li><a href="utility.html">效果</a></li> <li><a href="flex.html">Flex</a></li> <li><a href="cover.html">覆盖</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-bars"></i>导航类组件</a> <ul class="uk-nav-sub"> <li><a href="nav.html">导航菜单</a></li> <li><a href="navbar.html">导航栏</a></li> <li><a href="subnav.html">二级导航</a></li> <li><a href="breadcrumb.html">面包屑</a></li> <li><a href="pagination.html">分页</a></li> <li><a href="tab.html">选项卡</a></li> <li><a href="thumbnav.html">缩略图导航</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-check"></i>页面元素</a> <ul class="uk-nav-sub"> <li><a href="list.html">列表</a></li> <li><a href="description-list.html">描述列表</a></li> <li><a href="table.html">表格</a></li> <li><a href="form.html">表单</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-folder-open"></i> 常用组件</a> <ul class="uk-nav-sub"> <li><a href="button.html">按钮</a></li> <li><a href="icon.html">图标</a></li> <li><a href="close.html">关闭</a></li> <li><a href="badge.html">徽章</a></li> <li><a href="alert.html">提示框</a></li> <li><a href="thumbnail.html">缩略图</a></li> <li><a href="overlay.html">遮罩</a></li> <li><a href="text.html">文本</a></li> <li><a href="animation.html">动画</a></li> <li><a href="contrast.html">对比度</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-magic"></i>JavaScript组件</a> <ul class="uk-nav-sub"> <li><a href="dropdown.html">下拉菜单</a></li> <li><a href="modal.html">模态对话框</a></li> <li><a href="offcanvas.html">抽屉</a></li> <li><a href="switcher.html">切换器</a></li> <li><a href="toggle.html">拨动</a></li> <li><a href="scrollspy.html">滚动监听</a></li> <li><a href="smooth-scroll.html">平滑滚动</a></li> </ul> </li> <li class="uk-nav-header">附加组件</li> <li class="uk-parent"><a href="#"><i class="uk-icon-th-large"></i>布局类组件</a> <ul class="uk-nav-sub"> <li><a href="grid-js.html">动态网格</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-bars"></i>导航类组件</a> <ul class="uk-nav-sub"> <li><a href="dotnav.html">圆点导航</a></li> <li><a href="slidenav.html">滑动导航</a></li> <li><a href="pagination-js.html">动态分页</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-folder-open"></i> 常用组件</a> <ul class="uk-nav-sub"> <li><a href="form-advanced.html">高级表单</a></li> <li><a href="form-file.html">文件表单</a></li> <li><a href="form-password.html">密码表单</a></li> <li><a href="form-select.html">选择表单</a></li> <li><a href="placeholder.html">占位符</a></li> <li><a href="progress.html">进度条</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-magic"></i>JavaScript组件</a> <ul class="uk-nav-sub"> <li><a href="lightbox.html">灯箱</a></li> <li><a href="autocomplete.html">自动完成</a></li> <li><a href="datepicker.html">日期选择器</a></li> <li><a href="htmleditor.html">HTML 编辑器</a></li> <li><a href="slider.html">滚动条</a></li> <li><a href="slideset.html">滑块集</a></li> <li><a href="slideshow.html">幻灯片</a></li> <li><a href="parallax.html">视差</a></li> <li><a href="accordion.html">手风琴</a></li> <li><a href="notify.html">通知</a></li> <li><a href="search.html">搜索</a></li> <li><a href="nestable.html">可嵌套</a></li> <li><a href="sortable.html">可排序</a></li> <li><a href="sticky.html">附着</a></li> <li><a href="timepicker.html">时间选择器</a></li> <li><a href="tooltip.html">工具提示</a></li> <li><a href="upload.html">上传</a></li> </ul> </li> <li class="uk-nav-divider"></li> <li><a href="../showcase/index.html">案例展示</a></li> <li><a href="tutorials.html">视频教程</a></li> </ul> </div> </div> </body> </html>
lupuxyz/uikit_2.22.0
docs/offcanvas.html
HTML
mit
31,467
<?php App::uses('DataSource', 'Model/Datasource'); use Fluent\Logger\FluentLogger; Fluent\Autoloader::register(); class FluentLoggerSource extends DataSource { protected $_connection = null; public function __construct($config = null, $autoConnect = true) { parent::__construct($config); if ($autoConnect) { return $this->connect(); } } public function connect() { $config = $this->config + array( 'port' => '24224', ); $this->connected = false; try { $this->_connection = new FluentLogger($config['host'], $config['port']); $this->connected = true; } catch (Exception $e) { throw new MissingConnectionException(array( 'class' => get_class($this), 'message' => $e->getMessage(), )); } return $this->connected; } public function close() { if ($this->connected == true) { unset($this->_connection); $this->_connection = null; $this->connected = false; } return true; } public function query($method, $params, $model) { return call_user_func_array(array($this->_connection, $method), $params); } public function listSources($data = null) { } }
nanapi/cakephp-fluent-logger-datasource
Model/Datasource/FluentLoggerSource.php
PHP
mit
1,200
/* eslint-disable no-undef */ describe('Constructor', () => { let machine; let shuffleSpy; let runSpy; beforeEach(() => { shuffleSpy = sinon.spy(SlotMachine.prototype, 'shuffle'); runSpy = sinon.spy(SlotMachine.prototype, 'run'); }); afterEach(() => { shuffleSpy.restore(); runSpy.restore(); if (machine) { machine.element.remove(); } }); it('has element', () => { machine = render(); const element = document.getElementById(id); expect(machine.element).to.be.equal(element); }); it('element does not have overflow', () => { machine = render(); expect(machine.element.style.overflow).to.be.equal('hidden'); }); [ { active: 0, result: 0 }, { active: 1, result: 1 }, { active: 99, result: 0 }, { active: -99, result: 0 }, { active: '0', result: 0 }, { active: {}, result: 0 }, { active: null, result: 0 }, { active: undefined, result: 0 } ].forEach((testCase) => { it(`sets active: ${testCase.active}`, () => { machine = render({ active: testCase.active }); expect(machine.active).to.be.equal(testCase.result); }); }); it('wraps tiles and adds offsets', () => { machine = render(); expect(machine.container.classList.contains('slotMachineContainer')).to.be.true; expect(machine.container.children).to.have.lengthOf(5); }); ['up', 'down'].forEach((direction) => { it(`sets direction: ${direction}`, () => { machine = render({ direction: direction }); expect(machine.direction).to.be.equal(direction); }); }); it('sets randomize', () => { const randomize = () => {}; machine = render({ randomize }); expect(machine.randomize).to.be.equal(randomize); }); it('does not auto start', () => { machine = render(); expect(shuffleSpy).to.not.have.been.called; expect(runSpy).to.not.have.been.called; }); it('runs when auto is set to true', () => { machine = render({ auto: true }); expect(shuffleSpy).to.not.have.been.called; expect(runSpy).to.have.been.called; }); it('run auto when auto is set to number', () => { machine = render({ auto: 1 }); expect(shuffleSpy).to.not.have.been.called; expect(runSpy).to.have.been.called; }); });
josex2r/jQuery-SlotMachine
tests/acceptance/constructor-test.js
JavaScript
mit
2,336
// // UIImage+OpenCV.h // OpenCVClient // // Created by Washe on 01/12/2012. // Copyright 2012 Washe / Foundry. All rights reserved. // // Permission is given to use this source code file without charge in any // project, commercial or otherwise, entirely at your risk, with the condition // that any redistribution (in part or whole) of source code must retain // this copyright and permission notice. Attribution in compiled projects is // appreciated but not required. // #import <UIKit/UIKit.h> @interface UIImage (OpenCVBW) - (UIImage *)blackAndWhite; @end
kronik/smartcrop
SmartCrop/OpenCV/UIImage+OpenCVBW.h
C
mit
575
/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <[email protected]> */ pre code { display: block; padding: 0.5em; } pre code, pre .ruby .subst, pre .tag .title, pre .lisp .title { color: black; } pre .string, pre .title, pre .constant, pre .parent, pre .tag .value, pre .rules .value, pre .rules .value .number, pre .preprocessor, pre .ruby .symbol, pre .ruby .symbol .string, pre .ruby .symbol .keyword, pre .ruby .symbol .keymethods, pre .instancevar, pre .aggregate, pre .template_tag, pre .django .variable, pre .smalltalk .class, pre .addition, pre .flow, pre .stream, pre .bash .variable, pre .apache .tag, pre .apache .cbracket, pre .tex .command, pre .tex .special, pre .erlang_repl .function_or_atom { color: #800; } pre .comment, pre .annotation, pre .template_comment, pre .diff .header, pre .chunk { color: #888; } pre .number, pre .date, pre .regexp, pre .literal, pre .smalltalk .symbol, pre .smalltalk .char, pre .go .constant, pre .change { color: #080; } pre .label, pre .javadoc, pre .ruby .string, pre .decorator, pre .filter .argument, pre .localvars, pre .array, pre .attr_selector, pre .important, pre .pseudo, pre .pi, pre .doctype, pre .deletion, pre .envvar, pre .shebang, pre .apache .sqbracket, pre .nginx .built_in, pre .tex .formula, pre .erlang_repl .reserved, pre .input_number { color: #88F } pre .css .tag, pre .javadoctag, pre .phpdoc, pre .yardoctag { font-weight: bold; } pre .keyword, pre .id, pre .phpdoc, pre .title, pre .built_in, pre .aggregate, pre .smalltalk .class, pre .winutils, pre .bash .variable, pre .apache .tag, pre .go .typename, pre .tex .command { font-weight: bold; } pre .nginx .built_in { font-weight: normal; } pre .xml .css, pre .xml .javascript, pre .xml .vbscript, pre .tex .formula { opacity: 0.5; }
cycgit/blog
static/css/public/default.css
CSS
mit
1,817
\begin{table}[!htbp] \centering \caption{符号交织比特置换} \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline\hline \multicolumn{13}{|c|}{2K模式} \\ \hline \multicolumn{3}{|c|}{$R'_i$的比特位置} & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\ \hline \multicolumn{3}{|c|}{$R_i$的比特位置} & 0 & 7 & 5 & 1 & 8 & 2 & 6 & 9 & 3 & 4 \\ \hline \multicolumn{13}{|c|}{8K模式} \\ \hline $R'_i$的比特位置 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 \\ \hline $R'_i$的比特位置 & 5 & 11 & 3 & 0 & 10 & 8 & 6 & 9 & 2 & 4 & 1 & 7 \\ \hline\hline \end{tabular} \label{table:symbol_interleaver_bit_replace} \end{table} \endinput
Pokerpoke/LaTeX-Template-For-NPU-Thesis
paper/tables/symbol_interleaver_bit_replace.tex
TeX
mit
665
# API diff: SkiaSharp.dll ## SkiaSharp.dll > Assembly Version Changed: 1.56.0.0 vs 1.55.0.0 ### Namespace SkiaSharp #### Type Changed: SkiaSharp.SKBitmap Added methods: ```csharp public bool InstallPixels (SKPixmap pixmap); public SKPixmap PeekPixels (); public bool Resize (SKBitmap dst, SKBitmapResizeMethod method); public SKBitmap Resize (SKImageInfo info, SKBitmapResizeMethod method); public static bool Resize (SKBitmap dst, SKBitmap src, SKBitmapResizeMethod method); ``` #### Type Changed: SkiaSharp.SKCodec Added properties: ```csharp public SKEncodedInfo EncodedInfo { get; } public int FrameCount { get; } public SKCodecFrameInfo[] FrameInfo { get; } public int RepetitionCount { get; } ``` Added methods: ```csharp public SKCodecResult GetPixels (SKImageInfo info, IntPtr pixels, SKCodecOptions options); public SKCodecResult GetPixels (SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options); ``` #### Type Changed: SkiaSharp.SKCodecOptions Added constructor: ```csharp public SKCodecOptions (int frameIndex, bool hasPriorFrame); ``` Added properties: ```csharp public int FrameIndex { get; set; } public bool HasPriorFrame { get; set; } ``` #### Type Changed: SkiaSharp.SKColorFilter Obsoleted methods: ```diff [Obsolete ("Use CreateBlendMode(SKColor, SKBlendMode) instead.")] public static SKColorFilter CreateXferMode (SKColor c, SKXferMode mode); ``` Added method: ```csharp [Obsolete ("Use CreateBlendMode(SKColor, SKBlendMode) instead.")] public static SKColorFilter CreateBlendMode (SKColor c, SKXferMode mode); ``` #### Type Changed: SkiaSharp.SKImageFilter Removed method: ```csharp public static SKImageFilter CreateMerge (SKImageFilter[] filters, SKXferMode[] modes, SKImageFilter.CropRect cropRect); ``` Added methods: ```csharp public static SKImageFilter CreateMerge (SKImageFilter[] filters, SKBlendMode[] modes, SKImageFilter.CropRect cropRect); public static SKImageFilter CreateMerge (SKImageFilter first, SKImageFilter second, SKBlendMode mode, SKImageFilter.CropRect cropRect); ``` #### Type Changed: SkiaSharp.SKMaskFilter Added method: ```csharp public static SKMaskFilter CreateShadow (float occluderHeight, SKPoint3 lightPos, float lightRadius, float ambientAlpha, float spotAlpha, SKShadowMaskFilterShadowFlags flags); ``` #### Type Changed: SkiaSharp.SKPicture Obsoleted properties: ```diff [Obsolete ("Use CullRect instead.")] public SKRect Bounds { get; } ``` Added property: ```csharp public SKRect CullRect { get; } ``` #### Type Changed: SkiaSharp.SKPictureRecorder Modified methods: ```diff -public SKCanvas BeginRecording (SKRect rect) +public SKCanvas BeginRecording (SKRect cullRect) ``` #### Type Changed: SkiaSharp.SKShader Obsoleted methods: ```diff [Obsolete ("Use CreateCompose(SKShader, SKShader, SKBlendMode) instead.")] public static SKShader CreateCompose (SKShader shaderA, SKShader shaderB, SKXferMode mode); ``` Added method: ```csharp public static SKShader CreateCompose (SKShader shaderA, SKShader shaderB, SKBlendMode mode); ``` #### New Type: SkiaSharp.SKBitmapResizeMethod ```csharp [Serializable] public enum SKBitmapResizeMethod { Box = 0, Hamming = 3, Lanczos3 = 2, Mitchell = 4, Triangle = 1, } ``` #### New Type: SkiaSharp.SKCodecFrameInfo ```csharp public struct SKCodecFrameInfo { // properties public int Duration { get; set; } public int RequiredFrame { get; set; } } ``` #### New Type: SkiaSharp.SKEncodedInfo ```csharp public struct SKEncodedInfo { // constructors public SKEncodedInfo (SKEncodedInfoColor color); public SKEncodedInfo (SKEncodedInfoColor color, SKEncodedInfoAlpha alpha, byte bitsPerComponent); // properties public SKEncodedInfoAlpha Alpha { get; } public byte BitsPerComponent { get; } public byte BitsPerPixel { get; } public SKEncodedInfoColor Color { get; } } ``` #### New Type: SkiaSharp.SKEncodedInfoAlpha ```csharp [Serializable] public enum SKEncodedInfoAlpha { Binary = 2, Opaque = 0, Unpremul = 1, } ``` #### New Type: SkiaSharp.SKEncodedInfoColor ```csharp [Serializable] public enum SKEncodedInfoColor { Bgr = 5, Bgra = 7, Bgrx = 6, Gray = 0, GrayAlpha = 1, InvertedCmyk = 10, Palette = 2, Rgb = 3, Rgba = 4, Ycck = 11, Yuv = 8, Yuva = 9, } ``` #### New Type: SkiaSharp.SKPixmap ```csharp public class SKPixmap : SkiaSharp.SKObject, System.IDisposable { // constructors public SKPixmap (); public SKPixmap (SKImageInfo info, IntPtr addr, int rowBytes, SKColorTable ctable); // properties public SKAlphaType AlphaType { get; } public int BytesPerPixel { get; } public SKColorTable ColorTable { get; } public SKColorType ColorType { get; } public int Height { get; } public SKImageInfo Info { get; } public int RowBytes { get; } public int Width { get; } // methods protected override void Dispose (bool disposing); public IntPtr GetPixels (); public void Reset (); public void Reset (SKImageInfo info, IntPtr addr, int rowBytes, SKColorTable ctable); public static bool Resize (SKPixmap dst, SKPixmap src, SKBitmapResizeMethod method); } ``` #### New Type: SkiaSharp.SKShadowMaskFilterShadowFlags ```csharp [Serializable] [Flags] public enum SKShadowMaskFilterShadowFlags { All = 7, GaussianEdge = 4, LargerUmbra = 2, None = 0, TransparentOccluder = 1, } ```
mono/SkiaSharp
changelogs/SkiaSharp/1.56.0/SkiaSharp.md
Markdown
mit
5,309
/* ========================================================================= Unity Project - A Test Framework for C Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams [Released under MIT License. Please refer to license.txt for details] ============================================================================ */ #include "unity.h" #include <stddef.h> /* If omitted from header, declare overrideable prototypes here so they're ready for use */ #ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION void UNITY_OUTPUT_CHAR(int); #endif /* Helpful macros for us to use here */ #define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); } #define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); } /* return prematurely if we are already in failure or ignore state */ #define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} } struct _Unity Unity; static const char UnityStrOk[] = "OK"; static const char UnityStrPass[] = "PASS"; static const char UnityStrFail[] = "FAIL"; static const char UnityStrIgnore[] = "IGNORE"; static const char UnityStrNull[] = "NULL"; static const char UnityStrSpacer[] = ". "; static const char UnityStrExpected[] = " Expected "; static const char UnityStrWas[] = " Was "; static const char UnityStrElement[] = " Element "; static const char UnityStrByte[] = " Byte "; static const char UnityStrMemory[] = " Memory Mismatch."; static const char UnityStrDelta[] = " Values Not Within Delta "; static const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless."; static const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL"; static const char UnityStrNullPointerForActual[] = " Actual pointer was NULL"; static const char UnityStrNot[] = "Not "; static const char UnityStrInf[] = "Infinity"; static const char UnityStrNegInf[] = "Negative Infinity"; static const char UnityStrNaN[] = "NaN"; static const char UnityStrDet[] = "Determinate"; static const char UnityStrInvalidFloatTrait[] = "Invalid Float Trait"; const char UnityStrErrFloat[] = "Unity Floating Point Disabled"; const char UnityStrErrDouble[] = "Unity Double Precision Disabled"; const char UnityStrErr64[] = "Unity 64-bit Support Disabled"; static const char UnityStrBreaker[] = "-----------------------"; static const char UnityStrResultsTests[] = " Tests "; static const char UnityStrResultsFailures[] = " Failures "; static const char UnityStrResultsIgnored[] = " Ignored "; static const char UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " "; static const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " "; #ifdef UNITY_FLOAT_NEEDS_ZERO /* Dividing by these constants produces +/- infinity. * The rationale is given in UnityAssertFloatIsInf's body. */ static const _UF f_zero = 0.0f; #endif /* compiler-generic print formatting masks */ static const _U_UINT UnitySizeMask[] = { 255u, /* 0xFF */ 65535u, /* 0xFFFF */ 65535u, 4294967295u, /* 0xFFFFFFFF */ 4294967295u, 4294967295u, 4294967295u #ifdef UNITY_SUPPORT_64 ,0xFFFFFFFFFFFFFFFF #endif }; /*----------------------------------------------- * Pretty Printers & Test Result Output Handlers *-----------------------------------------------*/ void UnityPrint(const char* string) { const char* pch = string; if (pch != NULL) { while (*pch) { /* printable characters plus CR & LF are printed */ if ((*pch <= 126) && (*pch >= 32)) { UNITY_OUTPUT_CHAR(*pch); } /* write escaped carriage returns */ else if (*pch == 13) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('r'); } /* write escaped line feeds */ else if (*pch == 10) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('n'); } /* unprintable characters are shown as codes */ else { UNITY_OUTPUT_CHAR('\\'); UnityPrintNumberHex((_U_UINT)*pch, 2); } pch++; } } } void UnityPrintLen(const char* string, const _UU32 length); void UnityPrintLen(const char* string, const _UU32 length) { const char* pch = string; if (pch != NULL) { while (*pch && (_UU32)(pch - string) < length) { /* printable characters plus CR & LF are printed */ if ((*pch <= 126) && (*pch >= 32)) { UNITY_OUTPUT_CHAR(*pch); } /* write escaped carriage returns */ else if (*pch == 13) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('r'); } /* write escaped line feeds */ else if (*pch == 10) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('n'); } /* unprintable characters are shown as codes */ else { UNITY_OUTPUT_CHAR('\\'); UnityPrintNumberHex((_U_UINT)*pch, 2); } pch++; } } } /*-----------------------------------------------*/ void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style) { if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { UnityPrintNumber(number); } else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) { UnityPrintNumberUnsigned( (_U_UINT)number & UnitySizeMask[((_U_UINT)style & (_U_UINT)0x0F) - 1] ); } else { UnityPrintNumberHex((_U_UINT)number, (char)((style & 0x000F) << 1)); } } /*-----------------------------------------------*/ void UnityPrintNumber(const _U_SINT number_to_print) { _U_UINT number = (_U_UINT)number_to_print; if (number_to_print < 0) { /* A negative number, including MIN negative */ UNITY_OUTPUT_CHAR('-'); number = (_U_UINT)(-number_to_print); } UnityPrintNumberUnsigned(number); } /*----------------------------------------------- * basically do an itoa using as little ram as possible */ void UnityPrintNumberUnsigned(const _U_UINT number) { _U_UINT divisor = 1; /* figure out initial divisor */ while (number / divisor > 9) { divisor *= 10; } /* now mod and print, then divide divisor */ do { UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); divisor /= 10; } while (divisor > 0); } /*-----------------------------------------------*/ void UnityPrintNumberHex(const _U_UINT number, const char nibbles_to_print) { _U_UINT nibble; char nibbles = nibbles_to_print; UNITY_OUTPUT_CHAR('0'); UNITY_OUTPUT_CHAR('x'); while (nibbles > 0) { nibble = (number >> (--nibbles << 2)) & 0x0000000F; if (nibble <= 9) { UNITY_OUTPUT_CHAR((char)('0' + nibble)); } else { UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble)); } } } /*-----------------------------------------------*/ void UnityPrintMask(const _U_UINT mask, const _U_UINT number) { _U_UINT current_bit = (_U_UINT)1 << (UNITY_INT_WIDTH - 1); _US32 i; for (i = 0; i < UNITY_INT_WIDTH; i++) { if (current_bit & mask) { if (current_bit & number) { UNITY_OUTPUT_CHAR('1'); } else { UNITY_OUTPUT_CHAR('0'); } } else { UNITY_OUTPUT_CHAR('X'); } current_bit = current_bit >> 1; } } /*-----------------------------------------------*/ #ifdef UNITY_FLOAT_VERBOSE #include <stdio.h> #ifndef UNITY_VERBOSE_NUMBER_MAX_LENGTH # ifdef UNITY_DOUBLE_VERBOSE # define UNITY_VERBOSE_NUMBER_MAX_LENGTH 317 # else # define UNITY_VERBOSE_NUMBER_MAX_LENGTH 47 # endif #endif void UnityPrintFloat(_UF number) { char TempBuffer[UNITY_VERBOSE_NUMBER_MAX_LENGTH + 1]; snprintf(TempBuffer, sizeof(TempBuffer), "%.6f", number); UnityPrint(TempBuffer); } #endif /*-----------------------------------------------*/ void UnityPrintFail(void); void UnityPrintFail(void) { UnityPrint(UnityStrFail); } void UnityPrintOk(void); void UnityPrintOk(void) { UnityPrint(UnityStrOk); } /*-----------------------------------------------*/ static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line); static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) { #ifndef UNITY_FIXTURES UnityPrint(file); UNITY_OUTPUT_CHAR(':'); UnityPrintNumber((_U_SINT)line); UNITY_OUTPUT_CHAR(':'); UnityPrint(Unity.CurrentTestName); UNITY_OUTPUT_CHAR(':'); #else UNITY_UNUSED(file); UNITY_UNUSED(line); #endif } /*-----------------------------------------------*/ static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line); static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) { #ifndef UNITY_FIXTURES UnityTestResultsBegin(Unity.TestFile, line); #else UNITY_UNUSED(line); #endif UnityPrint(UnityStrFail); UNITY_OUTPUT_CHAR(':'); } /*-----------------------------------------------*/ void UnityConcludeTest(void) { if (Unity.CurrentTestIgnored) { Unity.TestIgnores++; UNITY_PRINT_EOL(); } else if (!Unity.CurrentTestFailed) { /* DRB: I'd preffer passed tests to be silent */ /* UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber); UnityPrint(UnityStrPass); */ } else { Unity.TestFailures++; UNITY_PRINT_EOL(); } Unity.CurrentTestFailed = 0; Unity.CurrentTestIgnored = 0; UNITY_FLUSH_CALL(); } /*-----------------------------------------------*/ static void UnityAddMsgIfSpecified(const char* msg); static void UnityAddMsgIfSpecified(const char* msg) { if (msg) { UnityPrint(UnityStrSpacer); #ifndef UNITY_EXCLUDE_DETAILS if (Unity.CurrentDetail1) { UnityPrint(UnityStrDetail1Name); UnityPrint(Unity.CurrentDetail1); if (Unity.CurrentDetail2) { UnityPrint(UnityStrDetail2Name); UnityPrint(Unity.CurrentDetail2); } UnityPrint(UnityStrSpacer); } #endif UnityPrint(msg); } } /*-----------------------------------------------*/ static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual); static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) { UnityPrint(UnityStrExpected); if (expected != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrint(expected); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } UnityPrint(UnityStrWas); if (actual != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrint(actual); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } } /*-----------------------------------------------*/ static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const _UU32 length) { UnityPrint(UnityStrExpected); if (expected != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrintLen(expected, length); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } UnityPrint(UnityStrWas); if (actual != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrintLen(actual, length); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } } /*----------------------------------------------- * Assertion & Control Helpers *-----------------------------------------------*/ static int UnityCheckArraysForNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const UNITY_LINE_TYPE lineNumber, const char* msg) { /* return true if they are both NULL */ if ((expected == NULL) && (actual == NULL)) return 1; /* throw error if just expected is NULL */ if (expected == NULL) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrNullPointerForExpected); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } /* throw error if just actual is NULL */ if (actual == NULL) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrNullPointerForActual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } /* return false if neither is NULL */ return 0; } /*----------------------------------------------- * Assertion Functions *-----------------------------------------------*/ void UnityAssertBits(const _U_SINT mask, const _U_SINT expected, const _U_SINT actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { UNITY_SKIP_EXECUTION; if ((mask & expected) != (mask & actual)) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); UnityPrintMask((_U_UINT)mask, (_U_UINT)expected); UnityPrint(UnityStrWas); UnityPrintMask((_U_UINT)mask, (_U_UINT)actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualNumber(const _U_SINT expected, const _U_SINT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style) { UNITY_SKIP_EXECUTION; if (expected != actual) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(expected, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(actual, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } #define UnityPrintPointlessAndBail() \ { \ UnityTestResultsFailBegin(lineNumber); \ UnityPrint(UnityStrPointless); \ UnityAddMsgIfSpecified(msg); \ UNITY_FAIL_AND_BAIL; } /*-----------------------------------------------*/ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const _UU32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style) { _UU32 elements = num_elements; UNITY_INTERNAL_PTR ptr_exp = (UNITY_INTERNAL_PTR)expected; UNITY_INTERNAL_PTR ptr_act = (UNITY_INTERNAL_PTR)actual; UNITY_SKIP_EXECUTION; if (elements == 0) { UnityPrintPointlessAndBail(); } if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1) return; /* If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case * as UNITY_DISPLAY_STYLE_INT includes a flag for UNITY_DISPLAY_RANGE_AUTO, which the width-specific * variants do not. Therefore remove this flag. */ switch(style & (UNITY_DISPLAY_STYLE_T)(~UNITY_DISPLAY_RANGE_AUTO)) { case UNITY_DISPLAY_STYLE_HEX8: case UNITY_DISPLAY_STYLE_INT8: case UNITY_DISPLAY_STYLE_UINT8: while (elements--) { if (*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 1); ptr_act = (UNITY_INTERNAL_PTR)((_UP)ptr_act + 1); } break; case UNITY_DISPLAY_STYLE_HEX16: case UNITY_DISPLAY_STYLE_INT16: case UNITY_DISPLAY_STYLE_UINT16: while (elements--) { if (*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_exp, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 2); ptr_act = (UNITY_INTERNAL_PTR)((_UP)ptr_act + 2); } break; #ifdef UNITY_SUPPORT_64 case UNITY_DISPLAY_STYLE_HEX64: case UNITY_DISPLAY_STYLE_INT64: case UNITY_DISPLAY_STYLE_UINT64: while (elements--) { if (*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_exp, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 8); ptr_act = (UNITY_INTERNAL_PTR)((_UP)ptr_act + 8); } break; #endif default: while (elements--) { if (*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_exp, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 4); ptr_act = (UNITY_INTERNAL_PTR)((_UP)ptr_act + 4); } break; } } /*-----------------------------------------------*/ #ifndef UNITY_EXCLUDE_FLOAT void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected, UNITY_PTR_ATTRIBUTE const _UF* actual, const _UU32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber) { _UU32 elements = num_elements; UNITY_PTR_ATTRIBUTE const _UF* ptr_expected = expected; UNITY_PTR_ATTRIBUTE const _UF* ptr_actual = actual; _UF diff, tol; UNITY_SKIP_EXECUTION; if (elements == 0) { UnityPrintPointlessAndBail(); } if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1) return; while (elements--) { diff = *ptr_expected - *ptr_actual; if (diff < 0.0f) diff = 0.0f - diff; tol = UNITY_FLOAT_PRECISION * *ptr_expected; if (tol < 0.0f) tol = 0.0f - tol; /* This first part of this condition will catch any NaN or Infinite values */ if (isnan(diff) || isinf(diff) || (diff > tol)) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); #ifdef UNITY_FLOAT_VERBOSE UnityPrint(UnityStrExpected); UnityPrintFloat(*ptr_expected); UnityPrint(UnityStrWas); UnityPrintFloat(*ptr_actual); #else UnityPrint(UnityStrDelta); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_expected++; ptr_actual++; } } /*-----------------------------------------------*/ void UnityAssertFloatsWithin(const _UF delta, const _UF expected, const _UF actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { _UF diff = actual - expected; _UF pos_delta = delta; UNITY_SKIP_EXECUTION; if (diff < 0.0f) { diff = 0.0f - diff; } if (pos_delta < 0.0f) { pos_delta = 0.0f - pos_delta; } /* This first part of this condition will catch any NaN or Infinite values */ if (isnan(diff) || isinf(diff) || (pos_delta < diff)) { UnityTestResultsFailBegin(lineNumber); #ifdef UNITY_FLOAT_VERBOSE UnityPrint(UnityStrExpected); UnityPrintFloat(expected); UnityPrint(UnityStrWas); UnityPrintFloat(actual); #else UnityPrint(UnityStrDelta); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertFloatSpecial(const _UF actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLOAT_TRAIT_T style) { const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet }; _U_SINT should_be_trait = ((_U_SINT)style & 1); _U_SINT is_trait = !should_be_trait; _U_SINT trait_index = (_U_SINT)(style >> 1); UNITY_SKIP_EXECUTION; switch(style) { /* To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly * We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise */ case UNITY_FLOAT_IS_INF: case UNITY_FLOAT_IS_NOT_INF: is_trait = isinf(actual) & ispos(actual); break; case UNITY_FLOAT_IS_NEG_INF: case UNITY_FLOAT_IS_NOT_NEG_INF: is_trait = isinf(actual) & isneg(actual); break; /* NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. */ case UNITY_FLOAT_IS_NAN: case UNITY_FLOAT_IS_NOT_NAN: is_trait = isnan(actual); break; /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */ case UNITY_FLOAT_IS_DET: case UNITY_FLOAT_IS_NOT_DET: if (isinf(actual) | isnan(actual)) is_trait = 0; else is_trait = 1; break; default: trait_index = 0; trait_names[0] = UnityStrInvalidFloatTrait; break; } if (is_trait != should_be_trait) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); if (!should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); UnityPrint(UnityStrWas); #ifdef UNITY_FLOAT_VERBOSE UnityPrintFloat(actual); #else if (should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } #endif /* not UNITY_EXCLUDE_FLOAT */ /*-----------------------------------------------*/ #ifndef UNITY_EXCLUDE_DOUBLE void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected, UNITY_PTR_ATTRIBUTE const _UD* actual, const _UU32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber) { _UU32 elements = num_elements; UNITY_PTR_ATTRIBUTE const _UD* ptr_expected = expected; UNITY_PTR_ATTRIBUTE const _UD* ptr_actual = actual; _UD diff, tol; UNITY_SKIP_EXECUTION; if (elements == 0) { UnityPrintPointlessAndBail(); } if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1) return; while (elements--) { diff = *ptr_expected - *ptr_actual; if (diff < 0.0) diff = 0.0 - diff; tol = UNITY_DOUBLE_PRECISION * *ptr_expected; if (tol < 0.0) tol = 0.0 - tol; /* This first part of this condition will catch any NaN or Infinite values */ if (isnan(diff) || isinf(diff) || (diff > tol)) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); #ifdef UNITY_DOUBLE_VERBOSE UnityPrint(UnityStrExpected); UnityPrintFloat((float)(*ptr_expected)); UnityPrint(UnityStrWas); UnityPrintFloat((float)(*ptr_actual)); #else UnityPrint(UnityStrDelta); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_expected++; ptr_actual++; } } /*-----------------------------------------------*/ void UnityAssertDoublesWithin(const _UD delta, const _UD expected, const _UD actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { _UD diff = actual - expected; _UD pos_delta = delta; UNITY_SKIP_EXECUTION; if (diff < 0.0) { diff = 0.0 - diff; } if (pos_delta < 0.0) { pos_delta = 0.0 - pos_delta; } /* This first part of this condition will catch any NaN or Infinite values */ if (isnan(diff) || isinf(diff) || (pos_delta < diff)) { UnityTestResultsFailBegin(lineNumber); #ifdef UNITY_DOUBLE_VERBOSE UnityPrint(UnityStrExpected); UnityPrintFloat((float)expected); UnityPrint(UnityStrWas); UnityPrintFloat((float)actual); #else UnityPrint(UnityStrDelta); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertDoubleSpecial(const _UD actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLOAT_TRAIT_T style) { const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet }; _U_SINT should_be_trait = ((_U_SINT)style & 1); _U_SINT is_trait = !should_be_trait; _U_SINT trait_index = (_U_SINT)(style >> 1); UNITY_SKIP_EXECUTION; switch(style) { /* To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly * We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise */ case UNITY_FLOAT_IS_INF: case UNITY_FLOAT_IS_NOT_INF: is_trait = isinf(actual) & ispos(actual); break; case UNITY_FLOAT_IS_NEG_INF: case UNITY_FLOAT_IS_NOT_NEG_INF: is_trait = isinf(actual) & isneg(actual); break; /* NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. */ case UNITY_FLOAT_IS_NAN: case UNITY_FLOAT_IS_NOT_NAN: is_trait = isnan(actual); break; /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */ case UNITY_FLOAT_IS_DET: case UNITY_FLOAT_IS_NOT_DET: if (isinf(actual) | isnan(actual)) is_trait = 0; else is_trait = 1; break; default: trait_index = 0; trait_names[0] = UnityStrInvalidFloatTrait; break; } if (is_trait != should_be_trait) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); if (!should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); UnityPrint(UnityStrWas); #ifdef UNITY_DOUBLE_VERBOSE UnityPrintFloat(actual); #else if (should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } #endif /* not UNITY_EXCLUDE_DOUBLE */ /*-----------------------------------------------*/ void UnityAssertNumbersWithin( const _U_UINT delta, const _U_SINT expected, const _U_SINT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style) { UNITY_SKIP_EXECUTION; if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { if (actual > expected) Unity.CurrentTestFailed = ((_U_UINT)(actual - expected) > delta); else Unity.CurrentTestFailed = ((_U_UINT)(expected - actual) > delta); } else { if ((_U_UINT)actual > (_U_UINT)expected) Unity.CurrentTestFailed = ((_U_UINT)(actual - expected) > delta); else Unity.CurrentTestFailed = ((_U_UINT)(expected - actual) > delta); } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrDelta); UnityPrintNumberByStyle((_U_SINT)delta, style); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(expected, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(actual, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualString(const char* expected, const char* actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { _UU32 i; UNITY_SKIP_EXECUTION; /* if both pointers not null compare the strings */ if (expected && actual) { for (i = 0; expected[i] || actual[i]; i++) { if (expected[i] != actual[i]) { Unity.CurrentTestFailed = 1; break; } } } else { /* handle case of one pointers being null (if both null, test should pass) */ if (expected != actual) { Unity.CurrentTestFailed = 1; } } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); UnityPrintExpectedAndActualStrings(expected, actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualStringLen(const char* expected, const char* actual, const _UU32 length, const char* msg, const UNITY_LINE_TYPE lineNumber) { _UU32 i; UNITY_SKIP_EXECUTION; /* if both pointers not null compare the strings */ if (expected && actual) { for (i = 0; (expected[i] || actual[i]) && i < length; i++) { if (expected[i] != actual[i]) { Unity.CurrentTestFailed = 1; break; } } } else { /* handle case of one pointers being null (if both null, test should pass) */ if (expected != actual) { Unity.CurrentTestFailed = 1; } } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); UnityPrintExpectedAndActualStringsLen(expected, actual, length); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualStringArray( const char** expected, const char** actual, const _UU32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber) { _UU32 i, j = 0; UNITY_SKIP_EXECUTION; /* if no elements, it's an error */ if (num_elements == 0) { UnityPrintPointlessAndBail(); } if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1) return; do { /* if both pointers not null compare the strings */ if (expected[j] && actual[j]) { for (i = 0; expected[j][i] || actual[j][i]; i++) { if (expected[j][i] != actual[j][i]) { Unity.CurrentTestFailed = 1; break; } } } else { /* handle case of one pointers being null (if both null, test should pass) */ if (expected[j] != actual[j]) { Unity.CurrentTestFailed = 1; } } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); if (num_elements > 1) { UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(j); } UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j])); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } while (++j < num_elements); } /*-----------------------------------------------*/ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const _UU32 length, const _UU32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber) { UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual; _UU32 elements = num_elements; _UU32 bytes; UNITY_SKIP_EXECUTION; if ((elements == 0) || (length == 0)) { UnityPrintPointlessAndBail(); } if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1) return; while (elements--) { /* /////////////////////////////////// */ bytes = length; while (bytes--) { if (*ptr_exp != *ptr_act) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrMemory); if (num_elements > 1) { UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); } UnityPrint(UnityStrByte); UnityPrintNumberUnsigned(length - bytes - 1); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 1); ptr_act = (UNITY_INTERNAL_PTR)((_UP)ptr_act + 1); } /* /////////////////////////////////// */ } } /*----------------------------------------------- * Control Functions *-----------------------------------------------*/ void UnityFail(const char* msg, const UNITY_LINE_TYPE line) { UNITY_SKIP_EXECUTION; UnityTestResultsBegin(Unity.TestFile, line); UnityPrintFail(); if (msg != NULL) { UNITY_OUTPUT_CHAR(':'); #ifndef UNITY_EXCLUDE_DETAILS if (Unity.CurrentDetail1) { UnityPrint(UnityStrDetail1Name); UnityPrint(Unity.CurrentDetail1); if (Unity.CurrentDetail2) { UnityPrint(UnityStrDetail2Name); UnityPrint(Unity.CurrentDetail2); } UnityPrint(UnityStrSpacer); } #endif if (msg[0] != ' ') { UNITY_OUTPUT_CHAR(' '); } UnityPrint(msg); } UNITY_FAIL_AND_BAIL; } /*-----------------------------------------------*/ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line) { UNITY_SKIP_EXECUTION; UnityTestResultsBegin(Unity.TestFile, line); UnityPrint(UnityStrIgnore); if (msg != NULL) { UNITY_OUTPUT_CHAR(':'); UNITY_OUTPUT_CHAR(' '); UnityPrint(msg); } UNITY_IGNORE_AND_BAIL; } /*-----------------------------------------------*/ #if defined(UNITY_WEAK_ATTRIBUTE) UNITY_WEAK_ATTRIBUTE void setUp(void) { } UNITY_WEAK_ATTRIBUTE void tearDown(void) { } #elif defined(UNITY_WEAK_PRAGMA) # pragma weak setUp void setUp(void) { } # pragma weak tearDown void tearDown(void) { } #endif /*-----------------------------------------------*/ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum) { Unity.CurrentTestName = FuncName; Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; Unity.NumberOfTests++; UNITY_CLR_DETAILS(); if (TEST_PROTECT()) { setUp(); Func(); } if (TEST_PROTECT() && !(Unity.CurrentTestIgnored)) { tearDown(); } UnityConcludeTest(); } /*-----------------------------------------------*/ void UnityBegin(const char* filename) { Unity.TestFile = filename; Unity.CurrentTestName = NULL; Unity.CurrentTestLineNumber = 0; Unity.NumberOfTests = 0; Unity.TestFailures = 0; Unity.TestIgnores = 0; Unity.CurrentTestFailed = 0; Unity.CurrentTestIgnored = 0; UNITY_CLR_DETAILS(); UNITY_OUTPUT_START(); } /*-----------------------------------------------*/ int UnityEnd(void) { UNITY_PRINT_EOL(); UnityPrint(UnityStrBreaker); UNITY_PRINT_EOL(); UnityPrintNumber((_U_SINT)(Unity.NumberOfTests)); UnityPrint(UnityStrResultsTests); UnityPrintNumber((_U_SINT)(Unity.TestFailures)); UnityPrint(UnityStrResultsFailures); UnityPrintNumber((_U_SINT)(Unity.TestIgnores)); UnityPrint(UnityStrResultsIgnored); UNITY_PRINT_EOL(); if (Unity.TestFailures == 0U) { UnityPrintOk(); } else { UnityPrintFail(); #ifdef UNITY_DIFFERENTIATE_FINAL_FAIL UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D'); #endif } UNITY_PRINT_EOL(); UNITY_FLUSH_CALL(); UNITY_OUTPUT_COMPLETE(); return (int)(Unity.TestFailures); } /*-----------------------------------------------*/
drbartling/fast_int_to_str
unity/unity.c
C
mit
40,971
package resources; @FunctionalInterface public interface ResourceChangeListener<T> { /** * Resource change event handler. * * @param resource * updated resource */ void process(T resource); }
csutorasa/spring
CommonImpl/src/main/java/resources/ResourceChangeListener.java
Java
mit
237
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" // Not exported @interface OAXDrawable : NSObject { } + (id)readDrawablesFromXmlNode:(struct _xmlNode *)arg1 inNamespace:(id)arg2 drawingState:(id)arg3; + (id)readDrawableFromXmlNode:(struct _xmlNode *)arg1 inNamespace:(id)arg2 drawingState:(id)arg3; + (void)readNonVisualPropertiesFromDrawableXmlNode:(struct _xmlNode *)arg1 inNamespace:(id)arg2 visualNodeName:(const char *)arg3 toDrawable:(id)arg4 drawingState:(id)arg5; @end
matthewsot/CocoaSharp
Headers/PrivateFrameworks/OfficeImport/OAXDrawable.h
C
mit
596
using System; using System.Reflection; using CWrapped; namespace MinecraftClient.Data.EntityMetadata { public abstract class MetadataEntry { public abstract byte Identifier { get; } public abstract string FriendlyName { get; } internal byte Index { get; set; } public abstract void FromStream(ref Wrapped stream); public abstract void WriteTo(ref Wrapped stream, byte index); public static implicit operator MetadataEntry(byte value) { return new MetadataByte(value); } public static implicit operator MetadataEntry(short value) { return new MetadataShort(value); } public static implicit operator MetadataEntry(int value) { return new MetadataInt(value); } public static implicit operator MetadataEntry(float value) { return new MetadataFloat(value); } public static implicit operator MetadataEntry(string value) { return new MetadataString(value); } public static implicit operator MetadataEntry(ItemStack value) { return new MetadataSlot(value); } protected byte GetKey(byte index) { Index = index; // Cheat to get this for ToString return (byte)((Identifier << 5) | (index & 0x1F)); } public override string ToString() { Type type = GetType(); FieldInfo[] fields = type.GetFields(); string result = FriendlyName + "[" + Index + "]: "; if (fields.Length != 0) result += fields[0].GetValue(this).ToString(); return result; } } }
Aragas/minelib.net
Data/EntityMetadata/MetadataEntry.cs
C#
mit
1,760
//------------------------------------------------------------------------------ // <auto-generated> // Este código se generó a partir de una plantilla. // // Los cambios manuales en este archivo pueden causar un comportamiento inesperado de la aplicación. // Los cambios manuales en este archivo se sobrescribirán si se regenera el código. // </auto-generated> //------------------------------------------------------------------------------ namespace Infodinamica.Framework.Test.Data { using System; using System.Collections.Generic; public partial class Comments { public int CommentsId { get; set; } public int BlogId { get; set; } public int UserId { get; set; } public string Comment { get; set; } public System.DateTime CreateDate { get; set; } public virtual Blog Blog { get; set; } public virtual User User { get; set; } } }
Infodinamica/repository
src/Infodinamica.Framework.Repository/Infodinamica.Framework.Test/Data/Comments.cs
C#
mit
935
angular.module("App", []); angular .module("App") .controller("dropController",dropController) .controller("menuController",menuController) .service("loginService", loginService ); function dropController($scope, loginService){ $scope.aberto = true; $scope.logChange = function( $event ) { $event.preventDefault() $scope.aberto = !$scope.aberto; }; $scope.logoff = function( id ){ loginService.logoff(id); } } function menuController( $scope ){ $scope.aberto = false; $scope.menus = ["paginas","log","usuarios"]; $scope.clickMenu = function( $event ){ $event.preventDefault() $scope.aberto = !$scope.aberto; } } function loginService($http) { function handleSuccess(res) { if( res.data.status == 1 ) location.reload(); } function handleError(error) { return function () { return { success: false, message: error }; }; } this.logoff = function( id ) { var p = $http({ url:'/app/app-admin/app-ajax.php', method:'POST', data: $.param({ controle: "login", metodo: "logout", id: id }), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }); p.then(handleSuccess, handleError('Error creating user')); }; return this; } dropController.$inject = ['$scope', 'loginService']; loginService.$inject = ['$http'];
DanCassiano/App
app-admin/assets/js/app.js
JavaScript
mit
1,386
package twitchtv import ( "fmt" "net/url" "github.com/zquestz/s/providers" ) func init() { providers.AddProvider("twitchtv", &Twitchtv{}) } // Twitchtv adheres to the Provider interface. type Twitchtv struct { } // BuildURI generates a search URL for Twitchtv. func (p *Twitchtv) BuildURI(q string) string { return fmt.Sprintf("https://www.twitch.tv/search?query=%s", url.QueryEscape(q)) }
streeck/s
providers/twitchtv/twitchtv.go
GO
mit
400
--- layout: post title: Project Charter Procurement Template image: img/project-charter-template.png description: Procurement uses the project charter template to document and track cost reduction initiatives. published: true --- ## Procurement Project Charter for Cost Reduction Projects Procurement uses the project charter template to document and track cost reduction initiatives. Each buyer in the procurement department completes project charters. The project charter slides are typically collated into a purchasing department presentation. The template file format is Microsoft PowerPoint. Effective procurement teams organize and prioritize key intiatives with the Excel project charter template. Focusing on key priorities enables purchasing power. This is week eight of ten free procurement templates in ten weeks. Be sure to check blog posts for free procurement templates from weeks one through seven. Week 1: [sourcing strategy]({{site.baseurl}}/2017/04/07/sourcing-strategy-template) Week 2: [request for quotation rfq]({{site.baseurl}}/2017/04/14/request-for-quotation-template) Week 3: [supplier cost improvement]({{site.baseurl}}/2017/04/21/supplier-cost-improvement-template) Week 4: [flexible supplier scorecard]({{site.baseurl}}/2017/04/28/flexible-supplier-scorecard-template) Week 5: [supplier risk assessment]({{site.baseurl}}/2017/05/05/risk-assessment-template) Week 6: [supplier financial viability]({{site.baseurl}}/2017/05/12/supplier-financial-viability-template) Week 7: [inbound transportation survey]({{site.baseurl}}/2017/05/19/inbound-transportation-survey-template) <!--more--> In a one-page summary, the project charter template provides information about key cost reduction initiatives. Key areas to complete on the project charter template include: - **Team objectives** - state the key project objectives; e.g. sourcing strategy for corrugated packaging category. - **Savings Estimates** - provide estimated and target savings. - **Approach** - provide the approach to be used to achieve the team objectives. An approach could be supplier consolidation or alternate supplier qualification to increase competition. - **Scope** - define the specific focus of the project along with addressable spend. - **Key Milestone** - state the key tasks and expected completion dates - **Project Team** - identify the project resources. - **Project Stakeholders** - indicate which key stakeholders this cost reduction project could impact. - **Project Sponsor** - name the sponsor of the project. I believe this template really helps procurement define key aspects of cost reduction projects. Resources are identified along with the project sponsor and key stakeholder alignment. Here is a screen shot of the project charter template for procurement: <div style="text-align:left" markdown="1"> ![project-charter-template]({{site.baseurl}}/img/project-charter-template.png) </div> To download this free procurement template go to this link; <a href="https://github.com/purchasingtoolpak/purchasingtoolpak/raw/master/supplier-integration/project-charter-template.pptx">project charter template</a>. You can download all the free procurement templates at this <a href="http://purchasingtoolpak.com/#download-procurement-templates">link</a>. If you have questions or comments please contact me through this link: [http://purchasingtoolpak.com/#contact](http://purchasingtoolpak.com/#contact-purchasing-toolpak "Contact Purchasing Toolpak")
purchasingtoolpak/purchasing-toolpak-blog
_posts/2017-05-23-project-charter-template.md
Markdown
mit
3,533
WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://travis-ci.org/Eric-Guo/wechat.svg)](https://travis-ci.org/Eric-Guo/wechat) [![Maintainability](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/maintainability)](https://codeclimate.com/github/Eric-Guo/wechat/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/test_coverage)](https://codeclimate.com/github/Eric-Guo/wechat/test_coverage) ====== [![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Eric-Guo/wechat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [中文文档 Chinese document](/README-CN.md) [Wechat](http://www.wechat.com/) is a Chinese multi-purpose messaging, social media and mobile payment app developed by Tencent. It was first released in 2011, and by 2018 it was one of the world's largest standalone mobile apps by monthly active users, with over 1 billion monthly active users (902 million daily active users). (According to [wiki](https://en.wikipedia.org/wiki/WeChat)) WeChat gem helps Rails developers integrate [WeChat Official Accounts Platform](https://mp.weixin.qq.com/) and [Wechat Enterprise](https://qy.weixin.qq.com) easily, including features: - [Sending message](http://qydev.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF) API(can be both accessed via console or rails server) - [Receiving message](http://qydev.weixin.qq.com/wiki/index.php?title=%E6%8E%A5%E6%94%B6%E6%B6%88%E6%81%AF%E4%B8%8E%E4%BA%8B%E4%BB%B6)(rails server is required to be running) - [Wechat JS-SDK](http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BE%AE%E4%BF%A1JS%E6%8E%A5%E5%8F%A3) config signature - OAuth 2.0 authentication - Record session when receiving message from user (Optional) `wechat` command shares the same API in console, so you can interact with wechat server quickly without starting up web environment/code. A responder DSL can be used in Rails controller, which gives an event based interface to handle messages sent by end users. If Wechat OAuth 2.0 is required by your app, [omniauth-wechat-oauth2](https://github.com/skinnyworm/omniauth-wechat-oauth2) is recommended in order to apply [devise authentication](https://github.com/plataformatec/devise). If tencent's [weui](https://github.com/weui/weui) UI style is adoped in your project, gem [weui-rails](https://github.com/Eric-Guo/weui-rails) is available for you. For web page only wechat application, please use [`wechat_api`](#wechat_api---rails-controller-wechat-api), which only contains web features, compared with traditional message type [`wechat_responder`](#wechat_responder---rails-responder-controller-dsl). There is a more complete [wechat-starter](https://github.com/goofansu/wechat-starter) demo available, which futher includes the payment SDK feature. ## Installation Use `gem install` ``` gem install "wechat" ``` Or add it to your app's `Gemfile`: ``` gem 'wechat' ``` Run the following command to install it: ```console bundle install ``` Run the generator: ```console rails generate wechat:install ``` `rails g wechat:install` will generate the initial `wechat.yml` configuration file, including an sample wechat controller and corresponding routes. Enable session record: ```console rails g wechat:session rake db:migrate ``` Enabling session will generate two files in Rails folder, you can add more columns to *wechat_session* table and add declaration to link to users table, it's also possible to store data directly in **hash_store**. If you are using PostgreSQL, using [hstore](http://guides.rubyonrails.org/active_record_postgresql.html#hstore)/json maybe better, but the best way is to add a dedicated column to record the data (the Rails way). Using Redis to store wechat token and ticket: ```console rails g wechat:redis_store ``` Redis storage supports Rails application running in multiple servers. It is recommended to use default file storage if there is only one single server. Besides that, `wechat` command won't read token/ticket stored in Redis. Enable database wechat configurations: ```console rails g wechat:config rake db:migrate ``` After running the migration, a `wechat_configs` table will be created that allows storage of multiple wechat accounts. ## Configuration #### Configure wechat for the first time Make sure to finish all the setup on rails side first, then submit those setting to Tencent wechat management website. Otherwise, wechat will raise error. URL address for wechat created by running `rails g wechat:install` is `http://your-server.com/wechat` How to setup appid/corpid and secret see below section. #### Configure for command line To use standalone `wechat` command, you need to create configuration file `~/.wechat.yml` and include content below for public account. The `access_token` will be written to file `/var/tmp/wechat_access_token`. ``` appid: "my_appid" secret: "my_secret" access_token: "/var/tmp/wechat_access_token" ``` For enterprise account, you need to use `corpid` instead of `appid` as enterprise account supports multiply application (Tencent calls them agents) in one enterprise account. Obtaining the `corpsecret` is a little bit tricky, must be created at management mode->privilege setting and create any of management group to obtain. Due to Tencent currently only providing Chinese interface for their management console, it's highly recommended you find a colleague knowing Mandarin to help you to obtain the `corpsecret`. Windows users need to store `.wechat.yml` at `C:/Users/[user_name]/` (replace with your user name), also pay attention to the direction of folder separator. ``` corpid: "my_appid" corpsecret: "my_secret" agentid: 1 # Integer, which can be obtained from application settings access_token: "C:/Users/[user_name]/wechat_access_token" ``` #### Configure for Rails Rails configuration file supports different environment similar to database.yml, after running `rails generate wechat:install` you can find configuration file at `config/wechat.yml` Public account configuration example: ``` default: &default appid: "app_id" secret: "app_secret" token: "app_token" access_token: "/var/tmp/wechat_access_token" jsapi_ticket: "/var/tmp/wechat_jsapi_ticket" production: appid: <%= ENV['WECHAT_APPID'] %> secret: <%= ENV['WECHAT_APP_SECRET'] %> token: <%= ENV['WECHAT_TOKEN'] %> access_token: <%= ENV['WECHAT_ACCESS_TOKEN'] %> jsapi_ticket: <%= ENV['WECHAT_JSAPI_TICKET'] %> oauth2_cookie_duration: <%= ENV['WECHAT_OAUTH2_COOKIE_DURATION'] %> # seconds development: <<: *default trusted_domain_fullname: "http://your_dev.proxy.qqbrowser.cc" test: <<: *default ``` Although it's optional for public account, but highly recommended to enable encrypt mode by adding these two items to `wechat.yml` ``` default: &default encrypt_mode: true encoding_aes_key: "my_encoding_aes_key" ``` Enterprise account must use encrypt mode (`encrypt_mode: true` is on by default, no need to configure). The `token` and `encoding_aes_key` can be obtained from management console -> one of the agent application -> Mode selection, select callback mode and get/set. ``` default: &default corpid: "corpid" corpsecret: "corpsecret" agentid: 1 access_token: "C:/Users/[user_name]/wechat_access_token" token: "" encoding_aes_key: "" jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket" production: corpid: <%= ENV['WECHAT_CORPID'] %> corpsecret: <%= ENV['WECHAT_CORPSECRET'] %> agentid: <%= ENV['WECHAT_AGENTID'] %> access_token: <%= ENV['WECHAT_ACCESS_TOKEN'] %> token: <%= ENV['WECHAT_TOKEN'] %> timeout: 30, skip_verify_ssl: true # not recommend encoding_aes_key: <%= ENV['WECHAT_ENCODING_AES_KEY'] %> jsapi_ticket: <%= ENV['WECHAT_JSAPI_TICKET'] %> oauth2_cookie_duration: <%= ENV['WECHAT_OAUTH2_COOKIE_DURATION'] %> development: <<: *default trusted_domain_fullname: "http://your_dev.proxy.qqbrowser.cc" test: <<: *default # Multiple Accounts # # wx2_development: # <<: *default # appid: "my_appid" # secret: "my_secret" # access_token: "tmp/wechat_access_token2" # jsapi_ticket: "tmp/wechat_jsapi_ticket2" # # wx2_test: # <<: *default # appid: "my_appid" # secret: "my_secret" # # wx2_production: # <<: *default # appid: "my_appid" # secret: "my_secret" ``` Notes about supporting multiple accounts of `WeChat Official Accounts Platform` / `WeChat Enterprise` (for example, adding account `wx2`): * Configuration for multiple accounts is similar to multi-database configuration in `config/database.yml`, where `development`, `test`, `production` segments are the default configuration, one needs to add `wx2_development`, `wx2_test`, `wx2_production` in order to add additional account named `wx2`. * Declaration of additional `wechat_responder`: ```ruby wechat_responder account: :wx2 ``` * Use `Wechat.api` or `Wechat.api(:default)` to represent the default wechat api. Use `Wechat.api(:wx2)` to call for wechat api of account `wx2`. * When using `Wechat command line`, one can switch to another wechat account by adding optional parameters `-a ACCOUNT [--account=ACCOUNT]`. For details about supporting multiple accounts, please check [PR 150](https://github.com/Eric-Guo/wechat/pull/150) For wechat mini program, can specified by the item `type`: ```yaml # Mini Program Accounts mini_development: <<: *default appid: "my_appid" secret: "my_secret" # `mp` is short for **mini program** type: 'mp' ``` #### Database wechat account configuration After enabling database account configuration, the following table will be created: Attribute | Type | Annotation ---- | ---- | ---- environment | string | Required. Environment of account configuration. Typical values are: `production`, `development` and `test`. For example, a `production` config will only be available in `production`. Default to `development`. account | string | Required. Custom wechat account name. Account names must be unique within each environment. enabled | boolean | Required. Whether this configuration is activated. Default to `true`. appid | string | Public account id. Either this attribute or `corpid` must be specified. secret | string | Public account configuration. Required when `appid` exists. corpid | string | Corp account id. Either this attribute or `appid` must be specified. corpsecret | string | Corp account configuration. Required when `corpid` exists. agentid | integer | Corp account configuration. Required when `corpid` exists. encrypt_mode | boolean | encoding_aes_key | string | Required when `encrypt_mode` is `true`. token | string | Required. access_token | string | Required. Path to `access token` storage file. jsapi_ticket | string | Required. Path to `jsapi ticket` storage file. skip_verify_ssl | boolean timeout | integer | Default to 20. trusted_domain_fullname | string | After updating database account configurations, you need to restart the server, or call `Wechat.reload_config!` to reload the updates. ##### Configure priority Running `wechat` command in the root folder of Rails application will be using the Rails configuration first (`default` section), if can not find it, will relay on `~\.wechat.yml`, such behavior enables managing more wechat public account and enterprise account without changing your home `~\.wechat.yml` file. When database account configuration is enabled, database configurations will be loaded after `yml` configuration file or environment parameters. When configurations with the same account name exist in both database and `yml` file or environment parameter, the one in the database will take precedence. ##### Wechat server timeout setting Stability varies for Tencent wechat server, so setting a long timeout may be needed, default is 20 seconds if not set. ##### Skip the SSL verification SSL Certification can also be corrupted for some reason in China, [it's reported](http://qydev.weixin.qq.com/qa/index.php?qa=11037) and if it happens to you, you can set `skip_verify_ssl: true`. (not recommend) #### Configure individual responder with different appid Sometimes, you may want to host more than one enterprise/public wechat account in one Rails application, so you can provide this configuration info when calling `wechat_responder` or `wechat_api` ```ruby class WechatFirstController < ActionController::Base wechat_responder account: :new_account, account_from_request: Proc.new{ |request| request.params[:wechat] } on :text, with:"help", respond: "help content" end ``` Or you can provide full list of options. ```ruby class WechatFirstController < ActionController::Base wechat_responder appid: "app1", secret: "secret1", token: "token1", access_token: Rails.root.join("tmp/access_token1"), account_from_request: Proc.new{ |request| request.params[:wechat] } on :text, with:"help", respond: "help content" end ``` `account_from_request` is a `Proc` that takes in `request` as its parameter, and returns the corresponding wechat account name. In the above examples, `controller` will choose the account based on the `wechat` parameter passed in the `request`. If `account_from_request` is not specified, or this `Proc` evaluates to `nil`, configuration specified by `account` or the full list of options will be used. #### JS-SDK helper JS-SDK gives you control over Wechat App behavior in html, by injecting a config signature, helper `wechat_config_js` does that in a simple way: To make wechat_config_js work, you need to put [`wechat_api`](#wechat_api---rails-controller-wechat-api) or [`wechat_responder`](#wechat_responder---rails-responder-controller-dsl) at controller first. ```erb <body> <%= wechat_config_js debug: false, api: %w(hideMenuItems closeWindow) -%> <script type="application/javascript"> wx.ready(function() { wx.hideOptionMenu(); }); </script> <a href="javascript:wx.closeWindow();">Close</a> </body> ``` Configure the `trusted_domain_fullname` if you are in development mode and app is running behind a reverse proxy server, otherwise wechat gem won't be able to get the correct url to be signed later. #### OAuth2.0 authentication For public account, code below will get following user's info. ```ruby class CartController < ActionController::Base wechat_api def index wechat_oauth2 do |openid| @current_user = User.find_by(wechat_openid: openid) @articles = @current_user.articles end # specify account_name to use arbitrary wechat account configuration # wechat_oauth2('snsapi_base', nil, account_name) do |openid| # ... # end end end ``` For enterprise account, code below will get enterprise member's userinfo. ```ruby class WechatsController < ActionController::Base layout 'wechat' wechat_responder def apply_new wechat_oauth2 do |userid| @current_user = User.find_by(wechat_userid: userid) @apply = Apply.new @apply.user_id = @current_user.id end end end ``` `wechat_oauth2` already implements the necessary OAuth2.0 and cookie logic. userid defined as the enterprise member UserID. openid defined as the user who following the public account, also notice openid will be different for the same user for different following public accounts. Notice: * If you use `wechat_responder` in your controller, you cannot use `create` and `show` action in your controller, otherwise it will throw errors. * If you get *redirect_uri parameter error* message, make sure you set the correct callback url value in wechat management console with path *Development center / Webpage service / Webpage authorization for retrieving user basic information*. ## The API privilege wechat gems won't handle any privilege exceptions. (except token timeout, but it's not important to you as it's auto retry/recovery in gems internally), but Tencent will control a lot of privilege based on your public account type and certification, for more info please reference [official document](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433401084). ## Command line mode The available API is different between public account and enterprise account, so wechat gems provide different set of command. Feel safe if you can not read Chinese in the comments, it's kept there in order to copy & find in the official documentation easier. #### Public account command line ``` $ wechat Wechat Public Account commands: wechat callbackip # 获取微信服务器IP地址 wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息 wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息 wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息 wechat custom_text [OPENID, TEXT_MESSAGE] # 发送文字客服消息 wechat custom_video [OPENID, VIDEO_PATH] # 发送视频客服消息 wechat custom_voice [OPENID, VOICE_PATH] # 发送语音客服消息 wechat customservice_getonlinekflist # 获取在线客服接待信息 wechat group_create [GROUP_NAME] # 创建分组 wechat group_delete [GROUP_ID] # 删除分组 wechat group_update [GROUP_ID, NEW_GROUP_NAME] # 修改分组名 wechat groups # 查询所有分组 wechat material [MEDIA_ID, PATH] # 永久媒体下载 wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传 wechat material_count # 获取永久素材总数 wechat material_delete [MEDIA_ID] # 删除永久素材 wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表 wechat media [MEDIA_ID, PATH] # 媒体下载 wechat media_hq [MEDIA_ID, PATH] # 高清音频下载 wechat media_create [MEDIA_TYPE, PATH] # 媒体上传 wechat media_uploadimg [IMAGE_PATH] # 上传图文消息内的图片 wechat media_uploadnews [MPNEWS_YAML_PATH] # 上传图文消息素材 wechat menu # 当前菜单 wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH] # 创建个性化菜单 wechat menu_create [MENU_YAML_PATH] # 创建菜单 wechat menu_delconditional [MENU_ID] # 删除个性化菜单 wechat menu_delete # 删除菜单 wechat menu_trymatch [USER_ID] # 测试个性化菜单匹配结果 wechat message_mass_delete [MSG_ID] # 删除群发消息 wechat message_mass_get [MSG_ID] # 查询群发消息发送状态 wechat message_mass_preview [WX_NAME, MPNEWS_MEDIA_ID] # 预览图文消息素材 wechat qrcode_create_limit_scene [SCENE_ID_OR_STR] # 请求永久二维码 wechat qrcode_create_scene [SCENE_ID_OR_STR, EXPIRE_SECONDS] # 请求临时二维码 wechat qrcode_download [TICKET, QR_CODE_PIC_PATH] # 通过ticket下载二维码 wechat short_url [LONG_URL] # 长链接转短链接 wechat tag [TAGID] # 获取标签下粉丝列表 wechat tag_add_user [TAG_ID, OPEN_IDS] # 批量为用户打标签 wechat tag_create [TAGNAME, TAG_ID] # 创建标签 wechat tag_del_user [TAG_ID, OPEN_IDS] # 批量为用户取消标签 wechat tag_delete [TAG_ID] # 删除标签 wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字 wechat tags # 获取所有标签 wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口 wechat user [OPEN_ID] # 获取用户基本信息 wechat user_batchget [OPEN_ID_LIST] # 批量获取用户基本信息 wechat user_change_group [OPEN_ID, TO_GROUP_ID] # 移动用户分组 wechat user_group [OPEN_ID] # 查询用户所在分组 wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名 wechat users # 关注者列表 wechat wxacode_download [WXA_CODE_PIC_PATH, PATH, WIDTH] # 下载小程序码 wechat clear_quota # 接口调用次数清零 ``` #### Enterprise account command line ``` $ wechat Wechat Enterprise Account commands: wechat agent [AGENT_ID] # 获取企业号应用详情 wechat agent_list # 获取应用概况列表 wechat batch_job_result [JOB_ID] # 获取异步任务结果 wechat batch_replaceparty [BATCH_PARTY_CSV_MEDIA_ID] # 全量覆盖部门 wechat batch_replaceuser [BATCH_USER_CSV_MEDIA_ID] # 全量覆盖成员 wechat batch_syncuser [SYNC_USER_CSV_MEDIA_ID] # 增量更新成员 wechat callbackip # 获取微信服务器IP地址 wechat convert_to_openid [USER_ID] # userid转换成openid wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息 wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息 wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息 wechat custom_text [OPENID, TEXT_MESSAGE] # 发送文字客服消息 wechat custom_video [OPENID, VIDEO_PATH] # 发送视频客服消息 wechat custom_voice [OPENID, VOICE_PATH] # 发送语音客服消息 wechat department [DEPARTMENT_ID] # 获取部门列表 wechat department_create [NAME, PARENT_ID] # 创建部门 wechat department_delete [DEPARTMENT_ID] # 删除部门 wechat department_update [DEPARTMENT_ID, NAME] # 更新部门 wechat getusercumulate [BEGIN_DATE, END_DATE] # 获取累计用户数据 wechat getusersummary [BEGIN_DATE, END_DATE] # 获取用户增减数据 wechat invite_user [USER_ID] # 邀请成员关注 wechat material [MEDIA_ID, PATH] # 永久媒体下载 wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传 wechat material_count # 获取永久素材总数 wechat material_delete [MEDIA_ID] # 删除永久素材 wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表 wechat media [MEDIA_ID, PATH] # 媒体下载 wechat media_create [MEDIA_TYPE, PATH] # 媒体上传 wechat media_uploadimg [IMAGE_PATH] # 上传图文消息内的图片 wechat menu # 当前菜单 wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH] # 创建个性化菜单 wechat menu_create [MENU_YAML_PATH] # 创建菜单 wechat menu_delconditional [MENU_ID] # 删除个性化菜单 wechat menu_delete # 删除菜单 wechat menu_trymatch [USER_ID] # 测试个性化菜单匹配结果 wechat message_send [OPENID, TEXT_MESSAGE] # 发送文字消息 wechat qrcode_download [TICKET, QR_CODE_PIC_PATH] # 通过ticket下载二维码 wechat tag [TAG_ID] # 获取标签成员 wechat tag_add_department [TAG_ID, PARTY_IDS] # 增加标签部门 wechat tag_add_user [TAG_ID, USER_IDS] # 增加标签成员 wechat tag_create [TAGNAME, TAG_ID] # 创建标签 wechat tag_del_department [TAG_ID, PARTY_IDS] # 删除标签部门 wechat tag_del_user [TAG_ID, USER_IDS] # 删除标签成员 wechat tag_delete [TAG_ID] # 删除标签 wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字 wechat tags # 获取所有标签 wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口 wechat upload_replaceparty [BATCH_PARTY_CSV_PATH] # 上传文件方式全量覆盖部门 wechat upload_replaceuser [BATCH_USER_CSV_PATH] # 上传文件方式全量覆盖成员 wechat user [OPEN_ID] # 获取用户基本信息 wechat user_batchdelete [USER_ID_LIST] # 批量删除成员 wechat user_create [USER_ID, NAME] # 创建成员 wechat user_delete [USER_ID] # 删除成员 wechat user_list [DEPARTMENT_ID] # 获取部门成员详情 wechat user_simplelist [DEPARTMENT_ID] # 获取部门成员 wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名 ``` ### Command line usage demo (partially) ##### Fetch all users open id ``` $ wechat users {"total"=>4, "count"=>4, "data"=>{"openid"=>["oCfEht9***********", "oCfEhtwqa***********", "oCfEht9oMCqGo***********", "oCfEht_81H5o2***********"]}, "next_openid"=>"oCfEht_81H5o2***********"} ``` ##### Fetch user info ``` $ wechat user "oCfEht9***********" {"subscribe"=>1, "openid"=>"oCfEht9***********", "nickname"=>"Nickname", "sex"=>1, "language"=>"zh_CN", "city"=>"徐汇", "province"=>"上海", "country"=>"中国", "headimgurl"=>"http://wx.qlogo.cn/mmopen/ajNVdqHZLLBd0SG8NjV3UpXZuiaGGPDcaKHebTKiaTyof*********/0", "subscribe_time"=>1395715239} ``` ##### Fetch menu ``` $ wechat menu {"menu"=>{"button"=>[{"type"=>"view", "name"=>"保护的", "url"=>"http://***/protected", "sub_button"=>[]}, {"type"=>"view", "name"=>"公开的", "url"=>"http://***", "sub_button"=>[]}]}} ``` ##### Menu create Running command `rails g wechat:menu` to generate a menu definition yaml file: ``` button: - name: "Want" sub_button: - type: "scancode_waitmsg" name: "绑定用餐二维码" key: "BINDING_QR_CODE" - type: "click" name: "预订午餐" key: "BOOK_LUNCH" - type: "miniprogram" name: "小程序示例" url: "http://ericguo.com/" appid: "wx1234567890" pagepath: "pages/index" - name: "Query" sub_button: - type: "click" name: "进出记录" key: "BADGE_IN_OUT" - type: "click" name: "年假余额" key: "ANNUAL_LEAVE" - type: "view" name: "About" url: "http://blog.cloud-mes.com/" ``` Running command below to upload the menu: ``` $ wechat menu_create menu.yaml ``` Caution: make sure you have management privilege for this application, otherwise you will get [60011](http://qydev.weixin.qq.com/wiki/index.php?title=%E5%85%A8%E5%B1%80%E8%BF%94%E5%9B%9E%E7%A0%81%E8%AF%B4%E6%98%8E) error. ##### Send custom news Sending custom_news should also be defined as a yaml file, like `articles.yml` ``` articles: - title: "习近平在布鲁日欧洲学院演讲" description: "新华网比利时布鲁日4月1日电 国家主席习近平1日在比利时布鲁日欧洲学院发表重要演讲" url: "http://news.sina.com.cn/c/2014-04-01/232629843387.shtml" pic_url: "http://i3.sinaimg.cn/dy/c/2014-04-01/1396366518_bYays1.jpg" ``` After that, you can run this command: ``` $ wechat custom_news oCfEht9oM*********** articles.yml ``` ##### Send template message Sending template message via yaml file is similar, too, define `template.yml` and content is just the template content. ``` template: template_id: "o64KQ62_xxxxxxxxxxxxxxx-Qz-MlNcRKteq8" url: "http://weixin.qq.com/download" topcolor: "#FF0000" data: first: value: "Hello, you successfully registered" color: "#0A0A0A" keynote1: value: "5km Health Running" color: "#CCCCCC" keynote2: value: "2014-09-16" color: "#CCCCCC" keynote3: value: "Centry Park, Pudong, Shanghai" color: "#CCCCCC" remark: value: "Welcome back" color: "#173177" ``` After that, you can run this command: ``` $ wechat template_message oCfEht9oM*********** template.yml ``` In code: ```ruby template = YAML.load(File.read(template_yaml_path)) Wechat.api.template_message_send Wechat::Message.to(openid).template(template["template"]) ``` If using wechat_api or wechat_responder in controller, can also use wechat as shortcut (supports multi account): ```ruby template = YAML.load(File.read(template_yaml_path)) wechat.template_message_send Wechat::Message.to(openid).template(template["template"]) ``` ## wechat_api - Rails Controller Wechat API Although user can always access all wechat features via Wechat.api, but it's highly recommended to use `wechat` directly in the controller. It's not only mandatory required if you plan to support multi-account, it also helps to separate the wechat specific logic from the model layer. ```ruby class WechatReportsController < ApplicationController wechat_api layout 'wechat' def index @lots = Lot.with_preloading.wip_lot end end ``` ## Using wechat api at ActiveJob/Rake tasks Using `Wechat.api` to access the wechat api function at any place. ## Checking the signature Using `Wechat.decrypt(encrypted_data,session_key, iv)` to decode the data. via. [Signature Checking](https://developers.weixin.qq.com/miniprogram/dev/api/signature.html) ## wechat_responder - Rails Responder Controller DSL In order to respond to the message user sent, Rails developer needs to create a wechat responder controller and define the routing in `routes.rb` ```ruby resource :wechat, only: [:show, :create] ``` So the ActionController should be defined like below: ```ruby class WechatsController < ActionController::Base wechat_responder # default text responder when no other match on :text do |request, content| request.reply.text "echo: #{content}" # Just echo end # When receive 'help', will trigger this responder on :text, with: 'help' do |request| request.reply.text 'help content' end # When receive '<n>news', will match and will get count as <n> as parameter on :text, with: /^(\d+) news$/ do |request, count| # Wechat article can only contain max 8 items, large than 8 will be dropped. news = (1..count.to_i).each_with_object([]) { |n, memo| memo << { title: 'News title', content: "No. #{n} news content" } } request.reply.news(news) do |article, n, index| # article is return object article.item title: "#{index} #{n[:title]}", description: n[:content], pic_url: 'http://www.baidu.com/img/bdlogo.gif', url: 'http://www.baidu.com/' end end on :event, with: 'subscribe' do |request| request.reply.text "#{request[:FromUserName]} subscribe now" end # When unsubscribe user scan qrcode qrscene_xxxxxx to subscribe in public account # notice user will subscribe public account at the same time, so wechat won't trigger subscribe event anymore on :scan, with: 'qrscene_xxxxxx' do |request, ticket| request.reply.text "Unsubscribe user #{request[:FromUserName]} Ticket #{ticket}" end # When subscribe user scan scene_id in public account on :scan, with: 'scene_id' do |request, ticket| request.reply.text "Subscribe user #{request[:FromUserName]} Ticket #{ticket}" end # When no any on :scan responder can match subscribe user scanned scene_id on :event, with: 'scan' do |request| if request[:EventKey].present? request.reply.text "event scan got EventKey #{request[:EventKey]} Ticket #{request[:Ticket]}" end end # When enterprise user press menu BINDING_QR_CODE and success to scan bar code on :scan, with: 'BINDING_QR_CODE' do |request, scan_result, scan_type| request.reply.text "User #{request[:FromUserName]} ScanResult #{scan_result} ScanType #{scan_type}" end # Except QR code, wechat can also scan CODE_39 bar code in enterprise account on :scan, with: 'BINDING_BARCODE' do |message, scan_result| if scan_result.start_with? 'CODE_39,' message.reply.text "User: #{message[:FromUserName]} scan barcode, result is #{scan_result.split(',')[1]}" end end # When user clicks the menu button on :click, with: 'BOOK_LUNCH' do |request, key| request.reply.text "User: #{request[:FromUserName]} click #{key}" end # When user views URL in the menu button on :view, with: 'http://wechat.somewhere.com/view_url' do |request, view| request.reply.text "#{request[:FromUserName]} view #{view}" end # When user sends an image on :image do |request| request.reply.image(request[:MediaId]) # Echo the sent image to user end # When user sends a voice on :voice do |request| request.reply.voice(request[:MediaId]) # Echo the sent voice to user end # When user sends a video on :video do |request| nickname = wechat.user(request[:FromUserName])['nickname'] # Call wechat api to get sender nickname request.reply.video(request[:MediaId], title: 'Echo', description: "Got #{nickname} sent video") # Echo the sent video to user end # When user sends location message with label on :label_location do |request| request.reply.text("Label: #{request[:Label]} Location_X: #{request[:Location_X]} Location_Y: #{request[:Location_Y]} Scale: #{request[:Scale]}") end # When user sends location on :location do |request| request.reply.text("Latitude: #{request[:Latitude]} Longitude: #{request[:Longitude]} Precision: #{request[:Precision]}") end on :event, with: 'unsubscribe' do |request| request.reply.success # user can not receive this message end # When user enters the app / agent app on :event, with: 'enter_agent' do |request| request.reply.text "#{request[:FromUserName]} enter agent app now" end # When batch job "create/update user (incremental)" is finished. on :batch_job, with: 'sync_user' do |request, batch_job| request.reply.text "sync_user job #{batch_job[:JobId]} finished, return code #{batch_job[:ErrCode]}, return message #{batch_job[:ErrMsg]}" end # When batch job "replace user (full sync)" is finished. on :batch_job, with: 'replace_user' do |request, batch_job| request.reply.text "replace_user job #{batch_job[:JobId]} finished, return code #{batch_job[:ErrCode]}, return message #{batch_job[:ErrMsg]}" end # When batch job "invite user" is finished. on :batch_job, with: 'invite_user' do |request, batch_job| request.reply.text "invite_user job #{batch_job[:JobId]} finished, return code #{batch_job[:ErrCode]}, return message #{batch_job[:ErrMsg]}" end # When batch job "replace department (full sync)" is finished. on :batch_job, with: 'replace_party' do |request, batch_job| request.reply.text "replace_party job #{batch_job[:JobId]} finished, return code #{batch_job[:ErrCode]}, return message #{batch_job[:ErrMsg]}" end # mass sent job finish result notification on :event, with: 'masssendjobfinish' do |request| # https://mp.weixin.qq.com/wiki?action=doc&id=mp1481187827_i0l21&t=0.03571905015619936#8 request.reply.success # request is XML result hash. end # If no match above will fallback to below on :fallback, respond: 'fallback message' end ``` So the important statement is only `wechat_responder`, all other is just a DSL: ``` on <message_type> do |message| message.reply.text "some text" end ``` The block code will be running to respond to user's message. Below are currently supported message_types: - :text text message, using `:with` to match text content like `on(:text, with:'help'){|message, content| ...}` - :image image message - :voice voice message - :shortvideo shortvideo message - :video video message - :label_location location message with label - :link link message - :event event message, using `:with` to match particular event, supports regular expression match similar to text message. - :click virtual event message, wechat still sends event message,but gems will map to menu click event. - :view virtual view message, wechat still sends event message,but gems will map to menu view page event. - :scan virtual scan message, wechat still sends event message, but gems will map to scan event. - :batch_job virtual batch job message - :location virtual location message - :fallback default message, when no other responder can handle incoming message, will be used as a fallback handler ### Transfer to customer service ```ruby class WechatsController < ActionController::Base # When no other responder can handle incoming message, will transfer to human customer service. on :fallback do |message| message.reply.transfer_customer_service end end ``` Caution: do not set default text responder if you want to use [multiply human customer service](http://dkf.qq.com/), other will lead text message can not transfer. ### Notifications * `wechat.responder.after_create` data includes request <Wechat::Message> and response <Wechat::Message>. Example: ```ruby ActiveSupport::Notifications.subscribe('wechat.responder.after_create') do |name, started, finished, unique_id, data| WechatLog.create request: data[:request], response: data[:response] end ``` ## Known Issues * Sometimes, enterprise account can not receive the menu message due to Tencent server unable to resolve DNS, so using IP as a callback URL is more stable, but it never happens for user sent text messages. * Enterprise batch "replace users" uses a CSV format file, but if you are using the downloaded template directly, it's [not working](http://qydev.weixin.qq.com/qa/index.php?qa=13978), must open the CSV file in Excel first, then save as CSV format again, seems Tencent only supports Excel "Save as CSV" file format. * If you using unicorn behind nginx and https, you need to set `trusted_domain_fullname` and point it to https, otherwise it will be http and will lead to invalid signature in the JS-SDK.
wolflee/wechat-rails
README.md
Markdown
mit
39,002
package lila.tournament import org.joda.time.{ DateTime, Duration, Interval } import ornicar.scalalib.Random import chess.{ Speed, Mode, StartingPosition } import lila.game.{ PovRef, PerfPicker } import lila.user.User case class Tournament( id: String, name: String, status: Status, system: System, clock: TournamentClock, minutes: Int, variant: chess.variant.Variant, position: StartingPosition, mode: Mode, `private`: Boolean, schedule: Option[Schedule], nbPlayers: Int, createdAt: DateTime, createdBy: String, startsAt: DateTime, winnerId: Option[String] = None) { def isCreated = status == Status.Created def isStarted = status == Status.Started def isFinished = status == Status.Finished def fullName = schedule.map(_.freq) match { case Some(Schedule.Freq.ExperimentalMarathon | Schedule.Freq.Marathon) => name case _ => s"$name $system" } def scheduled = schedule.isDefined def finishesAt = startsAt plusMinutes minutes def hasWaitedEnough = startsAt isBefore DateTime.now def secondsToStart = (startsAt.getSeconds - nowSeconds).toInt max 0 def secondsToFinish = (finishesAt.getSeconds - nowSeconds).toInt max 0 def isAlmostFinished = secondsToFinish < math.max(30, math.min(clock.limit / 2, 120)) def duration = new Duration(minutes * 60 * 1000) def interval = new Interval(startsAt, finishesAt) def overlaps(other: Tournament) = interval overlaps other.interval def speed = Speed(clock.chessClock.some) def perfType = PerfPicker.perfType(speed, variant, none) def perfLens = PerfPicker.mainOrDefault(speed, variant, none) def durationString = if (minutes < 60) s"${minutes}m" else s"${minutes / 60}h" + (if (minutes % 60 != 0) s" ${(minutes % 60)}m" else "") def berserkable = system.berserkable && clock.increment == 0 def clockStatus = secondsToFinish |> { s => "%02d:%02d".format(s / 60, s % 60) } } case class EnterableTournaments(tours: List[Tournament], scheduled: List[Tournament]) object Tournament { val minPlayers = 2 def make( createdBy: User, clock: TournamentClock, minutes: Int, system: System, variant: chess.variant.Variant, position: StartingPosition, mode: Mode, `private`: Boolean, waitMinutes: Int) = Tournament( id = Random nextStringUppercase 8, name = if (position.initial) RandomName() else position.shortName, status = Status.Created, system = system, clock = clock, minutes = minutes, createdBy = createdBy.id, createdAt = DateTime.now, nbPlayers = 0, variant = variant, position = position, mode = mode, `private` = `private`, schedule = None, startsAt = DateTime.now plusMinutes waitMinutes) def schedule(sched: Schedule, minutes: Int) = Tournament( id = Random nextStringUppercase 8, name = sched.name, status = Status.Created, system = System.default, clock = Schedule clockFor sched, minutes = minutes, createdBy = "lichess", createdAt = DateTime.now, nbPlayers = 0, variant = sched.variant, position = sched.position, mode = Mode.Rated, `private` = false, schedule = Some(sched), startsAt = sched.at) // To sort combined sequences of pairings and events. // This sorts all pairings/events in chronological order. Pairings without a timestamp // are assumed to have happened at the origin of time (i.e. before anything else). // object PairingEventOrdering extends Ordering[Either[Pairing, Event]] { // def compare(x: Either[Pairing, Event], y: Either[Pairing, Event]): Int = { // val ot1: Option[DateTime] = x.fold(_.date.some, e => Some(e.timestamp)) // val ot2: Option[DateTime] = y.fold(_.date.some, e => Some(e.timestamp)) // (ot1, ot2) match { // case (None, None) => 0 // case (None, Some(_)) => -1 // case (Some(_), None) => 1 // case (Some(t1), Some(t2)) => if (t1 equals t2) 0 else if (t1 isBefore t2) -1 else 1 // } // } // } }
Happy0/lila
modules/tournament/src/main/Tournament.scala
Scala
mit
4,078
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Copyright (c) 2013 UniversityCoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef __cplusplus # error This header can only be compiled as C++. #endif #ifndef __INCLUDED_PROTOCOL_H__ #define __INCLUDED_PROTOCOL_H__ #include "serialize.h" #include "netbase.h" #include <string> #include "uint256.h" extern bool fTestNet; static inline unsigned short GetDefaultPort(const bool testnet = fTestNet) { return testnet ? 45995 : 55996; } extern unsigned char pchMessageStart[4]; /** Message header. * (4) message start. * (12) command. * (4) size. * (4) checksum. */ class CMessageHeader { public: CMessageHeader(); CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn); std::string GetCommand() const; bool IsValid() const; IMPLEMENT_SERIALIZE ( READWRITE(FLATDATA(pchMessageStart)); READWRITE(FLATDATA(pchCommand)); READWRITE(nMessageSize); READWRITE(nChecksum); ) // TODO: make private (improves encapsulation) public: enum { MESSAGE_START_SIZE=sizeof(::pchMessageStart), COMMAND_SIZE=12, MESSAGE_SIZE_SIZE=sizeof(int), CHECKSUM_SIZE=sizeof(int), MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE, CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE }; char pchMessageStart[MESSAGE_START_SIZE]; char pchCommand[COMMAND_SIZE]; unsigned int nMessageSize; unsigned int nChecksum; }; /** nServices flags */ enum { NODE_NETWORK = (1 << 0), }; /** A CService with information about it as peer */ class CAddress : public CService { public: CAddress(); explicit CAddress(CService ipIn, uint64 nServicesIn=NODE_NETWORK); void Init(); IMPLEMENT_SERIALIZE ( CAddress* pthis = const_cast<CAddress*>(this); CService* pip = (CService*)pthis; if (fRead) pthis->Init(); if (nType & SER_DISK) READWRITE(nVersion); if ((nType & SER_DISK) || (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) READWRITE(nTime); READWRITE(nServices); READWRITE(*pip); ) void print() const; // TODO: make private (improves encapsulation) public: uint64 nServices; // disk and network only unsigned int nTime; // memory only int64 nLastTry; }; /** inv message data */ class CInv { public: CInv(); CInv(int typeIn, const uint256& hashIn); CInv(const std::string& strType, const uint256& hashIn); IMPLEMENT_SERIALIZE ( READWRITE(type); READWRITE(hash); ) friend bool operator<(const CInv& a, const CInv& b); bool IsKnownType() const; const char* GetCommand() const; std::string ToString() const; void print() const; // TODO: make private (improves encapsulation) public: int type; uint256 hash; }; #endif // __INCLUDED_PROTOCOL_H__
UniversityCoin/UniversityCoin
src/protocol.h
C
mit
3,472
// This file is part of node-lmdb, the Node.js binding for lmdb // Copyright (c) 2013 Timur Kristóf // Licensed to you under the terms of the MIT license // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #include "node-lmdb.h" using namespace v8; using namespace node; TxnWrap::TxnWrap(MDB_env *env, MDB_txn *txn) { this->env = env; this->txn = txn; } TxnWrap::~TxnWrap() { // Close if not closed already if (this->txn) { mdb_txn_abort(txn); this->ew->Unref(); } } NAN_METHOD(TxnWrap::ctor) { Nan::HandleScope scope; EnvWrap *ew = Nan::ObjectWrap::Unwrap<EnvWrap>(info[0]->ToObject()); int flags = 0; if (info[1]->IsObject()) { Local<Object> options = info[1]->ToObject(); // Get flags from options setFlagFromValue(&flags, MDB_RDONLY, "readOnly", false, options); } MDB_txn *txn; int rc = mdb_txn_begin(ew->env, nullptr, flags, &txn); if (rc != 0) { return Nan::ThrowError(mdb_strerror(rc)); } TxnWrap* tw = new TxnWrap(ew->env, txn); tw->ew = ew; tw->ew->Ref(); tw->Wrap(info.This()); NanReturnThis(); } NAN_METHOD(TxnWrap::commit) { Nan::HandleScope scope; TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This()); if (!tw->txn) { return Nan::ThrowError("The transaction is already closed."); } int rc = mdb_txn_commit(tw->txn); tw->txn = nullptr; tw->ew->Unref(); if (rc != 0) { return Nan::ThrowError(mdb_strerror(rc)); } return; } NAN_METHOD(TxnWrap::abort) { Nan::HandleScope scope; TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This()); if (!tw->txn) { return Nan::ThrowError("The transaction is already closed."); } mdb_txn_abort(tw->txn); tw->ew->Unref(); tw->txn = nullptr; return; } NAN_METHOD(TxnWrap::reset) { Nan::HandleScope scope; TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This()); if (!tw->txn) { return Nan::ThrowError("The transaction is already closed."); } mdb_txn_reset(tw->txn); return; } NAN_METHOD(TxnWrap::renew) { Nan::HandleScope scope; TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This()); if (!tw->txn) { return Nan::ThrowError("The transaction is already closed."); } int rc = mdb_txn_renew(tw->txn); if (rc != 0) { return Nan::ThrowError(mdb_strerror(rc)); } return; } Nan::NAN_METHOD_RETURN_TYPE TxnWrap::getCommon(Nan::NAN_METHOD_ARGS_TYPE info, Local<Value> (*successFunc)(MDB_val&)) { Nan::HandleScope scope; TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This()); DbiWrap *dw = Nan::ObjectWrap::Unwrap<DbiWrap>(info[0]->ToObject()); if (!tw->txn) { return Nan::ThrowError("The transaction is already closed."); } MDB_val key, data; void (*freeKey)(MDB_val&) = argToKey(info[1], key, dw->keyIsUint32); if (!freeKey) { return; } int rc = mdb_get(tw->txn, dw->dbi, &key, &data); freeKey(key); if (rc == MDB_NOTFOUND) { return info.GetReturnValue().Set(Nan::Null()); } else if (rc != 0) { return Nan::ThrowError(mdb_strerror(rc)); } else { return info.GetReturnValue().Set(successFunc(data)); } } NAN_METHOD(TxnWrap::getString) { return getCommon(info, valToString); } NAN_METHOD(TxnWrap::getStringUnsafe) { return getCommon(info, valToStringUnsafe); } NAN_METHOD(TxnWrap::getBinary) { return getCommon(info, valToBinary); } NAN_METHOD(TxnWrap::getBinaryUnsafe) { return getCommon(info, valToBinaryUnsafe); } NAN_METHOD(TxnWrap::getNumber) { return getCommon(info, valToNumber); } NAN_METHOD(TxnWrap::getBoolean) { return getCommon(info, valToBoolean); } Nan::NAN_METHOD_RETURN_TYPE TxnWrap::putCommon(Nan::NAN_METHOD_ARGS_TYPE info, void (*fillFunc)(Nan::NAN_METHOD_ARGS_TYPE info, MDB_val&), void (*freeData)(MDB_val&)) { Nan::HandleScope scope; TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This()); DbiWrap *dw = Nan::ObjectWrap::Unwrap<DbiWrap>(info[0]->ToObject()); if (!tw->txn) { return Nan::ThrowError("The transaction is already closed."); } int flags = 0; MDB_val key, data; void (*freeKey)(MDB_val&) = argToKey(info[1], key, dw->keyIsUint32); if (!freeKey) { return; } fillFunc(info, data); int rc = mdb_put(tw->txn, dw->dbi, &key, &data, flags); freeKey(key); freeData(data); if (rc != 0) { return Nan::ThrowError(mdb_strerror(rc)); } return; } NAN_METHOD(TxnWrap::putString) { return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void { CustomExternalStringResource::writeTo(info[2]->ToString(), &data); }, [](MDB_val &data) -> void { delete[] (uint16_t*)data.mv_data; }); } NAN_METHOD(TxnWrap::putBinary) { return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void { data.mv_size = node::Buffer::Length(info[2]); data.mv_data = node::Buffer::Data(info[2]); }, [](MDB_val &) -> void { // I think the data is owned by the node::Buffer so we don't need to free it - need to clarify }); } NAN_METHOD(TxnWrap::putNumber) { return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void { data.mv_size = sizeof(double); data.mv_data = new double; *((double*)data.mv_data) = info[2]->ToNumber(Nan::GetCurrentContext()).ToLocalChecked()->Value(); }, [](MDB_val &data) -> void { delete (double*)data.mv_data; }); } NAN_METHOD(TxnWrap::putBoolean) { return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void { data.mv_size = sizeof(double); data.mv_data = new bool; *((bool*)data.mv_data) = info[2]->ToBoolean()->Value(); }, [](MDB_val &data) -> void { delete (bool*)data.mv_data; }); } NAN_METHOD(TxnWrap::del) { Nan::HandleScope scope; TxnWrap *tw = Nan::ObjectWrap::Unwrap<TxnWrap>(info.This()); DbiWrap *dw = Nan::ObjectWrap::Unwrap<DbiWrap>(info[0]->ToObject()); if (!tw->txn) { return Nan::ThrowError("The transaction is already closed."); } MDB_val key; void (*freeKey)(MDB_val&) = argToKey(info[1], key, dw->keyIsUint32); if (!freeKey) { return; } // Set data if dupSort true and data given MDB_val data; Local<Value> dataHandle = info[2]; bool freeData = false; auto context = Nan::GetCurrentContext(); if ((dw->flags & MDB_DUPSORT) && !(dataHandle->IsUndefined())) { if (dataHandle->IsString()) { CustomExternalStringResource::writeTo(dataHandle->ToString(), &data); freeData = true; } else if (node::Buffer::HasInstance(dataHandle)) { data.mv_size = node::Buffer::Length(dataHandle); data.mv_data = node::Buffer::Data(dataHandle); freeData = true; } else if (dataHandle->IsNumber()) { data.mv_size = sizeof(double); data.mv_data = new double; auto local = dataHandle->ToNumber(context).ToLocalChecked(); *((double*)data.mv_data) = local->Value(); freeData = true; } else if (dataHandle->IsBoolean()) { data.mv_size = sizeof(double); data.mv_data = new bool; auto local = dataHandle->ToBoolean(context).ToLocalChecked(); *((bool*)data.mv_data) = local->Value(); freeData = true; } else { Nan::ThrowError("Invalid data type."); } } int rc = mdb_del(tw->txn, dw->dbi, &key, freeData ? &data : nullptr); freeKey(key); if (freeData) { if (dataHandle->IsString()) { delete[] (uint16_t*)data.mv_data; } else if (node::Buffer::HasInstance(dataHandle)) { // I think the data is owned by the node::Buffer so we don't need to free it - need to clarify } else if (dataHandle->IsNumber()) { delete (double*)data.mv_data; } else if (dataHandle->IsBoolean()) { delete (bool*)data.mv_data; } } if (rc != 0) { return Nan::ThrowError(mdb_strerror(rc)); } return; }
da77a/node-lmdb
src/txn.cpp
C++
mit
9,412
namespace DevTeam.TestTool.Engine.Contracts { using System; public interface ITestReporter: IObserver<TestProgress>, IObservable<TestReport>, IObservable<SummariseReport> { } }
DevTeam/patterns
TestTool/DevTeam.TestTool.Engine.Contracts/ITestReporter.cs
C#
mit
196
const https=require('https'); const fs=require('fs'); let options={ key:fs.readFileSync('ssh_key.pem'), cert:fs.readFileSync('ssh_cert.pem') } https.createServer(optinos,function(req,res){ res.writeHead(200); res.end('hello https'); }).listen(8201);
leokang28/demo
node/https.js
JavaScript
mit
259
""" Helper functions shared between the other modules """ from .core import * from . import result, errors
aurule/npc
npc/util/__init__.py
Python
mit
108
/* LUFA Library Copyright (C) Dean Camera, 2009. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ /** \file * * Header file for AudioOutput.c. */ #ifndef _AUDIO_OUTPUT_H_ #define _AUDIO_OUTPUT_H_ /* Includes: */ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> #include <stdbool.h> #include "Descriptors.h" #include <LUFA/Version.h> #include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/Buttons.h> /* Macros: */ /** MIDI command for a note on (activation) event */ #define MIDI_COMMAND_NOTE_ON 0x90 /** MIDI command for a note off (deactivation) event */ #define MIDI_COMMAND_NOTE_OFF 0x80 /** Standard key press velocity value used for all note events, as no pressure sensor is mounted */ #define MIDI_STANDARD_VELOCITY 64 /** Convenience macro. MIDI channels are numbered from 1-10 (natural numbers) however the logical channel * addresses are zero-indexed. This converts a natural MIDI channel number into the logical channel address. * * \param[in] channel MIDI channel number to address */ #define MIDI_CHANNEL(channel) ((channel) - 1) /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) /** LED mask for the library LED driver, to indicate that the USB interface is ready. */ #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) /* Type Defines: */ /** Type define for a USB MIDI event packet, used to encapsulate sent and received MIDI messages from a USB MIDI interface. */ typedef struct { unsigned char Command : 4; /**< MIDI command being sent or received in the event packet */ unsigned char CableNumber : 4; /**< Virtual cable number of the event being sent or received in the given MIDI interface */ uint8_t Data1; /**< First byte of data in the MIDI event */ uint8_t Data2; /**< Second byte of data in the MIDI event */ uint8_t Data3; /**< Third byte of data in the MIDI event */ } USB_MIDI_EventPacket_t; /* Function Prototypes: */ void SetupHardware(void); void MIDI_Task(void); void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_ConfigurationChanged(void); #endif
kevlar1818/umeter
LUFA_091223/Demos/Device/LowLevel/MIDI/MIDI.h
C
mit
3,899
<div class="links-container"> {{{widget-links}}} </div>
jo-asakura/spa-sushi
features/widget-content/views/home.html
HTML
mit
59