code
stringlengths
4
1.01M
/* ---------------------------------- * PUSH v2.0.0 * Licensed under The MIT License * inspired by chris's jquery.pjax.js * http://opensource.org/licenses/MIT * ---------------------------------- */ !function () { var noop = function () {}; // Pushstate cacheing // ================== var isScrolling; var maxCacheLength = 20; var cacheMapping = sessionStorage; var domCache = {}; var transitionMap = { 'slide-in' : 'slide-out', 'slide-out' : 'slide-in', 'fade' : 'fade' }; var bars = { bartab : '.bar-tab', barnav : '.bar-nav', barfooter : '.bar-footer', barheadersecondary : '.bar-header-secondary' }; var cacheReplace = function (data, updates) { PUSH.id = data.id; if (updates) data = getCached(data.id); cacheMapping[data.id] = JSON.stringify(data); window.history.replaceState(data.id, data.title, data.url); domCache[data.id] = document.body.cloneNode(true); }; var cachePush = function () { var id = PUSH.id; var cacheForwardStack = JSON.parse(cacheMapping.cacheForwardStack || '[]'); var cacheBackStack = JSON.parse(cacheMapping.cacheBackStack || '[]'); cacheBackStack.push(id); while (cacheForwardStack.length) delete cacheMapping[cacheForwardStack.shift()]; while (cacheBackStack.length > maxCacheLength) delete cacheMapping[cacheBackStack.shift()]; window.history.pushState(null, '', cacheMapping[PUSH.id].url); cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack); cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack); }; var cachePop = function (id, direction) { var forward = direction == 'forward'; var cacheForwardStack = JSON.parse(cacheMapping.cacheForwardStack || '[]'); var cacheBackStack = JSON.parse(cacheMapping.cacheBackStack || '[]'); var pushStack = forward ? cacheBackStack : cacheForwardStack; var popStack = forward ? cacheForwardStack : cacheBackStack; if (PUSH.id) pushStack.push(PUSH.id); popStack.pop(); cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack); cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack); }; var getCached = function (id) { return JSON.parse(cacheMapping[id] || null) || {}; }; var getTarget = function (e) { var target = findTarget(e.target); if ( ! target || e.which > 1 || e.metaKey || e.ctrlKey || isScrolling || location.protocol !== target.protocol || location.host !== target.host || !target.hash && /#/.test(target.href) || target.hash && target.href.replace(target.hash, '') === location.href.replace(location.hash, '') || target.getAttribute('data-ignore') == 'push' ) return; return target; }; // Main event handlers (touchend, popstate) // ========================================== var touchend = function (e) { var target = getTarget(e); if (!target) return; e.preventDefault(); PUSH({ url : target.href, hash : target.hash, timeout : target.getAttribute('data-timeout'), transition : target.getAttribute('data-transition') }); }; var popstate = function (e) { var key; var barElement; var activeObj; var activeDom; var direction; var transition; var transitionFrom; var transitionFromObj; var id = e.state; if (!id || !cacheMapping[id]) return; direction = PUSH.id < id ? 'forward' : 'back'; cachePop(id, direction); activeObj = getCached(id); activeDom = domCache[id]; if (activeObj.title) document.title = activeObj.title; if (direction == 'back') { transitionFrom = JSON.parse(direction == 'back' ? cacheMapping.cacheForwardStack : cacheMapping.cacheBackStack); transitionFromObj = getCached(transitionFrom[transitionFrom.length - 1]); } else { transitionFromObj = activeObj; } if (direction == 'back' && !transitionFromObj.id) return PUSH.id = id; transition = direction == 'back' ? transitionMap[transitionFromObj.transition] : transitionFromObj.transition; if (!activeDom) { return PUSH({ id : activeObj.id, url : activeObj.url, title : activeObj.title, timeout : activeObj.timeout, transition : transition, ignorePush : true }); } if (transitionFromObj.transition) { activeObj = extendWithDom(activeObj, '.content', activeDom.cloneNode(true)); for (key in bars) { barElement = document.querySelector(bars[key]) if (activeObj[key]) swapContent(activeObj[key], barElement); else if (barElement) barElement.parentNode.removeChild(barElement); } } swapContent( (activeObj.contents || activeDom).cloneNode(true), document.querySelector('.content'), transition ); PUSH.id = id; document.body.offsetHeight; // force reflow to prevent scroll }; // Core PUSH functionality // ======================= var PUSH = function (options) { var key; var data = {}; var xhr = PUSH.xhr; options.container = options.container || options.transition ? document.querySelector('.content') : document.body; for (key in bars) { options[key] = options[key] || document.querySelector(bars[key]); } if (xhr && xhr.readyState < 4) { xhr.onreadystatechange = noop; xhr.abort() } xhr = new XMLHttpRequest(); xhr.open('GET', options.url, true); xhr.setRequestHeader('X-PUSH', 'true'); xhr.onreadystatechange = function () { if (options._timeout) clearTimeout(options._timeout); if (xhr.readyState == 4) xhr.status == 200 ? success(xhr, options) : failure(options.url); }; if (!PUSH.id) { cacheReplace({ id : +new Date, url : window.location.href, title : document.title, timeout : options.timeout, transition : null }); } if (options.timeout) { options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout); } xhr.send(); if (xhr.readyState && !options.ignorePush) cachePush(); }; // Main XHR handlers // ================= var success = function (xhr, options) { var key; var barElement; var data = parseXHR(xhr, options); if (!data.contents) return locationReplace(options.url); if (data.title) document.title = data.title; if (options.transition) { for (key in bars) { barElement = document.querySelector(bars[key]) if (data[key]) swapContent(data[key], barElement); else if (barElement) barElement.parentNode.removeChild(barElement); } } swapContent(data.contents, options.container, options.transition, function () { cacheReplace({ id : options.id || +new Date, url : data.url, title : data.title, timeout : options.timeout, transition : options.transition }, options.id); triggerStateChange(); }); if (!options.ignorePush && window._gaq) _gaq.push(['_trackPageview']) // google analytics if (!options.hash) return; }; var failure = function (url) { throw new Error('Could not get: ' + url) }; // PUSH helpers // ============ var swapContent = function (swap, container, transition, complete) { var enter; var containerDirection; var swapDirection; if (!transition) { if (container) container.innerHTML = swap.innerHTML; else if (swap.classList.contains('content')) document.body.appendChild(swap); else document.body.insertBefore(swap, document.querySelector('.content')); } else { enter = /in$/.test(transition); if (transition == 'fade') { container.classList.add('in'); container.classList.add('fade'); swap.classList.add('fade'); } if (/slide/.test(transition)) { swap.classList.add('sliding-in', enter ? 'right' : 'left'); swap.classList.add('sliding'); container.classList.add('sliding'); } container.parentNode.insertBefore(swap, container); } if (!transition) complete && complete(); if (transition == 'fade') { container.offsetWidth; // force reflow container.classList.remove('in'); container.addEventListener('webkitTransitionEnd', fadeContainerEnd); function fadeContainerEnd() { container.removeEventListener('webkitTransitionEnd', fadeContainerEnd); swap.classList.add('in'); swap.addEventListener('webkitTransitionEnd', fadeSwapEnd); } function fadeSwapEnd () { swap.removeEventListener('webkitTransitionEnd', fadeSwapEnd); container.parentNode.removeChild(container); swap.classList.remove('fade'); swap.classList.remove('in'); complete && complete(); } } if (/slide/.test(transition)) { container.offsetWidth; // force reflow swapDirection = enter ? 'right' : 'left' containerDirection = enter ? 'left' : 'right' container.classList.add(containerDirection); swap.classList.remove(swapDirection); swap.addEventListener('webkitTransitionEnd', slideEnd); function slideEnd() { swap.removeEventListener('webkitTransitionEnd', slideEnd); swap.classList.remove('sliding', 'sliding-in'); swap.classList.remove(swapDirection); container.parentNode.removeChild(container); complete && complete(); } } }; var triggerStateChange = function () { var e = new CustomEvent('push', { detail: { state: getCached(PUSH.id) }, bubbles: true, cancelable: true }); window.dispatchEvent(e); }; var findTarget = function (target) { var i, toggles = document.querySelectorAll('a'); for (; target && target !== document; target = target.parentNode) { for (i = toggles.length; i--;) { if (toggles[i] === target) return target; } } }; var locationReplace = function (url) { window.history.replaceState(null, '', '#'); window.location.replace(url); }; var parseURL = function (url) { var a = document.createElement('a'); a.href = url; return a; }; var extendWithDom = function (obj, fragment, dom) { var i; var result = {}; for (i in obj) result[i] = obj[i]; Object.keys(bars).forEach(function (key) { var el = dom.querySelector(bars[key]); if (el) el.parentNode.removeChild(el); result[key] = el; }); result.contents = dom.querySelector(fragment); return result; }; var parseXHR = function (xhr, options) { var head; var body; var data = {}; var responseText = xhr.responseText; data.url = options.url; if (!responseText) return data; if (/<html/i.test(responseText)) { head = document.createElement('div'); body = document.createElement('div'); head.innerHTML = responseText.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0] body.innerHTML = responseText.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0] } else { head = body = document.createElement('div'); head.innerHTML = responseText; } data.title = head.querySelector('title'); data.title = data.title && data.title.innerText.trim(); if (options.transition) data = extendWithDom(data, '.content', body); else data.contents = body; return data; }; // Attach PUSH event handlers // ========================== window.addEventListener('touchstart', function () { isScrolling = false; }); window.addEventListener('touchmove', function () { isScrolling = true; }) window.addEventListener('touchend', touchend); window.addEventListener('click', function (e) { if (getTarget(e)) e.preventDefault(); }); window.addEventListener('popstate', popstate); window.PUSH = PUSH; }();
<?php namespace Kaishiyoku\LaravelMenu\Exceptions; class MenuExistsException extends \Exception { public function __construct(string $name, $code = 0, \Throwable $previous = null) { $message = "Menu '{$name}' already exists."; parent::__construct($message, $code, $previous); } }
.comment { margin: 10px 0; } #accept-answer :hover { background-color: grey; } /* Side notes for calling out things -------------------------------------------------- */ /* Base styles (regardless of theme) */ .bs-callout { margin: 20px 0; padding: 15px 30px 15px 15px; border: 1px solid #eee; border-left-width: 5px; } .bs-callout h4 { margin-top: 0; } .bs-callout p:last-child { margin-bottom: 0; } .bs-callout code, .bs-callout .highlight { background-color: #fff; } /* Themes for different contexts */ .bs-callout-danger { /*background-color: #fcf2f2;*/ border-color: #dFb5b4; } .bs-callout-warning { /*background-color: #fefbed;*/ border-color: #f1e7bc; } .bs-callout-info { /*background-color: #f0f7fd;*/ border-color: #d0e3f0; }
<?php /** * PHP version 5.6 * * This source file is subject to the license that is bundled with this package in the file LICENSE. */ namespace specs\Codeup\Bootcamps; use Codeup\Bootcamps\BootcampId; use Codeup\Bootcamps\Schedule; use Codeup\Bootcamps\Duration; use DateTimeImmutable; use PhpSpec\ObjectBehavior; class BootcampSpec extends ObjectBehavior { /** @var DateTimeImmutable */ private $now; function let() { $this->now = new DateTimeImmutable('now'); $currentMinute = (int) $this->now->format('i'); $currentHour = (int) $this->now->format('G'); if ($currentHour >= 16) { $currentHour -= 7; $this->now = $this->now->setTime($currentHour, $currentMinute); } $this->beConstructedThrough('start', [ BootcampId::fromLiteral(1), Duration::between( $this->now->modify('1 day ago'), $this->now->modify('4 months') ), 'Hampton', Schedule::withClassTimeBetween( $this->now, $this->now->setTime($currentHour + 7, $currentMinute) ) ]); } function it_knows_if_it_is_in_progress() { $this->isInProgress($this->now)->shouldBe(true); } function it_knows_if_has_not_yet_started() { $this->isInProgress($this->now->modify('2 days ago'))->shouldBe(false); } function it_knows_if_has_finished() { $this->isInProgress($this->now->modify('5 months'))->shouldBe(false); } }
\documentclass{article} \usepackage[utf8x]{inputenc} \usepackage[T1, T2A]{fontenc} \usepackage[russian]{babel} \usepackage{amsmath} \usepackage{amssymb} \setlength\parindent{0pt} \usepackage[parfill]{parskip} \pagenumbering{gobble} \DeclareMathOperator{\rank}{rank} \begin{document} Непрерывная функция $f(x)$ такова, что $f(0)=f(2)$. Докажите, что для какого-то $x \in [0,2]$ имеет место равенство $f(x)=f(x-1)$. \end{document}
package io.mewbase.rwtest; import io.mewbase.TestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.RandomAccessFile; /** * Created by tim on 11/10/16. */ public class MemoryMappedFileRWTest implements RWTest { private final static Logger logger = LoggerFactory.getLogger(MemoryMappedFileRWTest.class); private static final int PAGE_SIZE = 4 * 1024; @Override public int testRead(File testFile) throws Exception { RandomAccessFile raf = new RandomAccessFile(testFile, "rw"); long len = testFile.length(); int its = (int)(len / PAGE_SIZE); logger.trace("File length is {} iterations are {}", len, its); byte[] bytes = new byte[PAGE_SIZE]; int bytesRead; int cnt = 0; while (-1 != (bytesRead = raf.read(bytes))) { for (int i = 0; i < bytesRead; i++) { cnt += bytes[i]; } } raf.close(); return cnt; } @Override public int testWrite(File testFile) throws Exception { RandomAccessFile raf = new RandomAccessFile(testFile, "rw"); long len = testFile.length(); int its = (int)(len / PAGE_SIZE); logger.trace("File length is {} iterations are {}", len, its); byte[] bytes = TestUtils.randomByteArray(PAGE_SIZE); int cnt = 0; for (int i = 0; i < its; i++) { for (int j = 0; j < bytes.length; j++) { cnt += bytes[j]; } raf.write(bytes, 0, PAGE_SIZE); } raf.close(); return cnt; } }
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2007 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ ///-----includes_start----- #include "btBulletDynamicsCommon.h" #include <stdio.h> /// This is a Hello World program for running a basic Bullet physics simulation int main(int argc, char** argv) { ///-----includes_end----- int i; ///-----initialization_start----- ///collision configuration contains default setup for memory, collision setup. Advanced users can create their own configuration. btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration(); ///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded) btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration); ///btDbvtBroadphase is a good general purpose broadphase. You can also try out btAxis3Sweep. btBroadphaseInterface* overlappingPairCache = new btDbvtBroadphase(); ///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded) btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver; btDiscreteDynamicsWorld* dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,overlappingPairCache,solver,collisionConfiguration); dynamicsWorld->setGravity(btVector3(0,-10,0)); ///-----initialization_end----- ///create a few basic rigid bodies btCollisionShape* groundShape = new btBoxShape(btVector3(btScalar(50.),btScalar(50.),btScalar(50.))); //keep track of the shapes, we release memory at exit. //make sure to re-use collision shapes among rigid bodies whenever possible! btAlignedObjectArray<btCollisionShape*> collisionShapes; collisionShapes.push_back(groundShape); btTransform groundTransform; groundTransform.setIdentity(); groundTransform.setOrigin(btVector3(0,-56,0)); { btScalar mass(0.); //rigidbody is dynamic if and only if mass is non zero, otherwise static bool isDynamic = (mass != 0.f); btVector3 localInertia(0,0,0); if (isDynamic) groundShape->calculateLocalInertia(mass,localInertia); //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform); btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,groundShape,localInertia); btRigidBody* body = new btRigidBody(rbInfo); //add the body to the dynamics world dynamicsWorld->addRigidBody(body); } { //create a dynamic rigidbody //btCollisionShape* colShape = new btBoxShape(btVector3(1,1,1)); btCollisionShape* colShape = new btSphereShape(btScalar(1.)); collisionShapes.push_back(colShape); /// Create Dynamic Objects btTransform startTransform; startTransform.setIdentity(); btScalar mass(1.f); //rigidbody is dynamic if and only if mass is non zero, otherwise static bool isDynamic = (mass != 0.f); btVector3 localInertia(0,0,0); if (isDynamic) colShape->calculateLocalInertia(mass,localInertia); startTransform.setOrigin(btVector3(2,10,0)); //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform); btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia); btRigidBody* body = new btRigidBody(rbInfo); dynamicsWorld->addRigidBody(body); } /// Do some simulation ///-----stepsimulation_start----- for (i=0;i<100;i++) { dynamicsWorld->stepSimulation(1.f/60.f,10); //print positions of all objects for (int j=dynamicsWorld->getNumCollisionObjects()-1; j>=0 ;j--) { btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[j]; btRigidBody* body = btRigidBody::upcast(obj); if (body && body->getMotionState()) { btTransform trans; body->getMotionState()->getWorldTransform(trans); printf("world pos = %f,%f,%f\n",float(trans.getOrigin().getX()),float(trans.getOrigin().getY()),float(trans.getOrigin().getZ())); } } } ///-----stepsimulation_end----- //cleanup in the reverse order of creation/initialization ///-----cleanup_start----- //remove the rigidbodies from the dynamics world and delete them for (i=dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--) { btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[i]; btRigidBody* body = btRigidBody::upcast(obj); if (body && body->getMotionState()) { delete body->getMotionState(); } dynamicsWorld->removeCollisionObject( obj ); delete obj; } //delete collision shapes for (int j=0;j<collisionShapes.size();j++) { btCollisionShape* shape = collisionShapes[j]; collisionShapes[j] = 0; delete shape; } //delete dynamics world delete dynamicsWorld; //delete solver delete solver; //delete broadphase delete overlappingPairCache; //delete dispatcher delete dispatcher; delete collisionConfiguration; //next line is optional: it will be cleared by the destructor when the array goes out of scope collisionShapes.clear(); ///-----cleanup_end----- }
<?php // Require smarty class require_once (ABS_PARENT . 'smarty/Smarty.class.php'); // Define smarty template path @define ('ABS_SMARTY', ABS_ROOT . 'smarty' . DS); // Define smarty directories @define ('SONIC_SMARTY_TEMPLATE_DIR', ABS_SMARTY . 'templates'); @define ('SONIC_SMARTY_CACHE_DIR', ABS_SMARTY . 'cached'); @define ('SONIC_SMARTY_COMPILE_DIR', ABS_SMARTY . 'compiled'); @define ('SONIC_SMARTY_CONFIG_DIR', ABS_SMARTY . 'config'); @define ('SONIC_SMARTY_PLUGINS_DIR', ABS_SMARTY . 'plugins'); @define ('SONIC_SMARTY_ERROR_REPORTING', E_ALL & ~E_NOTICE);
<html> <head> <title>Jordie Lane's panel show appearances</title> <script type="text/javascript" src="../common.js"></script> <link rel="stylesheet" media="all" href="../style.css" type="text/css"/> <script type="text/javascript" src="../people.js"></script> <!--#include virtual="head.txt" --> </head> <body> <!--#include virtual="nav.txt" --> <div class="page"> <h1>Jordie Lane's panel show appearances</h1> <p>Jordie Lane has appeared in <span class="total">1</span> episodes between 2009-2009. Note that these appearances may be for more than one person if multiple people have the same name.</p> <div class="performerholder"> <table class="performer"> <tr style="vertical-align:bottom;"> <td><div style="height:100px;" class="performances male" title="1"></div><span class="year">2009</span></td> </tr> </table> </div> <ol class="episodes"> <li><strong>2009-11-04</strong> / <a href="../shows/spicks-and-specks.html">Spicks and Specks</a></li> </ol> </div> </body> </html>
/***************************************************** * Copyright (c) 2014 Colby Brown * * This program is released under the MIT license. * * For more information about the MIT license, * * visit http://opensource.org/licenses/MIT * *****************************************************/ var app = angular.module('volunteer', [ 'ajoslin.promise-tracker', 'cn.offCanvas', 'ncy-angular-breadcrumb', 'ngCookies', 'ui.bootstrap', 'ui.router', 'accentbows.controller', 'alerts.controller', 'bears.controller', 'configure.controller', 'confirm.controller', 'home.volunteer.controller', 'letters.controller', 'mums.volunteer.controller', 'mumtypes.controller', 'accessoriesAdd.controller', 'accessoriesAll.controller', 'accessoriesEdit.controller', 'accentbows.service', 'alerts.service', 'bears.service', 'confirm.service', 'letters.service', 'mum.service', 'mumtypes.service', 'pay.service', 'accessories.service', 'volunteer.service']); app.config(function($stateProvider, $urlRouterProvider, $httpProvider) { $urlRouterProvider.otherwise('/home'); $stateProvider .state('home', { url: '/home', templateUrl: 'public/views/volunteer/home/index.html', controller: 'homeController' }) .state('home.logout', { url: '/logout', onEnter: function($cookieStore, $rootScope, $state) { $cookieStore.remove('volunteerToken'); $rootScope.updateHeader(); $state.go('home'); } }) .state('configure', { url: '/configure', templateUrl: 'public/views/volunteer/configure/index.html', controller: 'configureController' }) .state('configure.accentbows', { url: '/accentbows', templateUrl: 'public/views/volunteer/accentbows/index.html', controller: 'accentbowsController' }) .state('configure.bears', { url: '/bears', templateUrl: 'public/views/volunteer/bears/index.html', controller: 'bearsController' }) .state('configure.letters', { url: '/letters', templateUrl: 'public/views/volunteer/letters/index.html', controller: 'lettersController' }) .state('configure.volunteers', { url: '/volunteers', templateUrl: 'public/views/volunteer/configure/volunteers.html', controller: 'configureVolunteerController' }) .state('configure.yearly', { url: '/yearly', templateUrl: 'public/views/volunteer/configure/yearly.html', controller: 'configureYearlyController' }) .state('mums', { url: '/mums', templateUrl: 'public/views/volunteer/mums/index.html', controller: 'mumsController', abstract: true }) .state('mums.all', { url: '', templateUrl: 'public/views/volunteer/mums/all.html', controller: 'mumsAllController' }) .state('mums.view', { url: '/view/:mumId', templateUrl: 'public/views/volunteer/mums/view.html', controller: 'mumsViewController' }) .state('configure.mumtypes', { url: '/mumtypes', templateUrl: 'public/views/volunteer/mumtypes/index.html', controller: 'mumtypesController', abstract: true }) .state('configure.mumtypes.grade', { url: '', templateUrl: 'public/views/volunteer/mumtypes/grade.html', controller: 'mumtypesItemsController', resolve: { itemDetails: function(MumtypesService) { return { formController: 'mumtypesEditGradeController', service: MumtypesService.grades, fetch: [] }; } } }) .state('configure.mumtypes.product', { url: '/:gradeId', templateUrl: 'public/views/volunteer/mumtypes/product.html', controller: 'mumtypesItemsController', resolve: { itemDetails: function($stateParams, MumtypesService) { return { formController: 'mumtypesEditProductController', service: MumtypesService.products, fetch: [ function($scope) { return MumtypesService.grades.fetch($stateParams.gradeId) .success(function(data) { $scope.grade = data; }); } ] }; } } }) .state('configure.mumtypes.size', { url: '/:gradeId/:productId', templateUrl: 'public/views/volunteer/mumtypes/size.html', controller: 'mumtypesItemsController', resolve: { itemDetails: function($stateParams, MumtypesService) { return { formController: 'mumtypesEditSizeController', service: MumtypesService.sizes, fetch: [ function($scope) { return MumtypesService.grades.fetch($stateParams.gradeId) .success(function(data) { $scope.grade = data; }); }, function($scope) { return MumtypesService.products.fetch($stateParams.productId) .success(function(data) { $scope.product = data; }); } ] }; } } }) .state('configure.mumtypes.backing', { url: '/:gradeId/:productId/:sizeId', templateUrl: 'public/views/volunteer/mumtypes/backing.html', controller: 'mumtypesItemsController', resolve: { itemDetails: function($stateParams, MumtypesService) { return { formController: 'mumtypesEditBackingController', service: MumtypesService.backings, fetch: [ function($scope) { return MumtypesService.grades.fetch($stateParams.gradeId) .success(function(data) { $scope.grade = data; }); }, function($scope) { return MumtypesService.products.fetch($stateParams.productId) .success(function(data) { $scope.product = data; }); }, function($scope) { return MumtypesService.sizes.fetch($stateParams.sizeId) .success(function(data) { $scope.size = data; }); } ] } } } }) .state('configure.accessories', { url: '/accessories', template: '<ui-view />', abstract: true }) .state('configure.accessories.all', { url: '', templateUrl: 'public/views/volunteer/accessories/all.html', controller: 'accessoriesAllController' }) .state('configure.accessories.add', { url: '/add', templateUrl: 'public/views/volunteer/accessories/edit.html', controller: 'accessoriesAddController' }) .state('configure.accessories.edit', { url: '/edit/:accessoryId', templateUrl: 'public/views/volunteer/accessories/edit.html', controller: 'accessoriesEditController' }); $httpProvider.defaults.headers.post = {'Content-Type': 'application/x-www-form-urlencoded'}; $httpProvider.defaults.headers.put = {'Content-Type': 'application/x-www-form-urlencoded'}; //PHP does not play nice with this feature. It's no big deal. //$locationProvider.html5Mode(true); }); app.run(['$cookieStore', '$injector', function($cookieStore, $injector) { $injector.get("$http").defaults.transformRequest.unshift(function(data, headersGetter) { var token = $cookieStore.get('volunteerToken'); if (token) { headersGetter()['Authentication'] = token.jwt; } if (data === undefined) { return data; } // If this is not an object, defer to native stringification. if ( ! angular.isObject( data ) ) { return( ( data == null ) ? "" : data.toString() ); } var buffer = []; // Serialize each key in the object. for ( var name in data ) { if ( ! data.hasOwnProperty( name ) ) { continue; } var value = data[ name ]; buffer.push( encodeURIComponent( name ) + "=" + encodeURIComponent( ( value == null ) ? "" : value ) ); } // Serialize the buffer and clean it up for transportation. var source = buffer.join( "&" ).replace( /%20/g, "+" ); return( source ); }); }]); app.controller('headerController', function($rootScope, $cookieStore) { $rootScope.updateHeader = function() { $rootScope.volunteer = $cookieStore.get('volunteerToken'); }; $rootScope.updateHeader(); }); //This filter is used to convert MySQL datetimes into AngularJS a readable ISO format. app.filter('dateToISO', function() { return function(badTime) { if (!badTime) return ""; if (badTime.date) { return badTime.date.replace(/(.+) (.+)/, "$1T$2Z"); } else { return badTime.replace(/(.+) (.+)/, "$1T$2Z"); } }; });
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Login Page - Photon Admin Panel Theme</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <link rel="shortcut icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/favicon.ico" /> <link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/iosicon.png" /> <!-- DEVELOPMENT LESS --> <!-- <link rel="stylesheet/less" href="css/photon.less" media="all" /> <link rel="stylesheet/less" href="css/photon-responsive.less" media="all" /> --> <!-- PRODUCTION CSS --> <link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all" /> <link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all" /> <link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/css/css_compiled/photon-responsive-min.css?v1.1" media="all" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" /> <![endif]--> <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" /> <script type="text/javascript" src="js/plugins/excanvas.js"></script> <script type="text/javascript" src="js/plugins/html5shiv.js"></script> <script type="text/javascript" src="js/plugins/respond.min.js"></script> <script type="text/javascript" src="js/plugins/fixFontIcons.js"></script> <![endif]--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/modernizr.custom.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.pnotify.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/less-1.3.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/xbreadcrumbs.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/charCount.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.textareaCounter.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/elrte.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/elrte.en.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/select2.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery-picklist.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.validate.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/additional-methods.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.form.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.metadata.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.mockjax.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.uniform.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.tagsinput.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.rating.pack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/farbtastic.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.timeentry.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.dataTables.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.jstree.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/dataTables.bootstrap.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.stack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.pie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.resize.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/raphael.2.1.0.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/justgage.1.0.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.qrcode.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.clock.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.countdown.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.jqtweet.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/jquery.cookie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/bootstrap-fileupload.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/prettify/prettify.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/bootstrapSwitch.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/plugins/mfupload.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/js/common.js"></script> </head> <body class="body-login"> <div class="nav-fixed-topright" style="visibility: hidden"> <ul class="nav nav-user-menu"> <li class="user-sub-menu-container"> <a href="javascript:;"> <i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i> </a> <ul class="nav user-sub-menu"> <li class="light"> <a href="javascript:;"> <i class='icon-photon stop'></i>Light Version </a> </li> <li class="dark"> <a href="javascript:;"> <i class='icon-photon stop'></i>Dark Version </a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-photon mail"></i> </a> </li> <li> <a href="javascript:;"> <i class="icon-photon comment_alt2_stroke"></i> <div class="notification-count">12</div> </a> </li> </ul> </div> <script> $(function(){ setTimeout(function(){ $('.nav-fixed-topright').removeAttr('style'); }, 300); $(window).scroll(function(){ if($('.breadcrumb-container').length){ var scrollState = $(window).scrollTop(); if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released'); else $('.nav-fixed-topright').removeClass('nav-released') } }); $('.user-sub-menu-container').on('click', function(){ $(this).toggleClass('active-user-menu'); }); $('.user-sub-menu .light').on('click', function(){ if ($('body').is('.light-version')) return; $('body').addClass('light-version'); setTimeout(function() { $.cookie('themeColor', 'light', { expires: 7, path: '/' }); }, 500); }); $('.user-sub-menu .dark').on('click', function(){ if ($('body').is('.light-version')) { $('body').removeClass('light-version'); $.cookie('themeColor', 'dark', { expires: 7, path: '/' }); } }); }); </script> <div class="container-login"> <div class="form-centering-wrapper"> <div class="form-window-login"> <div class="form-window-login-logo"> <div class="login-logo"> <img src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/js/plugins/prettify/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/> </div> <h2 class="login-title">Welcome to Photon UI!</h2> <div class="login-member">Not a Member?&nbsp;<a href="elrte.min.js.html#">Sign Up &#187;</a> <a href="elrte.min.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a> </div> <div class="login-or">Or</div> <div class="login-input-area"> <form method="POST" action="dashboard.php"> <span class="help-block">Login With Your Photon Account</span> <input type="text" name="email" placeholder="Email"> <input type="password" name="password" placeholder="Password"> <button type="submit" class="btn btn-large btn-success btn-login">Login</button> </form> <a href="elrte.min.js.html#" class="forgot-pass">Forgot Your Password?</a> </div> </div> </div> </div> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1936460-27']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Brian Schrader - D242</title> <link rel="shortcut icon" href="/assets/images/favicon.ico"> <link rel="stylesheet" href="/assets/css/style.css"> <link rel="alternate" type="application/rss+xml" title="My Blog" href="/rss.xml"> <link rel="stylesheet" href="/assets/css/highlight.css"> </head> <body> <nav class="main-nav"> <a href="/"> <span class="arrow">←</span> Home </a> <a href="/about">About </a> <a class="cta" href="/feed.xml">RSS</a> </nav> <section id="wrapper" class=""> <article class="post"> <header> <!-- <h1>D242</h1> --> <h2 class="headline">March 30, 2016</h2> </header> <section id="post-body"> <p>and I&#39;m pretty confident that I would have noticed it if it did. I&#39;ve logged a <em>lot</em> of typing hours on my Mac laptops. #college</p> </section> </article> <footer id="post-meta" class="clearfix"> <a href="http://snippets.today/users/sonicrocketman"> <img class="avatar" src="http://www.gravatar.com/avatar/11b074a636e00292c98e3e60f7e16595?s=160" /> <div> <span class="dark">sonicrocketman</span> <span>Brian Schrader</span> </div> </a> <section id="sharing"> <a class="twitter" href="https://twitter.com/intent/tweet?text=http://sonicrocketman.snippets.xyz/2016/03/30/d242.html"><span class="icon-twitter"> Tweet</span></a> <a class="facebook" href="#" onclick=" window.open( 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href), 'facebook-share-dialog', 'width=626,height=436'); return false;"><span class="icon-facebook-rect"> Share</span> </a> </section> </footer> <!-- Disqus comments --> <!-- Archive post list --> <!-- <ul id="post-list" class="archive readmore"> <h3>Read more</h3> <li> <a href="/2016/09/13/70a7.html">I'm convinced he was a friendly plumbing spirit. I'll never forget you; you were here so briefly I'm not sure you even existed at all. <aside class="dates">Sep 13</aside></a> </li> <li> <a href="/2016/09/13/5e48.html">Plumber came today to fix a large leak. He came to the door smiling, was here 10 mins, fixed the issue, laughed joyously, and said goodbye. <aside class="dates">Sep 13</aside></a> </li> <li> <a href="/2016/09/13/1184.html">First impressions of iOS 10: All the text is HUGE. <aside class="dates">Sep 13</aside></a> </li> <li> <a href="/2016/09/13/4799.html">I guess the whole app wasn't pure white enough. Jony Ive wasn't happy. <aside class="dates">Sep 13</aside></a> </li> <li> <a href="/2016/09/13/ec93.html">Not sure why the new version of iTunes removed the custom, album cover based playlist background colors, but I'm sad they're gone. <aside class="dates">Sep 13</aside></a> </li> <li> <a href="/2016/09/12/e9e1.html">I love this effect on photos. [http://bit.ly/2cUuJgV](http://bit.ly/2cUuJgV) credit: @museofadventure <aside class="dates">Sep 12</aside></a> </li> <li> <a href="/2016/09/09/5e5c.html">Typos make quotes better. <aside class="dates">Sep 09</aside></a> </li> <li> <a href="/2016/09/09/8c20.html">"See how he pops and locks agains his will?" <aside class="dates">Sep 09</aside></a> </li> <li> <a href="/2016/09/08/75b3.html">Thanks to everyone who's been commenting or visiting the Adventurer's Codex site. Your response has been amazing. <aside class="dates">Sep 08</aside></a> </li> <li> <a href="/2016/09/07/ed5f.html">I'm thrilled to announce a project I've been working on for a while now: Announcing Adventurer's Codex, a D&D 5e players tool. [http://bit.ly/2c5BLg7](http://bit.ly/2c5BLg7) <aside class="dates">Sep 07</aside></a> </li> <li> <a href="/2016/08/25/ada7.html">🎶Adding email filters🎶 <aside class="dates">Aug 25</aside></a> </li> <li> <a href="/2016/08/19/4ccf.html">I need a break for a week. [http://bit.ly/2bxiGlS](http://bit.ly/2bxiGlS) <aside class="dates">Aug 19</aside></a> </li> <li> <a href="/2016/08/16/cbd2.html">Now this is a hack, but it is also a working hack. [http://bit.ly/2aXQKcB](http://bit.ly/2aXQKcB) <aside class="dates">Aug 16</aside></a> </li> <li> <a href="/2016/08/15/9691.html">Other than that though, it's super fun. #NoMansSky <aside class="dates">Aug 15</aside></a> </li> <li> <a href="/2016/08/15/024b.html">One thing about No Man's Sky: the lack of an intro in Minecraft was never really a plus either. <aside class="dates">Aug 15</aside></a> </li> <li> <a href="/2016/08/14/4d06.html">"Gigabuckets of anti-love" <aside class="dates">Aug 14</aside></a> </li> <li> <a href="/2016/08/12/8d24.html">Solving the real problems. [http://bit.ly/2aQNYFS](http://bit.ly/2aQNYFS) @museofadventure <aside class="dates">Aug 12</aside></a> </li> <li> <a href="/2016/08/12/892f.html">Let the Star Gazing begin! #persieds <aside class="dates">Aug 12</aside></a> </li> <li> <a href="/2016/08/11/5edf.html">I think I've reached peak tech irony (sorry HackerNews commenters). [http://bit.ly/2aPx4WW](http://bit.ly/2aPx4WW) <aside class="dates">Aug 11</aside></a> </li> <li> <a href="/2016/08/10/f342.html">making plans with @museofadventure [http://bit.ly/2aKFxMn](http://bit.ly/2aKFxMn) <aside class="dates">Aug 10</aside></a> </li> <li> <a href="/2016/08/09/1a7d.html">I'm so full of good food. 😌😴 <aside class="dates">Aug 09</aside></a> </li> <li> <a href="/2016/08/09/eebb.html">(Yes I just popped in a new fuze). Thanks internet. [http://bit.ly/2aHP19W](http://bit.ly/2aHP19W) <aside class="dates">Aug 09</aside></a> </li> <li> <a href="/2016/08/09/2b1d.html">I wouldn't have normally noticed until I didn't see the reflection while driving. This stopped me before it could be a problem. 👍 <aside class="dates">Aug 09</aside></a> </li> <li> <a href="/2016/08/09/1f90.html">Apparently my car won't go into gear (there's an override) if the brake light fuze goes out. That's actually pretty cool. <aside class="dates">Aug 09</aside></a> </li> <li> <a href="/2016/07/30/5968.html">"Minor Text Fixes" - Most hated words in 2016 <aside class="dates">Jul 30</aside></a> </li> <li> <a href="/2016/07/30/7520.html">There must be 80 people here sitting in a small plaza, in the shade playing Pokemon. All ages. <aside class="dates">Jul 30</aside></a> </li> <li> <a href="/2016/07/27/7087.html">"Completely empty flight tonight" - Attendant 👍😊😴 <aside class="dates">Jul 27</aside></a> </li> <li> <a href="/2016/07/27/357b.html">SJC➡️SAN✈️ <aside class="dates">Jul 27</aside></a> </li> <li> <a href="/2016/07/27/c31f.html">Writing up a pre-flight post... ready for home. <aside class="dates">Jul 27</aside></a> </li> <li> <a href="/2016/07/27/eb90.html">Pre-Flight cappuccino <aside class="dates">Jul 27</aside></a> </li> <li> <a href="/2016/07/26/6834.html">This vacation is 30% Pokemon Go. <aside class="dates">Jul 26</aside></a> </li> <li> <a href="/2016/07/24/cc0f.html">OH: "Feet is not a feeling." <aside class="dates">Jul 24</aside></a> </li> <li> <a href="/2016/07/24/8dcc.html">Only a little sunburned... <aside class="dates">Jul 24</aside></a> </li> <li> <a href="/2016/07/23/4662.html">More views. [http://bit.ly/2a6inwX](http://bit.ly/2a6inwX) <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/23/807d.html">Dear SF, please teach your birds not to crap on my head. K thanks. <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/23/88ad.html">TIL Davey Crockett rode into town on the backs of crocodiles. [http://bit.ly/2aiC3Bh](http://bit.ly/2aiC3Bh) <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/23/dc22.html">Feels too much like San Diego here. Not that that's bad, just that I was already in San Diego. <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/23/5918.html">You know San Francisco, without the cold and the fog you lose a lot of the mystique. <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/23/04bc.html">The audiophile section of the last episode of @atpfm was longer than my flight. Super cool stuff though. <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/23/7be0.html">Traveling with @MuseofAdventure 😆🌅⏳☕️🎶😞 <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/23/9b21.html">SAN➡️SJC ✈️ <aside class="dates">Jul 23</aside></a> </li> <li> <a href="/2016/07/22/65d3.html">Second wind: Go! <aside class="dates">Jul 22</aside></a> </li> <li> <a href="/2016/07/20/5f83.html">New café recently opened down the street. Good coffee, weak AC. ☕😊️🔥😞 <aside class="dates">Jul 20</aside></a> </li> <li> <a href="/2016/07/20/aa08.html">An interesting writeup about today's Stack Overflow outage. [http://bit.ly/29Wk53Z](http://bit.ly/29Wk53Z) <aside class="dates">Jul 20</aside></a> </li> <li> <a href="/2016/07/20/8ff7.html">Xcode doesn't support Swift refactoring so I'm over here writing scripts to grep through source files. Funnily enough, I don't really mind. <aside class="dates">Jul 20</aside></a> </li> <li> <a href="/2016/07/20/e7f5.html">Python people are usually sticklers for it, and consequently, I am now too. But Swift is making it really difficult. <aside class="dates">Jul 20</aside></a> </li> <li> <a href="/2016/07/20/1b4d.html">Does anyone out there even attempt to keep ~80 characters/line in Swift? <aside class="dates">Jul 20</aside></a> </li> <li> <a href="/2016/07/19/58a1.html">It's a two coffee morning. ☕️☕️ <aside class="dates">Jul 19</aside></a> </li> <li> <a href="/2016/07/15/c66c.html">Holy crap Turkey. <aside class="dates">Jul 15</aside></a> </li> <li> <a href="/2016/07/15/7f78.html">Out for a night of Pokemon hunting. <aside class="dates">Jul 15</aside></a> </li> <li> <a href="/2016/07/11/8989.html">Will it finally be cool to wear a Pokemon hat as an adult now? I've waited for that moment for years. <aside class="dates">Jul 11</aside></a> </li> <li> <a href="/2016/07/11/caa7.html">Its official. I'm now fully indoctrinated. I've had the server crash on me while catching Pokemon. <aside class="dates">Jul 11</aside></a> </li> <li> <a href="/2016/07/11/4fd0.html">I know I'm a bit late to the party, but I'm here now. <aside class="dates">Jul 11</aside></a> </li> <li> <a href="/2016/07/11/6e42.html">Whelp. It's happened. [http://bit.ly/29CEkYa](http://bit.ly/29CEkYa) <aside class="dates">Jul 11</aside></a> </li> <li> <a href="/2016/07/08/1377.html">What do you call global, shared-state objects: NSNotificationCenter.defaultCenter, UIApplication.sharedApplication, etc? I say services. <aside class="dates">Jul 08</aside></a> </li> <li> <a href="/2016/07/05/a427.html">View from the top. #prefireworks [http://bit.ly/29mryMc](http://bit.ly/29mryMc) <aside class="dates">Jul 05</aside></a> </li> <li> <a href="/2016/07/04/da5b.html">Linode, you're awesome. <aside class="dates">Jul 04</aside></a> </li> <li> <a href="/2016/07/04/b1c7.html">[notice] everything is fine. It's a non-crucial personal server. Thanks to the folks at Linode for detecting the hack and shutting it down. <aside class="dates">Jul 04</aside></a> </li> <li> <a href="/2016/07/04/29a6.html">Ladies and Gentlemen, I have been hacked. [http://bit.ly/29oAEdb](http://bit.ly/29oAEdb) <aside class="dates">Jul 04</aside></a> </li> <li> <a href="/2016/07/02/52e6.html">There's a local Dixieland brass band playing on the front steps of a historical hotel down the street from me. I love this neighborhood. <aside class="dates">Jul 02</aside></a> </li> <li> <a href="/2016/06/28/10f3.html">Python Programming Interview: A: "What are the steps to make a PB&J sandwich?" B: "from sandwich import PBJ; my_sammie = PBJ()" <aside class="dates">Jun 28</aside></a> </li> <li> <a href="/2016/06/28/894d.html">Remember when we used to print emails, web pages, etc cause we wanted the "real version"? <aside class="dates">Jun 28</aside></a> </li> <li> <a href="/2016/06/28/df60.html">I normally don't really care for server admin stuff, but doing first time setup for production servers is exciting. It's like passing a milestone. <aside class="dates">Jun 28</aside></a> </li> <li> <a href="/2016/06/28/3e87.html">The project is real now. <aside class="dates">Jun 28</aside></a> </li> <li> <a href="/2016/06/21/c355.html">Last night @museofadventure took some great pictures of the Strawberry Moon. [http://bit.ly/28LEDvI](http://bit.ly/28LEDvI) <aside class="dates">Jun 21</aside></a> </li> <li> <a href="/2016/06/21/b4ad.html">I climb mountain like mountain goat. Minus the stumbling of course. <aside class="dates">Jun 21</aside></a> </li> <li> <a href="/2016/06/21/001c.html">The moon is so bright and its light is so moon-beautiful. Moon is moon best. Moon. #moon <aside class="dates">Jun 21</aside></a> </li> <li> <a href="/2016/06/21/fa7c.html">Keep the streak! [http://bit.ly/28JOu4e](http://bit.ly/28JOu4e) <aside class="dates">Jun 21</aside></a> </li> <li> <a href="/2016/06/19/4caf.html">Oh sweet, merciful god I found shade. <aside class="dates">Jun 19</aside></a> </li> <li> <a href="/2016/06/18/0050.html">OH: "12PM is the noon?" <aside class="dates">Jun 18</aside></a> </li> <li> <a href="/2016/06/16/b513.html">A long, but overall successful morning of coding. Now, I has lunch! <aside class="dates">Jun 16</aside></a> </li> <li> <a href="/2016/06/08/405f.html">"This isn't a Request for Thoughts. It's a Request for Comments." <aside class="dates">Jun 08</aside></a> </li> <li> <a href="/2016/06/07/f785.html">That's what software engineers should aspire to create. <aside class="dates">Jun 07</aside></a> </li> <li> <a href="/2016/06/07/2672.html">Not only is BBEdit's software great, but releases are timely with OS updates, and their documentation is complete (as far as I can tell). <aside class="dates">Jun 07</aside></a> </li> <li> <a href="/2016/06/07/9c61.html">BBEdit is a fantastic example of mature, correct software. It doesn't look "modern", but it's extremely powerful, stable, and feature-rich. <aside class="dates">Jun 07</aside></a> </li> <li> <a href="/2016/06/04/c4c2.html">PDX ➡️SAN ✈️ <aside class="dates">Jun 04</aside></a> </li> <li> <a href="/2016/06/04/f368.html">I will definitely be back. And hopefully before #PyCon2017 <aside class="dates">Jun 04</aside></a> </li> <li> <a href="/2016/06/04/1a03.html">It's been fun Portland. But now I must leave you. <aside class="dates">Jun 04</aside></a> </li> <li> <a href="/2016/06/03/ba0c.html">I. Love. This. City. <aside class="dates">Jun 03</aside></a> </li> <li> <a href="/2016/06/03/bfde.html">Why did I have to travel all the way from San Diego for this? Best coffee shop idea I've seen. [http://www.revolucioncoffeehouse.com](http://www.revolucioncoffeehouse.com) <aside class="dates">Jun 03</aside></a> </li> <li> <a href="/2016/06/03/7992.html">Re Portland: there's a lot of beautiful architecture. So many old buildings and churches. <aside class="dates">Jun 03</aside></a> </li> <li> <a href="/2016/06/03/2d82.html">I'm a sucker for columns. [http://bit.ly/1PrZ0Sc](http://bit.ly/1PrZ0Sc) <aside class="dates">Jun 03</aside></a> </li> <li> <a href="/2016/06/03/c8eb.html">Sacajawea [http://bit.ly/20XJmhX](http://bit.ly/20XJmhX) <aside class="dates">Jun 03</aside></a> </li> <li> <a href="/2016/06/03/7d72.html">Biscuits for Breakfast. 😊 <aside class="dates">Jun 03</aside></a> </li> <li> <a href="/2016/06/02/06f9.html">Now this is what Portland is about. #coffee [http://bit.ly/1r4kGrN](http://bit.ly/1r4kGrN) <aside class="dates">Jun 02</aside></a> </li> <li> <a href="/2016/06/02/d4e8.html">Tired. #PyCon has beaten me. <aside class="dates">Jun 02</aside></a> </li> <li> <a href="/2016/06/02/e3b5.html">Usually. [http://bit.ly/1Uvzjim](http://bit.ly/1Uvzjim) <aside class="dates">Jun 02</aside></a> </li> <li> <a href="/2016/06/01/8554.html">best quote, "crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, crap, yes!" <aside class="dates">Jun 01</aside></a> </li> <li> <a href="/2016/06/01/63b1.html">Great talks, great people, but I'm exhausted. <aside class="dates">Jun 01</aside></a> </li> <li> <a href="/2016/05/31/7c82.html">I can't imagine nicer Portland weather. <aside class="dates">May 31</aside></a> </li> <li> <a href="/2016/05/31/3e48.html">A Pork Katsu Torta? Yes please! <aside class="dates">May 31</aside></a> </li> <li> <a href="/2016/05/31/080b.html">some awesome lightning talks #pycon2016 <aside class="dates">May 31</aside></a> </li> <li> <a href="/2016/05/30/2b10.html">Oh no. Other Mac apps are doing the whole "jump to the cursor on-click like iMessage does" thing. Please fix this Apple. <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/8a73.html">Automation > Process #pycon2016 <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/7ac3.html">All of the talks are closed captioned. I feel so bad for them, so much jargon. <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/91ff.html">Up next: "The Cobbler's Children have no Shoes." <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/6df5.html">Seriously, their apps are so ridiculously good. <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/844a.html">The one thing I miss most after leaving Twitter: @tweetbot. <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/193b.html">define your charaters (funtions) before they're used. #pycon2016 <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/b555.html">programming style as storytelling. great idea. <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/ffda.html">"Readability matters because you don't scale" #pycon2016 <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/9b78.html">"Software is made out of people...and their time." <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/daec.html">Everyone in the room has Slack, Twitter, and Github open. <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/46c5.html">recovering git branches... YES! <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/b03f.html">Git: Fear of losing work is a barrier to learning/experimentation #pycon2016 <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/bd57.html">so many good talks all at the same time... <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/d31c.html">All examples in Python3. #asitshouldbe #pycon2016 <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/fb8e.html">btw if you don't care about programming or Python, then you might want to mute #pycon2016 for the next few days. <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/8412.html">First session of the day: File descriptors, UNIX sockets and other POSIX wizardry. #pycon2016 <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/9c03.html">PyCon so far has been 5% technology and 95% inclusivity, community, diversity, and education. #pycon2016 <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/7325.html">It's time for PyCon: Day 1! <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/c00c.html">Free food! <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/1c59.html">Badged. [http://bit.ly/1Z7sLb3](http://bit.ly/1Z7sLb3) <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/3c82.html">Portland Lyft driver makes a Portlandia reference and neither of the dudes from San Diego got it. #auspiciousstart <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/30/0a2c.html">I'm in Portland! <aside class="dates">May 30</aside></a> </li> <li> <a href="/2016/05/29/0513.html">Got some time to wait in the terminal. Time for some Revolutions Podcast! [https://overcast.fm/](https://overcast.fm/) BFNrRhjmI <aside class="dates">May 29</aside></a> </li> <li> <a href="/2016/05/29/51ae.html">My activity graph makes cat ears. [http://bit.ly/20Q8R4S](http://bit.ly/20Q8R4S) <aside class="dates">May 29</aside></a> </li> <li> <a href="/2016/05/29/db5e.html">Thank you to whoever unplugged the 12-port, communal charging strip so they could plug in their iPad directly. We didn't need those. <aside class="dates">May 29</aside></a> </li> <li> <a href="/2016/05/29/7e3e.html">SAN➡️PDX✈️ <aside class="dates">May 29</aside></a> </li> <li> <a href="/2016/05/28/70b4.html">🐍 Prepping for PyCon! 🐍 <aside class="dates">May 28</aside></a> </li> <li> <a href="/2016/05/28/8c01.html">Me before entering a Twitter argument. [http://gph.is/1eRvd1P](http://gph.is/1eRvd1P) <aside class="dates">May 28</aside></a> </li> <li> <a href="/2016/05/26/dd52.html">Glad to see that this case ended how it should have. The consequences are huge. [http://bit.ly/1UgpGUC](http://bit.ly/1UgpGUC) <aside class="dates">May 26</aside></a> </li> <li> <a href="/2016/05/26/244f.html">This is my favorite thing this week. [http://bit.ly/1Ru1mKn](http://bit.ly/1Ru1mKn) <aside class="dates">May 26</aside></a> </li> <li> <a href="/2016/05/24/8975.html">Guns replaced with selfie sticks [http://bit.ly/25k2aia](http://bit.ly/25k2aia) <aside class="dates">May 24</aside></a> </li> <li> <a href="/2016/05/24/b0c8.html">Work, now with breakfast! Order now! <aside class="dates">May 24</aside></a> </li> <li> <a href="/2016/05/23/dd56.html">End of a long, productive day. Now that nourishment has been consumed, it's time to relax. 🤖 *beep* <aside class="dates">May 23</aside></a> </li> <li> <a href="/2016/05/21/5b9f.html">Well it will be in an hour, at least. <aside class="dates">May 21</aside></a> </li> <li> <a href="/2016/05/21/0757.html">What time is it? Band practice time! <aside class="dates">May 21</aside></a> </li> <li> <a href="/2016/05/21/5940.html">It's serious stuff. [http://bit.ly/1NDPYRl](http://bit.ly/1NDPYRl) <aside class="dates">May 21</aside></a> </li> <li> <a href="/2016/05/20/f009.html">Can we all agree that there are too many proprietary chat apps, and bluetooth dongles? <aside class="dates">May 20</aside></a> </li> <li> <a href="/2016/05/18/d39f.html">🎶Configuring Postgres🎶 <aside class="dates">May 18</aside></a> </li> <li> <a href="/2016/05/18/cfbc.html">For reference, this is the keyboard in question. [http://amzn.to/1TZK4sT](http://amzn.to/1TZK4sT) <aside class="dates">May 18</aside></a> </li> <li> <a href="/2016/05/18/4caf.html">Got a new keyboard today; not used to split layouts. This might be a good motivator for me to learn to type correctly. <aside class="dates">May 18</aside></a> </li> <li> <a href="/2016/05/18/1fc1.html">I'm really liking the iTunes update yesterday. What year is this? <aside class="dates">May 18</aside></a> </li> <li> <a href="/2016/05/17/7d11.html">Different topic: I'm really liking Swift. It's a little inconsistent at times (EAFP/LBYL) but it's really practical. [http://www.oranlooney.com/lbyl-vs-eafp/](http://www.oranlooney.com/lbyl-vs-eafp/) <aside class="dates">May 17</aside></a> </li> <li> <a href="/2016/05/17/4ba1.html">Not just for if you lock yourself out (which is **huge**) but if you want to go to your car and you left the keys at your desk or something. <aside class="dates">May 17</aside></a> </li> <li> <a href="/2016/05/17/d255.html">Best advice I've ever gotten: Put a copy of your car key in your wallet. <aside class="dates">May 17</aside></a> </li> <li> <a href="/2016/05/15/e8b3.html">And now, band practice. 🎶 <aside class="dates">May 15</aside></a> </li> <li> <a href="/2016/05/15/2f47.html">Tried to take a time-lapse while bike riding. Took a slow-mo instead: 5 minutes of 240 glorious frames per second. <aside class="dates">May 15</aside></a> </li> <li> <a href="/2016/05/10/eb26.html">Remember the old days? [http://bit.ly/1XjNBFp](http://bit.ly/1XjNBFp) <aside class="dates">May 10</aside></a> </li> <li> <a href="/2016/04/25/4dfe.html">I have Xcode open. Repeat: I have Xcode open. <aside class="dates">Apr 25</aside></a> </li> <li> <a href="/2016/04/17/7810.html">Surprisingly, its working well. <aside class="dates">Apr 17</aside></a> </li> <li> <a href="/2016/04/17/3d84.html">I don't know why I'm doing it, but I am. <aside class="dates">Apr 17</aside></a> </li> <li> <a href="/2016/04/17/cda7.html">Currently listening to music in iTunes, streamed from my webserver, via Icecast, from NiceCast, using VLC, streamed from my media server. <aside class="dates">Apr 17</aside></a> </li> <li> <a href="/2016/04/16/8c88.html">"Apple recovered [a tonne] of gold from broken iPhones last year" [http://cnnmon.ie/1WxNBkK](http://cnnmon.ie/1WxNBkK) <aside class="dates">Apr 16</aside></a> </li> <li> <a href="/2016/04/16/688e.html">With this coffee, I am become human. <aside class="dates">Apr 16</aside></a> </li> <li> <a href="/2016/04/12/8d5d.html">Actually, can we make "Relevant Rocky and Bullwinkle" a thing? <aside class="dates">Apr 12</aside></a> </li> <li> <a href="/2016/04/12/1e3e.html">Request: Plz upload all human knowledge to the internet. I couldn't find a relevant Rocky and Bullwinkle episode and my joke was lost. k thx <aside class="dates">Apr 12</aside></a> </li> <li> <a href="/2016/04/07/abfa.html">Filenames are hard. <aside class="dates">Apr 07</aside></a> </li> <li> <a href="/2016/04/06/8416.html">Yesterday was the first time in months that I've added a new contact on my Mac. Went to my iPhone this morning: it's not there. <aside class="dates">Apr 06</aside></a> </li> <li> <a href="/2016/04/06/6e76.html">Mr. Rogers Neighborhood [http://bit.ly/25L6ZPg](http://bit.ly/25L6ZPg) <aside class="dates">Apr 06</aside></a> </li> <li> <a href="/2016/04/06/af55.html">"Why is this place called the Cave of Hopelessness?" "Oh fear not lad, tis named for its discoverer: Reginald Hopelessness..." <aside class="dates">Apr 06</aside></a> </li> <li> <a href="/2016/04/06/0ff0.html">"Deep in the Geysers of Gygax" <aside class="dates">Apr 06</aside></a> </li> <li> <a href="/2016/04/06/f52e.html">Waves. [http://bit.ly/1MRqI9s](http://bit.ly/1MRqI9s) <aside class="dates">Apr 06</aside></a> </li> <li> <a href="/2016/04/05/5a2b.html">Current status [http://bit.ly/1q4VEc1](http://bit.ly/1q4VEc1) <aside class="dates">Apr 05</aside></a> </li> <li> <a href="/2016/04/05/6cc2.html">Apparently we depend on C++, Perl, and even Powershell. Here's our full report. [http://pastebin.com/c0UwdGBK](http://pastebin.com/c0UwdGBK) <aside class="dates">Apr 05</aside></a> </li> <li> <a href="/2016/04/05/9b99.html">For a side project: We've written 8,500 lines of code. That code depends on 1,012,723 lines of 3rd party code. /cc @caseyliss <aside class="dates">Apr 05</aside></a> </li> <li> <a href="/2016/04/04/7272.html">Yup. [http://www.listen-tome.com/wasted-hours/](http://www.listen-tome.com/wasted-hours/) <aside class="dates">Apr 04</aside></a> </li> <li> <a href="/2016/04/04/bdf1.html">Fog [http://bit.ly/1MOry76](http://bit.ly/1MOry76) <aside class="dates">Apr 04</aside></a> </li> <li> <a href="/2016/04/02/35f8.html">Got a guitar yesterday. New to me, needed some cleaning but I've taken care of that, and of course new strings. Can't wait to play today! <aside class="dates">Apr 02</aside></a> </li> <li> <a href="/2016/04/01/59c9.html">People like pictures. <aside class="dates">Apr 01</aside></a> </li> <li> <a href="/2016/04/01/081e.html">Knowing all that, I got extremely giddy just now because I converted some console log statements into an HTML report with a progress bar. <aside class="dates">Apr 01</aside></a> </li> <li> <a href="/2016/04/01/200f.html">Developers get frustrated when people react to small visual changes over large code changes. To people that's when something becomes real. <aside class="dates">Apr 01</aside></a> </li> <li> <a href="/2016/04/01/06ee.html">umm... why? [http://bit.ly/1N0zRr2](http://bit.ly/1N0zRr2) <aside class="dates">Apr 01</aside></a> </li> <li> <a href="/2016/03/30/a03a.html">*cough* [http://bit.ly/1WYCNKq](http://bit.ly/1WYCNKq) <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/1135.html">Captionbot describes itself. [http://bit.ly/1ZLmyC8](http://bit.ly/1ZLmyC8) <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/e7d8.html">I am a tap-to-click trackpad wizard. <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/d242.html"><p>and I&#39;m pretty confident that I would have noticed it if it did. I&#39;ve logged a <em>lot</em> of typing hours on my Mac laptops. #college</p> <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/efdf.html"><p>Not sure if I&#39;m imagining it, but when I&#39;m using a trackpad, I mouse with my left hand (my dominant hand) and I&#39;ve never had issues. </p> <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/8763.html"><p>My setup today. Using my laptops keyboard and trackpad. <a href="http://bit.ly/1omk7Zc">http://bit.ly/1omk7Zc</a></p> <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/09fa.html"><p>I&#39;m banishing you to the depths! <a href="http://bit.ly/1UCC2Jz">http://bit.ly/1UCC2Jz</a></p> <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/2e17.html"><p>Anyone with burgeoning RSI use a magic trackpad over a mouse? I never seem to have issues when I&#39;m using my laptop, only with a mouse.</p> <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/30/c45e.html"><p>My favorite kind of weather. <a href="http://bit.ly/1ThtPsN">http://bit.ly/1ThtPsN</a></p> <aside class="dates">Mar 30</aside></a> </li> <li> <a href="/2016/03/29/e589.html"><p>Why do I Git version non-code projects? Because I can easily look up when, where, what, and how past me changed something. It&#39;s extremely useful.</p> <aside class="dates">Mar 29</aside></a> </li> <li> <a href="/2016/03/29/3ac7.html"><p>I highly doubt they will. &quot;[this] raises questions about... whether it will inform Apple about these vulnerabilities&quot; <a href="http://bit.ly/22VVxxU">http://bit.ly/22VVxxU</a></p> <aside class="dates">Mar 29</aside></a> </li> <li> <a href="/2016/03/29/e784.html"><p>It&#39;s never a good time when the Finder says an empty directory uses 28GB. That&#39;s when the panic starts.</p> <aside class="dates">Mar 29</aside></a> </li> <li> <a href="/2016/03/29/1e47.html"><p>Looks like a Disk Utility First Aid check caught the issue. <em>phew</em> 😪</p> <aside class="dates">Mar 29</aside></a> </li> <li> <a href="/2016/03/29/499f.html"><p>Oh no... 😣 please HFS , don&#39;t be corrupted.</p> <aside class="dates">Mar 29</aside></a> </li> <li> <a href="/2016/03/29/c773.html"><p>It took me all day, but I&#39;m down to the last cup of this french press of coffee I made this morning.</p> <aside class="dates">Mar 29</aside></a> </li> <li> <a href="/2016/03/28/c670.html"><p>Months after it came out, my parents are finally seeing Star Wars. </p> <aside class="dates">Mar 28</aside></a> </li> <li> <a href="/2016/03/28/2b0d.html"><p>4 cups of coffee and I&#39;m still tired. </p> <aside class="dates">Mar 28</aside></a> </li> <li> <a href="/2016/03/26/362e.html"><p>Post-hike Perrier. </p> <aside class="dates">Mar 26</aside></a> </li> <li> <a href="/2016/03/26/69d7.html"><p>I need to turn up my filter on Hacker News. </p> <aside class="dates">Mar 26</aside></a> </li> <li> <a href="/2016/03/25/b811.html"><p>Most of the buildings are still there. &quot;Classic NYC street photos, from the 1930s and now&quot; <a href="http://bit.ly/1SlQ3ax">http://bit.ly/1SlQ3ax</a></p> <aside class="dates">Mar 25</aside></a> </li> <li> <a href="/2016/03/25/045d.html"><p>The actual help menu appears when you run the script with no arguments. </p> <aside class="dates">Mar 25</aside></a> </li> <li> <a href="/2016/03/25/37ca.html"><p>You know you&#39;re using some really special software when the --help option just prints out Perl code with no additional comments.</p> <aside class="dates">Mar 25</aside></a> </li> <li> <a href="/2016/03/24/d904.html"><p>Hell is PDFs for documentation. </p> <aside class="dates">Mar 24</aside></a> </li> <li> <a href="/2016/03/23/fafa.html"><p>Early coffeehouses in Oxford (~1700s) held talks on topics like politics, news, science, etc. Why don&#39;t we do that today? TED: Coffeehouse</p> <aside class="dates">Mar 23</aside></a> </li> <li> <a href="/2016/03/23/5102.html"><p>so close... </p> <aside class="dates">Mar 23</aside></a> </li> <li> <a href="/2016/03/22/606d.html"><p>Big Software</p> <aside class="dates">Mar 22</aside></a> </li> <li> <a href="/2016/03/22/4855.html"><p>When there&#39;s no more coffee, it&#39;s time to leave.</p> <aside class="dates">Mar 22</aside></a> </li> <li> <a href="/2016/03/22/e228.html"><p>HTML was designed for researchers to publish and link to each other&#39;s work. Yet it&#39;s 2016 and we&#39;re still using PDF. <a href="http://bit.ly/25jeT24">http://bit.ly/25jeT24</a></p> <aside class="dates">Mar 22</aside></a> </li> <li> <a href="/2016/03/21/8c7b.html"><p>Looking at the list of talks for PyCon: I&#39;m not past the first set of sessions and I can&#39;t decide which one to go to. #AGoodProblemToHave</p> <aside class="dates">Mar 21</aside></a> </li> <li> <a href="/2016/03/21/86c8.html"><p>aaaaaaaaand no new Macs.</p> <aside class="dates">Mar 21</aside></a> </li> <li> <a href="/2016/03/21/c4c8.html"><p>What the hell is a &quot;nit of light?&quot; </p> <aside class="dates">Mar 21</aside></a> </li> <li> <a href="/2016/03/21/a743.html"><p>Wow. Tim Cook starting off the keynote with the FBI debacle. </p> <aside class="dates">Mar 21</aside></a> </li> <li> <a href="/2016/03/21/2af5.html"><p>Apple event screen. <a href="http://bit.ly/1ZkLKz8">http://bit.ly/1ZkLKz8</a></p> <aside class="dates">Mar 21</aside></a> </li> <li> <a href="/2016/03/20/3924.html"><p>Prepping for band practice. 🎶😊🎶</p> <aside class="dates">Mar 20</aside></a> </li> <li> <a href="/2016/03/20/6014.html"><p>Setting up a new Wordpress installation is pretty easy as long as you haven&#39;t messed with your Apache PHP configuration. Then it&#39;s a nightmare. </p> <aside class="dates">Mar 20</aside></a> </li> <li> <a href="/2016/03/18/e46a.html"><p>so much want.</p> <aside class="dates">Mar 18</aside></a> </li> <li> <a href="/2016/03/18/c612.html"><p>TIL that you can design custom telecasters... (designed, not ordered) <a href="http://bit.ly/1WuxSAF">http://bit.ly/1WuxSAF</a></p> <aside class="dates">Mar 18</aside></a> </li> <li> <a href="/2016/03/17/5108.html"><p>Why is there no standard way of sharing music playlists? And if there is, why doesn&#39;t iTunes support it?</p> <aside class="dates">Mar 17</aside></a> </li> <li> <a href="/2016/03/17/2986.html"><p>Well, I skimmed that paper and looked at the graphs. That&#39;s about all I could understand. :P</p> <aside class="dates">Mar 17</aside></a> </li> <li> <a href="/2016/03/17/3c3f.html"><p>My reading for today: Generalized methods and solvers for noise removal from piecewise constant signals. We&#39;ll see how this goes. </p> <aside class="dates">Mar 17</aside></a> </li> <li> <a href="/2016/03/17/2672.html"><p>A good morning so far. <a href="http://bit.ly/1R6435L">http://bit.ly/1R6435L</a></p> <aside class="dates">Mar 17</aside></a> </li> <li> <a href="/2016/03/15/e0af.html"><p>Everyone needs this Giphy Alfred workflow. <a href="http://bit.ly/1Xt1K0D">http://bit.ly/1Xt1K0D</a></p> <aside class="dates">Mar 15</aside></a> </li> <li> <a href="/2016/03/15/81da.html"><p>Google&#39;s like, &quot;Platform specific interface guidelines? lolwut?&quot; <a href="http://bit.ly/1QTq2iA">http://bit.ly/1QTq2iA</a></p> <aside class="dates">Mar 15</aside></a> </li> <li> <a href="/2016/03/15/b25f.html"><p>That&#39;s probably the 10th time I&#39;ve posted that. It&#39;s not funny to most people, but it&#39;s funny to me.</p> <aside class="dates">Mar 15</aside></a> </li> <li> <a href="/2016/03/14/bf08.html"><p>Thanks @overcast! I&#39;ve wanted a dark mode forever (looks great too) and file upload is something I can&#39;t wait to use.</p> <aside class="dates">Mar 14</aside></a> </li> <li> <a href="/2016/03/11/6283.html"><p>A universal install script. <a href="http://xkcd.com/1654/">http://xkcd.com/1654/</a></p> <aside class="dates">Mar 11</aside></a> </li> <li> <a href="/2016/03/11/5723.html"><p>🎶Mocking all the things🎶</p> <aside class="dates">Mar 11</aside></a> </li> <li> <a href="/2016/03/08/035e.html"><p>Dat rain doe</p> <aside class="dates">Mar 08</aside></a> </li> <li> <a href="/2016/03/08/755d.html"><p>🌧🌧🌧🌧🌙🌧🌧🌧🌧</p> <aside class="dates">Mar 08</aside></a> </li> <li> <a href="/2016/03/05/c865.html"><p>but seriously I don&#39;t think you realize how much time you actually spend just browsing (the modern equivalent of flipping channels)</p> <aside class="dates">Mar 05</aside></a> </li> <li> <a href="/2016/03/05/3dea.html"><p>I recommend filtering HN through to an RSS feed. You&#39;ll spend less time searching and more time reading things that are important to you.</p> <aside class="dates">Mar 05</aside></a> </li> <li> <a href="/2016/03/05/a19d.html"><p>After adding automatic filtering to Hacker News, I&#39;ve realized how few of the posts I actually want to read. It&#39;s not a bad thing.</p> <aside class="dates">Mar 05</aside></a> </li> <li> <a href="/2016/03/04/2ff3.html"><p>I&#39;m exahusted. Want sleep.</p> <aside class="dates">Mar 04</aside></a> </li> <li> <a href="/2016/03/02/054c.html"><p>Project meeting time! 🕖🎉🍹</p> <aside class="dates">Mar 02</aside></a> </li> <li> <a href="/2016/03/01/c52d.html"><p>It&#39;s a stupidly beautiful day. </p> <aside class="dates">Mar 01</aside></a> </li> <li> <a href="/2016/03/01/6e2c.html"><p>My coffee was cold. I warmed it up. Now it is cold again. #cantwin #failwhale #suckstobeme #tuesdays</p> <aside class="dates">Mar 01</aside></a> </li> <li> <a href="/2016/03/01/ecbf.html"><p>Eggs, with tomatoes and mushrooms, on toast. <a href="http://bit.ly/1oMwP3R">http://bit.ly/1oMwP3R</a></p> <aside class="dates">Mar 01</aside></a> </li> <li> <a href="/2016/03/01/9b15.html"><p>Also coffee.</p> <aside class="dates">Mar 01</aside></a> </li> <li> <a href="/2016/03/01/70e6.html"><p>Always coffee.</p> <aside class="dates">Mar 01</aside></a> </li> <li> <a href="/2016/03/01/9d21.html"><p>“Infinite are the arguments of mages,” ― Ursula K. Le Guin, A Wizard of Earthsea</p> <aside class="dates">Mar 01</aside></a> </li> <li> <a href="/2016/02/28/a803.html"><p>Gonna play some Risk tonight!</p> <aside class="dates">Feb 28</aside></a> </li> <li> <a href="/2016/02/27/7672.html"><p>I don&#39;t know why, but I just remembered this tweet. <a href="https://twitter.com/rentzsch/status/602862585398992896">https://twitter.com/rentzsch/status/602862585398992896</a></p> <aside class="dates">Feb 27</aside></a> </li> <li> <a href="/2016/02/25/4dc9.html"><p>[Closed as Expected Behavior]</p> <aside class="dates">Feb 25</aside></a> </li> <li> <a href="/2016/02/25/029b.html"><p>Bug #1234 &quot;Computers are generally insecure. Please add more privacy protection.&quot; &lt;<Closed as Expected Behavior>&gt; </p> <aside class="dates">Feb 25</aside></a> </li> <li> <a href="/2016/02/25/e04d.html"><p>The modern web and software landscape has conditioned people to just accept that computers are insecure, and broken. </p> <aside class="dates">Feb 25</aside></a> </li> <li> <a href="/2016/02/25/5fb4.html"><p>From what I&#39;ve seen, most people just expect that all things can be broken into. That&#39;s the scary part. There&#39;s no expectation of privacy.</p> <aside class="dates">Feb 25</aside></a> </li> <li> <a href="/2016/02/25/d56a.html"><p>The idea that the data on an iPhone can&#39;t be read, even by Apple or the FBI, is shocking to most people. </p> <aside class="dates">Feb 25</aside></a> </li> <li> <a href="/2016/02/24/13c2.html"><p>YouTube&#39;s goal recently seems to be to remind everyone that it controls everything and there&#39;s nothing we can do.</p> <aside class="dates">Feb 24</aside></a> </li> <li> <a href="/2016/02/24/b6f9.html"><p>Team Four Star&#39;s YouTube channel was taken down with no notice. </p> <aside class="dates">Feb 24</aside></a> </li> <li> <a href="/2016/02/23/4dc2.html"><p>CI is a magical thing. Especially when it auto-deploys.</p> <aside class="dates">Feb 23</aside></a> </li> <li> <a href="/2016/02/23/c420.html"><p>The evolution of the web. <a href="http://fabianburghardt.de/webolution/">http://fabianburghardt.de/webolution/</a></p> <aside class="dates">Feb 23</aside></a> </li> <li> <a href="/2016/02/23/f2c3.html"><p>A perfect example of the UNIX philosophy on the web is Gravatar. It does one thing: profile images, and it does it well. </p> <aside class="dates">Feb 23</aside></a> </li> <li> <a href="/2016/02/23/4bcd.html"><p>Coffee ✅ Eggs on toast ✅ Read some articles before work [In Progress] Work [Next] Book of Mormon [Tonight]</p> <aside class="dates">Feb 23</aside></a> </li> <li> <a href="/2016/02/20/dc1e.html"><p>&quot;Roll for gypsies&quot;</p> <aside class="dates">Feb 20</aside></a> </li> <li> <a href="/2016/02/20/806f.html"><p>I&#39;m proud of this. &quot;Fatal Python error: Cannot recover from stack overflow.&quot; <a href="http://bit.ly/24g4bJf">http://bit.ly/24g4bJf</a></p> <aside class="dates">Feb 20</aside></a> </li> <li> <a href="/2016/02/18/41c2.html"><p>Is there really no &quot;equal sign&quot; emoji? </p> <aside class="dates">Feb 18</aside></a> </li> <li> <a href="/2016/02/18/839d.html"><p>☕️➕🌧➕🎶➡️😌</p> <aside class="dates">Feb 18</aside></a> </li> <li> <a href="/2016/02/10/9e2e.html"><p>Webpage size with Twitter widget: 200KB; without it: 16KB. That&#39;s 12x smaller.</p> <aside class="dates">Feb 10</aside></a> </li> <li> <a href="/2016/02/10/b9c8.html"><p>Had to wait for my solar powered keyboard to charge before I could start my day.</p> <aside class="dates">Feb 10</aside></a> </li> <li> <a href="/2016/02/07/53c3.html"><p>This lox bagel is the only thing I&#39;ve ever wanted right now.</p> <aside class="dates">Feb 07</aside></a> </li> <li> <a href="/2016/02/07/fa1c.html"><p>Not a LOX bagel; that&#39;s something else.</p> <aside class="dates">Feb 07</aside></a> </li> <li> <a href="/2016/02/07/189c.html"><p>Coffee, code, and a lox Bagel. #aperfectsunday</p> <aside class="dates">Feb 07</aside></a> </li> <li> <a href="/2016/02/06/3e91.html"><p>I didn&#39;t know Gravatar had a default image option for missing avatars. It even includes random monster, and pattern images. That&#39;s awesome!</p> <aside class="dates">Feb 06</aside></a> </li> <li> <a href="/2016/02/05/a241.html"><p>In San Diego we have the problem of the weather being &#39;too perfect&#39;. It&#39;s boring having such perfect weather with no variety. 😜</p> <aside class="dates">Feb 05</aside></a> </li> <li> <a href="/2016/02/05/da63.html"><p>So, if I were to use the offical clients for all the chat apps I use, I&#39;d have to have 5 seperate applications that do the same thing.</p> <aside class="dates">Feb 05</aside></a> </li> <li> <a href="/2016/02/05/6a33.html"><p>(aim for some friends, HipChat for work, Gitter for side projects, IRC for meetups, SMS/iMessage for everything else)</p> <aside class="dates">Feb 05</aside></a> </li> <li> <a href="/2016/02/05/4dfb.html"><p>I log onto Twitter to change my profile and this is my timeline... <a href="http://bit.ly/1PFcLux">http://bit.ly/1PFcLux</a></p> <aside class="dates">Feb 05</aside></a> </li> <li> <a href="/2016/02/05/5d53.html"><p>I mean, it&#39;s probably a lot more than typical users, but I feel like a modern OS should be able to handle that without stuttering animations.</p> <aside class="dates">Feb 05</aside></a> </li> <li> <a href="/2016/02/05/9125.html"><p>I have 7 virtual desktops with about 4-5 windows in each (and some even have tabs 👻). I don&#39;t feel like that&#39;s a lot.</p> <aside class="dates">Feb 05</aside></a> </li> <li> <a href="/2016/02/05/534d.html"><p>Sometimes, I feel like I&#39;m pushing the limits of my Mac by just having lots of windows open. (even on my 2014 rMBP, 16GB Memory)</p> <aside class="dates">Feb 05</aside></a> </li> <li> <a href="/2016/02/04/921f.html"><p>All code is simple, if designed properly; even the most complex tasks are simple if you break it down.</p> <aside class="dates">Feb 04</aside></a> </li> <li> <a href="/2016/02/04/5c78.html"><p>Developing Software isn&#39;t a test of skill, or cleverness; it&#39;s a test of your ability to properly organize things. </p> <aside class="dates">Feb 04</aside></a> </li> <li> <a href="/2016/02/02/5064.html"><p>Second round of coffee, go!</p> <aside class="dates">Feb 02</aside></a> </li> <li> <a href="/2016/02/02/5a89.html"><p>Sometimes I wonder if I should write my History and Programming blog posts on seperate sites. </p> <aside class="dates">Feb 02</aside></a> </li> <li> <a href="/2016/02/01/eae0.html"><p>I opened the Terminal and got this... wut? <a href="http://bit.ly/20C5cID">http://bit.ly/20C5cID</a></p> <aside class="dates">Feb 01</aside></a> </li> <li> <a href="/2016/02/01/c894.html"><p>&quot;...it&#39;s basically every crappy IT project...&quot;</p> <aside class="dates">Feb 01</aside></a> </li> <li> <a href="/2016/02/01/485c.html"><p>&quot;I hate The Lord of the Rings because it&#39;s too much like work.&quot; <a href="http://kottke.org/16/02/i-hate-the-lord-of-the-rings">http://kottke.org/16/02/i-hate-the-lord-of-the-rings</a></p> <aside class="dates">Feb 01</aside></a> </li> <li> <a href="/2016/02/01/cfd8.html"><p>&quot;Installing updates&quot;</p> <aside class="dates">Feb 01</aside></a> </li> <li> <a href="/2016/02/01/3602.html"><p>Gordon Ramsey-style eggs. 😋 <a href="http://bit.ly/1KlLay8">http://bit.ly/1KlLay8</a></p> <aside class="dates">Feb 01</aside></a> </li> <li> <a href="/2016/01/31/1552.html"><p>&quot;Beer is the space catnip&quot;</p> <aside class="dates">Jan 31</aside></a> </li> <li> <a href="/2016/01/30/d587.html"><p>&quot;Cap off a canyon with ice&quot; Bam! Instant building. </p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/2ab3.html"><p>&quot;Pork, pasta, and peanut butter.&quot;</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/7e8f.html"><p>&quot;Hydroponics are key.&quot;</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/d9a4.html"><p>Recycling in space. </p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/8210.html"><p>Found the first use of the .aero domain! masten.aero</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/880a.html"><p>Asteroid mining and Masten #SpaceUpV <a href="https://db.tt/ARJoY71G">https://db.tt/ARJoY71G</a></p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/d315.html"><p>Thorium reactors and space pirates. #SpaceUpV</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/6574.html"><p>MaaS: Mars as a service. </p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/0143.html"><p>We need Silicon Valley-esq titles for space companies.</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/abb8.html"><p>&quot;Flags and Footprints model&quot; #SpaceUpV</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/241c.html"><p>&quot;Sucker punch the satellite&quot; </p> <p>&quot;Spongebob or a catcher&#39;s mitt&quot; #SpaceUpV</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/83e0.html"><p>&quot;Steampunk in space&quot; #SpaceUpV</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/d475.html"><p><a href="https://db.tt/tJCerFsF">https://db.tt/tJCerFsF</a></p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/c07c.html"><p>Power satellites! <a href="https://db.tt/Rgncs4BE">https://db.tt/Rgncs4BE</a></p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/64b2.html"><p>Getting ready for talks!</p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/e90b.html"><h1>SpaceUpV</h1> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/5c2b.html"><p>There we go. Now it&#39;s official. </p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/30/2f79.html"><p>SpaceUp has started! <a href="https://db.tt/a24WdFrv">https://db.tt/a24WdFrv</a></p> <aside class="dates">Jan 30</aside></a> </li> <li> <a href="/2016/01/29/c8c5.html"><p>It&#39;s a nice dream, but it&#39;s unfortunately just that. </p> <aside class="dates">Jan 29</aside></a> </li> <li> <a href="/2016/01/29/2e0c.html"><p>The dream for scientists, analysts, and programmers is for all the world&#39;s data to be in 1 place, in 1 format, and have 1 naming convention.</p> <aside class="dates">Jan 29</aside></a> </li> <li> <a href="/2016/01/28/7445.html"><p>making graphs!</p> <aside class="dates">Jan 28</aside></a> </li> <li> <a href="/2016/01/28/5884.html"><p>Oatmeal cookies and coffee. Breakfast of champions.</p> <aside class="dates">Jan 28</aside></a> </li> <li> <a href="/2016/01/28/76e8.html"><p>I&#39;ll fix it tomorrow. #sleep</p> <aside class="dates">Jan 28</aside></a> </li> <li> <a href="/2016/01/28/e317.html"><p>I guess it&#39;s still to early to require automatic https for Let&#39;s Encrypt certificates. I&#39;m getting &quot;untrusted&quot; errors from some browsers.</p> <aside class="dates">Jan 28</aside></a> </li> <li> <a href="/2016/01/28/f5a6.html"><p>Fun fact: There are more people under 15 in India then there are in the U.S. period.</p> <aside class="dates">Jan 28</aside></a> </li> <li> <a href="/2016/01/27/31b0.html"><p>Anyone have any good resources for learning intermediate-advanced Statistics? </p> <aside class="dates">Jan 27</aside></a> </li> <li> <a href="/2016/01/27/c031.html"><p>Kinda wanna blog more, but I don&#39;t want to look at my computer anymore. 😪</p> <aside class="dates">Jan 27</aside></a> </li> <li> <a href="/2016/01/27/96bc.html"><p>🎉🎉 Open Source Project Meetup Night 🎉🎉</p> <aside class="dates">Jan 27</aside></a> </li> <li> <a href="/2016/01/27/489c.html"><p>It&#39;s easier to just delete some after a week. The impulse to read clickbait articles vanishes, and only the best articles remain.</p> <aside class="dates">Jan 27</aside></a> </li> <li> <a href="/2016/01/27/1ad2.html"><p>Finally caught up on all the articles I&#39;ve been hoarding for the last week. By that I mean I read 2 of them, and deleted 8.</p> <aside class="dates">Jan 27</aside></a> </li> <li> <a href="/2016/01/26/cc03.html"><p>Everything I needed to do today is done. Now, time to relax.</p> <aside class="dates">Jan 26</aside></a> </li> <li> <a href="/2016/01/25/65bb.html"><p>I love it when all my tests pass.</p> <aside class="dates">Jan 25</aside></a> </li> <li> <a href="/2016/01/25/346e.html"><p>I love that <a href="http://bit.ly/1WBUi3w">Dr. Drang</a> links to the actual bills. It makes them so much easier to find.</p> <aside class="dates">Jan 25</aside></a> </li> <li> <a href="/2016/01/25/e30d.html"><p>&quot;California and New York State legislatures to force smartphone manufacturers... to incorporate backdoors...&quot; http://bit.ly/1ZNIP0L</p> <aside class="dates">Jan 25</aside></a> </li> <li> <a href="/2016/01/21/e534.html"><p>I recently read <a href="http://www.amazon.com/gp/product/1621052036?redirect=true&amp;ref_=cm_cr_ryp_prd_ttl_sol_0">King Space Void</a> by my friend Anthony Trevino. It&#39;s a fun, bite-sized bit of bizzareness. You should check it out!</p> <aside class="dates">Jan 21</aside></a> </li> <li> <a href="/2016/01/21/c8dd.html"><p>That feeling when you want to have a server just to serve your clever 500 error jokes.</p> <aside class="dates">Jan 21</aside></a> </li> <li> <a href="/2016/01/21/8a41.html"><p>I think I rediscover this every 6 months, but a thermos of coffee is a great thing to bring with me in the morning.</p> <aside class="dates">Jan 21</aside></a> </li> <li> <a href="/2016/01/11/9d46.html"><p>Written Log: blog Video Log: vlog Audio Log: alog? aug? augh? ugh?</p> <aside class="dates">Jan 11</aside></a> </li> <li> <a href="/2016/01/11/68f0.html"><blockquote> <p>With hindsight, it seems bloody obvious the Sun and not the Earth is the center of the solar system. Occam&#39;s razor and all that.</p> </blockquote> <p><img src="http://also.kottke.org/misc/images/helio-vs-geo.gif" alt="Heliocentrism vs geocentrism"></p> <aside class="dates">Jan 11</aside></a> </li> <li> <a href="/2016/01/11/7c56.html"><p>.@kjaymiller No, Peach is just a new version of the same thing. For now I&#39;ve got my own microblog. Twitter is becoming just chat for me.</p> <aside class="dates">Jan 11</aside></a> </li> <li> <a href="/2016/01/11/6689.html"><p>PSA: Never remove the Logitech adapter from your Mac, not even for 2 minutes. You&#39;ll forget to put it back, and you&#39;ll be sad at work.</p> <aside class="dates">Jan 11</aside></a> </li> <li> <a href="/2016/01/11/1ee6.html"><p>As of today, I won&#39;t really be posting to Twitter anymore. I&#39;ll still reply, and DM, but all of my normal tweets will be auto-posted from my Microblog. <a href="http://sonicrocketman.snippets.xyz">http://sonicrocketman.snippets.xyz</a></p> <aside class="dates">Jan 11</aside></a> </li> <li> <a href="/2016/01/11/0e9f.html"><p>Posting to Hacker News is so hit or miss.</p> <aside class="dates">Jan 11</aside></a> </li> <li> <a href="/2016/01/11/b54d.html"><p><a href="http://brianschrader.com/archive/breaking-up-is-hard-to-do/">Breaking up is hard to do (A breakup letter to Twitter)</a></p> <aside class="dates">Jan 11</aside></a> </li> <li> <a href="/2016/01/10/334d.html"><p>Coffee. It&#39;s the good stuff. </p> <aside class="dates">Jan 10</aside></a> </li> <li> <a href="/2015/10/20/1554.html"><p>I have not seen the new Star Wars Trailer.</p> <aside class="dates">Oct 20</aside></a> </li> <li> <a href="/2015/09/24/82fb.html"><p>Today has been a whirlwind of a day. </p> <aside class="dates">Sep 24</aside></a> </li> <li> <a href="/2015/09/24/2ea6.html"><p>Got some new data in today. Time to start digging.</p> <aside class="dates">Sep 24</aside></a> </li> <li> <a href="/2015/09/23/c59f.html"><p>Though, since I&#39;m not a biologist, I probably won&#39;t be able to tell.</p> <aside class="dates">Sep 23</aside></a> </li> <li> <a href="/2015/09/23/f021.html"><p>Got this DNA analysis going. Hopefully it leads to something interesting.</p> <aside class="dates">Sep 23</aside></a> </li> <li> <a href="/2015/09/23/d6af.html"><p>Hello world and all who inhabit it!</p> <aside class="dates">Sep 23</aside></a> </li> </ul> --> </section> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/assets/js/main.js"></script> <script src="/assets/js/highlight.js"></script> <script>hljs.initHighlightingOnLoad();</script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXXXXX-X', 'auto'); ga('send', 'pageview'); </script> </body> </html>
.contact_title { font-size: 16px; padding-bottom: 24px; font-weight:300; color:black; } .contact_container { display: -ms-flex; display: -webkit-flex; display: flex; justify-content: space-between; -webkit-justify-content: space-between; -ms-justify-content: space-between; -moz-justify-content: space-between; flex-flow: row wrap; -webkit-flex-flow: row wrap; -ms-flex-flow: row wrap; -moz-flex-flow: row wrap; position: relative; height: auto; } .contact_brief { line-height:40px; text-align:left; font-size:16px; font-weight:500; color: #000; } .contact_brief p{ margin-bottom: 16px; color: #999; } .contact_img { position: relative; height: 450px; margin-left: 30px; } .contact_img img{ width: 100%; position: absolute; } .makeTransparent{ opacity: 0; } .contact_brief a{ font-size: 16px; font-weight: 500; border-bottom: 1px solid #999; color: #999; transition: 0.5s; -webkit-transition: 0.5s; -moz-transition: 0.5s; -ms-transition: 0.5s; } .contact_brief a:hover { color: black; border-bottom-color: black; } .contact_option:hover{ cursor: pointer; } .switch_img{ opacity: 0; transition: opacity 0.5s; } #switch_img_0{ opacity: 1; }
using Agrobook.Common; using Agrobook.Domain.Usuarios; using System.Threading.Tasks; using System.Web.Http; namespace Agrobook.Server.Login { [RoutePrefix("login")] public class LoginController : ApiController { private readonly IDateTimeProvider dateTime = ServiceLocator.ResolveSingleton<IDateTimeProvider>(); private readonly UsuariosService usuariosService = ServiceLocator.ResolveSingleton<UsuariosService>(); [HttpPost] [Route("try-login")] public async Task<IHttpActionResult> TryLogin([FromBody]dynamic value) { // Source: http://stackoverflow.com/questions/13120971/how-to-get-json-post-values-with-asp-net-webapi string username = value.username.Value; string password = value.password.Value; var result = await this.usuariosService.HandleAsync(new IniciarSesion(username, password, this.dateTime.Now)); return this.Ok(result); } } }
/* ----------------------------------------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android © Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio. This FDK AAC Codec software is intended to be used on a wide variety of Android devices. AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part of the MPEG specifications. Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer) may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners individually for the purpose of encoding or decoding bit streams in products that are compliant with the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec software may already be covered under those patent licenses when it is used for those licensed purposes only. Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality, are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional applications information and documentation. 2. COPYRIGHT LICENSE Redistribution and use in source and binary forms, with or without modification, are permitted without payment of copyright license fees provided that you satisfy the following conditions: You must retain the complete text of this software license in redistributions of the FDK AAC Codec or your modifications thereto in source code form. You must retain the complete text of this software license in the documentation and/or other materials provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form. You must make available free of charge copies of the complete source code of the FDK AAC Codec and your modifications thereto to recipients of copies in binary form. The name of Fraunhofer may not be used to endorse or promote products derived from this library without prior written permission. You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec software or your modifications thereto. Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software and the date of any change. For modified versions of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android." 3. NO PATENT LICENSE NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with respect to this software. You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized by appropriate patent licenses. 4. DISCLAIMER This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages, including but not limited to procurement of substitute goods or services; loss of use, data, or profits, or business interruption, however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence), arising in any way out of the use of this software, even if advised of the possibility of such damage. 5. CONTACT INFORMATION Fraunhofer Institute for Integrated Circuits IIS Attention: Audio and Multimedia Departments - FDK AAC LL Am Wolfsmantel 33 91058 Erlangen, Germany www.iis.fraunhofer.de/amm amm-info@iis.fraunhofer.de ----------------------------------------------------------------------------------------------------------- */ /*! \file \brief frequency scale \author Tobias Chalupka */ #include "sbrenc_freq_sca.h" #include "sbr_misc.h" #include BLIK_FDKAAC_U_genericStds_h //original-code:"genericStds.h" /* StartFreq */ static INT getStartFreq(INT fsCore, const INT start_freq); /* StopFreq */ static INT getStopFreq(INT fsCore, const INT stop_freq); static INT numberOfBands(INT b_p_o, INT start, INT stop, FIXP_DBL warp_factor); static void CalcBands(INT * diff, INT start , INT stop , INT num_bands); static INT modifyBands(INT max_band, INT * diff, INT length); static void cumSum(INT start_value, INT* diff, INT length, UCHAR *start_adress); /******************************************************************************* Functionname: FDKsbrEnc_getSbrStartFreqRAW ******************************************************************************* Description: Arguments: Return: *******************************************************************************/ INT FDKsbrEnc_getSbrStartFreqRAW (INT startFreq, INT fsCore) { INT result; if ( startFreq < 0 || startFreq > 15) { return -1; } /* Update startFreq struct */ result = getStartFreq(fsCore, startFreq); result = (result*(fsCore>>5)+1)>>1; /* (result*fsSBR/QMFbands+1)>>1; */ return (result); } /* End FDKsbrEnc_getSbrStartFreqRAW */ /******************************************************************************* Functionname: getSbrStopFreq ******************************************************************************* Description: Arguments: Return: *******************************************************************************/ INT FDKsbrEnc_getSbrStopFreqRAW (INT stopFreq, INT fsCore) { INT result; if ( stopFreq < 0 || stopFreq > 13) return -1; /* Uppdate stopFreq struct */ result = getStopFreq(fsCore, stopFreq); result = (result*(fsCore>>5)+1)>>1; /* (result*fsSBR/QMFbands+1)>>1; */ return (result); } /* End getSbrStopFreq */ /******************************************************************************* Functionname: getStartFreq ******************************************************************************* Description: Arguments: fsCore - core sampling rate Return: *******************************************************************************/ static INT getStartFreq(INT fsCore, const INT start_freq) { INT k0_min; switch(fsCore){ case 8000: k0_min = 24; /* (3000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 11025: k0_min = 17; /* (3000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 12000: k0_min = 16; /* (3000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 16000: k0_min = 16; /* (4000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 22050: k0_min = 12; /* (4000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 24000: k0_min = 11; /* (4000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 32000: k0_min = 10; /* (5000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 44100: k0_min = 7; /* (5000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 48000: k0_min = 7; /* (5000 * nQmfChannels / fsSBR ) + 0.5 */ break; case 96000: k0_min = 3; /* (5000 * nQmfChannels / fsSBR ) + 0.5 */ break; default: k0_min=11; /* illegal fs */ } switch (fsCore) { case 8000: { INT v_offset[]= {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}; return (k0_min + v_offset[start_freq]); } case 11025: { INT v_offset[]= {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13}; return (k0_min + v_offset[start_freq]); } case 12000: { INT v_offset[]= {-5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}; return (k0_min + v_offset[start_freq]); } case 16000: { INT v_offset[]= {-6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}; return (k0_min + v_offset[start_freq]); } case 22050: case 24000: case 32000: { INT v_offset[]= {-4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20}; return (k0_min + v_offset[start_freq]); } case 44100: case 48000: case 96000: { INT v_offset[]= {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}; return (k0_min + v_offset[start_freq]); } default: { INT v_offset[]= {0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33}; return (k0_min + v_offset[start_freq]); } } } /* End getStartFreq */ /******************************************************************************* Functionname: getStopFreq ******************************************************************************* Description: Arguments: Return: *******************************************************************************/ static INT getStopFreq(INT fsCore, const INT stop_freq) { INT result,i; INT k1_min; INT v_dstop[13]; INT *v_stop_freq = NULL; INT v_stop_freq_16[14] = {48,49,50,51,52,54,55,56,57,59,60,61,63,64}; INT v_stop_freq_22[14] = {35,37,38,40,42,44,46,48,51,53,56,58,61,64}; INT v_stop_freq_24[14] = {32,34,36,38,40,42,44,46,49,52,55,58,61,64}; INT v_stop_freq_32[14] = {32,34,36,38,40,42,44,46,49,52,55,58,61,64}; INT v_stop_freq_44[14] = {23,25,27,29,32,34,37,40,43,47,51,55,59,64}; INT v_stop_freq_48[14] = {21,23,25,27,30,32,35,38,42,45,49,54,59,64}; INT v_stop_freq_64[14] = {20,22,24,26,29,31,34,37,41,45,49,54,59,64}; INT v_stop_freq_88[14] = {15,17,19,21,23,26,29,33,37,41,46,51,57,64}; INT v_stop_freq_96[14] = {13,15,17,19,21,24,27,31,35,39,44,50,57,64}; INT v_stop_freq_192[14] = {7, 8,10,12,14,16,19,23,27,32,38,46,54,64}; switch(fsCore){ case 8000: k1_min = 48; v_stop_freq =v_stop_freq_16; break; case 11025: k1_min = 35; v_stop_freq =v_stop_freq_22; break; case 12000: k1_min = 32; v_stop_freq =v_stop_freq_24; break; case 16000: k1_min = 32; v_stop_freq =v_stop_freq_32; break; case 22050: k1_min = 23; v_stop_freq =v_stop_freq_44; break; case 24000: k1_min = 21; v_stop_freq =v_stop_freq_48; break; case 32000: k1_min = 20; v_stop_freq =v_stop_freq_64; break; case 44100: k1_min = 15; v_stop_freq =v_stop_freq_88; break; case 48000: k1_min = 13; v_stop_freq =v_stop_freq_96; break; case 96000: k1_min = 7; v_stop_freq =v_stop_freq_192; break; default: k1_min = 21; /* illegal fs */ } /* if no valid core samplingrate is used this loop produces a segfault, because v_stop_freq is not initialized */ /* Ensure increasing bandwidth */ for(i = 0; i <= 12; i++) { v_dstop[i] = v_stop_freq[i+1] - v_stop_freq[i]; } FDKsbrEnc_Shellsort_int(v_dstop, 13); /* Sort bandwidth changes */ result = k1_min; for(i = 0; i < stop_freq; i++) { result = result + v_dstop[i]; } return(result); }/* End getStopFreq */ /******************************************************************************* Functionname: FDKsbrEnc_FindStartAndStopBand ******************************************************************************* Description: Arguments: srSbr SBR sampling freqency srCore AAC core sampling freqency noChannels Number of QMF channels startFreq SBR start frequency in QMF bands stopFreq SBR start frequency in QMF bands *k0 Output parameter *k2 Output parameter Return: Error code (0 is OK) *******************************************************************************/ INT FDKsbrEnc_FindStartAndStopBand( const INT srSbr, const INT srCore, const INT noChannels, const INT startFreq, const INT stopFreq, INT *k0, INT *k2 ) { /* Update startFreq struct */ *k0 = getStartFreq(srCore, startFreq); /* Test if start freq is outside corecoder range */ if( srSbr*noChannels < *k0 * srCore ) { return (1); /* raise the cross-over frequency and/or lower the number of target bands per octave (or lower the sampling frequency) */ } /*Update stopFreq struct */ if ( stopFreq < 14 ) { *k2 = getStopFreq(srCore, stopFreq); } else if( stopFreq == 14 ) { *k2 = 2 * *k0; } else { *k2 = 3 * *k0; } /* limit to Nyqvist */ if (*k2 > noChannels) { *k2 = noChannels; } /* Test for invalid k0 k2 combinations */ if ( (srCore == 22050) && ( (*k2 - *k0) > MAX_FREQ_COEFFS_FS44100 ) ) return (1); /* Number of bands exceeds valid range of MAX_FREQ_COEFFS for fs=44.1kHz */ if ( (srCore >= 24000) && ( (*k2 - *k0) > MAX_FREQ_COEFFS_FS48000 ) ) return (1); /* Number of bands exceeds valid range of MAX_FREQ_COEFFS for fs>=48kHz */ if ((*k2 - *k0) > MAX_FREQ_COEFFS) return (1);/*Number of bands exceeds valid range of MAX_FREQ_COEFFS */ if ((*k2 - *k0) < 0) return (1);/* Number of bands is negative */ return(0); } /******************************************************************************* Functionname: FDKsbrEnc_UpdateFreqScale ******************************************************************************* Description: Arguments: Return: *******************************************************************************/ INT FDKsbrEnc_UpdateFreqScale( UCHAR *v_k_master, INT *h_num_bands, const INT k0, const INT k2, const INT freqScale, const INT alterScale ) { INT b_p_o = 0; /* bands_per_octave */ FIXP_DBL warp = FL2FXCONST_DBL(0.0f); INT dk = 0; /* Internal variables */ INT k1 = 0, i; INT num_bands0; INT num_bands1; INT diff_tot[MAX_OCTAVE + MAX_SECOND_REGION]; INT *diff0 = diff_tot; INT *diff1 = diff_tot+MAX_OCTAVE; INT k2_achived; INT k2_diff; INT incr = 0; /* Init */ if (freqScale==1) b_p_o = 12; if (freqScale==2) b_p_o = 10; if (freqScale==3) b_p_o = 8; if(freqScale > 0) /*Bark*/ { if(alterScale==0) warp = FL2FXCONST_DBL(0.5f); /* 1.0/(1.0*2.0) */ else warp = FL2FXCONST_DBL(1.0f/2.6f); /* 1.0/(1.3*2.0); */ if(4*k2 >= 9*k0) /*two or more regions (how many times the basis band is copied)*/ { k1=2*k0; num_bands0=numberOfBands(b_p_o, k0, k1, FL2FXCONST_DBL(0.5f)); num_bands1=numberOfBands(b_p_o, k1, k2, warp); CalcBands(diff0, k0, k1, num_bands0);/*CalcBands1 => diff0 */ FDKsbrEnc_Shellsort_int( diff0, num_bands0);/*SortBands sort diff0 */ if (diff0[0] == 0) /* too wide FB bands for target tuning */ { return (1);/* raise the cross-over frequency and/or lower the number of target bands per octave (or lower the sampling frequency */ } cumSum(k0, diff0, num_bands0, v_k_master); /* cumsum */ CalcBands(diff1, k1, k2, num_bands1); /* CalcBands2 => diff1 */ FDKsbrEnc_Shellsort_int( diff1, num_bands1); /* SortBands sort diff1 */ if(diff0[num_bands0-1] > diff1[0]) /* max(1) > min(2) */ { if(modifyBands(diff0[num_bands0-1],diff1, num_bands1)) return(1); } /* Add 2'nd region */ cumSum(k1, diff1, num_bands1, &v_k_master[num_bands0]); *h_num_bands=num_bands0+num_bands1; /* Output nr of bands */ } else /* one region */ { k1=k2; num_bands0=numberOfBands(b_p_o, k0, k1, FL2FXCONST_DBL(0.5f)); CalcBands(diff0, k0, k1, num_bands0);/* CalcBands1 => diff0 */ FDKsbrEnc_Shellsort_int( diff0, num_bands0); /* SortBands sort diff0 */ if (diff0[0] == 0) /* too wide FB bands for target tuning */ { return (1); /* raise the cross-over frequency and/or lower the number of target bands per octave (or lower the sampling frequency */ } cumSum(k0, diff0, num_bands0, v_k_master);/* cumsum */ *h_num_bands=num_bands0; /* Output nr of bands */ } } else /* Linear mode */ { if (alterScale==0) { dk = 1; num_bands0 = 2 * ((k2 - k0)/2); /* FLOOR to get to few number of bands*/ } else { dk = 2; num_bands0 = 2 * (((k2 - k0)/dk +1)/2); /* ROUND to get closest fit */ } k2_achived = k0 + num_bands0*dk; k2_diff = k2 - k2_achived; for(i=0;i<num_bands0;i++) diff_tot[i] = dk; /* If linear scale wasn't achived */ /* and we got wide SBR are */ if (k2_diff < 0) { incr = 1; i = 0; } /* If linear scale wasn't achived */ /* and we got small SBR are */ if (k2_diff > 0) { incr = -1; i = num_bands0-1; } /* Adjust diff vector to get sepc. SBR range */ while (k2_diff != 0) { diff_tot[i] = diff_tot[i] - incr; i = i + incr; k2_diff = k2_diff + incr; } cumSum(k0, diff_tot, num_bands0, v_k_master);/* cumsum */ *h_num_bands=num_bands0; /* Output nr of bands */ } if (*h_num_bands < 1) return(1); /*To small sbr area */ return (0); }/* End FDKsbrEnc_UpdateFreqScale */ static INT numberOfBands(INT b_p_o, INT start, INT stop, FIXP_DBL warp_factor) { INT result=0; /* result = 2* (INT) ( (double)b_p_o * (double)(FDKlog((double)stop/(double)start)/FDKlog((double)2)) * (double)FX_DBL2FL(warp_factor) + 0.5); */ result = ( ( b_p_o * fMult( (CalcLdInt(stop) - CalcLdInt(start)), warp_factor) + (FL2FX_DBL(0.5f)>>LD_DATA_SHIFT) ) >> ((DFRACT_BITS-1)-LD_DATA_SHIFT) ) << 1; /* do not optimize anymore (rounding!!) */ return(result); } static void CalcBands(INT * diff, INT start , INT stop , INT num_bands) { INT i, qb, qe, qtmp; INT previous; INT current; FIXP_DBL base, exp, tmp; previous=start; for(i=1; i<= num_bands; i++) { base = fDivNorm((FIXP_DBL)stop, (FIXP_DBL)start, &qb); exp = fDivNorm((FIXP_DBL)i, (FIXP_DBL)num_bands, &qe); tmp = fPow(base, qb, exp, qe, &qtmp); tmp = fMult(tmp, (FIXP_DBL)(start<<24)); current = (INT)scaleValue(tmp, qtmp-23); current = (current+1) >> 1; /* rounding*/ diff[i-1] = current-previous; previous = current; } }/* End CalcBands */ static void cumSum(INT start_value, INT* diff, INT length, UCHAR *start_adress) { INT i; start_adress[0]=start_value; for(i=1;i<=length;i++) start_adress[i]=start_adress[i-1]+diff[i-1]; } /* End cumSum */ static INT modifyBands(INT max_band_previous, INT * diff, INT length) { INT change=max_band_previous-diff[0]; /* Limit the change so that the last band cannot get narrower than the first one */ if ( change > (diff[length-1] - diff[0]) / 2 ) change = (diff[length-1] - diff[0]) / 2; diff[0] += change; diff[length-1] -= change; FDKsbrEnc_Shellsort_int(diff, length); return(0); }/* End modifyBands */ /******************************************************************************* Functionname: FDKsbrEnc_UpdateHiRes ******************************************************************************* Description: Arguments: Return: *******************************************************************************/ INT FDKsbrEnc_UpdateHiRes( UCHAR *h_hires, INT *num_hires, UCHAR *v_k_master, INT num_master, INT *xover_band ) { INT i; INT max1,max2; if( (v_k_master[*xover_band] > 32 ) || /* v_k_master[*xover_band] > noQMFChannels(dualRate)/divider */ ( *xover_band > num_master ) ) { /* xover_band error, too big for this startFreq. Will be clipped */ /* Calculate maximum value for xover_band */ max1=0; max2=num_master; while( (v_k_master[max1+1] < 32 ) && /* noQMFChannels(dualRate)/divider */ ( (max1+1) < max2) ) { max1++; } *xover_band=max1; } *num_hires = num_master - *xover_band; for(i = *xover_band; i <= num_master; i++) { h_hires[i - *xover_band] = v_k_master[i]; } return (0); }/* End FDKsbrEnc_UpdateHiRes */ /******************************************************************************* Functionname: FDKsbrEnc_UpdateLoRes ******************************************************************************* Description: Arguments: Return: *******************************************************************************/ void FDKsbrEnc_UpdateLoRes(UCHAR * h_lores, INT *num_lores, UCHAR * h_hires, INT num_hires) { INT i; if(num_hires%2 == 0) /* if even number of hires bands */ { *num_lores=num_hires/2; /* Use every second lores=hires[0,2,4...] */ for(i=0;i<=*num_lores;i++) h_lores[i]=h_hires[i*2]; } else /* odd number of hires which means xover is odd */ { *num_lores=(num_hires+1)/2; /* Use lores=hires[0,1,3,5 ...] */ h_lores[0]=h_hires[0]; for(i=1;i<=*num_lores;i++) { h_lores[i]=h_hires[i*2-1]; } } }/* End FDKsbrEnc_UpdateLoRes */
#include "catch.hpp" #include "JumpGame.hpp" TEST_CASE("Jump Game") { JumpGame s; SECTION("Sample tests") { vector<int> nums_1{2, 3, 1, 1, 4}; REQUIRE(s.canJump(nums_1)); vector<int> nums_2{3, 2, 1, 0, 4}; REQUIRE_FALSE(s.canJump(nums_2)); } }
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System; using TerraFX.ApplicationModel; using TerraFX.Graphics; using TerraFX.Numerics; using static TerraFX.Utilities.UnsafeUtilities; namespace TerraFX.Samples.Graphics; public sealed class HelloTransform : HelloWindow { private GraphicsBuffer _constantBuffer = null!; private GraphicsPrimitive _trianglePrimitive = null!; private GraphicsBuffer _uploadBuffer = null!; private GraphicsBuffer _vertexBuffer = null!; private float _trianglePrimitiveTranslationX; public HelloTransform(string name, ApplicationServiceProvider serviceProvider) : base(name, serviceProvider) { } public override void Cleanup() { _trianglePrimitive?.Dispose(); _constantBuffer?.Dispose(); _uploadBuffer?.Dispose(); _vertexBuffer?.Dispose(); base.Cleanup(); } /// <summary>Initializes the GUI for this sample.</summary> /// <param name="application">The hosting <see cref="Application" />.</param> /// <param name="timeout">The <see cref="TimeSpan" /> after which this sample should stop running.</param> /// <param name="windowLocation">The <see cref="Vector2" /> that defines the initial window location.</param> /// <param name="windowSize">The <see cref="Vector2" /> that defines the initial window client rectangle size.</param> public override void Initialize(Application application, TimeSpan timeout, Vector2? windowLocation, Vector2? windowSize) { base.Initialize(application, timeout, windowLocation, windowSize); var graphicsDevice = GraphicsDevice; _constantBuffer = graphicsDevice.CreateConstantBuffer(64 * 1024, GraphicsResourceCpuAccess.Write); _uploadBuffer = graphicsDevice.CreateUploadBuffer(64 * 1024); _vertexBuffer = graphicsDevice.CreateVertexBuffer(64 * 1024); var graphicsCopyContext = graphicsDevice.RentCopyContext(); { graphicsCopyContext.Reset(); _trianglePrimitive = CreateTrianglePrimitive(graphicsCopyContext); graphicsCopyContext.Flush(); graphicsDevice.WaitForIdle(); } graphicsDevice.ReturnContext(graphicsCopyContext); _uploadBuffer.DisposeAllViews(); } protected override void Draw(GraphicsRenderContext graphicsRenderContext) { _trianglePrimitive.Draw(graphicsRenderContext); base.Draw(graphicsRenderContext); } protected override unsafe void Update(TimeSpan delta) { const float TranslationSpeed = 1.0f; const float OffsetBounds = 1.25f; var trianglePrimitiveTranslationX = _trianglePrimitiveTranslationX; { trianglePrimitiveTranslationX += (float)(TranslationSpeed * delta.TotalSeconds); if (trianglePrimitiveTranslationX > OffsetBounds) { trianglePrimitiveTranslationX = -OffsetBounds; } } _trianglePrimitiveTranslationX = trianglePrimitiveTranslationX; var constantBufferView = _trianglePrimitive.PipelineResourceViews![1].As<GraphicsBufferView>(); var constantBufferSpan = constantBufferView.Map<Matrix4x4>(); { // Shaders take transposed matrices, so we want to set X.W constantBufferSpan[0] = Matrix4x4.Identity; constantBufferSpan[0].X = Vector4.Create(1.0f, 0.0f, 0.0f, trianglePrimitiveTranslationX); } constantBufferView.UnmapAndWrite(); } private unsafe GraphicsPrimitive CreateTrianglePrimitive(GraphicsCopyContext graphicsCopyContext) { var graphicsRenderPass = GraphicsRenderPass; var graphicsSurface = graphicsRenderPass.Surface; var graphicsPipeline = CreateGraphicsPipeline(graphicsRenderPass, "Transform", "main", "main"); var constantBuffer = _constantBuffer; var uploadBuffer = _uploadBuffer; return new GraphicsPrimitive( graphicsPipeline, CreateVertexBufferView(graphicsCopyContext, _vertexBuffer, uploadBuffer, aspectRatio: graphicsSurface.Width / graphicsSurface.Height), resourceViews: new GraphicsResourceView[2] { CreateConstantBufferView(graphicsCopyContext, constantBuffer), CreateConstantBufferView(graphicsCopyContext, constantBuffer), } ); static GraphicsBufferView CreateConstantBufferView(GraphicsCopyContext graphicsCopyContext, GraphicsBuffer constantBuffer) { var constantBufferView = constantBuffer.CreateView<Matrix4x4>(1); var constantBufferSpan = constantBufferView.Map<Matrix4x4>(); { constantBufferSpan[0] = Matrix4x4.Identity; } constantBufferView.UnmapAndWrite(); return constantBufferView; } static GraphicsBufferView CreateVertexBufferView(GraphicsCopyContext graphicsCopyContext, GraphicsBuffer vertexBuffer, GraphicsBuffer uploadBuffer, float aspectRatio) { var uploadBufferView = uploadBuffer.CreateView<IdentityVertex>(3); var vertexBufferSpan = uploadBufferView.Map<IdentityVertex>(); { vertexBufferSpan[0] = new IdentityVertex { Color = Colors.Red, Position = Vector3.Create(0.0f, 0.25f * aspectRatio, 0.0f), }; vertexBufferSpan[1] = new IdentityVertex { Color = Colors.Lime, Position = Vector3.Create(0.25f, -0.25f * aspectRatio, 0.0f), }; vertexBufferSpan[2] = new IdentityVertex { Color = Colors.Blue, Position = Vector3.Create(-0.25f, -0.25f * aspectRatio, 0.0f), }; } uploadBufferView.UnmapAndWrite(); var vertexBufferView = vertexBuffer.CreateView<IdentityVertex>(3); graphicsCopyContext.Copy(vertexBufferView, uploadBufferView); return vertexBufferView; } GraphicsPipeline CreateGraphicsPipeline(GraphicsRenderPass graphicsRenderPass, string shaderName, string vertexShaderEntryPoint, string pixelShaderEntryPoint) { var graphicsDevice = graphicsRenderPass.Device; var signature = CreateGraphicsPipelineSignature(graphicsDevice); var vertexShader = CompileShader(graphicsDevice, GraphicsShaderKind.Vertex, shaderName, vertexShaderEntryPoint); var pixelShader = CompileShader(graphicsDevice, GraphicsShaderKind.Pixel, shaderName, pixelShaderEntryPoint); return graphicsRenderPass.CreatePipeline(signature, vertexShader, pixelShader); } static GraphicsPipelineSignature CreateGraphicsPipelineSignature(GraphicsDevice graphicsDevice) { var inputs = new GraphicsPipelineInput[1] { new GraphicsPipelineInput( new GraphicsPipelineInputElement[2] { new GraphicsPipelineInputElement(GraphicsPipelineInputElementKind.Color, GraphicsFormat.R32G32B32A32_SFLOAT, size: 16, alignment: 16), new GraphicsPipelineInputElement(GraphicsPipelineInputElementKind.Position, GraphicsFormat.R32G32B32_SFLOAT, size: 12, alignment: 4), } ), }; var resources = new GraphicsPipelineResourceInfo[2] { new GraphicsPipelineResourceInfo(GraphicsPipelineResourceKind.ConstantBuffer, GraphicsShaderVisibility.Vertex), new GraphicsPipelineResourceInfo(GraphicsPipelineResourceKind.ConstantBuffer, GraphicsShaderVisibility.Vertex), }; return graphicsDevice.CreatePipelineSignature(inputs, resources); } } }
######################################## # Automatically generated, do not edit. ######################################## from pyvisdk.thirdparty import Enum EventCategory = Enum( 'error', 'info', 'user', 'warning', )
using UnityEngine; using HoloToolkit.Unity.InputModule; public class ObjectTapHandler : MonoBehaviour, IInputClickHandler { /// <summary> /// Handles the users taps on objects. /// </summary> /// private AudioClip clickFeedback; private AudioSource audioSource; void Start() { var audioContainer = GameObject.Find("AudioContainer"); audioSource = audioContainer.GetComponents<AudioSource>()[1]; clickFeedback = Resources.Load<AudioClip>("Audio/highclick"); } public void OnInputClicked(InputClickedEventData eventData) { audioSource.PlayOneShot(clickFeedback, 0.1f); ObjectInteraction.Instance.Tap(gameObject); } }
import { exec, getById } from "../database/database"; import Gender from "../entities/gender"; export default class GenderController { constructor() {} static getById(id, as_object = true) { let gender = null; let results = getById(id, ` SELECT t1.id, t1.identifier as name FROM genders as t1 `); if(results) { gender = (as_object) ? new Gender(results) : results; } console.log(results); return gender; } }
<span class="error-message d"> The email addresses you have provided do not match </span>
require 'mcll4r' require 'test/unit' class Mcll4rTest < Test::Unit::TestCase def setup @mcll4r = Mcll4r.new end def test_assert_we_get_back_correct_district_data expected = { "response" => { "state_upper" => { "district" => "029", "display_name" => "TX 29th", "state" => "TX" }, "federal" => { "district" => "16", "display_name" => "TX 16th", "state" => "TX" }, "state_lower" => { "district" => "077", "display_name" => "TX 77th", "state" => "TX" }, "lng" => "-106.490969", "lat" => "31.76321" } } assert_equal expected, @mcll4r.district_lookup(31.76321, -106.490969) end def test_assert_raise_on_error assert_raise DistrictNotFound do @mcll4r.district_lookup(nil,nil) end end def test_assert_raise_on_district_not_found assert_raise DistrictNotFound do @mcll4r.district_lookup( 1.0, 1.0 ) end end end
--- title: борса-онлайн inshort: неопределен translator: Microsoft Cognitive Services ---
import requests import csv from configparser import ConfigParser config = ConfigParser() config.read("config.cfg") token = config.get("auth", "token") domain = config.get("instance", "domain") headers = {"Authorization" : "Bearer %s" % token} source_course_id = 311693 csv_file = "" payload = {'migration_type': 'course_copy_importer', 'settings[source_course_id]': source_course_id} with open(csv_file, 'rb') as courses: coursesreader = csv.reader(courses) for course in coursesreader: uri = domain + "/api/v1/courses/sis_course_id:%s/content_migrations" % course r = requests.post(uri, headers=headers,data=payload) print r.status_code + " " + course
<?php /** * Created by HKM Corporation. * User: Hesk * Date: 14年8月28日 * Time: 上午11:37 */ abstract class SingleBase { protected $db, $table, $stock_operation, $app_comment; protected $post_id, $lang, $content, $cate_list; public function __construct($ID) { global $wpdb; $this->post_id = (int)$ID; if (isset($_GET['lang'])) $this->lang = $_GET['lang']; if (!$this->isType(get_post_type($this->post_id))) throw new Exception("post type check failed. this object_id is not valid for this post type or this id is not exist", 1047); if (get_post_status($this->post_id) != 'publish') throw new Exception("the object id is not ready", 1048); $this->db = $wpdb; $this->beforeQuery(); $this->content = $this->queryobject(); } abstract protected function beforeQuery(); public function __destruct() { $this->db = NULL; $this->content = NULL; $this->stock_operation = NULL; $this->app_comment = NULL; } protected function isType($type) { return true; } abstract protected function queryobject(); protected function get_terms($tax) { $terms = $tax == "category" ? get_the_category($this->post_id) : get_the_terms($this->post_id, $tax); //resposne in david request for android development return !$terms ? array() : $terms; } protected function get_terms_images($taxonomy_id) { $array_terms = $taxonomy_id == "category" ? get_the_category($this->post_id) : get_the_terms($this->post_id, $taxonomy_id); $this->cate_list = array(); foreach ($array_terms as $cat) : $this->cate_list[] = $this->cat_loop($cat, true, strtolower($taxonomy_id) == "category", $taxonomy_id); endforeach; return count($this->cate_list) == 0 ? array() : $this->cate_list; } protected $filter_keys_setting = 0; /** * cate data loop * * @param $cat * @param bool $image * @param bool $isCate * @param $taxonomy_id * @throws Exception * @return array */ private function cat_loop($cat, $image = false, $isCate = false, $taxonomy_id) { $image_url = ""; if ($image && !function_exists('z_taxonomy_image_url')) { throw new Exception("image module not found."); } if ($isCate) { $desc = category_description($cat->term_id); } else { $text = trim(wp_kses(term_description($cat->term_id, $taxonomy_id), array())); $desc = str_replace('\n', "", $text); } if ($this->filter_keys_setting === 1) { return array( "name" => trim($cat->name), "countrycode" => $desc ); } else { if ($image) { return array( /* "unpress" => z_taxonomy_image_url($cat->term_id), "press" => z_taxonomy_image_url($cat->term_id, 2), "unpress_s" => z_taxonomy_image_url($cat->term_id, 3), "press_s" => z_taxonomy_image_url($cat->term_id, 4),*/ "name" => trim($cat->name), "description" => $desc, "id" => intval($cat->term_id), ); } else { return array( "name" => trim($cat->name), "description" => $desc, "id" => intval($cat->term_id), ); } } } /** * wordpress: wp_get_attachment_image_src * @param $key * @return mixed */ protected function get_product_image($key) { $list = get_post_meta($this->post_id, $key, true); $optionpost = wp_get_attachment_image_src($list, 'large'); return $optionpost[0]; } protected function get_image_series($key) { $list = get_post_meta($this->post_id, $key, false); $arr = array(); if (count($list) > 0) foreach ($list[0] as $id) { $image = wp_get_attachment_image_src($id, 'large'); $arr[] = array( "ID" => $id, "url" => $image[0], ); } return $arr; } protected function get_structure() { return json_decode(stripslashes(get_post_meta($this->post_id, "ext_v2", true)), true); } }
source ~/.bash/mac/sysadmin.bash
package equus.webstack.application; import java.net.URI; import javax.ws.rs.core.UriBuilder; import lombok.Setter; import lombok.SneakyThrows; import lombok.val; import lombok.extern.slf4j.Slf4j; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.webapp.WebAppContext; @Slf4j public class JettyStarter { private final int port = 9010; private final String contextPath = "/java-web-stack/"; private final String apiPath = "api"; @Setter private boolean resourceEnable = true; private String resourceBase = "WebContent"; public static void main(String[] args) { JettyStarter jetty = new JettyStarter(); if (args.length > 0) { jetty.resourceBase = args[0]; } jetty.start(); } @SneakyThrows public void start() { Server server = startServer(); server.join(); } @SneakyThrows public Server startServer() { val server = createServer(); val shutdownHook = new Thread(() -> { try { server.stop(); } catch (Throwable t) { log.error("unknown error occurred.", t); } }, "shutdown-hook"); Runtime.getRuntime().addShutdownHook(shutdownHook); server.start(); if (resourceEnable) { System.out.println("URL " + getBaseURI()); } System.out.println("API URL " + getAPIBaseURI()); return server; } public URI getBaseURI() { return UriBuilder.fromUri("http://localhost/").port(port).path(contextPath).build(); } public URI getAPIBaseURI() { return UriBuilder.fromUri("http://localhost/").port(port).path(contextPath).path(apiPath).build(); } private Server createServer() { val server = new Server(port); val context = new WebAppContext(); context.setServer(server); context.setContextPath(contextPath); context.setDescriptor("WebContent/WEB-INF/web.xml"); context.setParentLoaderPriority(true); if (resourceEnable) { context.setResourceBase(resourceBase); } server.setHandler(context); return server; } }
package tweaking.concurrency.reetrantLockExample; public class MainClass { public static void main(final String[] args) { final ThreadSafeArrayList<String> threadSafeList = new ThreadSafeArrayList<>(); final ListAdderThread threadA = new ListAdderThread("threadA", threadSafeList); final ListAdderThread threadB = new ListAdderThread("threadB", threadSafeList); final ListAdderThread threadC = new ListAdderThread("threadC", threadSafeList); threadA.start(); threadB.start(); threadC.start(); } }
# frozen_string_literal: true module M3u8 # DateRangeItem represents a #EXT-X-DATERANGE tag class DateRangeItem include M3u8 attr_accessor :id, :class_name, :start_date, :end_date, :duration, :planned_duration, :scte35_cmd, :scte35_out, :scte35_in, :end_on_next, :client_attributes def initialize(options = {}) options.each do |key, value| instance_variable_set("@#{key}", value) end end def parse(text) attributes = parse_attributes(text) @id = attributes['ID'] @class_name = attributes['CLASS'] @start_date = attributes['START-DATE'] @end_date = attributes['END-DATE'] @duration = parse_float(attributes['DURATION']) @planned_duration = parse_float(attributes['PLANNED-DURATION']) @scte35_cmd = attributes['SCTE35-CMD'] @scte35_out = attributes['SCTE35-OUT'] @scte35_in = attributes['SCTE35-IN'] @end_on_next = attributes.key?('END-ON-NEXT') ? true : false @client_attributes = parse_client_attributes(attributes) end def to_s "#EXT-X-DATERANGE:#{formatted_attributes}" end private def formatted_attributes [%(ID="#{id}"), class_name_format, %(START-DATE="#{start_date}"), end_date_format, duration_format, planned_duration_format, client_attributes_format, scte35_cmd_format, scte35_out_format, scte35_in_format, end_on_next_format].compact.join(',') end def class_name_format return if class_name.nil? %(CLASS="#{class_name}") end def end_date_format return if end_date.nil? %(END-DATE="#{end_date}") end def duration_format return if duration.nil? "DURATION=#{duration}" end def planned_duration_format return if planned_duration.nil? "PLANNED-DURATION=#{planned_duration}" end def client_attributes_format return if client_attributes.nil? client_attributes.map do |attribute| value = attribute.last value_format = decimal?(value) ? value : %("#{value}") "#{attribute.first}=#{value_format}" end end def decimal?(value) return true if value =~ /\A\d+\Z/ begin return true if Float(value) rescue false end end def scte35_cmd_format return if scte35_cmd.nil? "SCTE35-CMD=#{scte35_cmd}" end def scte35_out_format return if scte35_out.nil? "SCTE35-OUT=#{scte35_out}" end def scte35_in_format return if scte35_in.nil? "SCTE35-IN=#{scte35_in}" end def end_on_next_format return unless end_on_next 'END-ON-NEXT=YES' end def parse_client_attributes(attributes) attributes.select { |key| key.start_with?('X-') } end end end
using System; using System.Collections; using System.Windows.Media; using Microsoft.Win32; using MS.Win32; namespace System.Windows { /// <summary> /// Contains properties that are queries into the system's various colors. /// </summary> public static class SystemColors { #region Colors /// <summary> /// System color of the same name. /// </summary> public static Color ActiveBorderColor { get { return GetSystemColor(CacheSlot.ActiveBorder); } } /// <summary> /// System color of the same name. /// </summary> public static Color ActiveCaptionColor { get { return GetSystemColor(CacheSlot.ActiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static Color ActiveCaptionTextColor { get { return GetSystemColor(CacheSlot.ActiveCaptionText); } } /// <summary> /// System color of the same name. /// </summary> public static Color AppWorkspaceColor { get { return GetSystemColor(CacheSlot.AppWorkspace); } } /// <summary> /// System color of the same name. /// </summary> public static Color ControlColor { get { return GetSystemColor(CacheSlot.Control); } } /// <summary> /// System color of the same name. /// </summary> public static Color ControlDarkColor { get { return GetSystemColor(CacheSlot.ControlDark); } } /// <summary> /// System color of the same name. /// </summary> public static Color ControlDarkDarkColor { get { return GetSystemColor(CacheSlot.ControlDarkDark); } } /// <summary> /// System color of the same name. /// </summary> public static Color ControlLightColor { get { return GetSystemColor(CacheSlot.ControlLight); } } /// <summary> /// System color of the same name. /// </summary> public static Color ControlLightLightColor { get { return GetSystemColor(CacheSlot.ControlLightLight); } } /// <summary> /// System color of the same name. /// </summary> public static Color ControlTextColor { get { return GetSystemColor(CacheSlot.ControlText); } } /// <summary> /// System color of the same name. /// </summary> public static Color DesktopColor { get { return GetSystemColor(CacheSlot.Desktop); } } /// <summary> /// System color of the same name. /// </summary> public static Color GradientActiveCaptionColor { get { return GetSystemColor(CacheSlot.GradientActiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static Color GradientInactiveCaptionColor { get { return GetSystemColor(CacheSlot.GradientInactiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static Color GrayTextColor { get { return GetSystemColor(CacheSlot.GrayText); } } /// <summary> /// System color of the same name. /// </summary> public static Color HighlightColor { get { return GetSystemColor(CacheSlot.Highlight); } } /// <summary> /// System color of the same name. /// </summary> public static Color HighlightTextColor { get { return GetSystemColor(CacheSlot.HighlightText); } } /// <summary> /// System color of the same name. /// </summary> public static Color HotTrackColor { get { return GetSystemColor(CacheSlot.HotTrack); } } /// <summary> /// System color of the same name. /// </summary> public static Color InactiveBorderColor { get { return GetSystemColor(CacheSlot.InactiveBorder); } } /// <summary> /// System color of the same name. /// </summary> public static Color InactiveCaptionColor { get { return GetSystemColor(CacheSlot.InactiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static Color InactiveCaptionTextColor { get { return GetSystemColor(CacheSlot.InactiveCaptionText); } } /// <summary> /// System color of the same name. /// </summary> public static Color InfoColor { get { return GetSystemColor(CacheSlot.Info); } } /// <summary> /// System color of the same name. /// </summary> public static Color InfoTextColor { get { return GetSystemColor(CacheSlot.InfoText); } } /// <summary> /// System color of the same name. /// </summary> public static Color MenuColor { get { return GetSystemColor(CacheSlot.Menu); } } /// <summary> /// System color of the same name. /// </summary> public static Color MenuBarColor { get { return GetSystemColor(CacheSlot.MenuBar); } } /// <summary> /// System color of the same name. /// </summary> public static Color MenuHighlightColor { get { return GetSystemColor(CacheSlot.MenuHighlight); } } /// <summary> /// System color of the same name. /// </summary> public static Color MenuTextColor { get { return GetSystemColor(CacheSlot.MenuText); } } /// <summary> /// System color of the same name. /// </summary> public static Color ScrollBarColor { get { return GetSystemColor(CacheSlot.ScrollBar); } } /// <summary> /// System color of the same name. /// </summary> public static Color WindowColor { get { return GetSystemColor(CacheSlot.Window); } } /// <summary> /// System color of the same name. /// </summary> public static Color WindowFrameColor { get { return GetSystemColor(CacheSlot.WindowFrame); } } /// <summary> /// System color of the same name. /// </summary> public static Color WindowTextColor { get { return GetSystemColor(CacheSlot.WindowText); } } #endregion [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static SystemResourceKey CreateInstance(SystemResourceKeyID KeyId) { return new SystemResourceKey(KeyId); } #region Color Keys /// <summary> /// ActiveBorderColor System Resource Key /// </summary> public static ResourceKey ActiveBorderColorKey { get { if (_cacheActiveBorderColor == null) { _cacheActiveBorderColor = CreateInstance(SystemResourceKeyID.ActiveBorderColor); } return _cacheActiveBorderColor; } } /// <summary> /// ActiveCaptionColor System Resource Key /// </summary> public static ResourceKey ActiveCaptionColorKey { get { if (_cacheActiveCaptionColor == null) { _cacheActiveCaptionColor = CreateInstance(SystemResourceKeyID.ActiveCaptionColor); } return _cacheActiveCaptionColor; } } /// <summary> /// ActiveCaptionTextColor System Resource Key /// </summary> public static ResourceKey ActiveCaptionTextColorKey { get { if (_cacheActiveCaptionTextColor == null) { _cacheActiveCaptionTextColor = CreateInstance(SystemResourceKeyID.ActiveCaptionTextColor); } return _cacheActiveCaptionTextColor; } } /// <summary> /// AppWorkspaceColor System Resource Key /// </summary> public static ResourceKey AppWorkspaceColorKey { get { if (_cacheAppWorkspaceColor == null) { _cacheAppWorkspaceColor = CreateInstance(SystemResourceKeyID.AppWorkspaceColor); } return _cacheAppWorkspaceColor; } } /// <summary> /// ControlColor System Resource Key /// </summary> public static ResourceKey ControlColorKey { get { if (_cacheControlColor == null) { _cacheControlColor = CreateInstance(SystemResourceKeyID.ControlColor); } return _cacheControlColor; } } /// <summary> /// ControlDarkColor System Resource Key /// </summary> public static ResourceKey ControlDarkColorKey { get { if (_cacheControlDarkColor == null) { _cacheControlDarkColor = CreateInstance(SystemResourceKeyID.ControlDarkColor); } return _cacheControlDarkColor; } } /// <summary> /// ControlDarkDarkColor System Resource Key /// </summary> public static ResourceKey ControlDarkDarkColorKey { get { if (_cacheControlDarkDarkColor == null) { _cacheControlDarkDarkColor = CreateInstance(SystemResourceKeyID.ControlDarkDarkColor); } return _cacheControlDarkDarkColor; } } /// <summary> /// ControlLightColor System Resource Key /// </summary> public static ResourceKey ControlLightColorKey { get { if (_cacheControlLightColor == null) { _cacheControlLightColor = CreateInstance(SystemResourceKeyID.ControlLightColor); } return _cacheControlLightColor; } } /// <summary> /// ControlLightLightColor System Resource Key /// </summary> public static ResourceKey ControlLightLightColorKey { get { if (_cacheControlLightLightColor == null) { _cacheControlLightLightColor = CreateInstance(SystemResourceKeyID.ControlLightLightColor); } return _cacheControlLightLightColor; } } /// <summary> /// ControlTextColor System Resource Key /// </summary> public static ResourceKey ControlTextColorKey { get { if (_cacheControlTextColor == null) { _cacheControlTextColor = CreateInstance(SystemResourceKeyID.ControlTextColor); } return _cacheControlTextColor; } } /// <summary> /// DesktopColor System Resource Key /// </summary> public static ResourceKey DesktopColorKey { get { if (_cacheDesktopColor == null) { _cacheDesktopColor = CreateInstance(SystemResourceKeyID.DesktopColor); } return _cacheDesktopColor; } } /// <summary> /// GradientActiveCaptionColor System Resource Key /// </summary> public static ResourceKey GradientActiveCaptionColorKey { get { if (_cacheGradientActiveCaptionColor == null) { _cacheGradientActiveCaptionColor = CreateInstance(SystemResourceKeyID.GradientActiveCaptionColor); } return _cacheGradientActiveCaptionColor; } } /// <summary> /// GradientInactiveCaptionColor System Resource Key /// </summary> public static ResourceKey GradientInactiveCaptionColorKey { get { if (_cacheGradientInactiveCaptionColor == null) { _cacheGradientInactiveCaptionColor = CreateInstance(SystemResourceKeyID.GradientInactiveCaptionColor); } return _cacheGradientInactiveCaptionColor; } } /// <summary> /// GrayTextColor System Resource Key /// </summary> public static ResourceKey GrayTextColorKey { get { if (_cacheGrayTextColor == null) { _cacheGrayTextColor = CreateInstance(SystemResourceKeyID.GrayTextColor); } return _cacheGrayTextColor; } } /// <summary> /// HighlightColor System Resource Key /// </summary> public static ResourceKey HighlightColorKey { get { if (_cacheHighlightColor == null) { _cacheHighlightColor = CreateInstance(SystemResourceKeyID.HighlightColor); } return _cacheHighlightColor; } } /// <summary> /// HighlightTextColor System Resource Key /// </summary> public static ResourceKey HighlightTextColorKey { get { if (_cacheHighlightTextColor == null) { _cacheHighlightTextColor = CreateInstance(SystemResourceKeyID.HighlightTextColor); } return _cacheHighlightTextColor; } } /// <summary> /// HotTrackColor System Resource Key /// </summary> public static ResourceKey HotTrackColorKey { get { if (_cacheHotTrackColor == null) { _cacheHotTrackColor = CreateInstance(SystemResourceKeyID.HotTrackColor); } return _cacheHotTrackColor; } } /// <summary> /// InactiveBorderColor System Resource Key /// </summary> public static ResourceKey InactiveBorderColorKey { get { if (_cacheInactiveBorderColor == null) { _cacheInactiveBorderColor = CreateInstance(SystemResourceKeyID.InactiveBorderColor); } return _cacheInactiveBorderColor; } } /// <summary> /// InactiveCaptionColor System Resource Key /// </summary> public static ResourceKey InactiveCaptionColorKey { get { if (_cacheInactiveCaptionColor == null) { _cacheInactiveCaptionColor = CreateInstance(SystemResourceKeyID.InactiveCaptionColor); } return _cacheInactiveCaptionColor; } } /// <summary> /// InactiveCaptionTextColor System Resource Key /// </summary> public static ResourceKey InactiveCaptionTextColorKey { get { if (_cacheInactiveCaptionTextColor == null) { _cacheInactiveCaptionTextColor = CreateInstance(SystemResourceKeyID.InactiveCaptionTextColor); } return _cacheInactiveCaptionTextColor; } } /// <summary> /// InfoColor System Resource Key /// </summary> public static ResourceKey InfoColorKey { get { if (_cacheInfoColor == null) { _cacheInfoColor = CreateInstance(SystemResourceKeyID.InfoColor); } return _cacheInfoColor; } } /// <summary> /// InfoTextColor System Resource Key /// </summary> public static ResourceKey InfoTextColorKey { get { if (_cacheInfoTextColor == null) { _cacheInfoTextColor = CreateInstance(SystemResourceKeyID.InfoTextColor); } return _cacheInfoTextColor; } } /// <summary> /// MenuColor System Resource Key /// </summary> public static ResourceKey MenuColorKey { get { if (_cacheMenuColor == null) { _cacheMenuColor = CreateInstance(SystemResourceKeyID.MenuColor); } return _cacheMenuColor; } } /// <summary> /// MenuBarColor System Resource Key /// </summary> public static ResourceKey MenuBarColorKey { get { if (_cacheMenuBarColor == null) { _cacheMenuBarColor = CreateInstance(SystemResourceKeyID.MenuBarColor); } return _cacheMenuBarColor; } } /// <summary> /// MenuHighlightColor System Resource Key /// </summary> public static ResourceKey MenuHighlightColorKey { get { if (_cacheMenuHighlightColor == null) { _cacheMenuHighlightColor = CreateInstance(SystemResourceKeyID.MenuHighlightColor); } return _cacheMenuHighlightColor; } } /// <summary> /// MenuTextColor System Resource Key /// </summary> public static ResourceKey MenuTextColorKey { get { if (_cacheMenuTextColor == null) { _cacheMenuTextColor = CreateInstance(SystemResourceKeyID.MenuTextColor); } return _cacheMenuTextColor; } } /// <summary> /// ScrollBarColor System Resource Key /// </summary> public static ResourceKey ScrollBarColorKey { get { if (_cacheScrollBarColor == null) { _cacheScrollBarColor = CreateInstance(SystemResourceKeyID.ScrollBarColor); } return _cacheScrollBarColor; } } /// <summary> /// WindowColor System Resource Key /// </summary> public static ResourceKey WindowColorKey { get { if (_cacheWindowColor == null) { _cacheWindowColor = CreateInstance(SystemResourceKeyID.WindowColor); } return _cacheWindowColor; } } /// <summary> /// WindowFrameColor System Resource Key /// </summary> public static ResourceKey WindowFrameColorKey { get { if (_cacheWindowFrameColor == null) { _cacheWindowFrameColor = CreateInstance(SystemResourceKeyID.WindowFrameColor); } return _cacheWindowFrameColor; } } /// <summary> /// WindowTextColor System Resource Key /// </summary> public static ResourceKey WindowTextColorKey { get { if (_cacheWindowTextColor == null) { _cacheWindowTextColor = CreateInstance(SystemResourceKeyID.WindowTextColor); } return _cacheWindowTextColor; } } #endregion #region Brushes /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ActiveBorderBrush { get { return MakeBrush(CacheSlot.ActiveBorder); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ActiveCaptionBrush { get { return MakeBrush(CacheSlot.ActiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ActiveCaptionTextBrush { get { return MakeBrush(CacheSlot.ActiveCaptionText); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush AppWorkspaceBrush { get { return MakeBrush(CacheSlot.AppWorkspace); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ControlBrush { get { return MakeBrush(CacheSlot.Control); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ControlDarkBrush { get { return MakeBrush(CacheSlot.ControlDark); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ControlDarkDarkBrush { get { return MakeBrush(CacheSlot.ControlDarkDark); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ControlLightBrush { get { return MakeBrush(CacheSlot.ControlLight); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ControlLightLightBrush { get { return MakeBrush(CacheSlot.ControlLightLight); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ControlTextBrush { get { return MakeBrush(CacheSlot.ControlText); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush DesktopBrush { get { return MakeBrush(CacheSlot.Desktop); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush GradientActiveCaptionBrush { get { return MakeBrush(CacheSlot.GradientActiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush GradientInactiveCaptionBrush { get { return MakeBrush(CacheSlot.GradientInactiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush GrayTextBrush { get { return MakeBrush(CacheSlot.GrayText); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush HighlightBrush { get { return MakeBrush(CacheSlot.Highlight); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush HighlightTextBrush { get { return MakeBrush(CacheSlot.HighlightText); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush HotTrackBrush { get { return MakeBrush(CacheSlot.HotTrack); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush InactiveBorderBrush { get { return MakeBrush(CacheSlot.InactiveBorder); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush InactiveCaptionBrush { get { return MakeBrush(CacheSlot.InactiveCaption); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush InactiveCaptionTextBrush { get { return MakeBrush(CacheSlot.InactiveCaptionText); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush InfoBrush { get { return MakeBrush(CacheSlot.Info); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush InfoTextBrush { get { return MakeBrush(CacheSlot.InfoText); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush MenuBrush { get { return MakeBrush(CacheSlot.Menu); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush MenuBarBrush { get { return MakeBrush(CacheSlot.MenuBar); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush MenuHighlightBrush { get { return MakeBrush(CacheSlot.MenuHighlight); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush MenuTextBrush { get { return MakeBrush(CacheSlot.MenuText); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush ScrollBarBrush { get { return MakeBrush(CacheSlot.ScrollBar); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush WindowBrush { get { return MakeBrush(CacheSlot.Window); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush WindowFrameBrush { get { return MakeBrush(CacheSlot.WindowFrame); } } /// <summary> /// System color of the same name. /// </summary> public static SolidColorBrush WindowTextBrush { get { return MakeBrush(CacheSlot.WindowText); } } /// <summary> /// Inactive selection highlight brush. /// </summary> /// <remarks> /// Please note that this property does not have an equivalent system color. /// </remarks> public static SolidColorBrush InactiveSelectionHighlightBrush { get { if (SystemParameters.HighContrast) { return SystemColors.HighlightBrush; } else { return SystemColors.ControlBrush; } } } /// <summary> /// Inactive selection highlight text brush. /// </summary> /// <remarks> /// Please note that this property does not have an equivalent system color. /// </remarks> public static SolidColorBrush InactiveSelectionHighlightTextBrush { get { if (SystemParameters.HighContrast) { return SystemColors.HighlightTextBrush; } else { return SystemColors.ControlTextBrush; } } } #endregion #region Brush Keys /// <summary> /// ActiveBorderBrush System Resource Key /// </summary> public static ResourceKey ActiveBorderBrushKey { get { if (_cacheActiveBorderBrush == null) { _cacheActiveBorderBrush = CreateInstance(SystemResourceKeyID.ActiveBorderBrush); } return _cacheActiveBorderBrush; } } /// <summary> /// ActiveCaptionBrush System Resource Key /// </summary> public static ResourceKey ActiveCaptionBrushKey { get { if (_cacheActiveCaptionBrush == null) { _cacheActiveCaptionBrush = CreateInstance(SystemResourceKeyID.ActiveCaptionBrush); } return _cacheActiveCaptionBrush; } } /// <summary> /// ActiveCaptionTextBrush System Resource Key /// </summary> public static ResourceKey ActiveCaptionTextBrushKey { get { if (_cacheActiveCaptionTextBrush == null) { _cacheActiveCaptionTextBrush = CreateInstance(SystemResourceKeyID.ActiveCaptionTextBrush); } return _cacheActiveCaptionTextBrush; } } /// <summary> /// AppWorkspaceBrush System Resource Key /// </summary> public static ResourceKey AppWorkspaceBrushKey { get { if (_cacheAppWorkspaceBrush == null) { _cacheAppWorkspaceBrush = CreateInstance(SystemResourceKeyID.AppWorkspaceBrush); } return _cacheAppWorkspaceBrush; } } /// <summary> /// ControlBrush System Resource Key /// </summary> public static ResourceKey ControlBrushKey { get { if (_cacheControlBrush == null) { _cacheControlBrush = CreateInstance(SystemResourceKeyID.ControlBrush); } return _cacheControlBrush; } } /// <summary> /// ControlDarkBrush System Resource Key /// </summary> public static ResourceKey ControlDarkBrushKey { get { if (_cacheControlDarkBrush == null) { _cacheControlDarkBrush = CreateInstance(SystemResourceKeyID.ControlDarkBrush); } return _cacheControlDarkBrush; } } /// <summary> /// ControlDarkDarkBrush System Resource Key /// </summary> public static ResourceKey ControlDarkDarkBrushKey { get { if (_cacheControlDarkDarkBrush == null) { _cacheControlDarkDarkBrush = CreateInstance(SystemResourceKeyID.ControlDarkDarkBrush); } return _cacheControlDarkDarkBrush; } } /// <summary> /// ControlLightBrush System Resource Key /// </summary> public static ResourceKey ControlLightBrushKey { get { if (_cacheControlLightBrush == null) { _cacheControlLightBrush = CreateInstance(SystemResourceKeyID.ControlLightBrush); } return _cacheControlLightBrush; } } /// <summary> /// ControlLightLightBrush System Resource Key /// </summary> public static ResourceKey ControlLightLightBrushKey { get { if (_cacheControlLightLightBrush == null) { _cacheControlLightLightBrush = CreateInstance(SystemResourceKeyID.ControlLightLightBrush); } return _cacheControlLightLightBrush; } } /// <summary> /// ControlTextBrush System Resource Key /// </summary> public static ResourceKey ControlTextBrushKey { get { if (_cacheControlTextBrush == null) { _cacheControlTextBrush = CreateInstance(SystemResourceKeyID.ControlTextBrush); } return _cacheControlTextBrush; } } /// <summary> /// DesktopBrush System Resource Key /// </summary> public static ResourceKey DesktopBrushKey { get { if (_cacheDesktopBrush == null) { _cacheDesktopBrush = CreateInstance(SystemResourceKeyID.DesktopBrush); } return _cacheDesktopBrush; } } /// <summary> /// GradientActiveCaptionBrush System Resource Key /// </summary> public static ResourceKey GradientActiveCaptionBrushKey { get { if (_cacheGradientActiveCaptionBrush == null) { _cacheGradientActiveCaptionBrush = CreateInstance(SystemResourceKeyID.GradientActiveCaptionBrush); } return _cacheGradientActiveCaptionBrush; } } /// <summary> /// GradientInactiveCaptionBrush System Resource Key /// </summary> public static ResourceKey GradientInactiveCaptionBrushKey { get { if (_cacheGradientInactiveCaptionBrush == null) { _cacheGradientInactiveCaptionBrush = CreateInstance(SystemResourceKeyID.GradientInactiveCaptionBrush); } return _cacheGradientInactiveCaptionBrush; } } /// <summary> /// GrayTextBrush System Resource Key /// </summary> public static ResourceKey GrayTextBrushKey { get { if (_cacheGrayTextBrush == null) { _cacheGrayTextBrush = CreateInstance(SystemResourceKeyID.GrayTextBrush); } return _cacheGrayTextBrush; } } /// <summary> /// HighlightBrush System Resource Key /// </summary> public static ResourceKey HighlightBrushKey { get { if (_cacheHighlightBrush == null) { _cacheHighlightBrush = CreateInstance(SystemResourceKeyID.HighlightBrush); } return _cacheHighlightBrush; } } /// <summary> /// HighlightTextBrush System Resource Key /// </summary> public static ResourceKey HighlightTextBrushKey { get { if (_cacheHighlightTextBrush == null) { _cacheHighlightTextBrush = CreateInstance(SystemResourceKeyID.HighlightTextBrush); } return _cacheHighlightTextBrush; } } /// <summary> /// HotTrackBrush System Resource Key /// </summary> public static ResourceKey HotTrackBrushKey { get { if (_cacheHotTrackBrush == null) { _cacheHotTrackBrush = CreateInstance(SystemResourceKeyID.HotTrackBrush); } return _cacheHotTrackBrush; } } /// <summary> /// InactiveBorderBrush System Resource Key /// </summary> public static ResourceKey InactiveBorderBrushKey { get { if (_cacheInactiveBorderBrush == null) { _cacheInactiveBorderBrush = CreateInstance(SystemResourceKeyID.InactiveBorderBrush); } return _cacheInactiveBorderBrush; } } /// <summary> /// InactiveCaptionBrush System Resource Key /// </summary> public static ResourceKey InactiveCaptionBrushKey { get { if (_cacheInactiveCaptionBrush == null) { _cacheInactiveCaptionBrush = CreateInstance(SystemResourceKeyID.InactiveCaptionBrush); } return _cacheInactiveCaptionBrush; } } /// <summary> /// InactiveCaptionTextBrush System Resource Key /// </summary> public static ResourceKey InactiveCaptionTextBrushKey { get { if (_cacheInactiveCaptionTextBrush == null) { _cacheInactiveCaptionTextBrush = CreateInstance(SystemResourceKeyID.InactiveCaptionTextBrush); } return _cacheInactiveCaptionTextBrush; } } /// <summary> /// InfoBrush System Resource Key /// </summary> public static ResourceKey InfoBrushKey { get { if (_cacheInfoBrush == null) { _cacheInfoBrush = CreateInstance(SystemResourceKeyID.InfoBrush); } return _cacheInfoBrush; } } /// <summary> /// InfoTextBrush System Resource Key /// </summary> public static ResourceKey InfoTextBrushKey { get { if (_cacheInfoTextBrush == null) { _cacheInfoTextBrush = CreateInstance(SystemResourceKeyID.InfoTextBrush); } return _cacheInfoTextBrush; } } /// <summary> /// MenuBrush System Resource Key /// </summary> public static ResourceKey MenuBrushKey { get { if (_cacheMenuBrush == null) { _cacheMenuBrush = CreateInstance(SystemResourceKeyID.MenuBrush); } return _cacheMenuBrush; } } /// <summary> /// MenuBarBrush System Resource Key /// </summary> public static ResourceKey MenuBarBrushKey { get { if (_cacheMenuBarBrush == null) { _cacheMenuBarBrush = CreateInstance(SystemResourceKeyID.MenuBarBrush); } return _cacheMenuBarBrush; } } /// <summary> /// MenuHighlightBrush System Resource Key /// </summary> public static ResourceKey MenuHighlightBrushKey { get { if (_cacheMenuHighlightBrush == null) { _cacheMenuHighlightBrush = CreateInstance(SystemResourceKeyID.MenuHighlightBrush); } return _cacheMenuHighlightBrush; } } /// <summary> /// MenuTextBrush System Resource Key /// </summary> public static ResourceKey MenuTextBrushKey { get { if (_cacheMenuTextBrush == null) { _cacheMenuTextBrush = CreateInstance(SystemResourceKeyID.MenuTextBrush); } return _cacheMenuTextBrush; } } /// <summary> /// ScrollBarBrush System Resource Key /// </summary> public static ResourceKey ScrollBarBrushKey { get { if (_cacheScrollBarBrush == null) { _cacheScrollBarBrush = CreateInstance(SystemResourceKeyID.ScrollBarBrush); } return _cacheScrollBarBrush; } } /// <summary> /// WindowBrush System Resource Key /// </summary> public static ResourceKey WindowBrushKey { get { if (_cacheWindowBrush == null) { _cacheWindowBrush = CreateInstance(SystemResourceKeyID.WindowBrush); } return _cacheWindowBrush; } } /// <summary> /// WindowFrameBrush System Resource Key /// </summary> public static ResourceKey WindowFrameBrushKey { get { if (_cacheWindowFrameBrush == null) { _cacheWindowFrameBrush = CreateInstance(SystemResourceKeyID.WindowFrameBrush); } return _cacheWindowFrameBrush; } } /// <summary> /// WindowTextBrush System Resource Key /// </summary> public static ResourceKey WindowTextBrushKey { get { if (_cacheWindowTextBrush == null) { _cacheWindowTextBrush = CreateInstance(SystemResourceKeyID.WindowTextBrush); } return _cacheWindowTextBrush; } } /// <summary> /// InactiveSelectionHighlightBrush System Resource Key /// </summary> public static ResourceKey InactiveSelectionHighlightBrushKey { get { if (FrameworkCompatibilityPreferences.GetAreInactiveSelectionHighlightBrushKeysSupported()) { if (_cacheInactiveSelectionHighlightBrush == null) { _cacheInactiveSelectionHighlightBrush = CreateInstance(SystemResourceKeyID.InactiveSelectionHighlightBrush); } return _cacheInactiveSelectionHighlightBrush; } else { return ControlBrushKey; } } } /// <summary> /// InactiveSelectionHighlightTextBrush System Resource Key /// </summary> public static ResourceKey InactiveSelectionHighlightTextBrushKey { get { if (FrameworkCompatibilityPreferences.GetAreInactiveSelectionHighlightBrushKeysSupported()) { if (_cacheInactiveSelectionHighlightTextBrush == null) { _cacheInactiveSelectionHighlightTextBrush = CreateInstance(SystemResourceKeyID.InactiveSelectionHighlightTextBrush); } return _cacheInactiveSelectionHighlightTextBrush; } else { return ControlTextBrushKey; } } } #endregion #region Implementation internal static bool InvalidateCache() { bool color = SystemResources.ClearBitArray(_colorCacheValid); bool brush = SystemResources.ClearBitArray(_brushCacheValid); return color || brush; } // Shift count and bit mask for A, R, G, B components private const int AlphaShift = 24; private const int RedShift = 16; private const int GreenShift = 8; private const int BlueShift = 0; private const int Win32RedShift = 0; private const int Win32GreenShift = 8; private const int Win32BlueShift = 16; private static int Encode(int alpha, int red, int green, int blue) { return red << RedShift | green << GreenShift | blue << BlueShift | alpha << AlphaShift; } private static int FromWin32Value(int value) { return Encode(255, (value >> Win32RedShift) & 0xFF, (value >> Win32GreenShift) & 0xFF, (value >> Win32BlueShift) & 0xFF); } /// <summary> /// Query for system colors. /// </summary> /// <param name="slot">The color slot.</param> /// <returns>The system color.</returns> private static Color GetSystemColor(CacheSlot slot) { Color color; lock (_colorCacheValid) { if (!_colorCacheValid[(int)slot]) { uint argb; int sysColor = SafeNativeMethods.GetSysColor(SlotToFlag(slot)); argb = (uint)FromWin32Value(sysColor); color = Color.FromArgb((byte)((argb & 0xff000000) >>24), (byte)((argb & 0x00ff0000) >>16), (byte)((argb & 0x0000ff00) >>8), (byte)(argb & 0x000000ff)); _colorCache[(int)slot] = color; _colorCacheValid[(int)slot] = true; } else { color = _colorCache[(int)slot]; } } return color; } private static SolidColorBrush MakeBrush(CacheSlot slot) { SolidColorBrush brush; lock (_brushCacheValid) { if (!_brushCacheValid[(int)slot]) { brush = new SolidColorBrush(GetSystemColor(slot)); brush.Freeze(); _brushCache[(int)slot] = brush; _brushCacheValid[(int)slot] = true; } else { brush = _brushCache[(int)slot]; } } return brush; } private static int SlotToFlag(CacheSlot slot) { // FxCop: Hashtable would be overkill, using switch instead switch (slot) { case CacheSlot.ActiveBorder: return (int)NativeMethods.Win32SystemColors.ActiveBorder; case CacheSlot.ActiveCaption: return (int)NativeMethods.Win32SystemColors.ActiveCaption; case CacheSlot.ActiveCaptionText: return (int)NativeMethods.Win32SystemColors.ActiveCaptionText; case CacheSlot.AppWorkspace: return (int)NativeMethods.Win32SystemColors.AppWorkspace; case CacheSlot.Control: return (int)NativeMethods.Win32SystemColors.Control; case CacheSlot.ControlDark: return (int)NativeMethods.Win32SystemColors.ControlDark; case CacheSlot.ControlDarkDark: return (int)NativeMethods.Win32SystemColors.ControlDarkDark; case CacheSlot.ControlLight: return (int)NativeMethods.Win32SystemColors.ControlLight; case CacheSlot.ControlLightLight: return (int)NativeMethods.Win32SystemColors.ControlLightLight; case CacheSlot.ControlText: return (int)NativeMethods.Win32SystemColors.ControlText; case CacheSlot.Desktop: return (int)NativeMethods.Win32SystemColors.Desktop; case CacheSlot.GradientActiveCaption: return (int)NativeMethods.Win32SystemColors.GradientActiveCaption; case CacheSlot.GradientInactiveCaption: return (int)NativeMethods.Win32SystemColors.GradientInactiveCaption; case CacheSlot.GrayText: return (int)NativeMethods.Win32SystemColors.GrayText; case CacheSlot.Highlight: return (int)NativeMethods.Win32SystemColors.Highlight; case CacheSlot.HighlightText: return (int)NativeMethods.Win32SystemColors.HighlightText; case CacheSlot.HotTrack: return (int)NativeMethods.Win32SystemColors.HotTrack; case CacheSlot.InactiveBorder: return (int)NativeMethods.Win32SystemColors.InactiveBorder; case CacheSlot.InactiveCaption: return (int)NativeMethods.Win32SystemColors.InactiveCaption; case CacheSlot.InactiveCaptionText: return (int)NativeMethods.Win32SystemColors.InactiveCaptionText; case CacheSlot.Info: return (int)NativeMethods.Win32SystemColors.Info; case CacheSlot.InfoText: return (int)NativeMethods.Win32SystemColors.InfoText; case CacheSlot.Menu: return (int)NativeMethods.Win32SystemColors.Menu; case CacheSlot.MenuBar: return (int)NativeMethods.Win32SystemColors.MenuBar; case CacheSlot.MenuHighlight: return (int)NativeMethods.Win32SystemColors.MenuHighlight; case CacheSlot.MenuText: return (int)NativeMethods.Win32SystemColors.MenuText; case CacheSlot.ScrollBar: return (int)NativeMethods.Win32SystemColors.ScrollBar; case CacheSlot.Window: return (int)NativeMethods.Win32SystemColors.Window; case CacheSlot.WindowFrame: return (int)NativeMethods.Win32SystemColors.WindowFrame; case CacheSlot.WindowText: return (int)NativeMethods.Win32SystemColors.WindowText; } return 0; } private enum CacheSlot : int { ActiveBorder, ActiveCaption, ActiveCaptionText, AppWorkspace, Control, ControlDark, ControlDarkDark, ControlLight, ControlLightLight, ControlText, Desktop, GradientActiveCaption, GradientInactiveCaption, GrayText, Highlight, HighlightText, HotTrack, InactiveBorder, InactiveCaption, InactiveCaptionText, Info, InfoText, Menu, MenuBar, MenuHighlight, MenuText, ScrollBar, Window, WindowFrame, WindowText, NumSlots } private static BitArray _colorCacheValid = new BitArray((int)CacheSlot.NumSlots); private static Color[] _colorCache = new Color[(int)CacheSlot.NumSlots]; private static BitArray _brushCacheValid = new BitArray((int)CacheSlot.NumSlots); private static SolidColorBrush[] _brushCache = new SolidColorBrush[(int)CacheSlot.NumSlots]; private static SystemResourceKey _cacheActiveBorderBrush; private static SystemResourceKey _cacheActiveCaptionBrush; private static SystemResourceKey _cacheActiveCaptionTextBrush; private static SystemResourceKey _cacheAppWorkspaceBrush; private static SystemResourceKey _cacheControlBrush; private static SystemResourceKey _cacheControlDarkBrush; private static SystemResourceKey _cacheControlDarkDarkBrush; private static SystemResourceKey _cacheControlLightBrush; private static SystemResourceKey _cacheControlLightLightBrush; private static SystemResourceKey _cacheControlTextBrush; private static SystemResourceKey _cacheDesktopBrush; private static SystemResourceKey _cacheGradientActiveCaptionBrush; private static SystemResourceKey _cacheGradientInactiveCaptionBrush; private static SystemResourceKey _cacheGrayTextBrush; private static SystemResourceKey _cacheHighlightBrush; private static SystemResourceKey _cacheHighlightTextBrush; private static SystemResourceKey _cacheHotTrackBrush; private static SystemResourceKey _cacheInactiveBorderBrush; private static SystemResourceKey _cacheInactiveCaptionBrush; private static SystemResourceKey _cacheInactiveCaptionTextBrush; private static SystemResourceKey _cacheInfoBrush; private static SystemResourceKey _cacheInfoTextBrush; private static SystemResourceKey _cacheMenuBrush; private static SystemResourceKey _cacheMenuBarBrush; private static SystemResourceKey _cacheMenuHighlightBrush; private static SystemResourceKey _cacheMenuTextBrush; private static SystemResourceKey _cacheScrollBarBrush; private static SystemResourceKey _cacheWindowBrush; private static SystemResourceKey _cacheWindowFrameBrush; private static SystemResourceKey _cacheWindowTextBrush; private static SystemResourceKey _cacheInactiveSelectionHighlightBrush; private static SystemResourceKey _cacheInactiveSelectionHighlightTextBrush; private static SystemResourceKey _cacheActiveBorderColor; private static SystemResourceKey _cacheActiveCaptionColor; private static SystemResourceKey _cacheActiveCaptionTextColor; private static SystemResourceKey _cacheAppWorkspaceColor; private static SystemResourceKey _cacheControlColor; private static SystemResourceKey _cacheControlDarkColor; private static SystemResourceKey _cacheControlDarkDarkColor; private static SystemResourceKey _cacheControlLightColor; private static SystemResourceKey _cacheControlLightLightColor; private static SystemResourceKey _cacheControlTextColor; private static SystemResourceKey _cacheDesktopColor; private static SystemResourceKey _cacheGradientActiveCaptionColor; private static SystemResourceKey _cacheGradientInactiveCaptionColor; private static SystemResourceKey _cacheGrayTextColor; private static SystemResourceKey _cacheHighlightColor; private static SystemResourceKey _cacheHighlightTextColor; private static SystemResourceKey _cacheHotTrackColor; private static SystemResourceKey _cacheInactiveBorderColor; private static SystemResourceKey _cacheInactiveCaptionColor; private static SystemResourceKey _cacheInactiveCaptionTextColor; private static SystemResourceKey _cacheInfoColor; private static SystemResourceKey _cacheInfoTextColor; private static SystemResourceKey _cacheMenuColor; private static SystemResourceKey _cacheMenuBarColor; private static SystemResourceKey _cacheMenuHighlightColor; private static SystemResourceKey _cacheMenuTextColor; private static SystemResourceKey _cacheScrollBarColor; private static SystemResourceKey _cacheWindowColor; private static SystemResourceKey _cacheWindowFrameColor; private static SystemResourceKey _cacheWindowTextColor; #endregion } }
require 'bandcamp/band' require 'bandcamp/album' require 'bandcamp/track' require 'bandcamp/request' module Bandcamp class Getter def initialize request @request = request end def track track_id response = @request.track track_id response.nil? ? nil : Track.new(response) end def tracks *tracks track_list = tracks.join(',') response = @request.track track_list if response.nil? [] else response.collect{|key,val| Track.new val} end end def album album_id response = @request.album album_id response.nil? ? nil : Album.new(response) end def search band_name response = @request.search band_name if response.nil? [] else response.collect{|band_json| Band.new band_json} end end def band name response = @request.band name response.nil? ? nil : Band.new(response) end def url address response = @request.url address return nil if response.nil? case when response.has_key?("album_id") album(response["album_id"]) when response.has_key?("track_id") track(response["track_id"]) when (response.keys.length == 1) && response.has_key?("band_id") band(response["band_id"]) end end end end
'use strict'; var format = require('util').format , scripts = require('./scripts') , loadScriptSource = require('./load-script-source') // Ports: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp function ignore(cb) { cb() } function InspectorDebuggerAgent() { if (!(this instanceof InspectorDebuggerAgent)) return new InspectorDebuggerAgent(); this._enabled = false; this._breakpointsCookie = {} } module.exports = InspectorDebuggerAgent; var proto = InspectorDebuggerAgent.prototype; proto.enable = function enable(cb) { this._enabled = true; cb() } proto.disable = function disable(cb) { this._enabled = false; cb() } // https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp&l=606 proto._resolveBreakpoint = function _resolveBreakpoint(breakpointId, script, breakpoint, cb) { var result = { breakpointId: breakpointId, locations: [ ] }; // if a breakpoint registers on startup, the script's source may not have been loaded yet // in that case we load it, the script's source is set automatically during that step // should not be needed once other debugger methods are implemented if (script.source) onensuredSource(); else loadScriptSource(script.url, onensuredSource) function onensuredSource(err) { if (err) return cb(err); if (breakpoint.lineNumber < script.startLine || script.endLine < breakpoint.lineNumber) return cb(null, result); // TODO: scriptDebugServer().setBreakpoint(scriptId, breakpoint, &actualLineNumber, &actualColumnNumber, false); // https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/bindings/core/v8/ScriptDebugServer.cpp&l=89 var debugServerBreakpointId = 'TBD' if (!debugServerBreakpointId) return cb(null, result); // will be returned from call to script debug server var actualLineNumber = breakpoint.lineNumber , actualColumnNumber = breakpoint.columnNumber result.locations.push({ scriptId : script.id , lineNumber : actualLineNumber , columnNumber : actualColumnNumber }) cb(null, result); } } // https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp&l=333 proto.setBreakpointByUrl = function setBreakpointByUrl(opts, cb) { if (opts.urlRegex) return cb(new Error('Not supporting setBreakpointByUrl with urlRegex')); var isAntibreakpoint = !!opts.isAntibreakpoint , url = opts.url , condition = opts.condition || '' , lineNumber = opts.lineNumber , columnNumber if (typeof opts.columnNumber === Number) { columnNumber = opts.columnNumber; if (columnNumber < 0) return cb(new Error('Incorrect column number.')); } else { columnNumber = isAntibreakpoint ? -1 : 0; } var breakpointId = format('%s:%d:%d', url, lineNumber, columnNumber); if (this._breakpointsCookie[breakpointId]) return cb(new Error('Breakpoint at specified location already exists.')); this._breakpointsCookie[breakpointId] = { url : url , lineNumber : lineNumber , columnNumber : columnNumber , condition : condition , isAntibreakpoint : isAntibreakpoint } if (isAntibreakpoint) return cb(null, { breakpointId: breakpointId }); var match = scripts.byUrl[url]; if (!match) return cb(null, { breakpointId: breakpointId, locations: [] }) var breakpoint = { lineNumber: lineNumber, columnNumber: columnNumber, condition: condition } this._resolveBreakpoint(breakpointId, match, breakpoint, cb) } proto._removeBreakpoint = function _removeBreakpoint(breakpointId, cb) { // todo cb() } // https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp&l=416 proto.removeBreakpoint = function removeBreakpoint(breakpointId, cb) { var breakpoint = this._breakpointsCookie[breakpointId]; if (!breakpoint) return; this._breakpointsCookie[breakpointId] = undefined; if (!breakpoint.isAntibreakpoint) this._removeBreakpoint(breakpointId, cb); else cb() } proto.getScriptSource = function getScriptSource(id, cb) { var script = scripts.byId[id]; if (!script) return cb(new Error('Script with id ' + id + 'was not found')) cb(null, { scriptSource: script.source }) } proto.setBreakpointsActive = ignore proto.setSkipAllPauses = ignore proto.setBreakpoint = ignore proto.continueToLocation = ignore proto.stepOver = ignore proto.stepInto = ignore proto.stepOut = ignore proto.pause = ignore proto.resume = ignore proto.searchInContent = ignore proto.canSetScriptSource = ignore proto.setScriptSource = ignore proto.restartFrame = ignore proto.getFunctionDetails = ignore proto.getCollectionEntries = ignore proto.setPauseOnExceptions = ignore proto.evaluateOnCallFrame = ignore proto.compileScript = ignore proto.runScript = ignore proto.setOverlayMessage = ignore proto.setVariableValue = ignore proto.getStepInPositions = ignore proto.getBacktrace = ignore proto.skipStackFrames = ignore proto.setAsyncCallStackDepth = ignore proto.enablePromiseTracker = ignore proto.disablePromiseTracker = ignore proto.getPromises = ignore proto.getPromiseById = ignore
/* Theme Name: Not Here Theme URI: http://nothere.anchour.me Description: Theme developed for Not Here conference Version: 1.0 Author: Anchour Author URI: http://anchour.com/ */
/* eslint no-console: 0 */ 'use strict'; const fs = require('fs'); const mkdirp = require('mkdirp'); const rollup = require('rollup'); const nodeResolve = require('rollup-plugin-node-resolve'); const commonjs = require('rollup-plugin-commonjs'); const uglify = require('rollup-plugin-uglify'); const src = 'src'; const dest = 'dist/rollup-aot'; Promise.all([ // build main/app rollup.rollup({ entry: `${src}/main-aot.js`, context: 'this', plugins: [ nodeResolve({ jsnext: true, module: true }), commonjs(), uglify({ output: { comments: /@preserve|@license|@cc_on/i, }, mangle: { keep_fnames: true, }, compress: { warnings: false, }, }), ], }).then(app => app.write({ format: 'iife', dest: `${dest}/app.js`, sourceMap: false, }) ), // build polyfills rollup.rollup({ entry: `${src}/polyfills-aot.js`, context: 'this', plugins: [ nodeResolve({ jsnext: true, module: true }), commonjs(), uglify(), ], }).then(app => app.write({ format: 'iife', dest: `${dest}/polyfills.js`, sourceMap: false, }) ), // create index.html new Promise((resolve, reject) => { fs.readFile(`${src}/index.html`, 'utf-8', (readErr, indexHtml) => { if (readErr) return reject(readErr); const newIndexHtml = indexHtml .replace('</head>', '<script src="polyfills.js"></script></head>') .replace('</body>', '<script src="app.js"></script></body>'); mkdirp(dest, mkdirpErr => { if (mkdirpErr) return reject(mkdirpErr); return true; }); return fs.writeFile( `${dest}/index.html`, newIndexHtml, 'utf-8', writeErr => { if (writeErr) return reject(writeErr); console.log('Created index.html'); return resolve(); } ); }); }), ]).then(() => { console.log('Rollup complete'); }).catch(err => { console.error('Rollup failed with ', err); });
function checkHeadersSent(res, cb) { return (err, results) => { if (res.headersSent) { if (err) { return cb(err) } return null } cb(err, results) } } exports.finish = function finish(req, res, next) { const check = checkHeadersSent.bind(null, res) if (req.method === 'GET') { return check((err, results) => { if (err) { return next(err) // Send to default handler } res.json(results) }) } else if (req.method === 'POST') { return check((err, results) => { if (err) { return next(err) // Send to default handler } /* eslint-disable max-len */ // http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api?hn#useful-post-responses if (results) { res.json(results, 200) } else { res.json(204, {}) } }) } else if (req.method === 'PUT') { return check((err, results) => { if (err) { return next(err) // Send to default handler } if (results) { res.json(results, 200) } else { res.json(204, {}) } }) } else if (req.method === 'PATCH') { return check((err, results) => { if (err) { return next(err) // Send to default handler } if (results) { res.json(results) } else { res.json(204, {}) } }) } else if (req.method === 'DELETE') { return check((err, results) => { if (err) { return next(err) // Send to default handler } if (results) { res.json(results) } else { res.json(204, {}) } }) } }
package wiselabs.com.br.studylistandcards.entity; /** * Created by C.Lucas on 18/12/2016. */ public enum TipoProjeto { LEI_ORDINARIA, LEI_COMPLEMENTAR, EMENDA_LEI_ORGANICA, DECRETO_LEGISLATIVO, RESOLUCAO; }
import math import re from collections import defaultdict def matches(t1, t2): t1r = "".join([t[-1] for t in t1]) t2r = "".join([t[-1] for t in t2]) t1l = "".join([t[0] for t in t1]) t2l = "".join([t[0] for t in t2]) t1_edges = [t1[0], t1[-1], t1r, t1l] t2_edges = [t2[0], t2[-1], t2[0][::-1], t2[-1][::-1], t2l, t2l[::-1], t2r, t2r[::-1]] for et1 in t1_edges: for et2 in t2_edges: if et1 == et2: return True return False def flip(t): return [l[::-1] for l in t] # https://stackoverflow.com/a/34347121 def rotate(t): return [*map("".join, zip(*reversed(t)))] def set_corner(cor, right, down): rr = "".join([t[-1] for t in right]) dr = "".join([t[-1] for t in down]) rl = "".join([t[0] for t in right]) dl = "".join([t[0] for t in down]) r_edges = [right[0], right[-1], right[0][::-1], right[-1][::-1], rr, rr[::-1], rl, rl[::-1]] d_edges = [down[0], down[-1], down[0][::-1], down[-1][::-1], dr, dr[::-1], dl, dl[::-1]] for _ in range(2): cor = flip(cor) for _ in range(4): cor = rotate(cor) if cor[-1] in d_edges and "".join([t[-1] for t in cor]) in r_edges: return cor return None def remove_border(t): return [x[1:-1] for x in t[1:-1]] def set_left_edge(t1, t2): ref = "".join([t[-1] for t in t1]) for _ in range(2): t2 = flip(t2) for _ in range(4): t2 = rotate(t2) if "".join([t[0] for t in t2]) == ref: return t2 return None def set_upper_edge(t1, t2): ref = t1[-1] for _ in range(2): t2 = flip(t2) for _ in range(4): t2 = rotate(t2) if t2[0] == ref: return t2 return None def assemble_image(img, tiles): whole_image = [] for l in img: slice = [""] * len(tiles[l[0]]) for t in l: for i, s in enumerate(tiles[t]): slice[i] += s for s in slice: whole_image.append(s) return whole_image def part1(): tiles = defaultdict(list) for l in open("input.txt"): if "Tile" in l: tile = int(re.findall(r"\d+", l)[0]) elif "." in l or "#" in l: tiles[tile].append(l.strip()) connected = defaultdict(set) for i in tiles: for t in tiles: if i == t: continue if matches(tiles[i], tiles[t]): connected[i].add(t) connected[t].add(i) prod = 1 for i in connected: if len(connected[i]) == 2: prod *= i print(prod) def part2(): tiles = defaultdict(list) for l in open("input.txt"): if "Tile" in l: tile = int(re.findall(r"\d+", l)[0]) elif "." in l or "#" in l: tiles[tile].append(l.strip()) connected = defaultdict(set) for i in tiles: for t in tiles: if i == t: continue if matches(tiles[i], tiles[t]): connected[i].add(t) connected[t].add(i) sz = int(math.sqrt(len(connected))) image = [[0 for _ in range(sz)] for _ in range(sz)] for i in connected: if len(connected[i]) == 2: corner = i break image[0][0] = corner added = {corner} for y in range(1, sz): pos = connected[image[0][y - 1]] for cand in pos: if cand not in added and len(connected[cand]) < 4: image[0][y] = cand added.add(cand) break for x in range(1, sz): for y in range(sz): pos = connected[image[x - 1][y]] for cand in pos: if cand not in added: image[x][y] = cand added.add(cand) break tiles[image[0][0]] = set_corner(tiles[image[0][0]], tiles[image[0][1]], tiles[image[1][0]]) for y, l in enumerate(image): if y != 0: prv = image[y - 1][0] tiles[l[0]] = set_upper_edge(tiles[prv], tiles[l[0]]) for x, tile in enumerate(l): if x != 0: prv = image[y][x - 1] tiles[tile] = set_left_edge(tiles[prv], tiles[tile]) for t in tiles: tiles[t] = remove_border(tiles[t]) image = assemble_image(image, tiles) ky = 0 monster = set() for l in open("monster.txt").read().split("\n"): kx = len(l) for i, ch in enumerate(l): if ch == "#": monster.add((i, ky)) ky += 1 for _ in range(2): image = flip(image) for _ in range(4): image = rotate(image) for x in range(0, len(image) - kx): for y in range(0, len(image) - ky): parts = [] for i, p in enumerate(monster): dx = x + p[0] dy = y + p[1] parts.append(image[dy][dx] == "#") if all(parts): for p in monster: dx = x + p[0] dy = y + p[1] image[dy] = image[dy][:dx] + "O" + image[dy][dx + 1 :] with open("output.txt", "w+") as f: for l in rotate(rotate(rotate(image))): f.write(l + "\n") print(sum([l.count("#") for l in image])) if __name__ == "__main__": part1() part2()
var mongodb = process.env['TEST_NATIVE'] != null ? require('../lib/mongodb').native() : require('../lib/mongodb').pure(); var testCase = require('../deps/nodeunit').testCase, debug = require('util').debug, inspect = require('util').inspect, nodeunit = require('../deps/nodeunit'), gleak = require('../tools/gleak'), Db = mongodb.Db, Cursor = mongodb.Cursor, Script = require('vm'), Collection = mongodb.Collection, Server = mongodb.Server, Step = require("../deps/step/lib/step"), ServerManager = require('./tools/server_manager').ServerManager; var MONGODB = 'integration_tests'; var client = new Db(MONGODB, new Server("127.0.0.1", 27017, {auto_reconnect: true, poolSize: 4}), {native_parser: (process.env['TEST_NATIVE'] != null)}); /** * Module for parsing an ISO 8601 formatted string into a Date object. */ var ISODate = function (string) { var match; if (typeof string.getTime === "function") return string; else if (match = string.match(/^(\d{4})(-(\d{2})(-(\d{2})(T(\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|((\+|-)(\d{2}):(\d{2}))))?)?)?$/)) { var date = new Date(); date.setUTCFullYear(Number(match[1])); date.setUTCMonth(Number(match[3]) - 1 || 0); date.setUTCDate(Number(match[5]) || 0); date.setUTCHours(Number(match[7]) || 0); date.setUTCMinutes(Number(match[8]) || 0); date.setUTCSeconds(Number(match[10]) || 0); date.setUTCMilliseconds(Number("." + match[12]) * 1000 || 0); if (match[13] && match[13] !== "Z") { var h = Number(match[16]) || 0, m = Number(match[17]) || 0; h *= 3600000; m *= 60000; var offset = h + m; if (match[15] == "+") offset = -offset; new Date(date.valueOf() + offset); } return date; } else throw new Error("Invalid ISO 8601 date given.", __filename); }; // Define the tests, we want them to run as a nested test so we only clean up the // db connection once var tests = testCase({ setUp: function(callback) { client.open(function(err, db_p) { if(numberOfTestsRun == Object.keys(tests).length) { // If first test drop the db client.dropDatabase(function(err, done) { callback(); }); } else { return callback(); } }); }, tearDown: function(callback) { numberOfTestsRun = numberOfTestsRun - 1; // Drop the database and close it if(numberOfTestsRun <= 0) { // client.dropDatabase(function(err, done) { // Close the client client.close(); callback(); // }); } else { client.close(); callback(); } }, shouldForceMongoDbServerToAssignId : function(test) { /// Set up server with custom pk factory var db = new Db(MONGODB, new Server('localhost', 27017, {auto_reconnect: true}), {native_parser: (process.env['TEST_NATIVE'] != null), 'forceServerObjectId':true}); db.bson_deserializer = client.bson_deserializer; db.bson_serializer = client.bson_serializer; db.open(function(err, client) { client.createCollection('test_insert2', function(err, r) { client.collection('test_insert2', function(err, collection) { Step( function inserts() { var group = this.group(); for(var i = 1; i < 1000; i++) { collection.insert({c:i}, {safe:true}, group()); } }, function done(err, result) { collection.insert({a:2}, {safe:true}, function(err, r) { collection.insert({a:3}, {safe:true}, function(err, r) { collection.count(function(err, count) { test.equal(1001, count); // Locate all the entries using find collection.find(function(err, cursor) { cursor.toArray(function(err, results) { test.equal(1001, results.length); test.ok(results[0] != null); client.close(); // Let's close the db test.done(); }); }); }); }); }); } ) }); }); }); }, shouldCorrectlyPerformSingleInsert : function(test) { client.createCollection('shouldCorrectlyPerformSingleInsert', function(err, collection) { collection.insert({a:1}, {safe:true}, function(err, result) { collection.findOne(function(err, item) { test.equal(1, item.a); test.done(); }) }) }) }, shouldCorrectlyPerformBasicInsert : function(test) { client.createCollection('test_insert', function(err, r) { client.collection('test_insert', function(err, collection) { Step( function inserts() { var group = this.group(); for(var i = 1; i < 1000; i++) { collection.insert({c:i}, {safe:true}, group()); } }, function done(err, result) { collection.insert({a:2}, {safe:true}, function(err, r) { collection.insert({a:3}, {safe:true}, function(err, r) { collection.count(function(err, count) { test.equal(1001, count); // Locate all the entries using find collection.find(function(err, cursor) { cursor.toArray(function(err, results) { test.equal(1001, results.length); test.ok(results[0] != null); // Let's close the db test.done(); }); }); }); }); }); } ) }); }); }, // Test multiple document insert shouldCorrectlyHandleMultipleDocumentInsert : function(test) { client.createCollection('test_multiple_insert', function(err, r) { var collection = client.collection('test_multiple_insert', function(err, collection) { var docs = [{a:1}, {a:2}]; collection.insert(docs, {safe:true}, function(err, ids) { ids.forEach(function(doc) { test.ok(((doc['_id']) instanceof client.bson_serializer.ObjectID || Object.prototype.toString.call(doc['_id']) === '[object ObjectID]')); }); // Let's ensure we have both documents collection.find(function(err, cursor) { cursor.toArray(function(err, docs) { test.equal(2, docs.length); var results = []; // Check that we have all the results we want docs.forEach(function(doc) { if(doc.a == 1 || doc.a == 2) results.push(1); }); test.equal(2, results.length); // Let's close the db test.done(); }); }); }); }); }); }, shouldCorrectlyExecuteSaveInsertUpdate: function(test) { client.createCollection('shouldCorrectlyExecuteSaveInsertUpdate', function(err, collection) { collection.save({ email : 'save' }, {safe:true}, function() { collection.insert({ email : 'insert' }, {safe:true}, function() { collection.update( { email : 'update' }, { email : 'update' }, { upsert: true, safe:true}, function() { collection.find(function(e, c) { c.toArray(function(e, a) { test.equal(3, a.length) test.done(); }); }); } ); }); }); }); }, shouldCorrectlyInsertAndRetrieveLargeIntegratedArrayDocument : function(test) { client.createCollection('test_should_deserialize_large_integrated_array', function(err, collection) { var doc = {'a':0, 'b':['tmp1', 'tmp2', 'tmp3', 'tmp4', 'tmp5', 'tmp6', 'tmp7', 'tmp8', 'tmp9', 'tmp10', 'tmp11', 'tmp12', 'tmp13', 'tmp14', 'tmp15', 'tmp16'] }; // Insert the collection collection.insert(doc, {safe:true}, function(err, r) { // Fetch and check the collection collection.findOne({'a': 0}, function(err, result) { test.deepEqual(doc.a, result.a); test.deepEqual(doc.b, result.b); test.done(); }); }); }); }, shouldCorrectlyInsertAndRetrieveDocumentWithAllTypes : function(test) { client.createCollection('test_all_serialization_types', function(err, collection) { var date = new Date(); var oid = new client.bson_serializer.ObjectID(); var string = 'binstring' var bin = new client.bson_serializer.Binary() for(var index = 0; index < string.length; index++) { bin.put(string.charAt(index)) } var motherOfAllDocuments = { 'string': 'hello', 'array': [1,2,3], 'hash': {'a':1, 'b':2}, 'date': date, 'oid': oid, 'binary': bin, 'int': 42, 'float': 33.3333, 'regexp': /regexp/, 'boolean': true, 'long': date.getTime(), 'where': new client.bson_serializer.Code('this.a > i', {i:1}), 'dbref': new client.bson_serializer.DBRef('namespace', oid, 'integration_tests_') } collection.insert(motherOfAllDocuments, {safe:true}, function(err, docs) { collection.findOne(function(err, doc) { // Assert correct deserialization of the values test.equal(motherOfAllDocuments.string, doc.string); test.deepEqual(motherOfAllDocuments.array, doc.array); test.equal(motherOfAllDocuments.hash.a, doc.hash.a); test.equal(motherOfAllDocuments.hash.b, doc.hash.b); test.equal(date.getTime(), doc.long); test.equal(date.toString(), doc.date.toString()); test.equal(date.getTime(), doc.date.getTime()); test.equal(motherOfAllDocuments.oid.toHexString(), doc.oid.toHexString()); test.equal(motherOfAllDocuments.binary.value(), doc.binary.value()); test.equal(motherOfAllDocuments.int, doc.int); test.equal(motherOfAllDocuments.long, doc.long); test.equal(motherOfAllDocuments.float, doc.float); test.equal(motherOfAllDocuments.regexp.toString(), doc.regexp.toString()); test.equal(motherOfAllDocuments.boolean, doc.boolean); test.equal(motherOfAllDocuments.where.code, doc.where.code); test.equal(motherOfAllDocuments.where.scope['i'], doc.where.scope.i); test.equal(motherOfAllDocuments.dbref.namespace, doc.dbref.namespace); test.equal(motherOfAllDocuments.dbref.oid.toHexString(), doc.dbref.oid.toHexString()); test.equal(motherOfAllDocuments.dbref.db, doc.dbref.db); test.done(); }) }); }); }, shouldCorrectlyInsertAndUpdateDocumentWithNewScriptContext: function(test) { var db = new Db(MONGODB, new Server('localhost', 27017, {auto_reconnect: true}), {native_parser: (process.env['TEST_NATIVE'] != null)}); db.bson_deserializer = client.bson_deserializer; db.bson_serializer = client.bson_serializer; db.pkFactory = client.pkFactory; db.open(function(err, db) { //convience curried handler for functions of type 'a -> (err, result) function getResult(callback){ return function(error, result) { test.ok(error == null); return callback(result); } }; db.collection('users', getResult(function(user_collection){ user_collection.remove({}, {safe:true}, function(err, result) { //first, create a user object var newUser = { name : 'Test Account', settings : {} }; user_collection.insert([newUser], {safe:true}, getResult(function(users){ var user = users[0]; var scriptCode = "settings.block = []; settings.block.push('test');"; var context = { settings : { thisOneWorks : "somestring" } }; Script.runInNewContext(scriptCode, context, "testScript"); //now create update command and issue it var updateCommand = { $set : context }; user_collection.update({_id : user._id}, updateCommand, {safe:true}, getResult(function(updateCommand) { // Fetch the object and check that the changes are persisted user_collection.findOne({_id : user._id}, function(err, doc) { test.ok(err == null); test.equal("Test Account", doc.name); test.equal("somestring", doc.settings.thisOneWorks); test.equal("test", doc.settings.block[0]); // Let's close the db db.close(); test.done(); }); }) ); })); }); })); }); }, shouldCorrectlySerializeDocumentWithAllTypesInNewContext : function(test) { client.createCollection('test_all_serialization_types_new_context', function(err, collection) { var date = new Date(); var scriptCode = "var string = 'binstring'\n" + "var bin = new mongo.Binary()\n" + "for(var index = 0; index < string.length; index++) {\n" + " bin.put(string.charAt(index))\n" + "}\n" + "motherOfAllDocuments['string'] = 'hello';" + "motherOfAllDocuments['array'] = [1,2,3];" + "motherOfAllDocuments['hash'] = {'a':1, 'b':2};" + "motherOfAllDocuments['date'] = date;" + "motherOfAllDocuments['oid'] = new mongo.ObjectID();" + "motherOfAllDocuments['binary'] = bin;" + "motherOfAllDocuments['int'] = 42;" + "motherOfAllDocuments['float'] = 33.3333;" + "motherOfAllDocuments['regexp'] = /regexp/;" + "motherOfAllDocuments['boolean'] = true;" + "motherOfAllDocuments['long'] = motherOfAllDocuments['date'].getTime();" + "motherOfAllDocuments['where'] = new mongo.Code('this.a > i', {i:1});" + "motherOfAllDocuments['dbref'] = new mongo.DBRef('namespace', motherOfAllDocuments['oid'], 'integration_tests_');"; var context = { motherOfAllDocuments : {}, mongo:client.bson_serializer, date:date}; // Execute function in context Script.runInNewContext(scriptCode, context, "testScript"); // sys.puts(sys.inspect(context.motherOfAllDocuments)) var motherOfAllDocuments = context.motherOfAllDocuments; collection.insert(context.motherOfAllDocuments, {safe:true}, function(err, docs) { collection.findOne(function(err, doc) { // Assert correct deserialization of the values test.equal(motherOfAllDocuments.string, doc.string); test.deepEqual(motherOfAllDocuments.array, doc.array); test.equal(motherOfAllDocuments.hash.a, doc.hash.a); test.equal(motherOfAllDocuments.hash.b, doc.hash.b); test.equal(date.getTime(), doc.long); test.equal(date.toString(), doc.date.toString()); test.equal(date.getTime(), doc.date.getTime()); test.equal(motherOfAllDocuments.oid.toHexString(), doc.oid.toHexString()); test.equal(motherOfAllDocuments.binary.value(), doc.binary.value()); test.equal(motherOfAllDocuments.int, doc.int); test.equal(motherOfAllDocuments.long, doc.long); test.equal(motherOfAllDocuments.float, doc.float); test.equal(motherOfAllDocuments.regexp.toString(), doc.regexp.toString()); test.equal(motherOfAllDocuments.boolean, doc.boolean); test.equal(motherOfAllDocuments.where.code, doc.where.code); test.equal(motherOfAllDocuments.where.scope['i'], doc.where.scope.i); test.equal(motherOfAllDocuments.dbref.namespace, doc.dbref.namespace); test.equal(motherOfAllDocuments.dbref.oid.toHexString(), doc.dbref.oid.toHexString()); test.equal(motherOfAllDocuments.dbref.db, doc.dbref.db); test.done(); }) }); }); }, shouldCorrectlyDoToJsonForLongValue : function(test) { client.createCollection('test_to_json_for_long', function(err, collection) { test.ok(collection instanceof Collection); collection.insertAll([{value: client.bson_serializer.Long.fromNumber(32222432)}], {safe:true}, function(err, ids) { collection.findOne({}, function(err, item) { test.equal(32222432, item.value); test.done(); }); }); }); }, shouldCorrectlyInsertAndUpdateWithNoCallback : function(test) { var db = new Db(MONGODB, new Server('localhost', 27017, {auto_reconnect: true, poolSize: 1}), {native_parser: (process.env['TEST_NATIVE'] != null)}); db.bson_deserializer = client.bson_deserializer; db.bson_serializer = client.bson_serializer; db.pkFactory = client.pkFactory; db.open(function(err, client) { client.createCollection('test_insert_and_update_no_callback', function(err, collection) { // Insert the update collection.insert({i:1}, {safe:true}) // Update the record collection.update({i:1}, {"$set":{i:2}}, {safe:true}) // Make sure we leave enough time for mongodb to record the data setTimeout(function() { // Locate document collection.findOne({}, function(err, item) { test.equal(2, item.i) client.close(); test.done(); }); }, 100) }) }); }, shouldInsertAndQueryTimestamp : function(test) { client.createCollection('test_insert_and_query_timestamp', function(err, collection) { // Insert the update collection.insert({i:client.bson_serializer.Timestamp.fromNumber(100), j:client.bson_serializer.Long.fromNumber(200)}, {safe:true}, function(err, r) { // Locate document collection.findOne({}, function(err, item) { test.ok(item.i instanceof client.bson_serializer.Timestamp); test.equal(100, item.i); test.ok(typeof item.j == "number"); test.equal(200, item.j); test.done(); }); }) }) }, shouldCorrectlyInsertAndQueryUndefined : function(test) { client.createCollection('test_insert_and_query_undefined', function(err, collection) { // Insert the update collection.insert({i:undefined}, {safe:true}, function(err, r) { // Locate document collection.findOne({}, function(err, item) { test.equal(null, item.i) test.done(); }); }) }) }, shouldCorrectlySerializeDBRefToJSON : function(test) { var dbref = new client.bson_serializer.DBRef("foo", client.bson_serializer.ObjectID.createFromHexString("fc24a04d4560531f00000000"), null); JSON.stringify(dbref); test.done(); }, shouldCorrectlyPerformSafeInsert : function(test) { var fixtures = [{ name: "empty", array: [], bool: false, dict: {}, float: 0.0, string: "" }, { name: "not empty", array: [1], bool: true, dict: {x: "y"}, float: 1.0, string: "something" }, { name: "simple nested", array: [1, [2, [3]]], bool: true, dict: {x: "y", array: [1,2,3,4], dict: {x: "y", array: [1,2,3,4]}}, float: 1.5, string: "something simply nested" }]; client.createCollection('test_safe_insert', function(err, collection) { Step( function inserts() { var group = this.group(); for(var i = 0; i < fixtures.length; i++) { collection.insert(fixtures[i], {safe:true}, group()); } }, function done() { collection.count(function(err, count) { test.equal(3, count); collection.find().toArray(function(err, docs) { test.equal(3, docs.length) }); }); collection.find({}, {}, function(err, cursor) { var counter = 0; cursor.each(function(err, doc) { if(doc == null) { test.equal(3, counter); test.done(); } else { counter = counter + 1; } }); }); } ) }) }, shouldThrowErrorIfSerializingFunction : function(test) { client.createCollection('test_should_throw_error_if_serializing_function', function(err, collection) { var func = function() { return 1}; // Insert the update collection.insert({i:1, z:func }, {safe:true}, function(err, result) { collection.findOne({_id:result[0]._id}, function(err, object) { test.equal(func.toString(), object.z.code); test.equal(1, object.i); test.done(); }) }) }) }, shouldCorrectlyInsertDocumentWithUUID : function(test) { client.collection("insert_doc_with_uuid", function(err, collection) { collection.insert({_id : "12345678123456781234567812345678", field: '1'}, {safe:true}, function(err, result) { test.equal(null, err); collection.find({_id : "12345678123456781234567812345678"}).toArray(function(err, items) { test.equal(null, err); test.equal(items[0]._id, "12345678123456781234567812345678") test.equal(items[0].field, '1') // Generate a binary id var binaryUUID = new client.bson_serializer.Binary('00000078123456781234567812345678', client.bson_serializer.BSON.BSON_BINARY_SUBTYPE_UUID); collection.insert({_id : binaryUUID, field: '2'}, {safe:true}, function(err, result) { collection.find({_id : binaryUUID}).toArray(function(err, items) { test.equal(null, err); test.equal(items[0].field, '2') test.done(); }); }); }) }); }); }, shouldCorrectlyCallCallbackWithDbDriverInStrictMode : function(test) { var db = new Db(MONGODB, new Server('localhost', 27017, {auto_reconnect: true, poolSize: 1}), {strict:true, native_parser: (process.env['TEST_NATIVE'] != null)}); db.bson_deserializer = client.bson_deserializer; db.bson_serializer = client.bson_serializer; db.pkFactory = client.pkFactory; db.open(function(err, client) { client.createCollection('test_insert_and_update_no_callback_strict', function(err, collection) { collection.insert({_id : "12345678123456781234567812345678", field: '1'}, {safe:true}, function(err, result) { test.equal(null, err); collection.update({ '_id': "12345678123456781234567812345678" }, { '$set': { 'field': 0 }}, function(err, numberOfUpdates) { test.equal(null, err); test.equal(1, numberOfUpdates); db.close(); test.done(); }); }); }); }); }, shouldCorrectlyInsertDBRefWithDbNotDefined : function(test) { client.createCollection('shouldCorrectlyInsertDBRefWithDbNotDefined', function(err, collection) { var doc = {_id: new client.bson_serializer.ObjectID()}; var doc2 = {_id: new client.bson_serializer.ObjectID()}; var doc3 = {_id: new client.bson_serializer.ObjectID()}; collection.insert(doc, {safe:true}, function(err, result) { // Create object with dbref doc2.ref = new client.bson_serializer.DBRef('shouldCorrectlyInsertDBRefWithDbNotDefined', doc._id); doc3.ref = new client.bson_serializer.DBRef('shouldCorrectlyInsertDBRefWithDbNotDefined', doc._id, MONGODB); collection.insert([doc2, doc3], {safe:true}, function(err, result) { // Get all items collection.find().toArray(function(err, items) { test.equal("shouldCorrectlyInsertDBRefWithDbNotDefined", items[1].ref.namespace); test.equal(doc._id.toString(), items[1].ref.oid.toString()); test.equal(null, items[1].ref.db); test.equal("shouldCorrectlyInsertDBRefWithDbNotDefined", items[2].ref.namespace); test.equal(doc._id.toString(), items[2].ref.oid.toString()); test.equal(MONGODB, items[2].ref.db); test.done(); }) }); }); }); }, shouldCorrectlyInsertUpdateRemoveWithNoOptions : function(test) { var db = new Db(MONGODB, new Server('localhost', 27017, {auto_reconnect: true}), {native_parser: (process.env['TEST_NATIVE'] != null)}); db.bson_deserializer = client.bson_deserializer; db.bson_serializer = client.bson_serializer; db.pkFactory = client.pkFactory; db.open(function(err, db) { db.collection('shouldCorrectlyInsertUpdateRemoveWithNoOptions', function(err, collection) { collection.insert({a:1});//, function(err, result) { collection.update({a:1}, {a:2});//, function(err, result) { collection.remove({a:2});//, function(err, result) { collection.count(function(err, count) { test.equal(0, count); db.close(); test.done(); }) }); }); }, shouldCorrectlyExecuteMultipleFetches : function(test) { var db = new Db(MONGODB, new Server('localhost', 27017, {auto_reconnect: true}), {native_parser: (process.env['TEST_NATIVE'] != null)}); db.bson_deserializer = client.bson_deserializer; db.bson_serializer = client.bson_serializer; db.pkFactory = client.pkFactory; // Search parameter var to = 'ralph' // Execute query db.open(function(err, db) { db.collection('shouldCorrectlyExecuteMultipleFetches', function(err, collection) { collection.insert({addresses:{localPart:'ralph'}}, {safe:true}, function(err, result) { // Let's find our user collection.findOne({"addresses.localPart" : to}, function( err, doc ) { test.equal(null, err); test.equal(to, doc.addresses.localPart); db.close(); test.done(); }); }); }); }); }, shouldCorrectlyFailWhenNoObjectToUpdate: function(test) { client.createCollection('shouldCorrectlyExecuteSaveInsertUpdate', function(err, collection) { collection.update({_id : new client.bson_serializer.ObjectID()}, { email : 'update' }, {safe:true}, function(err, result) { test.equal(0, result); test.done(); } ); }); }, 'Should correctly insert object and retrieve it when containing array and IsoDate' : function(test) { var doc = { "_id" : new client.bson_serializer.ObjectID("4e886e687ff7ef5e00000162"), "str" : "foreign", "type" : 2, "timestamp" : ISODate("2011-10-02T14:00:08.383Z"), "links" : [ "http://www.reddit.com/r/worldnews/comments/kybm0/uk_home_secretary_calls_for_the_scrapping_of_the/" ] } client.createCollection('Should_correctly_insert_object_and_retrieve_it_when_containing_array_and_IsoDate', function(err, collection) { collection.insert(doc, {safe:true}, function(err, result) { test.ok(err == null); collection.findOne(function(err, item) { test.ok(err == null); test.deepEqual(doc, item); test.done(); }); }); }); }, 'Should correctly insert object with timestamps' : function(test) { var doc = { "_id" : new client.bson_serializer.ObjectID("4e886e687ff7ef5e00000162"), "str" : "foreign", "type" : 2, "timestamp" : new client.bson_serializer.Timestamp(10000), "links" : [ "http://www.reddit.com/r/worldnews/comments/kybm0/uk_home_secretary_calls_for_the_scrapping_of_the/" ], "timestamp2" : new client.bson_serializer.Timestamp(33333), } client.createCollection('Should_correctly_insert_object_with_timestamps', function(err, collection) { collection.insert(doc, {safe:true}, function(err, result) { test.ok(err == null); collection.findOne(function(err, item) { test.ok(err == null); test.deepEqual(doc, item); test.done(); }); }); }); }, noGlobalsLeaked : function(test) { var leaks = gleak.detectNew(); test.equal(0, leaks.length, "global var leak detected: " + leaks.join(', ')); test.done(); } }) // Stupid freaking workaround due to there being no way to run setup once for each suite var numberOfTestsRun = Object.keys(tests).length; // Assign out tests module.exports = tests;
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Library")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Library")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("7fe95ccf-31a1-463d-905f-3356047487df")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
// // AppDelegate.h // DPDataStorageDemo // // Created by Alex Bakhtin on 10/6/15. // Copyright © 2015 dmitriy.petrusevich. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
def is_isogram(s): """ Determine if a word or phrase is an isogram. An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter. Examples of isograms: - lumberjacks - background - downstream """ from collections import Counter s = s.lower().strip() s = [c for c in s if c.isalpha()] counts = Counter(s).values() return max(counts or [1]) == 1
import isEqual from '../util/isEqual'; import Delta from '../delta/Delta'; import Op from '../delta/Op'; import Line, { LineRanges, LineIds } from './Line'; import LineOp from './LineOp'; import AttributeMap from '../delta/AttributeMap'; import { EditorRange, normalizeRange } from './EditorRange'; import TextChange from './TextChange'; import { deltaToText } from './deltaToText'; const EMPTY_RANGE: EditorRange = [ 0, 0 ]; const EMPTY_OBJ = {}; const DELTA_CACHE = new WeakMap<TextDocument, Delta>(); const excludeProps = new Set([ 'id' ]); export interface FormattingOptions { nameOnly?: boolean; allFormats?: boolean; } export default class TextDocument { private _ranges: LineRanges; byId: LineIds; lines: Line[]; length: number; selection: EditorRange | null; constructor(lines?: TextDocument | Line[] | Delta, selection: EditorRange | null = null) { if (lines instanceof TextDocument) { this.lines = lines.lines; this.byId = lines.byId; this._ranges = lines._ranges; this.length = lines.length; } else { this.byId = new Map(); if (Array.isArray(lines)) { this.lines = lines; } else if (lines) { this.lines = Line.fromDelta(lines); } else { this.lines = [ Line.create() ]; } if (!this.lines.length) { this.lines.push(Line.create()); } this.byId = Line.linesToLineIds(this.lines); // Check for line id duplicates (should never happen, indicates bug) this.lines.forEach(line => { if (this.byId.get(line.id) !== line) throw new Error('TextDocument has duplicate line ids: ' + line.id); }); this._ranges = Line.getLineRanges(this.lines); this.length = this.lines.reduce((length, line) => length + line.length, 0); } this.selection = selection && selection.map(index => Math.min(this.length - 1, Math.max(0, index))) as EditorRange; } get change() { const change = new TextChange(this); change.apply = () => this.apply(change); return change; } getText(range?: EditorRange): string { if (range) range = normalizeRange(range); return deltaToText(range ? this.slice(range[0], range[1]) : this.slice(0, this.length - 1)); } getLineBy(id: string) { return this.byId.get(id) as Line; } getLineAt(at: number) { return this.lines.find(line => { const [ start, end ] = this.getLineRange(line); return start <= at && end > at; }) as Line; } getLinesAt(at: number | EditorRange, encompassed?: boolean) { let to = at as number; if (Array.isArray(at)) [ at, to ] = normalizeRange(at); return this.lines.filter(line => { const [ start, end ] = this.getLineRange(line); return encompassed ? start >= at && end <= to : (start < to || start === at) && end > at; }); } getLineRange(at: number | string | Line): EditorRange { const { lines, _ranges: lineRanges } = this; if (typeof at === 'number') { for (let i = 0; i < lines.length; i++) { const range = lineRanges.get(lines[i]) || EMPTY_RANGE; if (range[0] <= at && range[1] > at) return range; } return EMPTY_RANGE; } else { if (typeof at === 'string') at = this.getLineBy(at); return lineRanges.get(at) as EditorRange; } } getLineRanges(at?: number | EditorRange) { if (at == null) { return Array.from(this._ranges.values()); } else { return this.getLinesAt(at).map(line => this.getLineRange(line)); } } getLineFormat(at: number | EditorRange = this.selection as EditorRange, options?: FormattingOptions) { let to = at as number; if (Array.isArray(at)) [ at, to ] = normalizeRange(at); if (at === to) to++; return getAttributes(Line, this.lines, at, to, undefined, options); } getTextFormat(at: number | EditorRange = this.selection as EditorRange, options?: FormattingOptions) { let to = at as number; if (Array.isArray(at)) [ at, to ] = normalizeRange(at); if (at === to) at--; return getAttributes(LineOp, this.lines, at, to, op => op.insert !== '\n', options); } getFormats(at: number | EditorRange = this.selection as EditorRange, options?: FormattingOptions): AttributeMap { return { ...this.getTextFormat(at, options), ...this.getLineFormat(at, options) }; } slice(start: number = 0, end: number = Infinity): Delta { const ops: Op[] = []; const iter = LineOp.iterator(this.lines); let index = 0; while (index < end && iter.hasNext()) { let nextOp: Op; if (index < start) { nextOp = iter.next(start - index); } else { nextOp = iter.next(end - index); ops.push(nextOp); } index += Op.length(nextOp); } return new Delta(ops); } apply(change: Delta | TextChange, selection?: EditorRange | null, throwOnError?: boolean): TextDocument { let delta: Delta; if (change instanceof TextChange) { delta = change.delta; selection = change.selection; } else { delta = change; } // If no change, do nothing if (!delta.ops.length && (selection === undefined || isEqual(this.selection, selection))) { return this; } // Optimization for selection-only change if (!delta.ops.length && selection) { return new TextDocument(this, selection); } if (selection === undefined && this.selection) { selection = [ delta.transformPosition(this.selection[0]), delta.transformPosition(this.selection[1]) ]; // If the selection hasn't changed, keep the original reference if (isEqual(this.selection, selection)) { selection = this.selection; } } const thisIter = LineOp.iterator(this.lines, this.byId); const otherIter = Op.iterator(delta.ops); let lines: Line[] = []; const firstChange = otherIter.peek(); if (firstChange && firstChange.retain && !firstChange.attributes) { let firstLeft = firstChange.retain; while (thisIter.peekLineLength() <= firstLeft) { firstLeft -= thisIter.peekLineLength(); lines.push(thisIter.nextLine()); } if (firstChange.retain - firstLeft > 0) { otherIter.next(firstChange.retain - firstLeft); } } if (!thisIter.hasNext()) { if (throwOnError) throw new Error('apply() called with change that extends beyond document'); } let line = Line.createFrom(thisIter.peekLine()); // let wentBeyond = false; function addLine(line: Line) { line.length = line.content.length() + 1; lines.push(line); } while (thisIter.hasNext() || otherIter.hasNext()) { if (otherIter.peekType() === 'insert') { const otherOp = otherIter.peek(); const index = typeof otherOp.insert === 'string' ? otherOp.insert.indexOf('\n', otherIter.offset) : -1; if (index < 0) { line.content.push(otherIter.next()); } else { const nextIndex = index - otherIter.offset; if (nextIndex) line.content.push(otherIter.next(nextIndex)); const newlineOp = otherIter.next(1); const nextAttributes = line.attributes; line.attributes = newlineOp.attributes || {}; addLine(line); line = Line.create(undefined, nextAttributes, this.byId); } } else { const length = Math.min(thisIter.peekLength(), otherIter.peekLength()); const thisOp = thisIter.next(length); const otherOp = otherIter.next(length); if (typeof thisOp.retain === 'number') { if (throwOnError) throw new Error('apply() called with change that extends beyond document'); // line.content.push({ insert: '#'.repeat(otherOp.retain || 1) }); // wentBeyond = true; continue; } if (typeof otherOp.retain === 'number') { const isLine = thisOp.insert === '\n'; let newOp: Op = thisOp; // Preserve null when composing with a retain, otherwise remove it for inserts const attributes = otherOp.attributes && AttributeMap.compose(thisOp.attributes, otherOp.attributes); if (otherOp.attributes && !isEqual(attributes, thisOp.attributes)) { if (isLine) { line.attributes = attributes || {}; } else { newOp = { insert: thisOp.insert }; if (attributes) newOp.attributes = attributes; } } if (isLine) { addLine(line); line = Line.createFrom(thisIter.peekLine()); } else { line.content.push(newOp); } // Optimization if at the end of other if (otherOp.retain === Infinity || !otherIter.hasNext()) { if (thisIter.opIterator.index !== 0 || thisIter.opIterator.offset !== 0) { const ops = thisIter.restCurrentLine(); for (let i = 0; i < ops.length; i++) { line.content.push(ops[i]); } addLine(line); thisIter.nextLine(); } lines.push(...thisIter.restLines()); break; } } // else ... otherOp should be a delete so we won't add the next thisOp insert } } // if (wentBeyond) { // console.log('went beyond:', line); // addLine(line); // } return new TextDocument(lines, selection); } replace(delta?: Delta, selection?: EditorRange | null) { return new TextDocument(delta, selection); } toDelta(): Delta { const cache = DELTA_CACHE; let delta = cache.get(this); if (!delta) { delta = Line.toDelta(this.lines); cache.set(this, delta); } return delta; } equals(other: TextDocument, options?: { contentOnly?: boolean }) { return this === other || (options?.contentOnly || isEqual(this.selection, other.selection)) && isEqual(this.lines, other.lines, { excludeProps }); } toJSON() { return this.toDelta(); } toString() { return this.lines .map(line => line.content .map(op => typeof op.insert === 'string' ? op.insert : ' ') .join('')) .join('\n') + '\n'; } } function getAttributes(Type: any, data: any, from: number, to: number, filter?: (next: any) => boolean, options?: FormattingOptions): AttributeMap { const iter = Type.iterator(data); let attributes: AttributeMap | undefined; let index = 0; if (iter.skip) index += iter.skip(from); while (index < to && iter.hasNext()) { let next = iter.next() as { attributes: AttributeMap }; index += Type.length(next); if (index > from && (!filter || filter(next))) { if (!next.attributes) attributes = {}; else if (!attributes) attributes = { ...next.attributes }; else if (options?.allFormats) attributes = AttributeMap.compose(attributes, next.attributes); else attributes = intersectAttributes(attributes, next.attributes, options?.nameOnly); } } return attributes || EMPTY_OBJ; } // Intersect 2 attibute maps, keeping only those that are equal in both function intersectAttributes(attributes: AttributeMap, other: AttributeMap, nameOnly?: boolean) { return Object.keys(other).reduce(function(intersect, name) { if (nameOnly) { if (name in attributes && name in other) intersect[name] = true; } else if (isEqual(attributes[name], other[name], { partial: true })) { intersect[name] = other[name]; } else if (isEqual(other[name], attributes[name], { partial: true })) { intersect[name] = attributes[name]; } return intersect; }, {}); }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, shrink-to-fit=no, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Dashboard - El Rey Jesus</title> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Simple Side Bar CSS --> <link href="css/simple-sidebar.css" rel="stylesheet"> <!-- Font Awesome CSS --> <link rel="stylesheet" href="css/font-awesome.min.css"> <!-- Web Ration CSS --> <link href="css/app.css" rel="stylesheet"> <link href="css/dashboard.css" rel="stylesheet"> <!-- Sweet Alert 2 --> <link href="https://cdn.jsdelivr.net/sweetalert2/6.4.2/sweetalert2.min.css" rel="stylesheet"> <!-- Google Fonts --> <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet"> <!-- 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/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div id="wrapper" class="toggled"> <div class="main_logo_container"> <img src="img/logo-icon.png" class="img-responsive main_logo_icon" id="logo"> </div> <!-- sidebar-menu-wrapper --> <div id="sidebar-wrapper" class="hide_scroll"> <ul class="nav sidebar-nav nav-stacked" id="accordion"> <!-- Toggle Menu Button --> <li> <a href="#menu-toggle" id="menu-toggle"><i class="fa fa-bars menu_icon" aria-hidden="true"></i><span class="font_white">NAVAGACÍON</span><i class="fa fa-angle-left custom font_white" aria-hidden="true"></i></a> </li> <!-- Toggle Menu Button --> <!-- Menu Items - elementos de menú --> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#firstLink" id="userProfile"><i class="fa fa-user-o primary_menu_icon" aria-hidden="true"></i><span class="font_white">Julien Cousin</span></a></li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#secondLink"><i class="fa fa-users primary_menu_icon" aria-hidden="true"></i>Membresa [Lider]<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="secondLink" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#exitLink" id="exit"><i class="fa fa-power-off primary_menu_icon" aria-hidden="true"></i>Exit</a></li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#contactosLink"><i class="fa fa-users primary_menu_icon" aria-hidden="true"></i>Contactos<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="contactosLink" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#3Link"><i class="fa fa-cogs primary_menu_icon" aria-hidden="true"></i>Discipulados<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="3Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link">Mis discípulos</a></li> <li class="sub_menu"><a href="#" class="sub_menu_link">Mentores y Discípulos</a></li> <li class="sub_menu"><a href="#" class="sub_menu_link">Renuniones de discípulos</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#4Link"><i class="fa fa-home primary_menu_icon" aria-hidden="true"></i>Casa De Paz<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="4Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#5Link" title="Categoría de lotes, lotes,, redes, cosechas"><i class="fa fa-map-marker primary_menu_icon" aria-hidden="true"></i>Categoría de lotes, lotes,, redes, cosechas<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="5Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#6Link" title="Escuelas, Escuelas,EscuelasEscuelas,Escuelas"><i class="fa fa-graduation-cap primary_menu_icon" aria-hidden="true"></i>Escuelas, Escuelas Escuelas<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="6Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, SubSubS...</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#7Link" title="ERJ-Definiciones, ERJ-Definiciones, ERJ-Definiciones"><i class="fa fa-book primary_menu_icon" aria-hidden="true"></i>ERJ-Definiciones, ERJ-Definiciones, ERJ-Definiciones<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="7Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#5Link"><i class="fa fa-map-marker primary_menu_icon" aria-hidden="true"></i>Lotes<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="5Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#6Link"><i class="fa fa-graduation-cap primary_menu_icon" aria-hidden="true"></i>Escuelas<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="6Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#7Link"><i class="fa fa-book primary_menu_icon" aria-hidden="true"></i>ERJ-Definiciones<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="7Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#5Link"><i class="fa fa-map-marker primary_menu_icon" aria-hidden="true"></i>Lotes<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="5Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#6Link"><i class="fa fa-graduation-cap primary_menu_icon" aria-hidden="true"></i>Escuelas<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="6Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> <li class="panel_menu menu_link_item"><a class="main_menu_link" data-toggle="collapse" data-parent="#accordion" href="#7Link"><i class="fa fa-book primary_menu_icon" aria-hidden="true"></i>ERJ-Definiciones<i class="fa fa-angle-down" aria-hidden="true"></i></a> <ul id="7Link" class="collapse"> <li class="sub_menu"><a href="#" class="sub_menu_link" title="Sub Menu ExpSub Menu Exp, Sub Menu Exp">Sub Menu Exp, Sub Menu Exp</a></li> </ul> </li> </ul> </div> <!-- sidebar-menu-wrapper --> <!-- Page Content --> <div id="page-content-wrapper"> <div class="container-fluid"> <!-- top bar (search area) --> <div class="row" id="top_bar"> <div class="col-xs-12 col-lg-4"> <p class="font_white">My Dashboard</p> </div> <div class="col-xs-12 col-lg-4"> <!-- Search Bar --> <form action="#" method="post"> <div class="input-group full_width"> <input type="text" class="form-control" aria-label="Search Field" placeholder="Busca..."> <span class="input-group-addon"><i class="fa fa-search" aria-hidden="true"></i></span> </div> </form> <!-- End Search Bar --> </div> <div class="col-xs-12 col-lg-4 small_viewport_section"> <!-- <p class="font_white">My Dashboard</p> --> </div> </div> <!-- end top bar (search area) --> <!-- main area --> <div class="row col-xs-12" id="main_body"> <!-- User Data / Fab button --> <div class="fab_area"> <div class="col-lg-4"> <span>Dashboard</span><br> <span class="user_name">Julien Cousin</span><br> <span class="user_id">4684548786</span> </div> <div class="col-lg-8 text-right"> <div class="btn-group custom"> <div class="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle dropdown_fab" type="button" data-toggle="dropdown"> <i class="fa fa-plus" aria-hidden="true"></i> </button> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#" class="text-right">My Dashboard <span class="fa fa-circle"></span></a></li> <li><a href="#" class="text-right">Send Email <span class="fa fa-envelope"></span></a></li> <li><a href="#" class="text-right">Events <span class="fa fa-bell"></span></a></li> <li><a href="#" class="text-right">Limits <span class="fa fa-heart"></span></a></li> <li><a href="#" class="text-right">Responsibilities <span class="fa fa-times"></span></a></li> </ul> </div> </div> </div> </div> <!-- End User Data / Fab button --> <div class="col-xs-12"> <!-- Table and Tabs --> <ul class="nav nav-tabs personal_info_section"> <li class="active"> <a data-toggle="tab" href="#evengelismo">Evengelismo</a> <div class="progressCircleGreen" style="position:absolute;top:-7px;left:2px;"></div> </li> <li> <a data-toggle="tab" href="#afirmacion">Afirmacion</a> </li> <li> <a data-toggle="tab" href="#cpaz">Casa de Paz</a> <div class="progressCircleYellow" style="position:absolute;top:-7px;left:2px;"></div> </li> <li> <a data-toggle="tab" href="#mentores">Mentores</a> <div class="progressCircleRed" style="position:absolute;top:-7px;left:2px;"></div> </li> </ul> <!-- EndTable and Tabs --> <!-- Tab Content --> <div id="dashboardCharts" class="tab-content"> <div id="evengelismo" class="tab-pane fade in active"> <div class="personal_info personal_info_section"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-md-4" style="border-right: 1px solid #f2f2f2"> <!-- Current (Main) Chart --> <canvas class="chart_1" id="dashChartCurrent"></canvas> <!-- End Current (Main) Chart --> <div class="text-center"> <strong>Current Totals + Targets</strong> <hr> <!-- Chart Year Buttons --> <button class="graph_button_years" data-chart="dashChart1">1 Year</button> <button class="graph_button_years" data-chart="dashChart2">5 Year</button> <button class="graph_button_years" data-chart="dashChart3">10 Year</button> <!-- Chart Year Buttons --> <hr> </div> <div class="chart_container"> <canvas class="" id="dashChart1"></canvas> <canvas class="hide" id="dashChart2"></canvas> <canvas class="hide" id="dashChart3"></canvas> </div> <div class="text-center"> <hr> <strong>Historical Total + Targets</strong> </div> </div> <div class="col-xs-11 col-md-8" style="border-right: 1px solid #f2f2f2"> <div class="table-responsive"> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th colspan="5"><input type="text" class="form-control" aria-label="Search Field" placeholder="Busca..."></th> </tr> <tr> <th></th> <th>Nombre</th> <th>Email</th> <th>Teléfono celular</th> <th><div class="text-right"> <button title="Email" class="btn btn-primary" id="email_1" name="email_1" type="submit" value="Aplicar"><span class="fa fa-envelope"></span> Send All</button> <button title="Email" class="btn btn-primary" id="clear_1" name="email_1" type="submit" value="Aplicar"><span class="fa fa-times"></span> Clear All</button> </th> </tr> </thead> <tbody> <tr> <td><div class="progressCircleRed"></div></td> <td>Frankie Torres</td> <td>Frankie@gmail.com</td> <td>973-234-4812</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope disabled" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Daniela Navarro</td> <td>Daniela@gmail.com</td> <td>407-393-7629</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye disabled" aria-hidden="true"></i> <i class="fa fa-envelope disabled" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Daniela Valeri</td> <td>Daniela@gmail.com</td> <td>115-841-64177906</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleGreen"></div></td> <td>Maria Adelina</td> <td>Maria@gmail.com</td> <td>786-738-3255</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleGreen"></div></td> <td>Maria Fernanda</td> <td>Maria@gmail.com</td> <td>854-764-76</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Tayda Oshi</td> <td>Tayda@gmail.com</td> <td>770-899-9566</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Sabrina Jean</td> <td>Sabrina@gmail.com</td> <td>786-630-9345</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleGreen"></div></td> <td>Gloria Yolanda</td> <td>Gloria@gmail.com</td> <td>786-316-8049</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye disabled" aria-hidden="true"></i> <i class="fa fa-envelope disabled" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Cira Rodriguez</td> <td>Cira@gmail.com</td> <td>786-478-5680</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye disabled" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Frankie Torres</td> <td>Frankie@gmail.com</td> <td>973-234-4812</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope disabled" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Daniela Navarro</td> <td>Daniela@gmail.com</td> <td>407-393-7629</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye disabled" aria-hidden="true"></i> <i class="fa fa-envelope disabled" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Daniela Valeri</td> <td>Daniela@gmail.com</td> <td>115-841-64177906</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleGreen"></div></td> <td>Maria Adelina</td> <td>Maria@gmail.com</td> <td>786-738-3255</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleGreen"></div></td> <td>Maria Fernanda</td> <td>Maria@gmail.com</td> <td>854-764-76</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Tayda Oshi</td> <td>Tayda@gmail.com</td> <td>770-899-9566</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Sabrina Jean</td> <td>Sabrina@gmail.com</td> <td>786-630-9345</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleGreen"></div></td> <td>Gloria Yolanda</td> <td>Gloria@gmail.com</td> <td>786-316-8049</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye disabled" aria-hidden="true"></i> <i class="fa fa-envelope disabled" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> <tr> <td><div class="progressCircleRed"></div></td> <td>Cira Rodriguez</td> <td>Cira@gmail.com</td> <td>786-478-5680</td> <td class="text-right"> <div class="quick_actions_container display_inline"> <i class="fa fa-eye disabled" aria-hidden="true"></i> <i class="fa fa-envelope" aria-hidden="true"></i> </div> <div class="btn-group custom"> <div class="dropdown"> <span class="btn dropdown-toggle dropdown_fab btn_table_extra" data-toggle="dropdown"> <i class="fa fa-ellipsis-v" aria-hidden="true"></i> </span> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> <div class="table-responsive hide"> <p>Hidden Table</p> </div> <hr> </div> <!-- <div class="col-xs-11 col-md-8 hide" style="border-right: 1px solid #f2f2f2"> <div class="table-responsive"> <p>Hidden Table</p> </div> <hr> </div> --> </div> </div> </div> </div> <!-- <div id="afirmacion" class="tab-pane fade in"> <div class="personal_info personal_info_section"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-md-4" style="border-right: 1px solid #f2f2f2"> <canvas class="chart_3" id="dashChart3"></canvas> </div> <div class="col-xs-11 col-md-8" style="border-right: 1px solid #f2f2f2"> <div> Lorem ipsum dolor sit amet, consectetur 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. 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> <hr> <div class="text-right"> <button title="Email" class="btn btn-primary" id="email_3" name="email_3" type="submit" value="Aplicar"><span class="fa fa-envelope"></span> Send Email</button> </div> </div> <div class="col-xs-12 col-md-1 text-right"> <div class="btn-group custom"> <div class="dropdown"> <button type="button" class="btn btn-circle btn-primary dropdown-toggle dropdown_fab" type="button" data-toggle="dropdown"> <i class="fa fa-plus" aria-hidden="true"></i> </button> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#" class="text-right">My Dashboard <span class="fa fa-circle"></span></a></li> <li><a href="#" class="text-right">Send Email <span class="fa fa-envelope"></span></a></li> <li><a href="#" class="text-right">Events <span class="fa fa-bell"></span></a></li> <li><a href="#" class="text-right">Limits <span class="fa fa-heart"></span></a></li> <li><a href="#" class="text-right">Responsibilities <span class="fa fa-times"></span></a></li> </ul> </div> </div> </div> </div> <hr> <div class="row"> <div class="col-xs-12 col-md-4" style="border-right: 1px solid #f2f2f2"> <canvas class="chart_4" id="dashChart4"></canvas> </div> <div class="col-xs-11 col-md-8" style="border-right: 1px solid #f2f2f2"> <div> Lorem ipsum dolor sit amet, consectetur 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. 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> <hr> <div class="text-right"> <button title="Email" class="btn btn-primary" id="email_4" name="email_4" type="submit" value="Aplicar"><span class="fa fa-envelope"></span> Send Email</button> </div> </div> <div class="col-xs-12 col-md-1 text-right"> <div class="btn-group custom"> <div class="dropdown"> <button type="button" class="btn btn-circle btn-primary dropdown-toggle dropdown_fab" type="button" data-toggle="dropdown"> <i class="fa fa-plus" aria-hidden="true"></i> </button> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#">Ver detalles de la persona</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Todas las Vistas</a></li> <li><a href="#">Pre-register</a></li> <li><a href="#">Asignar responsable</a></li> </ul> </div> </div> </div> </div> </div> </div> </div> <div id="cpaz" class="tab-pane fade in">8 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> <hr> <div class="text-right"> <button title="Email" class="btn btn-primary" id="email_6" name="email_6" type="submit" value="Aplicar"><span class="fa fa-envelope"></span> Send Email</button> </div> </div> <div class="col-xs-12 col-md-1 text-right"> <div class="btn-group custom"> <div class="dropdown"> <button type="button" class="btn btn-circle btn-primary dropdown-toggle dropdown_fab" type="button" data-toggle="dropdown"> <i class="fa fa-plus" aria-hidden="true"></i> </button> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#" class="text-right">My Dashboard <span class="fa fa-circle"></span></a></li> <li><a href="#" class="text-right">Send Email <span class="fa fa-envelope"></span></a></li> <li><a href="#" class="text-right">Events <span class="fa fa-bell"></span></a></li> <li><a href="#" class="text-right">Limits <span class="fa fa-heart"></span></a></li> <li><a href="#" class="text-right">Responsibilities <span class="fa fa-times"></span></a></li> </ul> </div> </div> </div> </div> </div> </div> </div> <div id="mentores" class="tab-pane fade in">8" style="border-right: 1px solid #f2f2f2"> <div> Lorem ipsum dolor sit amet, consectetur 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. 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> <hr> <div class="text-right"> <button title="Email" class="btn btn-primary" id="email_7" name="email_7" type="submit" value="Aplicar"><span class="fa fa-envelope"></span> Send Email</button> </div> </div> <div class="col-xs-12 col-md-1 text-right"> <div class="btn-group custom"> <div class="dropdown"> <button type="button" class="btn btn-circle btn-primary dropdown-toggle dropdown_fab" type="button" data-toggle="dropdown"> <i class="fa fa-plus" aria-hidden="true"></i> </button> <ul class="dropdown-menu dropdown-menu-right"> <li><a href="#" class="text-right">My Dashboard <span class="fa fa-circle"></span></a></li> <li><a href="#" class="text-right">Send Email <span class="fa fa-envelope"></span></a></li> <li><a href="#" class="text-right">Events <span class="fa fa-bell"></span></a></li> <li><a href="#" class="text-right">Limits <span class="fa fa-heart"></span></a></li> <li><a href="#" class="text-right">Responsibilities <span class="fa fa-times"></span></a></li> </ul> </div> </div> </div> </div> </div> </div> </div> --> </div> <!-- End Tab Content --> </div> <!-- end main area --> </div> </div> <!-- /#page-content-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <script src="js/collapse.js"></script> <!-- Chart.js --> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.4/Chart.bundle.min.js"></script> <script src="js/customChartJS.js"></script> <!-- VueJS (Reactive JS) --> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.min.js"></script> <script src="js/dashboard.js"></script> <!-- sweetAlert2.js --> <script src="https://cdn.jsdelivr.net/sweetalert2/6.4.2/sweetalert2.min.js"></script> <!-- Web Ration CSS --> <script src="js/mini-menu.js"></script> <script src="js/show-hide.js"></script> </body> </html>
using System; using System.Linq; using ServiceStack.ServiceHost; using ServiceStack.ServiceInterface; using BTDeploy.ServiceDaemon.TorrentClients; using System.IO; namespace BTDeploy.ServiceDaemon { [Route("/api/admin/kill", "DELETE")] public class AdminKillRequest : IReturnVoid { } public class AdminService : ServiceStack.ServiceInterface.Service { public void Delete(AdminKillRequest request) { Response.Close (); Environment.Exit (0); } } }
/*! * Start Bootstrap - Agency v3.3.7+1 (http://startbootstrap.com/template-overviews/agency) * Copyright 2013-2016 Start Bootstrap * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) */ body { overflow-x: hidden; font-family: "Roboto Slab", "Helvetica Neue", Helvetica, Arial, sans-serif; } .text-muted { color: #777777; } .text-primary { color: #fed136; } p { font-size: 14px; line-height: 1.75; } p.large { font-size: 16px; } a, a:hover, a:focus, a:active, a.active { outline: none; } a { color: #fed136; } a:hover, a:focus, a:active, a.active { color: #fec503; } h1, h2, h3, h4, h5, h6 { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; } .img-centered { margin: 0 auto; } .bg-light-gray { background-color: #eeeeee; } .bg-darkest-gray { background-color: #222222; } .btn-primary { color: white; background-color: #fed136; border-color: #fed136; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { color: white; background-color: #fec503; border-color: #f6bf01; } .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #fed136; border-color: #fed136; } .btn-primary .badge { color: #fed136; background-color: white; } .btn-xl { color: white; background-color: #fed136; border-color: #fed136; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; border-radius: 3px; font-size: 18px; padding: 20px 40px; } .btn-xl:hover, .btn-xl:focus, .btn-xl:active, .btn-xl.active, .open .dropdown-toggle.btn-xl { color: white; background-color: #fec503; border-color: #f6bf01; } .btn-xl:active, .btn-xl.active, .open .dropdown-toggle.btn-xl { background-image: none; } .btn-xl.disabled, .btn-xl[disabled], fieldset[disabled] .btn-xl, .btn-xl.disabled:hover, .btn-xl[disabled]:hover, fieldset[disabled] .btn-xl:hover, .btn-xl.disabled:focus, .btn-xl[disabled]:focus, fieldset[disabled] .btn-xl:focus, .btn-xl.disabled:active, .btn-xl[disabled]:active, fieldset[disabled] .btn-xl:active, .btn-xl.disabled.active, .btn-xl[disabled].active, fieldset[disabled] .btn-xl.active { background-color: #fed136; border-color: #fed136; } .btn-xl .badge { color: #fed136; background-color: white; } .navbar-custom { background-color: #222222; border-color: transparent; } .navbar-custom .navbar-brand { color: #fed136; font-family: "Kaushan Script", "Helvetica Neue", Helvetica, Arial, cursive; } .navbar-custom .navbar-brand:hover, .navbar-custom .navbar-brand:focus, .navbar-custom .navbar-brand:active, .navbar-custom .navbar-brand.active { color: #fec503; } .navbar-custom .navbar-collapse { border-color: rgba(255, 255, 255, 0.02); } .navbar-custom .navbar-toggle { background-color: #fed136; border-color: #fed136; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; color: white; font-size: 12px; } .navbar-custom .navbar-toggle:hover, .navbar-custom .navbar-toggle:focus { background-color: #fed136; } .navbar-custom .nav li a { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 400; letter-spacing: 1px; color: white; } .navbar-custom .nav li a:hover, .navbar-custom .nav li a:focus { color: #1d7c00; outline: none; } .navbar-custom .navbar-nav > .active > a { border-radius: 0; color: #1d7c00; background-color: #fff; } .navbar-custom .navbar-nav > .active > a:hover, .navbar-custom .navbar-nav > .active > a:focus { color: #1d7c00; background-color: #fff; } @media (min-width: 768px) { .navbar-custom { background-color: transparent; padding: 25px 0; -webkit-transition: padding 0.3s; -moz-transition: padding 0.3s; transition: padding 0.3s; border: none; } .navbar-custom .navbar-brand { font-size: 2em; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; } .navbar-custom .navbar-nav > .active > a { border-radius: 3px; } } @media (min-width: 768px) { .navbar-custom.affix { background-color: #222222; padding: 10px 0; } .navbar-custom.affix .navbar-brand { font-size: 1.5em; } } header { background-image: url('../img/header-bg.jpg'); background-repeat: no-repeat; background-attachment: scroll; background-position: center center; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; text-align: center; color: white; } header .intro-text { padding-top: 100px; padding-bottom: 50px; } header .intro-text .intro-lead-in { font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 22px; line-height: 22px; margin-bottom: 25px; } header .intro-text .intro-heading { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; font-size: 50px; line-height: 50px; margin-bottom: 25px; } @media (min-width: 768px) { header .intro-text { padding-top: 300px; padding-bottom: 200px; } header .intro-text .intro-lead-in { font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 40px; line-height: 40px; margin-bottom: 25px; } header .intro-text .intro-heading { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; font-size: 75px; line-height: 75px; margin-bottom: 50px; } } section { padding: 100px 0; } section h2.section-heading { font-size: 40px; margin-top: 0; margin-bottom: 15px; } section h3.section-subheading { font-size: 16px; font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: none; font-style: italic; font-weight: 400; margin-bottom: 75px; } @media (min-width: 768px) { section { padding: 150px 0; } } .service-heading { margin: 15px 0; text-transform: none; } #portfolio .portfolio-item { margin: 0 0 15px; right: 0; } #portfolio .portfolio-item .portfolio-link { display: block; position: relative; max-width: 400px; margin: 0 auto; } #portfolio .portfolio-item .portfolio-link .portfolio-hover { background: rgba(254, 209, 54, 0.9); position: absolute; width: 100%; height: 100%; opacity: 0; transition: all ease 0.5s; -webkit-transition: all ease 0.5s; -moz-transition: all ease 0.5s; } #portfolio .portfolio-item .portfolio-link .portfolio-hover:hover { opacity: 1; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content { position: absolute; width: 100%; height: 20px; font-size: 20px; text-align: center; top: 50%; margin-top: -12px; color: white; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content i { margin-top: -12px; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h3, #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h4 { margin: 0; } #portfolio .portfolio-item .portfolio-caption { max-width: 400px; margin: 0 auto; background-color: white; text-align: center; padding: 25px; } #portfolio .portfolio-item .portfolio-caption h4 { text-transform: none; margin: 0; } #portfolio .portfolio-item .portfolio-caption p { font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 16px; margin: 0; } #portfolio * { z-index: 2; } @media (min-width: 767px) { #portfolio .portfolio-item { margin: 0 0 30px; } } .timeline { list-style: none; padding: 0; position: relative; } .timeline:before { top: 0; bottom: 0; position: absolute; content: ""; width: 5px; background-color: #237a11; left: 40px; margin-left: -1.5px; } .timeline > li { margin-bottom: 50px; position: relative; min-height: 50px; } .timeline > li:before, .timeline > li:after { content: " "; display: table; } .timeline > li:after { clear: both; } .timeline > li .timeline-panel { width: 100%; float: right; padding: 0 20px 0 100px; position: relative; text-align: left; } .timeline > li .timeline-panel:before { border-left-width: 0; border-right-width: 15px; left: -15px; right: auto; } .timeline > li .timeline-panel:after { border-left-width: 0; border-right-width: 14px; left: -14px; right: auto; } .timeline > li .timeline-image { left: 0; margin-left: 0; width: 80px; height: 80px; position: absolute; z-index: 100; background-color: #fed136; color: white; border-radius: 100%; border: 5px solid #237a11; text-align: center; } .timeline > li .timeline-image h4 { font-size: 10px; margin-top: 12px; line-height: 14px; } .timeline > li.timeline-inverted > .timeline-panel { float: right; text-align: left; padding: 0 20px 0 100px; } .timeline > li.timeline-inverted > .timeline-panel:before { border-left-width: 0; border-right-width: 15px; left: -15px; right: auto; } .timeline > li.timeline-inverted > .timeline-panel:after { border-left-width: 0; border-right-width: 14px; left: -14px; right: auto; } .timeline > li:last-child { margin-bottom: 0; } .timeline .timeline-heading h4 { margin-top: 0; color: inherit; } .timeline .timeline-heading h4.subheading { text-transform: none; } .timeline .timeline-body > p, .timeline .timeline-body > ul { margin-bottom: 0; } @media (min-width: 768px) { .timeline:before { left: 50%; } .timeline > li { margin-bottom: 100px; min-height: 100px; } .timeline > li .timeline-panel { width: 41%; float: left; padding: 0 20px 20px 30px; text-align: right; } .timeline > li .timeline-image { width: 100px; height: 100px; left: 50%; margin-left: -50px; } .timeline > li .timeline-image h4 { font-size: 13px; margin-top: 16px; line-height: 18px; } .timeline > li.timeline-inverted > .timeline-panel { float: right; text-align: left; padding: 0 30px 20px 20px; } } @media (min-width: 992px) { .timeline > li { min-height: 150px; } .timeline > li .timeline-panel { padding: 0 20px 20px; } .timeline > li .timeline-image { width: 150px; height: 150px; margin-left: -75px; } .timeline > li .timeline-image h4 { font-size: 18px; margin-top: 30px; line-height: 26px; } .timeline > li.timeline-inverted > .timeline-panel { padding: 0 20px 20px; } } @media (min-width: 1200px) { .timeline > li { min-height: 170px; } .timeline > li .timeline-panel { padding: 0 20px 20px 100px; } .timeline > li .timeline-image { width: 170px; height: 170px; margin-left: -85px; } .timeline > li .timeline-image h4 { margin-top: 40px; } .timeline > li.timeline-inverted > .timeline-panel { padding: 0 100px 20px 20px; } } .team-member { text-align: center; margin-bottom: 50px; } .team-member img { margin: 0 auto; border: 7px solid white; } .team-member h4 { margin-top: 25px; margin-bottom: 0; text-transform: none; } .team-member p { margin-top: 0; } aside.clients img { margin: 50px auto; } section#contact { background-color: #222222; background-image: url('../img/map-image.png'); background-position: center; background-repeat: no-repeat; } section#contact .section-heading { color: white; } section#contact .form-group { margin-bottom: 25px; } section#contact .form-group input, section#contact .form-group textarea { padding: 20px; } section#contact .form-group input.form-control { height: auto; } section#contact .form-group textarea.form-control { height: 236px; } section#contact .form-control:focus { border-color: #fed136; box-shadow: none; } section#contact ::-webkit-input-placeholder { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact :-moz-placeholder { /* Firefox 18- */ font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact ::-moz-placeholder { /* Firefox 19+ */ font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact :-ms-input-placeholder { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact .text-danger { color: #e74c3c; } footer { padding: 25px 0; text-align: center; } footer span.copyright { line-height: 40px; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; text-transform: none; } footer ul.quicklinks { margin-bottom: 0; line-height: 40px; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; text-transform: none; } ul.social-buttons { margin-bottom: 0; } ul.social-buttons li a { display: block; background-color: #222222; height: 40px; width: 40px; border-radius: 100%; font-size: 20px; line-height: 40px; color: white; outline: none; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; } ul.social-buttons li a:hover, ul.social-buttons li a:focus, ul.social-buttons li a:active { background-color: #fed136; } .btn:focus, .btn:active, .btn.active, .btn:active:focus { outline: none; } .portfolio-modal .modal-dialog { margin: 0; height: 100%; width: auto; } .portfolio-modal .modal-content { border-radius: 0; background-clip: border-box; -webkit-box-shadow: none; box-shadow: none; border: none; min-height: 100%; padding: 100px 0; text-align: center; } .portfolio-modal .modal-content h2 { margin-bottom: 15px; font-size: 3em; } .portfolio-modal .modal-content p { margin-bottom: 30px; } .portfolio-modal .modal-content p.item-intro { margin: 20px 0 30px; font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 16px; } .portfolio-modal .modal-content ul.list-inline { margin-bottom: 30px; margin-top: 0; } .portfolio-modal .modal-content img { margin-bottom: 30px; } .portfolio-modal .close-modal { position: absolute; width: 75px; height: 75px; background-color: transparent; top: 25px; right: 25px; cursor: pointer; } .portfolio-modal .close-modal:hover { opacity: 0.3; } .portfolio-modal .close-modal .lr { height: 75px; width: 1px; margin-left: 35px; background-color: #222222; transform: rotate(45deg); -ms-transform: rotate(45deg); /* IE 9 */ -webkit-transform: rotate(45deg); /* Safari and Chrome */ z-index: 1051; } .portfolio-modal .close-modal .lr .rl { height: 75px; width: 1px; background-color: #222222; transform: rotate(90deg); -ms-transform: rotate(90deg); /* IE 9 */ -webkit-transform: rotate(90deg); /* Safari and Chrome */ z-index: 1052; } .portfolio-modal .modal-backdrop { opacity: 0; display: none; } ::-moz-selection { text-shadow: none; background: #fed136; } ::selection { text-shadow: none; background: #fed136; } img::selection { background: transparent; } img::-moz-selection { background: transparent; } body { webkit-tap-highlight-color: #fed136; } .newbg a { color: #000!important; } .navbar-header.page-scroll { background-color: white; padding: 20px; border-bottom-left-radius: 30px; border-bottom-right-radius: 30px; } .navbar-header img { width:170px; } @media (min-width: 768px) { .navbar-nav>li>a { padding-top: 55px; } } @media (min-width: 768px) { .navbar-custom.affix img{ width:60px; background-color:transparent; } .navbar-custom.affix .navbar-nav>li>a{ padding-top: 30px; } .navbar-custom.affix .navbar-header.page-scroll{ border-radius:none; } p {font-size: 100px !important;}
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Reflection; using System.Reflection.Emit; namespace EasyEmit.Creator { public class ConstructorCreator : Metadata.MenberData { private MethodAttributes methodAttributes; private ConstructorBuilder constructorBuilder; private ConstructorInfo constructorInfo; public ConstructorInfo ConstructorInfo { get { return constructorInfo; } } private IEnumerable<Metadata.Metadata> parameters; private List<ParameterCreator> configurationParameter = new List<ParameterCreator>(); private List<CustomAttributeBuilder> customAttributes = new List<CustomAttributeBuilder>(); private ConstructorCreator(ConstructorInfo constructorInfo) { State = Metadata.State.Defined; this.constructorInfo = constructorInfo; } internal ConstructorCreator(MethodAttributes methodAttributes,IEnumerable<Metadata.Metadata> parameters) { this.methodAttributes = methodAttributes; this.parameters = parameters; } #region BaseDefinition /// <summary> /// Configure one parameter of the constructor /// </summary> /// <param name="position">Position of parameter in the contrusctor</param> /// <param name="parameterAttributes"></param> /// <param name="parameterName">Name of parameter</param> /// <returns></returns> public ParameterCreator ConfigureParameter(int position,ParameterAttributes parameterAttributes,string parameterName) { if (State == Metadata.State.NotDefined) { if (parameters.ElementAt(position - 1) == null) { throw new Exception("This parameter doesnt exist"); } if (configurationParameter.Count(cp => cp.Position == position) == 1) { throw new Exception("This parameter is alreadty configure"); } if (configurationParameter.Count(cp => cp.Name == parameterName) == 1) { throw new Exception("An another parameter already have this name"); } else { ParameterCreator parameterCreator = new ParameterCreator(position, parameterAttributes, parameterName, parameters.ElementAt(position - 1)); configurationParameter.Add(parameterCreator); return parameterCreator; } } else { throw new Exception((State == Metadata.State.AllDefiniton) ? "The type has been partialy compile" : "The type has been compile"); } } /// <summary> /// Suppress one parameter using position /// </summary> /// <param name="position">Position of parameter to suppress</param> public void SuppressConfigurationParameter(int position) { if (State == Metadata.State.NotDefined) { configurationParameter.RemoveAll(cp => cp.Position == position); } else { throw new Exception((State == Metadata.State.AllDefiniton) ? "The type has been partialy compile" : "The type has been compile"); } } /// <summary> /// Suppress one parameter using name /// </summary> /// <param name="name">Name of parameter to suppress</param> public void SuppressConfigurationParameter(string name) { if (State == Metadata.State.NotDefined) { configurationParameter.RemoveAll(cp => cp.Name == name); } else { throw new Exception((State == Metadata.State.AllDefiniton) ? "The type has been partialy compile" : "The type has been compile"); } } /// <summary> /// Add CustomAttribute /// </summary> /// <param name="customAttributeBuilder"></param> /// <exception cref="System.Exception">Throw when type has been already compile</exception> public void SetCustomAttribute(CustomAttributeBuilder customAttributeBuilder) { if (State == Metadata.State.NotDefined) { customAttributes.Add(customAttributeBuilder); } else { throw new Exception((State == Metadata.State.AllDefiniton) ? "The type has been partialy compile" : "The type has been compile"); } } /// <summary> /// Remove all CustomAttribute /// </summary> /// <exception cref="System.Exception">Throw when type has been already compile</exception> public void RemoveAllCustomAttribute() { if (State == Metadata.State.NotDefined) { customAttributes.Clear(); } else { throw new Exception((State == Metadata.State.AllDefiniton) ? "The type has been partialy compile" : "The type has been compile"); } } #endregion #region Compilation public bool VerificationBaseDefinition(bool throwException) { if (parameters != null) { if (parameters.Any(p => p == null || p.State == Metadata.State.NotDefined)) { if (throwException) { throw new Exception(string.Format("The type {0} is null or not defined", parameters.First(p => p == null || p.State == Metadata.State.NotDefined).Name)); } else { return false; } } foreach(ParameterCreator parameter in configurationParameter) { parameter.Verification(throwException); } } return true; } internal void CompileBaseDefinition(TypeBuilder typeBuilder) { VerificationBaseDefinition(true); Type[] parameters = (this.parameters == null) ? Type.EmptyTypes : this.parameters.Select(m => (Type)m).ToArray(); constructorBuilder = typeBuilder.DefineConstructor(methodAttributes, CallingConventions.Standard, parameters); foreach(ParameterCreator parameter in configurationParameter) { parameter.Compile(constructorBuilder); } foreach(CustomAttributeBuilder customAttribute in customAttributes) { constructorBuilder.SetCustomAttribute(customAttribute); } constructorInfo = constructorBuilder; State = Metadata.State.BaseDefinition; } internal void Compile(TypeBuilder typeBuilder) { if(State == Metadata.State.NotDefined) { CompileBaseDefinition(typeBuilder); } constructorBuilder.GetILGenerator().Emit(OpCodes.Ret); constructorInfo = constructorBuilder; State = Metadata.State.Defined; } #endregion public static implicit operator ConstructorCreator(ConstructorInfo constructorInfo) { return new ConstructorCreator(constructorInfo); } } }
@font-face { font-family: "flaticon51"; src: url("flaticon.eot"); src: url("flaticon.eot#iefix") format("embedded-opentype"), url("flaticon.woff") format("woff"), url("flaticon.ttf") format("truetype"), url("flaticon.svg") format("svg"); font-weight: normal; font-style: normal; } [class^="flaticon51-"]:before, [class*=" flaticon51-"]:before, [class^="flaticon51-"]:after, [class*=" flaticon51-"]:after { font-family: flaticon51; font-size: 20px; font-style: normal; margin-left: 20px; }.flaticon51-arrow247:before { content: "\e000"; } .flaticon51-arrows31:before { content: "\e001"; } .flaticon51-box151:before { content: "\e002"; } .flaticon51-box152:before { content: "\e003"; } .flaticon51-box153:before { content: "\e004"; } .flaticon51-box154:before { content: "\e005"; } .flaticon51-box155:before { content: "\e006"; } .flaticon51-box156:before { content: "\e007"; } .flaticon51-box157:before { content: "\e008"; } .flaticon51-check-mark23:before { content: "\e009"; } .flaticon51-check-mark24:before { content: "\e00a"; } .flaticon51-cup88:before { content: "\e00b"; } .flaticon51-cup89:before { content: "\e00c"; } .flaticon51-curve-arrow52:before { content: "\e00d"; } .flaticon51-cutting23:before { content: "\e00e"; } .flaticon51-direction418:before { content: "\e00f"; } .flaticon51-ecological34:before { content: "\e010"; } .flaticon51-envelope157:before { content: "\e011"; } .flaticon51-feather37:before { content: "\e012"; } .flaticon51-glass82:before { content: "\e013"; } .flaticon51-glass83:before { content: "\e014"; } .flaticon51-hand446:before { content: "\e015"; } .flaticon51-left-arrow79:before { content: "\e016"; } .flaticon51-loupe21:before { content: "\e017"; } .flaticon51-mailing11:before { content: "\e018"; } .flaticon51-map-location66:before { content: "\e019"; } .flaticon51-mark29:before { content: "\e01a"; } .flaticon51-package87:before { content: "\e01b"; } .flaticon51-phone-call57:before { content: "\e01c"; } .flaticon51-rain121:before { content: "\e01d"; } .flaticon51-shipping10:before { content: "\e01e"; } .flaticon51-shipping11:before { content: "\e01f"; } .flaticon51-shipping13:before { content: "\e020"; } .flaticon51-shipping14:before { content: "\e021"; } .flaticon51-shipping8:before { content: "\e022"; } .flaticon51-shipping9:before { content: "\e023"; } .flaticon51-shoe-prints5:before { content: "\e024"; } .flaticon51-sun163:before { content: "\e025"; } .flaticon51-target88:before { content: "\e026"; } .flaticon51-thermometer78:before { content: "\e027"; } .flaticon51-tool1522:before { content: "\e028"; } .flaticon51-transport1182:before { content: "\e029"; } .flaticon51-transport1183:before { content: "\e02a"; } .flaticon51-transport1186:before { content: "\e02b"; } .flaticon51-transport1187:before { content: "\e02c"; } .flaticon51-transport1188:before { content: "\e02d"; } .flaticon51-up-arrows18:before { content: "\e02e"; } .flaticon51-warehouse3:before { content: "\e02f"; } .flaticon51-warning67:before { content: "\e030"; } .flaticon51-weightlifting10:before { content: "\e031"; }
<?php namespace App\Models; use App\Models\BaseModel; class MessageModel extends BaseModel { public function __construct(\Silex\Application $app) { parent::__construct($app, 'message'); } protected function getAllowedParams() { return array( 'author' => true, 'title' => true, 'content' => true ); } }
const createImmutableEqualsSelector = require('./customSelectorCreator'); const compare = require('../util/compare'); const exampleReducers = require('../reducers/exampleReducers'); /** * Get state function */ const getSortingState = exampleReducers.getSortingState; const getPaginationState = exampleReducers.getPaginationState; const getDataState = exampleReducers.getDataState; /** * Sorting immutable data source * @param {Map} source immutable data source * @param {string} sortingKey property of data * @param {string} orderByCondition 'asc' or 'desc' * @return {List} immutable testing data source with sorting */ const sortingData = (source, sortingKey, orderByCondition) => { let orderBy = orderByCondition === 'asc' ? 1 : -1; return source.sortBy(data => data.get(sortingKey), (v, k) => orderBy * compare(v, k)); } /** * Paginating data from sortingSelector * @param {List} sortedData immutable data source with sorting * @param {number} start * @param {number} end * @return {array} sorting data with pagination and converting Immutable.List to array */ const pagination = (sortedData, start, end) => sortedData.slice(start, end).toList().toJS() /** * Partial selector only to do sorting */ const sortingSelector = createImmutableEqualsSelector( [ getDataState, // get data source getSortingState ], (dataState, sortingCondition) => sortingData(dataState, sortingCondition.get('sortingKey'), sortingCondition.get('orderBy')) ) /** * Root selector to paginate data from sortingSelector */ const paginationSelector = createImmutableEqualsSelector( [ sortingSelector, // bind selector to be new data source getPaginationState ], (sortedData, paginationCondition) => pagination(sortedData, paginationCondition.get('start'), paginationCondition.get('end')) ) module.exports = paginationSelector;
/** * Filesystem based directory storage. */ package com.github.basking2.sdsai.dsds.fs;
Bitcoin version 0.6.0 is now available for download at: http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.6.0/test/ This release includes more than 20 language localizations. More translations are welcome; join the project at Transifex to help: https://www.transifex.net/projects/p/bitcoin/ Please report bugs using the issue tracker at github: https://github.com/bitcoin/bitcoin/issues Project source code is hosted at github; we are no longer distributing .tar.gz files here, you can get them directly from github: https://github.com/bitcoin/bitcoin/tarball/v0.6.0 # .tar.gz https://github.com/bitcoin/bitcoin/zipball/v0.6.0 # .zip For Ubuntu users, there is a ppa maintained by Matt Corallo which you can add to your system so that it will automatically keep bitcoin up-to-date. Just type sudo apt-add-repository ppa:bitcoin/bitcoin in your terminal, then install the bitcoin-qt package. KNOWN ISSUES Shutting down while synchronizing with the network (downloading the blockchain) can take more than a minute, because database writes are queued to speed up download time. NEW FEATURES SINCE BITCOIN VERSION 0.5 Initial network synchronization should be much faster (one or two hours on a typical machine instead of ten or more hours). Backup Wallet menu option. Bitcoin-Qt can display and save QR codes for sending and receiving addresses. New context menu on addresses to copy/edit/delete them. New Sign Message dialog that allows you to prove that you own a bitcoin address by creating a digital signature. New wallets created with this version will use 33-byte 'compressed' public keys instead of 65-byte public keys, resulting in smaller transactions and less traffic on the bitcoin network. The shorter keys are already supported by the network but wallet.dat files containing short keys are not compatible with earlier versions of Bitcoin-Qt/krugercoind. New command-line argument -blocknotify=<command> that will spawn a shell process to run <command> when a new block is accepted. New command-line argument -splash=0 to disable Bitcoin-Qt's initial splash screen validateaddress JSON-RPC api command output includes two new fields for addresses in the wallet: pubkey : hexadecimal public key iscompressed : true if pubkey is a short 33-byte key New JSON-RPC api commands for dumping/importing private keys from the wallet (dumprivkey, importprivkey). New JSON-RPC api command for getting information about blocks (getblock, getblockhash). New JSON-RPC api command (getmininginfo) for getting extra information related to mining. The getinfo JSON-RPC command no longer includes mining-related information (generate/genproclimit/hashespersec). NOTABLE CHANGES BIP30 implemented (security fix for an attack involving duplicate "coinbase transactions"). The -nolisten, -noupnp and -nodnsseed command-line options were renamed to -listen, -upnp and -dnsseed, with a default value of 1. The old names are still supported for compatibility (so specifying -nolisten is automatically interpreted as -listen=0; every boolean argument can now be specified as either -foo or -nofoo). The -noirc command-line options was renamed to -irc, with a default value of 0. Run -irc=1 to get the old behavior. Three fill-up-available-memory denial-of-service attacks were fixed. NOT YET IMPLEMENTED FEATURES Support for clicking on bitcoin: URIs and opening/launching Bitcoin-Qt is available only on Linux, and only if you configure your desktop to launch Bitcoin-Qt. All platforms support dragging and dropping bitcoin: URIs onto the Bitcoin-Qt window to start payment. PRELIMINARY SUPPORT FOR MULTISIGNATURE TRANSACTIONS This release has preliminary support for multisignature transactions-- transactions that require authorization from more than one person or device before they will be accepted by the bitcoin network. Prior to this release, multisignature transactions were considered 'non-standard' and were ignored; with this release multisignature transactions are considered standard and will start to be relayed and accepted into blocks. It is expected that future releases of Bitcoin-Qt will support the creation of multisignature transactions, once enough of the network has upgraded so relaying and validating them is robust. For this release, creation and testing of multisignature transactions is limited to the bitcoin test network using the "addmultisigaddress" JSON-RPC api call. Short multisignature address support is included in this release, as specified in BIP 13 and BIP 16.
import argparse from PGEnv import PGEnvironment from PGAgent import PGAgent if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--gym_environment', type=str, default='Pong-v0', help='OpenAI Gym Environment to be used (default to Pong-v0)') parser.add_argument('--mode', type=str, default='train', choices=['train', 'test'], help='running mode (default to train)') parser.add_argument('--use_gpu', type=bool, default=False, help='whether to use GPU (default to True)') parser.add_argument('--gpu_id', type=int, default=0, help='the id of the GPU to be used (default to 0)') parser.add_argument('--model_save_path', type=str, default='./model/PG_model.ckpt', help='path to save/load the model for training/testing (default to model/PG_model.ckpt)') parser.add_argument('--check_point', type=int, default=None, help='index of the ckeck point (default to None)') parser.add_argument('--model_save_freq', type=int, default=100, help='dump model at every k-th iteration (default to 100)') parser.add_argument('--display', type=bool, default=False, help='whether to render to result. (default to False)') args = parser.parse_args() if args.mode == 'train': env = PGEnvironment(environment_name=args.gym_environment, display=args.display) agent = PGAgent(env) assert(args.model_save_path is not None) agent.learn(model_save_frequency=args.model_save_freq, model_save_path=args.model_save_path, check_point = args.check_point, use_gpu=args.use_gpu, gpu_id=args.gpu_id) else: # disable frame skipping during testing result in better performance (because the agent can take more actions) env = PGEnvironment(environment_name=args.gym_environment, display=args.display, frame_skipping=False) agent = PGAgent(env) assert(args.check_point is not None) agent.test(model_save_path = args.model_save_path, check_point=args.check_point, use_gpu=args.use_gpu, gpu_id=args.gpu_id) print('finished.')
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.peering.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; /** Resource collection API of ReceivedRoutes. */ public interface ReceivedRoutes { /** * Lists the prefixes received over the specified peering under the given subscription and resource group. * * @param resourceGroupName The name of the resource group. * @param peeringName The name of the peering. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of received routes for the peering. */ PagedIterable<PeeringReceivedRoute> listByPeering(String resourceGroupName, String peeringName); /** * Lists the prefixes received over the specified peering under the given subscription and resource group. * * @param resourceGroupName The name of the resource group. * @param peeringName The name of the peering. * @param prefix The optional prefix that can be used to filter the routes. * @param asPath The optional AS path that can be used to filter the routes. * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. * @param skipToken The optional page continuation token that is used in the event of paginated result. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of received routes for the peering. */ PagedIterable<PeeringReceivedRoute> listByPeering( String resourceGroupName, String peeringName, String prefix, String asPath, String originAsValidationState, String rpkiValidationState, String skipToken, Context context); }
/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2014 TIBCO Software Inc. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.jasperreports.engine.component; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: ContextAwareComponent.java 7199 2014-08-27 13:58:10Z teodord $ */ public interface ContextAwareComponent extends Component { /** * */ void setContext(ComponentContext context); /** * */ ComponentContext getContext(); }
package example.naoki.ble_myo; import java.util.ArrayList; import java.util.StringTokenizer; /** * Created by naoki on 15/04/09. * */ public class EmgData { private ArrayList<Double> emgData = new ArrayList<>(); public EmgData() { } public EmgData(EmgCharacteristicData characteristicData) { this.emgData = new ArrayList<>( characteristicData.getEmg8Data_abs().getEmgArray() ); } public EmgData(ArrayList<Double> emgData) { this.emgData = emgData; } public String getLine() { StringBuilder return_SB = new StringBuilder(); for (int i_emg_num = 0; i_emg_num < 8; i_emg_num++) { return_SB.append(String.format("%f,", emgData.get(i_emg_num))); } return return_SB.toString(); } public void setLine(String line) { ArrayList<Double> data = new ArrayList<>(); StringTokenizer st = new StringTokenizer(line , ","); for (int i_emg_num = 0; i_emg_num < 8; i_emg_num++) { data.add(Double.parseDouble(st.nextToken())); } emgData = data; } public void addElement(double element) { emgData.add(element); } public void setElement(int index ,double element) { emgData.set(index,element); } public Double getElement(int index) { if (index < 0 || index > emgData.size() - 1) { return null; } else { return emgData.get(index); } } public ArrayList<Double> getEmgArray() { return this.emgData; } public Double getDistanceFrom(EmgData baseData) { Double distance = 0.00; for (int i_element = 0; i_element < 8; i_element++) { distance += Math.pow((emgData.get(i_element) - baseData.getElement(i_element)),2.0); } return Math.sqrt(distance); } public Double getInnerProductionTo(EmgData baseData) { Double val = 0.00; for (int i_element = 0; i_element < 8; i_element++) { val += emgData.get(i_element) * baseData.getElement(i_element); } return val; } public Double getNorm(){ Double norm = 0.00; for (int i_element = 0; i_element < 8; i_element++) { norm += Math.pow( emgData.get(i_element) ,2.0); } return Math.sqrt(norm); } }
\begin{homeworkProblem}[-1][Problema de la Ruta más corta como problema PL] Objetivo: minimizar la distancia recorrida. Variables de decisión: \begin{itemize} \item $ X_{ij} = \begin{cases} 1 &\mbox{\text{si se viaja de $i$ a $j$}} \\ 0 &\mbox{\text{si no}} \end{cases} $ \end{itemize} Función Objetivo: \begin{align*} Min\ Z = \sum_{i=1}^{n}{\sum_{j=1}^{m}{d_{ij}X_{ij}}} \end{align*} Sujeta a las siguientes restricciones: \begin{align*} &\corche{\text{Único Comienzo}}& &\sum_{j=1}^{m}{X_{0j}}=1& \\ &\corche{\text{Único Fin}}& &\sum_{i=1}^{n}{X_{iF}}=1& \\ && &\sum_{i=1}^{n}{X_{ik}}-\sum_{j=1}^{m}{X_{kj}}=0 \quad \forall k \neq 0 \wedge k \neq F &\\ && &\forall i=1..n \quad \forall j=1..m \quad\quad X_{ij}\in \left\{0,1\right\}& \end{align*} \end{homeworkProblem}
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0 * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ package fixtures.bodyfile; /** * The interface for AutoRestSwaggerBATFileService class. */ public interface AutoRestSwaggerBATFileService { /** * Gets the URI used as the base for all cloud service requests. * @return The BaseUri value. */ String getBaseUri(); /** * Gets the Files object to access its operations. * @return the files value. */ Files getFiles(); }
package com.xinyiglass.springSample.entity; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.beans.factory.FactoryBean; import org.springframework.jdbc.core.RowMapper; @SuppressWarnings("rawtypes") public class FuncVO implements FactoryBean,RowMapper<FuncVO>, Cloneable{ private Long functionId; private String functionCode; private String functionName; private String functionHref; private String description; private Long iconId; private String iconCode; private Long createdBy; private java.util.Date creationDate; private Long lastUpdatedBy; private java.util.Date lastUpdateDate; private Long lastUpdateLogin; //GET&SET Method public Long getFunctionId() { return functionId; } public void setFunctionId(Long functionId) { this.functionId = functionId; } public String getFunctionCode() { return functionCode; } public void setFunctionCode(String functionCode) { this.functionCode = functionCode; } public String getFunctionName() { return functionName; } public void setFunctionName(String functionName) { this.functionName = functionName; } public String getFunctionHref() { return functionHref; } public void setFunctionHref(String functionHref) { this.functionHref = functionHref; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Long getIconId() { return iconId; } public void setIconId(Long iconId) { this.iconId = iconId; } public String getIconCode() { return iconCode; } public void setIconCode(String iconCode) { this.iconCode = iconCode; } public Long getCreatedBy() { return createdBy; } public void setCreatedBy(Long createdBy) { this.createdBy = createdBy; } public java.util.Date getCreationDate() { return creationDate; } public void setCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; } public Long getLastUpdatedBy() { return lastUpdatedBy; } public void setLastUpdatedBy(Long lastUpdatedBy) { this.lastUpdatedBy = lastUpdatedBy; } public java.util.Date getLastUpdateDate() { return lastUpdateDate; } public void setLastUpdateDate(java.util.Date lastUpdateDate) { this.lastUpdateDate = lastUpdateDate; } public Long getLastUpdateLogin() { return lastUpdateLogin; } public void setLastUpdateLogin(Long lastUpdateLogin) { this.lastUpdateLogin = lastUpdateLogin; } @Override public Object clone() { FuncVO funcVO = null; try{ funcVO = (FuncVO)super.clone(); }catch(CloneNotSupportedException e) { e.printStackTrace(); } return funcVO; } @Override public FuncVO mapRow(ResultSet rs, int rowNum) throws SQLException { FuncVO func = new FuncVO(); func.setFunctionId(rs.getLong("function_id")); func.setFunctionCode(rs.getString("function_code")); func.setFunctionName(rs.getString("function_name")); func.setFunctionHref(rs.getString("function_href")); func.setDescription(rs.getObject("description")==null?null:rs.getString("description")); func.setIconId(rs.getLong("icon_id")); func.setIconCode(rs.getString("icon_code")); func.setCreatedBy(rs.getLong("created_by")); func.setCreationDate(rs.getDate("creation_date")); func.setLastUpdatedBy(rs.getLong("last_updated_by")); func.setLastUpdateDate(rs.getDate("last_update_date")); func.setLastUpdateLogin(rs.getLong("last_update_login")); return func; } @Override public Object getObject() throws Exception { // TODO Auto-generated method stub return null; } @Override public Class getObjectType() { // TODO Auto-generated method stub return null; } @Override public boolean isSingleton() { // TODO Auto-generated method stub return false; } }
var stream = require('readable-stream') var util = require('util') var fifo = require('fifo') var toStreams2 = function(s) { if (s._readableState) return s var wrap = new stream.Readable().wrap(s) if (s.destroy) wrap.destroy = s.destroy.bind(s) return wrap } var Parallel = function(streams, opts) { if (!(this instanceof Parallel)) return new Parallel(streams, opts) stream.Readable.call(this, opts) this.destroyed = false this._forwarding = false this._drained = false this._queue = fifo() for (var i = 0; i < streams.length; i++) this.add(streams[i]) this._current = this._queue.node } util.inherits(Parallel, stream.Readable) Parallel.obj = function(streams) { return new Parallel(streams, {objectMode: true, highWaterMark: 16}) } Parallel.prototype.add = function(s) { s = toStreams2(s) var self = this var node = this._queue.push(s) var onend = function() { if (node === self._current) self._current = node.next self._queue.remove(node) s.removeListener('readable', onreadable) s.removeListener('end', onend) s.removeListener('error', onerror) s.removeListener('close', onclose) self._forward() } var onreadable = function() { self._forward() } var onclose = function() { if (!s._readableState.ended) self.destroy() } var onerror = function(err) { self.destroy(err) } s.on('end', onend) s.on('readable', onreadable) s.on('close', onclose) s.on('error', onerror) } Parallel.prototype._read = function () { this._drained = true this._forward() } Parallel.prototype._forward = function () { if (this._forwarding || !this._drained) return this._forwarding = true var stream = this._get() if (!stream) return var chunk while ((chunk = stream.read()) !== null) { this._current = this._current.next this._drained = this.push(chunk) stream = this._get() if (!stream) return } this._forwarding = false } Parallel.prototype._get = function() { var stream = this._current && this._queue.get(this._current) if (!stream) this.push(null) else return stream } Parallel.prototype.destroy = function (err) { if (this.destroyed) return this.destroyed = true var next while ((next = this._queue.shift())) { if (next.destroy) next.destroy() } if (err) this.emit('error', err) this.emit('close') } module.exports = Parallel
// Copyright (c) 2012 Pieter Wuille // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _ELECTRA_ADDRMAN #define _ELECTRA_ADDRMAN 1 #include "netbase.h" #include "protocol.h" #include "util.h" #include "sync.h" #include <map> #include <vector> #include <openssl/rand.h> /** Extended statistics about a CAddress */ class CAddrInfo : public CAddress { private: // where knowledge about this address first came from CNetAddr source; // last successful connection by us int64_t nLastSuccess; // last try whatsoever by us: // int64_t CAddress::nLastTry // connection attempts since last successful attempt int nAttempts; // reference count in new sets (memory only) int nRefCount; // in tried set? (memory only) bool fInTried; // position in vRandom int nRandomPos; friend class CAddrMan; public: IMPLEMENT_SERIALIZE( CAddress* pthis = (CAddress*)(this); READWRITE(*pthis); READWRITE(source); READWRITE(nLastSuccess); READWRITE(nAttempts); ) void Init() { nLastSuccess = 0; nLastTry = 0; nAttempts = 0; nRefCount = 0; fInTried = false; nRandomPos = -1; } CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource) { Init(); } CAddrInfo() : CAddress(), source() { Init(); } // Calculate in which "tried" bucket this entry belongs int GetTriedBucket(const std::vector<unsigned char> &nKey) const; // Calculate in which "new" bucket this entry belongs, given a certain source int GetNewBucket(const std::vector<unsigned char> &nKey, const CNetAddr& src) const; // Calculate in which "new" bucket this entry belongs, using its default source int GetNewBucket(const std::vector<unsigned char> &nKey) const { return GetNewBucket(nKey, source); } // Determine whether the statistics about this entry are bad enough so that it can just be deleted bool IsTerrible(int64_t nNow = GetAdjustedTime()) const; // Calculate the relative chance this entry should be given when selecting nodes to connect to double GetChance(int64_t nNow = GetAdjustedTime()) const; }; // Stochastic address manager // // Design goals: // * Only keep a limited number of addresses around, so that addr.dat and memory requirements do not grow without bound. // * Keep the address tables in-memory, and asynchronously dump the entire to able in addr.dat. // * Make sure no (localized) attacker can fill the entire table with his nodes/addresses. // // To that end: // * Addresses are organized into buckets. // * Address that have not yet been tried go into 256 "new" buckets. // * Based on the address range (/16 for IPv4) of source of the information, 32 buckets are selected at random // * The actual bucket is chosen from one of these, based on the range the address itself is located. // * One single address can occur in up to 4 different buckets, to increase selection chances for addresses that // are seen frequently. The chance for increasing this multiplicity decreases exponentially. // * When adding a new address to a full bucket, a randomly chosen entry (with a bias favoring less recently seen // ones) is removed from it first. // * Addresses of nodes that are known to be accessible go into 64 "tried" buckets. // * Each address range selects at random 4 of these buckets. // * The actual bucket is chosen from one of these, based on the full address. // * When adding a new good address to a full bucket, a randomly chosen entry (with a bias favoring less recently // tried ones) is evicted from it, back to the "new" buckets. // * Bucket selection is based on cryptographic hashing, using a randomly-generated 256-bit key, which should not // be observable by adversaries. // * Several indexes are kept for high performance. Defining DEBUG_ADDRMAN will introduce frequent (and expensive) // consistency checks for the entire data structure. // total number of buckets for tried addresses #define ADDRMAN_TRIED_BUCKET_COUNT 64 // maximum allowed number of entries in buckets for tried addresses #define ADDRMAN_TRIED_BUCKET_SIZE 64 // total number of buckets for new addresses #define ADDRMAN_NEW_BUCKET_COUNT 256 // maximum allowed number of entries in buckets for new addresses #define ADDRMAN_NEW_BUCKET_SIZE 64 // over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread #define ADDRMAN_TRIED_BUCKETS_PER_GROUP 4 // over how many buckets entries with new addresses originating from a single group are spread #define ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP 32 // in how many buckets for entries with new addresses a single address may occur #define ADDRMAN_NEW_BUCKETS_PER_ADDRESS 4 // how many entries in a bucket with tried addresses are inspected, when selecting one to replace #define ADDRMAN_TRIED_ENTRIES_INSPECT_ON_EVICT 4 // how old addresses can maximally be #define ADDRMAN_HORIZON_DAYS 30 // after how many failed attempts we give up on a new node #define ADDRMAN_RETRIES 3 // how many successive failures are allowed ... #define ADDRMAN_MAX_FAILURES 10 // ... in at least this many days #define ADDRMAN_MIN_FAIL_DAYS 7 // the maximum percentage of nodes to return in a getaddr call #define ADDRMAN_GETADDR_MAX_PCT 23 // the maximum number of nodes to return in a getaddr call #define ADDRMAN_GETADDR_MAX 2500 /** Stochastical (IP) address manager */ class CAddrMan { private: // critical section to protect the inner data structures mutable CCriticalSection cs; // secret key to randomize bucket select with std::vector<unsigned char> nKey; // last used nId int nIdCount; // table with information about all nIds std::map<int, CAddrInfo> mapInfo; // find an nId based on its network address std::map<CNetAddr, int> mapAddr; // randomly-ordered vector of all nIds std::vector<int> vRandom; // number of "tried" entries int nTried; // list of "tried" buckets std::vector<std::vector<int> > vvTried; // number of (unique) "new" entries int nNew; // list of "new" buckets std::vector<std::set<int> > vvNew; protected: // Find an entry. CAddrInfo* Find(const CNetAddr& addr, int *pnId = NULL); // find an entry, creating it if necessary. // nTime and nServices of found node is updated, if necessary. CAddrInfo* Create(const CAddress &addr, const CNetAddr &addrSource, int *pnId = NULL); // Swap two elements in vRandom. void SwapRandom(unsigned int nRandomPos1, unsigned int nRandomPos2); // Return position in given bucket to replace. int SelectTried(int nKBucket); // Remove an element from a "new" bucket. // This is the only place where actual deletes occur. // They are never deleted while in the "tried" table, only possibly evicted back to the "new" table. int ShrinkNew(int nUBucket); // Move an entry from the "new" table(s) to the "tried" table // @pre vvUnkown[nOrigin].count(nId) != 0 void MakeTried(CAddrInfo& info, int nId, int nOrigin); // Mark an entry "good", possibly moving it from "new" to "tried". void Good_(const CService &addr, int64_t nTime); // Add an entry to the "new" table. bool Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty); // Mark an entry as attempted to connect. void Attempt_(const CService &addr, int64_t nTime); // Select an address to connect to. // nUnkBias determines how much to favor new addresses over tried ones (min=0, max=100) CAddress Select_(int nUnkBias); #ifdef DEBUG_ADDRMAN // Perform consistency check. Returns an error code or zero. int Check_(); #endif // Select several addresses at once. void GetAddr_(std::vector<CAddress> &vAddr); // Mark an entry as currently-connected-to. void Connected_(const CService &addr, int64_t nTime); public: IMPLEMENT_SERIALIZE (({ // serialized format: // * version byte (currently 0) // * nKey // * nNew // * nTried // * number of "new" buckets // * all nNew addrinfos in vvNew // * all nTried addrinfos in vvTried // * for each bucket: // * number of elements // * for each element: index // // Notice that vvTried, mapAddr and vVector are never encoded explicitly; // they are instead reconstructed from the other information. // // vvNew is serialized, but only used if ADDRMAN_UNKOWN_BUCKET_COUNT didn't change, // otherwise it is reconstructed as well. // // This format is more complex, but significantly smaller (at most 1.5 MiB), and supports // changes to the ADDRMAN_ parameters without breaking the on-disk structure. { LOCK(cs); unsigned char nVersion = 0; READWRITE(nVersion); READWRITE(nKey); READWRITE(nNew); READWRITE(nTried); CAddrMan *am = const_cast<CAddrMan*>(this); if (fWrite) { int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT; READWRITE(nUBuckets); std::map<int, int> mapUnkIds; int nIds = 0; for (std::map<int, CAddrInfo>::iterator it = am->mapInfo.begin(); it != am->mapInfo.end(); it++) { if (nIds == nNew) break; // this means nNew was wrong, oh ow mapUnkIds[(*it).first] = nIds; CAddrInfo &info = (*it).second; if (info.nRefCount) { READWRITE(info); nIds++; } } nIds = 0; for (std::map<int, CAddrInfo>::iterator it = am->mapInfo.begin(); it != am->mapInfo.end(); it++) { if (nIds == nTried) break; // this means nTried was wrong, oh ow CAddrInfo &info = (*it).second; if (info.fInTried) { READWRITE(info); nIds++; } } for (std::vector<std::set<int> >::iterator it = am->vvNew.begin(); it != am->vvNew.end(); it++) { const std::set<int> &vNew = (*it); int nSize = vNew.size(); READWRITE(nSize); for (std::set<int>::iterator it2 = vNew.begin(); it2 != vNew.end(); it2++) { int nIndex = mapUnkIds[*it2]; READWRITE(nIndex); } } } else { int nUBuckets = 0; READWRITE(nUBuckets); am->nIdCount = 0; am->mapInfo.clear(); am->mapAddr.clear(); am->vRandom.clear(); am->vvTried = std::vector<std::vector<int> >(ADDRMAN_TRIED_BUCKET_COUNT, std::vector<int>(0)); am->vvNew = std::vector<std::set<int> >(ADDRMAN_NEW_BUCKET_COUNT, std::set<int>()); for (int n = 0; n < am->nNew; n++) { CAddrInfo &info = am->mapInfo[n]; READWRITE(info); am->mapAddr[info] = n; info.nRandomPos = vRandom.size(); am->vRandom.push_back(n); if (nUBuckets != ADDRMAN_NEW_BUCKET_COUNT) { am->vvNew[info.GetNewBucket(am->nKey)].insert(n); info.nRefCount++; } } am->nIdCount = am->nNew; int nLost = 0; for (int n = 0; n < am->nTried; n++) { CAddrInfo info; READWRITE(info); std::vector<int> &vTried = am->vvTried[info.GetTriedBucket(am->nKey)]; if (vTried.size() < ADDRMAN_TRIED_BUCKET_SIZE) { info.nRandomPos = vRandom.size(); info.fInTried = true; am->vRandom.push_back(am->nIdCount); am->mapInfo[am->nIdCount] = info; am->mapAddr[info] = am->nIdCount; vTried.push_back(am->nIdCount); am->nIdCount++; } else { nLost++; } } am->nTried -= nLost; for (int b = 0; b < nUBuckets; b++) { std::set<int> &vNew = am->vvNew[b]; int nSize = 0; READWRITE(nSize); for (int n = 0; n < nSize; n++) { int nIndex = 0; READWRITE(nIndex); CAddrInfo &info = am->mapInfo[nIndex]; if (nUBuckets == ADDRMAN_NEW_BUCKET_COUNT && info.nRefCount < ADDRMAN_NEW_BUCKETS_PER_ADDRESS) { info.nRefCount++; vNew.insert(nIndex); } } } } } });) CAddrMan() : vRandom(0), vvTried(ADDRMAN_TRIED_BUCKET_COUNT, std::vector<int>(0)), vvNew(ADDRMAN_NEW_BUCKET_COUNT, std::set<int>()) { nKey.resize(32); RAND_bytes(&nKey[0], 32); nIdCount = 0; nTried = 0; nNew = 0; } // Return the number of (unique) addresses in all tables. int size() { return vRandom.size(); } // Consistency check void Check() { #ifdef DEBUG_ADDRMAN { LOCK(cs); int err; if ((err=Check_())) printf("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\n", err); } #endif } // Add a single address. bool Add(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty = 0) { bool fRet = false; { LOCK(cs); Check(); fRet |= Add_(addr, source, nTimePenalty); Check(); } if (fRet) printf("Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString().c_str(), nTried, nNew); return fRet; } // Add multiple addresses. bool Add(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64_t nTimePenalty = 0) { int nAdd = 0; { LOCK(cs); Check(); for (std::vector<CAddress>::const_iterator it = vAddr.begin(); it != vAddr.end(); it++) nAdd += Add_(*it, source, nTimePenalty) ? 1 : 0; Check(); } if (nAdd) printf("Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString().c_str(), nTried, nNew); return nAdd > 0; } // Mark an entry as accessible. void Good(const CService &addr, int64_t nTime = GetAdjustedTime()) { { LOCK(cs); Check(); Good_(addr, nTime); Check(); } } // Mark an entry as connection attempted to. void Attempt(const CService &addr, int64_t nTime = GetAdjustedTime()) { { LOCK(cs); Check(); Attempt_(addr, nTime); Check(); } } // Choose an address to connect to. // nUnkBias determines how much "new" entries are favored over "tried" ones (0-100). CAddress Select(int nUnkBias = 50) { CAddress addrRet; { LOCK(cs); Check(); addrRet = Select_(nUnkBias); Check(); } return addrRet; } // Return a bunch of addresses, selected at random. std::vector<CAddress> GetAddr() { Check(); std::vector<CAddress> vAddr; { LOCK(cs); GetAddr_(vAddr); } Check(); return vAddr; } // Mark an entry as currently-connected-to. void Connected(const CService &addr, int64_t nTime = GetAdjustedTime()) { { LOCK(cs); Check(); Connected_(addr, nTime); Check(); } } }; #endif
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::Network module Models # # Properties of Backend address pool settings of application gateway # class ApplicationGatewayBackendHttpSettingsPropertiesFormat include MsRestAzure # @return [Integer] Gets or sets the port attr_accessor :port # @return [ApplicationGatewayProtocol] Gets or sets the protocol. # Possible values for this property include: 'Http', 'Https'. attr_accessor :protocol # @return [ApplicationGatewayCookieBasedAffinity] Gets or sets the # cookie affinity. Possible values for this property include: # 'Enabled', 'Disabled'. attr_accessor :cookie_based_affinity # @return [String] Gets or sets Provisioning state of the backend http # settings resource Updating/Deleting/Failed attr_accessor :provisioning_state # # Validate the object. Throws ValidationError if validation fails. # def validate end # # Serializes given Model object into Ruby Hash. # @param object Model object to serialize. # @return [Hash] Serialized object in form of Ruby Hash. # def self.serialize_object(object) object.validate output_object = {} serialized_property = object.port output_object['port'] = serialized_property unless serialized_property.nil? serialized_property = object.protocol output_object['protocol'] = serialized_property unless serialized_property.nil? serialized_property = object.cookie_based_affinity output_object['cookieBasedAffinity'] = serialized_property unless serialized_property.nil? serialized_property = object.provisioning_state output_object['provisioningState'] = serialized_property unless serialized_property.nil? output_object end # # Deserializes given Ruby Hash into Model object. # @param object [Hash] Ruby Hash object to deserialize. # @return [ApplicationGatewayBackendHttpSettingsPropertiesFormat] # Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = ApplicationGatewayBackendHttpSettingsPropertiesFormat.new deserialized_property = object['port'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.port = deserialized_property deserialized_property = object['protocol'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ApplicationGatewayProtocol.constants.any? { |e| ApplicationGatewayProtocol.const_get(e).to_s.downcase == deserialized_property.downcase } fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid end output_object.protocol = deserialized_property deserialized_property = object['cookieBasedAffinity'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ApplicationGatewayCookieBasedAffinity.constants.any? { |e| ApplicationGatewayCookieBasedAffinity.const_get(e).to_s.downcase == deserialized_property.downcase } fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid end output_object.cookie_based_affinity = deserialized_property deserialized_property = object['provisioningState'] output_object.provisioning_state = deserialized_property output_object.validate output_object end end end end
--- layout: post title: Test post date: '2017-03-30T13:58:00.001+05:30' cover: 'assets/images/cover2.jpg' author: veena tags: netgalley lightread youngadult classic indian lovestories personalexperience subclass: 'post tag-test tag-content' logo: 'assets/images/ghost.png' --- This is a test post to test how PowerShell code works. Minim fugiat anim ex non et cupidatat ex ea ex veniam in exercitation cillum sunt reprehenderit ullamco quis. Adipisicing elit est adipisicing consectetur est ad ad et aute qui. Incididunt ut ipsum exercitation voluptate labore magna ullamco elit esse ex sint amet officia laboris elit cillum officia. Velit consectetur voluptate do proident voluptate voluptate officia dolor elit nulla pariatur consequat irure dolor sit nulla dolor. Laboris labore adipisicing reprehenderit voluptate elit tempor id officia laborum consectetur veniam reprehenderit esse occaecat esse. Laborum laboris veniam adipisicing sint elit mollit quis nostrud fugiat laboris officia commodo eu. Officia fugiat consectetur occaecat eu eu magna ea sint irure magna cillum non sunt laboris culpa irure minim. Nisi aliquip eu ad reprehenderit anim consectetur anim irure eiusmod nulla culpa aliqua voluptate et sunt est in. Et do aliquip aliquip id dolor sint tempor cillum culpa deserunt sunt sint dolor officia. {% highlight powershell %} param( [parameter( Mandatory = $true, HelpMessage = "Enter a year between 1900 and 2100:" )] [ValidateRange(1900,2100)] [int]$myYear ) $names = "Rat","Ox","Tiger","Rabbit","Dragon","Snake","Horse","Goat","Monkey","Rooster","Dog","Pig" Write-Host $myYear -ForegroundColor White -NoNewline if ( $myYear -lt ( Get-Date ).Year ) { Write-Host " was" -NoNewline } elseif ( $myYear -gt ( Get-Date ).Year ) { Write-Host " will be" -NoNewline } else { Write-Host " is" -NoNewline } Write-Host " a Chinese year of the " -NoNewline Write-Host $names[ ( $myYear - 1900 ) % 12 ] -ForegroundColor White {% endhighlight %} Commodo elit eiusmod nostrud eu laboris eiusmod occaecat sint quis non consectetur. Dolore do laboris id enim ut mollit culpa pariatur sunt veniam et enim quis commodo incididunt dolore. Lorem officia est dolor ut velit non occaecat sunt eu. Voluptate ea qui eu duis et sit magna anim in laboris. Aliquip sit labore cupidatat sint esse exercitation anim ut ut tempor. Veniam proident magna Lorem dolor do cillum eiusmod magna minim id minim. Pariatur quis cupidatat est quis aliqua aliqua tempor commodo proident incididunt duis pariatur esse ipsum enim qui. Non officia cupidatat non ad nulla Lorem quis voluptate velit dolore. In elit consequat elit eu culpa sunt aute enim laborum do excepteur duis reprehenderit ullamco. Ex do nostrud adipisicing id elit consectetur enim ad ea labore veniam anim qui qui. Proident dolore proident id reprehenderit cupidatat culpa labore ipsum duis amet sint.
<?php /* AdminBundle::layoutSUP.html.twig */ class __TwigTemplate_66433e67719e263cb349ed4744109ccf2266f78b6012a7d47e226769c3932f4d extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( 'user_content' => array($this, 'block_user_content'), ); } protected function doDisplay(array $context, array $blocks = array()) { // line 1 echo "<!DOCTYPE html> <html> <head> <meta charset=\"UTF-8\"> <title>AfrikIsol | Dashboard</title> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <!-- Bootstrap 3.3.4 --> <link href=\""; // line 8 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bootstrap/css/bootstrap.min.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- FontAwesome 4.3.0 --> <link href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\" rel=\"stylesheet\" type=\"text/css\" /> <!-- Ionicons 2.0.0 --> <link href=\"https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css\" rel=\"stylesheet\" type=\"text/css\" /> <!-- Theme style --> <link href=\""; // line 14 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("dist/css/AdminLTE.min.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- DATA TABLES --> <link href=\""; // line 16 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/datatables/dataTables.bootstrap.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <link href=\""; // line 18 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("dist/css/skins/_all-skins.min.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- iCheck --> <link href=\""; // line 20 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/iCheck/flat/blue.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- Morris chart --> <link href=\""; // line 22 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/morris/morris.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- jvectormap --> <link href=\""; // line 24 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/jvectormap/jquery-jvectormap-1.2.2.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- Date Picker --> <link href=\""; // line 26 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/datepicker/datepicker3.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- Daterange picker --> <link href=\""; // line 28 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/daterangepicker/daterangepicker-bs3.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- bootstrap wysihtml5 - text editor --> <link href=\""; // line 30 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js\" type=\"text/javascript\"></script> <script type=\"text/javascript\"> \$(function () { \$(\"#example1\").dataTable(); \$('#example2').dataTable({ \"bPaginate\": true, \"bLengthChange\": false, \"bFilter\": false, \"bSort\": true, \"bInfo\": true, \"bAutoWidth\": false }); }); </script> </head> <body class=\"skin-blue sidebar-mini\"> <div class=\"wrapper\"> <header class=\"main-header\"> <!-- Logo --> <a href=\"\" class=\"logo\" height=\"40\" width=\"40\"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class=\"logo-mini\"><b>A</b>AI</span> <!-- logo for regular state and mobile devices --> <span class=\"logo-lg\"><b>Admin</b>AfrikIsol<br></span> </a> <!-- Header Navbar: style can be found in header.less --> <nav class=\"navbar navbar-static-top\" role=\"navigation\"> <!-- Sidebar toggle button--> <a href=\"#\" class=\"sidebar-toggle\" data-toggle=\"offcanvas\" role=\"button\"> <span class=\"sr-only\">Toggle navigation</span> </a> <div class=\"navbar-custom-menu\"> <ul class=\"nav navbar-nav\"> <li class=\"dropdown user user-menu\"> "; // line 69 $context["imag"] = $this->env->getExtension('img_extension')->afficheImg($this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "user", array())); // line 70 echo " <a href=\""; echo $this->env->getExtension('routing')->getPath("fos_user_security_logout"); echo "\" class=\"dropdown-toggle\" > <img src=\"data:image/png;base64,"; // line 71 echo twig_escape_filter($this->env, (isset($context["imag"]) ? $context["imag"] : $this->getContext($context, "imag")), "html", null, true); echo "\" class=\"user-image\" alt=\"User Image\" /> <span class=\"hidden-xs\">Déconnexion</span> </a> </li> <!-- Control Sidebar Toggle Button <li> <a href=\"#\" data-toggle=\"control-sidebar\"><i class=\"fa fa-gears\"></i></a> </li> --> </ul> </div> </nav> </header> <!-- Left side column. contains the logo and sidebar --> <aside class=\"main-sidebar\"> <!-- sidebar: style can be found in sidebar.less --> <section class=\"sidebar\"> <!-- Sidebar user panel --> <div class=\"user-panel\"> <div class=\"pull-left image\"> <img src=\"data:image/png;base64,"; // line 93 echo twig_escape_filter($this->env, (isset($context["imag"]) ? $context["imag"] : $this->getContext($context, "imag")), "html", null, true); echo "\" class=\"img-circle\" alt=\"User Image\" /> </div> <div class=\"pull-left info\"> <p>"; // line 97 echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "user", array()), "username", array()), "html", null, true); echo " </p> <a href=\"#\"><i class=\"fa fa-circle text-success\"></i> Online</a> </div> </div> <!-- search form --> <form action=\"#\" method=\"get\" class=\"sidebar-form\"> <div class=\"input-group\"> <input type=\"text\" name=\"q\" class=\"form-control\" placeholder=\"Search...\"/> <span class=\"input-group-btn\"> <button type='submit' name='search' id='search-btn' class=\"btn btn-flat\"><i class=\"fa fa-search\"></i></button> </span> </div> </form> <!-- /.search form --> <!-- sidebar menu: : style can be found in sidebar.less --> <ul class=\"sidebar-menu\"> <li class=\"header\">Menu de navigation</li> <li class=\"active treeview\"> <a href=\"#\"> <i class=\"fa fa-desktop\"></i> <span>Gestion des comptes</span> <i class=\"fa fa-angle-left pull-right\"></i> </a> <ul class=\"treeview-menu\"> <li class=\"active\"> <a href=\""; // line 120 echo $this->env->getExtension('routing')->getPath("fos_user_profile_show"); echo "\"><i class=\"fa fa-user-secret\"></i> Mon compte<i class=\"fa fa-angle-left pull-right\"></i></a> <ul class=\"treeview-menu\"> <li><a href=\""; // line 122 echo $this->env->getExtension('routing')->getPath("admin_updateprofile"); echo "\"><i class=\"fa fa-wrench\"></i> Modifier infos</a></li> <li><a href=\""; // line 123 echo $this->env->getExtension('routing')->getPath("fos_user_change_password"); echo "\"><i class=\"fa fa-lock\"></i> Changer mot de passe</a></li> </ul> </li> <li> <a href=\"index2.html\"><i class=\"fa fa-users\"></i> Tous les utilisateurs<i class=\"fa fa-angle-left pull-right\"></i></a> <ul class=\"treeview-menu\"> <li><a href=\""; // line 129 echo $this->env->getExtension('routing')->getPath("fos_user_registration_register"); echo "\"><i class=\"fa fa-user-plus\"></i> Créer</a></li> <li><a href=\""; // line 130 echo $this->env->getExtension('routing')->getPath("admin_listerUser"); echo "\"><i class=\"fa fa-list-alt\"></i> Lister</a></li> </ul> </li> </ul> </li> <li class=\"active treeview\"> <a href=\"#\"> <i class=\"fa fa-slideshare\"></i> <span>Gestion des Clients</span> <i class=\"fa fa-angle-left pull-right\"></i> </a> <ul class=\"treeview-menu\"> <li class=\"active\"> <a href=\""; // line 141 echo $this->env->getExtension('routing')->getPath("tech_addClient"); echo "\"><i class=\"fa fa-plus\"></i> Ajouter Client</a> </li> <li> <a href=\""; // line 145 echo $this->env->getExtension('routing')->getPath("tech_listClient"); echo "\"><i class=\"fa fa-th-list\"></i> Lister Clients</a> </li> </ul> </li> <li class=\"active treeview\"> <a href=\"#\"> <i class=\"fa fa-clipboard\"></i> <span>Gestion des Projets</span> <i class=\"fa fa-angle-left pull-right\"></i> </a> <ul class=\"treeview-menu\"> <li class=\"active\"> <a href=\""; // line 157 echo $this->env->getExtension('routing')->getPath("tech_addProjet"); echo "\"><i class=\"fa fa-plus-square-o\"></i> Ajouter Projet</a> </li> <li> <a href=\""; // line 161 echo $this->env->getExtension('routing')->getPath("tech_listProjet"); echo "\"><i class=\"fa fa-list-ul\"></i> Lister projets</a> </li> <li> <a href=\""; // line 165 echo $this->env->getExtension('routing')->getPath("tech_listGantt"); echo "\"><i class=\"fa fa-bar-chart\"></i>Planification des travaux</a> </li> <li> <a href=\""; // line 168 echo $this->env->getExtension('routing')->getPath("tech_listTole"); echo "\"><i class=\"fa fa-edit\"></i> Ajouter/Lister tôles</a> </li> <li> <a href=\""; // line 171 echo $this->env->getExtension('routing')->getPath("tech_listPlan"); echo "\"><i class=\"fa fa-area-chart\"></i>Planification </a> </li> <li> <a href=\""; // line 174 echo $this->env->getExtension('routing')->getPath("tech_listAvancement"); echo "\"><i class=\"fa fa-area-chart\"></i>Avancement</a> </li> <li> <a href=\""; // line 177 echo $this->env->getExtension('routing')->getPath("tech_listMAD"); echo "\"><i class=\"fa fa-area-chart\"></i>Mise à disposition</a> </li> </ul> </li> <li class=\"active treeview\"> <a href=\"#\"> <i class=\"fa fa-database\"></i> <span>Gestion de Stock</span> <i class=\"fa fa-angle-left pull-right\"></i> </a> <ul class=\"treeview-menu\"> <li class=\"active\"> <a href=\""; // line 189 echo $this->env->getExtension('routing')->getPath("log_addStock"); echo "\"><i class=\"fa fa-calculator\"></i> Ajouter au stock</a> </li> <li> <a href=\""; // line 193 echo $this->env->getExtension('routing')->getPath("log_listStock"); echo "\"><i class=\"fa fa-list\"></i> Lister Stock</a> </li> <li> <a href=\""; // line 197 echo $this->env->getExtension('routing')->getPath("log_listDmd"); echo "\"><i class=\"fa fa-list\"></i> Demandes <span class=\"label label-primary pull-right\">"; echo twig_escape_filter($this->env, $this->env->getExtension('dmd_extension')->calcul(0), "html", null, true); echo "</span></a> </li> </ul> </li> </ul> </section> <!-- /.sidebar --> </aside> <!-- Content Wrapper. Contains page content --> <div class=\"content-wrapper\"> <!-- Content Header (Page header) --> <section class=\"content-header\"> <h1> Tableau de bord <small>Panneau de contrôle</small> </h1> <ol class=\"breadcrumb\"> <li><a href=\"#\"><i class=\"fa fa-dashboard\"></i> Accueil</a></li> <li class=\"active\">Tableau de bord</li> </ol> </section> <!-- Main content --> <section class=\"content\"> <br> <br> <br> <br> "; // line 227 $this->displayBlock('user_content', $context, $blocks); // line 242 echo " <br> <br> "; // line 245 if ($this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "request", array()), "hasPreviousSession", array())) { // line 246 echo " "; $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "session", array()), "flashbag", array()), "all", array(), "method")); foreach ($context['_seq'] as $context["type"] => $context["messages"]) { // line 247 echo " "; $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable($context["messages"]); foreach ($context['_seq'] as $context["_key"] => $context["message"]) { // line 248 echo " <div class=\"flash-"; echo twig_escape_filter($this->env, $context["type"], "html", null, true); echo "\"> <h3> "; // line 249 echo twig_escape_filter($this->env, $context["message"], "html", null, true); echo " </h3> </div> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 252 echo " "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['type'], $context['messages'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 253 echo " "; } // line 254 echo " </section><!-- /.content --> </div><!-- /.content-wrapper --> <footer class=\"main-footer\"> <strong>Copyright &copy; 2014-2015 <a href=\"\">Ali Brahem</a>.</strong> All rights reserved. </footer> <!-- Control Sidebar --> <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar --> <div class='control-sidebar-bg'></div> </div><!-- ./wrapper --> <!-- jQuery 2.1.4 --> <script src=\""; // line 269 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/jQuery/jQuery-2.1.4.min.js"), "html", null, true); echo "\"></script> <!-- jQuery UI 1.11.2 --> <script src=\"http://code.jquery.com/ui/1.11.2/jquery-ui.min.js\" type=\"text/javascript\"></script> <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip --> <script> \$.widget.bridge('uibutton', \$.ui.button); </script> <!-- Bootstrap 3.3.2 JS --> <script src=\""; // line 277 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bootstrap/js/bootstrap.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- Morris.js charts --> <script src=\"http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js\"></script> <script src=\""; // line 280 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/morris/morris.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- Sparkline --> <script src=\""; // line 282 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/sparkline/jquery.sparkline.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- jvectormap --> <script src=\""; // line 284 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <script src=\""; // line 285 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/jvectormap/jquery-jvectormap-world-mill-en.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- jQuery Knob Chart --> <script src=\""; // line 287 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/knob/jquery.knob.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- daterangepicker --> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js\" type=\"text/javascript\"></script> <script src=\""; // line 290 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/daterangepicker/daterangepicker.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- datepicker --> <script src=\""; // line 292 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/datepicker/bootstrap-datepicker.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- Bootstrap WYSIHTML5 --> <script src=\""; // line 294 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- Slimscroll --> <script src=\""; // line 296 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/slimScroll/jquery.slimscroll.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- FastClick --> <script src=\""; // line 298 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/fastclick/fastclick.min.js"), "html", null, true); echo "\"></script> <!-- AdminLTE App --> <script src=\""; // line 300 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("dist/js/app.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <script src=\""; // line 301 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bootstrap/js/calculTole.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <script src=\""; // line 302 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bootstrap/js/avancement.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <script src=\""; // line 303 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bootstrap/js/stock.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- AdminLTE dashboard demo (This is only for demo purposes) --> <script src=\""; // line 305 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("dist/js/pages/dashboard.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <!-- DATA TABES SCRIPT --> <script src=\""; // line 307 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/datatables/jquery.dataTables.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <script src=\""; // line 308 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("plugins/datatables/dataTables.bootstrap.min.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> <link href=\""; // line 309 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bootstrap/css/loading.css"), "html", null, true); echo "\" rel=\"stylesheet\" type=\"text/css\" /> <!-- AdminLTE for demo purposes --> <script src=\""; // line 312 echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("dist/js/demo.js"), "html", null, true); echo "\" type=\"text/javascript\"></script> </body> </html>"; } // line 227 public function block_user_content($context, array $blocks = array()) { // line 228 echo " <!-- Small boxes (Stat box) --> <div class=\"row\"> <div class=\"col-lg-3 col-xs-6\"> <!-- small box --> </div><!-- ./col --> <!-- Main row --> <div class=\"row\"> </div><!-- /.row (main row) --> "; } public function getTemplateName() { return "AdminBundle::layoutSUP.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 517 => 228, 514 => 227, 507 => 312, 501 => 309, 497 => 308, 493 => 307, 488 => 305, 483 => 303, 479 => 302, 475 => 301, 471 => 300, 466 => 298, 461 => 296, 456 => 294, 451 => 292, 446 => 290, 440 => 287, 435 => 285, 431 => 284, 426 => 282, 421 => 280, 415 => 277, 404 => 269, 387 => 254, 384 => 253, 378 => 252, 369 => 249, 364 => 248, 359 => 247, 354 => 246, 352 => 245, 347 => 242, 345 => 227, 310 => 197, 303 => 193, 296 => 189, 281 => 177, 275 => 174, 269 => 171, 263 => 168, 257 => 165, 250 => 161, 243 => 157, 228 => 145, 221 => 141, 207 => 130, 203 => 129, 194 => 123, 190 => 122, 185 => 120, 159 => 97, 152 => 93, 127 => 71, 122 => 70, 120 => 69, 78 => 30, 73 => 28, 68 => 26, 63 => 24, 58 => 22, 53 => 20, 48 => 18, 43 => 16, 38 => 14, 29 => 8, 20 => 1,); } }
const App = require('./spec/app'); module.exports = config => { const params = { basePath: '', frameworks: [ 'express-http-server', 'jasmine' ], files: [ 'lib/**/*.js' ], colors: true, singleRun: true, logLevel: config.LOG_WARN, browsers: [ 'Chrome', 'PhantomJS' ], concurrency: Infinity, reporters: [ 'spec', 'coverage' ], preprocessors: { 'lib/**/*.js': ['coverage'] }, coverageReporter: { dir: 'coverage/', reporters: [ { type: 'html', subdir: 'report' }, { type: 'lcovonly', subdir: './', file: 'coverage-front.info' }, { type: 'lcov', subdir: '.' } ] }, browserDisconnectTimeout: 15000, browserNoActivityTimeout: 120000, expressHttpServer: { port: 8092, appVisitor: App } }; if (process.env.TRAVIS) { params.browsers = [ 'PhantomJS' ]; } config.set(params); };
from feature import * from pymongo import MongoClient from bson.binary import Binary as BsonBinary import pickle import os from operator import itemgetter import time import sys imagelocation = "" #Input Image path indir = "" #Directory Path client = MongoClient('mongodb://localhost:27017') db = client.coil #Insert your database in place of coil col = db.images #Insert your collection in place of images class Image(object): """docstring for Image""" def __init__(self, path): self.path = path img = cv2.imread(self.path,0) imgm = preprocess(img) segm = segment(imgm) self.glfeature = globalfeature(imgm,16) self.llfeature = localfeature(segm) self.numberofones = self.glfeature.sum(dtype=int) start_time = time.time() count = 0 for root, dirs, filenames in os.walk(indir): for f in filenames: i1 = Image(f) count = count+1 perc = (count/360) * 100 sys.stdout.write("\r%d%%" % perc) sys.stdout.flush() new_posts = [{'path': i1.path, 'llfeature': BsonBinary(pickle.dumps(i1.llfeature,protocol=2)), 'glfeature': BsonBinary(pickle.dumps(i1.glfeature,protocol=2)), 'numberofones' : int(i1.numberofones)}] post_id = col.insert(new_posts) # print(post_id) img = Image(imagelocation) count = 0 maxglosim = 0 maxlocsim = 0 maximum = 0 gridmax=0 vectormax=0 for f in col.find(): llfeature = pickle.loads(f['llfeature']) glfeature = pickle.loads(f['glfeature']) count = count+1 perc = (count/360) * 100 sys.stdout.write("\r%d%%" % perc) sys.stdout.flush() locsim = np.absolute((llfeature-img.llfeature).sum()) glosim = np.logical_xor(glfeature,img.glfeature).sum() distance = locsim+glosim if(glosim>maxglosim): gridmax = glfeature maxglosim=glosim if(locsim>maxlocsim): maxlocsim=locsim vectormax = llfeature if(distance>maximum): vectmostdif= llfeature gridmostdif = glfeature maximum = distance maxilocsim = np.absolute((vectormax-img.llfeature).sum()) maxiglosim = np.logical_xor(gridmax,img.glfeature).sum() processed_time = time.time() print("\nTotal Processing Time : {0:.2f} seconds".format(processed_time-start_time)) def gloDist(gridA,gridB): glosim = np.logical_xor(gridA,gridB).sum() return glosim/maxiglosim def locDist(vectorA,vectorB): locsim = np.absolute((vectorA-vectorB).sum()) return locsim/maxilocsim ranking = [] count = 0 print("\nSearching:") for f in col.find(): llfeature = pickle.loads(f['llfeature']) glfeature = pickle.loads(f['glfeature']) count = count+1 perc = (count/360) * 100 sys.stdout.write("\r%d%%" % perc) sys.stdout.flush() g1 = gloDist(glfeature,img.glfeature) l1 = locDist(llfeature,img.llfeature) sim = ((2-(g1+l1))/2)*100 ranking.append([sim,f['path']]) search_time = time.time() print("\nTotal Searching Time : {0:.2f} seconds".format(search_time-processed_time)) print("\nTotal Time : {0:.2f} seconds".format(search_time-start_time)) ranking = sorted(ranking, key=itemgetter(0),reverse=True) #Ranking : Results in a list
package com.pandu.remotemouse; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.Button; public class Help extends Dialog{ public Help(Context context) { super(context); // TODO Auto-generated constructor stub } @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.help); setTitle("Help"); Button but = (Button) findViewById(R.id.bCloseDialog); but.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub dismiss(); } }); } }
<?php /* * This file is part of the Elcodi package. * * Copyright (c) 2014-2015 Elcodi.com * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * Feel free to edit as you please, and have fun. * * @author Marc Morera <yuhu@mmoreram.com> * @author Aldo Chiecchia <zimage@tiscali.it> * @author Elcodi Team <tech@elcodi.com> */ namespace Elcodi\Admin\PluginBundle\Controller; use Mmoreram\ControllerExtraBundle\Annotation\JsonResponse; use RuntimeException; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpFoundation\Request; use Elcodi\Admin\CoreBundle\Controller\Abstracts\AbstractAdminController; use Elcodi\Component\Plugin\Entity\Plugin; use Elcodi\Component\Plugin\Form\Type\PluginType; use Elcodi\Component\Plugin\PluginTypes; /** * Class Controller for Plugins * * @Route( * path = "/plugin", * ) */ class PluginController extends AbstractAdminController { /** * List plugins * * @param string $category Optional plugin category * * @return array Result * * @Route( * path = "s", * name = "admin_plugin_list", * methods = {"GET"} * ) * * @Route( * path = "s/{category}", * name = "admin_plugin_categorized_list", * methods = {"GET"} * ) * * @Template */ public function listAction($category = null) { $criteria = [ 'type' => PluginTypes::TYPE_PLUGIN, ]; if ($category !== null) { $criteria['category'] = $category; } $plugins = $this ->get('elcodi.repository.plugin') ->findBy( $criteria, [ 'category' => 'ASC' ] ); return [ 'plugins' => $plugins, 'category' => $category, ]; } /** * Configure plugin * * @param Request $request Request * @param string $pluginHash Plugin hash * * @return array Result * * @throws RuntimeException Plugin not available for configuration * * @Route( * path = "/{pluginHash}", * name = "admin_plugin_configure", * methods = {"GET", "POST"} * ) * @Template */ public function configureAction( Request $request, $pluginHash ) { /** * @var Plugin $plugin */ $plugin = $this ->get('elcodi.repository.plugin') ->findOneBy([ 'hash' => $pluginHash, ]); $form = $this ->createForm( new PluginType($plugin), $plugin->getFieldValues() ); if ($request->isMethod(Request::METHOD_POST)) { $form->handleRequest($request); $pluginValues = $form->getData(); $plugin->setFieldValues($pluginValues); $this ->get('elcodi.object_manager.plugin') ->flush($plugin); $this->addFlash( 'success', $this ->get('translator') ->trans('admin.plugin.saved') ); return $this ->redirectToRoute('admin_plugin_configure', [ 'pluginHash' => $plugin->getHash(), ]); } return [ 'form' => $form->createView(), 'plugin' => $plugin, ]; } /** * Enable/Disable plugin * * @param Request $request Request * @param string $pluginHash Plugin hash * * @return array Result * * @Route( * path = "/{pluginHash}/enable", * name = "admin_plugin_enable", * methods = {"POST"} * ) * @JsonResponse() */ public function enablePluginAction( Request $request, $pluginHash ) { /** * @var Plugin $plugin */ $plugin = $this ->get('elcodi.repository.plugin') ->findOneBy([ 'hash' => $pluginHash, ]); $enabled = (boolean) $request ->request ->get('value'); $plugin->setEnabled($enabled); $this ->get('elcodi.object_manager.plugin') ->flush($plugin); $this ->get('elcodi.manager.menu') ->removeFromCache('admin'); return [ 'status' => 200, 'response' => [ $this ->get('translator') ->trans('admin.plugin.saved'), ], ]; } /** * Check if, given a plugin hash, a configuration page is available * * @param Plugin $plugin Plugin * * @return boolean Is available */ protected function isPluginConfigurable(Plugin $plugin = null) { return ($plugin instanceof Plugin) && $plugin->hasFields(); } }
"use strict"; let fs = require("fs") , chalk = require("chalk"); module.exports = function(name) { let file = process.env.CONFIG_PATH + "initializers/" + name; if (!fs.existsSync(file + ".js")) console.log(chalk.red("\tInitializer", name + ".js not found, add it on /config/initializers")); return require(file); };
<!DOCTYPE html> <html> <head> <link href="css/awsdocs.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/awsdocs.min.js"></script> <meta charset="utf-8"> </head> <body> <div id="content" style="padding: 10px 30px;"> <h1 class="topictitle" id="aws-properties-ses-receiptrule-workmailaction">Amazon Simple Email Service ReceiptRule WorkmailAction</h1><p>The <code class="code">WorkmailAction</code> property type includes an action in an Amazon SES receipt rule that calls Amazon WorkMail and, optionally, publishes a notification to Amazon SNS. </p><p>You will typically not use this action directly because Amazon WorkMail adds the rule automatically during its setup procedure. </p><p>For information using a receipt rule to call Amazon WorkMail, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/url-ses-dev;receiving-email-action-workmail.html" target="_blank">WorkMail Action</a> in the <em>Amazon Simple Email Service Developer Guide</em>. </p><p> <code class="code">WorkmailAction</code> is a property of the <a href="aws-properties-ses-receiptrule-action.html">Amazon Simple Email Service ReceiptRule Action</a> property type. </p><h2 id="aws-properties-ses-receiptrule-workmailaction-syntax">Syntax</h2><p>To declare this entity in your AWS CloudFormation template, use the following syntax:</p><div id="JSON" name="JSON" class="section langfilter"> <h3 id="aws-properties-ses-receiptrule-workmailaction-syntax.json">JSON</h3> <pre class="programlisting"><div class="code-btn-container"><div class="btn-copy-code" title="Copy"></div><div class="btn-dark-theme" title="Dark theme" title-dark="Dark theme" title-light="Light theme"></div></div><code class="nohighlight">{ &quot;<a href="aws-properties-ses-receiptrule-workmailaction.html#cfn-ses-receiptrule-workmailaction-topicarn">TopicArn</a>&quot; : <em class="replaceable"><code>String</code></em>, &quot;<a href="aws-properties-ses-receiptrule-workmailaction.html#cfn-ses-receiptrule-workmailaction-organizationarn">OrganizationArn</a>&quot; : <em class="replaceable"><code>String</code></em> }</code></pre> </div><div id="YAML" name="YAML" class="section langfilter"> <h3 id="aws-properties-ses-receiptrule-workmailaction-syntax.yaml">YAML</h3> <pre class="programlisting"><div class="code-btn-container"><div class="btn-copy-code" title="Copy"></div><div class="btn-dark-theme" title="Dark theme" title-dark="Dark theme" title-light="Light theme"></div></div><code class="nohighlight"> <a href="aws-properties-ses-receiptrule-workmailaction.html#cfn-ses-receiptrule-workmailaction-topicarn">TopicArn</a>: <em class="replaceable"><code>String</code></em> <a href="aws-properties-ses-receiptrule-workmailaction.html#cfn-ses-receiptrule-workmailaction-organizationarn">OrganizationArn</a>: <em class="replaceable"><code>String</code></em></code></pre> </div><h2 id="aws-properties-ses-receiptrule-workmailaction-properties">Properties</h2><div class="variablelist"> <dl> <dt><a id="cfn-ses-receiptrule-workmailaction-organizationarn"></a><span class="term"><code class="code">OrganizationArn</code></span></dt> <dd> <p>The ARN of the Amazon WorkMail organization. An example of an Amazon WorkMail organization ARN is <code class="code">arn:aws:workmail:us-west-2:123456789012:organization/m-68755160c4cb4e29a2b2f8fb58f359d7</code>. For information about Amazon WorkMail organizations, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/url-wm-admin;organizations_overview.html" target="_blank">Working with Organizations</a> in the <em>Amazon WorkMail Administrator Guide</em>. </p> <p> <em>Required</em>: Yes </p> <p> <em>Type</em>: String </p> <p> <em>Update requires</em>: <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt">No interruption</a> </p> </dd> <dt><a id="cfn-ses-receiptrule-workmailaction-topicarn"></a><span class="term"><code class="code">TopicArn</code></span></dt> <dd> <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the WorkMail action is called. An example of an Amazon SNS topic ARN is <code class="code">arn:aws:sns:us-west-2:123456789012:MyTopic</code>. </p> <p> <em>Required</em>: No </p> <p> <em>Type</em>: String </p> <p> <em>Update requires</em>: <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt">No interruption</a> </p> </dd> </dl> </div><h2 id="aws-properties-ses-receiptrule-workmailaction-seealso">See Also</h2><div class="itemizedlist"> <ul class="itemizedlist" type="disc"> <li class="listitem"> <p><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/url-ses-dev;receiving-email-receipt-rules.html" target="_blank">Creating Receipt Rules for Amazon SES Email Receiving</a> in the <em>Amazon Simple Email Service Developer Guide</em></p> </li> <li class="listitem"> <p><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/url-ses-dev;receiving-email-action-workmail.html" target="_blank">WorkMail Action</a> in the <em>Amazon Simple Email Service Developer Guide</em></p> </li> <li class="listitem"> <p><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/url-ses-api;API_WorkmailAction.html" target="_blank">WorkmailAction</a> in the <em>Amazon Simple Email Service API Reference</em></p> </li> </ul> </div></div> </body> </html>
# Sublime Text [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code) ## Packager [Sublime Package Control](https://sublime.wbond.net/) [Sublime Package Control Install](https://sublime.wbond.net/installation) Install a Package /preferences/package control/install package List Install Packages /preferences/package control/list packages ### Base Packages [Sidebar Enhancements](https://sublime.wbond.net/packages/SideBarEnhancements) Browser Refresh (not needed for hugo or compass) [Markdown Editing](https://sublime.wbond.net/packages/MarkdownEditing) might have to set view/syntax/opens all with current extensions as/markdownediting/??? to get nice formatting Delete Blank Lines FileDiffs rsub (for editing locally files on remote server) https://github.com/Drarok/rsub [Dependents](dependents.md) ssh to the server and wget this ``` sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate sudo chmod +x /usr/local/bin/rsub ``` original post here. http://www.lleess.com/2013/05/how-to-edit-remote-files-with-sublime.html Possible sh file or put it in the config. ``` #!/bin/bash ssh -R 52698:localhost:52698 ssh -o IdentitiesOnly=yes -i /home/david/.ssh/EC2Server.pem ubuntu@54.191.214.51 ``` ``` ~/.ssh/config Host 54.191.214.51 RemoteForward 52698 localhost:52698 ``` Windows/Linux: Ctrl+Alt+Backspace --> Delete Blank Lines Ctrl+Alt+Shift+Backspace --> Delete Surplus Blank Lines OSX: Ctrl+Alt+Delete --> Delete Blank Lines Ctrl+Alt+Shift+Delete --> Delete Blank Lines ### Misc ctnrl-j join lines (http://sublimetexttips.com/7-handy-text-manipulation-tricks-sublime-text-2/) ### User Settings For not saving state ``` "hot_exit": false, "remember_open_files": false ``` ### Languages download a raw .dic file from there to the packages directory (you can find out by doing preferences browse packages) https://github.com/SublimeText/Dictionaries click on the .dic file right click on the raw button and download ### My Snippets fmt<tab> {{% format xxxxx %}} cfmt<tab> {{% /format %}} img<tab> {{% image filename="" caption="" position="" %}} ibr<tab> {{% imagebreak %}} lno<tab> {{% linkout text="" url="" %}} (not finished??) For notes use NOTE-xx: where xx is initials of person for that note. use no initial for a generic note. Could us bold-italics for notes. Example ***NOTE-dk:this is example note*** to use the note snippet. type nt then the <tab> key ## Find and Replace ### Regular Expressions - Regex Finds a paragraph ^(.+?)\n\s*\n Put something before and after the paragraph {test}\n\1\n{end test}\n\n find paragaraphs ``` ^(.+?)\n\s*\n ``` find paragraph starting with {{% image ``` ^(\{\{% image.*$) ``` wrap the english class format shortcode around it ``` {{% format english %}}\n\1\n{{% /format %}} ``` find paragraphs except those that start with {{% which is a shortcode ``` ^(?!\{\{\%)(.*$)\n\s*\n ``` put format shortcoded around paragraph ``` {{% format english %}}\n\1\n{{% /format %}}\n\n ```
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // 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. // //********************************************************* namespace CompositionSampleGallery { public sealed partial class ShadowInterop : SamplePage { public ShadowInterop() { this.InitializeComponent(); } public static string StaticSampleName { get { return "Shadow Interop"; } } public override string SampleName { get { return StaticSampleName; } } public override string SampleDescription { get { return "Demonstrates how to apply drop shadows to Xaml elements."; } } public override string SampleCodeUri { get { return "http://go.microsoft.com/fwlink/p/?LinkID=761171"; } } } }
"use strict"; // Controller function Avatar(app, req, res) { // HTTP action this.action = (params) => { app.sendFile(res, './storage/users/' + params[0] + '/' + params[1]); }; }; module.exports = Avatar;
<?php namespace Models; /** * Class Candidate * @package Models * * @Source("candidates") * */ class Candidate extends \Phalcon\Mvc\Model { /** * @Id * @Identity * @GeneratedValue * @Primary * @Column(type="integer") * @var integer */ public $id; /** * @Column(column="pib", type="string") * @var string */ public $pib; /** * @Column(column="birthDate", type="timestamp") * @var string */ public $birthDate; /** * @Column(name="maritalStatus", type="enum") * @var string */ public $maritalStatus; /** * @Column(name="cityId", type="integer") * @var string */ public $cityId; /** * @Column(name="educationId", type="integer") * @var string */ public $educationId; /** * @Column(name="phoneMobile", type="string", length=200) * @var string */ public $phoneMobile; /** * @Column(name="phoneHome", type="string") * @var string */ public $phoneHome; /** * @Column(name="email", type="string") * @var string */ public $email; /** * @Column(name="drivingExp", type="string") * @var string */ public $drivingExp; /** * @Column(type="$recommendations", nullable=false, name="group_id", size="11") */ public $recommendations; /** * @Column(column="changed", type="timestamp") * @var string */ public $changed; /** * @Column(column="created", type="timestamp") * @var string */ public $created; public function getSource() { return "candidates"; } }
# Creating a Base Image A base image is an image of a virtual machine. The base image will be an installed and configured Ubuntu 16.04 server. This image can then be cloned multiple times to create copies to use when provisioning new virtual machines. This greatly speeds up the process to creating multiple machines and does it in a reliable manner. The main tool in use here is Packer. Packer will automatically install Ubuntu from the installation ISO and configure it correctly. Once the installation is done, the final installed image is placed into a folder ready for use. ## YouTube Tutorial The virtualbox steps on a mac are available as a youtube tutorial now! <iframe width="560" height="315" src="https://www.youtube.com/embed/IDjibt2aLOQ?ecver=1" frameborder="0" allowfullscreen></iframe> <br/> ## Creating an Ubuntu 16.04 base image First clone this repo: ```git clone https://github.com/mrgeoffrich/learn-openstack-scripts``` Then run the packer build for your virtualisation tool of choice. Change directory into the repo. <div class="virtualbox" style="display: none"> Run: <code>packer build --only=virtualbox-iso ubuntu1604base.json</code> </div> <div class="fusion" style="display: none"> Run: <code>packer build --only=vmware-iso ubuntu1604base.json</code> </div> <div class="hyperv" style="display: none"> <p><b>Note</b> - You will need to set up an external Virtual Switch and set the variable in ubuntu1604base.json to match the name of this switch.</p> Run: <code>packer build --only=hyperv-iso ubuntu1604base.json</code> </div> <div class="novisor" style="display: none"> <p> Please select a preferred hypervisor using the dropdown at the top right. </p> </div> ### What it's doing Packer will download the ubuntu 16.04 ISO, create a new blank virtual machine, then automatically step through the installation process for Ubuntu 16.04. Once the installation is done, and SSH is available, packer will SSH in and run a number of commands to continue setting up the machine. If you want to look at the configuration, the ```ubuntu1604base.json``` file is the packer config, and in the scripts folder are the shell scripts that are executed. ### What it creates <div class="virtualbox" style="display: none"> There will be a virtualbox/base-ubuntu folder with the VirtualBox (ovf) virtual machine files inside. </div> <div class="fusion" style="display: none"> There will be a vmware/base-ubuntu folder with the VMware (vmx,vmdk) virtual machine files. </div> <div class="hyperv" style="display: none"> There will be a hyperv/base-ubuntu folder with the Hyper-V format virtual machine files. </div>
"use strict"; var Response = (function () { function Response(result, childWork) { this.result = result; this.childWork = childWork; } return Response; }()); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Response; //# sourceMappingURL=response.js.map
/* *********************************************************************************************************************** * * Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * 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. * **********************************************************************************************************************/ #pragma once #include "core/dmaCmdBuffer.h" #include "core/hw/gfxip/gfx9/gfx9Device.h" namespace Pal { namespace Gfx9 { // ===================================================================================================================== // // OSS5 (GFX10) hardware-specific functionality for DMA command buffer execution. class DmaCmdBuffer final : public Pal::DmaCmdBuffer { public: static size_t GetSize(const Device& device) { return sizeof(DmaCmdBuffer); } static uint32* BuildNops(uint32* pCmdSpace, uint32 numDwords); DmaCmdBuffer(Device& device, const CmdBufferCreateInfo& createInfo); virtual void CmdWriteTimestamp(HwPipePoint pipePoint, const IGpuMemory& dstGpuMemory, gpusize dstOffset) override; virtual void CmdUpdateMemory( const IGpuMemory& dstGpuMemory, gpusize dstOffset, gpusize dataSize, const uint32* pData) override; virtual void CmdWriteImmediate( HwPipePoint pipePoint, uint64 data, ImmediateDataWidth dataSize, gpusize address) override; virtual uint32 CmdInsertExecutionMarker() override; protected: virtual ~DmaCmdBuffer() {} virtual Result AddPreamble() override; virtual Result AddPostamble() override; virtual bool SupportsExecutionMarker() override { return true; } virtual void BeginExecutionMarker(uint64 clientHandle) override; virtual void EndExecutionMarker() override; virtual void SetupDmaInfoExtent(DmaImageInfo* pImageInfo) const override; virtual uint32* WritePredicateCmd(size_t predicateDwords, uint32* pCmdSpace) const override; virtual void PatchPredicateCmd(size_t predicateDwords, void* pPredicateCmd) const override; virtual uint32* WriteCopyGpuMemoryCmd( gpusize srcGpuAddr, gpusize dstGpuAddr, gpusize copySize, DmaCopyFlags copyFlags, uint32* pCmdSpace, gpusize* pBytesCopied) const override; virtual uint32* WriteCopyTypedBuffer( const DmaTypedBufferCopyInfo& dmaCopyInfo, uint32* pCmdSpace) const override; virtual void WriteCopyImageLinearToLinearCmd(const DmaImageCopyInfo& imageCopyInfo) override; virtual void WriteCopyImageLinearToTiledCmd(const DmaImageCopyInfo& imageCopyInfo) override; virtual void WriteCopyImageTiledToLinearCmd(const DmaImageCopyInfo& imageCopyInfo) override; virtual void WriteCopyImageTiledToTiledCmd(const DmaImageCopyInfo& imageCopyInfo) override; virtual uint32* WriteCopyMemToLinearImageCmd( const GpuMemory& srcGpuMemory, const DmaImageInfo& dstImage, const MemoryImageCopyRegion& rgn, uint32* pCmdSpace) const override; virtual uint32* WriteCopyMemToTiledImageCmd( const GpuMemory& srcGpuMemory, const DmaImageInfo& dstImage, const MemoryImageCopyRegion& rgn, uint32* pCmdSpace) const override { return CopyImageMemTiledTransform(dstImage, srcGpuMemory, rgn, false, pCmdSpace); } virtual uint32* WriteCopyLinearImageToMemCmd( const DmaImageInfo& srcImage, const GpuMemory& dstGpuMemory, const MemoryImageCopyRegion& rgn, uint32* pCmdSpace) const override; virtual uint32* WriteCopyTiledImageToMemCmd( const DmaImageInfo& srcImage, const GpuMemory& dstGpuMemory, const MemoryImageCopyRegion& rgn, uint32* pCmdSpace) const override { return CopyImageMemTiledTransform(srcImage, dstGpuMemory, rgn, true, pCmdSpace); } virtual uint32* WriteFillMemoryCmd( gpusize dstAddr, gpusize byteSize, uint32 data, uint32* pCmdSpace, gpusize* pBytesCopied) const override; virtual uint32* WriteWaitEventSet( const GpuEvent& gpuEvent, uint32* pCmdSpace) const override; virtual void WriteEventCmd(const BoundGpuMemory& boundMemObj, HwPipePoint pipePoint, uint32 data) override; virtual uint32* WriteNops(uint32* pCmdSpace, uint32 numDwords) const override; virtual gpusize GetSubresourceBaseAddr(const Pal::Image& image, const SubresId& subresource) const override; virtual uint32 GetLinearRowPitchAlignment(uint32 bytesPerPixel) const override; protected: virtual bool UseT2tScanlineCopy(const DmaImageCopyInfo& imageCopyInfo) const override; virtual DmaMemImageCopyMethod GetMemImageCopyMethod(bool isLinearImg, const DmaImageInfo& imageInfo, const MemoryImageCopyRegion& region) const override; private: PAL_DISALLOW_COPY_AND_ASSIGN(DmaCmdBuffer); PAL_DISALLOW_DEFAULT_CTOR(DmaCmdBuffer); uint32 GetCachePolicy(Gfx10SdmaBypassMall bypassFlag) const; bool GetMallBypass(Gfx10SdmaBypassMall bypassFlag) const; uint32 GetCpvFromLlcPolicy(uint32 llcPolicy) const; uint32 GetCpvFromCachePolicy(uint32 cachePolicy) const; uint32* CopyImageLinearTiledTransform( const DmaImageCopyInfo& copyInfo, const DmaImageInfo& linearImg, const DmaImageInfo& tiledImg, bool deTile, uint32* pCmdSpace) const; uint32* CopyImageMemTiledTransform( const DmaImageInfo& image, const GpuMemory& gpuMemory, const MemoryImageCopyRegion& rgn, bool deTile, uint32* pCmdSpace) const; static uint32 GetHwDimension(const DmaImageInfo& dmaImageInfo); static uint32 GetMaxMip(const DmaImageInfo& dmaImageInfo); static AddrSwizzleMode GetSwizzleMode(const DmaImageInfo& dmaImageInfo); static uint32 GetPipeBankXor(const Pal::Image& image, const SubresId& subresource); template <typename PacketName> static void SetupMetaData(const DmaImageInfo& image, PacketName* pPacket, bool imageIsDst); static bool ImageHasMetaData(const DmaImageInfo& imageInfo); void WriteCondExecCmd(uint32* pCmdSpace, gpusize predMemory, uint32 skipCountInDwords) const; void WriteFenceCmd(uint32* pCmdSpace, gpusize memory, uint32 predCopyData) const; uint32 GetImageZ(const DmaImageInfo& dmaImageInfo, uint32 offsetZ) const; uint32 GetImageZ(const DmaImageInfo& dmaImageInfo) const { return GetImageZ(dmaImageInfo, dmaImageInfo.offset.z); } uint32 GetLinearRowPitch(gpusize rowPitch, uint32 bytesPerPixel) const; void ValidateLinearRowPitch(gpusize rowPitchInBytes, gpusize height, uint32 bytesPerPixel) const; static uint32 GetLinearDepthPitch(gpusize depthPitch, uint32 bytesPerPixel) { PAL_ASSERT(depthPitch % bytesPerPixel == 0); // Note that the linear pitches must be expressed in units of pixels, minus one. return static_cast<uint32>(depthPitch / bytesPerPixel) - 1; } uint32 GetLinearRowPitch(const DmaImageInfo& imageInfo) const { ValidateLinearRowPitch(imageInfo.pSubresInfo->rowPitch, imageInfo.extent.height, imageInfo.bytesPerPixel); return GetLinearRowPitch(imageInfo.pSubresInfo->rowPitch, imageInfo.bytesPerPixel); } static uint32 GetLinearDepthPitch(const DmaImageInfo& imageInfo) { return GetLinearDepthPitch(imageInfo.pSubresInfo->depthPitch, imageInfo.bytesPerPixel); } static uint32* BuildUpdateMemoryPacket( gpusize dstAddr, uint32 dwordsToWrite, const uint32* pSrcData, uint32* pCmdSpace); static uint32* UpdateImageMetaData( const DmaImageInfo& image, uint32* pCmdSpace); void WriteTimestampCmd(gpusize dstAddr); }; } // Oss4 } // Pal
require 'digest/sha1' require 'yaml' module SimpleCov # # A simplecov code coverage result, initialized from the Hash Ruby 1.9's built-in coverage # library generates (Coverage.result). # class Result # Returns the original Coverage.result used for this instance of SimpleCov::Result attr_reader :original_result # Returns all files that are applicable to this result (sans filters!) as instances of SimpleCov::SourceFile. Aliased as :source_files attr_reader :files alias_method :source_files, :files # Explicitly set the Time this result has been created attr_writer :created_at # Explicitly set the command name that was used for this coverage result. Defaults to SimpleCov.command_name attr_writer :command_name # Initialize a new SimpleCov::Result from given Coverage.result (a Hash of filenames each containing an array of # coverage data) def initialize(original_result) @original_result = original_result.freeze @files = original_result.map {|filename, coverage| SimpleCov::SourceFile.new(filename, coverage)}.sort_by(&:filename) filter! end # Returns all filenames for source files contained in this result def filenames files.map(&:filename) end # Returns a Hash of groups for this result. Define groups using SimpleCov.add_group 'Models', 'app/models' def groups @groups ||= SimpleCov.grouped(files) end # The overall percentual coverage for this result def covered_percent missed_lines, covered_lines = 0, 0 @files.each do |file| original_result[file.filename].each do |line_result| case line_result when 0 missed_lines += 1 when 1 covered_lines += 1 end end end total = (missed_lines + covered_lines) if total.zero? 0 else 100.0 * covered_lines / total end end # Applies the configured SimpleCov.formatter on this result def format! SimpleCov.formatter.new.format(self) end # Defines when this result has been created. Defaults to Time.now def created_at @created_at ||= Time.now end # The command name that launched this result. # Retrieved from SimpleCov.command_name def command_name @command_name ||= SimpleCov.command_name end # Returns a hash representation of this Result that can be used for marshalling it into YAML def to_hash {command_name => {:original_result => original_result.reject {|filename, result| !filenames.include?(filename) }, :created_at => created_at}} end # Returns a yaml dump of this result, which then can be reloaded using SimpleCov::Result.from_yaml def to_yaml to_hash.to_yaml end # Loads a SimpleCov::Result#to_hash dump def self.from_hash(hash) command_name, data = hash.first result = SimpleCov::Result.new(data[:original_result]) result.command_name = command_name result.created_at = data[:created_at] result end # Loads a SimpleCov::Result#to_yaml dump def self.from_yaml(yaml) from_hash(YAML.load(yaml)) end private # Applies all configured SimpleCov filters on this result's source files def filter! @files = SimpleCov.filtered(files) end end end
Package.describe({ name: 'craigslist-utils', summary: 'Npm Craigslist-utils packaged for Meteor.' }); Npm.depends ({ 'craigslist-utils': '0.0.7' }); Package.on_use(function (api) { api.add_files('craigslist-utils.js', ['server']); api.export('CL'); }); Package.on_test(function (api) { api.use('craigslist-utils'); api.use('tinytest'); api.add_files('craigslist-utils_tests.js'); });
# Tag Input Component for Angular [![Build Status](https://travis-ci.org/Gbuomprisco/ngx-chips.svg?branch=develop)](https://travis-ci.org/Gbuomprisco/ng2-tag-input) [![npm version](https://badge.fury.io/js/ngx-chips.svg)](https://badge.fury.io/js/ngx-chips) This is a component for Angular >= 4. Design and API are blandly inspired by Angular Material's md-chips. Formerly called ng2-tag-input. [![NPM](https://nodei.co/npm/ngx-chips.png?downloads=true&stars=true)](https://nodei.co/npm/ngx-chips/) ## [Demo](https://angular-mfppay.stackblitz.io/) Check out [the live demo](https://angular-mfppay.stackblitz.io/). **NB**: This repository is currently unmaintained. Please fork or use Angular Material's chips module, it got better. ## Getting Started npm i ngx-chips // OR yarn add ngx-chips **Notice**: the latest version on NPM may not reflect the branch `master`. Open an issue and tag me if you need it to be published. ## Configuration Ensure you import the module and the dependencies: ```javascript import { TagInputModule } from 'ngx-chips'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; // this is needed! import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @NgModule({ imports: [ TagInputModule, BrowserAnimationsModule, FormsModule, ReactiveFormsModule ...OtherModules ] // along with your other modules }) export class AppModule {} ``` ## API for TagInputComponent #### Inputs ##### ngModel OR use FormGroup/formControlName (required) - **`ngModel`** - [**`string[] | TagModel[]`**] - Model of the component. Accepts an array of strings as input OR an array of objects. If you do use an array of objects, make sure you: - define two properties, `value` and `display`. `Value` will uniquely identify the items, `display` will be the value displayed. - or, in alternative, provide the keys using the inputs `identifyBy` and `displayBy` **Notice**: the items provided to the model won't change, but the items added to the model will have the format { display, value }. If you do provide `identifyBy` and `displayBy`, these will be used as format for the user-entered tags. --- #### Properties (optional) **`placeholder`** - [**`?string`**] String that sets the placeholder of the input for entering new terms. **`secondaryPlaceholder`** - [**`?string`**] String that sets the placeholder of the input for entering new terms when there are 0 items entered. **`maxItems`** - [**`?number`**] Sets the maximum number of items it is possible to enter. ~~**`readonly`**~~ - [**`?boolean`**] [REMOVED] Please add a readonly attribute to each tag model as a truthy value instead. Example: ``` // TagModel { display: 'display', value: 124242, readonly: true } ``` **`separatorKeyCodes`** - [**`?number[]`**] Array of keyboard keys with which is possible to define the key for separating terms. By default, only Enter is the defined key. **`separatorKeys`** - [**`?string[]`**] Array of input characters with which is possible to define the key for separating terms. Default is empty. Can use with `separatorKeyCodes`, either one method matched will trigger tag separation. ~~**`transform`**~~ - [**`?(item: string) => string`**] [REMOVED] Please use `onAdding` instead. Just pass the value, transformed, to the Observable. **`inputId`** - [**`?string`**] Custom ID assigned to the input **`inputClass`** - [**`?string`**] Custom class assigned to the input **`clearOnBlur`** - [**`?boolean`**] If set to true, it will clear the form's text on blur events **`hideForm`** - [**`?boolean`**] If set to true, will remove the form from the component **`onTextChangeDebounce`** - [**`?number`**] Number of ms for debouncing the `onTextChange` event (defaults to `250`) **`addOnBlur`** - [**`?boolean`**] If set to `true`, will add an item when the form is blurred (defaults to `false`) **`addOnPaste`** - [**`?boolean`**] If set to `true`, will add items pasted into the form's input (defaults to `false`) **`pasteSplitPattern`** - [**`?string | RegExp`**] Pattern used with the native method split() to separate patterns in the string pasted (defaults to `,`) **`blinkIfDupe`** - [**`?boolean`**] If a duplicate item gets added, this will blink - giving the user a visual cue of where it is located (defaults to `true`) **`removable`** - [**`?boolean`**] If set to `false`, it will not be possible to remove tags (defaults to `true`) **`editable`** (experimental) - [**`?boolean`**] If set to `true`, it will be possible to edit the display value of the tags (defaults to `false`) **`allowDupes`** - [**`?boolean`**] If set to `true`, it will be possible to add tags with the same value (defaults to `false`) **`modelAsStrings`** - [**`?boolean`**] If set to `true`, all values added will be strings, and not objects (defaults to `false`) **`trimTags`** - [**`?boolean`**] If set to `false`, the tags could contain leading and trailing spaces (defaults to `true`) **`inputText`** - [**`?string`**] Property to bind text directly to the form's value. You can use it to change the text of the input at any time, or to just bind a value. Remember: use two-way data binding with this property. **`ripple`** - [**`?boolean`**] Specifies whether the ripple effect should be visible or not (defaults to `true`) **`disable`** - [**`?boolean`**] If set to `true`, the input will be disabled. Similar to `readonly` but with a visual effect. *Notice**: this attribute was changed from 'disabled' to 'disable' in order to comply with Angular's compiler. **`tabindex`** - [**`?string`**] If set, passes the specified tabindex to the form's input. **`dragZone`** - [**`?string`**] If set, the input will be draggable. Also the input will be draggable to another form with the same dragZone value. **`animationDuration`** - [**`?{enter: string, leave: string}`**] This option overwrites the default timing values for the animation. If you don't like the animation at all, just set both values to '0ms'. The default value is `{enter: '250ms', leave: '150ms'}` --- ##### Validation (optional) **`validators`** - [**`?ValidatorFn[]`**] An array of Validators (custom or Angular's) that will validate the tag before adding it to the list of items. It is possible to use multiple validators. **`asyncValidators`** - [**`?AsyncValidatorFn[]`**] An array of AsyncValidators that will validate the tag before adding it to the list of items. It is possible to use multiple async validators. **`errorMessages`** - [**`?Object{error: message}`**] An object whose key is the name of the error (ex. required) and the value is the message you want to display to your users **`onAdding`** - [**`?onAdding(tag: tagModel): Observable<TagModel>`**] Hook to intercept when an item is being added. Needs to return an Observable. * You can modify the tag being added during the interception. Example: ```javascript public onAdding(tag: TagModel): Observable<TagModel> { const confirm = window.confirm('Do you really want to add this tag?'); return Observable .of(tag) .filter(() => confirm); } ``` **`onRemoving`** - [**`?onRemoving(tag: tagModel): Observable<TagModel>`**] Hook to intercept when an item is being removed. Needs to return an Observable. Example: ```javascript public onRemoving(tag: TagModel): Observable<TagModel> { const confirm = window.confirm('Do you really want to remove this tag?'); return Observable .of(tag) .filter(() => confirm); } ``` --- ##### Autocomplete (optional) **`onlyFromAutocomplete`** - [**`?boolean`**] If set to `true`, it will be possible to add new items only from the autocomplete dropdown ##### Tags as Objects (optional) **`identifyBy`** - [**`?any`**] Any value you want your tag object to be defined by (defaults to `value`) **`displayBy`** - [**`?string`**] The string displayed in a tag object (defaults to `display`) --- #### Outputs (optional) **`onAdd`** - [**`?onAdd($event: string)`**] Event fired when an item has been added **`onRemove`** - [**`?onRemove($event: string)`**] Event fired when an item has been removed **`onSelect`** - [**`?onSelect($event: string)`**] Event fired when an item has been selected **`onFocus`** - [**`?onFocus($event: string)`**] Event fired when the input is focused - will return current input value **`onBlur`** - [**`?onBlur($event: string)`**] Event fired when the input is blurred - will return current input value **`onTextChange`** - [**`?onTextChange($event: string)`**] Event fired when the input value changes **`onPaste`** - [**`?onPaste($event: string)`**] Event fired when the text is pasted into the input (only if `addOnPaste` is set to `true`) **`onValidationError`** - [**`?onValidationError($event: string)`**] Event fired when the validation fails **`onTagEdited`** - [**`?onTagEdited($event: TagModel)`**] Event fired when a tag is edited ## API for TagInputDropdownComponent TagInputDropdownComponent is a proxy between `ngx-chips` and `ng2-material-dropdown`. **`autocompleteObservable`** - [**`(text: string) => Observable<Response>`**] A function that takes a string (current input value) and returns an Observable (ex. `http.get()`) with an array of items wit the same structure as `autocompleteItems` (see below). Make sure you retain the scope of your class or function when using this property. It can be used to populate the autocomplete with items coming from an async request. **`showDropdownIfEmpty`** - [**`?boolean`**] If set to `true`, the dropdown of the autocomplete will be shown as soon as the user focuses on the form **`keepOpen`** - [**`?boolean`**] To use in conjunction with `showDropdownIfEmpty`. If set to `false`, the dropdown will not reopen automatically after adding a new tag. (defaults to `true`). **`autocompleteItems`** - [**`?string[] | AutoCompleteModel[]`**] An array of items to populate the autocomplete dropdown **`offset`** - [**`?string`**] Offset to adjust the position of the dropdown with absolute values (defaults to `'50 0'`) **`focusFirstElement`** - [**`?boolean`**] If set to `true`, the first item of the dropdown will be automatically focused (defaults to `false`) **`minimumTextLength`** - [**`?number`**] Minimum text length in order to display the autocomplete dropdown (defaults to `1`) **`limitItemsTo`** - [**`?number`**] Number of items to display in the autocomplete dropdown **`identifyBy`** - [**`?string`**] Just like for `tag-input`, this property defines the property of the value displayed of the object passed to the autocomplete **`displayBy`** - [**`?string`**] Just like for `tag-input`, this property defines the property of the unique value of the object passed to the autocomplete **`matchingFn`** - [**`?matchingFn(value: string, target: TagModel): boolean`**] Use this property if you are not happy with the default matching and want to provide your own implementation. The first value is the value of the input text, the second value corresponds to the value of each autocomplete item passed to the component **`appendToBody`** - [**`?boolean`**] If set to `false`, the dropdown will not be appended to the body, but will remain in its parent element. Useful when using the components inside popups or dropdowns. Defaults to `true`. **`dynamicUpdate`** - [**`?boolean`**] If set to `false`, the dropdown will not try to set the position according to its position in the page, but will be fixed. Defaults to `true`. **`zIndex`** - [**`?number`**] Manually set the zIndex of the dropdown. Defaults to `100`. --- The property `autocompleteItems` can be an array of strings or objects. Interface for `AutoCompleteModel` (just like `TagModel)` is: ```javascript interface AutoCompleteModel { value: any; display: string; } ``` The input text will be matched against both the properties. More options to customise the dropdown will follow. ### Basic Example ```javascript @Component({ selector: 'app', template: `<tag-input [(ngModel)]='items'></tag-input>` }); export class App { items = ['Pizza', 'Pasta', 'Parmesan']; } ``` ```html <tag-input [(ngModel)]='items'></tag-input> ``` ### Advanced usage #### Using an array of objects ```html // itemsAsObjects = [{value: 0, display: 'Angular'}, {value: 1, display: 'React'}]; <tag-input [ngModel]="itemsAsObjects"></tag-input> ``` #### Using an array of with custom `identifyBy` and `displayBy` ```html // itemsAsObjects = [{id: 0, name: 'Angular'}, {id: 1, name: 'React'}]; <tag-input [ngModel]="itemsAsObjects" [identifyBy]="'id'" [displayBy]="'name'"></tag-input> ``` #### Editable tags ```html <tag-input [(ngModel)]='items' [editable]='true' (onTagEdited)="onTagEdited($event)"></tag-input> ``` #### Static Tags (not removable) ```html <tag-input [(ngModel)]='items' [removable]='false'></tag-input> ``` #### Max number of items ```html <tag-input [(ngModel)]='items' [maxItems]='5'></tag-input> ``` If the value of the model will contain more tags than `maxItems`, `maxItems` will be replaced with the current size of the model. #### Autocomplete ```html <tag-input [ngModel]="['@item']"> <tag-input-dropdown [autocompleteItems]="[{display: 'Item1', value: 0}, 'item2', 'item3']"> </tag-input-dropdown> </tag-input> ``` This will accept items only from the autocomplete dropdown: ```html <tag-input [ngModel]="['@item']" [onlyFromAutocomplete]="true"> <tag-input-dropdown [showDropdownIfEmpty]="true" [autocompleteItems]="['iTem1', 'item2', 'item3']"> </tag-input-dropdown> </tag-input> ``` ##### Define a template for your menu items ```html <tag-input [ngModel]="['@item']" [onlyFromAutocomplete]="true"> <tag-input-dropdown [showDropdownIfEmpty]="true" [autocompleteItems]="['iTem1', 'item2', 'item3']"> <ng-template let-item="item" let-index="index"> {{ index }}: {{ item.display }} </ng-template> </tag-input-dropdown> </tag-input> ``` ##### Populate items using an Observable ```javascript public requestAutocompleteItems = (text: string): Observable<Response> => { const url = `https://my.api.com/search?q=${text}`; return this.http .get(url) .map(data => data.json()); }; ``` ```html <tag-input [ngModel]="['@item']"> <tag-input-dropdown [autocompleteObservable]='requestAutocompleteItems'></tag-input-dropdown> </tag-input> ``` #### Additional keys to separate tags If you want to use more keys to separate items, add them to separatorKeys as an array of keyboard key codes. ```html <tag-input [(ngModel)]='items' [separatorKeyCodes]="[32]"></tag-input> ``` #### Validation Create some validation methods in your component: ```javascript class MyComponent { private startsWithAt(control: FormControl) { if (control.value.charAt(0) !== '@') { return { 'startsWithAt@': true }; } return null; } private endsWith$(control: FormControl) { if (control.value.charAt(control.value.length - 1) !== '$') { return { 'endsWith$': true }; } return null; } public validators = [this.startsWithAt, this.endsWith$]; public errorMessages = { 'startsWithAt@': 'Your items need to start with "@"', 'endsWith$': 'Your items need to end with "$"' }; } ``` Pass them to the tag-input component: ```html <tag-input [ngModel]="['@item']" [errorMessages]="errorMessages" [validators]="validators"> </tag-input> ``` #### Events Set up some methods that will run when its relative event is fired. ```html <tag-input [(ngModel)]='items' (onBlur)="onInputBlurred($event)" (onFocus)="onInputFocused($event)" (onSelect)="onSelected($event)" (onRemove)="onItemRemoved($event)" (onTextChange)="onTextChange($event)" (onAdd)="onItemAdded($event)"> </tag-input> ``` ~~#### Readonly If readonly is passed to the tag-input, it won't be possible to select, add and remove items.~~ [REMOVED] ```html <tag-input [ngModel]="['Javascript', 'Typescript']" [readonly]="true"></tag-input> ``` #### Custom items template Define your own template, but remember to set up the needed events using the `input` reference. ```html <tag-input [ngModel]="['@item']" [modelAsStrings]="true" #input> <ng-template let-item="item" let-index="index"> <!-- DEFINE HERE YOUR TEMPLATE --> <span> <!-- YOU MAY ACTUALLY DISPLAY WHATEVER YOU WANT IF YOU PASS AN OBJECT AS ITEM --> <!-- ex. item.myDisplayValue --> item: {{ item }} </span> <delete-icon (click)="input.removeItem(item, index)"></delete-icon> </ng-template> </tag-input> ``` #### Add default values If you use many instances of the component and want to set some values by default for all of them, import the module and use `withDefaults`: ```javascript import { TagInputModule } from 'ngx-chips'; TagInputModule.withDefaults({ tagInput: { placeholder: 'Add a new tag', // add here other default values for tag-input }, dropdown: { displayBy: 'my-display-value', // add here other default values for tag-input-dropdown } }); ``` #### Built-in Themes If you don't like how the default theme looks, or you just need it to fit in a different design, you can choose 4 new themes: `bootstrap3-info`, `bootstrap`, `dark` and `minimal`. ```html <tag-input [(ngModel)]='items' theme='bootstrap3-info'></tag-input> <tag-input [(ngModel)]='items' theme='bootstrap'></tag-input> <tag-input [(ngModel)]='items' theme='minimal'></tag-input> <tag-input [(ngModel)]='items' theme='dark'></tag-input> ``` If you do not like these themes, [define your own theme](https://github.com/gbuomprisco/ngx-chips/blob/master/docs/custom-themes.md). ## FAQ ### Does it work with Angular Universal? Yes. ### Does it work with Angular's Ahead of time compilation (AOT)? Yes. ### Does it work with Ionic 2? Yes. ### What version does it support? This component is supposed to work with the latest Angular versions. If you have any issues, please do make sure you're not running a different version (or check this repo's package.json). Otherwise, please do open a new issue. ### Can I change the style? Yes - check out [how to create custom themes](https://github.com/gbuomprisco/ngx-chips/blob/master/docs/custom-themes.md). ### Something's broken? Please do open a new issue, but please check first that the same issue has not already been raised and that you are using the latest version :) Please **do not** send private emails - Github Issues are supposed to help whoever might have your same issue, so it is the right place to help each other. Issues not filled out with the provided templates are going to be closed. Please provide as much information as possible: do include a plunkr so that I can see what the problem is without having to replicate your environment on my laptop. The time I can spend on this is very limited. No features requests will be considered, unless they are Pull Requests. I feel the component is already quite bloated, and I'd like on solving bugs and making this more reliable for everyone. ## Contributing/Pull Requests Contributions are highly welcome! No, there is no guideline on how to do it. Just make sure to lint and unit test your changes. We'll figure out the rest with a couple of messages... ### Ok - cool stuff. But when will you fix the issue I created? Do please read this great post by Micheal Bromley: http://www.michaelbromley.co.uk/blog/529/why-i-havent-fixed-your-issue-yet. No, I don't have babies, but am not 24/7 coding :)
'use strict'; import Application from '../../core/Application.js'; import Action from '../../core/Action.js'; describe('Action', () => { var app; var action; class ChildAction extends Action { get name() { return 'ChildAction'; } } beforeEach(() => { app = new Application(); action = new ChildAction(app); }); it('has to be defined, be a function and can be instantiated', () => { expect(ChildAction).toBeDefined(); expect(ChildAction).toEqual(jasmine.any(Function)); expect(action instanceof ChildAction).toBe(true); }); it('holds an app instance', () => { var myApp = action.app; expect(myApp).toEqual(jasmine.any(Application)); expect(myApp).toBe(app); }); it('has an execute function that throws an error if it is not implemented', () => { expect(action.execute).toEqual(jasmine.any(Function)); expect(() => action.execute(payload)).toThrow(); }); });
@import url('main.css'); header.main{ background-color: #3F51B5; position: fixed; height: 64px; width: 100%; z-index: 1000; box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.2); } header.main div#menu_main{ float: left; background: url('../img/ic_menu_white.svg') no-repeat center center; } header.main h1{ display: inline-block; color: #FFF; position: absolute; top: 0; left: 64px; font-size: 1.3em; line-height: 64px; font-weight: 400; text-transform: uppercase; } header.main div#options{ background: url('../img/ic_more_white.svg') no-repeat center center; } header.main a#logout{ background: url('../img/ic_logout_white.svg') no-repeat center center; } header.main div#search{ background: url('../img/ic_search_white.svg') no-repeat center center; } header.main div.icon, header.main a.icon{ top: 0; height: 64px; width: 64px; display: block; cursor: pointer; position: relative; float: right; } header.main input{ width: 200px; float: right; margin-top: 16px; transition: width 500ms ease; } header.main input.hidden{ width: 0; padding-left: 0; padding-right: 0; } aside.main{ position: fixed; left: 0; background: #FFF; z-index: 500; width: 240px; top: 64px; bottom: 0; transition: left 100ms; box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.2); } aside.main.hidden{ left: -250px; } aside.main header{ height: 150px; position: relative; background: url('../img/bg.png') no-repeat center center; background-size: cover; } aside.main header img{ box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.2); height: 64px; width: 64px; margin: 16px; border-radius: 50%; } aside.main header h2{ color: #FFF; bottom: 0; left: 0; right: 0; padding: 10px; position: absolute; background-color: rgba(0, 0, 0, 0.4); } aside.main ul{ margin: 20px 0; } aside.main ul li{ display: block; } aside.main ul li.div{ height: 20px; } aside.main ul li a{ padding: 7px 0 7px 40px; font-size: 1em; display: block; text-decoration: none; position: relative; color: #000; } aside.main ul li a:hover{ background-color: rgba(0, 0, 0, 0.1); } aside.main ul li a::before{ position: absolute; left: 6px; top: 2px; } aside.main ul li a.dashboard::before{ content: url('../img/ic_dashboard_black.svg'); } aside.main ul li a.search::before{ content: url('../img/ic_search_black.svg'); } aside.main ul li a.profile::before{ content: url('../img/ic_account_black.svg'); } aside.main ul li a.logout::before{ content: url('../img/ic_logout_black.svg'); } aside.main ul li a.catalog::before{ content: url('../img/ic_module_black.svg'); left: 5px; } div#content{ top: 64px; position: absolute; min-height: calc(100% - 64px); width: 100%; } input{ border-bottom: 1px solid rgba(0, 0, 0, 0.12); transition: border-bottom 200ms; box-shadow: 0 0 0px 128px white inset; display: block; font-size: 1.2em; color: rgba(0, 0, 0, 0.87); padding: 5px 10px; background-color: transparent; } input:focus{ border-bottom: 1px solid #FF4081; } input:focus::-webkit-input-placeholder{color:#FF80AB;} input:focus:-moz-placeholder{color:#FF80AB;} input:focus::-moz-placeholder{color:#FF80AB;} input:focus:-ms-input-placeholder{color:#FF80AB;} a#floating{ position: fixed; display: block; height: 64px; width: 64px; z-index: 2000; border-radius: 50%; right: 16px; bottom: 16px; background: url('../img/ic_add_white.svg') no-repeat center center; background-size: 32px; background-color: #FF4081; box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.2); } input[type="submit"]{ display: inline-block; background-color: #FF4081; width: auto; padding: 5px 10px; border-radius: 3px; position: absolute; right: 24px; text-transform: uppercase; color: #FFF; box-shadow: 1px 1px 5px 1px rgba(0, 0, 0, 0.2); font-size: 1.09em; cursor: pointer; font-weight: 500; letter-spacing: -0.005em; transition: box-shadow 200ms; -moz-transition: box-shadow 200ms; } input[type="submit"]:active{ box-shadow: 1px 1px 7px 2px rgba(0, 0, 0, 0.2); } #paginate a[href="#"] { visibility: hidden; }
.controls-inputs-row { display: table-row; & > * { display: table-cell; } } .source-inputs { min-width: 12rem; padding-right: 0.3rem; } .source-input-unset { padding-right: 0.5rem; } .source-input-add { padding-left: 0.5rem; }
// // Play Sound.h // Play Sound // // Created by James Badger on 27/10/05. // Copyright 2005 James Badger. All rights reserved. // #import <Cocoa/Cocoa.h> #import <Automator/AMBundleAction.h> @interface Play_Sound : AMBundleAction { bool exitNow; NSSound *file; } - (bool)runWithInput:(id)input fromAction:(AMAction *)anAction error:(NSDictionary **)errorInfo; - (void)stop; @end
cars = 100 space_in_a_car = 4.0 drivers = 30 passengers = 90 cars_not_driven = cars - drivers cars_driven = drivers carpool_capacity = cars_driven * space_in_a_car average_passengers_per_car = passengers / cars_driven puts "There are #{cars} available." puts "There are only #{drivers} available." puts "There will be #{cars_not_driven} empty cars today." puts "We can transport #{carpool_capacity} today." puts "We have #{passengers} to carpool today." puts "We need to put about #{average_passengers_per_car} in each car."
namespace _3.RefactorLoop { using System; class RefactorLoop { static void Main() { int[] array = new int[100]; int expectedValue = 666; // It's not necessary to be 666 :) for (int i = 0; i < array.Length; i++) { Console.WriteLine(array[i]); if (i % 10 == 0) { if (array[i] == expectedValue) { Console.WriteLine("Value Found"); } } } } } }
$(document).ready(function() { $('#mostrar_menu').click(function() { $('#sidebar-wrapper').toggle(300); }); });
#ifndef _ACTION_FIND_TARGET_H #define _ACTION_FIND_TARGET_H #include "action.h" #include "character.h" class ActionFindTarget: public Action { public: ActionFindTarget(Character * character); virtual void Start(); virtual void Run(); virtual void End(); private: Character * m_target; }; #endif//!_ACTION_FIND_TARGET_H
<?php /* * This file is part of Okatea. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $GLOBALS['okt_l10n']['m_contact_recipients'] = 'Destinataires'; $GLOBALS['okt_l10n']['m_contact_recipients_email_address_$s_is_invalid'] = 'L’adresse électronique "%s" est invalide.'; $GLOBALS['okt_l10n']['m_contact_recipients_page_description'] = 'Cette page permet de gérer les destinataires de la page contact.'; $GLOBALS['okt_l10n']['m_contact_recipients_default_recipient_%s'] = 'Si vous n’utilisez pas cette page, le destinataire sera celui du site&nbsp;: %s.'; $GLOBALS['okt_l10n']['m_contact_recipients_copy_hidden_copy'] = 'En plus des destinataires vous pouvez ajouter des destinataires en copie, ainsi que des destinataires en copie cachée.'; $GLOBALS['okt_l10n']['m_contact_recipients_howto_delete_recipent'] = 'Pour supprimer un destinataire, supprimez son adresse.'; $GLOBALS['okt_l10n']['m_contact_recipients_recipient_%s'] = 'Destinataire %s'; $GLOBALS['okt_l10n']['m_contact_recipients_add_recipient'] = 'Ajouter un destinataire'; $GLOBALS['okt_l10n']['m_contact_recipients_copy'] = 'Destinataires en copie'; $GLOBALS['okt_l10n']['m_contact_recipients_copy_%s'] = 'Destinataire %s en copie'; $GLOBALS['okt_l10n']['m_contact_recipients_add_copy'] = 'Ajouter un destinataire en copie'; $GLOBALS['okt_l10n']['m_contact_recipients_hidden_copy'] = 'Destinataires en copie cachée'; $GLOBALS['okt_l10n']['m_contact_recipients_hidden_copy_%s'] = 'Destinataire %s en copie cachée'; $GLOBALS['okt_l10n']['m_contact_recipients_add_hidden_copy'] = 'Ajouter un destinataire en copie cachée';
const { app, BrowserWindow } = require('electron'); const {ipcMain} = require('electron'); // shared to-do list data global.sharedData = { itemList: [ { id: 0, text: "First meet up with David Lau on 5th July", isCompleted: true }, { id: 1, text: "David Bewick meet with David Lau on Monday", isCompleted: true }, { id: 2, text: "David Lau to speak with Kaspar on Wednesday", isCompleted: false } ], itemLatestID: 2 }; // electron main process app.on('ready', () => { const numOfWindows = 3; // number of windows, can grow dynamically var windows = []; for(var i = 0; i < numOfWindows; i++){ const win = new BrowserWindow({ width: 800, height: 600, show: true, }); win.loadURL(`file://${__dirname}/dist/index.html`); // win.openDevTools(); windows.push(win); } ipcMain.on('item-list-update', () => { windows.forEach((win) => { win.webContents.send('refresh-item-data'); }); }); });
<?php namespace Translate\Test\TestCase\Controller\Admin; use Shim\TestSuite\IntegrationTestCase; /** * Translate\Controller\Admin\TranslateDomainsController Test Case * * @uses \Translate\Controller\Admin\TranslateDomainsController */ class TranslateDomainsControllerTest extends IntegrationTestCase { /** * Fixtures * * @var array */ protected $fixtures = [ 'plugin.Translate.TranslateDomains', 'plugin.Translate.TranslateStrings', 'plugin.Translate.TranslateProjects', ]; /** * Test index method * * @return void */ public function testIndex() { $this->disableErrorHandlerMiddleware(); $this->get(['prefix' => 'Admin', 'plugin' => 'Translate', 'controller' => 'TranslateDomains', 'action' => 'index']); $this->assertResponseCode(200); $this->assertNoRedirect(); } /** * Test view method * * @return void */ public function testView() { $this->disableErrorHandlerMiddleware(); $id = 1; $this->get(['prefix' => 'Admin', 'plugin' => 'Translate', 'controller' => 'TranslateDomains', 'action' => 'view', $id]); $this->assertResponseCode(200); $this->assertNoRedirect(); } /** * Test add method * * @return void */ public function testAdd() { $this->disableErrorHandlerMiddleware(); $this->get(['prefix' => 'Admin', 'plugin' => 'Translate', 'controller' => 'TranslateDomains', 'action' => 'add']); $this->assertResponseCode(200); $this->assertNoRedirect(); } /** * Test edit method * * @return void */ public function testEdit() { $this->disableErrorHandlerMiddleware(); $id = 1; $this->get(['prefix' => 'Admin', 'plugin' => 'Translate', 'controller' => 'TranslateDomains', 'action' => 'edit', $id]); $this->assertResponseCode(200); $this->assertNoRedirect(); } /** * Test delete method * * @return void */ public function testDelete() { $this->disableErrorHandlerMiddleware(); $id = 1; $this->post(['prefix' => 'Admin', 'plugin' => 'Translate', 'controller' => 'TranslateDomains', 'action' => 'delete', $id]); $this->assertResponseCode(302); $this->assertRedirect(); } }
-- Omitted = auto-detect. Test UTF-8 without BOM. IMPORT CSV '<FILES>\utf8.csv' INTO table1; SELECT * FROM table1; -- Omitted = auto-detect. Test UTF-8 with BOM. IMPORT CSV '<FILES>\utf8bom.csv' INTO table2; SELECT * FROM table2; -- Omitted = auto-detect. Test UTF-16. IMPORT CSV '<FILES>\utf16.csv' INTO table3; SELECT * FROM table3; -- 0 = auto-detect. Test UTF-8 without BOM. IMPORT CSV '<FILES>\utf8.csv' INTO table4 OPTIONS (FILE_ENCODING: 0); SELECT * FROM table4; -- 0 = auto-detect. Test UTF-8 with BOM. IMPORT CSV '<FILES>\utf8bom.csv' INTO table5 OPTIONS (FILE_ENCODING: 0); SELECT * FROM table5; -- 0 = auto-detect. Test UTF-16. IMPORT CSV '<FILES>\utf16.csv' INTO table6 OPTIONS (FILE_ENCODING: 0); SELECT * FROM table6; -- 65001 = UTF-8. Test without BOM. IMPORT CSV '<FILES>\utf8.csv' INTO table7 OPTIONS (FILE_ENCODING: 65001); SELECT * FROM table7; -- 65001 = UTF-8. Test with BOM. IMPORT CSV '<FILES>\utf8bom.csv' INTO table8 OPTIONS (FILE_ENCODING: 65001); SELECT * FROM table8; -- 1200 = UTF-16 IMPORT CSV '<FILES>\utf16.csv' INTO table9 OPTIONS (FILE_ENCODING: 1200); SELECT * FROM table9; -- 932 = Shift-JIS IMPORT CSV '<FILES>\shiftjis.csv' INTO table10 OPTIONS (FILE_ENCODING: 932); SELECT * FROM table10; --output-- foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - foo,bar 111,HELLO 222,WORLD - 日,本,語 いつ神戸に来るのか教えて下さい,ABC社のガードナー氏は,2月20日から27日までマリオットホテルに滞在中で ぜひあなたに会いたいとのことです,彼は、詩人ではなくて小説家だ,3人のうちの1人が芝刈り機で私の庭を大雑把にさっと刈り -
function generalAttack(attacker, receiver, weaponBonus){ //Weapon bonus of one means attacker gets bonus, 0 = neutral, and -1 = penalty if(attacker.attack > receiver.defense){ if(weaponBonus == 1){ receiver.health = receiver.health - ((attacker.attack + 2) - receiver.defense); }else if(weaponBonus == -1){ receiver.health = receiver.health - ((attacker.attack - 2) - receiver.defense); }else{ receiver.health = receiver.health - (attacker.attack - receiver.defense); } }else { receiver.health -= 2; } } function death(){ console.log("should be dead"); hero.alive = false; } // Global variables, we're all going to hell var healthPlaceholder = 0; var damageTaken = 0; var totalDamageDealt = 0; var totalDamageTaken = 0; var totalKills = 0; var totalTurns = 0; function wolvesAttack() { var wolf = new Character(); wolf.health = 30; wolf.attack = 5; wolf.defense = 5; while(wolf.health > 0 && hero.health > 0) { var chance = Math.floor((Math.random() * 100) + 1); if(chance < 20){ print_to_path(hero.name + " currently has " + hero.health + " health"); healthPlaceholder = hero.health; generalAttack(wolf, hero); damageTaken = healthPlaceholder - hero.health; totalDamageTaken += damageTaken; if(chance % 2 == 0){ print_to_path("A wolf runs up and bites "+hero.name+" for " + damageTaken + " damage"); }else{ print_to_path("A wolf claww "+hero.name+" for " + damageTaken + " damage"); } } else { healthPlaceholder = wolf.health; generalAttack(hero, wolf,0); totalDamageDealt += (healthPlaceholder - wolf.health); print_to_path(hero.name+" attacks the wolf!"); print_to_path("The wolf's health falls to "+wolf.health); } totalTurns += 1; } if(wolf.health <= 0){ console.log("wolf dead"); totalKills += 1; } if(hero.health<= 0){ death(); } } function banditsAttack() { var bandit = new Character(); bandit.health = 40; bandit.attack = 10; bandit.defense = 5; while(bandit.health > 0 && hero.health > 0) { var chance = Math.floor((Math.random() * 100) + 1); if(chance < 30){ print_to_path(hero.name + " currently has " + hero.health + " health"); healthPlaceholder = hero.health; generalAttack(bandit, hero); damageTaken = healthPlaceholder - hero.health; totalDamageTaken += damageTaken; if(chance % 2 == 0){ print_to_path("A clan of bandits knocks "+hero.name+" to the ground dealing " + damageTaken + " Damage"); }else{ print_to_path("A bandit Seaks up from behind stabbs "+hero.name+" dealing " + damageTaken + " Damage"); } } else { healthPlaceholder = bandit.health; if(hero.weapon == "Sword"){ generalAttack(hero, bandit,1); }else if(hero.weapon == "Bow"){ generalAttack(hero, bandit,-1); }else{ generalAttack(hero, bandit,0); } totalDamageDealt += (healthPlaceholder - bandit.health); print_to_path(hero.name+" attacks a bandit!"); print_to_path("The bandit's health falls to "+bandit.health); } totalTurns += 1; } if(bandit.health <= 0){ console.log("bandit dead"); totalKills += 1; } if(hero.health<= 0){ death(); } } function trollsAttack() { var troll = new Character(); troll.health = 50; troll.attack = 25; troll.defense = 15; while(troll.health > 0 && hero.health > 0) { var chance = Math.floor((Math.random() * 100) + 1); if(chance < 35){ print_to_path(hero.name + " currently has " + hero.health + " health"); healthPlaceholder = hero.health; generalAttack(troll, hero); damageTaken = healthPlaceholder - hero.health; totalDamageTaken += damageTaken; if(chance % 2 == 0){ print_to_path("A troll throws a small axe at "+hero.name+" dealing " + damageTaken + " damage"); }else{ print_to_path("A troll smashes "+hero.name+" with his club for " + damageTaken + " damage"); } } else { healthPlaceholder = troll.health; generalAttack(hero, troll); totalDamageDealt += (healthPlaceholder - troll.health); print_to_path(hero.name+" attacks the troll!"); print_to_path("The troll's health falls to "+troll.health); } totalTurns += 1; } if(troll.health <= 0){ console.log("troll dead"); totalKills += 1; } if(hero.health<= 0){ death(); } } function golemsAttack() { var golem = new Character(); golem.health = 60; golem.attack = 10; golem.defense = 50; while(golem.health > 0 && hero.health > 0) { var chance = Math.floor((Math.random() * 100) + 1); if(chance < 20){ print_to_path(hero.name + " currently has " + hero.health + " health"); healthPlaceholder = hero.health; generalAttack(golem, hero); damageTaken = healthPlaceholder - hero.health; totalDamageTaken += damageTaken; if(chance % 2 == 0){ print_to_path("A golem flails its arms, smashing "+hero.name+" into the ground, dealing " + damageTaken + " damage"); }else{ print_to_path("A golem stomps its foot on the ground causing rocks to fall on "+hero.name+" from the nearby mountain. dealing " + damageTaken + " Damage"); } } else { healthPlaceholder = golem.health; if(hero.weapon == "Mace"){ generalAttack(hero, golem,1); }else if(hero.weapon == "Sword"){ generalAttack(hero, golem,-1); }else{ generalAttack(hero, golem,0); } totalDamageDealt += (healthPlaceholder - golem.health); print_to_path(hero.name+" attacks the golem!"); print_to_path("The golem's health falls to "+golem.health); } totalTurns += 1; } if(golem.health <= 0){ console.log("golem dead"); totalKills += 1; } if(hero.health<= 0){ death(); } } function dragonAttack() { // atk 30 var dragon = new Character(); dragon.health = 60; dragon.attack = 30; dragon.defense = 30; while(dragon.health > 0 && hero.health > 0) { var chance = Math.floor((Math.random() * 100) + 1); if(chance < 20){ print_to_path(hero.name + " currently has " + hero.health + " health"); healthPlaceholder = hero.health; generalAttack(dragon, hero); damageTaken = healthPlaceholder - hero.health; totalDamageTaken += damageTaken; if(chance % 2 == 0){ print_to_path("A dragon breaths green flames at "+hero.name+" which inflicted a burn, dealing " + damageTaken + " damage"); }else{ print_to_path("A dragon wipes its tail along the floor flinging "+hero.name+" into the wall, dealing " + damageTaken + " damage"); } } else { healthPlaceholder = dragon.health; if(hero.weapon == "Bow"){ generalAttack(hero, dragon,1); }else if(hero.weapon == "Mace"){ generalAttack(hero, dragon,-1); }else{ generalAttack(hero, dragon,0); } totalDamageDealt += (healthPlaceholder - dragon.health); print_to_path(hero.name+" attacks the dragon!"); print_to_path("The dragon's health falls to: "+dragon.health); } totalTurns += 1; } if(dragon.health <= 0){ console.log("dragon dead"); totalKills += 1; } if(hero.health<= 0){ death(); } } function blackSquirrelAttacks() { // I has no Tail D: } function statistics() { print_to_path("<b>Score:</b>"); print_to_path("Total kills: " + totalKills + " | " + "Total turns: " + totalTurns + " | " + "Total damage dealt: " + totalDamageDealt + " | " + "Total damage taken: " + totalDamageTaken ); }
package com.ernieyu.feedparser; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.InputStream; import java.net.URL; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.ernieyu.feedparser.Feed; import com.ernieyu.feedparser.FeedParser; import com.ernieyu.feedparser.FeedParserFactory; import com.ernieyu.feedparser.FeedType; import com.ernieyu.feedparser.Item; /** * Test case using live feeds. */ public class LiveFeedTestSuite { private final static String BBC_WORLD_NEWS = "http://feeds.bbci.co.uk/news/world/rss.xml"; private final static String NYT_WORLD_NEWS = "http://feeds.nytimes.com/nyt/rss/World"; private final static String USGS_QUAKE_ATOM = "http://earthquake.usgs.gov/earthquakes/catalogs/1hour-M1.xml"; private final static String USGS_QUAKE_RSS = "http://earthquake.usgs.gov/earthquakes/catalogs/eqs1hour-M1.xml"; private final static Logger LOG = Logger.getLogger(LiveFeedTestSuite.class.getName()); private FeedParser feedParser; @Before public void setUp() throws Exception { feedParser = FeedParserFactory.newParser(); } @After public void tearDown() throws Exception { feedParser = null; } /** Test using BBC world news RSS feed. */ @Test public void testBBCNewsRss() { try { // Open input stream for test feed. URL url = new URL(BBC_WORLD_NEWS); InputStream inStream = url.openConnection().getInputStream(); // Parse feed. Feed feed = feedParser.parse(inStream); assertEquals("feed name", "rss", feed.getName()); assertEquals("feed type", FeedType.RSS_2_0, feed.getType()); assertEquals("feed title", "BBC News - World", feed.getTitle()); List<Item> itemList = feed.getItemList(); LOG.log(Level.INFO, "item count = " + itemList.size()); assertTrue("item count", itemList.size() > 0); } catch (Exception ex) { fail(ex.getMessage()); } } /** Test using NY Times world news RSS feed. */ @Test public void testNYTimesRss() { try { // Open input stream for test feed. URL url = new URL(NYT_WORLD_NEWS); InputStream inStream = url.openConnection().getInputStream(); // Parse feed. Feed feed = feedParser.parse(inStream); assertEquals("feed name", "rss", feed.getName()); assertEquals("feed type", FeedType.RSS_2_0, feed.getType()); assertEquals("feed title", "NYT > World", feed.getTitle()); List<Item> itemList = feed.getItemList(); LOG.log(Level.INFO, "item count = " + itemList.size()); assertTrue("item count", itemList.size() > 0); } catch (Exception ex) { fail(ex.getMessage()); } } /** Test using USGS earthquakes Atom feed. */ @Test public void testUSGSQuakesAtom() { try { // Open input stream for test feed. URL url = new URL(USGS_QUAKE_ATOM); InputStream inStream = url.openConnection().getInputStream(); // Parse feed. Feed feed = feedParser.parse(inStream); assertEquals("feed name", "feed", feed.getName()); assertEquals("feed type", FeedType.ATOM_1_0, feed.getType()); assertEquals("feed title", "USGS M 1+ Earthquakes", feed.getTitle()); List<Item> itemList = feed.getItemList(); LOG.log(Level.INFO, "item count = " + itemList.size()); assertTrue("item count", itemList.size() > 0); } catch (Exception ex) { fail(ex.getMessage()); } } /** Test using USGS earthquakes RSS feed. */ @Test public void testUSGSQuakesRss() { try { // Open input stream for test feed. URL url = new URL(USGS_QUAKE_RSS); InputStream inStream = url.openConnection().getInputStream(); // Parse feed. Feed feed = feedParser.parse(inStream); assertEquals("feed name", "rss", feed.getName()); assertEquals("feed type", FeedType.RSS_2_0, feed.getType()); assertEquals("feed title", "USGS M 1+ Earthquakes", feed.getTitle()); List<Item> itemList = feed.getItemList(); LOG.log(Level.INFO, "item count = " + itemList.size()); assertTrue("item count", itemList.size() > 0); } catch (Exception ex) { fail(ex.getMessage()); } } }
<!DOCTYPE html> <!--[if lt IE 7]> <html lang="en" ng-app="lovevApp" ng-strict-di class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html lang="en" ng-app="lovevApp" ng-strict-di class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html lang="en" ng-app="lovevApp" ng-strict-di class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html lang="en" ng-app="lovevApp" ng-strict-di class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>My AngularJS App</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- <link rel="stylesheet" href="libs/html5-boilerplate/css/normalize.css"> <link rel="stylesheet" href="libs/html5-boilerplate/css/main.css"> <link rel="stylesheet" href="app.css"> <script src="libs/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script> --> </head> <body> <!-- <ul class="menu"> <li><a href="#/view1">view1</a></li> <li><a href="#/view2">view2</a></li> </ul> --> <!--[if lt IE 7]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <div> {{"userInfo : " + userInfo.nickName}} <button ng-click="logout()">logout</button> <img src="/ImageCaptchaServlet.servlet"> <input ng-model="veriCode"> <button ng-click="loginByPassword({msisdn:'13916207620',password:'eclipse35',veriCode:'',keep:'1'})"> loginByPassword </button> <button ng-click="loginByAccessCode()">loginByAccessCode</button> </div> <div ng-view></div> <div>Angular seed app: v<span app-version></span></div> <!-- In production use: <script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script> --> <script src="libs/angular/angular.js"></script> <script src="libs/angular-route/angular-route.js"></script> <script src="app.js"></script> <!-- <script src="view1/view1.js"></script> <script src="view2/view2.js"></script> <script src="components/version/version.js"></script> <script src="components/version/version-directive.js"></script> <script src="components/version/interpolate-filter.js"></script> --> <script src="components/user/user.js"></script> </body> </html>
package ro.ubb.samples.structural.facade.point; public class Client { public static void main(String[] args) { // 3. Client uses the Facade Line lineA = new Line(new Point(2, 4), new Point(5, 7)); lineA.move(-2, -4); System.out.println( "after move: " + lineA ); lineA.rotate(45); System.out.println( "after rotate: " + lineA ); Line lineB = new Line( new Point(2, 1), new Point(2.866, 1.5)); lineB.rotate(30); System.out.println("30 degrees to 60 degrees: " + lineB); } }
#!/bin/bash THIS_SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${THIS_SCRIPTDIR}/_bash_utils/utils.sh" source "${THIS_SCRIPTDIR}/_bash_utils/formatted_output.sh" source "${THIS_SCRIPTDIR}/_setup.sh" # init / cleanup the formatted output echo "" > "${formatted_output_file_path}" if [ -z "${BITRISE_SOURCE_DIR}" ]; then write_section_to_formatted_output "# Error" write_section_start_to_formatted_output '* BITRISE_SOURCE_DIR input is missing' exit 1 fi # Update Cocoapods if [[ "${IS_UPDATE_COCOAPODS}" != "false" ]] ; then print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/steps-cocoapods-update/step.sh" else write_section_to_formatted_output "*Skipping Cocoapods version update*" fi print_and_do_command_exit_on_error cd "${BITRISE_SOURCE_DIR}" if [ -n "${GATHER_PROJECTS}" ]; then write_section_to_formatted_output "# Gathering project configurations" # create/cleanup ~/.schemes file echo "" > ~/.schemes if [ ! -z "${REPO_VALIDATOR_SINGLE_BRANCH}" ] ; then write_section_to_formatted_output "*Scanning a single branch: ${REPO_VALIDATOR_SINGLE_BRANCH}*" branches_to_scan=("origin/${REPO_VALIDATOR_SINGLE_BRANCH}") else write_section_to_formatted_output "*Scanning all branches*" branches_to_scan=$(git branch -r | grep -v -- "->") fi echo " (i) branches_to_scan:" echo "${branches_to_scan}" set -e echo "===> Setting up gather-projects dependencies..." SetupGatherProjectsDependencies echo "<=== Dependency setup completed." set +e for branch in ${branches_to_scan} ; do echo echo "==> Switching to branch: ${branch}" # remove every file before switch; except the .git folder print_and_do_command_exit_on_error find . -not -path '*.git/*' -not -path '*.git' -delete # remove the prefix "origin/" from the branch name branch_without_remote=$(printf "%s" "${branch}" | cut -c 8-) echo "Local branch: ${branch_without_remote}" # switch to branch GIT_ASKPASS=echo GIT_SSH="${THIS_SCRIPTDIR}/ssh_no_prompt.sh" git checkout -f "${branch_without_remote}" fail_if_cmd_error "Failed to checkout branch: ${branch_without_remote}" GIT_ASKPASS=echo GIT_SSH="${THIS_SCRIPTDIR}/ssh_no_prompt.sh" git submodule foreach git reset --hard fail_if_cmd_error "Failed to reset submodules" GIT_ASKPASS=echo GIT_SSH="${THIS_SCRIPTDIR}/ssh_no_prompt.sh" git submodule update --init --recursive fail_if_cmd_error "Failed to update submodules" write_section_to_formatted_output "### Switching to branch: ${branch_without_remote}" print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/run_pod_install.sh" print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/find_schemes.sh" "${branch_without_remote}" echo "-> Finished on branch: ${branch}" done else write_section_to_formatted_output "# Run pod install" print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/run_pod_install.sh" fi exit 0
# encoding: utf-8 # xreq_xrep_poll.rb # # It illustrates the use of xs_poll(), as wrapped by the Ruby library, # for detecting and responding to read and write events recorded on sockets. # It also shows how to use XS::NO_BLOCK/XS::DONTWAIT for non-blocking send # and receive. require File.join(File.dirname(__FILE__), '..', 'lib', 'ffi-rxs') def assert(rc) raise "Last API call failed at #{caller(1)}" unless rc >= 0 end link = "tcp://127.0.0.1:5555" begin ctx = XS::Context.new s1 = ctx.socket(XS::XREQ) s2 = ctx.socket(XS::XREP) rescue ContextError => e STDERR.puts "Failed to allocate context or socket" raise end s1.identity = 'socket1.xreq' s2.identity = 'socket2.xrep' assert(s1.setsockopt(XS::LINGER, 100)) assert(s2.setsockopt(XS::LINGER, 100)) assert(s1.bind(link)) assert(s2.connect(link)) poller = XS::Poller.new poller.register_readable(s2) poller.register_writable(s1) start_time = Time.now @unsent = true until @done do assert(poller.poll_nonblock) # send the message after 5 seconds if Time.now - start_time > 5 && @unsent puts "sending payload nonblocking" 5.times do |i| payload = "#{ i.to_s * 40 }" assert(s1.send_string(payload, XS::NonBlocking)) end @unsent = false end # check for messages after 1 second if Time.now - start_time > 1 poller.readables.each do |sock| if sock.identity =~ /xrep/ routing_info = '' assert(sock.recv_string(routing_info, XS::NonBlocking)) puts "routing_info received [#{routing_info}] on socket.identity [#{sock.identity}]" else routing_info = nil received_msg = '' assert(sock.recv_string(received_msg, XS::NonBlocking)) # skip to the next iteration if received_msg is nil; that means we got an EAGAIN next unless received_msg puts "message received [#{received_msg}] on socket.identity [#{sock.identity}]" end while sock.more_parts? do received_msg = '' assert(sock.recv_string(received_msg, XS::NonBlocking)) puts "message received [#{received_msg}]" end puts "kick back a reply" assert(sock.send_string(routing_info, XS::SNDMORE | XS::NonBlocking)) if routing_info time = Time.now.strftime "%Y-%m-%dT%H:%M:%S.#{Time.now.usec}" reply = "reply " + sock.identity.upcase + " #{time}" puts "sent reply [#{reply}], #{time}" assert(sock.send_string(reply)) @done = true poller.register_readable(s1) end end end puts "executed in [#{Time.now - start_time}] seconds" assert(s1.close) assert(s2.close) ctx.terminate
var draw = SVG('mainPage'); var energyBar = draw.rect(0,5).move(0,598) .fill({ color: '#cc0', opacity: '1' }) .stroke({ color: '#fff', width: '1', opacity: '0.6'}); var port = 25550; var images = "http://"+document.location.hostname+":"+port+"/game/images/"; var localPlayers = new Array(); var localBullets = new Array(); var localBonus = new Array(); var bonusBars = new Array(); function PlayerEntity(mark, text) { this.mark = mark; this.text = text; } // Gestion des joueurs socket.on('refreshPlayers', function (players) { for(var i in players) { // Création des nouveaux joueurs if(typeof(localPlayers[i]) === "undefined") { var ownColor = '#fff'; if(players[i].id == socket.socket.sessionid) { // Attribution d'un marqueur de couleur pour le joueur en cours ownColor = '#c00'; } // Création des éléments var circle = draw.circle(6).move(players[i].x,players[i].y) .fill({ color: ownColor, opacity: '1' }) .stroke({ color: '#fff', width: '1' }); var text = draw.text(players[i].pseudo).font({ size: 12 }) .fill({ color: '#fff', opacity: '0.6' }) .stroke({ color: '#fff', width: '1', opacity: '0.4'}); // Déplacement du texte au dessus du marqueur text.move(players[i].x - text.bbox().width /2, players[i].y - text.bbox().height - 10); // Ajout de l'entité au tableau localPlayers[i] = new PlayerEntity(circle, text); } else { // Déplacement du joueur localPlayers[i].mark.move(players[i].x, players[i].y); localPlayers[i].text.move(players[i].x - localPlayers[i].text.bbox().width /2, players[i].y - localPlayers[i].text.bbox().height - 10); // Actualisation du joueur local if(players[i].id == socket.socket.sessionid) { // Affichage du bouton au bon endroit en fonction du mode if(players[i].spec == false) { document.getElementById("b1").style.display = "none"; document.getElementById("b2").style.display = "block"; } else { document.getElementById("b2").style.display = "none"; document.getElementById("b1").style.display = "block"; } // Actualisation de la barre d'énergie if (players[i].energy > 1) { energyBar.width(((players[i].energy-1)/100)*800); } else { energyBar.width(0); } // Actualisation des barres de bonus for(var j in bonusBars) { switch(bonusBars[j].name) { case "speed": bonusBars[j].bar.width(players[i].bSpeed); break; case "arrow": bonusBars[j].bar.width(players[i].bArrow); break; } } } } } }); // Passage en spectateur function _setSpec() { socket.emit('setSpec', 1); } // Ajout d'une barre de bonus socket.on('newPlayerBonus', function (bonus) { // Vérification de la non existence de la barre for(var i in bonusBars) { if(bonusBars[i].name == bonus.name) { return; } } var rect = draw.rect(0,12).move(0,15*(bonusBars.length+1)) .fill({ color: bonus.color, opacity: '0.4' }); bonusBars.push({name: bonus.name, bar: rect}); }); // Rerait d'un joueur socket.on('removePlayer', function (id) { localPlayers[id].mark.remove(); localPlayers[id].text.remove(); localPlayers.splice(id,1); }); // Affichage d'un bonus socket.on('displayBonus', function (bonus) { for(var i in bonus) { // Création des nouveaux bonus if(typeof(localBonus[i]) === "undefined") { localBonus[i] = draw.image(images+""+bonus[i].image+".png") .move(bonus[i].x,bonus[i].y); } } }); // Retrait d'un bonus socket.on('removeBonus', function (bonusID) { if (bonusID == -1) { for(var i in localBonus) { localBonus[i].remove(); } localBonus = []; } else { localBonus[bonusID].remove(); localBonus.splice(bonusID,1); } }); // Rafraichissement du tableau de scores socket.on('refreshScores', function (players) { // Arrangement du tableau en fonction des scores players = players.sort(function(a,b) { return a.points > b.points; }).reverse(); // Formattage de la liste des joueurs var list = "<b>Joueurs en ligne : </b><br />"; var listSpec = "<b>Spectateurs : </b><br />"; for(var i in players) { if(players[i].spec == 0) { if(players[i].alive == 0) { list = list + "<span style='color:#" + players[i].color + "; float:left;'><s>" + players[i].pseudo + "</s></span><span style='float:right;'>- " + players[i].points + " points</span><br />"; } else { list = list + "<span style='color:#" + players[i].color + "; float:left;'>" + players[i].pseudo + "</span><span style='float:right;'>- " + players[i].points + " points</span><br />"; } } else { listSpec = listSpec + "<span style='color:#" + players[i].color + "; float:left;'>" + players[i].pseudo + "</span><br />"; } } // Mise à jour de l'affichage de la liste des joueurs document.getElementById("scores").innerHTML = list; document.getElementById("specs").innerHTML = listSpec; }); // Ajout des nouvelles balles contenues dans le buffer var max = 0; socket.on('refreshBullets', function (bulletTable) { for(var i in bulletTable) { // Création des traces var length = max + i; if(typeof(localBullets[length]) === "undefined") { localBullets[length] = draw.circle(5/*heignt line*/) .move(bulletTable[i].x,bulletTable[i].y) .fill({ color:'#'+bulletTable[i].color }) .stroke({ color: '#fff', width: '1', opacity: '0.5' }); max++; } } }); // Réinitialisation du terrain socket.on('resetGround', function (e) { for(var i in localBullets) { localBullets[i].remove(); } localBullets = []; }); // Arret du serveur socket.on('stopServer', function (e) { window.location.replace("http://"+document.location.hostname+"/?alert=1"); }); // Kick du joueur socket.on('kickPlayer', function (e) { window.location.replace("http://"+document.location.hostname+"/?kick=1"); }); // Gestion d'un nouveau message socket.on('newMessage', function (e) { var tmp = document.getElementById("comments").innerHTML; document.getElementById("comments").innerHTML = "<b>"+e.pseudo+" : </b>"+e.message+"<br />"+tmp; }); // Affichage d'une alerte socket.on('displayAlert', function(text, color, duration) { if(color == '') { color = "#fff"; } if(duration == '') { duration = 1000; } var appear, disappear, deleteAlert, alert = draw.text(text).font({ size: 36 }); appear = function() { alert.move(400-(alert.bbox().width / 2), 100) .fill({ color: color, opacity: '0' }) .animate(100).fill({ opacity: '1' }) .after(disappear); }; disappear = function() { setTimeout(function() { alert.animate(500).fill({ opacity: '0' }).after(deleteAlert); }, duration); }; deleteAlert = function() { alert.remove(); } appear(); }); // Affichage d'une victoire socket.on('displayVictory', function(pseudo) { var appear, disappear, deleteAlert, alert = draw.text("Victoire de "+pseudo+" !").font({ size: 20 }); appear = function() { alert.move(400-(alert.bbox().width / 2), 50) .fill({ color: '#fff', opacity: '0' }) .animate(100).fill({ opacity: '1' }) .after(disappear); }; disappear = function() { setTimeout(function() { alert.animate(500).fill({ opacity: '0' }).after(deleteAlert); }, 1000); }; deleteAlert = function() { alert.remove(); } appear(); });
goog.provide('gmf.DisplayquerygridController'); goog.provide('gmf.displayquerygridDirective'); goog.require('gmf'); goog.require('ngeo.CsvDownload'); goog.require('ngeo.GridConfig'); /** @suppress {extraRequire} */ goog.require('ngeo.gridDirective'); goog.require('ngeo.FeatureOverlay'); goog.require('ngeo.FeatureOverlayMgr'); goog.require('ol.Collection'); goog.require('ol.style.Circle'); goog.require('ol.style.Fill'); goog.require('ol.style.Stroke'); goog.require('ol.style.Style'); ngeo.module.value('gmfDisplayquerygridTemplateUrl', /** * @param {angular.JQLite} element Element. * @param {angular.Attributes} attrs Attributes. * @return {string} Template. */ function(element, attrs) { var templateUrl = attrs['gmfDisplayquerygridTemplateurl']; return templateUrl !== undefined ? templateUrl : gmf.baseTemplateUrl + '/displayquerygrid.html'; }); /** * Provides a directive to display results of the {@link ngeo.queryResult} in a * grid and shows related features on the map using * the {@link ngeo.FeatureOverlayMgr}. * * You can override the default directive's template by setting the * value `gmfDisplayquerygridTemplateUrl`. * * Features displayed on the map use a default style but you can override these * styles by passing ol.style.Style objects as attributes of this directive. * * Example: * * <gmf-displayquerygrid * gmf-displayquerygrid-map="ctrl.map" * gmf-displayquerygrid-featuresstyle="ctrl.styleForAllFeatures" * gmf-displayquerygrid-selectedfeaturestyle="ctrl.styleForTheCurrentFeature"> * </gmf-displayquerygrid> * * @htmlAttribute {boolean} gmf-displayquerygrid-active The active state of the component. * @htmlAttribute {ol.style.Style} gmf-displayquerygrid-featuresstyle A style * object for all features from the result of the query. * @htmlAttribute {ol.style.Style} gmf-displayquerygrid-selectedfeaturestyle A style * object for the currently selected features. * @htmlAttribute {ol.Map} gmf-displayquerygrid-map The map. * @htmlAttribute {boolean?} gmf-displayquerygrid-removeemptycolumns Optional. Should * empty columns be hidden? Default: `false`. * @htmlAttribute {number?} gmf-displayquerygrid-maxrecenterzoom Optional. Maximum * zoom-level to use when zooming to selected features. * @htmlAttribute {gmfx.GridMergeTabs?} gmf-displayquerygrid-gridmergetabas Optional. * Configuration to merge grids with the same attributes into a single grid. * @param {string} gmfDisplayquerygridTemplateUrl URL to a template. * @return {angular.Directive} Directive Definition Object. * @ngInject * @ngdoc directive * @ngname gmfDisplayquerygrid */ gmf.displayquerygridDirective = function( gmfDisplayquerygridTemplateUrl) { return { bindToController: true, controller: 'GmfDisplayquerygridController', controllerAs: 'ctrl', templateUrl: gmfDisplayquerygridTemplateUrl, replace: true, restrict: 'E', scope: { 'active': '=gmfDisplayquerygridActive', 'featuresStyleFn': '&gmfDisplayquerygridFeaturesstyle', 'selectedFeatureStyleFn': '&gmfDisplayquerygridSourceselectedfeaturestyle', 'getMapFn': '&gmfDisplayquerygridMap', 'removeEmptyColumnsFn': '&?gmfDisplayquerygridRemoveemptycolumns', 'maxResultsFn': '&?gmfDisplayquerygridMaxresults', 'maxRecenterZoomFn': '&?gmfDisplayquerygridMaxrecenterzoom', 'mergeTabsFn': '&?gmfDisplayquerygridMergetabs' } }; }; gmf.module.directive('gmfDisplayquerygrid', gmf.displayquerygridDirective); /** * Controller for the query grid. * * @param {!angular.Scope} $scope Angular scope. * @param {ngeox.QueryResult} ngeoQueryResult ngeo query result. * @param {ngeo.FeatureOverlayMgr} ngeoFeatureOverlayMgr The ngeo feature * overlay manager service. * @param {angular.$timeout} $timeout Angular timeout service. * @param {ngeo.CsvDownload} ngeoCsvDownload CSV download service. * @param {ngeo.Query} ngeoQuery Query service. * @param {angular.JQLite} $element Element. * @constructor * @export * @ngInject * @ngdoc Controller * @ngname GmfDisplayquerygridController */ gmf.DisplayquerygridController = function($scope, ngeoQueryResult, ngeoFeatureOverlayMgr, $timeout, ngeoCsvDownload, ngeoQuery, $element) { /** * @type {!angular.Scope} * @private */ this.$scope_ = $scope; /** * @type {angular.$timeout} * @private */ this.$timeout_ = $timeout; /** * @type {ngeox.QueryResult} * @export */ this.ngeoQueryResult = ngeoQueryResult; /** * @type {ngeo.CsvDownload} * @private */ this.ngeoCsvDownload_ = ngeoCsvDownload; /** * @type {angular.JQLite} * @private */ this.$element_ = $element; /** * @type {number} * @export */ this.maxResults = ngeoQuery.getLimit(); /** * @type {boolean} * @export */ this.active = false; /** * @type {boolean} * @export */ this.pending = false; /** * @type {!Object.<string, gmfx.GridSource>} * @export */ this.gridSources = {}; /** * IDs of the grid sources in the order they were loaded. * @type {Array.<string>} * @export */ this.loadedGridSources = []; /** * The id of the currently shown query source. * @type {string|number|null} * @export */ this.selectedTab = null; /** * @type {boolean} * @private */ this.removeEmptyColumns_ = this['removeEmptyColumnsFn'] ? this['removeEmptyColumnsFn']() === true : false; /** * @type {number|undefined} * @export */ this.maxRecenterZoom = this['maxRecenterZoomFn'] ? this['maxRecenterZoomFn']() : undefined; var mergeTabs = this['mergeTabsFn'] ? this['mergeTabsFn']() : {}; /** * @type {!gmfx.GridMergeTabs} * @private */ this.mergeTabs_ = mergeTabs ? mergeTabs : {}; /** * A mapping between row uid and the corresponding feature for each * source. * @type {!Object.<string, Object.<string, ol.Feature>>} * @private */ this.featuresForSources_ = {}; // Styles for displayed features (features) and selected features // (highlightFeatures_) (user can set both styles). /** * @type {ol.Collection} * @private */ this.features_ = new ol.Collection(); var featuresOverlay = ngeoFeatureOverlayMgr.getFeatureOverlay(); var featuresStyle = this['featuresStyleFn'](); if (featuresStyle !== undefined) { goog.asserts.assertInstanceof(featuresStyle, ol.style.Style); featuresOverlay.setStyle(featuresStyle); } featuresOverlay.setFeatures(this.features_); /** * @type {ngeo.FeatureOverlay} * @private */ this.highlightFeatureOverlay_ = ngeoFeatureOverlayMgr.getFeatureOverlay(); /** * @type {ol.Collection} * @private */ this.highlightFeatures_ = new ol.Collection(); this.highlightFeatureOverlay_.setFeatures(this.highlightFeatures_); var highlightFeatureStyle = this['selectedFeatureStyleFn'](); if (highlightFeatureStyle !== undefined) { goog.asserts.assertInstanceof(highlightFeatureStyle, ol.style.Style); } else { var fill = new ol.style.Fill({color: [255, 0, 0, 0.6]}); var stroke = new ol.style.Stroke({color: [255, 0, 0, 1], width: 2}); highlightFeatureStyle = new ol.style.Style({ fill: fill, image: new ol.style.Circle({fill: fill, radius: 5, stroke: stroke}), stroke: stroke, zIndex: 10 }); } this.highlightFeatureOverlay_.setStyle(highlightFeatureStyle); var map = null; var mapFn = this['getMapFn']; if (mapFn) { map = mapFn(); goog.asserts.assertInstanceof(map, ol.Map); } /** * @type {ol.Map} * @private */ this.map_ = map; // Watch the ngeo query result service. this.$scope_.$watchCollection( function() { return ngeoQueryResult; }, function(newQueryResult, oldQueryResult) { if (newQueryResult !== oldQueryResult) { this.updateData_(); } }.bind(this)); /** * An unregister function returned from `$scope.$watchCollection` for * "on-select" changes (when rows are selected/unselected). * @type {?function()} * @private */ this.unregisterSelectWatcher_ = null; }; /** * Returns a list of grid sources in the order they were loaded. * @export * @return {Array.<gmfx.GridSource>} Grid sources. */ gmf.DisplayquerygridController.prototype.getGridSources = function() { return this.loadedGridSources.map(function(sourceId) { return this.gridSources[sourceId]; }.bind(this)); }; /** * @private */ gmf.DisplayquerygridController.prototype.updateData_ = function() { // close if there are no results if (this.ngeoQueryResult.total === 0 && !this.hasOneWithTooManyResults_()) { var oldActive = this.active; this.clear(); if (oldActive) { // don't close if there are pending queries this.active = this.ngeoQueryResult.pending; this.pending = this.ngeoQueryResult.pending; } return; } this.active = true; this.pending = false; var sources = this.ngeoQueryResult.sources; // merge sources if requested if (Object.keys(this.mergeTabs_).length > 0) { sources = this.getMergedSources_(sources); } // create grids (only for source with features or with too many results) sources.forEach(function(source) { if (source.tooManyResults) { this.makeGrid_(null, source); } else { var features = source.features; if (features.length > 0) { this.collectData_(source); } } }.bind(this)); if (this.loadedGridSources.length == 0) { // if no grids were created, do not show this.active = false; return; } // keep the first existing navigation tab open if (this.selectedTab === null || !(('' + this.selectedTab) in this.gridSources)) { // selecting the tab is done in a timeout, because otherwise in rare cases // `ng-class` might set the `active` class on multiple tabs. this.$timeout_(function() { var firstSourceId = this.loadedGridSources[0]; this.selectTab(this.gridSources[firstSourceId]); this.reflowGrid_(firstSourceId); }.bind(this), 0); } }; /** * @private * @return {boolean} If one of the source has too many results. */ gmf.DisplayquerygridController.prototype.hasOneWithTooManyResults_ = function() { return this.ngeoQueryResult.sources.some(function(source) { return source.tooManyResults; }); }; /** * Returns if the given grid source is selected? * @export * @param {gmfx.GridSource} gridSource Grid source. * @return {boolean} Is selected? */ gmf.DisplayquerygridController.prototype.isSelected = function(gridSource) { return this.selectedTab === gridSource.source.id; }; /** * Try to merge the mergable sources. * @param {Array.<ngeox.QueryResultSource>} sources Sources. * @return {Array.<ngeox.QueryResultSource>} The merged sources. * @private */ gmf.DisplayquerygridController.prototype.getMergedSources_ = function(sources) { var allSources = []; /** @type {Object.<string, ngeox.QueryResultSource>} */ var mergedSources = {}; sources.forEach(function(source) { // check if this source can be merged var mergedSource = this.getMergedSource_(source, mergedSources); if (mergedSource === null) { // this source should not be merged, add as is allSources.push(source); } }.bind(this)); for (var mergedSourceId in mergedSources) { allSources.push(mergedSources[mergedSourceId]); } return allSources; }; /** * Check if the given source should be merged. If so, an artificial source * that will contain the features of all mergable sources is returned. If not, * `null` is returned. * @param {ngeox.QueryResultSource} source Source. * @param {Object.<string, ngeox.QueryResultSource>} mergedSources Merged sources. * @return {?ngeox.QueryResultSource} A merged source of null if the source should * not be merged. * @private */ gmf.DisplayquerygridController.prototype.getMergedSource_ = function(source, mergedSources) { var mergeSourceId = null; for (var currentMergeSourceId in this.mergeTabs_) { var sourceIds = this.mergeTabs_[currentMergeSourceId]; var containsSource = sourceIds.some(function(sourceId) { return sourceId == source.id; }); if (containsSource) { mergeSourceId = currentMergeSourceId; break; } } if (mergeSourceId === null) { // this source should not be merged return null; } /** @type {ngeox.QueryResultSource} */ var mergeSource; if (mergeSourceId in mergedSources) { mergeSource = mergedSources[mergeSourceId]; } else { mergeSource = { features: [], id: mergeSourceId, label: mergeSourceId, pending: false, queried: true, tooManyResults: false, totalFeatureCount: undefined }; mergedSources[mergeSourceId] = mergeSource; } // add features of source to merge source source.features.forEach(function(feature) { mergeSource.features.push(feature); }); // if one of the source has too many results, the resulting merged source will // also be marked with `tooManyResults` and will not contain any features. mergeSource.tooManyResults = mergeSource.tooManyResults || source.tooManyResults; if (mergeSource.tooManyResults) { mergeSource.totalFeatureCount = (mergeSource.totalFeatureCount !== undefined) ? mergeSource.totalFeatureCount + mergeSource.features.length : mergeSource.features.length; mergeSource.features = []; } if (source.totalFeatureCount !== undefined) { mergeSource.totalFeatureCount = (mergeSource.totalFeatureCount !== undefined) ? mergeSource.totalFeatureCount + source.totalFeatureCount : source.totalFeatureCount; } return mergeSource; }; /** * Collect all features in the queryResult object. * @param {ngeox.QueryResultSource} source Result source. * @private */ gmf.DisplayquerygridController.prototype.collectData_ = function(source) { var features = source.features; var allProperties = []; var featureGeometriesNames = []; var featuresForSource = {}; var properties, featureGeometryName; features.forEach(function(feature) { properties = feature.getProperties(); if (properties !== undefined) { // Keeps distinct geometry names to remove theme later. featureGeometryName = feature.getGeometryName(); if (featureGeometriesNames.indexOf(featureGeometryName) === -1) { featureGeometriesNames.push(featureGeometryName); } allProperties.push(properties); featuresForSource[ngeo.GridConfig.getRowUid(properties)] = feature; } }.bind(this)); this.cleanProperties_(allProperties, featureGeometriesNames); if (allProperties.length > 0) { var gridCreated = this.makeGrid_(allProperties, source); if (gridCreated) { this.featuresForSources_['' + source.id] = featuresForSource; } } }; /** * Remove all unwanted columns. * @param {Array.<Object>} allProperties A row. * @param {Array.<string>} featureGeometriesNames Geometry names. * @private */ gmf.DisplayquerygridController.prototype.cleanProperties_ = function( allProperties, featureGeometriesNames) { allProperties.forEach(function(properties) { featureGeometriesNames.forEach(function(featureGeometryName) { delete properties[featureGeometryName]; }); delete properties['boundedBy']; }); if (this.removeEmptyColumns_ === true) { this.removeEmptyColumnsFn_(allProperties); } }; /** * Remove columns that will be completely empty between each properties. * @param {Array.<Object>} allProperties A row. * @private */ gmf.DisplayquerygridController.prototype.removeEmptyColumnsFn_ = function( allProperties) { // Keep all keys that correspond to at least one value in a properties object. var keysToKeep = []; var i, key; for (key in allProperties[0]) { for (i = 0; i < allProperties.length; i++) { if (allProperties[i][key] !== undefined) { keysToKeep.push(key); break; } } } // Get all keys that previously always refers always to an empty value. var keyToRemove; allProperties.forEach(function(properties) { keyToRemove = []; for (key in properties) { if (keysToKeep.indexOf(key) === -1) { keyToRemove.push(key); } } // Remove these keys. keyToRemove.forEach(function(key) { delete properties[key]; }); }); }; /** * @param {?Array.<Object>} data Grid rows. * @param {ngeox.QueryResultSource} source Query source. * @return {boolean} Returns true if a grid was created. * @private */ gmf.DisplayquerygridController.prototype.makeGrid_ = function(data, source) { var sourceId = '' + source.id; var gridConfig = null; if (data !== null) { gridConfig = this.getGridConfiguration_(data); if (gridConfig === null) { return false; } } if (this.loadedGridSources.indexOf(sourceId) == -1) { this.loadedGridSources.push(sourceId); } this.gridSources[sourceId] = { configuration: gridConfig, source: source }; return true; }; /** * @param {Array.<!Object>} data Grid rows. * @return {?ngeo.GridConfig} Grid config. * @private */ gmf.DisplayquerygridController.prototype.getGridConfiguration_ = function( data) { goog.asserts.assert(data.length > 0); var columns = Object.keys(data[0]); /** @type {Array.<ngeox.GridColumnDef>} */ var columnDefs = []; columns.forEach(function(column) { if (column !== 'ol_uid') { columnDefs.push(/** @type {ngeox.GridColumnDef} */ ({ name: column })); } }); if (columnDefs.length > 0) { return new ngeo.GridConfig(data, columnDefs); } else { // no columns, do not show grid return null; } }; /** * Remove the current selected feature and source and remove all features * from the map. * @export */ gmf.DisplayquerygridController.prototype.clear = function() { this.active = false; this.pending = false; this.gridSources = {}; this.loadedGridSources = []; this.selectedTab = null; this.tooManyResults = false; this.features_.clear(); this.highlightFeatures_.clear(); this.featuresForSources_ = {}; if (this.unregisterSelectWatcher_) { this.unregisterSelectWatcher_(); } }; /** * Select the tab for the given grid source. * @param {gmfx.GridSource} gridSource Grid source. * @export */ gmf.DisplayquerygridController.prototype.selectTab = function(gridSource) { var source = gridSource.source; this.selectedTab = source.id; if (this.unregisterSelectWatcher_) { this.unregisterSelectWatcher_(); this.unregisterSelectWatcher_ = null; } if (gridSource.configuration !== null) { this.unregisterSelectWatcher_ = this.$scope_.$watchCollection( function() { return gridSource.configuration.selectedRows; }, function(newSelected, oldSelectedRows) { if (Object.keys(newSelected) !== Object.keys(oldSelectedRows)) { this.onSelectionChanged_(); } }.bind(this)); } this.updateFeatures_(gridSource); }; /** * @private * @param {string|number} sourceId Id of the source that should be refreshed. */ gmf.DisplayquerygridController.prototype.reflowGrid_ = function(sourceId) { // this is a "work-around" to make sure that the grid is rendered correctly. // when a pane is activated by setting `this.selectedTab`, the class `active` // is not yet set on the pane. that's why the class is set manually, and // after the pane is shown (in the next digest loop), the grid table can // be refreshed. var activePane = this.$element_.find('div.tab-pane#' + sourceId); activePane.removeClass('active').addClass('active'); this.$timeout_(function() { activePane.find('div.ngeo-grid-table-container table')['trigger']('reflow'); }); }; /** * Called when the row selection has changed. * @private */ gmf.DisplayquerygridController.prototype.onSelectionChanged_ = function() { if (this.selectedTab === null) { return; } var gridSource = this.gridSources['' + this.selectedTab]; this.updateFeatures_(gridSource); }; /** * @param {gmfx.GridSource} gridSource Grid source * @private */ gmf.DisplayquerygridController.prototype.updateFeatures_ = function(gridSource) { this.features_.clear(); this.highlightFeatures_.clear(); if (gridSource.configuration === null) { return; } var sourceId = '' + gridSource.source.id; var featuresForSource = this.featuresForSources_[sourceId]; var selectedRows = gridSource.configuration.selectedRows; for (var rowId in featuresForSource) { var feature = featuresForSource[rowId]; if (rowId in selectedRows) { this.highlightFeatures_.push(feature); } else { this.features_.push(feature); } } }; /** * Get the currently shown grid source. * @export * @return {gmfx.GridSource|null} Grid source. */ gmf.DisplayquerygridController.prototype.getActiveGridSource = function() { if (this.selectedTab === null) { return null; } else { return this.gridSources['' + this.selectedTab]; } }; /** * Returns if a row of the currently active grid is selected? * @export * @return {boolean} Is one selected? */ gmf.DisplayquerygridController.prototype.isOneSelected = function() { var source = this.getActiveGridSource(); if (source === null || source.configuration === null) { return false; } else { return source.configuration.getSelectedCount() > 0; } }; /** * Returns the number of selected rows of the currently active grid. * @export * @return {number} The number of selected rows. */ gmf.DisplayquerygridController.prototype.getSelectedRowCount = function() { var source = this.getActiveGridSource(); if (source === null || source.configuration === null) { return 0; } else { return source.configuration.getSelectedCount(); } }; /** * Select all rows of the currently active grid. * @export */ gmf.DisplayquerygridController.prototype.selectAll = function() { var source = this.getActiveGridSource(); if (source !== null) { source.configuration.selectAll(); } }; /** * Unselect all rows of the currently active grid. * @export */ gmf.DisplayquerygridController.prototype.unselectAll = function() { var source = this.getActiveGridSource(); if (source !== null) { source.configuration.unselectAll(); } }; /** * Invert the selection of the currently active grid. * @export */ gmf.DisplayquerygridController.prototype.invertSelection = function() { var source = this.getActiveGridSource(); if (source !== null) { source.configuration.invertSelection(); } }; /** * Zoom to the selected features. * @export */ gmf.DisplayquerygridController.prototype.zoomToSelection = function() { var source = this.getActiveGridSource(); if (source !== null) { var extent = ol.extent.createEmpty(); this.highlightFeatures_.forEach(function(feature) { ol.extent.extend(extent, feature.getGeometry().getExtent()); }); var mapSize = this.map_.getSize(); goog.asserts.assert(mapSize !== undefined); this.map_.getView().fit(extent, mapSize, {maxZoom: this.maxRecenterZoom}); } }; /** * Start a CSV download for the selected features. * @export */ gmf.DisplayquerygridController.prototype.downloadCsv = function() { var source = this.getActiveGridSource(); if (source !== null) { var columnDefs = source.configuration.columnDefs; goog.asserts.assert(columnDefs !== undefined); var selectedRows = source.configuration.getSelectedRows(); this.ngeoCsvDownload_.startDownload( selectedRows, columnDefs, 'query-results'); } }; gmf.module.controller('GmfDisplayquerygridController', gmf.DisplayquerygridController);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>KlusterKite: KlusterKite.API.Provider.Resolvers.EnumResolver&lt; T &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">KlusterKite &#160;<span id="projectnumber">0.0.0</span> </div> <div id="projectbrief">A framework to create scalable and redundant services based on awesome Akka.Net project.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#properties">Properties</a> &#124; <a href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">KlusterKite.API.Provider.Resolvers.EnumResolver&lt; T &gt; Class Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Resolves a enum value <a href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html#details">More...</a></p> <div class="dynheader"> Inheritance diagram for KlusterKite.API.Provider.Resolvers.EnumResolver&lt; T &gt;:</div> <div class="dyncontent"> <div class="center"> <img src="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.png" usemap="#KlusterKite.API.Provider.Resolvers.EnumResolver_3C_20T_20_3E_map" alt=""/> <map id="KlusterKite.API.Provider.Resolvers.EnumResolver_3C_20T_20_3E_map" name="KlusterKite.API.Provider.Resolvers.EnumResolver_3C_20T_20_3E_map"> <area href="interface_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_i_resolver.html" title="Resolves api requests for an object " alt="KlusterKite.API.Provider.Resolvers.IResolver" shape="rect" coords="0,0,325,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a1f73d097173c5fe77fd23d2c4c40f98e"><td class="memItemLeft" align="right" valign="top">Task&lt; JToken &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html#a1f73d097173c5fe77fd23d2c4c40f98e">ResolveQuery</a> (object source, <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_request.html">ApiRequest</a> request, <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_field.html">ApiField</a> apiField, <a class="el" href="class_kluster_kite_1_1_security_1_1_attributes_1_1_request_context.html">RequestContext</a> context, JsonSerializer argumentsSerializer, Action&lt; Exception &gt; onErrorCallback)</td></tr> <tr class="memdesc:a1f73d097173c5fe77fd23d2c4c40f98e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resolves <a class="el" href="namespace_kluster_kite_1_1_a_p_i.html">API</a> request to object <a href="#a1f73d097173c5fe77fd23d2c4c40f98e">More...</a><br /></td></tr> <tr class="separator:a1f73d097173c5fe77fd23d2c4c40f98e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac49206179cd68f1d214dfbb05b1ac619"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_type.html">ApiType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html#ac49206179cd68f1d214dfbb05b1ac619">GetElementType</a> ()</td></tr> <tr class="memdesc:ac49206179cd68f1d214dfbb05b1ac619"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the resolved api type of resolved element <a href="#ac49206179cd68f1d214dfbb05b1ac619">More...</a><br /></td></tr> <tr class="separator:ac49206179cd68f1d214dfbb05b1ac619"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acf1a076ed6e0b16a15bd84cf2b408f74"><td class="memItemLeft" align="right" valign="top">IEnumerable&lt; <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_field.html">ApiField</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html#acf1a076ed6e0b16a15bd84cf2b408f74">GetTypeArguments</a> ()</td></tr> <tr class="memdesc:acf1a076ed6e0b16a15bd84cf2b408f74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the list of arguments that are supported by resolver itself (not the original object method arguments) <a href="#acf1a076ed6e0b16a15bd84cf2b408f74">More...</a><br /></td></tr> <tr class="separator:acf1a076ed6e0b16a15bd84cf2b408f74"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a> Properties</h2></td></tr> <tr class="memitem:af4dcf4dff79c36f08e5e5183724e3d9c"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_type.html">ApiType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html#af4dcf4dff79c36f08e5e5183724e3d9c">GeneratedType</a><code> [get]</code></td></tr> <tr class="memdesc:af4dcf4dff79c36f08e5e5183724e3d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the generated api type for typed argument <a href="#af4dcf4dff79c36f08e5e5183724e3d9c">More...</a><br /></td></tr> <tr class="separator:af4dcf4dff79c36f08e5e5183724e3d9c"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Resolves a enum value </p> <dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname">T</td><td>The type of enum</td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="_enum_resolver_8cs_source.html#l00032">32</a> of file <a class="el" href="_enum_resolver_8cs_source.html">EnumResolver.cs</a>.</p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="ac49206179cd68f1d214dfbb05b1ac619"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac49206179cd68f1d214dfbb05b1ac619">&#9670;&nbsp;</a></span>GetElementType()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_type.html">ApiType</a> <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html">KlusterKite.API.Provider.Resolvers.EnumResolver</a>&lt; T &gt;.GetElementType </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Gets the resolved api type of resolved element </p> <p>Implements <a class="el" href="interface_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_i_resolver.html#aee7c7ca5cbce746a88d7f0abc64098d7">KlusterKite.API.Provider.Resolvers.IResolver</a>.</p> <p class="definition">Definition at line <a class="el" href="_enum_resolver_8cs_source.html#l00079">79</a> of file <a class="el" href="_enum_resolver_8cs_source.html">EnumResolver.cs</a>.</p> </div> </div> <a id="acf1a076ed6e0b16a15bd84cf2b408f74"></a> <h2 class="memtitle"><span class="permalink"><a href="#acf1a076ed6e0b16a15bd84cf2b408f74">&#9670;&nbsp;</a></span>GetTypeArguments()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">IEnumerable&lt;<a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_field.html">ApiField</a>&gt; <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html">KlusterKite.API.Provider.Resolvers.EnumResolver</a>&lt; T &gt;.GetTypeArguments </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Gets the list of arguments that are supported by resolver itself (not the original object method arguments) </p> <p>Implements <a class="el" href="interface_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_i_resolver.html#ad161ea5a909149028e60d0683dfb591d">KlusterKite.API.Provider.Resolvers.IResolver</a>.</p> <p class="definition">Definition at line <a class="el" href="_enum_resolver_8cs_source.html#l00085">85</a> of file <a class="el" href="_enum_resolver_8cs_source.html">EnumResolver.cs</a>.</p> </div> </div> <a id="a1f73d097173c5fe77fd23d2c4c40f98e"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1f73d097173c5fe77fd23d2c4c40f98e">&#9670;&nbsp;</a></span>ResolveQuery()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Task&lt;JToken&gt; <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html">KlusterKite.API.Provider.Resolvers.EnumResolver</a>&lt; T &gt;.ResolveQuery </td> <td>(</td> <td class="paramtype">object&#160;</td> <td class="paramname"><em>source</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_request.html">ApiRequest</a>&#160;</td> <td class="paramname"><em>request</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_field.html">ApiField</a>&#160;</td> <td class="paramname"><em>apiField</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="class_kluster_kite_1_1_security_1_1_attributes_1_1_request_context.html">RequestContext</a>&#160;</td> <td class="paramname"><em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">JsonSerializer&#160;</td> <td class="paramname"><em>argumentsSerializer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">Action&lt; Exception &gt;&#160;</td> <td class="paramname"><em>onErrorCallback</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Resolves <a class="el" href="namespace_kluster_kite_1_1_a_p_i.html">API</a> request to object </p> <p>Implements <a class="el" href="interface_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_i_resolver.html#a14caed5e2f15a4dda78ac0dfdae75ef7">KlusterKite.API.Provider.Resolvers.IResolver</a>.</p> <p class="definition">Definition at line <a class="el" href="_enum_resolver_8cs_source.html#l00072">72</a> of file <a class="el" href="_enum_resolver_8cs_source.html">EnumResolver.cs</a>.</p> </div> </div> <h2 class="groupheader">Property Documentation</h2> <a id="af4dcf4dff79c36f08e5e5183724e3d9c"></a> <h2 class="memtitle"><span class="permalink"><a href="#af4dcf4dff79c36f08e5e5183724e3d9c">&#9670;&nbsp;</a></span>GeneratedType</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_client_1_1_api_type.html">ApiType</a> <a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html">KlusterKite.API.Provider.Resolvers.EnumResolver</a>&lt; T &gt;.GeneratedType</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">get</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Gets the generated api type for typed argument </p> <p class="definition">Definition at line <a class="el" href="_enum_resolver_8cs_source.html#l00069">69</a> of file <a class="el" href="_enum_resolver_8cs_source.html">EnumResolver.cs</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>KlusterKite.API/KlusterKite.API.Provider/Resolvers/<a class="el" href="_enum_resolver_8cs_source.html">EnumResolver.cs</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespace_kluster_kite.html">KlusterKite</a></li><li class="navelem"><a class="el" href="namespace_kluster_kite_1_1_a_p_i.html">API</a></li><li class="navelem"><a class="el" href="namespace_kluster_kite_1_1_a_p_i_1_1_provider.html">Provider</a></li><li class="navelem"><a class="el" href="namespace_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers.html">Resolvers</a></li><li class="navelem"><a class="el" href="class_kluster_kite_1_1_a_p_i_1_1_provider_1_1_resolvers_1_1_enum_resolver.html">EnumResolver</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html>