code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
4
991
language
stringclasses
9 values
license
stringclasses
15 values
size
int32
3
1.05M
import java.io.IOException; import java.util.Scanner; import iterators.*; import User.User; public class main { public static void zad1(ArrayIterator it){ PredicateCoN pred = new PredicateCoN(4); PredicateCoN pred2 = new PredicateCoN(2); IteratorCoN con = new IteratorCoN(it,pred); IteratorCoN co = new IteratorCoN(con,pred2); System.out.printf("Ostatni element ogólnie: %s\n",((User)it.current()).login); co.last(); System.out.printf("Ostatni element wg iteratora: %s\n",((User)co.current()).login); User pom; while(!co.isDone()) { pom = (User) con.current(); System.out.println(pom.login); co.previous(); } } public static void zad2(ArrayIterator it){ PredicateZad2 pred = new PredicateZad2(); IteratorZad2 zad = new IteratorZad2(it,pred); zad.first(); User pom; while (!zad.isDone()) { pom = (User) zad.current(); System.out.println(pom.login); zad.next(); } } public static void zad3(ArrayIterator it){ PredicateZad3 pred = new PredicateZad3(); IteratorZad3 zad = new IteratorZad3(it,pred); zad.first(); User pom; while (!zad.isDone()) { pom = (User) zad.current(); System.out.println(pom.login); zad.next(); } } public static void main(final String[] args) throws IOException { final int n = 14; User[] tab = new User[n]; Scanner wej = new Scanner(System.in); tab[0] = new User("Andrzej",1000,null,0); tab[1] = new User("Bogdan",-200,tab[0],1); tab[2] = new User("Cyprian",-100,null,2); tab[3] = new User("Dawid",23000,null,3); tab[4] = new User("Ebi",500,tab[2],4); tab[5] = new User("Franek",-60,tab[1],5); tab[6] = new User("George",70,null,6); tab[7] = new User("Henryk",-8,null,7); tab[8] = new User("Ignacy",900,null,8); tab[9] = new User("Ja",900,tab[7],9); tab[10] = new User("Kociao",100,null,10); tab[11] = new User("Lol",-111,tab[10],11); tab[12] = new User("Misiek",120,null,12); tab[13] = new User("Nowy",1300,tab[6],13); ArrayIterator it = new ArrayIterator(tab,0,n); it.last(); System.out.println("Które zadanie chcesz wyœwietliæ?"); int wybor = wej.nextInt(); switch (wybor) { case 1: zad1(it); break; case 2: zad2(it); break; case 3: zad3(it); } wej.close(); } }
superdyzio/PWR-Stuff
INF/Algorytmy i Struktury Danych/zad1/main.java
Java
mit
2,259
import { Component } from 'vidom'; import { DocComponent, DocTabs, DocTab, DocAttrs, DocAttr, DocExample, DocChildren, DocText, DocInlineCode } from '../../Doc'; import SimpleExample from './examples/SimpleExample'; import simpleExampleCode from '!raw!./examples/SimpleExample.js'; export default function ModalDoc({ tab, onTabChange }) { return ( <DocComponent title="Modal"> <DocTabs value={ tab } onTabChange={ onTabChange }> <DocTab title="Examples" value="Examples"> <DocExample title="Simple" code={ simpleExampleCode }> <SimpleExample/> </DocExample> </DocTab> <DocTab title="API" value="api"> <DocAttrs> <DocAttr name="autoclosable" type="Boolean" def="false"> Enables the modal to be hidden on pressing "Esc" or clicking somewhere outside its content. </DocAttr> <DocAttr name="onHide" type="Function"> The callback to handle hide event. </DocAttr> <DocAttr name="theme" type="String" required> Sets the modal theme. </DocAttr> <DocAttr name="visible" type="Boolean" def="false"> Sets the visibility of the modal. </DocAttr> </DocAttrs> <DocChildren> <DocText> Children with any valid type are allowed. </DocText> </DocChildren> </DocTab> </DocTabs> </DocComponent> ); }
dfilatov/vidom-ui
src/components/Modal/doc/index.js
JavaScript
mit
1,817
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Postgrad_alumni_model extends CI_Model { function __construct() { parent::__construct(); $this->load->database(); } public function selectStudent () { $this->db->select("student_id,full_name, p_university_passing_year, email, location"); $this->db->from("students"); $this->db->where('`student_id` != "headcse"'); $this->db->where('`student_id` != "nazmul"'); $this->db->where('LENGTH(`student_id`) > 7'); $this->db->order_by('p_university_admission_year','DESC'); $this->db->order_by('student_id','ASC'); $query = $this->db->get(); return $result = $query->result(); } function selectStudentByYear($a_year, $p_year) { $this->db->select('student_id,full_name, p_university_passing_year, email, location'); $this->db->from("students"); $this->db->where('`student_id` != "headcse"'); $this->db->where('`student_id` != "nazmul"'); $this->db->where('LENGTH(`student_id`) > 7'); if($a_year!=='All'){ $this->db->where('p_university_admission_year',$a_year); } if($p_year!=='All'){ if($p_year==''){ $this->db->where('p_university_passing_year is NULL'); } else { $this->db->where('p_university_passing_year',$p_year); } } $this->db->order_by('p_university_admission_year','DESC'); $this->db->order_by('student_id','ASC'); $query = $this->db->get(); return $query->result(); } public function getPassYear() { $arr=array(); $this->db->select('DISTINCT(p_university_passing_year)'); $this->db->from('students'); $this->db->order_by('p_university_passing_year DESC'); $query = $this->db->get(); foreach($query->result_array() as $row){ $arr[$row['p_university_passing_year']]=$row['p_university_passing_year']; } return $arr; } public function getAddYear() { $arr=array(); $this->db->select('DISTINCT(p_university_admission_year)'); $this->db->from('students'); $this->db->where('p_university_admission_year!=0'); $this->db->order_by('p_university_admission_year DESC'); $query = $this->db->get(); foreach($query->result_array() as $row){ $arr[$row['p_university_admission_year']]=$row['p_university_admission_year']; } return $arr; } function __destruct() { $this->db->close(); } }
nazmule27/alumni
application/models/Postgrad_alumni_model.php
PHP
mit
2,663
// Copyright 2013-2022, University of Colorado Boulder /** * A DOM drawable (div element) that contains child blocks (and is placed in the main DOM tree when visible). It should * use z-index for properly ordering its blocks in the correct stacking order. * * @author Jonathan Olson <jonathan.olson@colorado.edu> */ import toSVGNumber from '../../../dot/js/toSVGNumber.js'; import cleanArray from '../../../phet-core/js/cleanArray.js'; import Poolable from '../../../phet-core/js/Poolable.js'; import { scenery, Utils, Drawable, GreedyStitcher, RebuildStitcher, Stitcher } from '../imports.js'; // constants const useGreedyStitcher = true; class BackboneDrawable extends Drawable { /** * @mixes Poolable * * @param {Display} display * @param {Instance} backboneInstance * @param {Instance} transformRootInstance * @param {number} renderer * @param {boolean} isDisplayRoot */ constructor( display, backboneInstance, transformRootInstance, renderer, isDisplayRoot ) { super(); this.initialize( display, backboneInstance, transformRootInstance, renderer, isDisplayRoot ); } /** * @public * * @param {Display} display * @param {Instance} backboneInstance * @param {Instance} transformRootInstance * @param {number} renderer * @param {boolean} isDisplayRoot */ initialize( display, backboneInstance, transformRootInstance, renderer, isDisplayRoot ) { super.initialize( renderer ); this.display = display; // @public {Instance} - reference to the instance that controls this backbone this.backboneInstance = backboneInstance; // @public {Instance} - where is the transform root for our generated blocks? this.transformRootInstance = transformRootInstance; // @private {Instance} - where have filters been applied to up? our responsibility is to apply filters between this // and our backboneInstance this.filterRootAncestorInstance = backboneInstance.parent ? backboneInstance.parent.getFilterRootInstance() : backboneInstance; // where have transforms been applied up to? our responsibility is to apply transforms between this and our backboneInstance this.transformRootAncestorInstance = backboneInstance.parent ? backboneInstance.parent.getTransformRootInstance() : backboneInstance; this.willApplyTransform = this.transformRootAncestorInstance !== this.transformRootInstance; this.willApplyFilters = this.filterRootAncestorInstance !== this.backboneInstance; this.transformListener = this.transformListener || this.markTransformDirty.bind( this ); if ( this.willApplyTransform ) { this.backboneInstance.relativeTransform.addListener( this.transformListener ); // when our relative transform changes, notify us in the pre-repaint phase this.backboneInstance.relativeTransform.addPrecompute(); // trigger precomputation of the relative transform, since we will always need it when it is updated } this.backboneVisibilityListener = this.backboneVisibilityListener || this.updateBackboneVisibility.bind( this ); this.backboneInstance.relativeVisibleEmitter.addListener( this.backboneVisibilityListener ); this.updateBackboneVisibility(); this.visibilityDirty = true; this.renderer = renderer; this.domElement = isDisplayRoot ? display.domElement : BackboneDrawable.createDivBackbone(); this.isDisplayRoot = isDisplayRoot; this.dirtyDrawables = cleanArray( this.dirtyDrawables ); // Apply CSS needed for future CSS transforms to work properly. Utils.prepareForTransform( this.domElement ); // Ff we need to, watch nodes below us (and including us) and apply their filters (opacity/visibility/clip) to the // backbone. Order will be important, since we'll visit them in the order of filter application this.watchedFilterNodes = cleanArray( this.watchedFilterNodes ); // @private {boolean} this.filterDirty = true; // @private {boolean} this.clipDirty = true; this.filterDirtyListener = this.filterDirtyListener || this.onFilterDirty.bind( this ); this.clipDirtyListener = this.clipDirtyListener || this.onClipDirty.bind( this ); if ( this.willApplyFilters ) { assert && assert( this.filterRootAncestorInstance.trail.nodes.length < this.backboneInstance.trail.nodes.length, 'Our backboneInstance should be deeper if we are applying filters' ); // walk through to see which instances we'll need to watch for filter changes // NOTE: order is important, so that the filters are applied in the correct order! for ( let instance = this.backboneInstance; instance !== this.filterRootAncestorInstance; instance = instance.parent ) { const node = instance.node; this.watchedFilterNodes.push( node ); node.filterChangeEmitter.addListener( this.filterDirtyListener ); node.clipAreaProperty.lazyLink( this.clipDirtyListener ); } } this.lastZIndex = 0; // our last zIndex is stored, so that overlays can be added easily this.blocks = this.blocks || []; // we are responsible for their disposal // the first/last drawables for the last the this backbone was stitched this.previousFirstDrawable = null; this.previousLastDrawable = null; // We track whether our drawables were marked for removal (in which case, they should all be removed by the time we dispose). // If removedDrawables = false during disposal, it means we need to remove the drawables manually (this should only happen if an instance tree is removed) this.removedDrawables = false; this.stitcher = this.stitcher || ( useGreedyStitcher ? new GreedyStitcher() : new RebuildStitcher() ); sceneryLog && sceneryLog.BackboneDrawable && sceneryLog.BackboneDrawable( `initialized ${this.toString()}` ); } /** * Releases references * @public */ dispose() { sceneryLog && sceneryLog.BackboneDrawable && sceneryLog.BackboneDrawable( `dispose ${this.toString()}` ); sceneryLog && sceneryLog.BackboneDrawable && sceneryLog.push(); while ( this.watchedFilterNodes.length ) { const node = this.watchedFilterNodes.pop(); node.filterChangeEmitter.removeListener( this.filterDirtyListener ); node.clipAreaProperty.unlink( this.clipDirtyListener ); } this.backboneInstance.relativeVisibleEmitter.removeListener( this.backboneVisibilityListener ); // if we need to remove drawables from the blocks, do so if ( !this.removedDrawables ) { for ( let d = this.previousFirstDrawable; d !== null; d = d.nextDrawable ) { d.parentDrawable.removeDrawable( d ); if ( d === this.previousLastDrawable ) { break; } } } this.markBlocksForDisposal(); if ( this.willApplyTransform ) { this.backboneInstance.relativeTransform.removeListener( this.transformListener ); this.backboneInstance.relativeTransform.removePrecompute(); } this.backboneInstance = null; this.transformRootInstance = null; this.filterRootAncestorInstance = null; this.transformRootAncestorInstance = null; cleanArray( this.dirtyDrawables ); cleanArray( this.watchedFilterNodes ); this.previousFirstDrawable = null; this.previousLastDrawable = null; super.dispose(); sceneryLog && sceneryLog.BackboneDrawable && sceneryLog.pop(); } /** * Dispose all of the blocks while clearing our references to them * @public */ markBlocksForDisposal() { while ( this.blocks.length ) { const block = this.blocks.pop(); sceneryLog && sceneryLog.BackboneDrawable && sceneryLog.BackboneDrawable( `${this.toString()} removing block: ${block.toString()}` ); //TODO: PERFORMANCE: does this cause reflows / style calculation if ( block.domElement.parentNode === this.domElement ) { // guarded, since we may have a (new) child drawable add it before we can remove it this.domElement.removeChild( block.domElement ); } block.markForDisposal( this.display ); } } /** * @private */ updateBackboneVisibility() { this.visible = this.backboneInstance.relativeVisible; if ( !this.visibilityDirty ) { this.visibilityDirty = true; this.markDirty(); } } /** * Marks this backbone for disposal. * @public * @override * * NOTE: Should be called during syncTree * * @param {Display} display */ markForDisposal( display ) { for ( let d = this.previousFirstDrawable; d !== null; d = d.oldNextDrawable ) { d.notePendingRemoval( this.display ); if ( d === this.previousLastDrawable ) { break; } } this.removedDrawables = true; // super call super.markForDisposal( display ); } /** * Marks a drawable as dirty. * @public * * @param {Drawable} drawable */ markDirtyDrawable( drawable ) { if ( assert ) { // Catch infinite loops this.display.ensureNotPainting(); } this.dirtyDrawables.push( drawable ); this.markDirty(); } /** * Marks our transform as dirty. * @public */ markTransformDirty() { assert && assert( this.willApplyTransform, 'Sanity check for willApplyTransform' ); // relative matrix on backbone instance should be up to date, since we added the compute flags Utils.applyPreparedTransform( this.backboneInstance.relativeTransform.matrix, this.domElement ); } /** * Marks our opacity as dirty. * @private */ onFilterDirty() { if ( !this.filterDirty ) { this.filterDirty = true; this.markDirty(); } } /** * Marks our clip as dirty. * @private */ onClipDirty() { if ( !this.clipDirty ) { this.clipDirty = true; this.markDirty(); } } /** * Updates the DOM appearance of this drawable (whether by preparing/calling draw calls, DOM element updates, etc.) * @public * @override * * @returns {boolean} - Whether the update should continue (if false, further updates in supertype steps should not * be done). */ update() { // See if we need to actually update things (will bail out if we are not dirty, or if we've been disposed) if ( !super.update() ) { return false; } while ( this.dirtyDrawables.length ) { this.dirtyDrawables.pop().update(); } if ( this.filterDirty ) { this.filterDirty = false; let filterString = ''; const len = this.watchedFilterNodes.length; for ( let i = 0; i < len; i++ ) { const node = this.watchedFilterNodes[ i ]; const opacity = node.getEffectiveOpacity(); for ( let j = 0; j < node._filters.length; j++ ) { filterString += `${filterString ? ' ' : ''}${node._filters[ j ].getCSSFilterString()}`; } // Apply opacity after other effects if ( opacity !== 1 ) { filterString += `${filterString ? ' ' : ''}opacity(${toSVGNumber( opacity )})`; } } this.domElement.style.filter = filterString; } if ( this.visibilityDirty ) { this.visibilityDirty = false; this.domElement.style.display = this.visible ? '' : 'none'; } if ( this.clipDirty ) { this.clipDirty = false; // var clip = this.willApplyFilters ? this.getFilterClip() : ''; //OHTWO TODO: CSS clip-path/mask support here. see http://www.html5rocks.com/en/tutorials/masking/adobe/ // this.domElement.style.clipPath = clip; // yikes! temporary, since we already threw something? } return true; } /** * Returns the combined visibility of nodes "above us" that will need to be taken into account for displaying this * backbone. * @public * * @returns {boolean} */ getFilterVisibility() { const len = this.watchedFilterNodes.length; for ( let i = 0; i < len; i++ ) { if ( !this.watchedFilterNodes[ i ].isVisible() ) { return false; } } return true; } /** * Returns the combined clipArea (string???) for nodes "above us". * @public * * @returns {string} */ getFilterClip() { const clip = ''; //OHTWO TODO: proper clipping support // var len = this.watchedFilterNodes.length; // for ( var i = 0; i < len; i++ ) { // if ( this.watchedFilterNodes[i].clipArea ) { // throw new Error( 'clip-path for backbones unimplemented, and with questionable browser support!' ); // } // } return clip; } /** * Ensures that z-indices are strictly increasing, while trying to minimize the number of times we must change it * @public */ reindexBlocks() { // full-pass change for zindex. let zIndex = 0; // don't start below 1 (we ensure > in loop) for ( let k = 0; k < this.blocks.length; k++ ) { const block = this.blocks[ k ]; if ( block.zIndex <= zIndex ) { const newIndex = ( k + 1 < this.blocks.length && this.blocks[ k + 1 ].zIndex - 1 > zIndex ) ? Math.ceil( ( zIndex + this.blocks[ k + 1 ].zIndex ) / 2 ) : zIndex + 20; // NOTE: this should give it its own stacking index (which is what we want) block.domElement.style.zIndex = block.zIndex = newIndex; } zIndex = block.zIndex; if ( assert ) { assert( this.blocks[ k ].zIndex % 1 === 0, 'z-indices should be integers' ); assert( this.blocks[ k ].zIndex > 0, 'z-indices should be greater than zero for our needs (see spec)' ); if ( k > 0 ) { assert( this.blocks[ k - 1 ].zIndex < this.blocks[ k ].zIndex, 'z-indices should be strictly increasing' ); } } } // sanity check this.lastZIndex = zIndex + 1; } /** * Stitches multiple change intervals. * @public * * @param {Drawable} firstDrawable * @param {Drawable} lastDrawable * @param {ChangeInterval} firstChangeInterval * @param {ChangeInterval} lastChangeInterval */ stitch( firstDrawable, lastDrawable, firstChangeInterval, lastChangeInterval ) { // no stitch necessary if there are no change intervals if ( firstChangeInterval === null || lastChangeInterval === null ) { assert && assert( firstChangeInterval === null ); assert && assert( lastChangeInterval === null ); return; } assert && assert( lastChangeInterval.nextChangeInterval === null, 'This allows us to have less checks in the loop' ); if ( sceneryLog && sceneryLog.Stitch ) { sceneryLog.Stitch( `Stitch intervals before constricting: ${this.toString()}` ); sceneryLog.push(); Stitcher.debugIntervals( firstChangeInterval ); sceneryLog.pop(); } // Make the intervals as small as possible by skipping areas without changes, and collapse the interval // linked list let lastNonemptyInterval = null; let interval = firstChangeInterval; let intervalsChanged = false; while ( interval ) { intervalsChanged = interval.constrict() || intervalsChanged; if ( interval.isEmpty() ) { assert && assert( intervalsChanged ); if ( lastNonemptyInterval ) { // skip it, hook the correct reference lastNonemptyInterval.nextChangeInterval = interval.nextChangeInterval; } } else { // our first non-empty interval will be our new firstChangeInterval if ( !lastNonemptyInterval ) { firstChangeInterval = interval; } lastNonemptyInterval = interval; } interval = interval.nextChangeInterval; } if ( !lastNonemptyInterval ) { // eek, no nonempty change intervals. do nothing (good to catch here, but ideally there shouldn't be change // intervals that all collapse). return; } lastChangeInterval = lastNonemptyInterval; lastChangeInterval.nextChangeInterval = null; if ( sceneryLog && sceneryLog.Stitch && intervalsChanged ) { sceneryLog.Stitch( `Stitch intervals after constricting: ${this.toString()}` ); sceneryLog.push(); Stitcher.debugIntervals( firstChangeInterval ); sceneryLog.pop(); } if ( sceneryLog && scenery.isLoggingPerformance() ) { this.display.perfStitchCount++; let dInterval = firstChangeInterval; while ( dInterval ) { this.display.perfIntervalCount++; this.display.perfDrawableOldIntervalCount += dInterval.getOldInternalDrawableCount( this.previousFirstDrawable, this.previousLastDrawable ); this.display.perfDrawableNewIntervalCount += dInterval.getNewInternalDrawableCount( firstDrawable, lastDrawable ); dInterval = dInterval.nextChangeInterval; } } this.stitcher.stitch( this, firstDrawable, lastDrawable, this.previousFirstDrawable, this.previousLastDrawable, firstChangeInterval, lastChangeInterval ); } /** * Runs checks on the drawable, based on certain flags. * @public * @override * * @param {boolean} allowPendingBlock * @param {boolean} allowPendingList * @param {boolean} allowDirty */ audit( allowPendingBlock, allowPendingList, allowDirty ) { if ( assertSlow ) { super.audit( allowPendingBlock, allowPendingList, allowDirty ); assertSlow && assertSlow( this.backboneInstance.isBackbone, 'We should reference an instance that requires a backbone' ); assertSlow && assertSlow( this.transformRootInstance.isTransformed, 'Transform root should be transformed' ); for ( let i = 0; i < this.blocks.length; i++ ) { this.blocks[ i ].audit( allowPendingBlock, allowPendingList, allowDirty ); } } } /** * Creates a base DOM element for a backbone. * @public * * @returns {HTMLDivElement} */ static createDivBackbone() { const div = document.createElement( 'div' ); div.style.position = 'absolute'; div.style.left = '0'; div.style.top = '0'; div.style.width = '0'; div.style.height = '0'; return div; } /** * Given an external element, we apply the necessary style to make it compatible as a backbone DOM element. * @public * * @param {HTMLElement} element * @returns {HTMLElement} - For chaining */ static repurposeBackboneContainer( element ) { if ( element.style.position !== 'relative' || element.style.position !== 'absolute' ) { element.style.position = 'relative'; } element.style.left = '0'; element.style.top = '0'; return element; } } scenery.register( 'BackboneDrawable', BackboneDrawable ); Poolable.mixInto( BackboneDrawable ); export default BackboneDrawable;
phetsims/scenery
js/display/BackboneDrawable.js
JavaScript
mit
18,588
"use strict"; /** * Broadcast updates to client when the model changes */ Object.defineProperty(exports, "__esModule", { value: true }); var product_events_1 = require("./product.events"); // Model events to emit var events = ['save', 'remove']; function register(socket) { // Bind model events to socket events for (var i = 0, eventsLength = events.length; i < eventsLength; i++) { var event = events[i]; var listener = createListener('product:' + event, socket); product_events_1.default.on(event, listener); socket.on('disconnect', removeListener(event, listener)); } } exports.register = register; function createListener(event, socket) { return function (doc) { socket.emit(event, doc); }; } function removeListener(event, listener) { return function () { product_events_1.default.removeListener(event, listener); }; } //# sourceMappingURL=product.socket.js.map
ashwath10110/mfb-new
dist/server/api/product/product.socket.js
JavaScript
mit
944
<?php /** * Genesis Framework. * * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. * Please do all modifications in the form of a child theme. * * @package Genesis\Loops * @author StudioPress * @license GPL-2.0+ * @link http://my.studiopress.com/themes/genesis/ */ add_action( 'genesis_loop', 'genesis_do_loop' ); /** * Attach a loop to the `genesis_loop` output hook so we can get some front-end output. * * @since 1.1.0 */ function genesis_do_loop() { if ( is_page_template( 'page_blog.php' ) ) { $include = genesis_get_option( 'blog_cat' ); $exclude = genesis_get_option( 'blog_cat_exclude' ) ? explode( ',', str_replace( ' ', '', genesis_get_option( 'blog_cat_exclude' ) ) ) : ''; $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; // Easter Egg. $query_args = wp_parse_args( genesis_get_custom_field( 'query_args' ), array( 'cat' => $include, 'category__not_in' => $exclude, 'showposts' => genesis_get_option( 'blog_cat_num' ), 'paged' => $paged, ) ); genesis_custom_loop( $query_args ); } else { genesis_standard_loop(); } } /** * Standard loop, meant to be executed without modification in most circumstances where content needs to be displayed. * * It outputs basic wrapping HTML, but uses hooks to do most of its content output like title, content, post information * and comments. * * The action hooks called are: * * - `genesis_before_entry` * - `genesis_entry_header` * - `genesis_before_entry_content` * - `genesis_entry_content` * - `genesis_after_entry_content` * - `genesis_entry_footer` * - `genesis_after_endwhile` * - `genesis_loop_else` (only if no posts were found) * * @since 1.1.0 * * @return void Return early after legacy loop if not supporting HTML5. */ function genesis_standard_loop() { // Use old loop hook structure if not supporting HTML5. if ( ! genesis_html5() ) { genesis_legacy_loop(); return; } if ( have_posts() ) : do_action( 'genesis_before_while' ); while ( have_posts() ) : the_post(); do_action( 'genesis_before_entry' ); genesis_markup( array( 'open' => '<article %s>', 'context' => 'entry', ) ); do_action( 'genesis_entry_header' ); do_action( 'genesis_before_entry_content' ); printf( '<div %s>', genesis_attr( 'entry-content' ) ); do_action( 'genesis_entry_content' ); echo '</div>'; do_action( 'genesis_after_entry_content' ); do_action( 'genesis_entry_footer' ); genesis_markup( array( 'close' => '</article>', 'context' => 'entry', ) ); do_action( 'genesis_after_entry' ); endwhile; // End of one post. do_action( 'genesis_after_endwhile' ); else : // If no posts exist. do_action( 'genesis_loop_else' ); endif; // End loop. } /** * XHTML loop. * * This is called by {@link genesis_standard_loop()} if the child theme does not support HTML5. * * It is a standard loop, and is meant to be executed, without modification, in most circumstances where content needs * to be displayed. * * It outputs basic wrapping HTML, but uses hooks to do most of its content output like title, content, post information * and comments. * * The action hooks called are: * * - `genesis_before_post` * - `genesis_before_post_title` * - `genesis_post_title` * - `genesis_after_post_title` * - `genesis_before_post_content` * - `genesis_post_content` * - `genesis_after_post_content` * - `genesis_after_post` * - `genesis_after_endwhile` * - `genesis_loop_else` (only if no posts were found) * * @since 2.0.0 * * @global int $loop_counter Increments on each loop pass. */ function genesis_legacy_loop() { global $loop_counter; $loop_counter = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); do_action( 'genesis_before_post' ); printf( '<div class="%s">', implode( ' ', get_post_class() ) ); do_action( 'genesis_before_post_title' ); do_action( 'genesis_post_title' ); do_action( 'genesis_after_post_title' ); do_action( 'genesis_before_post_content' ); echo '<div class="entry-content">'; do_action( 'genesis_post_content' ); echo '</div>'; // End .entry-content. do_action( 'genesis_after_post_content' ); echo '</div>'; // End .entry. do_action( 'genesis_after_post' ); $loop_counter++; endwhile; // End of one post. do_action( 'genesis_after_endwhile' ); else : // If no posts exist. do_action( 'genesis_loop_else' ); endif; // End loop. } /** * Custom loop, meant to be executed when a custom query is needed. * * It accepts arguments in query_posts style format to modify the custom `WP_Query` object. * * It outputs basic wrapping HTML, but uses hooks to do most of its content output like title, content, post information, * and comments. * * The arguments can be passed in via the `genesis_custom_loop_args` filter. * * The action hooks called are the same as {@link genesis_standard_loop()}. * * @since 1.1.0 * * @global WP_Query $wp_query Query object. * @global int $more * * @param array $args Loop configuration. */ function genesis_custom_loop( $args = array() ) { global $wp_query, $more; $defaults = array(); // For forward compatibility. $args = apply_filters( 'genesis_custom_loop_args', wp_parse_args( $args, $defaults ), $args, $defaults ); $wp_query = new WP_Query( $args ); // Only set $more to 0 if we're on an archive. $more = is_singular() ? $more : 0; genesis_standard_loop(); // Restore original query. wp_reset_query(); } /** * The grid loop - a specific implementation of a custom loop. * * Outputs markup compatible with a Feature + Grid style layout. * All normal loop hooks present, except for `genesis_post_content`. * * The arguments can be filtered by the `genesis_grid_loop_args` filter. * * @since 1.5.0 * * @global array $_genesis_loop_args Associative array for grid loop configuration. * * @param array $args Associative array for grid loop configuration. */ function genesis_grid_loop( $args = array() ) { // Global vars. global $_genesis_loop_args; // Parse args. $args = apply_filters( 'genesis_grid_loop_args', wp_parse_args( $args, array( 'features' => 2, 'features_on_all' => false, 'feature_image_size' => 0, 'feature_image_class' => 'alignleft', 'feature_content_limit' => 0, 'grid_image_size' => 'thumbnail', 'grid_image_class' => 'alignleft', 'grid_content_limit' => 0, 'more' => __( 'Read more', 'genesis' ) . '&#x02026;', ) ) ); // If user chose more features than posts per page, adjust features. if ( get_option( 'posts_per_page' ) < $args['features'] ) { $args['features'] = get_option( 'posts_per_page' ); } // What page are we on? $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; // Potentially remove features on page 2+. if ( $paged > 1 && ! $args['features_on_all'] ) { $args['features'] = 0; } // Set global loop args. $_genesis_loop_args = $args; // Remove some unnecessary stuff from the grid loop. remove_action( 'genesis_before_post_title', 'genesis_do_post_format_image' ); remove_action( 'genesis_post_content', 'genesis_do_post_image' ); remove_action( 'genesis_post_content', 'genesis_do_post_content' ); remove_action( 'genesis_post_content', 'genesis_do_post_content_nav' ); remove_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 ); remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 ); remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 ); // Custom loop output. add_filter( 'post_class', 'genesis_grid_loop_post_class' ); add_action( 'genesis_post_content', 'genesis_grid_loop_content' ); add_action( 'genesis_entry_content', 'genesis_grid_loop_content' ); // The loop. genesis_standard_loop(); // Reset loops. genesis_reset_loops(); remove_filter( 'post_class', 'genesis_grid_loop_post_class' ); remove_action( 'genesis_post_content', 'genesis_grid_loop_content' ); remove_action( 'genesis_entry_content', 'genesis_grid_loop_content' ); } /** * Filter the post classes to output custom classes for the feature and grid layout. * * Based on the grid loop args and the loop counter. * * Applies the `genesis_grid_loop_post_class` filter. * * The `&1` is a test to see if it is odd. `2&1 = 0` (even), `3&1 = 1` (odd). * * @since 1.5.0 * * @global array $_genesis_loop_args Associative array for grid loop config. * @global WP_Query $wp_query Query object. * * @param array $classes Existing post classes. * @return array Amended post classes. */ function genesis_grid_loop_post_class( array $classes ) { global $_genesis_loop_args, $wp_query; $grid_classes = array(); if ( $_genesis_loop_args['features'] && $wp_query->current_post < $_genesis_loop_args['features'] ) { $grid_classes[] = 'genesis-feature'; $grid_classes[] = sprintf( 'genesis-feature-%s', $wp_query->current_post + 1 ); $grid_classes[] = $wp_query->current_post&1 ? 'genesis-feature-even' : 'genesis-feature-odd'; } elseif ( $_genesis_loop_args['features']&1 ) { $grid_classes[] = 'genesis-grid'; $grid_classes[] = sprintf( 'genesis-grid-%s', $wp_query->current_post - $_genesis_loop_args['features'] + 1 ); $grid_classes[] = $wp_query->current_post&1 ? 'genesis-grid-odd' : 'genesis-grid-even'; } else { $grid_classes[] = 'genesis-grid'; $grid_classes[] = sprintf( 'genesis-grid-%s', $wp_query->current_post - $_genesis_loop_args['features'] + 1 ); $grid_classes[] = $wp_query->current_post&1 ? 'genesis-grid-even' : 'genesis-grid-odd'; } return array_merge( $classes, apply_filters( 'genesis_grid_loop_post_class', $grid_classes ) ); } /** * Output specially formatted content, based on the grid loop args. * * @since 1.5.0 * * @global array $_genesis_loop_args Associative array for grid loop configuration. */ function genesis_grid_loop_content() { global $_genesis_loop_args; if ( in_array( 'genesis-feature', get_post_class() ) ) { if ( $_genesis_loop_args['feature_image_size'] ) { $image = genesis_get_image( array( 'size' => $_genesis_loop_args['feature_image_size'], 'context' => 'grid-loop-featured', 'attr' => genesis_parse_attr( 'entry-image-grid-loop', array( 'class' => $_genesis_loop_args['feature_image_class'] ) ), ) ); printf( '<a href="%s">%s</a>', get_permalink(), $image ); } if ( $_genesis_loop_args['feature_content_limit'] ) { the_content_limit( (int) $_genesis_loop_args['feature_content_limit'], genesis_a11y_more_link( esc_html( $_genesis_loop_args['more'] ) ) ); } else { the_content( genesis_a11y_more_link( esc_html( $_genesis_loop_args['more'] ) ) ); } } else { if ( $_genesis_loop_args['grid_image_size'] ) { $image = genesis_get_image( array( 'size' => $_genesis_loop_args['grid_image_size'], 'context' => 'grid-loop', 'attr' => genesis_parse_attr( 'entry-image-grid-loop', array( 'class' => $_genesis_loop_args['grid_image_class'] ) ), ) ); printf( '<a href="%s">%s</a>', get_permalink(), $image ); } if ( $_genesis_loop_args['grid_content_limit'] ) { the_content_limit( (int) $_genesis_loop_args['grid_content_limit'], genesis_a11y_more_link( esc_html( $_genesis_loop_args['more'] ) ) ); } else { the_excerpt(); printf( '<a href="%s" class="more-link">%s</a>', get_permalink(), genesis_a11y_more_link( esc_html( $_genesis_loop_args['more'] ) ) ); } } } add_action( 'genesis_after_post', 'genesis_add_id_to_global_exclude' ); add_action( 'genesis_after_entry', 'genesis_add_id_to_global_exclude' ); /** * Modify the global $_genesis_displayed_ids each time a loop iterates. * * Keep track of what posts have been shown on any given page by adding each ID to a global array, which can be used any * time by other loops to prevent posts from being displayed twice on a page. * * @since 2.0.0 * * @global array $_genesis_displayed_ids Array of displayed post IDs. */ function genesis_add_id_to_global_exclude() { global $_genesis_displayed_ids; $_genesis_displayed_ids[] = get_the_ID(); }
growlingfish/giftplatform-bedrock
web/app/themes/genesis/lib/structure/loops.php
PHP
mit
12,384
package app.location; import app.core.BaseEntity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; @NoArgsConstructor @AllArgsConstructor @Getter @Setter @Entity @Table(name = "app_location") public class Location extends BaseEntity { @Column(name = "name") private String name; }
BahodirBoydedayev/conferenceApp
src/main/java/app/location/Location.java
Java
mit
454
/** * vuex-mapstate-modelvalue-instrict- v0.0.4 * (c) 2017 fsy0718 * @license MIT */ 'use strict'; var push = Array.prototype.push; var pop = Array.prototype.pop; var _mapStateModelValueInStrict = function (modelValue, stateName, type, opts, setWithPayload, copts) { if ( opts === void 0 ) opts = {}; if ( copts === void 0 ) copts = {}; if (process.env.NODE_ENV === 'development' && (!modelValue || !stateName || !type)) { throw new Error(("vuex-mapstate-modelvalue-instrict: the " + modelValue + " at least 3 parameters are required")) } var getFn = opts.getFn || copts.getFn; var modulePath = opts.modulePath || copts.modulePath; return { get: function get () { if (getFn) { return getFn(this.$store.state, modelValue, stateName, modulePath) } if (modulePath) { var paths = modulePath.split('/') || []; var result; try { result = paths.reduce(function (r, c) { return r[c] }, this.$store.state); result = result[stateName]; } catch (e) { if (process.env.NODE_ENV === 'development') { throw e } result = undefined; } return result } return this.$store.state[stateName] }, set: function set (value) { var mutation = setWithPayload ? ( obj = {}, obj[stateName] = value, obj ) : value; var obj; var _type = modulePath ? (modulePath + "/" + type) : type; this.$store.commit(_type, mutation, modulePath ? opts.param || copts.param : undefined); } } }; var _mapStateModelValuesInStrict = function () { var args = arguments; var setWithPayload = pop.call(args); var result = {}; if (Array.isArray(args[0])) { var opts = args[1]; args[0].forEach(function (item) { result[item[0]] = _mapStateModelValueInStrict(item[0], item[1], item[2], item[3], setWithPayload, opts); }); } else { result[args[0]] = _mapStateModelValueInStrict(args[0], args[1], args[2], args[3], setWithPayload); } return result }; // mapStateModelValuesInStrict(modelValue, stateName, type, {getFn, setWithPayload, modulePath}}) // mapStateModelValuesInStrict([[modelValue, stateName, type, {getFn1}], [modelValue, stateName, type]], {getFn, setWithPayload}) var mapStateModelValuesInStrictWithPayload = function () { var args = arguments; push.call(arguments, true); return _mapStateModelValuesInStrict.apply(null, args) }; var mapStateModelValuesInStrict = function () { var args = arguments; push.call(arguments, false); return _mapStateModelValuesInStrict.apply(null, args) }; var index = { mapStateModelValuesInStrict: mapStateModelValuesInStrict, mapStateModelValuesInStrictWithPayload: mapStateModelValuesInStrictWithPayload, version: '0.0.4' }; module.exports = index;
fsy0718/mapStateModelInStrict
dist/mapStateModelValueInStrict.common.js
JavaScript
mit
2,832
// The file contents for the current environment will overwrite these during build. // The build system defaults to the dev environment which uses `environment.ts`, but if you do // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `angular-cli.json`. // The file contents for the current environment will overwrite these during build. export var environment = { production: false }; //# sourceMappingURL=C:/Old/Hadron/HadronClient/src/environments/environment.js.map
1729org/Hadron
HadronClient/dist/out-tsc/environments/environment.js
JavaScript
mit
560
<?php namespace DeliciousBrains\WP_Offload_SES\Aws3\Aws\Api\Parser; use DeliciousBrains\WP_Offload_SES\Aws3\Aws\Api\Service; use DeliciousBrains\WP_Offload_SES\Aws3\Aws\Api\StructureShape; use DeliciousBrains\WP_Offload_SES\Aws3\Aws\CommandInterface; use DeliciousBrains\WP_Offload_SES\Aws3\Aws\ResultInterface; use DeliciousBrains\WP_Offload_SES\Aws3\Psr\Http\Message\ResponseInterface; use DeliciousBrains\WP_Offload_SES\Aws3\Psr\Http\Message\StreamInterface; /** * @internal */ abstract class AbstractParser { /** @var \Aws\Api\Service Representation of the service API*/ protected $api; /** @var callable */ protected $parser; /** * @param Service $api Service description. */ public function __construct(\DeliciousBrains\WP_Offload_SES\Aws3\Aws\Api\Service $api) { $this->api = $api; } /** * @param CommandInterface $command Command that was executed. * @param ResponseInterface $response Response that was received. * * @return ResultInterface */ public abstract function __invoke(\DeliciousBrains\WP_Offload_SES\Aws3\Aws\CommandInterface $command, \DeliciousBrains\WP_Offload_SES\Aws3\Psr\Http\Message\ResponseInterface $response); public abstract function parseMemberFromStream(\DeliciousBrains\WP_Offload_SES\Aws3\Psr\Http\Message\StreamInterface $stream, \DeliciousBrains\WP_Offload_SES\Aws3\Aws\Api\StructureShape $member, $response); }
misfit-inc/misfit.co
wp-content/plugins/wp-ses/vendor/Aws3/Aws/Api/Parser/AbstractParser.php
PHP
mit
1,441
var namespace_pathfinder_1_1_internal_1_1_g_u_i = [ [ "ModExtensionsUI", "class_pathfinder_1_1_internal_1_1_g_u_i_1_1_mod_extensions_u_i.html", "class_pathfinder_1_1_internal_1_1_g_u_i_1_1_mod_extensions_u_i" ], [ "ModList", "class_pathfinder_1_1_internal_1_1_g_u_i_1_1_mod_list.html", "class_pathfinder_1_1_internal_1_1_g_u_i_1_1_mod_list" ] ];
Spartan322/Hacknet-Pathfinder
docs/html/namespace_pathfinder_1_1_internal_1_1_g_u_i.js
JavaScript
mit
353
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Compute::Mgmt::V2015_06_15 module Models # # Contains the os disk image information. # class OSDiskImage include MsRestAzure # @return [OperatingSystemTypes] The operating system of the osDiskImage. # Possible values include: 'Windows', 'Linux' attr_accessor :operating_system # # Mapper for OSDiskImage class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'OSDiskImage', type: { name: 'Composite', class_name: 'OSDiskImage', model_properties: { operating_system: { client_side_validation: true, required: true, serialized_name: 'operatingSystem', type: { name: 'Enum', module: 'OperatingSystemTypes' } } } } } end end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_compute/lib/2015-06-15/generated/azure_mgmt_compute/models/osdisk_image.rb
Ruby
mit
1,259
using System; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; using Telegram.Bot.Types.Enums; namespace Telegram.Bot.Types { /// <summary> /// This object contains information about one member of the chat. /// </summary> [JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))] public class ChatMember { /// <summary> /// Information about the user /// </summary> [JsonProperty(Required = Required.Always)] public User User { get; set; } /// <summary> /// The member's status in the chat. /// </summary> [JsonProperty(Required = Required.Always)] public ChatMemberStatus Status { get; set; } /// <summary> /// Optional. Owner and administrators only. Custom title for this user /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public string CustomTitle { get; set; } /// <summary> /// Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, UTC time /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonConverter(typeof(UnixDateTimeConverter))] public DateTime? UntilDate { get; set; } /// <summary> /// Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanBeEdited { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanChangeInfo { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can post in the channel, channels only /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanPostMessages { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can edit messages of other users, channels only /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanEditMessages { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can delete messages of other users /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanDeleteMessages { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can invite new users to the chat /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanInviteUsers { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanRestrictMembers { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can pin messages, supergroups only /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanPinMessages { get; set; } /// <summary> /// Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanPromoteMembers { get; set; } /// <summary> /// Optional. Restricted only. True, if the user is a member of the chat at the moment of the request /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? IsMember { get; set; } /// <summary> /// Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanSendMessages { get; set; } /// <summary> /// Optional. Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies <see cref="CanSendMessages"/> /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanSendMediaMessages { get; set; } /// <summary> /// Optional. Restricted only. True, if the user is allowed to send polls /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanSendPolls { get; set; } /// <summary> /// Optional. Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies <see cref="CanSendMediaMessages"/> /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanSendOtherMessages { get; set; } /// <summary> /// Optional. Restricted only. True, if user may add web page previews to his messages, implies <see cref="CanSendMediaMessages"/> /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? CanAddWebPagePreviews { get; set; } } }
TelegramBots/telegram.bot
src/Telegram.Bot/Types/ChatMember.cs
C#
mit
5,882
<?php return [ /* |-------------------------------------------------------------------------- | Application Debug Mode |-------------------------------------------------------------------------- | | When your application is in debug mode, detailed error messages with | stack traces will be shown on every error that occurs within your | application. If disabled, a simple generic error page is shown. | */ 'debug' => env('APP_DEBUG'), /* |-------------------------------------------------------------------------- | Application URL |-------------------------------------------------------------------------- | | This URL is used by the console to properly generate URLs when using | the Artisan command line tool. You should set this to the root of | your application so that it is used when running Artisan tasks. | */ 'url' => 'http://localhost', /* |-------------------------------------------------------------------------- | Application Timezone |-------------------------------------------------------------------------- | | Here you may specify the default timezone for your application, which | will be used by the PHP date and date-time functions. We have gone | ahead and set this to a sensible default for you out of the box. | */ 'timezone' => 'UTC', /* |-------------------------------------------------------------------------- | Application Locale Configuration |-------------------------------------------------------------------------- | | The application locale determines the default locale that will be used | by the translation service provider. You are free to set this value | to any of the locales which will be supported by the application. | */ 'locale' => 'en', /* |-------------------------------------------------------------------------- | Application Fallback Locale |-------------------------------------------------------------------------- | | The fallback locale determines the locale to use when the current one | is not available. You may change the value to correspond to any of | the language folders that are provided through your application. | */ 'fallback_locale' => 'en', /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | This key is used by the Illuminate encrypter service and should be set | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | */ 'key' => env('APP_KEY', 'SomeRandomString'), 'cipher' => MCRYPT_RIJNDAEL_128, /* |-------------------------------------------------------------------------- | Logging Configuration |-------------------------------------------------------------------------- | | Here you may configure the log settings for your application. Out of | the box, Laravel uses the Monolog PHP logging library. This gives | you a variety of powerful log handlers / formatters to utilize. | | Available Settings: "single", "daily", "syslog", "errorlog" | */ 'log' => 'daily', /* |-------------------------------------------------------------------------- | Autoloaded Service Providers |-------------------------------------------------------------------------- | | The service providers listed here will be automatically loaded on the | request to your application. Feel free to add your own services to | this array to grant expanded functionality to your applications. | */ 'providers' => [ /* * Laravel Framework Service Providers... */ 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Foundation\Providers\FoundationServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Pipeline\PipelineServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', /* * Application Service Providers... */ 'App\Providers\AppServiceProvider', 'App\Providers\BusServiceProvider', 'App\Providers\ConfigServiceProvider', 'App\Providers\EventServiceProvider', 'App\Providers\RouteServiceProvider', 'YAAP\Theme\ThemeServiceProvider', ], /* |-------------------------------------------------------------------------- | Class Aliases |-------------------------------------------------------------------------- | | This array of class aliases will be registered when this application | is started. However, feel free to register as many as you wish as | the aliases are "lazy" loaded so they don't hinder performance. | */ 'aliases' => [ 'App' => 'Illuminate\Support\Facades\App', 'Artisan' => 'Illuminate\Support\Facades\Artisan', 'Auth' => 'Illuminate\Support\Facades\Auth', 'Blade' => 'Illuminate\Support\Facades\Blade', 'Bus' => 'Illuminate\Support\Facades\Bus', 'Cache' => 'Illuminate\Support\Facades\Cache', 'Config' => 'Illuminate\Support\Facades\Config', 'Cookie' => 'Illuminate\Support\Facades\Cookie', 'Crypt' => 'Illuminate\Support\Facades\Crypt', 'DB' => 'Illuminate\Support\Facades\DB', 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 'Event' => 'Illuminate\Support\Facades\Event', 'File' => 'Illuminate\Support\Facades\File', 'Hash' => 'Illuminate\Support\Facades\Hash', 'Input' => 'Illuminate\Support\Facades\Input', 'Inspiring' => 'Illuminate\Foundation\Inspiring', 'Lang' => 'Illuminate\Support\Facades\Lang', 'Log' => 'Illuminate\Support\Facades\Log', 'Mail' => 'Illuminate\Support\Facades\Mail', 'Password' => 'Illuminate\Support\Facades\Password', 'Queue' => 'Illuminate\Support\Facades\Queue', 'Redirect' => 'Illuminate\Support\Facades\Redirect', 'Redis' => 'Illuminate\Support\Facades\Redis', 'Request' => 'Illuminate\Support\Facades\Request', 'Response' => 'Illuminate\Support\Facades\Response', 'Route' => 'Illuminate\Support\Facades\Route', 'Schema' => 'Illuminate\Support\Facades\Schema', 'Session' => 'Illuminate\Support\Facades\Session', 'Storage' => 'Illuminate\Support\Facades\Storage', 'URL' => 'Illuminate\Support\Facades\URL', 'Validator' => 'Illuminate\Support\Facades\Validator', 'View' => 'Illuminate\Support\Facades\View', 'Theme' => 'YAAP\Theme\Facades\Theme', ], ];
sroutier/l5-theme-demo
config/app.php
PHP
mit
7,202
<?php namespace Asad\Core\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class AsadCoreBundle extends Bundle { }
moinulcseduet/symfony-json-version
src/Asad/Core/Bundle/AsadCoreBundle.php
PHP
mit
125
/** * * $Id$ */ package Variation_Diff.validation; /** * A sample validator interface for {@link Variation_Diff.EntityType}. * This doesn't really do anything, and it's not a real EMF artifact. * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended. * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. */ public interface EntityTypeValidator { boolean validate(); boolean validateType(String value); }
catedrasaes-umu/NoSQLDataEngineering
projects/es.um.nosql.s13e.datavisualization/src/Variation_Diff/validation/EntityTypeValidator.java
Java
mit
534
import 'babel-polyfill'; import EdgeGrid from 'edgegrid'; import dotenv from 'dotenv'; import inquirer from 'inquirer'; import formatJson from 'format-json'; import fs from 'fs'; (async function() { // load .env vars dotenv.config(); let papiResponses = new Map(); const edgegrid = new EdgeGrid({ path: process.env.AKA_EDGERC, section: 'default' }); let contractId = await papiChoice( 'Select Akamai contract:', '/papi/v1/contracts', 'contracts', 'contractId', 'contractTypeName' ); let groupId = await papiChoice( 'Select Akamai property group:', '/papi/v1/groups/?contractId=' + contractId, 'groups', 'groupId', 'groupName' ); let propertyId = await papiChoice( 'Select Akamai property:', '/papi/v1/properties/?contractId=' + contractId + '&groupId=' + groupId, 'properties', 'propertyId', 'propertyName' ); let latestVersion = papiResponses.get('properties').properties.items.filter((property) => { return property.propertyId === propertyId; })[0].latestVersion; // request property version let version = await inquirer.prompt([ { type: 'input', name: 'version', message: 'The latest property verions is ' + latestVersion + ', which would you like?', default: latestVersion, validate: (version) => { if (parseInt(version) > 0 && parseInt(version) <= latestVersion) { return true; } else { return 'Please enter a valid version number.'; } } } ]).then(function (answers) { console.log('selected version = ' + answers.version); return answers.version; }); let propertyJson = await callPapi('property', '/papi/v1/properties/' + propertyId + '/versions/' + version + '/rules?contractId=' + contractId + '&groupId=' + groupId).then((data) => { return data; }); let propertyName = papiResponses.get('properties').properties.items.filter((property) => { return property.propertyId === propertyId; })[0].propertyName; await inquirer.prompt([ { type: 'confirm', name: 'outputToFile', message: 'Output property ' + propertyName + ' v' + version + ' json to file now?', default: true, } ]).then(function (answers) { console.log('selected outputToFile = ' + answers.outputToFile); if (answers.outputToFile) { let outputDir = __dirname + '/../papiJson'; if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir); } fs.writeFileSync( outputDir + '/' + propertyName + '-v' + version + '.papi.json', formatJson.plain(propertyJson), 'utf8' ); console.log('\npapi json written to: ./papiJson/' + propertyName + '-v' + version + '.papi.json'); } }); console.log( '\n# ---------------------------------------------------------\n' + '# place the following in .env or set as shell/node env vars\n' + '# if you would like to use these parameters to configure nginx directly\n' + '# from api calls - otherwise point at the generated papi json.\n' + '# refer to start.js and start-local.js\n' + 'AKA_CONTRACT_ID=' + contractId + '\n' + 'AKA_GROUP_ID=' + groupId + '\n' + 'AKA_PROPERTY_ID=' + propertyId + '\n' + 'AKA_PROPERTY_VERSION=' + version + '\n' ); async function papiChoice(message, papiUrl, containerField, valueField, nameField) { let choices = await callPapi(containerField, papiUrl).then((data) => { return data[containerField].items.map((item) => { let choice = {}; choice.name = item[valueField] + ' ' + item[nameField]; choice.value = item[valueField]; return choice; }); }); return await inquirer.prompt([ { type: 'list', name: valueField, message: message, paginated: true, choices: choices } ]).then(function (answers) { console.log('selected ' + valueField + ' = ' + answers[valueField]); return answers[valueField]; }); } async function callPapi(type, papiUrl) { return new Promise( (resolve, reject) => { console.log('calling papi url: ' + papiUrl + '\n'); edgegrid.auth({ path: papiUrl, method: 'GET' }).send((error, response, body) => { if (error) { return reject(error); } let jsonResult = JSON.parse(body); papiResponses.set(type, jsonResult); return resolve(jsonResult); }); }); } })();
wyvern8/akamai-nginx
configure.js
JavaScript
mit
5,154
import {Component, Inject} from "@angular/core"; import {HighLevelComponent, GENERIC_INPUTS, GENERIC_BINDINGS} from "../common/component"; import {REACT_NATIVE_WRAPPER} from "./../../renderer/renderer"; import {ReactNativeWrapper} from "../../wrapper/wrapper"; /** * A component for displaying a tab bar. * * ``` @Component({ selector: 'sample', template: ` <TabBar tintColor="white" barTintColor="darkslateblue"> <TabBarItem systemIcon="history" [selected]="selectedTab == 'one'" (select)="selectedTab='one'"><Text>Tab one</Text></TabBarItem> <TabBarItem systemIcon="favorites" [selected]="selectedTab == 'two'" (select)="selectedTab='two'"><Text>Tab two</Text></TabBarItem> <TabBarItem systemIcon="featured" badge="8" [selected]="selectedTab == 'three'" (select)="selectedTab='three'"><Text>Tab three</Text></TabBarItem> </TabBar> ` }) export class Sample { selectedTab: string = 'one'; } * ``` * @style https://facebook.github.io/react-native/docs/view.html#style * @platform ios */ @Component({ selector: 'TabBar', inputs: [ 'barTintColor', 'itemPositioning', 'tintColor', 'translucent' ].concat(GENERIC_INPUTS), template: `<native-tabbar [barTintColor]="_barTintColor" [itemPositioning]="_itemPositioning" [tintColor]="_tintColor" [translucent]="_translucent" ${GENERIC_BINDINGS}><ng-content></ng-content></native-tabbar>` }) export class TabBar extends HighLevelComponent { constructor(@Inject(REACT_NATIVE_WRAPPER) wrapper: ReactNativeWrapper) { super(wrapper); this.setDefaultStyle({flex: 1}); } //Properties public _barTintColor: number; public _itemPositioning: string; public _tintColor: number; public _translucent: boolean; /** * To be documented */ set barTintColor(value: string) {this._barTintColor = this.processColor(value);} /** * To be documented */ set itemPositioning(value: string) {this._itemPositioning = this.processEnum(value, ['auto', 'fill', 'center']);} /** * To be documented */ set tintColor(value: string) {this._tintColor = this.processColor(value);} /** * To be documented */ set translucent(value: string) {this._translucent = this.processBoolean(value);} }
angular/react-native-renderer
src/components/ios/tabbar.ts
TypeScript
mit
2,193
export default { Control : require('./Control'), Delete : require('./Delete'), Detail : require('./Detail'), Head : require('./Head'), Quit : require('./Quit'), };
czy0729/react-alumni
app/pages/index/UserDetail/containers/index.js
JavaScript
mit
191
$(function() { // column select dw.backend.on('sync-option:base-color', sync); function sync(args) { var chart = args.chart, vis = args.vis, theme_id = chart.get('theme'), labels = getLabels(), $el = $('#'+args.key), $picker = $('.base-color-picker', $el); if (dw.theme(theme_id)) themesAreReady(); else dw.backend.one('theme-loaded', themesAreReady); function themesAreReady() { var theme = dw.theme(theme_id); if (!args.option.hideBaseColorPicker) initBaseColorPicker(); if (!args.option.hideCustomColorSelector) initCustomColorSelector(); /* * initializes the base color dropdown */ function initBaseColorPicker() { var curColor = chart.get('metadata.visualize.'+args.key, 0); if (!_.isString(curColor)) curColor = theme.colors.palette[curColor]; // update base color picker $picker .css('background', curColor) .click(function() { $picker.colorselector({ color: curColor, palette: [].concat(theme.colors.palette, theme.colors.secondary), change: baseColorChanged }); }); function baseColorChanged(color) { $picker.css('background', color); var palIndex = theme.colors.palette.join(',') .toLowerCase() .split(',') .indexOf(color); chart.set( 'metadata.visualize.'+args.key, palIndex < 0 ? color : palIndex ); curColor = color; } } /* * initializes the custom color dialog */ function initCustomColorSelector() { var labels = getLabels(), sel = chart.get('metadata.visualize.custom-colors', {}), $head = $('.custom-color-selector-head', $el), $body = $('.custom-color-selector-body', $el), $customColorBtn = $('.custom', $head), $labelUl = $('.dataseries', $body), $resetAll = $('.reset-all-colors', $body); if (_.isEmpty(labels)) { $head.hide(); return; } $head.show(); $customColorBtn.click(function(e) { e.preventDefault(); $body.toggle(); $customColorBtn.toggleClass('active'); }); $resetAll.click(resetAllColors); // populate custom color selector $.each(labels, addLabelToList); $('.select-all', $body).click(function() { $('li', $labelUl).addClass('selected'); customColorSelectSeries(); }); $('.select-none', $body).click(function() { $('li', $labelUl).removeClass('selected'); customColorSelectSeries(); }); $('.select-invert', $body).click(function() { $('li', $labelUl).toggleClass('selected'); customColorSelectSeries(); }); function addLabelToList(i, lbl) { var s = lbl; if (_.isArray(lbl)) { s = lbl[0]; lbl = lbl[1]; } var li = $('<li data-series="'+s+'"></li>') .append('<div class="color">×</div><label>'+lbl+'</label>') .appendTo($labelUl) .click(click); if (sel[s]) { $('.color', li).html('').css('background', sel[s]); li.data('color', sel[s]); } function click(e) { if (!e.shiftKey) $('li', $labelUl).removeClass('selected'); if (e.shiftKey && li.hasClass('selected')) li.removeClass('selected'); else li.addClass('selected'); customColorSelectSeries(); if (e.shiftKey) { // clear selection if (window.getSelection) { if (window.getSelection().empty) { // Chrome window.getSelection().empty(); } else if (window.getSelection().removeAllRanges) { // Firefox window.getSelection().removeAllRanges(); } } else if (document.selection) { // IE? document.selection.empty(); } } } } // called whenever the user selects a new series function customColorSelectSeries() { var li = $('li.selected', $labelUl), $colPicker = $('.color-picker', $body), $reset = $('.reset-color', $body); if (li.length > 0) { $('.info', $body).hide(); $('.select', $body).show(); $colPicker.click(function() { $colPicker.colorselector({ color: li.data('color'), palette: [].concat(theme.colors.palette, theme.colors.secondary), change: function(color) { $colPicker.css('background', color); update(color); } }); }).css('background', li.data('color') || '#fff'); $reset.off('click').on('click', reset); } else { $('.info', $body).show(); $('.select', $body).hide(); } // set a new color and save function update(color) { var sel = $.extend({}, chart.get('metadata.visualize.custom-colors', {})); $('.color', li) .css('background', color) .html(''); li.data('color', color); li.each(function(i, el) { sel[$(el).data('series')] = color; }); chart.set('metadata.visualize.custom-colors', sel); } // reset selected colors and save function reset() { var sel = $.extend({}, chart.get('metadata.visualize.custom-colors', {})); li.data('color', undefined); $('.color', li) .css('background', '') .html('×'); li.each(function(i, li) { sel[$(li).data('series')] = ''; }); chart.set('metadata.visualize.custom-colors', sel); $colPicker.css('background', '#fff'); } } function resetAllColors() { $('li .color', $labelUl).html('×').css('background', ''); $('li', $labelUl).data('color', undefined); $('.color-picker', $body).css('background', '#fff'); chart.set('metadata.visualize.custom-colors', {}); } } } function getLabels() { return args.option.axis && vis.axes(true)[args.option.axis] ? _.unique(vis.axes(true)[args.option.axis].values()) : (vis.colorKeys ? vis.colorKeys() : vis.keys()); } } });
plusgut/datawrapper
plugins/core-vis-options/static/sync-colorselector.js
JavaScript
mit
8,443
//--------------------------------------------------------------------------------// // COPYRIGHT NOTICE // //--------------------------------------------------------------------------------// // Copyright (c) 2012, Instituto de Microelectronica de Sevilla (IMSE-CNM) // // // // All rights reserved. // // // // Redistribution and use in source and binary forms, with or without // // modification, are permitted provided that the following conditions are met: // // // // * Redistributions of source code must retain the above copyright notice, // // this list of conditions and the following disclaimer. // // // // * Redistributions in binary form must reproduce the above copyright // // notice, this list of conditions and the following disclaimer in the // // documentation and/or other materials provided with the distribution. // // // // * Neither the name of the IMSE-CNM nor the names of its contributors may // // be used to endorse or promote products derived from this software // // without specific prior written permission. // // // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // //--------------------------------------------------------------------------------// package xfuzzy.xfplot; import javax.swing.*; import java.awt.*; /** * Clase que desarrolla el panel para la representación gráfica en 2 * dimensiones * * @author Francisco José Moreno Velo * */ public class Xfplot2DPanel extends JPanel { //----------------------------------------------------------------------------// // CONSTANTES PRIVADAS // //----------------------------------------------------------------------------// /** * Código asociado a la clase serializable */ private static final long serialVersionUID = 95505666603053L; /** * Altura del panel */ private static final int HEIGHT = 500; /** * Anchura del panel */ private static final int WIDTH = 700; //----------------------------------------------------------------------------// // MIEMBROS PRIVADOS // //----------------------------------------------------------------------------// /** * Referencia al apágina principal de la aplicación */ private Xfplot xfplot; //----------------------------------------------------------------------------// // CONSTRUCTOR // //----------------------------------------------------------------------------// /** * Constructor */ public Xfplot2DPanel(Xfplot xfplot) { super(); this.xfplot = xfplot; setSize(new Dimension(WIDTH,HEIGHT)); setPreferredSize(new Dimension(WIDTH,HEIGHT)); setBackground(Color.white); setBorder(BorderFactory.createLoweredBevelBorder()); } //----------------------------------------------------------------------------// // MÉTODOS PÚBLICOS // //----------------------------------------------------------------------------// /** * Pinta la representación gráfica. * Este método sobreescribe el método paint() de JPanel(). */ public void paint(Graphics g) { super.paint(g); paintAxis(g); paintVariables(g); paintFunction(g); } //----------------------------------------------------------------------------// // MÉTODOS PRIVADOS // //----------------------------------------------------------------------------// /** * Dibuja los ejes de la representación gráfica */ private void paintAxis(Graphics g) { int width = getSize().width; int height = getSize().height; int xmin = width/8; int xmax = width*7/8; int ymin = height*7/8; int ymax = height/8; g.drawLine(xmin, ymin, xmin, ymax); g.drawLine(xmin, ymin, xmax, ymin); for(int i=0; i<6; i++) { int y = ymin + (ymax - ymin)*i/5; g.drawLine(xmin-3, y, xmin, y); } for(int i=0; i<6; i++) { int x = xmin + (xmax - xmin)*i/5; g.drawLine(x, ymin+3, x, ymin); } } /** * Dibuja los nombres de las variables a representar */ private void paintVariables(Graphics g) { int width = getSize().width; int height = getSize().height; int xx = width * 9 / 10; int xy = height * 9 / 10; int yx = width / 10; int yy = height / 10; g.drawString(xfplot.getXVariable().toString(), xx, xy); g.drawString(xfplot.getZVariable().toString(), yx, yy); } /** * Dibuja la función en tramos lineales */ private void paintFunction(Graphics g) { double function[] = xfplot.get2DFunction(); if(function == null) return; int x0, y0, x1, y1; int width = getSize().width; int height = getSize().height; int xrange = width * 3 / 4; int yrange = height * 3 / 4; int xmin = width/8; int ymin = height*7/8; Color old = g.getColor(); g.setColor(Color.red); x0 = xmin; y0 = ymin - (int) Math.round(function[0]*yrange); for(int i=1; i<function.length; i++) { x1 = xmin + i*xrange/(function.length-1); y1 = ymin - (int) Math.round(function[i]*yrange); g.drawLine(x0,y0,x1,y1); x0 = x1; y0 = y1; } g.setColor(old); } }
dayse/gesplan
src/xfuzzy/xfplot/Xfplot2DPanel.java
Java
mit
6,711
import Game from '../models/game' class Store { constructor() { const game = new Game({ onTick: () => { this.ui.game.update() } }) const { snake, map } = game this.snake = snake this.map = map this.game = game game.start() this.ui = {} this.data = { map, paused: false } } turnUp = () => { this.snake.turnUp() } turnRight = () => { this.snake.turnRight() } turnDown = () => { this.snake.turnDown() } turnLeft = () => { this.snake.turnLeft() } pauseOrPlay = () => { if (this.game.paused) { this.game.play() this.data.paused = false } else { this.game.pause() this.data.paused = true } this.ui.index.updateSelf() } reset = () => { this.game.reset() } toggleSpeed = () => { this.game.toggleSpeed() } } export default new Store
AlloyTeam/Nuclear
packages/omi-snake/src/stores/index.js
JavaScript
mit
908
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually #pragma once #include <common/common.h> #include <_cash_discount_.hpp> START_ATF_NAMESPACE namespace Info { using _cash_discount_ctor__cash_discount_2_ptr = void (WINAPIV*)(struct _cash_discount_*); using _cash_discount_ctor__cash_discount_2_clbk = void (WINAPIV*)(struct _cash_discount_*, _cash_discount_ctor__cash_discount_2_ptr); using _cash_discount_dtor__cash_discount_4_ptr = void (WINAPIV*)(struct _cash_discount_*); using _cash_discount_dtor__cash_discount_4_clbk = void (WINAPIV*)(struct _cash_discount_*, _cash_discount_dtor__cash_discount_4_ptr); }; // end namespace Info END_ATF_NAMESPACE
goodwinxp/Yorozuya
library/ATF/_cash_discount_Info.hpp
C++
mit
775
class Repositext class Subtitle class Operation # Represents a move right subtitle operation. class MoveRight < Operation def inverse_operation Subtitle::Operation.new_from_hash( affected_stids: inverse_affected_stids, operation_id: '', operation_type: :move_left, ) end # Returns affected stids for inverse operation def inverse_affected_stids affected_stids.map { |e| before, after = e.tmp_attrs[:after], e.tmp_attrs[:before] e.tmp_attrs[:before] = before e.tmp_attrs[:after] = after e } end end end end end
imazen/repositext
lib/repositext/subtitle/operation/move_right.rb
Ruby
mit
709
(function () { 'use strict'; angular.module('app.layout', ['app.core', 'ui.bootstrap.collapse']); })();
Clare-MCR/ClarePunts
src/client/app/layout/layout.module.js
JavaScript
mit
109
<?php namespace Core\UserBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use JMS\Serializer\Annotation as JMS; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; /** * @ORM\Entity * @ORM\Table(name="google_accounts", indexes={@ORM\Index(columns={"user_id"}), @ORM\Index(columns={"followers_count"})}) * @UniqueEntity( * fields={"socialAccountId"}, * message="errors.social_account_exist" * ) * * @JMS\ExclusionPolicy("all") */ class GoogleAccount implements SocialAccountInterface { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") * * @JMS\Expose */ protected $id; /** * @ORM\OneToOne(targetEntity="Core\UserBundle\Entity\User", inversedBy="googleAccount") * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true) */ protected $user; /** * @ORM\Column(type="string") * @Assert\NotBlank(message="errors.global.not_blank") * * @JMS\Groups({"OnlyForAdmin"}) * @JMS\Expose */ protected $name; /** * @ORM\Column(type="string", unique=true) * @Assert\NotBlank(message="errors.global.not_blank") * * @JMS\Groups({"OnlyForAdmin"}) * @JMS\Expose */ protected $email; /** * @ORM\Column(type="string") * @Assert\NotBlank(message="errors.global.not_blank") * * @JMS\Groups({"OnlyForAdmin"}) * @JMS\Expose */ protected $language; /** * @ORM\Column(name="social_account_id", type="string", unique=true) * @Assert\NotBlank(message="errors.global.not_blank") * * @JMS\Groups({"OnlyForAdmin"}) * @JMS\Expose */ protected $socialAccountId; /** * @ORM\Column(name="followers_count", type="integer") * @Assert\NotBlank(message="errors.global.not_blank") * * @JMS\Expose */ protected $followersCount; /** * @ORM\Column(name="youtube_followers_count", type="integer", nullable=true) * * @JMS\Expose */ protected $youtubeFollowersCount; /** * @ORM\Column(name="created_at", type="datetime") * @Assert\NotBlank(message="errors.global.not_blank") * @Assert\DateTime * * @JMS\Groups({"OnlyForAdmin"}) * @JMS\Expose */ protected $createdAt; /** * @ORM\Column(name="updated_at", type="datetime") * @Assert\NotBlank(message="errors.global.not_blank") * @Assert\DateTime * * @JMS\Groups({"OnlyForAdmin"}) * @JMS\Expose */ protected $updatedAt; /** * @ORM\Column(name="youtube_updated_at", type="datetime", nullable=true) * @Assert\DateTime * * @JMS\Groups({"OnlyForAdmin"}) * @JMS\Expose */ protected $youtubeUpdatedAt; public function __construct() { $this->createdAt = new \DateTime(); } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * Set name. * * @param string $name * * @return GoogleAccount */ public function setName($name) { $this->name = $name; return $this; } /** * Get name. * * @return string */ public function getName() { return $this->name; } /** * Set email. * * @param string $email * * @return GoogleAccount */ public function setEmail($email) { $this->email = $email; return $this; } /** * Get email. * * @return string */ public function getEmail() { return $this->email; } /** * Set language. * * @param string $language * * @return GoogleAccount */ public function setLanguage($language) { $this->language = $language; return $this; } /** * Get language. * * @return string */ public function getLanguage() { return $this->language; } /** * Set socialAccountId. * * @param string $socialAccountId * * @return GoogleAccount */ public function setSocialAccountId($socialAccountId) { $this->socialAccountId = $socialAccountId; return $this; } /** * Get socialAccountId. * * @return string */ public function getSocialAccountId() { return $this->socialAccountId; } /** * Set followersCount. * * @param int $followersCount * * @return GoogleAccount */ public function setFollowersCount($followersCount) { $this->followersCount = $followersCount; return $this; } /** * Get followersCount. * * @return int */ public function getFollowersCount() { return $this->followersCount; } /** * Set createdAt. * * @param \DateTime $createdAt * * @return GoogleAccount */ public function setCreatedAt($createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get createdAt. * * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } /** * Set user. * * @param \Core\UserBundle\Entity\User $user * * @return GoogleAccount */ public function setUser(\Core\UserBundle\Entity\User $user = null) { $this->user = $user; return $this; } /** * Get user. * * @return \Core\UserBundle\Entity\User */ public function getUser() { return $this->user; } /** * Set youtubeFollowersCount. * * @param int $youtubeFollowersCount * * @return GoogleAccount */ public function setYoutubeFollowersCount($youtubeFollowersCount) { $this->youtubeFollowersCount = $youtubeFollowersCount; return $this; } /** * Get youtubeFollowersCount. * * @return int */ public function getYoutubeFollowersCount() { return $this->youtubeFollowersCount; } /** * Set updatedAt. * * @param \DateTime $updatedAt * * @return FacebookAccount */ public function setUpdatedAt($updatedAt) { $this->updatedAt = $updatedAt; return $this; } /** * Get updatedAt. * * @return \DateTime */ public function getUpdatedAt() { return $this->updatedAt; } /** * Set youtubeUpdatedAt. * * @param \DateTime $youtubeUpdatedAt * * @return FacebookAccount */ public function setYoutubeUpdatedAt($youtubeUpdatedAt) { $this->youtubeUpdatedAt = $youtubeUpdatedAt; return $this; } /** * Get youtubeUpdatedAt. * * @return \DateTime */ public function getYoutubeUpdatedAt() { return $this->youtubeUpdatedAt; } }
mikecpl/cashforpost
src/Core/UserBundle/Entity/GoogleAccount.php
PHP
mit
7,092
<?php # MantisBT - A PHP based bugtracking system # MantisBT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # MantisBT 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MantisBT. If not, see <http://www.gnu.org/licenses/>. /** * This page displays "improved" charts on categories : categories on bars and 3Dpie * * @package MantisBT * @copyright Copyright 2000 - 2002 Kenzaburo Ito - kenito@300baud.org * @copyright Copyright 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ require_once( 'core.php' ); plugin_require_api( 'core/graph_api.php' ); access_ensure_project_level( config_get( 'view_summary_threshold' ) ); layout_page_header(); layout_page_begin( 'summary_page.php' ); print_summary_menu( 'summary_page.php' ); print_summary_submenu(); $t_series_name = lang_get( 'bugs' ); $t_metrics = create_category_summary(); ?> <div class="col-md-12 col-xs-12"> <div class="space-10"></div> <div class="widget-box widget-color-blue2"> <div class="widget-header widget-header-small"> <h4 class="widget-title lighter"> <i class="ace-icon fa fa-bar-chart-o"></i> <?php echo plugin_lang_get( 'graph_imp_category_title' ) ?> </h4> </div> <?php graph_bar( $t_metrics, lang_get( 'by_category' ), $t_series_name ); # echo '<div class="space-10"></div>'; # graph_pie( $t_metrics, plugin_lang_get( 'by_category_pct' ) ); ?> </div> </div> <?php layout_page_end();
nabusas/Nabu
Mantis/plugins/MantisGraph/pages/category_graph.php
PHP
mit
1,877
/** * @class Oskari.mapframework.bundle.layerselector2.view.PublishedLayersTab * */ Oskari.clazz.define("Oskari.mapframework.bundle.layerselector2.view.PublishedLayersTab", /** * @method create called automatically on construction * @static */ function (instance, title) { //"use strict"; this.instance = instance; this.title = title; this.layerGroups = []; this.layerContainers = {}; this._createUI(); }, { getTitle: function () { //"use strict"; return this.title; }, getTabPanel: function () { //"use strict"; return this.tabPanel; }, getState: function () { //"use strict"; var state = { tab: this.getTitle(), filter: this.filterField.getValue(), groups: [] }; // TODO: groups listing /* var layerGroups = jQuery(this.container).find('div.layerList div.layerGroup.open'); for(var i=0; i < layerGroups.length; ++i) { var group = layerGroups[i]; state.groups.push(jQuery(group).find('.groupName').text()); }*/ return state; }, setState: function (state) { //"use strict"; if (!state) { return; } if (!state.filter) { this.filterField.setValue(state.filter); this.filterLayers(state.filter); } /* TODO: should open panels in this.accordion where groups[i] == panel.title if (state.groups && state.groups.length > 0) { } */ }, _createUI: function () { //"use strict"; var me = this; me.tabPanel = Oskari.clazz.create('Oskari.userinterface.component.TabPanel'); me.tabPanel.setTitle(this.title); me.tabPanel.setSelectionHandler(function (wasSelected) { if (wasSelected) { me.tabSelected(); } else { me.tabUnselected(); } }); me.tabPanel.getContainer().append(this.getFilterField().getField()); me.accordion = Oskari.clazz.create('Oskari.userinterface.component.Accordion'); me.accordion.insertTo(this.tabPanel.getContainer()); }, getFilterField: function () { //"use strict"; if (this.filterField) { return this.filterField; } var me = this, field = Oskari.clazz.create('Oskari.userinterface.component.FormInput'); field.setPlaceholder(me.instance.getLocalization('filter').text); field.addClearButton(); field.bindChange(function (event) { me._searchTrigger(field.getValue()); }, true); field.bindEnterKey(function (event) { me._relatedSearchTrigger(field.getValue()); }); this.filterField = field; return field; }, _searchTrigger: function (keyword) { //"use strict"; var me = this; // clear any previous search if search field changes if (me.searchTimer) { clearTimeout(me.searchTimer); } // if field is was cleared -> do immediately if (!keyword || keyword.length === 0) { me._search(keyword); } else { // else use a small timeout to see if user is typing more me.searchTimer = setTimeout(function () { me._search(keyword); me.searchTimer = undefined; }, 500); } }, _relatedSearchTrigger: function (keyword) { //"use strict"; var me = this; // clear any previous search if search field changes if (me.searchTimer) { clearTimeout(me.searchTimer); } // if field is was cleared -> do immediately /* TODO! if (!keyword || keyword.length === 0) { me._search(keyword); }*/ }, tabSelected: function () { //"use strict"; // update data if now done so yet if (this.layerGroups.length === 0) { this.accordion.showMessage(this.instance.getLocalization('loading')); var me = this, ajaxUrl = this.instance.sandbox.getAjaxUrl(); jQuery.ajax({ type: "GET", dataType: 'json', beforeSend: function (x) { if (x && x.overrideMimeType) { x.overrideMimeType("application/j-son;charset=UTF-8"); } }, url: ajaxUrl + 'action_route=GetPublishedMyPlaceLayers', success: function (pResp) { me._populateLayerGroups(pResp); me.showLayerGroups(me.layerGroups); }, error: function (jqXHR, textStatus) { var loc = me.instance.getLocalization('errors'); me.accordion.showMessage(loc.generic); } }); } }, tabUnselected: function () { //"use strict"; }, /** * @method _getLayerGroups * @private */ _populateLayerGroups: function (jsonResponse) { //"use strict"; var me = this, sandbox = me.instance.getSandbox(), mapLayerService = sandbox.getService('Oskari.mapframework.service.MapLayerService'), userUuid = sandbox.getUser().getUuid(), group = null, n, groupJSON, i, layerJson, layer; this.layerGroups = []; for (n = 0; n < jsonResponse.length; n += 1) { groupJSON = jsonResponse[n]; if (!group || group.getTitle() !== groupJSON.name) { group = Oskari.clazz.create("Oskari.mapframework.bundle.layerselector2.model.LayerGroup", groupJSON.name); this.layerGroups.push(group); } for (i = 0; i < groupJSON.layers.length; i += 1) { layerJson = groupJSON.layers[i]; layer = this._getPublishedLayer(layerJson, mapLayerService, userUuid === groupJSON.id); layer.setDescription(groupJSON.name); // user name as "subtitle" group.addLayer(layer); } } }, /** * @method _getPublishedLayer * Populates the category based data to the base maplayer json * @private * @return maplayer json for the category */ _getPublishedLayer: function (jsonResponse, mapLayerService, usersOwnLayer) { //"use strict"; var baseJson = this._getMapLayerJsonBase(), layer; baseJson.wmsUrl = "/karttatiili/myplaces?myCat=" + jsonResponse.id + "&"; // this.instance.conf.wmsUrl //baseJson.wmsUrl = "/karttatiili/myplaces?myCat=" + categoryModel.getId() + "&"; baseJson.name = jsonResponse.name; baseJson.id = 'myplaces_' + jsonResponse.id; if (usersOwnLayer) { baseJson.permissions = { "publish": "publication_permission_ok" }; } else { baseJson.permissions = { "publish": "no_publication_permission" }; } layer = mapLayerService.createMapLayer(baseJson); if (!usersOwnLayer) { // catch exception if the layer is already added to maplayer service // reloading published layers will crash otherwise // myplaces bundle will add users own layers so we dont even have to try it try { mapLayerService.addLayer(layer); } catch (ignore) { // layer already added, ignore } } return layer; }, /** * @method _getMapLayerJsonBase * Returns a base model for maplayer json to create my places map layer * @private * @return {Object} */ _getMapLayerJsonBase: function () { //"use strict"; var catLoc = this.instance.getLocalization('published'), json = { wmsName: 'ows:my_places_categories', type: "wmslayer", isQueryable: true, opacity: 50, metaType: 'published', orgName: catLoc.organization, inspire: catLoc.inspire }; return json; }, showLayerGroups: function (groups) { //"use strict"; var me = this, i, group, layers, groupContainer, groupPanel, n, layer, layerWrapper, layerContainer, loc, selectedLayers; me.accordion.removeAllPanels(); me.layerContainers = undefined; me.layerContainers = {}; me.layerGroups = groups; for (i = 0; i < groups.length; i += 1) { group = groups[i]; layers = group.getLayers(); groupPanel = Oskari.clazz.create('Oskari.userinterface.component.AccordionPanel'); groupPanel.setTitle(group.getTitle() + ' (' + layers.length + ')'); group.layerListPanel = groupPanel; groupContainer = groupPanel.getContainer(); for (n = 0; n < layers.length; n += 1) { layer = layers[n]; layerWrapper = Oskari.clazz.create('Oskari.mapframework.bundle.layerselector2.view.Layer', layer, me.instance.sandbox, me.instance.getLocalization()); layerContainer = layerWrapper.getContainer(); groupContainer.append(layerContainer); me.layerContainers[layer.getId()] = layerWrapper; } me.accordion.addPanel(groupPanel); } if (me.layerGroups.length === 0) { // empty result loc = me.instance.getLocalization('errors'); me.accordion.showMessage(loc.noResults); } else { selectedLayers = me.instance.sandbox.findAllSelectedMapLayers(); for (i = 0; i < selectedLayers.length; i += 1) { me.setLayerSelected(selectedLayers[i].getId(), true); } } }, /** * @method _search * @private * @param {String} keyword * keyword to filter layers by * Shows and hides layers by comparing the given keyword to the text in layer containers layer-keywords div. * Also checks if all layers in a group is hidden and hides the group as well. */ _search: function (keyword) { //"use strict"; var me = this; if (!keyword || keyword.length === 0) { // show all me.updateLayerContent(); return; } // empty previous me.showLayerGroups([]); me.accordion.showMessage(this.instance.getLocalization('loading')); // search jQuery.ajax({ type: "GET", dataType: 'json', beforeSend: function (x) { if (x && x.overrideMimeType) { x.overrideMimeType("application/j-son;charset=UTF-8"); } }, data: { searchKey: keyword }, url: ajaxUrl + 'action_route=FreeFindFromMyPlaceLayers', success: function (pResp) { me._populateLayerGroups(pResp); me.showLayerGroups(me.layerGroups); }, error: function (jqXHR, textStatus) { var loc = me.instance.getLocalization('errors'); me.accordion.showMessage(loc.generic); } }); // TODO: check if there are no groups visible -> show 'no matches' // notification? }, setLayerSelected: function (layerId, isSelected) { //"use strict"; var layerCont = this.layerContainers[layerId]; if (layerCont) { layerCont.setSelected(isSelected); } }, updateLayerContent: function (layerId, layer) { //"use strict"; // empty the listing to trigger refresh when this tab is selected again this.accordion.removeMessage(); this.showLayerGroups([]); this.tabSelected(); } });
uhef/Oskari-Routing-frontend
bundles/framework/bundle/layerselector2/view/PublishedLayersTab.js
JavaScript
mit
13,634
#!/usr/bin/env python import time from nicfit.aio import Application async def _main(args): print(args) print("Sleeping 2...") time.sleep(2) print("Sleeping 0...") return 0 def atexit(): print("atexit") app = Application(_main, atexit=atexit) app.arg_parser.add_argument("--example", help="Example cli") app.run() assert not"will not execute"
nicfit/nicfit.py
examples/asyncio_example.py
Python
mit
371
require 'spec_helper' describe PolarExpress do context 'Gem Basics' do it "creates a new instance of the gem" do @tracker = PolarExpress.new('DHL', '1234') @tracker.should respond_to :shipping_number end end end
eljojo/polar_express
spec/polar_express/polar_express_spec.rb
Ruby
mit
236
// +build linux darwin freebsd netbsd openbsd solaris package clif import ( "os" "runtime" "syscall" "unsafe" ) func init() { TermWidthCall = func() (int, error) { w := new(termWindow) tio := syscall.TIOCGWINSZ if runtime.GOOS == "darwin" { tio = TERM_TIOCGWINSZ_OSX } res, _, err := syscall.Syscall(sys_ioctl, uintptr(syscall.Stdin), uintptr(tio), uintptr(unsafe.Pointer(w)), ) if err != 0 || int(res) == -1 { return TERM_DEFAULT_WIDTH, os.NewSyscallError("GetWinsize", err) } return int(w.Col) - 4, nil } TermWidthCurrent, _ = TermWidthCall() }
ukautz/clif
term_x.go
GO
mit
591
<?php namespace CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; /** * FriendsGroup * * @ORM\Table(name="friends_group") * @ORM\Entity(repositoryClass="CoreBundle\Repository\FriendsGroupRepository") */ class FriendsGroup { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="Name", type="string", length=255) */ private $name; /** * @var \DateTime * * @ORM\Column(name="DateCreation", type="date") * @Gedmo\Timestampable(on="create") */ private $dateCreation; /** * @var array * * @ORM\ManyToMany(targetEntity="CoreBundle\Entity\Story", mappedBy="groups", cascade={"persist"}) */ private $stories; /** * @var array * * @ORM\ManyToMany(targetEntity="CoreBundle\Entity\Boug", mappedBy="friendsGroups", cascade={"persist"}) */ private $members; /** * @var array * * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\Boug", inversedBy="groupsManaged", cascade={"persist"}) */ private $manager; /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set name * * @param string $name * * @return FriendsGroup */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set dateCreation * * @param \DateTime $dateCreation * * @return FriendsGroup */ public function setDateCreation($dateCreation) { $this->dateCreation = $dateCreation; return $this; } /** * Get dateCreation * * @return \DateTime */ public function getDateCreation() { return $this->dateCreation; } /** * Constructor */ public function __construct() { $this->stories = new \Doctrine\Common\Collections\ArrayCollection(); $this->members = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Add story * * @param \CoreBundle\Entity\Story $story * * @return FriendsGroup */ public function addStory(\CoreBundle\Entity\Story $story) { $this->stories[] = $story; return $this; } /** * Remove story * * @param \CoreBundle\Entity\Story $story */ public function removeStory(\CoreBundle\Entity\Story $story) { $this->stories->removeElement($story); } /** * Get stories * * @return \Doctrine\Common\Collections\Collection */ public function getStories() { return $this->stories; } /** * Add member * * @param \CoreBundle\Entity\Boug $member * * @return FriendsGroup */ public function addMember(\CoreBundle\Entity\Boug $member) { $member->addFriendsGroup($this); $this->members[] = $member; return $this; } /** * Remove member * * @param \CoreBundle\Entity\Boug $member */ public function removeMember(\CoreBundle\Entity\Boug $member) { $group->removeGroup($this); $this->members->removeElement($member); } /** * Get members * * @return \Doctrine\Common\Collections\Collection */ public function getMembers() { return $this->members; } /** * Set manager * * @param \CoreBundle\Entity\Boug $manager * * @return FriendsGroup */ public function setManager(\CoreBundle\Entity\Boug $manager = null) { $this->manager = $manager; return $this; } /** * Get manager * * @return \CoreBundle\Entity\Boug */ public function getManager() { return $this->manager; } }
basileazh/HDB
src/CoreBundle/Entity/FriendsGroup.php
PHP
mit
4,133
export * from './dropdown-treeview-select.module';
leovo2708/ngx-treeview
src/app/dropdown-treeview-select/index.ts
TypeScript
mit
51
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("SWD.Page.Recorder")] [assembly: AssemblyDescription("SWD Page Recorder")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SWD Page Recorder")] [assembly: AssemblyCopyright("Dmytro Zharii 2013 - 2015; License: MIT")] [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("e9df8048-bebd-4007-8c9d-3d2a6fed2de8")] // 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(Build.Version)] [assembly: AssemblyFileVersion(Build.Version)] public class Build { public const string Version = "2015.12.28"; public const string WebDriverVersion = "v2.48"; }
sergueik/swd-recorder
SwdPageRecorder/SwdPageRecorder.UI/Properties/AssemblyInfo.cs
C#
mit
1,581
using System; using System.Net; using System.Net.Sockets; using System.Reflection; using Hik.Communication.Scs.Communication.EndPoints.Tcp; namespace Hik.Communication.Scs.Client.Tcp { /// <summary> /// This class is used to simplify TCP socket operations. /// </summary> internal static class TcpHelper { public static Socket ConnectToServer(ScsTcpEndPoint endPoint, int timeoutMs) { var pc = ProxyConfig.ProxyConfig.GetConfig(); if (pc.ProxyEnable && !string.IsNullOrEmpty(pc.ProxyType) && pc.ProxyType.Equals("HTTP")) { return ConnectViaHttpProxy(endPoint.IpAddress, endPoint.TcpPort, pc.ProxyAddress, pc.ProxyPort, pc.ProxyUserName, pc.ProxyPassword); } return ConnectToServerNoProxy(new IPEndPoint(IPAddress.Parse(endPoint.IpAddress), endPoint.TcpPort), timeoutMs); } /// <summary> /// This code is used to connect to a TCP socket with timeout option. /// </summary> /// <param name="endPoint">IP endpoint of remote server</param> /// <param name="timeoutMs">Timeout to wait until connect</param> /// <returns>Socket object connected to server</returns> /// <exception cref="SocketException">Throws SocketException if can not connect.</exception> /// <exception cref="TimeoutException">Throws TimeoutException if can not connect within specified timeoutMs</exception> public static Socket ConnectToServerNoProxy(EndPoint endPoint, int timeoutMs) { var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { socket.Blocking = false; socket.Connect(endPoint); socket.Blocking = true; return socket; } catch (SocketException socketException) { if (socketException.ErrorCode != 10035) { socket.Close(); throw; } if (!socket.Poll(timeoutMs*1000, SelectMode.SelectWrite)) { socket.Close(); throw new TimeoutException("The host failed to connect. Timeout occured."); } socket.Blocking = true; return socket; } } public static Socket ConnectViaHttpProxy(string targetHost, int targetPort, string httpProxyHost, int httpProxyPort, string proxyUserName, string proxyPassword) { const BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance; var uriBuilder = new UriBuilder { Scheme = Uri.UriSchemeHttp, Host = httpProxyHost, Port = httpProxyPort }; var request = WebRequest.Create("http://" + targetHost + ":" + targetPort); var webProxy = new WebProxy(uriBuilder.Uri); request.Proxy = webProxy; request.Method = "CONNECT"; webProxy.Credentials = new NetworkCredential(proxyUserName, proxyPassword); var response = request.GetResponse(); var responseStream = response.GetResponseStream(); if (responseStream == null) throw new ArgumentNullException(nameof(responseStream)); var rsType = responseStream.GetType(); var connectionProperty = rsType.GetProperty("Connection", flags); var connection = connectionProperty.GetValue(responseStream, null); var connectionType = connection.GetType(); var networkStreamProperty = connectionType.GetProperty("NetworkStream", flags); var networkStream = networkStreamProperty.GetValue(connection, null); var nsType = networkStream.GetType(); var socketProperty = nsType.GetProperty("Socket", flags); return (Socket) socketProperty.GetValue(networkStream, null); } } }
huhen/scs
src/Scs/Communication/Scs/Client/Tcp/TcpHelper.cs
C#
mit
4,229
package proxy.test; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import util.JavaLog; public class Server extends UnicastRemoteObject implements RemoteInterface{ private static final long serialVersionUID = 1L; protected Server() throws RemoteException { super(); } public static void main(String[] args) { try { RemoteInterface service = new Server(); Naming.rebind("Hello", service); JavaLog.d("sadfasfd"); } catch (Exception e) { JavaLog.d("sadfasfd:" + e); } } @Override public String Hi() { return "Hello,Deyu"; } }
DeyuGoGo/EasyJavaDesignPatterns
HeadFirstDesignPatterns/src/proxy/test/Server.java
Java
mit
622
var _ = require('lodash'), fs = require('fs'), path = require('path'), through = require('through'), filesize = require('file-size'); function browserify(file, options) { var source = []; function write(data) { source.push(data); }; function end(file, options) { var renderTemplate = function(options, stats) { var si = options.size.representation === 'si', computedSize = filesize(stats.size, { fixed: options.size.decimals, spacer: options.size.spacer }), jsonOptions = JSON.stringify(options), jsonStats = JSON.stringify(stats), prettySize = (options.size.unit === 'human') ? computedSize.human({ si: si }) : computedSize.to(options.size.unit, si), template = options.output.file.template; return template.replace('%file%', path.basename(file)) .replace('%fullname%', file) .replace('%size%', prettySize) .replace('%stats%', jsonStats) .replace('%atime%', stats.atime) .replace('%mtime%', stats.mtime) .replace('%unit%', options.size.unit) .replace('%decimals%', options.size.decimals) .replace('%options%', jsonOptions); }; var fileStat = function(err, stats) { if (err) { console.error('Failure to extract file stats', file, err); return; } if (options.output.file) { var result = '', prependHeader = renderTemplate(options, stats); try { result = [prependHeader, source.join('')].join(''); } catch (error) { error.message += ' in "' + file + '"'; this.emit('error', error); } this.queue(result); this.queue(null); } }.bind(this); fs.stat(file, fileStat); } return (function transform(file, options) { var options = _.extend({ size: { unit: 'human', decimals: '2', spacer: ' ', representation: 'si' }, output: { file: { template: [ '', '/* =========================== ', ' * > File: %file%', ' * > Size: %size%', ' * > Modified: %mtime%', ' * =========================== */', '' ].join('\n') } } }, options); return through(_.partial(write), _.partial(end, file, options)); })(file, options); }; module.exports = { browserify: browserify };
hekar/grunt-voluminosify
src/transformers.js
JavaScript
mit
2,693
<?php namespace Modules\Dynamicfield\Providers; use Illuminate\Support\ServiceProvider; class DynamicfieldServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; public function boot() { } /** * Register the service provider. */ public function register() { $this->registerBindings(); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return array(); } private function registerBindings() { // add bindings $this->app->bind( 'Modules\Dynamicfield\Repositories\FieldsRepository', function () { $repository = new \Modules\Dynamicfield\Repositories\Eloquent\EloquentFieldsRepository(new \Modules\Dynamicfield\Entities\Fields()); if (!config('app.cache')) { return $repository; } } ); $this->app->bind( 'Modules\Dynamicfield\Repositories\GroupRepository', function () { $repository = new \Modules\Dynamicfield\Repositories\Eloquent\EloquentGroupRepository(new \Modules\Dynamicfield\Entities\Group()); if (!config('app.cache')) { return $repository; } } ); $this->app->bind( 'Modules\Dynamicfield\Repositories\GroupFieldRepository', function () { $repository = new \Modules\Dynamicfield\Repositories\Eloquent\EloquentGroupFieldRepository(new \Modules\Dynamicfield\Entities\Field()); if (!config('app.cache')) { return $repository; } } ); if ($this->app->environment() == 'local') { $this->app->register('Barryvdh\Debugbar\ServiceProvider'); } } }
stone-lab/Dynamicfield
Providers/DynamicfieldServiceProvider.php
PHP
mit
2,013
<?php namespace Robbo\Presenter\View; use ArrayAccess; use IteratorAggregate; use Robbo\Presenter\PresentableInterface; use Illuminate\View\Environment as BaseEnvironment; class Environment extends BaseEnvironment { /** * Get a evaluated view contents for the given view. * * @param string $view * @param array $data * @param array $mergeData * @return Illuminate\View\View */ public function make($view, $data = array(), $mergeData = array()) { $path = $this->finder->find($view); $data = array_merge($data, $mergeData); return new View($this, $this->getEngineFromPath($path), $view, $path, $this->makePresentable($data)); } /** * Add a piece of shared data to the environment. * * @param string $key * @param mixed $value * @return void */ public function share($key, $value = null) { if ( ! is_array($key)) { return parent::share($key, $this->makePresentable($value)); } return parent::share($this->makePresentable($key)); } /** * If this variable implements Robbo\Presenter\PresentableInterface then turn it into a presenter. * * @param mixed $value * @return mixed $value */ public function makePresentable($value) { if ($value instanceof PresentableInterface) { return $value->getPresenter(); } if (is_array($value) OR ($value instanceof IteratorAggregate AND $value instanceof ArrayAccess)) { foreach ($value AS $k => $v) { $value[$k] = $this->makePresentable($v); } } return $value; } }
coreywagehoft/laravel-4-base
vendor/robclancy/presenter/src/Robbo/Presenter/View/Environment.php
PHP
mit
1,513
/* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include <string.h> #include <list> #include <memory> #include <queue> #include <vector> #include "modules/video_coding/encoded_frame.h" #include "modules/video_coding/packet.h" #include "modules/video_coding/receiver.h" #include "modules/video_coding/test/stream_generator.h" #include "modules/video_coding/test/test_util.h" #include "modules/video_coding/timing.h" #include BOSS_WEBRTC_U_rtc_base__checks_h //original-code:"rtc_base/checks.h" #include BOSS_WEBRTC_U_system_wrappers__include__clock_h //original-code:"system_wrappers/include/clock.h" #include BOSS_WEBRTC_U_test__gtest_h //original-code:"test/gtest.h" namespace webrtc { class TestVCMReceiver : public ::testing::Test { protected: TestVCMReceiver() : clock_(new SimulatedClock(0)), timing_(clock_.get()), receiver_(&timing_, clock_.get(), &event_factory_) { stream_generator_.reset( new StreamGenerator(0, clock_->TimeInMilliseconds())); } virtual void SetUp() { receiver_.Reset(); } int32_t InsertPacket(int index) { VCMPacket packet; bool packet_available = stream_generator_->GetPacket(&packet, index); EXPECT_TRUE(packet_available); if (!packet_available) return kGeneralError; // Return here to avoid crashes below. return receiver_.InsertPacket(packet); } int32_t InsertPacketAndPop(int index) { VCMPacket packet; bool packet_available = stream_generator_->PopPacket(&packet, index); EXPECT_TRUE(packet_available); if (!packet_available) return kGeneralError; // Return here to avoid crashes below. return receiver_.InsertPacket(packet); } int32_t InsertFrame(FrameType frame_type, bool complete) { int num_of_packets = complete ? 1 : 2; stream_generator_->GenerateFrame( frame_type, (frame_type != kEmptyFrame) ? num_of_packets : 0, (frame_type == kEmptyFrame) ? 1 : 0, clock_->TimeInMilliseconds()); int32_t ret = InsertPacketAndPop(0); if (!complete) { // Drop the second packet. VCMPacket packet; stream_generator_->PopPacket(&packet, 0); } clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); return ret; } bool DecodeNextFrame() { VCMEncodedFrame* frame = receiver_.FrameForDecoding(0, false); if (!frame) return false; receiver_.ReleaseFrame(frame); return true; } std::unique_ptr<SimulatedClock> clock_; VCMTiming timing_; NullEventFactory event_factory_; VCMReceiver receiver_; std::unique_ptr<StreamGenerator> stream_generator_; }; TEST_F(TestVCMReceiver, NonDecodableDuration_Empty) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs); EXPECT_TRUE(DecodeNextFrame()); bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_NoKeyFrame) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); const int kNumFrames = kDefaultFrameRate * kMaxNonDecodableDuration / 1000; for (int i = 0; i < kNumFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_TRUE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_OneIncomplete) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Insert enough frames to have too long non-decodable sequence. for (int i = 0; i < kMaxNonDecodableDurationFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we get a key frame request. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_TRUE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_NoTrigger) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Insert all but one frame to not trigger a key frame request due to // too long duration of non-decodable frames. for (int i = 0; i < kMaxNonDecodableDurationFrames - 1; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we don't get a key frame request since we haven't generated // enough frames. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_NoTrigger2) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert enough frames to have too long non-decodable sequence, except that // we don't have any losses. for (int i = 0; i < kMaxNonDecodableDurationFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we don't get a key frame request since the non-decodable duration // is only one frame. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_KeyFrameAfterIncompleteFrames) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Insert enough frames to have too long non-decodable sequence. for (int i = 0; i < kMaxNonDecodableDurationFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we don't get a key frame request since we have a key frame // in the list. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } // A simulated clock, when time elapses, will insert frames into the jitter // buffer, based on initial settings. class SimulatedClockWithFrames : public SimulatedClock { public: SimulatedClockWithFrames(StreamGenerator* stream_generator, VCMReceiver* receiver) : SimulatedClock(0), stream_generator_(stream_generator), receiver_(receiver) {} virtual ~SimulatedClockWithFrames() {} // If |stop_on_frame| is true and next frame arrives between now and // now+|milliseconds|, the clock will be advanced to the arrival time of next // frame. // Otherwise, the clock will be advanced by |milliseconds|. // // For both cases, a frame will be inserted into the jitter buffer at the // instant when the clock time is timestamps_.front().arrive_time. // // Return true if some frame arrives between now and now+|milliseconds|. bool AdvanceTimeMilliseconds(int64_t milliseconds, bool stop_on_frame) { return AdvanceTimeMicroseconds(milliseconds * 1000, stop_on_frame); } bool AdvanceTimeMicroseconds(int64_t microseconds, bool stop_on_frame) { int64_t start_time = TimeInMicroseconds(); int64_t end_time = start_time + microseconds; bool frame_injected = false; while (!timestamps_.empty() && timestamps_.front().arrive_time <= end_time) { RTC_DCHECK(timestamps_.front().arrive_time >= start_time); SimulatedClock::AdvanceTimeMicroseconds(timestamps_.front().arrive_time - TimeInMicroseconds()); GenerateAndInsertFrame((timestamps_.front().render_time + 500) / 1000); timestamps_.pop(); frame_injected = true; if (stop_on_frame) return frame_injected; } if (TimeInMicroseconds() < end_time) { SimulatedClock::AdvanceTimeMicroseconds(end_time - TimeInMicroseconds()); } return frame_injected; } // Input timestamps are in unit Milliseconds. // And |arrive_timestamps| must be positive and in increasing order. // |arrive_timestamps| determine when we are going to insert frames into the // jitter buffer. // |render_timestamps| are the timestamps on the frame. void SetFrames(const int64_t* arrive_timestamps, const int64_t* render_timestamps, size_t size) { int64_t previous_arrive_timestamp = 0; for (size_t i = 0; i < size; i++) { RTC_CHECK(arrive_timestamps[i] >= previous_arrive_timestamp); timestamps_.push(TimestampPair(arrive_timestamps[i] * 1000, render_timestamps[i] * 1000)); previous_arrive_timestamp = arrive_timestamps[i]; } } private: struct TimestampPair { TimestampPair(int64_t arrive_timestamp, int64_t render_timestamp) : arrive_time(arrive_timestamp), render_time(render_timestamp) {} int64_t arrive_time; int64_t render_time; }; void GenerateAndInsertFrame(int64_t render_timestamp_ms) { VCMPacket packet; stream_generator_->GenerateFrame(FrameType::kVideoFrameKey, 1, // media packets 0, // empty packets render_timestamp_ms); bool packet_available = stream_generator_->PopPacket(&packet, 0); EXPECT_TRUE(packet_available); if (!packet_available) return; // Return here to avoid crashes below. receiver_->InsertPacket(packet); } std::queue<TimestampPair> timestamps_; StreamGenerator* stream_generator_; VCMReceiver* receiver_; }; // Use a SimulatedClockWithFrames // Wait call will do either of these: // 1. If |stop_on_frame| is true, the clock will be turned to the exact instant // that the first frame comes and the frame will be inserted into the jitter // buffer, or the clock will be turned to now + |max_time| if no frame comes in // the window. // 2. If |stop_on_frame| is false, the clock will be turn to now + |max_time|, // and all the frames arriving between now and now + |max_time| will be // inserted into the jitter buffer. // // This is used to simulate the JitterBuffer getting packets from internet as // time elapses. class FrameInjectEvent : public EventWrapper { public: FrameInjectEvent(SimulatedClockWithFrames* clock, bool stop_on_frame) : clock_(clock), stop_on_frame_(stop_on_frame) {} bool Set() override { return true; } EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT if (clock_->AdvanceTimeMilliseconds(max_time, stop_on_frame_) && stop_on_frame_) { return EventTypeWrapper::kEventSignaled; } else { return EventTypeWrapper::kEventTimeout; } } private: SimulatedClockWithFrames* clock_; bool stop_on_frame_; }; class VCMReceiverTimingTest : public ::testing::Test { protected: VCMReceiverTimingTest() : clock_(&stream_generator_, &receiver_), stream_generator_(0, clock_.TimeInMilliseconds()), timing_(&clock_), receiver_( &timing_, &clock_, std::unique_ptr<EventWrapper>(new FrameInjectEvent(&clock_, false)), std::unique_ptr<EventWrapper>( new FrameInjectEvent(&clock_, true))) {} virtual void SetUp() { receiver_.Reset(); } SimulatedClockWithFrames clock_; StreamGenerator stream_generator_; VCMTiming timing_; VCMReceiver receiver_; }; // Test whether VCMReceiver::FrameForDecoding handles parameter // |max_wait_time_ms| correctly: // 1. The function execution should never take more than |max_wait_time_ms|. // 2. If the function exit before now + |max_wait_time_ms|, a frame must be // returned. TEST_F(VCMReceiverTimingTest, FrameForDecoding) { const size_t kNumFrames = 100; const int kFramePeriod = 40; int64_t arrive_timestamps[kNumFrames]; int64_t render_timestamps[kNumFrames]; // Construct test samples. // render_timestamps are the timestamps stored in the Frame; // arrive_timestamps controls when the Frame packet got received. for (size_t i = 0; i < kNumFrames; i++) { // Preset frame rate to 25Hz. // But we add a reasonable deviation to arrive_timestamps to mimic Internet // fluctuation. arrive_timestamps[i] = (i + 1) * kFramePeriod + (i % 10) * ((i % 2) ? 1 : -1); render_timestamps[i] = (i + 1) * kFramePeriod; } clock_.SetFrames(arrive_timestamps, render_timestamps, kNumFrames); // Record how many frames we finally get out of the receiver. size_t num_frames_return = 0; const int64_t kMaxWaitTime = 30; // Ideally, we should get all frames that we input in InitializeFrames. // In the case that FrameForDecoding kills frames by error, we rely on the // build bot to kill the test. while (num_frames_return < kNumFrames) { int64_t start_time = clock_.TimeInMilliseconds(); VCMEncodedFrame* frame = receiver_.FrameForDecoding(kMaxWaitTime, false); int64_t end_time = clock_.TimeInMilliseconds(); // In any case the FrameForDecoding should not wait longer than // max_wait_time. // In the case that we did not get a frame, it should have been waiting for // exactly max_wait_time. (By the testing samples we constructed above, we // are sure there is no timing error, so the only case it returns with NULL // is that it runs out of time.) if (frame) { receiver_.ReleaseFrame(frame); ++num_frames_return; EXPECT_GE(kMaxWaitTime, end_time - start_time); } else { EXPECT_EQ(kMaxWaitTime, end_time - start_time); } } } // Test whether VCMReceiver::FrameForDecoding handles parameter // |prefer_late_decoding| and |max_wait_time_ms| correctly: // 1. The function execution should never take more than |max_wait_time_ms|. // 2. If the function exit before now + |max_wait_time_ms|, a frame must be // returned and the end time must be equal to the render timestamp - delay // for decoding and rendering. TEST_F(VCMReceiverTimingTest, FrameForDecodingPreferLateDecoding) { const size_t kNumFrames = 100; const int kFramePeriod = 40; int64_t arrive_timestamps[kNumFrames]; int64_t render_timestamps[kNumFrames]; int render_delay_ms; int max_decode_ms; int dummy; timing_.GetTimings(&dummy, &max_decode_ms, &dummy, &dummy, &dummy, &dummy, &render_delay_ms); // Construct test samples. // render_timestamps are the timestamps stored in the Frame; // arrive_timestamps controls when the Frame packet got received. for (size_t i = 0; i < kNumFrames; i++) { // Preset frame rate to 25Hz. // But we add a reasonable deviation to arrive_timestamps to mimic Internet // fluctuation. arrive_timestamps[i] = (i + 1) * kFramePeriod + (i % 10) * ((i % 2) ? 1 : -1); render_timestamps[i] = (i + 1) * kFramePeriod; } clock_.SetFrames(arrive_timestamps, render_timestamps, kNumFrames); // Record how many frames we finally get out of the receiver. size_t num_frames_return = 0; const int64_t kMaxWaitTime = 30; bool prefer_late_decoding = true; while (num_frames_return < kNumFrames) { int64_t start_time = clock_.TimeInMilliseconds(); VCMEncodedFrame* frame = receiver_.FrameForDecoding(kMaxWaitTime, prefer_late_decoding); int64_t end_time = clock_.TimeInMilliseconds(); if (frame) { EXPECT_EQ(frame->RenderTimeMs() - max_decode_ms - render_delay_ms, end_time); receiver_.ReleaseFrame(frame); ++num_frames_return; } else { EXPECT_EQ(kMaxWaitTime, end_time - start_time); } } } } // namespace webrtc
koobonil/Boss2D
Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/modules/video_coding/receiver_unittest.cc
C++
mit
20,183
var Models = {}; module.exports = Models; /** * Creates a new instance of the Model class * @constructor */ Models.Model = function(id, name, status, type, normalValue, wierdValue) { /** @type {string} */ this._id = id || ''; /** @type {string} */ this.name = name || ''; /** @type {string} */ this.status = status || 'disable'; /** @type {string} */ this.type = type || 'normal'; /** @type {number} */ this.normalValue = normalValue || 0; /** @type {number} */ this.wierdValue = wierdValue || 0; }; /** * Creates a new instance of a PublicModel * @constructor */ Models.PublicModel = function(name, value) { /** @type {string} */ this.name = name || ''; /** @type {number} */ this.value = value || 0; };
ValYouW/rollmodel
models/model.js
JavaScript
mit
771
/* ============================================================= * bootstrap-collapse.js v2.3.2 * http://getbootstrap.com/2.3.2/javascript.html#collapse * ============================================================= * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================ */ !function ($) { "use strict"; // jshint ;_; /* COLLAPSE PUBLIC CLASS DEFINITION * ================================ */ var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, $.fn.collapse.defaults, options) if (this.options.parent) { this.$parent = $(this.options.parent) } this.options.toggle && this.toggle() } Collapse.prototype = { constructor: Collapse , dimension: function () { var hasWidth = this.$element.hasClass('width') return hasWidth ? 'width' : 'height' } , show: function () { var dimension , scroll , actives , hasData if (this.transitioning || this.$element.hasClass('in')) return dimension = this.dimension() scroll = $.camelCase(['scroll', dimension].join('-')) actives = this.$parent && this.$parent.find('> .accordion-group > .in') if (actives && actives.length) { hasData = actives.data('collapse') if (hasData && hasData.transitioning) return actives.collapse('hide') hasData || actives.data('collapse', null) } this.$element[dimension](0) this.transition('addClass', $.Event('show'), 'shown') $.support.transition && this.$element[dimension](this.$element[0][scroll]) } , hide: function () { var dimension if (this.transitioning || !this.$element.hasClass('in')) return dimension = this.dimension() this.reset(this.$element[dimension]()) this.transition('removeClass', $.Event('hide'), 'hidden') this.$element[dimension](0) } , reset: function (size) { var dimension = this.dimension() this.$element .removeClass('collapse') [dimension](size || 'auto') [0].offsetWidth this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') return this } , transition: function (method, startEvent, completeEvent) { var that = this , complete = function () { if (startEvent.type == 'show') that.reset() that.transitioning = 0 that.$element.trigger(completeEvent) } this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return this.transitioning = 1 this.$element[method]('in') $.support.transition && this.$element.hasClass('collapse') ? this.$element.one($.support.transition.end, complete) : complete() } , toggle: function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } } /* COLLAPSE PLUGIN DEFINITION * ========================== */ var old = $.fn.collapse $.fn.collapse = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('collapse') , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) if (!data) $this.data('collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.collapse.defaults = { toggle: true } $.fn.collapse.Constructor = Collapse /* COLLAPSE NO CONFLICT * ==================== */ $.fn.collapse.noConflict = function () { $.fn.collapse = old return this } /* COLLAPSE DATA-API * ================= */ $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { var $this = $(this), href , target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 , option = $(target).data('collapse') ? 'toggle' : $this.data() $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') $(target).collapse(option) }) }(window.jQuery);
nfelix/mvmt
public/assets/rails_admin/bootstrap/bootstrap-collapse-3387a8b21abb7862bae6aac8337d6b26.js
JavaScript
mit
4,731
// Copyright (c) Rotorz Limited. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root. using Rotorz.Games.EditorExtensions; using System; using System.IO; using UnityEngine; namespace Rotorz.Games.UnityEditorExtensions { /// <summary> /// Project-wide settings for the "@rotorz/unity3d-editor-menu" package. /// </summary> /// <remarks> /// <para>The default <see cref="IEditorMenuPresenter"/> implementation type can be /// overridden by creating a settings file at the path "{Project}/Assets/Plugins/PackageData/@rotorz/unity3d-editor-menu/EditorMenuSettings.json" /// and then specifying the type as follows:</para> /// <code language="json"><![CDATA[ /// { /// "DefaultPresenterTypeName": "MyNamespace.CustomEditorMenuPresenter" /// } /// ]]></code> /// </remarks> public sealed class EditorMenuSettings { private static EditorMenuSettings s_Instance; /// <summary> /// Gets the <see cref="EditorMenuSettings"/> instance for the end-user's project. /// </summary> public static EditorMenuSettings Instance { get { if (s_Instance == null) { s_Instance = LoadSettings(); } return s_Instance; } } private static EditorMenuSettings LoadSettings() { EditorMenuSettings settings = new EditorMenuSettings(); string editorMenuSettingsFilePath = PackageUtility.ResolveDataPathAbsolute("@rotorz/unity3d-editor-menu", null, "EditorMenuSettings.json"); if (File.Exists(editorMenuSettingsFilePath)) { var jsonRaw = File.ReadAllText(editorMenuSettingsFilePath); var data = JsonUtility.FromJson<JsonData>(jsonRaw); settings.FromSerializable(data); } return settings; } private Type defaultPresenterType; /// <summary> /// Initializes a new instance of the <see cref="EditorMenuSettings"/> class. /// </summary> public EditorMenuSettings() { this.defaultPresenterType = this.FallbackDefaultPresenterType; } /// <summary> /// Gets the fallback <see cref="IEditorMenuPresenter"/> implementation type. /// </summary> public Type FallbackDefaultPresenterType { get { return typeof(EditorMenuPresenter_GenericMenu); } } /// <summary> /// Gets the default <see cref="IEditorMenuPresenter"/> implementation type. /// </summary> public Type DefaultPresenterType { get { return this.defaultPresenterType; } private set { if (value == null) { throw new ArgumentNullException("value"); } if (!typeof(IEditorMenuPresenter).IsAssignableFrom(value)) { throw new ArgumentException("Does not implement 'IEditorMenuPresenter' interface."); } this.defaultPresenterType = value; } } private void FromSerializable(JsonData data) { if (!string.IsNullOrEmpty(data.DefaultPresenterTypeName)) { var type = Type.GetType(data.DefaultPresenterTypeName, throwOnError: false); if (type != null && typeof(IEditorMenuPresenter).IsAssignableFrom(type)) { this.defaultPresenterType = type; return; } } this.defaultPresenterType = this.FallbackDefaultPresenterType; } [Serializable] private sealed class JsonData { public string DefaultPresenterTypeName; } } }
tenvick/hugula
Client/Assets/Third/PSD2UGUI/@rotorz/unity3d-editor-menu/Editor/EditorMenuSettings.cs
C#
mit
3,824
# -*- coding: utf-8 -*- """ Organization Registry - Controllers """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------------------- def index(): """ Module's Home Page """ return s3db.cms_index(module, alt_function="index_alt") # ----------------------------------------------------------------------------- def index_alt(): """ Module homepage for non-Admin users when no CMS content found """ # @ToDo: Move this to the Template (separate deployment_setting or else a customise for non-REST controllers) template = settings.get_template() if template == "SandyRelief": # Just redirect to the Facilities redirect(URL(f="facility")) else: # Just redirect to the list of Organisations redirect(URL(f="organisation")) # ----------------------------------------------------------------------------- def group(): """ RESTful CRUD controller """ return s3_rest_controller(rheader = s3db.org_rheader) # ----------------------------------------------------------------------------- def region(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def sector(): """ RESTful CRUD controller """ # Pre-processor def prep(r): # Location Filter s3db.gis_location_filter(r) return True s3.prep = prep return s3_rest_controller() # ----------------------------------------------------------------------------- def subsector(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def site(): """ RESTful CRUD controller - used by S3SiteAutocompleteWidget which doesn't yet support filtering to just updateable sites - used by site_contact_person() - used by S3OptionsFilter (e.g. Asset Log) """ # Pre-processor def prep(r): if r.representation != "json" and \ r.method not in ("search_ac", "search_address_ac", "site_contact_person"): return False # Location Filter s3db.gis_location_filter(r) return True s3.prep = prep return s3_rest_controller() # ----------------------------------------------------------------------------- def sites_for_org(): """ Used to provide the list of Sites for an Organisation - used in User Registration """ try: org = request.args[0] except: result = current.xml.json_message(False, 400, "No Org provided!") else: stable = s3db.org_site if settings.get_org_branches(): # Find all branches for this Organisation btable = s3db.org_organisation_branch query = (btable.organisation_id == org) & \ (btable.deleted != True) rows = db(query).select(btable.branch_id) org_ids = [row.branch_id for row in rows] + [org] query = (stable.organisation_id.belongs(org_ids)) & \ (stable.deleted != True) else: query = (stable.organisation_id == org) & \ (stable.deleted != True) rows = db(query).select(stable.site_id, stable.name, orderby=stable.name) result = rows.json() finally: response.headers["Content-Type"] = "application/json" return result # ----------------------------------------------------------------------------- def facility(): """ RESTful CRUD controller """ return s3db.org_facility_controller() # ----------------------------------------------------------------------------- def facility_type(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def office_type(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def organisation_type(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def organisation(): """ RESTful CRUD controller """ # Defined in the Model for use from Multiple Controllers for unified menus return s3db.org_organisation_controller() # ----------------------------------------------------------------------------- def org_search(): """ Organisation REST controller - limited to just search_ac for use in Autocompletes - allows differential access permissions """ s3.prep = lambda r: r.method == "search_ac" return s3_rest_controller(module, "organisation") # ----------------------------------------------------------------------------- def organisation_list_represent(l): organisation_represent = s3db.org_organisation_represent if l: max_length = 4 if len(l) > max_length: return "%s, etc" % \ organisation_represent.multiple(l[:max_length]) else: return organisation_represent.multiple(l) else: return NONE # ----------------------------------------------------------------------------- def office(): """ RESTful CRUD controller """ # Defined in the Model for use from Multiple Controllers for unified menus return s3db.org_office_controller() # ----------------------------------------------------------------------------- def person(): """ Person controller for AddPersonWidget """ def prep(r): if r.representation != "s3json": # Do not serve other representations here return False else: current.xml.show_ids = True return True s3.prep = prep return s3_rest_controller("pr", "person") # ----------------------------------------------------------------------------- def room(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def mailing_list(): """ RESTful CRUD controller """ tablename = "pr_group" table = s3db[tablename] # Only groups with a group_type of 5 s3.filter = (table.group_type == 5) table.group_type.writable = False table.group_type.readable = False table.name.label = T("Mailing List Name") s3.crud_strings[tablename] = s3.pr_mailing_list_crud_strings # define the list_fields list_fields = s3db.configure(tablename, list_fields = ["id", "name", "description", ]) # Components _rheader = s3db.pr_rheader _tabs = [(T("Organization"), "organisation/"), (T("Mailing List Details"), None), ] if len(request.args) > 0: _tabs.append((T("Members"), "group_membership")) if "viewing" in request.vars: tablename, record_id = request.vars.viewing.rsplit(".", 1) if tablename == "org_organisation": table = s3db[tablename] _rheader = s3db.org_rheader _tabs = [] s3db.add_components("pr_group", pr_group_membership="group_id") rheader = lambda r: _rheader(r, tabs = _tabs) return s3_rest_controller("pr", "group", rheader=rheader) # ----------------------------------------------------------------------------- def donor(): """ RESTful CRUD controller """ tablename = "org_donor" table = s3db[tablename] tablename = "org_donor" s3.crud_strings[tablename] = Storage( label_create = ADD_DONOR, title_display = T("Donor Details"), title_list = T("Donors Report"), title_update = T("Edit Donor"), label_list_button = T("List Donors"), label_delete_button = T("Delete Donor"), msg_record_created = T("Donor added"), msg_record_modified = T("Donor updated"), msg_record_deleted = T("Donor deleted"), msg_list_empty = T("No Donors currently registered")) s3db.configure(tablename, listadd=False) output = s3_rest_controller() return output # ----------------------------------------------------------------------------- def resource(): """ RESTful CRUD controller """ def prep(r): if r.interactive: if r.method in ("create", "update"): # Context from a Profile page?" table = r.table location_id = request.get_vars.get("(location)", None) if location_id: field = table.location_id field.default = location_id field.readable = field.writable = False organisation_id = request.get_vars.get("(organisation)", None) if organisation_id: field = table.organisation_id field.default = organisation_id field.readable = field.writable = False return True s3.prep = prep return s3_rest_controller() # ----------------------------------------------------------------------------- def resource_type(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def service(): """ RESTful CRUD controller """ return s3_rest_controller() # ----------------------------------------------------------------------------- def req_match(): """ Match Requests for Sites """ return s3db.req_match() # ----------------------------------------------------------------------------- def incoming(): """ Incoming Shipments for Sites @unused """ return inv_incoming() # ----------------------------------------------------------------------------- def facility_geojson(): """ Create GeoJSON[P] of Facilities for use by a high-traffic website - controller just for testing - function normally run on a schedule """ s3db.org_facility_geojson() # END =========================================================================
code-for-india/sahana_shelter_worldbank
controllers/org.py
Python
mit
10,621
<?php namespace ALttP\Http\Controllers; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; }
sporchia/alttp_vt_randomizer
app/Http/Controllers/Controller.php
PHP
mit
363
# https://leetcode.com/problems/anagrams/ # # Given an array of strings, group anagrams together. # # For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: # # [ # ["ate", "eat", "tea"], # ["nat", "tan"], # ["bat"] # ] # # Notes: # # + For the return value, each inner list's elements must follow the # lexicographic order. # + All inputs will be in lower-case. # @param {String[]} strs # @return {String[][]} def group_anagrams(strs) strs.group_by(&->(s){ s.chars.sort.join }).values.map(&:sort) end
shemerey/coderepo
algorithms/anagrams.rb
Ruby
mit
563
/* MIT License Copyright (c) 2016 JetBrains http://www.jetbrains.com 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. */ using System; #pragma warning disable 1591 // ReSharper disable UnusedMember.Global // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedAutoPropertyAccessor.Global // ReSharper disable IntroduceOptionalParameters.Global // ReSharper disable MemberCanBeProtected.Global // ReSharper disable InconsistentNaming // ReSharper disable once CheckNamespace namespace FacePalm.Annotations { /// <summary> /// Indicates that the value of the marked element could be <c>null</c> sometimes, /// so the check for <c>null</c> is necessary before its usage. /// </summary> /// <example><code> /// [CanBeNull] object Test() => null; /// /// void UseTest() { /// var p = Test(); /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' /// } /// </code></example> [AttributeUsage( AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)] public sealed class CanBeNullAttribute : Attribute { } /// <summary> /// Indicates that the value of the marked element could never be <c>null</c>. /// </summary> /// <example><code> /// [NotNull] object Foo() { /// return null; // Warning: Possible 'null' assignment /// } /// </code></example> [AttributeUsage( AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)] public sealed class NotNullAttribute : Attribute { } /// <summary> /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property /// or of the Lazy.Value property can never be null. /// </summary> [AttributeUsage( AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field)] public sealed class ItemNotNullAttribute : Attribute { } /// <summary> /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property /// or of the Lazy.Value property can be null. /// </summary> [AttributeUsage( AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field)] public sealed class ItemCanBeNullAttribute : Attribute { } /// <summary> /// Indicates that the marked method builds string by format pattern and (optional) arguments. /// Parameter, which contains format string, should be given in constructor. The format string /// should be in <see cref="string.Format(IFormatProvider,string,object[])"/>-like form. /// </summary> /// <example><code> /// [StringFormatMethod("message")] /// void ShowError(string message, params object[] args) { /* do something */ } /// /// void Foo() { /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string /// } /// </code></example> [AttributeUsage( AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Delegate)] public sealed class StringFormatMethodAttribute : Attribute { /// <param name="formatParameterName"> /// Specifies which parameter of an annotated method should be treated as format-string /// </param> public StringFormatMethodAttribute([NotNull] string formatParameterName) { FormatParameterName = formatParameterName; } [NotNull] public string FormatParameterName { get; } } /// <summary> /// For a parameter that is expected to be one of the limited set of values. /// Specify fields of which type should be used as values for this parameter. /// </summary> [AttributeUsage( AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)] public sealed class ValueProviderAttribute : Attribute { public ValueProviderAttribute([NotNull] string name) { Name = name; } [NotNull] public string Name { get; } } /// <summary> /// Indicates that the function argument should be string literal and match one /// of the parameters of the caller function. For example, ReSharper annotates /// the parameter of <see cref="System.ArgumentNullException"/>. /// </summary> /// <example><code> /// void Foo(string param) { /// if (param == null) /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol /// } /// </code></example> [AttributeUsage(AttributeTargets.Parameter)] public sealed class InvokerParameterNameAttribute : Attribute { } /// <summary> /// Indicates that the method is contained in a type that implements /// <c>System.ComponentModel.INotifyPropertyChanged</c> interface and this method /// is used to notify that some property value changed. /// </summary> /// <remarks> /// The method should be non-static and conform to one of the supported signatures: /// <list> /// <item><c>NotifyChanged(string)</c></item> /// <item><c>NotifyChanged(params string[])</c></item> /// <item><c>NotifyChanged{T}(Expression{Func{T}})</c></item> /// <item><c>NotifyChanged{T,U}(Expression{Func{T,U}})</c></item> /// <item><c>SetProperty{T}(ref T, T, string)</c></item> /// </list> /// </remarks> /// <example><code> /// public class Foo : INotifyPropertyChanged { /// public event PropertyChangedEventHandler PropertyChanged; /// /// [NotifyPropertyChangedInvocator] /// protected virtual void NotifyChanged(string propertyName) { ... } /// /// string _name; /// /// public string Name { /// get { return _name; } /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } /// } /// } /// </code> /// Examples of generated notifications: /// <list> /// <item><c>NotifyChanged("Property")</c></item> /// <item><c>NotifyChanged(() =&gt; Property)</c></item> /// <item><c>NotifyChanged((VM x) =&gt; x.Property)</c></item> /// <item><c>SetProperty(ref myField, value, "Property")</c></item> /// </list> /// </example> [AttributeUsage(AttributeTargets.Method)] public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute { public NotifyPropertyChangedInvocatorAttribute() { } public NotifyPropertyChangedInvocatorAttribute([NotNull] string parameterName) { ParameterName = parameterName; } [CanBeNull] public string ParameterName { get; } } /// <summary> /// Describes dependency between method input and output. /// </summary> /// <syntax> /// <p>Function Definition Table syntax:</p> /// <list> /// <item>FDT ::= FDTRow [;FDTRow]*</item> /// <item>FDTRow ::= Input =&gt; Output | Output &lt;= Input</item> /// <item>Input ::= ParameterName: Value [, Input]*</item> /// <item>Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}</item> /// <item>Value ::= true | false | null | notnull | canbenull</item> /// </list> /// If method has single input parameter, it's name could be omitted.<br/> /// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same) for method output /// means that the methos doesn't return normally (throws or terminates the process).<br/> /// Value <c>canbenull</c> is only applicable for output parameters.<br/> /// You can use multiple <c>[ContractAnnotation]</c> for each FDT row, or use single attribute /// with rows separated by semicolon. There is no notion of order rows, all rows are checked /// for applicability and applied per each program state tracked by R# analysis.<br/> /// </syntax> /// <examples><list> /// <item><code> /// [ContractAnnotation("=&gt; halt")] /// public void TerminationMethod() /// </code></item> /// <item><code> /// [ContractAnnotation("halt &lt;= condition: false")] /// public void Assert(bool condition, string text) // regular assertion method /// </code></item> /// <item><code> /// [ContractAnnotation("s:null =&gt; true")] /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() /// </code></item> /// <item><code> /// // A method that returns null if the parameter is null, /// // and not null if the parameter is not null /// [ContractAnnotation("null =&gt; null; notnull =&gt; notnull")] /// public object Transform(object data) /// </code></item> /// <item><code> /// [ContractAnnotation("=&gt; true, result: notnull; =&gt; false, result: null")] /// public bool TryParse(string s, out Person result) /// </code></item> /// </list></examples> [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public sealed class ContractAnnotationAttribute : Attribute { public ContractAnnotationAttribute([NotNull] string contract) : this(contract, false) { } public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates) { Contract = contract; ForceFullStates = forceFullStates; } [NotNull] public string Contract { get; } public bool ForceFullStates { get; } } /// <summary> /// Indicates that marked element should be localized or not. /// </summary> /// <example><code> /// [LocalizationRequiredAttribute(true)] /// class Foo { /// string str = "my string"; // Warning: Localizable string /// } /// </code></example> [AttributeUsage(AttributeTargets.All)] public sealed class LocalizationRequiredAttribute : Attribute { public LocalizationRequiredAttribute() : this(true) { } public LocalizationRequiredAttribute(bool required) { Required = required; } public bool Required { get; } } /// <summary> /// Indicates that the value of the marked type (or its derivatives) /// cannot be compared using '==' or '!=' operators and <c>Equals()</c> /// should be used instead. However, using '==' or '!=' for comparison /// with <c>null</c> is always permitted. /// </summary> /// <example><code> /// [CannotApplyEqualityOperator] /// class NoEquality { } /// /// class UsesNoEquality { /// void Test() { /// var ca1 = new NoEquality(); /// var ca2 = new NoEquality(); /// if (ca1 != null) { // OK /// bool condition = ca1 == ca2; // Warning /// } /// } /// } /// </code></example> [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct)] public sealed class CannotApplyEqualityOperatorAttribute : Attribute { } /// <summary> /// When applied to a target attribute, specifies a requirement for any type marked /// with the target attribute to implement or inherit specific type or types. /// </summary> /// <example><code> /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement /// class ComponentAttribute : Attribute { } /// /// [Component] // ComponentAttribute requires implementing IComponent interface /// class MyComponent : IComponent { } /// </code></example> [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] [BaseTypeRequired(typeof(Attribute))] public sealed class BaseTypeRequiredAttribute : Attribute { public BaseTypeRequiredAttribute([NotNull] Type baseType) { BaseType = baseType; } [NotNull] public Type BaseType { get; } } /// <summary> /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), /// so this symbol will not be marked as unused (as well as by other usage inspections). /// </summary> [AttributeUsage(AttributeTargets.All)] public sealed class UsedImplicitlyAttribute : Attribute { public UsedImplicitlyAttribute() : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) : this(useKindFlags, ImplicitUseTargetFlags.Default) { } public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) : this(ImplicitUseKindFlags.Default, targetFlags) { } public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) { UseKindFlags = useKindFlags; TargetFlags = targetFlags; } public ImplicitUseKindFlags UseKindFlags { get; } public ImplicitUseTargetFlags TargetFlags { get; } } /// <summary> /// Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes /// as unused (as well as by other usage inspections) /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter)] public sealed class MeansImplicitUseAttribute : Attribute { public MeansImplicitUseAttribute() : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) : this(useKindFlags, ImplicitUseTargetFlags.Default) { } public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) : this(ImplicitUseKindFlags.Default, targetFlags) { } public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) { UseKindFlags = useKindFlags; TargetFlags = targetFlags; } [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; } [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; } } [Flags] public enum ImplicitUseKindFlags { Default = Access | Assign | InstantiatedWithFixedConstructorSignature, /// <summary>Only entity marked with attribute considered used.</summary> Access = 1, /// <summary>Indicates implicit assignment to a member.</summary> Assign = 2, /// <summary> /// Indicates implicit instantiation of a type with fixed constructor signature. /// That means any unused constructor parameters won't be reported as such. /// </summary> InstantiatedWithFixedConstructorSignature = 4, /// <summary>Indicates implicit instantiation of a type.</summary> InstantiatedNoFixedConstructorSignature = 8 } /// <summary> /// Specify what is considered used implicitly when marked /// with <see cref="MeansImplicitUseAttribute"/> or <see cref="UsedImplicitlyAttribute"/>. /// </summary> [Flags] public enum ImplicitUseTargetFlags { Default = Itself, Itself = 1, /// <summary>Members of entity marked with attribute are considered used.</summary> Members = 2, /// <summary>Entity marked with attribute and all its members considered used.</summary> WithMembers = Itself | Members } /// <summary> /// This attribute is intended to mark publicly available API /// which should not be removed and so is treated as used. /// </summary> [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)] public sealed class PublicAPIAttribute : Attribute { public PublicAPIAttribute() { } public PublicAPIAttribute([NotNull] string comment) { Comment = comment; } [CanBeNull] public string Comment { get; } } /// <summary> /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack. /// If the parameter is a delegate, indicates that delegate is executed while the method is executed. /// If the parameter is an enumerable, indicates that it is enumerated while the method is executed. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class InstantHandleAttribute : Attribute { } /// <summary> /// Indicates that a method does not make any observable state changes. /// The same as <c>System.Diagnostics.Contracts.PureAttribute</c>. /// </summary> /// <example><code> /// [Pure] int Multiply(int x, int y) => x * y; /// /// void M() { /// Multiply(123, 42); // Waring: Return value of pure method is not used /// } /// </code></example> [AttributeUsage(AttributeTargets.Method)] public sealed class PureAttribute : Attribute { } /// <summary> /// Indicates that the return value of method invocation must be used. /// </summary> [AttributeUsage(AttributeTargets.Method)] public sealed class MustUseReturnValueAttribute : Attribute { public MustUseReturnValueAttribute() { } public MustUseReturnValueAttribute([NotNull] string justification) { Justification = justification; } [CanBeNull] public string Justification { get; } } /// <summary> /// Indicates the type member or parameter of some type, that should be used instead of all other ways /// to get the value that type. This annotation is useful when you have some "context" value evaluated /// and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one. /// </summary> /// <example><code> /// class Foo { /// [ProvidesContext] IBarService _barService = ...; /// /// void ProcessNode(INode node) { /// DoSomething(node, node.GetGlobalServices().Bar); /// // ^ Warning: use value of '_barService' field /// } /// } /// </code></example> [AttributeUsage( AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.GenericParameter)] public sealed class ProvidesContextAttribute : Attribute { } /// <summary> /// Indicates that a parameter is a path to a file or a folder within a web project. /// Path can be relative or absolute, starting from web root (~). /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class PathReferenceAttribute : Attribute { public PathReferenceAttribute() { } public PathReferenceAttribute([NotNull] [PathReference] string basePath) { BasePath = basePath; } [CanBeNull] public string BasePath { get; } } /// <summary> /// An extension method marked with this attribute is processed by ReSharper code completion /// as a 'Source Template'. When extension method is completed over some expression, it's source code /// is automatically expanded like a template at call site. /// </summary> /// <remarks> /// Template method body can contain valid source code and/or special comments starting with '$'. /// Text inside these comments is added as source code when the template is applied. Template parameters /// can be used either as additional method parameters or as identifiers wrapped in two '$' signs. /// Use the <see cref="MacroAttribute"/> attribute to specify macros for parameters. /// </remarks> /// <example> /// In this example, the 'forEach' method is a source template available over all values /// of enumerable types, producing ordinary C# 'foreach' statement and placing caret inside block: /// <code> /// [SourceTemplate] /// public static void forEach&lt;T&gt;(this IEnumerable&lt;T&gt; xs) { /// foreach (var x in xs) { /// //$ $END$ /// } /// } /// </code> /// </example> [AttributeUsage(AttributeTargets.Method)] public sealed class SourceTemplateAttribute : Attribute { } /// <summary> /// Allows specifying a macro for a parameter of a <see cref="SourceTemplateAttribute">source template</see>. /// </summary> /// <remarks> /// You can apply the attribute on the whole method or on any of its additional parameters. The macro expression /// is defined in the <see cref="MacroAttribute.Expression"/> property. When applied on a method, the target /// template parameter is defined in the <see cref="MacroAttribute.Target"/> property. To apply the macro silently /// for the parameter, set the <see cref="MacroAttribute.Editable"/> property value = -1. /// </remarks> /// <example> /// Applying the attribute on a source template method: /// <code> /// [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")] /// public static void forEach&lt;T&gt;(this IEnumerable&lt;T&gt; collection) { /// foreach (var item in collection) { /// //$ $END$ /// } /// } /// </code> /// Applying the attribute on a template method parameter: /// <code> /// [SourceTemplate] /// public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) { /// /*$ var $x$Id = "$newguid$" + x.ToString(); /// x.DoSomething($x$Id); */ /// } /// </code> /// </example> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = true)] public sealed class MacroAttribute : Attribute { /// <summary> /// Allows specifying a macro that will be executed for a <see cref="SourceTemplateAttribute">source template</see> /// parameter when the template is expanded. /// </summary> [CanBeNull] public string Expression { get; set; } /// <summary> /// Allows specifying which occurrence of the target parameter becomes editable when the template is deployed. /// </summary> /// <remarks> /// If the target parameter is used several times in the template, only one occurrence becomes editable; /// other occurrences are changed synchronously. To specify the zero-based index of the editable occurrence, /// use values >= 0. To make the parameter non-editable when the template is expanded, use -1. /// </remarks>> public int Editable { get; set; } /// <summary> /// Identifies the target parameter of a <see cref="SourceTemplateAttribute">source template</see> if the /// <see cref="MacroAttribute"/> is applied on a template method. /// </summary> [CanBeNull] public string Target { get; set; } } [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute { public AspMvcAreaMasterLocationFormatAttribute([NotNull] string format) { Format = format; } [NotNull] public string Format { get; } } [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute { public AspMvcAreaPartialViewLocationFormatAttribute([NotNull] string format) { Format = format; } [NotNull] public string Format { get; } } [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute { public AspMvcAreaViewLocationFormatAttribute([NotNull] string format) { Format = format; } [NotNull] public string Format { get; } } [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] public sealed class AspMvcMasterLocationFormatAttribute : Attribute { public AspMvcMasterLocationFormatAttribute([NotNull] string format) { Format = format; } [NotNull] public string Format { get; } } [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute { public AspMvcPartialViewLocationFormatAttribute([NotNull] string format) { Format = format; } [NotNull] public string Format { get; } } [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] public sealed class AspMvcViewLocationFormatAttribute : Attribute { public AspMvcViewLocationFormatAttribute([NotNull] string format) { Format = format; } [NotNull] public string Format { get; } } /// <summary> /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter /// is an MVC action. If applied to a method, the MVC action name is calculated /// implicitly from the context. Use this attribute for custom wrappers similar to /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] public sealed class AspMvcActionAttribute : Attribute { public AspMvcActionAttribute() { } public AspMvcActionAttribute([NotNull] string anonymousProperty) { AnonymousProperty = anonymousProperty; } [CanBeNull] public string AnonymousProperty { get; } } /// <summary> /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area. /// Use this attribute for custom wrappers similar to /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AspMvcAreaAttribute : Attribute { public AspMvcAreaAttribute() { } public AspMvcAreaAttribute([NotNull] string anonymousProperty) { AnonymousProperty = anonymousProperty; } [CanBeNull] public string AnonymousProperty { get; } } /// <summary> /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is /// an MVC controller. If applied to a method, the MVC controller name is calculated /// implicitly from the context. Use this attribute for custom wrappers similar to /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] public sealed class AspMvcControllerAttribute : Attribute { public AspMvcControllerAttribute() { } public AspMvcControllerAttribute([NotNull] string anonymousProperty) { AnonymousProperty = anonymousProperty; } [CanBeNull] public string AnonymousProperty { get; } } /// <summary> /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AspMvcMasterAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, Object)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AspMvcModelTypeAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC /// partial view. If applied to a method, the MVC partial view name is calculated implicitly /// from the context. Use this attribute for custom wrappers similar to /// <c>System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] public sealed class AspMvcPartialViewAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method. /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public sealed class AspMvcSuppressViewErrorAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. /// Use this attribute for custom wrappers similar to /// <c>System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AspMvcDisplayTemplateAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. /// Use this attribute for custom wrappers similar to /// <c>System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AspMvcEditorTemplateAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template. /// Use this attribute for custom wrappers similar to /// <c>System.ComponentModel.DataAnnotations.UIHintAttribute(System.String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AspMvcTemplateAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter /// is an MVC view component. If applied to a method, the MVC view name is calculated implicitly /// from the context. Use this attribute for custom wrappers similar to /// <c>System.Web.Mvc.Controller.View(Object)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] public sealed class AspMvcViewAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter /// is an MVC view component name. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AspMvcViewComponentAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter /// is an MVC view component view. If applied to a method, the MVC view component view name is default. /// </summary> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] public sealed class AspMvcViewComponentViewAttribute : Attribute { } /// <summary> /// ASP.NET MVC attribute. When applied to a parameter of an attribute, /// indicates that this parameter is an MVC action name. /// </summary> /// <example><code> /// [ActionName("Foo")] /// public ActionResult Login(string returnUrl) { /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK /// return RedirectToAction("Bar"); // Error: Cannot resolve action /// } /// </code></example> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] public sealed class AspMvcActionSelectorAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)] public sealed class HtmlElementAttributesAttribute : Attribute { public HtmlElementAttributesAttribute() { } public HtmlElementAttributesAttribute([NotNull] string name) { Name = name; } [CanBeNull] public string Name { get; } } [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)] public sealed class HtmlAttributeValueAttribute : Attribute { public HtmlAttributeValueAttribute([NotNull] string name) { Name = name; } [NotNull] public string Name { get; } } /// <summary> /// Razor attribute. Indicates that a parameter or a method is a Razor section. /// Use this attribute for custom wrappers similar to /// <c>System.Web.WebPages.WebPageBase.RenderSection(String)</c>. /// </summary> [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] public sealed class RazorSectionAttribute : Attribute { } /// <summary> /// Indicates how method, constructor invocation or property access /// over collection type affects content of the collection. /// </summary> [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)] public sealed class CollectionAccessAttribute : Attribute { public CollectionAccessAttribute(CollectionAccessType collectionAccessType) { CollectionAccessType = collectionAccessType; } public CollectionAccessType CollectionAccessType { get; } } [Flags] public enum CollectionAccessType { /// <summary>Method does not use or modify content of the collection.</summary> None = 0, /// <summary>Method only reads content of the collection but does not modify it.</summary> Read = 1, /// <summary>Method can change content of the collection but does not add new elements.</summary> ModifyExistingContent = 2, /// <summary>Method can add new elements to the collection.</summary> UpdatedContent = ModifyExistingContent | 4 } /// <summary> /// Indicates that the marked method is assertion method, i.e. it halts control flow if /// one of the conditions is satisfied. To set the condition, mark one of the parameters with /// <see cref="AssertionConditionAttribute"/> attribute. /// </summary> [AttributeUsage(AttributeTargets.Method)] public sealed class AssertionMethodAttribute : Attribute { } /// <summary> /// Indicates the condition parameter of the assertion method. The method itself should be /// marked by <see cref="AssertionMethodAttribute"/> attribute. The mandatory argument of /// the attribute is the assertion type. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class AssertionConditionAttribute : Attribute { public AssertionConditionAttribute(AssertionConditionType conditionType) { ConditionType = conditionType; } public AssertionConditionType ConditionType { get; } } /// <summary> /// Specifies assertion type. If the assertion method argument satisfies the condition, /// then the execution continues. Otherwise, execution is assumed to be halted. /// </summary> public enum AssertionConditionType { /// <summary>Marked parameter should be evaluated to true.</summary> IS_TRUE = 0, /// <summary>Marked parameter should be evaluated to false.</summary> IS_FALSE = 1, /// <summary>Marked parameter should be evaluated to null value.</summary> IS_NULL = 2, /// <summary>Marked parameter should be evaluated to not null value.</summary> IS_NOT_NULL = 3 } /// <summary> /// Indicates that the marked method unconditionally terminates control flow execution. /// For example, it could unconditionally throw exception. /// </summary> [Obsolete("Use [ContractAnnotation('=> halt')] instead")] [AttributeUsage(AttributeTargets.Method)] public sealed class TerminatesProgramAttribute : Attribute { } /// <summary> /// Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select, /// .Where). This annotation allows inference of [InstantHandle] annotation for parameters /// of delegate type by analyzing LINQ method chains. /// </summary> [AttributeUsage(AttributeTargets.Method)] public sealed class LinqTunnelAttribute : Attribute { } /// <summary> /// Indicates that IEnumerable, passed as parameter, is not enumerated. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class NoEnumerationAttribute : Attribute { } /// <summary> /// Indicates that parameter is regular expression pattern. /// </summary> [AttributeUsage(AttributeTargets.Parameter)] public sealed class RegexPatternAttribute : Attribute { } /// <summary> /// Prevents the Member Reordering feature from tossing members of the marked class. /// </summary> /// <remarks> /// The attribute must be mentioned in your member reordering patterns /// </remarks> [AttributeUsage( AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Enum)] public sealed class NoReorderAttribute : Attribute { } /// <summary> /// XAML attribute. Indicates the type that has <c>ItemsSource</c> property and should be treated /// as <c>ItemsControl</c>-derived type, to enable inner items <c>DataContext</c> type resolve. /// </summary> [AttributeUsage(AttributeTargets.Class)] public sealed class XamlItemsControlAttribute : Attribute { } /// <summary> /// XAML attribute. Indicates the property of some <c>BindingBase</c>-derived type, that /// is used to bind some item of <c>ItemsControl</c>-derived type. This annotation will /// enable the <c>DataContext</c> type resolve for XAML bindings for such properties. /// </summary> /// <remarks> /// Property should have the tree ancestor of the <c>ItemsControl</c> type or /// marked with the <see cref="XamlItemsControlAttribute"/> attribute. /// </remarks> [AttributeUsage(AttributeTargets.Property)] public sealed class XamlItemBindingOfItemsControlAttribute : Attribute { } [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public sealed class AspChildControlTypeAttribute : Attribute { public AspChildControlTypeAttribute([NotNull] string tagName, [NotNull] Type controlType) { TagName = tagName; ControlType = controlType; } [NotNull] public string TagName { get; } [NotNull] public Type ControlType { get; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] public sealed class AspDataFieldAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] public sealed class AspDataFieldsAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property)] public sealed class AspMethodPropertyAttribute : Attribute { } [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public sealed class AspRequiredAttributeAttribute : Attribute { public AspRequiredAttributeAttribute([NotNull] string attribute) { Attribute = attribute; } [NotNull] public string Attribute { get; } } [AttributeUsage(AttributeTargets.Property)] public sealed class AspTypePropertyAttribute : Attribute { public AspTypePropertyAttribute(bool createConstructorReferences) { CreateConstructorReferences = createConstructorReferences; } public bool CreateConstructorReferences { get; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class RazorImportNamespaceAttribute : Attribute { public RazorImportNamespaceAttribute([NotNull] string name) { Name = name; } [NotNull] public string Name { get; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class RazorInjectionAttribute : Attribute { public RazorInjectionAttribute([NotNull] string type, [NotNull] string fieldName) { Type = type; FieldName = fieldName; } [NotNull] public string Type { get; } [NotNull] public string FieldName { get; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class RazorDirectiveAttribute : Attribute { public RazorDirectiveAttribute([NotNull] string directive) { Directive = directive; } [NotNull] public string Directive { get; } } [AttributeUsage(AttributeTargets.Method)] public sealed class RazorHelperCommonAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property)] public sealed class RazorLayoutAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method)] public sealed class RazorWriteLiteralMethodAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method)] public sealed class RazorWriteMethodAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter)] public sealed class RazorWriteMethodParameterAttribute : Attribute { } }
swsch/FacePalm
FacePalm/Properties/Annotations.cs
C#
mit
43,439
package jaci.openrio.toast.core.loader.simulation; import jaci.openrio.toast.lib.state.RobotState; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.Rectangle2D; /** * A GUI Element for switching the Robot State during Simulation * * @author Jaci */ public class GuiRobotState extends JComponent implements MouseListener { RobotState state; int x, y; int width = 100; int height = 30; static final Color bgPassive = new Color(20, 20, 20); static final Color bgClicked = new Color(11, 11, 11); static final Color fgPassive = new Color(100, 100, 100); public GuiRobotState(int x, int y, RobotState state, JPanel parent) { this.x = x; this.y = y; this.state = state; this.setBounds(x, y, width, height); parent.add(this); parent.addMouseListener(this); this.setBackground(bgPassive); this.setForeground(fgPassive); } /** * Paints the component. This calls the super as well as calling the second 'paint()' method that will * draw the button based on the state given in {@link SimulationData} */ public void paintComponent(Graphics g) { super.paintComponent(g); paint((Graphics2D) g); } /** * Paints the object with the new Graphics2D object. This takes data from the {@link SimulationData} class in order * to paint the correct button. */ public void paint(Graphics2D g) { g.setColor(this.getBackground()); g.fillRect(0, 0, width, height); g.setColor(SimulationData.currentState == state ? new Color(100, 170, 100) : this.getForeground()); FontMetrics metrics = g.getFontMetrics(); Rectangle2D textBounds = metrics.getStringBounds(state.state, g); g.drawString(state.state, (float) ((width - textBounds.getWidth()) / 2), (float) ((height - textBounds.getHeight()) / 2 + metrics.getAscent())); } /** * Does a check for whether or not the Mouse exists within the bounds of the button. */ public boolean inBounds(MouseEvent e) { return e.getX() > x && e.getX() < x + width && e.getY() > y && e.getY() < y + height; } /** * Apply this button */ public void apply() { SimulationData.currentState = this.state; repaint(); } /** * Stub Method - Not Used */ @Override public void mouseClicked(MouseEvent e) { } /** * Serves to change the colour of the button to indicate it being depressed. */ @Override public void mousePressed(MouseEvent e) { if (inBounds(e)) { this.setBackground(bgClicked); } this.repaint(); } /** * Invokes the new state change */ @Override public void mouseReleased(MouseEvent e) { if (inBounds(e)) apply(); this.setBackground(bgPassive); this.repaint(); } /** * Stub Method - Not Used */ @Override public void mouseEntered(MouseEvent e) { } /** * Stub Method - Not Used */ @Override public void mouseExited(MouseEvent e) { } }
Open-RIO/ToastAPI
src/main/java/jaci/openrio/toast/core/loader/simulation/GuiRobotState.java
Java
mit
3,232
using System.Resources; 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("TableTennisChampionship.Model")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TableTennisChampionship.Model")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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")]
IvoAtanasov/TableTennisChampionship
TableTennisChampionship/TableTennisChampionship.Model/Properties/AssemblyInfo.cs
C#
mit
1,116
namespace app.home { /** * This class represents example model for data sample. */ export class DataItem { /** * Creates an instance of DataItem. * @param {number} id - ID property of data item. * @param {string} name - Name property of data item. * @constructor */ constructor( public id: number, public name: string ) { } } }
vladanp/angularjs-typescript-grunt-seed
app/scripts/home/data.model.ts
TypeScript
mit
390
angular.module('Eintrag').service('editarService', ['$http', function ($http) { this.editarUsuario = function (data) { return $http.post('http://localhost/Eintrag/www/server.php/editarUsuario', $.param(data)); }; }]);
Jorge-CR/Eintrag
www/app/service/service.editar.js
JavaScript
mit
254
appService.factory('Chats', function() { // Might use a resource here that returns a JSON array // Some fake testing data var chats = [{ id: 0, name: 'Ben Sparrow', lastText: 'You on your way?', face: 'app/view/common/img/ben.png' }, { id: 1, name: 'Max Lynx', lastText: 'Hey, it\'s me', face: 'app/view/common/img/max.png' }, { id: 2, name: 'Adam Bradleyson', lastText: 'I should buy a boat', face: 'app/view/common/img/adam.jpg' }, { id: 3, name: 'Perry Governor', lastText: 'Look at my mukluks!', face: 'app/view/common/img/perry.png' }, { id: 4, name: 'Mike Harrington', lastText: 'This is wicked good ice cream.', face: 'app/view/common/img/mike.png' }]; return { all: function() { return chats; }, remove: function(chat) { chats.splice(chats.indexOf(chat), 1); }, get: function(chatId) { for (var i = 0; i < chats.length; i++) { if (chats[i].id === parseInt(chatId)) { return chats[i]; } } return null; } }; });
pastryTeam/pastry-plugin-base-ionic
replacedata/www/app/view/chatsModule/chatsService.js
JavaScript
mit
1,146
package drone_slam.apps.controlcenter.plugins.attitudechart; import drone_slam.apps.controlcenter.ICCPlugin; import drone_slam.base.IARDrone; import drone_slam.base.navdata.AttitudeListener; import org.jfree.chart.ChartPanel; import javax.swing.*; import java.awt.*; public class AttitudeChartPanel extends JPanel implements ICCPlugin { private IARDrone drone; private AttitudeChart chart; public AttitudeChartPanel() { super(new GridBagLayout()); this.chart = new AttitudeChart(); JPanel chartPanel = new ChartPanel(chart.getChart(), true, true, true, true, true); add(chartPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); } private AttitudeListener attitudeListener = new AttitudeListener() { public void windCompensation(float pitch, float roll) { } public void attitudeUpdated(float pitch, float roll) { } public void attitudeUpdated(float pitch, float roll, float yaw) { chart.setAttitude(pitch / 1000, roll / 1000, yaw / 1000); } }; public void activate(IARDrone drone) { this.drone = drone; drone.getNavDataManager().addAttitudeListener(attitudeListener); } public void deactivate() { drone.getNavDataManager().removeAttitudeListener(attitudeListener); } public String getTitle() { return "Attitude Chart"; } public String getDescription() { return "Displays a chart with the latest pitch, roll and yaw"; } public boolean isVisual() { return true; } public Dimension getScreenSize() { return new Dimension(330, 250); } public Point getScreenLocation() { return new Point(330, 390); } public JPanel getPanel() { return this; } }
YangMann/drone-slam
drone-slam/src/drone_slam/apps/controlcenter/plugins/attitudechart/AttitudeChartPanel.java
Java
mit
1,902
package org.osiam.client; /* * for licensing see the file license.txt. */ import static org.apache.http.HttpStatus.SC_FORBIDDEN; import static org.apache.http.HttpStatus.SC_OK; import static org.apache.http.HttpStatus.SC_UNAUTHORIZED; import static org.apache.http.HttpStatus.SC_CONFLICT; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.entity.ContentType; import org.apache.http.impl.client.DefaultHttpClient; import org.osiam.client.exception.ConflictException; import org.osiam.client.exception.ConnectionInitializationException; import org.osiam.client.exception.ForbiddenException; import org.osiam.client.exception.NoResultException; import org.osiam.client.exception.UnauthorizedException; import org.osiam.client.oauth.AccessToken; import org.osiam.client.query.Query; import org.osiam.client.query.QueryResult; import org.osiam.client.update.UpdateUser; import org.osiam.resources.scim.User; /** * The OsiamUserService provides all methods necessary to manipulate the User-entries registered in the * given OSIAM installation. For the construction of an instance please use the included {@link OsiamUserService.Builder} */ public final class OsiamUserService extends AbstractOsiamService<User> { // NOSONAR - Builder constructs instances of this class /** * The private constructor for the OsiamUserService. Please use the {@link OsiamUserService.Builder} * to construct one. * * @param userWebResource a valid WebResource to connect to a given OSIAM server */ private OsiamUserService(Builder builder) { super(builder); } /** * Retrieve a single User with the given id. If no user for the given id can be found a {@link NoResultException} * is thrown. * * @param id the id of the wanted user * @param accessToken the OSIAM access token from for the current session * @return the user with the given id * @throws org.osiam.client.exception.UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.NoResultException if no user with the given id can be found * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws org.osiam.client.exception.ConnectionInitializationException * if the connection to the given OSIAM service could not be initialized */ public User getUser(String id, AccessToken accessToken) { return getResource(id, accessToken); } /** * Retrieve the User who holds the given access token. * Not to be used for the grant Client-Credentials * @param accessToken the OSIAM access token from for the current session * @return the actual logged in user * @throws UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws ConnectionInitializationException * if no connection to the given OSIAM services could be initialized */ public User getMeBasic(AccessToken accessToken) { final User user; if (accessToken == null) { // NOSONAR - false-positive from clover; if-expression is correct throw new IllegalArgumentException("The given accessToken can't be null."); } try { DefaultHttpClient httpclient = new DefaultHttpClient(); HttpGet realWebresource = createRealWebResource(accessToken); realWebresource.setURI(new URI(getMeWebResource().getURI().toString())); HttpResponse response = httpclient.execute(realWebresource); int httpStatus = response.getStatusLine().getStatusCode(); if (httpStatus != SC_OK) { // NOSONAR - false-positive from clover; if-expression is correct String errorMessage; switch (httpStatus) { case SC_UNAUTHORIZED: errorMessage = getErrorMessage(response, "You are not authorized to access OSIAM. Please make sure your access token is valid"); throw new UnauthorizedException(errorMessage); case SC_FORBIDDEN: errorMessage = "Insufficient scope (" + accessToken.getScope() + ") to retrieve the actual User."; throw new ForbiddenException(errorMessage); case SC_CONFLICT: errorMessage = getErrorMessage(response, "Unable to retrieve the actual User."); throw new ConflictException(errorMessage); default: errorMessage = getErrorMessage(response, String.format("Unable to setup connection (HTTP Status Code: %d)", httpStatus)); throw new ConnectionInitializationException(errorMessage); } } InputStream content = response.getEntity().getContent(); user = mapSingleResourceResponse(content); return user; } catch (IOException | URISyntaxException e) { throw new ConnectionInitializationException("Unable to setup connection", e); } } /** * Retrieve the User who holds the given access token. * Not to be used for the grant Client-Credentials * @param accessToken the OSIAM access token from for the current session * @return the actual logged in user * @throws UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws ConnectionInitializationException * if no connection to the given OSIAM services could be initialized */ public User getMe(AccessToken accessToken) { final User user; if (accessToken == null) { // NOSONAR - false-positive from clover; if-expression is correct throw new IllegalArgumentException("The given accessToken can't be null."); } try { DefaultHttpClient httpclient = new DefaultHttpClient(); HttpGet realWebresource = createRealWebResource(accessToken); realWebresource.setURI(new URI(getUri() + "/me")); HttpResponse response = httpclient.execute(realWebresource); int httpStatus = response.getStatusLine().getStatusCode(); if (httpStatus != SC_OK) { // NOSONAR - false-positive from clover; if-expression is correct String errorMessage; switch (httpStatus) { case SC_UNAUTHORIZED: errorMessage = getErrorMessage(response, "You are not authorized to access OSIAM. Please make sure your access token is valid"); throw new UnauthorizedException(errorMessage); case SC_FORBIDDEN: errorMessage = "Insufficient scope (" + accessToken.getScope() + ") to retrieve the actual User."; throw new ForbiddenException(errorMessage); case SC_CONFLICT: errorMessage = getErrorMessage(response, "Unable to retrieve the actual User."); throw new ConflictException(errorMessage); default: errorMessage = getErrorMessage(response, String.format("Unable to setup connection (HTTP Status Code: %d)", httpStatus)); throw new ConnectionInitializationException(errorMessage); } } InputStream content = response.getEntity().getContent(); user = mapSingleResourceResponse(content); return user; } catch (IOException | URISyntaxException e) { throw new ConnectionInitializationException("Unable to setup connection", e); } } protected HttpGet getMeWebResource() { HttpGet webResource; try { webResource = new HttpGet(new URI(getEndpoint() + "/me")); webResource.addHeader("Accept", ContentType.APPLICATION_JSON.getMimeType()); } catch (URISyntaxException e) { throw new ConnectionInitializationException("Unable to setup connection " + getEndpoint() + "is not a valid URI.", e); } return webResource; } /** * Retrieve a list of the of all {@link User} resources saved in the OSIAM service. * If you need to have all User but the number is very big, this method can be slow. * In this case you can also use Query.Builder with no filter to split the number of User returned * * @param accessToken * @return a list of all Users * @throws org.osiam.client.exception.UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws org.osiam.client.exception.ConnectionInitializationException * if the connection to the given OSIAM service could not be initialized */ public List<User> getAllUsers(AccessToken accessToken) { return super.getAllResources(accessToken); } /** * Search for the existing Users by a given search string. For more detailed information about the possible * logical operators and usable fields please have a look into the wiki.<p> * <b>Note:</b> The query string should be URL encoded! * * @param queryString The URL encoded string with the query that should be passed to the OSIAM service * @param accessToken the OSIAM access token from for the current session * @return a QueryResult Containing a list of all found Users * @throws org.osiam.client.exception.UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws org.osiam.client.exception.ConnectionInitializationException * if the connection to the given OSIAM service could not be initialized * @see <a href="https://github.com/osiam/connector4java/wiki/Working-with-user#search-for-user">https://github.com/osiam/connector4java/wiki/Working-with-user#search-for-user</a> */ public QueryResult<User> searchUsers(String queryString, AccessToken accessToken) { return super.searchResources(queryString, accessToken); } /** * Search for existing Users by the given {@link Query}. * * @param query containing the query to execute. * @param accessToken the OSIAM access token from for the current session * @return a QueryResult Containing a list of all found Users * @throws org.osiam.client.exception.UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws org.osiam.client.exception.ConnectionInitializationException * if the connection to the given OSIAM service could not be initialized */ public QueryResult<User> searchUsers(Query query, AccessToken accessToken) { return super.searchResources(query, accessToken); } /** * delete the given {@link User} at the OSIAM DB. * @param id id of the User to be delete * @param accessToken the OSIAM access token from for the current session * @throws org.osiam.client.exception.UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.NoResultException if no user with the given id can be found * @throws org.osiam.client.exception.ConflictException if the User could not be deleted * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws org.osiam.client.exception.ConnectionInitializationException * if the connection to the given OSIAM service could not be initialized */ public void deleteUser(String id, AccessToken accessToken) { deleteResource(id, accessToken); } /** * saves the given {@link User} to the OSIAM DB. * @param user user to be saved * @param accessToken the OSIAM access token from for the current session * @return the same user Object like the given but with filled metadata and a new valid id * @throws org.osiam.client.exception.UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.ConflictException if the User could not be created * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws org.osiam.client.exception.ConnectionInitializationException * if the connection to the given OSIAM service could not be initialized */ public User createUser(User user, AccessToken accessToken) { return createResource(user, accessToken); } /** * update the user of the given id with the values given in the User Object. * For more detailed information how to set new field, update Fields or to delete Fields please look in the wiki * @param id if of the User to be updated * @param updateUser all Fields that need to be updated * @param accessToken the OSIAM access token from for the current session * @return the updated User Object with all new Fields * @see <a href="https://github.com/osiam/connector4java/wiki/Working-with-user">https://github.com/osiam/connector4java/wiki/Working-with-user</a> * @throws org.osiam.client.exception.UnauthorizedException if the request could not be authorized. * @throws org.osiam.client.exception.ConflictException if the User could not be updated * @throws org.osiam.client.exception.NotFoundException if no group with the given id can be found * @throws org.osiam.client.exception.ForbiddenException if the scope doesn't allow this request * @throws org.osiam.client.exception.ConnectionInitializationException * if the connection to the given OSIAM service could not be initialized */ public User updateUser(String id, UpdateUser updateUser , AccessToken accessToken){ if (updateUser == null) { // NOSONAR - false-positive from clover; if-expression is correct throw new IllegalArgumentException("The given updateUser can't be null."); } return updateResource(id, updateUser.getScimConformUpdateUser(), accessToken); } /** * The Builder class is used to construct instances of the {@link OsiamUserService} */ public static class Builder extends AbstractOsiamService.Builder<User> { /** * Set up the Builder for the construction of an {@link OsiamUserService} instance for the OSIAM service at * the given endpoint * * @param endpoint The URL at which the OSIAM server lives. */ public Builder(String endpoint) { super(endpoint); } /** * constructs an OsiamUserService with the given values * * @return a valid OsiamUserService */ public OsiamUserService build() { return new OsiamUserService(this); } } }
wallner/connector4java
src/main/java/org/osiam/client/OsiamUserService.java
Java
mit
15,934
<?php namespace Ahs\BlogBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class AhsBlogBundle extends Bundle { }
OlivierParent/WDAD-III
src/Ahs/BlogBundle/AhsBlogBundle.php
PHP
mit
122
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package lila.runtime; import java.io.PrintWriter; import java.io.StringWriter; /** * <p>A PrintWriter that maintains a String as its backing store.</p> * * <p>Usage: * <pre> * StringPrintWriter out = new StringPrintWriter(); * printTo(out); * System.out.println( out.getString() ); * </pre> * </p> * * @author Alex Chaffee * @author Scott Stanchfield * @author Gary D. Gregory * @since 2.0 */ class StringPrintWriter extends PrintWriter { /** * Constructs a new instance. */ public StringPrintWriter() { super(new StringWriter()); } /** * Constructs a new instance using the specified initial string-buffer * size. * * @param initialSize an int specifying the initial size of the buffer. */ public StringPrintWriter(int initialSize) { super(new StringWriter(initialSize)); } /** * <p>Since toString() returns information *about* this object, we * want a separate method to extract just the contents of the * internal buffer as a String.</p> * * @return the contents of the internal string buffer */ public String getString() { flush(); return ((StringWriter) this.out).toString(); } }
turbolent/lila
src/java/lila/runtime/StringPrintWriter.java
Java
mit
1,802
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ControlPanelPlugin { public class ButtonItem : PanelItem { public Constants.Panel.SwitchId Switch; public bool State = false; public ButtonItem(Constants.Panel.SwitchId button, bool state) { Switch = button; this.State = state; var connection = ConnectionManager.Instance.Connection; connection.RegisterHandler(SerialConnection.MsgType.GroupState, InputMessageHandler); } protected void InputMessageHandler(SerialConnection.MsgType type, byte size, System.IO.BinaryReader stream) { if (type != SerialConnection.MsgType.GroupState) return; byte id = stream.ReadByte(); byte state = stream.ReadByte(); var switchId = (Constants.Panel.SwitchId)id; if (switchId != Switch) return; HandleSwitchStateMsg(switchId, state == 1); } protected virtual void HandleSwitchStateMsg(Constants.Panel.SwitchId switchId, bool state) { State = state; } public override bool Update() { return true; } } }
SpikE4343/control-panel
plugin/Items/ButtonItem.cs
C#
mit
1,175
import { AppRegistry } from "react-native"; import App from "./App"; AppRegistry.registerComponent("KeepTheBallGame", () => App);
react-native-sensors/react-native-sensors
examples/KeepTheBallGame/index.js
JavaScript
mit
131
package main import "fmt" // returns a function that returns an int func fibonacci() func() int { old_fib :=-1 fib := 1 return func() int { fib, old_fib = fib + old_fib, fib return fib } } func main() { f := fibonacci() for i := 0; i < 10; i++ { fmt.Println(f()) } }
wm/going
03_closures.go
GO
mit
297
#include "cxxsource.h" CxxSource::CxxSource() { }
dmleontiev9000/AsicEditor
Cxx/cxxsource.cpp
C++
mit
53
# coding: utf8 from wsgidav.dav_provider import DAVCollection, DAVNonCollection from wsgidav.dav_error import DAVError, HTTP_FORBIDDEN from wsgidav import util from wsgidav.addons.tracim import role, MyFileStream from time import mktime from datetime import datetime from os.path import normpath, dirname, basename try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class Root(DAVCollection): def __init__(self, path, environ): super(Root, self).__init__(path, environ) def __repr__(self): return 'Root folder' def getCreationDate(self): return mktime(datetime.now().timetuple()) def getDisplayName(self): return 'Tracim - Home' def getLastModified(self): return mktime(datetime.now().timetuple()) def getMemberNames(self): return self.provider.get_all_workspaces(only_name=True) def getMember(self, workspace_name): workspace = self.provider.get_workspace({'label': workspace_name}) if not self.provider.has_right( self.environ["http_authenticator.username"], workspace.workspace_id, role["READER"] ): return None return Workspace(self.path + workspace.label, self.environ, workspace) def createEmptyResource(self, name): raise DAVError(HTTP_FORBIDDEN) def createCollection(self, name): raise DAVError(HTTP_FORBIDDEN) def getMemberList(self): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) return memberlist class Workspace(DAVCollection): def __init__(self, path, environ, workspace): super(Workspace, self).__init__(path, environ) self.workspace = workspace def __repr__(self): return "Workspace: %s" % self.workspace.label def getCreationDate(self): return mktime(self.workspace.created.timetuple()) def getDisplayName(self): return self.workspace.label def getLastModified(self): return mktime(self.workspace.updated.timetuple()) def getMemberNames(self): return self.provider.get_workspace_children_id(self.workspace) def getMember(self, item_id): item = self.provider.get_item({'id': item_id, 'child_revision_id': None}) if not self.provider.has_right( self.environ["http_authenticator.username"], item.workspace_id, role["READER"] ): return None return Folder(self.path + item.item_name, self.environ, item) def createEmptyResource(self, name): raise DAVError(HTTP_FORBIDDEN) def createCollection(self, name): assert "/" not in name if not self.provider.has_right( self.environ["http_authenticator.username"], self.workspace.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) item = self.provider.add_item( item_name=name, item_type="FOLDER", workspace_id=self.workspace.workspace_id ) return Folder(self.path + name, self.environ, item) def delete(self): if not self.provider.has_right( self.environ["http_authenticator.username"], self.workspace.workspace_id, role["WORKSPACE_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) self.provider.delete_workspace(self.workspace) self.removeAllLocks(True) def copyMoveSingle(self, destpath, ismove): if ismove: self.provider.set_workspace_label(self.workspace, basename(normpath(destpath))) else: self.provider.add_workspace(basename(normpath(destpath))) def supportRecursiveMove(self, destpath): return True def moveRecursive(self, destpath): if not self.provider.has_right( self.environ["http_authenticator.username"], self.workspace.workspace_id, role["WORKSPACE_MANAGER"] ) or dirname(normpath(destpath)) != '/': raise DAVError(HTTP_FORBIDDEN) self.provider.set_workspace_label(self.workspace, basename(normpath(destpath))) def setLastModified(self, destpath, timestamp, dryrun): return False def getMemberList(self): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) return memberlist class Folder(DAVCollection): def __init__(self, path, environ, item): super(Folder, self).__init__(path, environ) self.item = item def __repr__(self): return "Folder: %s" % self.item.item_name def getCreationDate(self): return mktime(self.item.created.timetuple()) def getDisplayName(self): return self.item.item_name def getLastModified(self): return mktime(self.item.updated.timetuple()) def getMemberNames(self): return self.provider.get_item_children(self.item.id) def getMember(self, item_id): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"] ): return None item = self.provider.get_item({'id': item_id, 'child_revision_id': None}) return self.provider.getResourceInst(self.path + item.item_name, self.environ) def createEmptyResource(self, name): assert "/" not in name if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTRIBUTOR"] ): raise DAVError(HTTP_FORBIDDEN) item = self.provider.add_item( item_name=name, item_type="FILE", workspace_id=self.item.workspace_id, parent_id=self.item.id ) return File(self.path + name, self.environ, item) def createCollection(self, name): assert "/" not in name if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) item = self.provider.add_item( item_name=name, item_type="FOLDER", workspace_id=self.item.workspace_id, parent_id=self.item.id ) return Folder(self.path + name, self.environ, item) def delete(self): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) self.provider.delete_item(self.item) self.removeAllLocks(True) def copyMoveSingle(self, destpath, ismove): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ) or dirname(normpath(destpath)) == '/': raise DAVError(HTTP_FORBIDDEN) if ismove: self.provider.move_item(self.item, destpath) else: self.provider.copy_item(self.item, destpath) def supportRecursiveMove(self, destpath): return True def moveRecursive(self, destpath): self.copyMoveSingle(destpath, True) def setLastModified(self, destpath, timestamp, dryrun): return False def getMemberList(self, copyOrMove=False): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) print "j'ai : ", copyOrMove if memberlist != [] and not copyOrMove: memberlist.append(HistoryFolder(self.path + ".history", self.environ, self.item)) return memberlist def getDescendants(self, collections=True, resources=True, depthFirst=False, depth="infinity", addSelf=False, copyOrMove=False): assert depth in ("0", "1", "infinity") res = [] if addSelf and not depthFirst: res.append(self) if depth != "0" and self.isCollection: for child in self.getMemberList(copyOrMove): if not child: _ = self.getMemberList(copyOrMove) want = (collections and child.isCollection) or (resources and not child.isCollection) if want and not depthFirst: res.append(child) if child.isCollection and depth == "infinity": res.extend(child.getDescendants(collections, resources, depthFirst, depth, addSelf=False, copyOrMove=copyOrMove)) if want and depthFirst: res.append(child) if addSelf and depthFirst: res.append(self) return res class HistoryFolder(Folder): def __init__(self, path, environ, item): super(HistoryFolder, self).__init__(path, environ, item) def __repr__(self): return "Folder history of : %s" % self.item.item_name def getCreationDate(self): return mktime(datetime.now().timetuple()) def getDisplayName(self): return '.history' def getLastModified(self): return mktime(datetime.now().timetuple()) def getMember(self, item_id): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"] ): return None item = self.provider.get_item({'id': item_id, 'child_revision_id': None}) if item.item_type == 'FOLDER': return None return HistoryFileFolder(self.path + item.item_name, self.environ, item) def createEmptyResource(self, name): raise DAVError(HTTP_FORBIDDEN) def createCollection(self, name): raise DAVError(HTTP_FORBIDDEN) def handleDelete(self): return True def handleCopy(self, destPath, depthInfinity): return True def handleMove(self, destPath): return True def setLastModified(self, destpath, timestamp, dryrun): return False def getMemberList(self, copyOrMove=False): memberlist = [] for name in self.getMemberNames(): member = self.getMember(name) if member is not None: memberlist.append(member) return memberlist class HistoryFileFolder(HistoryFolder): def __init__(self, path, environ, item): super(HistoryFileFolder, self).__init__(path, environ, item) def __repr__(self): return "File folder history of : %s" % self.item.item_name def getCreationDate(self): return mktime(datetime.now().timetuple()) def getDisplayName(self): return self.item.item_name def createCollection(self, name): raise DAVError(HTTP_FORBIDDEN) def getLastModified(self): return mktime(datetime.now().timetuple()) def getMemberNames(self): return self.provider.get_all_revisions_from_item(self.item, only_id=True) def getMember(self, item_id): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"]): return None item = self.provider.get_item({'id': item_id}) if item.item_type in ["FILE"]: return HistoryFile(self.path + str(item.id) + '-' + item.item_name , self.environ, item) else: return HistoryOtherFile(self.path + str(item.id) + '-' + item.item_name, self.environ, item) class File(DAVNonCollection): def __init__(self, path, environ, item): super(File, self).__init__(path, environ) self.item = item self.filestream = MyFileStream(self.provider, self.item) def __repr__(self): return "File: %s" % self.item.item_name def getContentLength(self): return len(self.item.item_content) def getContentType(self): return util.guessMimeType(self.item.item_name) def getCreationDate(self): return mktime(self.item.created.timetuple()) def getDisplayName(self): return self.item.item_name def getLastModified(self): return mktime(self.item.updated.timetuple()) def getContent(self): filestream = StringIO() filestream.write(self.item.item_content) filestream.seek(0) return filestream def beginWrite(self, contentType=None): return self.filestream def delete(self): if not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["CONTENT_MANAGER"] ): raise DAVError(HTTP_FORBIDDEN) self.provider.delete_item(self.item) self.removeAllLocks(True) def copyMoveSingle(self, destpath, ismove): if not self.provider.has_right( self.environ["http_authenticator.username"], self.provider.get_workspace_id_from_path(destpath), role["CONTRIBUTOR"] ) or not self.provider.has_right( self.environ["http_authenticator.username"], self.item.workspace_id, role["READER"] ) or dirname(normpath(destpath)) == '/' \ or dirname(dirname(normpath(destpath))) == '/': raise DAVError(HTTP_FORBIDDEN) if ismove: self.provider.move_all_revisions(self.item, destpath) else: self.provider.copy_item(self.item, destpath) def supportRecursiveMove(self, dest): return True def moveRecursive(self, destpath): self.copyMoveSingle(destpath, True) def setLastModified(self, dest, timestamp, dryrun): return False class HistoryFile(File): def __init__(self, path, environ, item): super(HistoryFile, self).__init__(path, environ, item) def __repr__(self): return "File history: %s-%s" % (self.item.item_name, self.item.id) def getDisplayName(self): return str(self.item.id) + '-' + self.item.item_name def beginWrite(self, contentType=None): raise DAVError(HTTP_FORBIDDEN) def delete(self): raise DAVError(HTTP_FORBIDDEN) def handleDelete(self): return True def handleCopy(self, destPath, depthInfinity): return True def handleMove(self, destPath): return True def copyMoveSingle(self, destpath, ismove): raise DAVError(HTTP_FORBIDDEN) class OtherFile(File): def __init__(self, path, environ, item): super(OtherFile, self).__init__(path, environ, item) self.content = self.design(self.item.item_content) def __repr__(self): return "File: %s" % self.item.item_name def getContentLength(self): return len(self.content) def getContentType(self): return 'text/html' def getContent(self): filestream = StringIO() filestream.write(self.content) filestream.seek(0) return filestream def design(self, content): f = open('wsgidav/addons/tracim/style.css', 'r') style = f.read() f.close() file = ''' <html> <head> <title>Hey</title> <style>%s</style> </head> <body> <div> %s </div> </body> </html> ''' % (style, content) return file class HistoryOtherFile(OtherFile): def __init__(self, path, environ, item): super(HistoryOtherFile, self).__init__(path, environ, item) self.content = self.design(self.item.item_content) def __repr__(self): return "File history: %s-%s" % (self.item.item_name, self.item.id) def getDisplayName(self): return str(self.item.id) + '-' + self.item.item_name def beginWrite(self, contentType=None): raise DAVError(HTTP_FORBIDDEN) def delete(self): raise DAVError(HTTP_FORBIDDEN) def handleDelete(self): return True def handleCopy(self, destPath, depthInfinity): return True def handleMove(self, destPath): return True def copyMoveSingle(self, destpath, ismove): raise DAVError(HTTP_FORBIDDEN)
tracim/tracim-webdav
wsgidav/addons/tracim/sql_resources.py
Python
mit
16,929
module Cardjour module VERSION #:nodoc: MAJOR = 0 MINOR = 1 TINY = 0 STRING = [MAJOR, MINOR, TINY].join('.') end end
siuying/cardjour
pkg/cardjour-0.1.0/lib/cardjour/version.rb
Ruby
mit
139
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.CompilerServices; namespace MS.Internal { // WPF's builds are seeing warnings as a result of using LocalAppContext in mutliple assemblies. // that have internalsVisibleTo attribute set between them - which results in the warning. // We don't have a way of suppressing this warning effectively until the shared copies of LocalAppContext and // AppContextDefaultValues have pragmas added to suppress warning 436 #pragma warning disable 436 internal static class BuildTasksAppContextSwitches { #region DoNotUseSha256ForMarkupCompilerChecksumAlgorithm internal const string DoNotUseSha256ForMarkupCompilerChecksumAlgorithmSwitchName = "Switch.System.Windows.Markup.DoNotUseSha256ForMarkupCompilerChecksumAlgorithm"; private static int _doNotUseSha256ForMarkupCompilerChecksumAlgorithm; public static bool DoNotUseSha256ForMarkupCompilerChecksumAlgorithm { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return LocalAppContext.GetCachedSwitchValue(DoNotUseSha256ForMarkupCompilerChecksumAlgorithmSwitchName, ref _doNotUseSha256ForMarkupCompilerChecksumAlgorithm); } } #endregion } #pragma warning restore 436 }
lindexi/lindexi_gd
PresentationBuildTasksTest/WPF/PresentationBuildTasks/MS/Internal/BuildTasksAppContextSwitches.cs
C#
mit
1,510
import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import AppBar from 'material-ui/AppBar'; import Tabs, { Tab } from 'material-ui/Tabs'; import PhoneIcon from '@material-ui/icons/Phone'; import FavoriteIcon from '@material-ui/icons/Favorite'; import PersonPinIcon from '@material-ui/icons/PersonPin'; import HelpIcon from '@material-ui/icons/Help'; import ShoppingBasket from '@material-ui/icons/ShoppingBasket'; import ThumbDown from '@material-ui/icons/ThumbDown'; import ThumbUp from '@material-ui/icons/ThumbUp'; import Typography from 'material-ui/Typography'; function TabContainer(props) { return ( <Typography component="div" style={{ padding: 8 * 3 }}> {props.children} </Typography> ); } TabContainer.propTypes = { children: PropTypes.node.isRequired, }; const styles = theme => ({ root: { flexGrow: 1, width: '100%', backgroundColor: theme.palette.background.paper, }, }); class ScrollableTabsButtonPrevent extends React.Component { state = { value: 0, }; handleChange = (event, value) => { this.setState({ value }); }; render() { const { classes } = this.props; const { value } = this.state; return ( <div className={classes.root}> <AppBar position="static"> <Tabs value={value} onChange={this.handleChange} scrollable scrollButtons="off"> <Tab icon={<PhoneIcon />} /> <Tab icon={<FavoriteIcon />} /> <Tab icon={<PersonPinIcon />} /> <Tab icon={<HelpIcon />} /> <Tab icon={<ShoppingBasket />} /> <Tab icon={<ThumbDown />} /> <Tab icon={<ThumbUp />} /> </Tabs> </AppBar> {value === 0 && <TabContainer>Item One</TabContainer>} {value === 1 && <TabContainer>Item Two</TabContainer>} {value === 2 && <TabContainer>Item Three</TabContainer>} {value === 3 && <TabContainer>Item Four</TabContainer>} {value === 4 && <TabContainer>Item Five</TabContainer>} {value === 5 && <TabContainer>Item Six</TabContainer>} {value === 6 && <TabContainer>Item Seven</TabContainer>} </div> ); } } ScrollableTabsButtonPrevent.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(ScrollableTabsButtonPrevent);
cherniavskii/material-ui
docs/src/pages/demos/tabs/ScrollableTabsButtonPrevent.js
JavaScript
mit
2,367
using System.Collections.Generic; namespace Greg.Requests { public class PackageVersionUploadRequestBody : RequestBody { internal PackageVersionUploadRequestBody() { } public PackageVersionUploadRequestBody(string name, string version, string description, IEnumerable<string> keywords, string contents, string engine, string engineVersion, string metadata, string group, IEnumerable<PackageDependency> dependencies, string siteUrl, string repositoryUrl, bool containsBinaries, IEnumerable<string> nodeLibraryNames ) { this.name = name; this.version = version; this.description = description; this.dependencies = dependencies; this.keywords = keywords; this.contents = contents; this.engine = engine; this.group = group; this.engine_version = engineVersion; this.engine_metadata = metadata; this.site_url = siteUrl; this.repository_url = repositoryUrl; this.contains_binaries = containsBinaries; this.node_libraries = nodeLibraryNames; } public string file_hash { get; set; } public string name { get; set; } public string version { get; set; } public string description { get; set; } public string group { get; set; } public IEnumerable<string> keywords { get; set; } public IEnumerable<PackageDependency> dependencies { get; set; } public string contents { get; set; } public string engine_version { get; set; } public string engine { get; set; } public string engine_metadata { get; set; } public string site_url { get; set; } public string repository_url { get; set; } public bool contains_binaries { get; set; } public IEnumerable<string> node_libraries { get; set; } } }
Benglin/GRegClientNET
src/GregClient/Requests/PackageVersionUploadRequestBody.cs
C#
mit
2,001
package xsierra.digitguesser.drawer.pipeline; import java.awt.image.BufferedImage; public interface DigitPipeline { /** * @param image An image that contains a drawed digit * @return the guessed digit, a number between 0 - 9 */ byte imageGuessDigit(BufferedImage image); }
xaviersierra/digit-guesser
drawer/src/main/java/xsierra/digitguesser/drawer/pipeline/DigitPipeline.java
Java
mit
299
package connect.view; import android.content.Context; import android.util.AttributeSet; import connect.view.roundedimageview.RoundedImageView; /** * Created by Administrator on 2016/12/15. */ public class HightEqWidthRounderImage extends RoundedImageView { public HightEqWidthRounderImage(Context context) { super(context); } public HightEqWidthRounderImage(Context context, AttributeSet attrs) { super(context, attrs); } public HightEqWidthRounderImage(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, widthMeasureSpec); } }
connectim/Android
app/src/main/java/connect/view/HightEqWidthRounderImage.java
Java
mit
759
package com.sind.projectx.domain.food.menu; import org.hibernate.validator.constraints.NotBlank; import org.hibernate.validator.constraints.NotEmpty; import java.util.ArrayList; import java.util.List; /** * @author Dmytro Bekuzarov */ public class MenuSection { @NotBlank private String name; @NotEmpty private List<String> items = new ArrayList<>(); private List<MenuSection> sections = new ArrayList<>(); public String getName() { return name; } public void setName(String name) { this.name = name; } public List<String> getItems() { return items; } public void setItems(List<String> items) { this.items = items; } public List<MenuSection> getSections() { return sections; } public void setSections(List<MenuSection> sections) { this.sections = sections; } }
dmytro-bekuzarov/projectx-api
projectx-api-domain/src/main/java/com/sind/projectx/domain/food/menu/MenuSection.java
Java
mit
890
/* Binary Tree Upside Down Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it upside down and turn it into a tree where the original right nodes turned into left leaf nodes. Return the new root. For example: Given a binary tree {1,2,3,4,5}, 1 / \ 2 3 / \ 4 5 return the root of the binary tree [4,5,2,#,#,3,1]. 4 / \ 5 2 / \ 3 1 confused what "{1,#,2,3}" means? > read more on how binary tree is serialized on OJ. Hide Tags Tree Hide Similar Problems (E) Reverse Linked List */ /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution { public TreeNode upsideDownBinaryTree(TreeNode root) { TreeNode p = root, parent = null, parentRight = null; while (p!=null) { TreeNode left = p.left; p.left = parentRight; parentRight = p.right; p.right = parent; parent = p; p = left; } return parent; } } /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution { public TreeNode upsideDownBinaryTree(TreeNode root) { if(root==null)return root; if(root.left==null && root.right==null)return root; TreeNode newRoot = upsideDownBinaryTree(root.left); root.left.left=root.right; root.left.right=root; root.left=null; root.right=null; return newRoot; } } /* 1 /\ 2 3 /\ 4 5 1 / 2 -3 / 4 - 5 */
Yujia-Xiao/Leetcode
List/Binary_Tree_Upside_Down.java
Java
mit
1,805
import { lighten } from 'polished'; import { css } from '@emotion/react'; import styled from '@emotion/styled'; import { colors } from './colors'; export const outer = css` position: relative; padding: 0 5vw; `; // Centered content container blocks export const inner = css` margin: 0 auto; max-width: 1040px; width: 100%; `; export const SiteNavMain = css` position: fixed; top: 0; right: 0; left: 0; z-index: 1000; /* background: color(var(--darkgrey) l(-5%)); */ background: ${lighten('-0.05', colors.darkgrey)}; `; export const SiteMain = css` flex-grow: 1; @media (prefers-color-scheme: dark) { background: ${colors.darkmode}; } `; export const SiteTitle = styled.h1` z-index: 10; margin: 0 0 0 -2px; padding: 0; font-size: 5rem; line-height: 1em; font-weight: 600; @media (max-width: 500px) { font-size: 4.2rem; } `; export const SiteDescription = styled.h2` z-index: 10; margin: 0; padding: 5px 0; font-size: 2.1rem; line-height: 1.4em; font-weight: 400; opacity: 0.8; @media (max-width: 500px) { font-size: 1.8rem; } `; export const Posts = css` overflow-x: hidden; `; export const PostFeed = css` position: relative; display: flex; flex-wrap: wrap; margin: 0 -20px; padding: 50px 0 0; background: #fff; /* Special Template Styles */ padding: 40px 0 5vw; border-top-left-radius: 3px; border-top-right-radius: 3px; @media (prefers-color-scheme: dark) { background: ${colors.darkmode}; } `; export const SocialLink = css` display: inline-block; margin: 0; padding: 10px; opacity: 0.8; :hover { opacity: 1; } svg { height: 1.8rem; fill: #fff; } `; export const SocialLinkFb = css` svg { height: 1.6rem; } `; export const SiteHeader = css``; export const SiteHeaderContent = styled.div` z-index: 100; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6vw 3vw; min-height: 200px; max-height: 340px; `; export const SiteHeaderStyles = css` position: relative; /* margin-top: 64px; */ padding-bottom: 12px; color: #fff; /* background: color(var(--darkgrey) l(-5%)) no-repeat center center; */ background: ${lighten('-0.05', colors.darkgrey)} no-repeat center center; background-size: cover; :before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; display: block; background: rgba(0, 0, 0, 0.18); } :after { content: ''; position: absolute; top: 0; right: 0; bottom: auto; left: 0; z-index: 10; display: block; height: 140px; background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)); } @media (prefers-color-scheme: dark) { :before { background: rgba(0, 0, 0, 0.6); } } `; export const AuthorProfileImage = css` flex: 0 0 60px; margin: 0; width: 60px; height: 60px; border: none; @media (prefers-color-scheme: dark) { box-shadow: 0 0 0 6px hsla(0, 0%, 100%, 0.04); background: ${colors.darkmode}; } `; // tag and author post lists export const SiteArchiveHeader = css` .site-header-content { position: relative; align-items: stretch; padding: 12vw 0 20px; min-height: 200px; max-height: 600px; } `; export const SiteHeaderBackground = css` margin-top: 64px; `; export const ResponsiveHeaderBackground = styled.div<{ backgroundImage?: string }>` ${p => p.backgroundImage && ` position: relative; margin-top: 64px; padding-bottom: 12px; color: #fff; background-size: cover; /* background: color(var(--darkgrey) l(-5%)) no-repeat center center; */ background: #090a0b no-repeat 50%; background-image: url(${p.backgroundImage}); :before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; display: block; background: rgba(0, 0, 0, 0.18); } :after { content: ''; position: absolute; top: 0; right: 0; bottom: auto; left: 0; z-index: 10; display: block; height: 140px; background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)); } @media (prefers-color-scheme: dark) { &:before { background: rgba(0, 0, 0, 0.6); } } `} ${p => !p.backgroundImage && ` padding-top: 0; padding-bottom: 0; /* color: var(--darkgrey); */ color: ${colors.darkgrey}; background: #fff; opacity: 1; .site-description { /* color: var(--midgrey); */ color: ${colors.midgrey}; opacity: 1; } .site-header-content { padding: 5vw 0 10px; /* border-bottom: 1px solid color(var(--lightgrey) l(+12%)); */ border-bottom: 1px solid ${lighten('0.12', colors.lightgrey)}; } .author-bio { /* color: var(--midgrey); */ color: ${colors.midgrey}; opacity: 1; } .author-meta { /* color: var(--midgrey); */ color: ${colors.midgrey}; opacity: 1; } .author-social-link a { /* color: var(--darkgrey); */ color: ${colors.darkgrey}; } .author-social-link a:before { /* color: var(--midgrey); */ color: ${colors.midgrey}; } .author-location + .author-stats:before, .author-stats + .author-social-link:before, .author-social-link + .author-social-link:before { /* color: var(--midgrey); */ color: ${colors.midgrey}; } .author-header { padding-bottom: 20px; } @media (max-width: 500px) { .site-header-content { flex-direction: column; align-items: center; min-height: unset; } .site-title { font-size: 4.2rem; text-align: center; } .site-header-content { padding: 12vw 0 20px; } .author-header { padding-bottom: 10px; } } @media (prefers-color-scheme: dark) { color: rgba(255, 255, 255, 0.9); /* background: var(--darkmode); */ background: ${colors.darkmode}; .site-header-content { /* border-bottom-color: color(var(--darkmode) l(+15%)); */ /* border-bottom-color: ${lighten('0.15', colors.darkmode)}; */ border-bottom-color: #272a30; } .author-social-link a { color: rgba(255, 255, 255, 0.75); } } `} `; export const NoImage = css` .no-image { padding-top: 0; padding-bottom: 0; /* color: var(--darkgrey); */ color: ${colors.darkgrey}; background: #fff; opacity: 1; } .no-image .site-description { /* color: var(--midgrey); */ color: ${colors.midgrey}; opacity: 1; } .no-image .site-header-content { padding: 5vw 0 10px; /* border-bottom: 1px solid color(var(--lightgrey) l(+12%)); */ border-bottom: 1px solid ${lighten('0.12', colors.lightgrey)}; } .no-image .author-bio { /* color: var(--midgrey); */ color: ${colors.midgrey}; opacity: 1; } .no-image .author-meta { /* color: var(--midgrey); */ color: ${colors.midgrey}; opacity: 1; } .no-image .author-social-link a { /* color: var(--darkgrey); */ color: ${colors.darkgrey}; } .no-image .author-social-link a:before { /* color: var(--midgrey); */ color: ${colors.midgrey}; } .no-image .author-location + .author-stats:before, .no-image .author-stats + .author-social-link:before, .no-image .author-social-link + .author-social-link:before { /* color: var(--midgrey); */ color: ${colors.midgrey}; } @media (max-width: 500px) { .site-header-content { flex-direction: column; align-items: center; min-height: unset; } .site-title { font-size: 4.2rem; text-align: center; } .no-image .site-header-content { padding: 12vw 0 20px; } } @media (prefers-color-scheme: dark) { .no-image { color: rgba(255, 255, 255, 0.9); /* background: var(--darkmode); */ background: ${colors.darkmode}; } .no-image .site-header-content { /* border-bottom-color: color(var(--darkmode) l(+15%)); */ border-bottom-color: ${lighten('0.15', colors.darkmode)}; } .no-image .author-social-link a { color: rgba(255, 255, 255, 0.75); } } `;
chso2/chso2.github.io
src/styles/shared.ts
TypeScript
mit
8,265
using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Terraria; using TAPI; namespace Avalon.Projectiles.FromPlayer.Explosions { /// <summary> /// The Ichor Explosion. /// </summary> public sealed class IchorExplosion : ModProjectile { /// <summary> /// /// </summary> public override void AI() { Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 162, 0, 0, 100, new Color(), 1.4f)].noGravity = false; projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X); } /// <summary> /// /// </summary> /// <param name="npc"></param> /// <param name="hitDir"></param> /// <param name="damage"></param> /// <param name="knockback"></param> /// <param name="crit"></param> /// <param name="critMult"></param> public override void DamageNPC(NPC npc, int hitDir, ref int damage, ref float knockback, ref bool crit, ref float critMult) { npc.AddBuff(69, 1800, true); } } }
Avalon-Team/Terraria-Avalon
Avalon/Projectiles/FromPlayer/Explosions/Ichor Explosion.cs
C#
mit
1,177
package ru.mail.parking.sw2.system; import com.sonyericsson.extras.liveware.aef.registration.Registration; import com.sonyericsson.extras.liveware.extension.util.ExtensionUtils; import com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInformation; import android.content.ContentValues; import ru.mail.parking.R; import ru.mail.parking.ui.SettingsActivity; import static ru.mail.parking.App.app; public class SwRegInfo extends RegistrationInformation { public static final String EXTENSION_KEY = app().getPackageName(); private static final ContentValues INFO = new ContentValues(); public SwRegInfo() { INFO.put(Registration.ExtensionColumns.CONFIGURATION_ACTIVITY, SettingsActivity.class.getName()); INFO.put(Registration.ExtensionColumns.NAME, app().getString(R.string.sw_title)); INFO.put(Registration.ExtensionColumns.EXTENSION_KEY, EXTENSION_KEY); INFO.put(Registration.ExtensionColumns.LAUNCH_MODE, Registration.LaunchMode.CONTROL); String icon = ExtensionUtils.getUriString(app(), R.drawable.icon); INFO.put(Registration.ExtensionColumns.HOST_APP_ICON_URI, icon); icon = ExtensionUtils.getUriString(app(), R.drawable.icon_sw); INFO.put(Registration.ExtensionColumns.EXTENSION_48PX_ICON_URI, icon); } @Override public ContentValues getExtensionRegistrationConfiguration() { return INFO; } @Override public int getRequiredWidgetApiVersion() { return RegistrationInformation.API_NOT_REQUIRED; } @Override public int getRequiredSensorApiVersion() { return RegistrationInformation.API_NOT_REQUIRED; } @Override public int getRequiredNotificationApiVersion() { return RegistrationInformation.API_NOT_REQUIRED; } @Override public int getRequiredControlApiVersion() { return 2; } @Override public boolean controlInterceptsBackButton() { return true; } @Override public boolean isDisplaySizeSupported(int width, int height) { return width == app().getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_width) && height == app().getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_height); } }
trashkalmar/MrParkingNavigator
src/ru/mail/parking/sw2/system/SwRegInfo.java
Java
mit
2,177
/** * **************************************************************************** * Copyright 2014 Virginia Polytechnic Institute and State University * <p/> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * **************************************************************************** */ package edu.vt.vbi.patric.portlets; import edu.vt.vbi.patric.beans.Genome; import edu.vt.vbi.patric.beans.Taxonomy; import edu.vt.vbi.patric.common.DataApiHandler; import edu.vt.vbi.patric.common.SiteHelper; import edu.vt.vbi.patric.common.SolrCore; import edu.vt.vbi.patric.dao.DBDisease; import edu.vt.vbi.patric.dao.ResultType; import org.apache.commons.lang.StringUtils; import org.apache.solr.client.solrj.SolrQuery; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectReader; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.portlet.*; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Map; public class DiseaseOverview extends GenericPortlet { private static final Logger LOGGER = LoggerFactory.getLogger(DiseaseOverview.class); private ObjectReader jsonReader; @Override public void init() throws PortletException { super.init(); ObjectMapper objectMapper = new ObjectMapper(); jsonReader = objectMapper.reader(Map.class); } @Override protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { SiteHelper.setHtmlMetaElements(request, response, "Disease Overview"); response.setContentType("text/html"); response.setTitle("Disease Overview"); String contextType = request.getParameter("context_type"); String contextId = request.getParameter("context_id"); int taxonId; List<Integer> targetGenusList = Arrays .asList(1386,773,138,234,32008,194,83553,1485,776,943,561,262,209,1637,1763,780,590,620,1279,1301,662,629); DataApiHandler dataApi = new DataApiHandler(); if (contextType.equals("genome")) { Genome genome = dataApi.getGenome(contextId); taxonId = genome.getTaxonId(); } else { taxonId = Integer.parseInt(contextId); } Taxonomy taxonomy = dataApi.getTaxonomy(taxonId); List<String> taxonLineageNames = taxonomy.getLineageNames(); List<String> taxonLineageRanks = taxonomy.getLineageRanks(); List<Integer> taxonLineageIds = taxonomy.getLineageIds(); List<Taxonomy> genusList = new LinkedList<>(); for (int i = 0; i < taxonLineageIds.size(); i++) { if (taxonLineageRanks.get(i).equals("genus") && targetGenusList.contains(taxonLineageIds.get(i))) { Taxonomy genus = new Taxonomy(); genus.setId(taxonLineageIds.get(i)); genus.setTaxonName(taxonLineageNames.get(i)); genusList.add(genus); } } if (genusList.isEmpty()) { SolrQuery query = new SolrQuery("lineage_ids:" + taxonId + " AND taxon_rank:genus AND taxon_id:(" + StringUtils.join(targetGenusList, " OR ") + ")"); String apiResponse = dataApi.solrQuery(SolrCore.TAXONOMY, query); Map resp = jsonReader.readValue(apiResponse); Map respBody = (Map) resp.get("response"); genusList = dataApi.bindDocuments((List<Map>) respBody.get("docs"), Taxonomy.class); } request.setAttribute("contextType", contextType); request.setAttribute("contextId", contextId); request.setAttribute("genusList", genusList); PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/disease_overview.jsp"); prd.include(request, response); } @SuppressWarnings("unchecked") public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { response.setContentType("application/json"); String type = request.getParameter("type"); String cId = request.getParameter("cId"); DBDisease conn_disease = new DBDisease(); int count_total; JSONArray results = new JSONArray(); PrintWriter writer = response.getWriter(); if (type.equals("incidence")) { JSONObject jsonResult = new JSONObject(); // String cType = request.getParameter("cType"); // sorting // String sort_field = request.getParameter("sort"); // String sort_dir = request.getParameter("dir"); // Map<String, String> key = new HashMap<>(); // Map<String, String> sort = null; // // if (sort_field != null && sort_dir != null) { // sort = new HashMap<String, String>(); // sort.put("field", sort_field); // sort.put("direction", sort_dir); // } // // key.put("cId", cId); // key.put("cType", cType); count_total = 1; jsonResult.put("total", count_total); JSONObject obj = new JSONObject(); obj.put("rownum", "1"); obj.put("pathogen", "Pathogen"); obj.put("disease", "Disease"); obj.put("incidence", "10"); obj.put("infection", "5"); results.add(obj); jsonResult.put("results", results); jsonResult.writeJSONString(writer); } else if (type.equals("disease_tree")) { JSONArray jsonResult = new JSONArray(); String tree_node = request.getParameter("node"); List<ResultType> items = conn_disease.getMeshHierarchy(cId, tree_node); if (items.size() > 0) { int min = Integer.parseInt(items.get(0).get("lvl")); try { for (ResultType item : items) { if (min == Integer.parseInt(item.get("lvl"))) { boolean flag = false; JSONObject obj = DiseaseOverview.encodeNodeJSONObject(item); String mesh_id = (String) obj.get("tree_node"); for (int j = 0; j < jsonResult.size(); j++) { JSONObject temp = (JSONObject) jsonResult.get(j); if (temp.get("tree_node").equals(mesh_id)) { flag = true; temp.put("pathogen", temp.get("pathogen") + "<br>" + obj.get("pathogen")); temp.put("genome", temp.get("genome") + "<br>" + obj.get("genome")); temp.put("vfdb", temp.get("vfdb") + "<br>" + obj.get("vfdb")); temp.put("gad", temp.get("gad") + "<br>" + obj.get("gad")); temp.put("ctd", temp.get("ctd") + "<br>" + obj.get("ctd")); temp.put("taxon_id", temp.get("taxon_id") + "<br>" + obj.get("taxon_id")); jsonResult.set(j, temp); } } if (!flag) { jsonResult.add(obj); } } } } catch (Exception ex) { LOGGER.error(ex.getMessage(), ex); } } jsonResult.writeJSONString(writer); } writer.close(); } @SuppressWarnings("unchecked") public static JSONObject encodeNodeJSONObject(ResultType rt) { JSONObject obj = new JSONObject(); obj.putAll(rt); obj.put("id", rt.get("tree_node")); obj.put("node", rt.get("tree_node")); obj.put("expanded", "true"); if (rt.get("leaf").equals("1")) { obj.put("leaf", "true"); } else { obj.put("leaf", "false"); } return obj; } }
PATRIC3/patric3_website
portal/patric-diseaseview/src/edu/vt/vbi/patric/portlets/DiseaseOverview.java
Java
mit
7,388
/***************************************************************************** * Course: CS 27500 * Name: Adam Joseph Cook * Email: cook5@purduecal.edu * Assignment: 1 * * The <CODE>TestDrive</CODE> Java application simulates a car being driven * depending on its provided fuel efficiency and fuel amount. * * @author Adam Joseph Cook * <A HREF="mailto:cook5@purduecal.edu"> (cook5@purduecal.edu) </A> *****************************************************************************/ import java.util.Scanner; public class TestDrive { public static void main( String[] args ) { Scanner sc = new Scanner(System.in); Car car; boolean mainDone = false; while (!mainDone) { System.out.print("Enter fuel efficiency: "); double fuelEfficiency = sc.nextDouble(); car = new Car(fuelEfficiency); if (fuelEfficiency == 0) { // The user entered a fuel efficiency of zero, so terminate the // program. System.exit(0); } boolean outerDone = false; while (!outerDone) { System.out.print("Enter amount of fuel: "); double fuelAmountToAdd = sc.nextDouble(); if (fuelAmountToAdd == 0) { // The user entered a zero value for the fuel to add, so // terminate this outer loop. outerDone = true; } else { // Add provided fuel to the car. car.addFuel(fuelAmountToAdd); boolean innerDone = false; while (!innerDone) { System.out.print("Enter distance to travel: "); double distanceToTravel = sc.nextDouble(); if (distanceToTravel == 0) { // The user entered a zero distance to travel, so // terminate this inner loop. innerDone = true; } else { // Attempt to travel the distance provided with the // car. double distanceTraveled = car.drive(distanceToTravel); System.out.println(" Distance actually " + "traveled = " + distanceTraveled); System.out.println(" Current fuelLevel = " + car.getFuelLevel()); System.out.println(" Current odometer = " + car.getOdometer()); } } } } } } }
adamjcook/cs27500
hw1/TestDrive.java
Java
mit
2,807
#!/usr/bin/env ruby require "pathname" require_relative "testframework/testhelper" require_relative "testframework/testenvironment" require_relative "testframework/testdefinition" require_relative "testframework/testoperator" environment = TestEnvironment.new() definition = TestDefinition.new() pathname = Pathname.new(__FILE__).expand_path definition.name = pathname.basename.sub_ext("") definition.description = "different prefixes for id and id2 will be shown" definition.compiler_flags = [ "-DLOGGER_ENABLE" ] definition.library_directories = [ ] definition.libraries = [ ] definition.source_files = [ "./#{definition.name}.c" ] definition.executable = "./#{definition.name}" definition.arguments = [ ] definition.stdin = "" definition.stdout = "#{definition.name}.template_stdout" definition.stderr = "" definition.files = [ [ "", ""] ] definition.status = 0 definition.temporary_files = [ "#{definition.executable}" ] operator = TestOperator.new(environment, definition) operator.setup() if operator.buildTest() puts "#{definition.name} ... #{fail()} (build)" return_value = 1 else if operator.runTest() puts "#{definition.name} ... #{fail()} (behavior)" return_value = 1 else puts "#{definition.name} ... #{pass()}" return_value = 0 end end operator.cleanup() exit return_value
embear/logger
test/test014.rb
Ruby
mit
1,456
// Actions export const ADD_NOTIFICATION = 'notifications/ADD_NOTIFICATION' export const DISMISS_NOTIFICATION = 'notifications/DISMISS_NOTIFICATION' export const CLEAR_NOTIFICATIONS = 'notifications/CLEAR_NOTIFICATIONS' // Reducer export const initialState = [] export default function reducer(state = initialState, action) { const { payload, type } = action switch (type) { case ADD_NOTIFICATION: return [...state, payload] case DISMISS_NOTIFICATION: return state.filter(notification => notification.id !== payload) case CLEAR_NOTIFICATIONS: return [state] default: return state } } // Action Creators export function addNotification(notification) { const { id, dismissAfter } = notification if (!id) { notification.id = new Date().getTime() } return (dispatch, getState) => { dispatch({ type: ADD_NOTIFICATION, payload: notification }) if (dismissAfter) { setTimeout(() => { const { notifications } = getState() const found = notifications.find(lookup => { return lookup.id === notification.id }) if (found) { dispatch({ type: DISMISS_NOTIFICATION, payload: notification.id }) } }, dismissAfter) } } } export function dismissNotification(id) { return { type: DISMISS_NOTIFICATION, payload: id } } export function clearNotifications(id) { return { type: CLEAR_NOTIFICATIONS, payload: id } }
cannoneyed/tmm-glare
src/core/notifications/index.js
JavaScript
mit
1,447
<?php // src/VersionControl/GitlabIssueBundle/Entity/User.php /* * This file is part of the GitlabIssueBundle package. * * (c) Paul Schweppe <paulschweppe@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace VersionControl\GitlabIssueBundle\Entity; use VersionControl\GitControlBundle\Entity\Issues\IssueUserInterface; class User implements IssueUserInterface { /** * @var int */ protected $id; /** * @var string */ protected $name; public function getId() { return $this->id; } public function setId($id) { $this->id = $id; return $this; } public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } }
SSHVersionControl/git-web-client
app/src/VersionControl/GitlabIssueBundle/Entity/User.php
PHP
mit
887
var NaturalLanguageUnderstandingV1 = require('watson-developer-cloud/natural-language-understanding/v1.js'); var ToneAnalyzerV3 = require('watson-developer-cloud/tone-analyzer/v3'); let fs = require('fs'); let path = require('path'); const directoryName = path.dirname(__filename); const creds = { tone: { "username": "redacted", "password": "redacted" }, nlu: { "username": "redacted", "password": "redacted" } }; let toneAnalyzer = new ToneAnalyzerV3({ username: creds.tone.username, password: creds.tone.password, version: 'v3', version_date: '2017-03-15' }); var nlu = new NaturalLanguageUnderstandingV1({ username: creds.nlu.username, password: creds.nlu.password, version_date: NaturalLanguageUnderstandingV1.VERSION_DATE_2017_02_27 }); function generateToneAnalysis(title, poem) { let toneParams = { 'text': poem, 'isHTML': false, 'sentences': false }; let nluParams = { 'text': poem, 'features': { 'keywords': { 'emotion': true, 'sentiment': true, 'limit': 10 }, 'sentiment': {} } } toneAnalyzer.tone(toneParams, function(err, res1){ if (err) { console.log(err); } else { nlu.analyze(nluParams, function(err, res2){ if (err) { console.log(err); } else { var result = Object.assign({"title": title}, res1, res2); prettyJson = JSON.stringify(result, null, 2); fs.appendFileSync('./sentiments.json', prettyJson, {encoding: 'utf8'}); console.log(`Retrieved Watson Analysis for ${title}`); } }); } }); } function readFiles(dirname, onFileContent, onError) { fs.readdir(dirname, function(err, filenames) { if (err) { onError(err); return; } var index = filenames.indexOf(".DS_Store"); if (index >= 0) { filenames.splice(index, 1 ); } filenames.forEach(function(filename) { fs.readFile(path.join(dirname,filename), 'utf8', function(err, content) { if (err) { onError(err); return; } onFileContent(filename.substring(0, filename.length-4), content); }); }); }); } // fs.writeFileSync('./s.json', '', 'utf8'); // fs.readdir('./missing', function(err, files) { // var index = files.indexOf(".DS_Store"); // if (index >= 0) { // files.splice(index, 1 ); // } // for (var i = 0; i<files.length; i++) { // console.log(files[i]); // file = fs.readFileSync(path.join(directoryName+'/missing', files[i]), {encoding: 'utf8'}); // generateToneAnalysis(files[i], file); // } // }); fs.readdir('./poems', function(err, folders){ if (err) { console.log(err); return; } var index = folders.indexOf(".DS_Store"); if (index >= 0) { folders.splice(index, 1 ); } for (var i = 0; i < folders.length; i++) { let dirname = path.join('./poems', folders[i]); readFiles(dirname, generateToneAnalysis, function(err) { console.log(err); }); } });
jhowtan/frost-poetry-dh
scripts/watson.js
JavaScript
mit
3,009
var encodeDecode = function() { var randomNum = function (min, max) { // helper function for random numbers return Math.random() * (max - min) + min; }; var insertBreak = function (counter) { //helper function to break lines @ 100 char if (counter % 100 === 0) { $('body').append("<br>"); } }; var encode = function (s) { //encodes a string var spl = s.split(""); var lineCounter = 0; for (var i=0; i < spl.length; i++) { $('body').append("<span class='encoded' hidden>" + spl[i] + "</span>"); var r = randomNum(20,30); for (var j=0; j < r; j++) { insertBreak(lineCounter); lineCounter++; var q = randomNum(33,126); $('body').append("<span>" + String.fromCharCode(q) + "</span>"); } } }; var decode = function () { //decodes the page var decodeString = ""; $('[hidden]').each(function() { decodeString += $(this).text(); $(this).remove(); }); $('span, br').remove(); $('body').append("<span class='decoded'>" + decodeString + "</span>"); }; if ($('body').children('span.encoded').length > 0) { decode(); } else if ($('body').children('span.decoded').length > 0) { var s = $('span.decoded').text(); $('span.decoded').remove(); encode(s); } else { encode("The challenge was found by running: $('body').children().toggle(); Note that even the line breaks from the challenege were included in my script. We should grab lunch, don't you think? "); //starter string to encode / decode } }; $( document ).ready(function() { encodeDecode(); });
Pink401k/kyle.pink
app/quizzes/scripts.js
JavaScript
mit
1,653
<?xml version="1.0" ?><!DOCTYPE TS><TS language="cmn" version="2.0"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;Horuscoin Core&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../utilitydialog.cpp" line="+29"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Horuscoin Core developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+30"/> <source>Double-click to edit address or label</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;New</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Copy the currently selected address to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Copy</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>C&amp;lose</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+74"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/addressbookpage.ui" line="-41"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-27"/> <source>&amp;Delete</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="-30"/> <source>Choose the address to send coins to</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Choose the address to receive coins with</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>C&amp;hoose</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>sending addresses</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>receiving addresses</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>These are your Horuscoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>These are your Horuscoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+194"/> <source>Export Address List</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Exporting Failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>There was an error trying to save the address list to %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+168"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>(no label)</source> <translation type="unfinished"/> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+40"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR HORUSCOINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>Horuscoin Core will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Horuscoins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"/> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+295"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+335"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-407"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="-137"/> <source>Node</source> <translation type="unfinished"/> </message> <message> <location line="+138"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show information about Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Sending addresses...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Receiving addresses...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Open &amp;URI...</source> <translation type="unfinished"/> </message> <message> <location line="+325"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-405"/> <source>Send coins to a Horuscoin address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="+430"/> <source>Horuscoin</source> <translation type="unfinished"/> </message> <message> <location line="-643"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+146"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <location line="+2"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your Horuscoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Horuscoin addresses</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="-284"/> <location line="+376"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="-401"/> <source>Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+163"/> <source>Request payments (generates QR codes and horuscoin: URIs)</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <location line="+2"/> <source>&amp;About Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Show the list of used sending addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Show the list of used receiving addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Open a horuscoin: URI or payment request</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the Horuscoin Core help message to get a list with possible Horuscoin Core command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+159"/> <location line="+5"/> <source>Horuscoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+142"/> <source>%n active connection(s) to Horuscoin network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+23"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="-85"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+130"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+438"/> <source>A fatal error occurred. Horuscoin Core can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+119"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control Address Selection</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+63"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+42"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock unspent</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Unlock unspent</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+323"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>higher</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lower</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>(%1 locked)</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>none</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Dust</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is greater than 1000 bytes.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+5"/> <source>This means a fee of at least %1 per kB is required.</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>Can vary +/- 1 byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions with higher priority are more likely to get included into a block.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the priority is smaller than &quot;medium&quot;.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This label turns red, if any recipient receives an amount smaller than %1.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+4"/> <source>This means a fee of at least %1 is required.</source> <translation type="unfinished"/> </message> <message> <location line="-3"/> <source>Amounts below 0.546 times the minimum relay fee are shown as dust.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>This label turns red, if the change is smaller than %1.</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <location line="+66"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address list entry</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>The address associated with this address list entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+28"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Horuscoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>FreespaceChecker</name> <message> <location filename="../intro.cpp" line="+65"/> <source>A new data directory will be created.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>name</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Path already exists, and is not a directory.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Cannot create data directory here.</source> <translation type="unfinished"/> </message> </context> <context> <name>HelpMessageDialog</name> <message> <location filename="../forms/helpmessagedialog.ui" line="+19"/> <source>Horuscoin Core - Command-line options</source> <translation type="unfinished"/> </message> <message> <location filename="../utilitydialog.cpp" line="+38"/> <source>Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Choose data directory on startup (default: 0)</source> <translation type="unfinished"/> </message> </context> <context> <name>Intro</name> <message> <location filename="../forms/intro.ui" line="+14"/> <source>Welcome</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Welcome to Horuscoin Core.</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>As this is the first time the program is launched, you can choose where Horuscoin Core will store its data.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Horuscoin Core will download and store a copy of the Horuscoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Use the default data directory</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use a custom data directory:</source> <translation type="unfinished"/> </message> <message> <location filename="../intro.cpp" line="+85"/> <source>Horuscoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Specified data directory &quot;%1&quot; can not be created.</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>GB of free space available</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>(of %1GB needed)</source> <translation type="unfinished"/> </message> </context> <context> <name>OpenURIDialog</name> <message> <location filename="../forms/openuridialog.ui" line="+14"/> <source>Open URI</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Open payment request from URI or file</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>URI:</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Select payment request file</source> <translation type="unfinished"/> </message> <message> <location filename="../openuridialog.cpp" line="+47"/> <source>Select payment request file to open</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start Horuscoin Core after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start Horuscoin Core on system login</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Size of &amp;database cache</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>MB</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Number of script &amp;verification threads</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+58"/> <source>Connect to the Horuscoin network through a SOCKS proxy.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy (default proxy):</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> <translation type="unfinished"/> </message> <message> <location line="+224"/> <source>Active command-line options that override above options:</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="-323"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the Horuscoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Horuscoin Core.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show Horuscoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only)</source> <translation type="unfinished"/> </message> <message> <location line="+136"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+67"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>none</source> <translation type="unfinished"/> </message> <message> <location line="+75"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+29"/> <source>Client restart required to activate changes.</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Client will be shutdown, do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>This change would require a client restart.</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Horuscoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-155"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-83"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Confirmed:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+120"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+403"/> <location line="+13"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>URI can not be parsed! This can be caused by an invalid Horuscoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+96"/> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation type="unfinished"/> </message> <message> <location line="-221"/> <location line="+212"/> <location line="+13"/> <location line="+95"/> <location line="+18"/> <location line="+16"/> <source>Payment request error</source> <translation type="unfinished"/> </message> <message> <location line="-353"/> <source>Cannot start horuscoin: click-to-pay handler</source> <translation type="unfinished"/> </message> <message> <location line="+58"/> <source>Net manager warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Your active proxy doesn&apos;t support SOCKS5, which is required for payment requests via proxy.</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>Payment request fetch URL is invalid: %1</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Payment request file handling</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Payment request file can not be read or processed! This can be caused by an invalid payment request file.</source> <translation type="unfinished"/> </message> <message> <location line="+73"/> <source>Unverified payment requests to custom payment scripts are unsupported.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Refund from %1</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Error communicating with %1: %2</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Payment request can not be parsed or processed!</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Bad response from server %1</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>Payment acknowledged</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Network request error</source> <translation type="unfinished"/> </message> </context> <context> <name>QObject</name> <message> <location filename="../bitcoin.cpp" line="+71"/> <location line="+11"/> <source>Horuscoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Specified data directory &quot;%1&quot; does not exist.</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Error: Invalid combination of -regtest and -testnet.</source> <translation type="unfinished"/> </message> <message> <location filename="../guiutil.cpp" line="+82"/> <source>Enter a Horuscoin address (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation type="unfinished"/> </message> </context> <context> <name>QRImageWidget</name> <message> <location filename="../receiverequestdialog.cpp" line="+36"/> <source>&amp;Save Image...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Copy Image</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Image (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+23"/> <location line="+36"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+359"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-223"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>General</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Name</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="+72"/> <source>&amp;Network Traffic</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Clear</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Totals</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>In:</source> <translation type="unfinished"/> </message> <message> <location line="+80"/> <source>Out:</source> <translation type="unfinished"/> </message> <message> <location line="-521"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="+206"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the Horuscoin Core debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Horuscoin Core RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>%1 B</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 KB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 MB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 GB</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>%1 m</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>%1 h</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 h %2 m</source> <translation type="unfinished"/> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <location filename="../forms/receivecoinsdialog.ui" line="+107"/> <source>&amp;Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="-37"/> <source>&amp;Message:</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>R&amp;euse an existing receiving address (not recommended)</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <location line="+23"/> <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Horuscoin network.</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <location line="+21"/> <source>An optional label to associate with the new receiving address.</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <location line="+22"/> <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Clear all fields of the form.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear</source> <translation type="unfinished"/> </message> <message> <location line="+78"/> <source>Requested payments history</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>&amp;Request payment</source> <translation type="unfinished"/> </message> <message> <location line="+120"/> <source>Show the selected request (does the same as double clicking an entry)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Show</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Remove the selected entries from the list</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Remove</source> <translation type="unfinished"/> </message> <message> <location filename="../receivecoinsdialog.cpp" line="+38"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy message</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <location filename="../forms/receiverequestdialog.ui" line="+29"/> <source>QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Copy &amp;URI</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Copy &amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Save Image...</source> <translation type="unfinished"/> </message> <message> <location filename="../receiverequestdialog.cpp" line="+56"/> <source>Request payment to %1</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Payment information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>URI</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <location filename="../recentrequeststablemodel.cpp" line="+24"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>(no message)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>(no amount)</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+380"/> <location line="+80"/> <source>Send Coins</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+89"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+164"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <source>Clear all fields of the form.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-229"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <location line="+5"/> <location line="+5"/> <location line="+4"/> <source>%1 to %2</source> <translation type="unfinished"/> </message> <message> <location line="-121"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+170"/> <source>Total Amount %1 (= %2)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>or</source> <translation type="unfinished"/> </message> <message> <location line="+203"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+113"/> <source>Warning: Invalid Horuscoin address</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>(no label)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Warning: Unknown change address</source> <translation type="unfinished"/> </message> <message> <location line="-367"/> <source>Are you sure you want to send?</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>added as transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+171"/> <source>Payment request expired</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Invalid payment address %1</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+131"/> <location line="+521"/> <location line="+536"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="-1152"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+30"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="+57"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Choose previously used address</source> <translation type="unfinished"/> </message> <message> <location line="-40"/> <source>This is a normal payment.</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+524"/> <location line="+536"/> <source>Remove this entry</source> <translation type="unfinished"/> </message> <message> <location line="-1008"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+968"/> <source>This is a verified payment request.</source> <translation type="unfinished"/> </message> <message> <location line="-991"/> <source>Enter a label for this address to add it to the list of used addresses</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>A message that was attached to the horuscoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Horuscoin network.</source> <translation type="unfinished"/> </message> <message> <location line="+426"/> <source>This is an unverified payment request.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <location line="+532"/> <source>Pay To:</source> <translation type="unfinished"/> </message> <message> <location line="-498"/> <location line="+536"/> <source>Memo:</source> <translation type="unfinished"/> </message> </context> <context> <name>ShutdownWindow</name> <message> <location filename="../utilitydialog.cpp" line="+48"/> <source>Horuscoin Core is shutting down...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do not shut down the computer until this window disappears.</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+210"/> <source>Choose previously used address</source> <translation type="unfinished"/> </message> <message> <location line="-200"/> <location line="+210"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-200"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Horuscoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+143"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-84"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Verify the message to ensure it was signed with the specified Horuscoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+30"/> <source>Enter a Horuscoin address (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+84"/> <location line="+80"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <location line="+8"/> <location line="+72"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <location line="+80"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-72"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+58"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+28"/> <source>Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>The Horuscoin Core developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation type="unfinished"/> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <location filename="../trafficgraphwidget.cpp" line="+79"/> <source>KB/s</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+28"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+53"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-125"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+53"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <location line="+9"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Merchant</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-232"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+234"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+16"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="-22"/> <location line="+25"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="-22"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+62"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+57"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+142"/> <source>Export Transaction History</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Exporting Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the transaction history to %1.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Exporting Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The transaction history was successfully saved to %1.</source> <translation type="unfinished"/> </message> <message> <location line="-22"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+107"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletFrame</name> <message> <location filename="../walletframe.cpp" line="+26"/> <source>No wallet has been loaded.</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+245"/> <source>Send Coins</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+43"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+181"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to %1.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>The wallet data was successfully saved to %1.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> </context> <context> <name>horuscoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+221"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Specify configuration file (default: horuscoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Specify pid file (default: horuscoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="-26"/> <source>Listen for connections on &lt;port&gt; (default: 22556 or testnet: 44556)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="-51"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+84"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-148"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-36"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 22555 or testnet: 44555)</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+80"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-118"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-95"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=horuscoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Horuscoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Horuscoin Core is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Horuscoin Core will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&lt;category&gt; can be:</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Horuscoin Core Daemon</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Horuscoin Core RPC client version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Connect through SOCKS proxy</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Connect to JSON-RPC on &lt;port&gt; (default: 22555 or testnet: 44555)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do not load the wallet and disable wallet RPC calls</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Fee per kB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -onion address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Prepend debug output with timestamp (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>RPC client options:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Select SOCKS version for -proxy (4 or 5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send command to Horuscoin Core server</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Set maximum block size in bytes (default: %d)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Start Horuscoin Core server</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Usage (deprecated, use horuscoin-cli):</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wait for RPC server to start</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet %s resides outside data directory %s</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Wallet options:</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>You need to rebuild the database using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="-79"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-105"/> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+89"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-58"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-70"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+80"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="-132"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+161"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-37"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Horuscoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+98"/> <source>Wallet needed to be rewritten: restart Horuscoin Core to complete</source> <translation type="unfinished"/> </message> <message> <location line="-100"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-101"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="-32"/> <source>Unable to bind to %s on this computer. Horuscoin Core is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+95"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+67"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="-58"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="+85"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="-35"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"/> </message> </context> </TS>
horuscoin/horuscoin
src/qt/locale/bitcoin_cmn.ts
TypeScript
mit
131,056
<?php if(isset($_POST['message']) && isset($_POST['name'])){ $handle = fopen('feedback.txt', 'a') or die('Could not open the file'); $from = $_POST['name']; $time = date('m/d h:i:s'); $message = $_POST['message']; $toWrite = "Message from: $from on $time:\r\n$message\r\n\r\n"; fwrite($handle, $toWrite); fclose($handle); echo "<strong>Thank you</strong>, your message was successfully submitted."; }else{ echo "Something went <strong>terribly</strong> wrong. Please tell Michael about this."; } ?>
M-shin/homepage
tileslide/php/feedback.php
PHP
mit
534
namespace Merchello.Web.Models.ContentEditing.Collections { using System; using System.Diagnostics.CodeAnalysis; using System.Runtime.Serialization; using System.Security.Cryptography; using Merchello.Core; using Merchello.Core.Models; using Merchello.Core.Models.EntityBase; using Merchello.Core.Models.Interfaces; using Merchello.Core.Models.TypeFields; using Newtonsoft.Json; using Newtonsoft.Json.Converters; /// <summary> /// Represents and entity collection. /// </summary> [DataContract(Name = "entityCollectionDisplay", Namespace = "")] public class EntityCollectionDisplay { /// <summary> /// Gets or sets the key. /// </summary> [DataMember(Name = "key")] public Guid Key { get; set; } /// <summary> /// Gets or sets the parent key. /// </summary> [DataMember(Name = "parentKey")] public Guid? ParentKey { get; set; } /// <summary> /// Gets or sets the entity type field key. /// </summary> [DataMember(Name = "entityTfKey")] public Guid EntityTfKey { get; set; } /// <summary> /// Gets or sets the entity type field. /// </summary> [DataMember(Name = "entityTypeField")] public TypeField EntityTypeField { get; set; } /// <summary> /// Gets or sets the entity type. /// </summary> [DataMember(Name = "entityType")] [JsonConverter(typeof(StringEnumConverter))] public EntityType EntityType { get; set; } /// <summary> /// Gets or sets the provider key. /// </summary> [DataMember(Name = "providerKey")] public Guid ProviderKey { get; set; } /// <summary> /// Gets or sets the name. /// </summary> [DataMember(Name = "name")] public string Name { get; set; } /// <summary> /// Gets or sets the sort order. /// </summary> [DataMember(Name = "sortOrder")] public int SortOrder { get; set; } } /// <summary> /// Extension methods for <see cref="EntityCollectionDisplay"/>. /// </summary> [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Reviewed. Suppression is OK here.")] internal static class EntityCollectionDisplayExtensions { /// <summary> /// Maps <see cref="IEntityCollection"/> to <see cref="EntityCollectionDisplay"/>. /// </summary> /// <param name="collection"> /// The collection. /// </param> /// <returns> /// The <see cref="EntityCollectionDisplay"/>. /// </returns> public static EntityCollectionDisplay ToEntityCollectionDisplay(this IEntityCollection collection) { return AutoMapper.Mapper.Map<EntityCollectionDisplay>(collection); } /// <summary> /// Maps a <see cref="EntityCollectionDisplay"/> to an <see cref="IEntityCollection"/>. /// </summary> /// <param name="display"> /// The display. /// </param> /// <param name="destination"> /// The destination. /// </param> /// <returns> /// The <see cref="IEntityCollection"/>. /// </returns> public static IEntityCollection ToEntityCollection( this EntityCollectionDisplay display, IEntityCollection destination) { if (!Guid.Empty.Equals(display.Key)) destination.Key = display.Key; destination.Name = display.Name; destination.ProviderKey = display.ProviderKey; destination.EntityTfKey = display.EntityTfKey; destination.ParentKey = display.ParentKey.GetValueOrDefault(); ((EntityCollection)destination).SortOrder = display.SortOrder; return destination; } } }
rasmusjp/Merchello
src/Merchello.Web/Models/ContentEditing/Collections/EntityCollectionDisplay.cs
C#
mit
3,983
# coding=utf-8 # Bootstrap installation of setuptools from ez_setup import use_setuptools use_setuptools() import os import sys from fnmatch import fnmatchcase from distutils.util import convert_path from propane_distribution import cmdclassdict from setuptools import setup, find_packages from engineer import version PROJECT = 'engineer' ################################################################################ # find_package_data written by Ian Bicking. # Provided as an attribute, so you can append to these instead # of replicating them: standard_exclude = ('*.py', '*.pyc', '*~', '.*', '*.bak', '*.swp*') standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', './dist', 'EGG-INFO', '*.egg-info') def find_package_data( where='.', package='', exclude=standard_exclude, exclude_directories=standard_exclude_directories, only_in_packages=True, show_ignored=False): """ Return a dictionary suitable for use in ``package_data`` in a distutils ``setup.py`` file. The dictionary looks like:: {'package': [files]} Where ``files`` is a list of all the files in that package that don't match anything in ``exclude``. If ``only_in_packages`` is true, then top-level directories that are not packages won't be included (but directories under packages will). Directories matching any pattern in ``exclude_directories`` will be ignored; by default directories with leading ``.``, ``CVS``, and ``_darcs`` will be ignored. If ``show_ignored`` is true, then all the files that aren't included in package data are shown on stderr (for debugging purposes). Note patterns use wildcards, or can be exact paths (including leading ``./``), and all searching is case-insensitive. This function is by Ian Bicking. """ out = {} stack = [(convert_path(where), '', package, only_in_packages)] while stack: where, prefix, package, only_in_packages = stack.pop(0) for name in os.listdir(where): fn = os.path.join(where, name) if os.path.isdir(fn): bad_name = False for pattern in exclude_directories: if fnmatchcase(name, pattern) or fn.lower() == pattern.lower(): bad_name = True if show_ignored: print >> sys.stderr, ( "Directory %s ignored by pattern %s" % (fn, pattern)) break if bad_name: continue if os.path.isfile(os.path.join(fn, '__init__.py')): if not package: new_package = name else: new_package = package + '.' + name stack.append((fn, '', new_package, False)) else: stack.append((fn, prefix + name + '/', package, only_in_packages)) elif package or not only_in_packages: # is a file bad_name = False for pattern in exclude: if fnmatchcase(name, pattern) or fn.lower() == pattern.lower(): bad_name = True if show_ignored: print >> sys.stderr, ( "File %s ignored by pattern %s" % (fn, pattern)) break if bad_name: continue out.setdefault(package, []).append(prefix + name) return out ################################################################################ # noinspection PyShadowingBuiltins def get_install_requirements(requirements_file='requirements.txt'): requirements = [] with open(requirements_file) as file: temp = file.readlines() temp = [i[:-1] for i in temp] for line in temp: if line is None or line == '' or line.startswith(('#', '-e', '-r')): continue else: requirements.append(line) return requirements # noinspection PyShadowingBuiltins def get_readme(): with open('README.md') as file: return file.read() setup( name=PROJECT, version=version.string, author='Tyler Butler', author_email='tyler@tylerbutler.com', platforms='any', packages=find_packages(), entry_points={ 'console_scripts': [ 'engineer=engineer.engine:cmdline', 'engineer_dev=engineer.devtools:main [dev]' ], }, url='http://github.com/tylerbutler/engineer', license='MIT', description='A static website generator.', long_description=get_readme(), install_requires=get_install_requirements(), tests_require=get_install_requirements('requirements_tests.txt'), extras_require={ 'dev': ['argh', 'clint'] }, cmdclass=cmdclassdict, include_package_data=True, package_data=find_package_data(PROJECT, package=PROJECT, only_in_packages=False), # Setting to False doesn't create an egg - easier to debug and hack on zip_safe=True, )
tylerbutler/engineer
setup.py
Python
mit
5,374
// ------------------------------------------------------- // Copyright (C) 施维串 版权所有。 // 创建标识:2013-11-11 10:53:36 Created by 施维串 // 功能说明: // 注意事项: // // 更新记录: // ------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace shiwch.util { /// <summary> /// 字节数组相等比较器 /// </summary> public sealed class ByteArrayEqualityComparer : IEqualityComparer<byte[]> { /// <summary> /// 判断两个字节数组是否相等 /// </summary> /// <param name="first"></param> /// <param name="second"></param> /// <returns></returns> public bool Equals(byte[] first, byte[] second) { return ByteEquals(first, second); } /// <summary> /// 判断两个字节数组是否相等 /// </summary> /// <param name="first"></param> /// <param name="second"></param> /// <returns></returns> public static bool ByteEquals(byte[] first, byte[] second) { if (first == second) { return true; } if (first == null || second == null) { return false; } if (first.Length != second.Length) { return false; } for (int i = 0; i < first.Length; i++) { if (first[i] != second[i]) { return false; } } return true; } public int GetHashCode(byte[] array) { if (array == null) { return 0; } int num = 17; for (int i = 0; i < array.Length; i++) { byte b = array[i]; num = num * 31 + (int)b; } return num; } } }
q120582371/gameserver
shiwch.util/ByteArrayEqualityComparer.cs
C#
mit
2,062
import React, { Fragment, Children, cloneElement, useRef, useEffect } from 'react'; import { createPortal } from 'react-dom'; import PropTypes from 'prop-types'; import cx from 'classnames'; import idgen from './idgen'; import Button from './Button'; import { safeJSONStringify } from './utils'; const Modal = ({ actions, bottomSheet, children, fixedFooter, header, className, trigger, options, open, root, ...props }) => { const _modalRoot = useRef(null); const _modalInstance = useRef(null); const _modalRef = useRef(null); if (root === null) { console.warn( 'React Materialize: root should be a valid node element to render a Modal' ); } useEffect(() => { const modalRoot = _modalRoot.current; if (!_modalInstance.current) { _modalInstance.current = M.Modal.init(_modalRef.current, options); } return () => { if (root.contains(modalRoot)) { root.removeChild(modalRoot); } _modalInstance.current.destroy(); }; // deep comparing options object // eslint-disable-next-line react-hooks/exhaustive-deps }, [safeJSONStringify(options), root]); useEffect(() => { if (open) { showModal(); } else { hideModal(); } }, [open]); const showModal = e => { e && e.preventDefault(); _modalInstance.current && _modalInstance.current.open(); }; const hideModal = e => { e && e.preventDefault(); _modalInstance.current && _modalInstance.current.close(); }; const classes = cx( 'modal', { 'modal-fixed-footer': fixedFooter, 'bottom-sheet': bottomSheet }, className ); const renderModalPortal = () => { if (!_modalRoot.current) { _modalRoot.current = document.createElement('div'); root.appendChild(_modalRoot.current); } return createPortal( <div className={classes} ref={_modalRef} {...props}> <div className="modal-content"> <h4>{header}</h4> {children} </div> <div className="modal-footer">{Children.toArray(actions)}</div> </div>, _modalRoot.current ); }; return ( <Fragment> {trigger && cloneElement(trigger, { onClick: showModal })} {renderModalPortal()} </Fragment> ); }; Modal.propTypes = { /** * Options * Object with options for modal */ options: PropTypes.shape({ /** * Opacity of the modal overlay. */ opacity: PropTypes.number, /** * Transition in duration in milliseconds. */ inDuration: PropTypes.number, /** * Transition out duration in milliseconds. */ outDuration: PropTypes.number, /** * Callback function called before modal is opened. */ onOpenStart: PropTypes.func, /** * Callback function called after modal is opened. */ onOpenEnd: PropTypes.func, /** * Callback function called before modal is closed. */ onCloseStart: PropTypes.func, /** * Callback function called after modal is closed. */ onCloseEnd: PropTypes.func, /** * Prevent page from scrolling while modal is open. */ preventScrolling: PropTypes.bool, /** * Allow modal to be dismissed by keyboard or overlay click. */ dismissible: PropTypes.bool, /** * Starting top offset */ startingTop: PropTypes.string, /** * Ending top offset */ endingTop: PropTypes.string }), /** * Extra class to added to the Modal */ className: PropTypes.string, /** * Modal is opened on mount * @default false */ open: PropTypes.bool, /** * BottomSheet styled modal * @default false */ bottomSheet: PropTypes.bool, /** * Component children */ children: PropTypes.node, /** * FixedFooter styled modal * @default false */ fixedFooter: PropTypes.bool, /** * Text to shown in the header of the modal */ header: PropTypes.string, /** * The button to trigger the display of the modal */ trigger: PropTypes.node, /** * The buttons to show in the footer of the modal * @default <Button>Close</Button> */ actions: PropTypes.node, /** * The ID to trigger the modal opening/closing */ id: PropTypes.string, /** * Root node where modal should be injected * @default document.body */ root: PropTypes.any }; Modal.defaultProps = { get id() { return `Modal-${idgen()}`; }, root: typeof window !== 'undefined' ? document.body : null, open: false, options: { opacity: 0.5, inDuration: 250, outDuration: 250, onOpenStart: null, onOpenEnd: null, onCloseStart: null, onCloseEnd: null, preventScrolling: true, dismissible: true, startingTop: '4%', endingTop: '10%' }, fixedFooter: false, bottomSheet: false, actions: [ <Button waves="green" modal="close" flat> Close </Button> ] }; export default Modal;
react-materialize/react-materialize
src/Modal.js
JavaScript
mit
4,976
class KonamiCodeManager { constructor() { this._pattern = "38384040373937396665"; this._keyCodeCache = ''; this._callback = () => {}; this._boundCheckKeyCodePattern = this._checkKeyCodePattern.bind(this); } attach(root, callback) { if (root instanceof Element) { root.removeEventListener('keydown', this._boundCheckKeyCodePattern); root.addEventListener('keydown', this._boundCheckKeyCodePattern); this._callback = callback; } } _checkKeyCodePattern(e) { if (e) { this._keyCodeCache += e.keyCode; if (this._keyCodeCache.length === this._pattern.length) { if (this._keyCodeCache === this._pattern) { console.log('KonamiCode passed, let\'s show some easter eggs :)'); this._callback(); } this._keyCodeCache = ''; } else if (!this._pattern.match(this._keyCodeCache)) { this._keyCodeCache = ''; } } } } module.exports = new KonamiCodeManager();
EragonJ/Kaku
src/views/modules/KonamiCodeManager.js
JavaScript
mit
988
class CharAttribute < ActiveRecord::Base belongs_to :character belongs_to :base_attribute default_scope -> { order(base_attribute_id: :asc) } end
mbroadwater/shadowrun
app/models/char_attribute.rb
Ruby
mit
152
'use strict'; describe('test search controller', function() { beforeEach(module('mapTweetInfoApp')); beforeEach(module('twitterSearchServices')); beforeEach(module('latLngServices')); describe('searchCtrl', function(){ var scope, ctrl, $httpBackend, $browser, $location; beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) { // $httpBackend = _$httpBackend_; // $httpBackend.expectGET('phones/phones.json'). // respond([{name: 'Nexus S'}, {name: 'Motorola DROID'}]); scope = $rootScope.$new(); $location = scope.$service('$location'); $browser = scope.$service('$browser'); ctrl = $controller('searchCtrl', {$scope: scope}); })); it('should have default variables set', function() { // expect(scope.phones).toEqualData([]); // $httpBackend.flush(); expect(scope.counts).toEqualData( [{label: '25 Tweets', value: '25'},{label: '50 Tweets', value: '50'},{label: '75 Tweets', value: '75'},{label: '150 Tweets', value: '150'}] ); }); // it('should set the default value of orderProp model', function() { // expect(scope.orderProp).toBe('age'); // }); }); });
hartzis/MapTweet.Info
test/app/unit/controllers/searchControllerSpec.js
JavaScript
mit
1,204
/** * * Trailing Zeroes * * @author: Corey Hart <http://www.codenothing.com> * @description: Removes unecessary trailing zeroes from values * * @before: * .example { * width: 5.0px; * } * * @after: * .example { * width: 5px; * } * */ var CSSCompressor = global.CSSCompressor, rdecimal = /^(\+|\-)?(\d*\.[1-9]*0*)(\%|[a-z]{2})$/i, rleadzero = /^\-?0/; CSSCompressor.rule({ name: 'Trailing Zeroes', type: CSSCompressor.RULE_TYPE_VALUE, group: 'Numeric', description: "Removes unecessary trailing zeroes from values", callback: function( value, position, compressor ) { var m = rdecimal.exec( value ), before = value, n; if ( m ) { // Remove possible leading zero that comes from parseFloat n = parseFloat( m[ 2 ] ); if ( ( n > 0 && n < 1 ) || ( n > -1 && n < 0 ) ) { n = ( n + '' ).replace( rleadzero, '' ); } value = ( m[ 1 ] ? m[ 1 ] : '' ) + n + ( m[ 3 ] ? m[ 3 ] : '' ); compressor.log( "Removing unecesary trailing zeroes '" + before + "' => '" + value + "'", position ); return value; } } });
codenothing/CSSCompressor
lib/rules/Trailing Zeroes.js
JavaScript
mit
1,115
<?php date_default_timezone_set('asia/manila');?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="John Noah G. Ompad"> <title>AGUS 6/7 - Warehouse Management System</title> <!-- Bootstrap core CSS --> <link href="<?php echo base_url();?>_assets/assets/css/bootstrap.css" rel="stylesheet"> <!--external css--> <link href="<?php echo base_url();?>_assets/assets/font-awesome/css/font-awesome.css" rel="stylesheet" /> <!-- Custom styles for this template --> <link href="<?php echo base_url();?>_assets/assets/css/style.css" rel="stylesheet"> <link href="<?php echo base_url();?>_assets/assets/css/style-responsive.css" rel="stylesheet"> <link href="<?php echo base_url();?>_assets/assets/css/dataTables.bootstrap.css" rel="stylesheet"> <link href="<?php echo base_url();?>_assets/assets/css/dataTables.responsive.css" rel="stylesheet"> <link href="<?php echo base_url();?>_assets/bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet"> <link href="<?php echo base_url();?>_assets/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet"> <link href="<?php echo base_url();?>_assets/bower_components/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet"--> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[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> <section id="container" > <!-- ********************************************************************************************************************************************************** TOP BAR CONTENT & NOTIFICATIONS *********************************************************************************************************************************************************** --> <!--header start--> <header class="header black-bg"> <div class="sidebar-toggle-box" > <div class="fa fa-bars tooltips" data-placement="right" data-original-title="Toggle Navigation"></div> </div> <!--logo start--> <a href="<?php echo base_url();?>" class="logo hidden-print"><b>sWMS</b></a> <!--logo end--> <ul class="top-nav pull-right"> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu"> <li class="divider"></li> <li><a href="<?php echo base_url();?>WMS/emp_logout"><i class="fa fa-sign-out fa-fw"></i> Logout</a> </li> </ul> <!-- /.dropdown-user --> </li> </ul> </header> <!--header end--> <!-- ********************************************************************************************************************************************************** MAIN SIDEBAR MENU *********************************************************************************************************************************************************** --> <!--sidebar start--> <aside> <div id="sidebar" class="nav-collapse "> <!-- sidebar menu start--> <ul class="sidebar-menu" id="nav-accordion"> <p class="centered"><img src="<?php echo base_url();?>/_assets/assets/img/default_profile1.png" class="img-circle" style="background-color:#F3F3F3;"width="90"></p> <h3 class="centered" style="text-transform:uppercase;"><?php echo $Enduser_Name;?><br><i class="title-position" ><?php echo $Position;?></i></h3> <li class="sub-menu"> <a href="<?php echo base_url();?>WMS/Homepage"> <i class="fa fa-briefcase"></i> <span>Spares Inventory</span> </a> </li> <li class="sub-menu"> <a href="javascript:;" class="active"> <i class="fa fa-tasks"></i> <span>Transactions</span> </a> <ul class="sub"> <li ><a href="<?php echo base_url();?>WMS/Request_Spare" >Requested Spares</a></li> <li class="active"><a href="<?php echo base_url();?>WMS/Request_Spare_Approved">Request Evaluation</a></li> </ul> </li> </ul> <!-- sidebar menu end--> </div> </aside> <!--sidebar end--> <!-- ********************************************************************************************************************************************************** MAIN CONTENT *********************************************************************************************************************************************************** --> <!--main content start--> <section id="main-content"> <section class="wrapper site-min-height"> <h4><i class="fa fa-tasks"></i><a style="color:#004D40;padding-left:5px;">Transactions</a><i class="fa fa-angle-double-left" style="padding-left:5px;"> </i><a style="color:#004D40;padding-left:5px;font-size:16px;">Requested Spares</a></h4> <div class="row mt"> <div class="col-lg-12"> <div class="panel-bodyt"> <!-- Nav tabs --> <ul class="nav nav-tabs"> <li class="active"><a href="#Draft" data-toggle="tab">Evaluated</a> </li> </ul> <!-- Tab panes --> <div class="tab-content"> <div class="tab-pane fade in active" id="Draft"> <?php if ($message[0]== "R"){ $color="#004D40"; }else{ $color="#006CD9"; } ?> <h5><center style="color:<?php echo $color;?>"><?php echo $message; ?></center></h5> <div class="panel-body"> <div class="dataTable_wrapper"> <table class="table table-striped table-advance table-hover" id="dataTables-Draft"> <thead> <tr> <th><center><i class="fa fa-gavel"></i> WRS No.</center></th> <th><i class="fa fa-list"></i> REMARKS</th> <th><i class="fa fa-calendar"></i> DATE / TIME REQUESTED</th> <th><i class="fa fa-tags"></i> Status</th> </tr> </thead> <tbody> <?php foreach ($Draft1 as $row){ ?> <tr class="spareitems"> <td> <form method="post" action="<?php echo base_url();?>WMS/Request_Spares_Info"> <input type="hidden" value="<?php echo $row->WRId;?>" name="WRId"> <center><button type="submit" class="btn btn-link btn-link-modal" style="text-decoration:none;"> <?php echo $row->WRId;?> </button></center> </form> </td> <td> <form method="post" action="<?php echo base_url();?>WMS/Released_Spares_Info"> <input type="hidden" value="<?php echo $row->WRId;?>" name="WRId"> <button type="submit" class="btn btn-link btn-link-modal" style="text-decoration:none;"> <? echo substr($row->Remarks,0,50)." <code style='font-size:11px;color:#000040;margin-left:2%;'>see more...</code>"?> </button> </form> </td> <td><?php echo date('F d , Y',strtotime($row->Date_Requested))." - ".date('h:i A', strtotime($row->Date_Requested));?></td> <?php $det_status = $row->Status; if($det_status == "Released"){ ?> <td><span class="label label-success" style="font-size:12px;"><?php echo $row->Status; ?></span></td> <?php }elseif ($det_status == "Declined"){ ?> <td><span class="label label-danger" style="font-size:12px;"><?php echo $row->Status; ?></span></td> <?php }else{ ?> <td><span class="label label-info" style="font-size:12px;"><?php echo $row->Status; ?></span></td> <?php }?> </tr> <?php } ?> </tbody> </table> </div> <!-- /.table-responsive --> </div> <!-- /.panel-body --> </div> <div class="tab-pane fade" id="Requested"> <h5><center style="text-transform:uppercase;">Evaluated Spare Request</center></h5> <div class="panel-body"> <div class="dataTable_wrapper"> <table class="table table-striped table-advance table-hover" id="dataTables-Requested"> </table> </div> <!-- /.table-responsive --> </div> <!-- /.panel-body --> </div> </div> </div> <!-- /.panel-body --> </div><!--/end col --> </div> <!-- /end row --> </section><!--/wrapper --> </section><!-- /MAIN CONTENT --> <!--main content end--> <!-- Modal Create WRS--> <div class="modal fade" id="newDraft" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title" id="myModalLabel">DRAFT PRE-PR</h4> </div> <div class="modal-body" style="font-size:12px;color:#00271D;"> <?php echo form_open("WMS/createdraft");?> <div class="row"> <div class='col-md-12'> <input type="hidden" value="<?php echo $Section; ?>" name="Requisitioning_Section"> <input type="hidden" value="<?php echo $officername; ?>" name="PPMP_officer"> <input type="hidden" value="<?php echo $officersubname; ?>" name="PPMP_Section"> <input type="hidden" value="<?php echo $Oicname; ?>" name="Oic"> <input type="hidden" value="<?php echo $DceNo; ?>" name="DceNo"> <div class="pull-left" style="margin-left:5%;width:45%;"> <div class="pull-left" style="width:50%;"> Requisition Section <br></br> Cost Center Number </div> <div class="pull-right" style="font-weight:bold;width:50%;"> : <?php $lastSpId = $LastSpID; if($lastSpId < 10){ $a = "00$lastSpId"; }else if ($lastSpId >= 10 && $lastSpId < 100){ $a = "0$lastSpId"; } $date=date('Y', time()); $b=substr($date,2); $name=strtoupper("$Fname[0]$Mname[0]$Lname[0]"); $SpId="$name-PREPR$b-$a"; //$SpId="$name-$date-" echo "$Section"; ?> <input type="hidden" value="<?php echo $SpId;?>" name="SpId"> <br></br> : <?php echo $CcNo;?> </div> </div> <div class="pull-right" style="width:50%;"> <div class="pull-left" style="width:35%;"> Date Prepared <br></br> Date Needed </div> <?php $dc=time(); ?> <div class="pull-right" style="width:65%;"> : <?php echo date('F d ,Y',$dc);?> <input type="hidden" value="<?php echo date('F d ,Y',$dc);?>" name="Date_Prepared"> <div style="padding-top:8px;" class="input-group-btn"> <input type="date" style="padding:5px;font-size:12px;" class="form-control" name="Date_Needed" required/> </div> </div> </div> </div> <div class='col-md-12'> <div style="margin-left:5%;margin-top:8px;"> <label>Purpose of Purchase</label> <br> <textarea class="form-control" name="Purpose" placeholder="Text Here ... " required></textarea> </div> </div> </div> <!--end row--> </div> <div class="modal-footer"> <button type="button" class="btn btn-default btn-color-close" data-dismiss="modal">Close</button> <?php //registration button echo form_submit("loginSubmit","Create","style='color:#FFFFFF;padding:5px;background-color:#004D40;border:2px solid #004D40;'","class='btn btn-color'"); echo form_close(); ?> </div> </div> </div> </div> <!--footer start--> <footer class="site-footer"> <div class="text-center centered"> (c) 2015 - Spares Warehouse Management System <a href="blank.html#" class="go-top"> <i class="fa fa-angle-up"></i> </a> </div> </footer> <!--footer end--> </section> <!-- js placed at the end of the document so the pages load faster --> <script src="<?php echo base_url();?>/_assets/assets/js/jquery.js"></script> <script src="<?php echo base_url();?>/_assets/assets/js/bootstrap.min.js"></script> <script src="<?php echo base_url();?>/_assets/assets/js/jquery-ui-1.9.2.custom.min.js"></script> <script src="<?php echo base_url();?>/_assets/assets/js/jquery.ui.touch-punch.min.js"></script> <script class="include" type="text/javascript" src="<?php echo base_url();?>/_assets/assets/js/jquery.dcjqaccordion.2.7.js"></script> <script src="<?php echo base_url();?>/_assets/assets/js/jquery.scrollTo.min.js"></script> <script src="<?php echo base_url();?>/_assets/assets/js/jquery.nicescroll.js" type="text/javascript"></script> <script src="<?php echo base_url();?>/_assets/assets/js/datatables/metisMenu.min.js"></script> <script src="<?php echo base_url();?>/_assets/assets/js/datatables/jquery.dataTables.min.js"></script> <script src="<?php echo base_url();?>/_assets/assets/js/datatables/dataTables.bootstrap.min.js"></script> <!--common script for all pages--> <script src="<?php echo base_url();?>/_assets/assets/js/common-scripts.js"></script> <!--script for this page--> <script> $(document).ready(function() { $('#dataTables-Draft').DataTable({ responsive: true }); }); </script> <script> $(document).ready(function() { $('#dataTables-Requested').DataTable({ responsive: true }); }); </script> <script> $(document).ready(function() { $('#dataTables-Approved').DataTable({ responsive: true }); }); </script> </body> </html>
comexprt/swms
application/views/Request_Spares_Approved.php
PHP
mit
16,009
// 文件上传 jQuery(function() { var $ = jQuery, $list = $('#thelist'), $btn = $('#ctlBtn'), state = 'pending', // 优化retina, 在retina下这个值是2 ratio = window.devicePixelRatio || 1, // 缩略图大小 thumbnailWidth = 100 * ratio, thumbnailHeight = 100 * ratio, uploader; uploader = WebUploader.create({ // 单文件上传 multiple: false, // 不压缩image resize: false, // swf文件路径 swf: '/webuploader/Uploader.swf', // 文件接收服务端。 server: '/upload', // 选择文件的按钮。可选。 // 内部根据当前运行是创建,可能是input元素,也可能是flash. pick: '#picker', // 只允许选择图片文件。 accept: { title: 'Images', extensions: 'gif,jpg,jpeg,bmp,png', mimeTypes: 'image/*' } }); // 当有文件添加进来的时候 uploader.on( 'fileQueued', function( file ) { var $li = $( '<div id="' + file.id + '" class="file-item thumbnail">' + '<img>' + '<div class="info">' + file.name + '</div>' + '</div>' ), $img = $li.find('img'); $list.append( $li ); // 创建缩略图 uploader.makeThumb( file, function( error, src ) { if ( error ) { $img.replaceWith('<span>不能预览</span>'); return; } $img.attr( 'src', src ); }, thumbnailWidth, thumbnailHeight ); }); // 文件上传过程中创建进度条实时显示。 uploader.on( 'uploadProgress', function( file, percentage ) { var $li = $( '#'+file.id ), $percent = $li.find('.progress .progress-bar'); // 避免重复创建 if ( !$percent.length ) { $percent = $('<div class="progress progress-striped active">' + '<div class="progress-bar" role="progressbar" style="width: 0%">' + '</div>' + '</div>').appendTo( $li ).find('.progress-bar'); } $li.find('p.state').text('上传中'); $percent.css( 'width', percentage * 100 + '%' ); }); uploader.on( 'uploadSuccess', function( file , data) { $( '#'+file.id ).find('p.state').text('已上传'); $('#user_avatar').val(data.imageurl) $('#avatar').attr("src",data.imageurl) }); uploader.on( 'uploadError', function( file ) { $( '#'+file.id ).find('p.state').text('上传出错'); }); uploader.on( 'uploadComplete', function( file ) { $( '#'+file.id ).find('.progress').fadeOut(); }); uploader.on( 'all', function( type ) { if ( type === 'startUpload' ) { state = 'uploading'; } else if ( type === 'stopUpload' ) { state = 'paused'; } else if ( type === 'uploadFinished' ) { state = 'done'; } if ( state === 'uploading' ) { $btn.text('暂停上传'); } else { $btn.text('开始上传'); } }); $btn.on( 'click', function() { if ( state === 'uploading' ) { uploader.stop(); } else { uploader.upload(); } }); });
sxyx2008/rubyblog
public/webuploader/user-webuploader.js
JavaScript
mit
3,416
/* * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. * * This file is part of Aspose.Pdf. The source code in this file * is only intended as a supplement to the documentation, and is provided * "as is", without warranty of any kind, either expressed or implied. */ package programmersguide.workingwithasposepdfgenerator.workingwithtext.textformatting.inheritingtextformat.java; import com.aspose.pdf.*; public class InheritingTextFormat { public static void main(String[] args) throws Exception { // The path to the documents directory. String dataDir = "src/programmersguide/workingwithasposepdfgenerator/workingwithtext(generator)/textformatting/inheritingtextformat/data/"; } }
asposemarketplace/Aspose-Pdf-Java
src/programmersguide/workingwithasposepdfgenerator/workingwithtext/textformatting/inheritingtextformat/java/InheritingTextFormat.java
Java
mit
751
'use strict'; module.exports = { client: { lib: { // Load Angular-UI-Bootstrap module templates for these modules: uibModuleTemplates: [ 'modal', 'popover', 'progressbar', 'tabs', 'tooltip', 'typeahead' ], css: [ 'public/lib/fontello/css/animation.css', 'public/lib/medium-editor/dist/css/medium-editor.css', 'modules/core/client/fonts/fontello/css/tricons-codes.css', 'public/lib/angular-ui-bootstrap/src/position/position.css', 'public/lib/angular-ui-bootstrap/src/typeahead/typeahead.css', 'public/lib/angular-ui-bootstrap/src/tooltip/tooltip.css' ], js: [ // Non minified versions 'public/lib/jquery/dist/jquery.js', 'public/lib/angular/angular.js', 'public/lib/angular-aria/angular-aria.js', 'public/lib/angular-resource/angular-resource.js', 'public/lib/angular-animate/angular-animate.js', 'public/lib/angular-touch/angular-touch.js', 'public/lib/angular-sanitize/angular-sanitize.js', 'public/lib/angular-message-format/angular-message-format.js', 'public/lib/angulartics/src/angulartics.js', 'public/lib/angular-ui-router/release/angular-ui-router.js', 'public/lib/angular-ui-bootstrap/src/buttons/buttons.js', 'public/lib/angular-ui-bootstrap/src/collapse/collapse.js', 'public/lib/angular-ui-bootstrap/src/dateparser/dateparser.js', 'public/lib/angular-ui-bootstrap/src/debounce/debounce.js', 'public/lib/angular-ui-bootstrap/src/dropdown/dropdown.js', 'public/lib/angular-ui-bootstrap/src/modal/modal.js', 'public/lib/angular-ui-bootstrap/src/popover/popover.js', 'public/lib/angular-ui-bootstrap/src/position/position.js', 'public/lib/angular-ui-bootstrap/src/progressbar/progressbar.js', 'public/lib/angular-ui-bootstrap/src/stackedMap/stackedMap.js', 'public/lib/angular-ui-bootstrap/src/tabs/tabs.js', 'public/lib/angular-ui-bootstrap/src/tooltip/tooltip.js', 'public/lib/angular-ui-bootstrap/src/typeahead/typeahead.js', 'public/lib/moment/moment.js', 'public/lib/angular-moment/angular-moment.js', 'public/lib/medium-editor/dist/js/medium-editor.js', 'public/lib/leaflet/dist/leaflet-src.js', 'public/lib/angular-simple-logger/dist/angular-simple-logger.js', // Required by angular-leaflet-directive 'public/lib/PruneCluster/dist/PruneCluster.js', 'public/lib/ui-leaflet/dist/ui-leaflet.js', 'public/lib/leaflet-active-area/src/leaflet.activearea.js', 'public/lib/angular-waypoints/dist/angular-waypoints.all.js', 'public/lib/ng-file-upload/ng-file-upload.js', 'public/lib/message-center/message-center.js', 'public/lib/chosen/chosen.jquery.js', 'public/lib/angular-chosen-localytics/dist/angular-chosen.js', 'public/lib/angular-loading-bar/build/loading-bar.js', 'public/lib/angular-trustpass/dist/tr-trustpass.js', 'public/lib/mailcheck/src/mailcheck.js', 'public/lib/angular-mailcheck/angular-mailcheck.js', 'public/lib/angular-locker/dist/angular-locker.js', 'public/lib/angular-confirm-modal/angular-confirm.js', 'public/lib/angulargrid/angulargrid.js' ], less: [ 'public/lib/angular-trustpass/src/tr-trustpass.less', // Bootstrap // --------- // Bootstrap core variables 'public/lib/bootstrap/less/variables.less', // Bootstrap utility mixins // See the full list from 'public/lib/bootstrap/less/mixins.less' // Utility mixins 'public/lib/bootstrap/less/mixins/hide-text.less', 'public/lib/bootstrap/less/mixins/opacity.less', 'public/lib/bootstrap/less/mixins/image.less', 'public/lib/bootstrap/less/mixins/labels.less', 'public/lib/bootstrap/less/mixins/reset-filter.less', 'public/lib/bootstrap/less/mixins/resize.less', 'public/lib/bootstrap/less/mixins/responsive-visibility.less', 'public/lib/bootstrap/less/mixins/size.less', 'public/lib/bootstrap/less/mixins/tab-focus.less', 'public/lib/bootstrap/less/mixins/reset-text.less', 'public/lib/bootstrap/less/mixins/text-emphasis.less', 'public/lib/bootstrap/less/mixins/text-overflow.less', 'public/lib/bootstrap/less/mixins/vendor-prefixes.less', // Component mixins 'public/lib/bootstrap/less/mixins/alerts.less', 'public/lib/bootstrap/less/mixins/buttons.less', 'public/lib/bootstrap/less/mixins/panels.less', 'public/lib/bootstrap/less/mixins/pagination.less', 'public/lib/bootstrap/less/mixins/list-group.less', 'public/lib/bootstrap/less/mixins/nav-divider.less', 'public/lib/bootstrap/less/mixins/forms.less', 'public/lib/bootstrap/less/mixins/progress-bar.less', 'public/lib/bootstrap/less/mixins/table-row.less', // Skin mixins 'public/lib/bootstrap/less/mixins/background-variant.less', 'public/lib/bootstrap/less/mixins/border-radius.less', 'public/lib/bootstrap/less/mixins/gradients.less', // Layout mixins 'public/lib/bootstrap/less/mixins/clearfix.less', 'public/lib/bootstrap/less/mixins/center-block.less', 'public/lib/bootstrap/less/mixins/nav-vertical-align.less', 'public/lib/bootstrap/less/mixins/grid-framework.less', 'public/lib/bootstrap/less/mixins/grid.less', // Reset and dependencies 'public/lib/bootstrap/less/normalize.less', 'public/lib/bootstrap/less/print.less', // 'public/lib/bootstrap/less/glyphicons.less', // Core CSS 'public/lib/bootstrap/less/scaffolding.less', 'public/lib/bootstrap/less/type.less', // 'public/lib/bootstrap/less/code.less', 'public/lib/bootstrap/less/grid.less', 'public/lib/bootstrap/less/tables.less', 'public/lib/bootstrap/less/forms.less', 'public/lib/bootstrap/less/buttons.less', // Components 'public/lib/bootstrap/less/component-animations.less', 'public/lib/bootstrap/less/dropdowns.less', 'public/lib/bootstrap/less/button-groups.less', 'public/lib/bootstrap/less/input-groups.less', 'public/lib/bootstrap/less/navs.less', 'public/lib/bootstrap/less/navbar.less', // 'public/lib/bootstrap/less/breadcrumbs.less', // 'public/lib/bootstrap/less/pagination.less', // 'public/lib/bootstrap/less/pager.less', 'public/lib/bootstrap/less/labels.less', 'public/lib/bootstrap/less/badges.less', // 'public/lib/bootstrap/less/jumbotron.less', // 'public/lib/bootstrap/less/thumbnails.less', 'public/lib/bootstrap/less/alerts.less', 'public/lib/bootstrap/less/progress-bars.less', 'public/lib/bootstrap/less/media.less', 'public/lib/bootstrap/less/list-group.less', 'public/lib/bootstrap/less/panels.less', // 'public/lib/bootstrap/less/responsive-embed.less', // 'public/lib/bootstrap/less/wells.less', 'public/lib/bootstrap/less/close.less', // Components w/ JavaScript 'public/lib/bootstrap/less/modals.less', 'public/lib/bootstrap/less/tooltip.less', 'public/lib/bootstrap/less/popovers.less', // 'public/lib/bootstrap/less/carousel.less', // Utility classes 'public/lib/bootstrap/less/utilities.less', 'public/lib/bootstrap/less/responsive-utilities.less' ], tests: ['public/lib/angular-mocks/angular-mocks.js'] }, less: [ 'modules/core/client/app/less/*.less', 'modules/core/client/less/**/*.less', 'modules/*/client/less/*.less' ], js: [ 'modules/core/client/app/config.js', 'modules/core/client/app/init.js', 'modules/*/client/*.js', 'modules/*/client/controllers/*.js', 'modules/*/client/**/*.js' ], views: ['modules/*/client/views/**/*.html'] }, server: { fontelloConfig: 'modules/core/client/fonts/fontello/config.json', gulpConfig: 'gulpfile.js', workerJS: ['worker.js', 'config/**/*.js'], allJS: ['server.js', 'config/**/*.js', 'modules/*/server/**/*.js'], models: 'modules/*/server/models/**/*.js', routes: ['modules/!(core)/server/routes/**/*.js', 'modules/core/server/routes/**/*.js'], config: 'modules/*/server/config/*.js', policies: 'modules/*/server/policies/*.js', views: 'modules/*/server/views/*.html' } };
mleanos/trustroots
config/assets/default.js
JavaScript
mit
8,669
using System; using System.Collections.Generic; namespace EventStreams.Projection { using Core; using EventHandling; using Transformation; public interface IProjector { IEventSequenceTransformer Transformations { get; } TModel Project<TModel>(IEnumerable<IStreamedEvent> events, Func<TModel, EventHandler> eventHandlerFactory) where TModel : class; TModel Project<TModel>(Guid identity, IEnumerable<IStreamedEvent> events, Func<TModel, EventHandler> eventHandlerFactory) where TModel : class; } }
nbevans/EventStreams
EventStreams/Projection/IProjector.cs
C#
mit
590
(function (w) { var $ = w.$, d = document, e = d.documentElement, g = d.getElementsByTagName('body')[0], my = w.ilm, contid = 0; function fixCharts(width, fn) { $(fn).css("width", width); $(d).ready(function () { var inner = $(fn).width(); setTimeout(function () { $.each(w.ilm.charts, function (i, obj) { obj.setSize($(fn).width() - 6, obj.containerHeight, false); }); }, 500); }); } function setWidth() { console.log(w.ilm.getWidth()); var inner = ((w.ilm.getWidth() < 1024) ? "100" : "50") + "%"; $('.float').each(function () { fixCharts(inner, this); }); } w.ilm.popup=""; w.ilm.Options = function(state){ var t = this, f = $("#lingid"), g = $("#sl"); g.html("Seaded (klikk varjamiseks)"); my.settingTemplate(f); return false; }; w.ilm.Lingid = function (state) { var t = this, f = $("#lingid"), g = $("#sl"); g.html("Lingid (klikk varjamiseks)"); f.html(w.ilm.lingid.process(w.ilm.lingid.JSON)); return false; }; w.ilm.Popup = function(name, cb) { var v = $("#popup"); if(!v) return false; var b = $("#bghide"), hh = $('.navbar').height(), y = w.innerHeight || e.clientHeight || g.clientHeight, act = v.attr("name"),swp = 0; if (act) $("#ilm-" + act).parent().removeClass("active"); if(name && (!act || (act && act !== name))) { b.css({height : $(d).height(), position : 'absolute', left : 0, top : 0}).show(); v.attr("name", name); $("#ilm-" + name).parent().addClass("active"); if(cb) cb.call(this, name); swp = ((y/2) - (v.height()/2)) + $(w).scrollTop(); v.css({top : (swp > 0 ? swp : hh)}).show(); } else if(v.is(":visible")) { v.hide(); b.hide(); v.attr("name", ""); } return false; }; $(d).ready(function () { $("#pagelogo").html(ilm.logo); //setWidth(); $("#ilm-viited").click(function(e){ //ilm.showLinks(); var b = $(e.target); if(w.ilm.linksasmenu) { b.attr({"data-toggle":"dropdown"}); b.addClass("dropdown-toggle"); var a = $(".ilm-viited-dropdown"); a.html(w.ilm.lingid.process(w.ilm.lingid.JSON)); a.height(w.innerHeight-(w.innerHeight/3)); } else { b.removeClass("dropdown-toggle"); b.removeAttr("data-toggle"); w.ilm.Popup("viited",w.ilm.Lingid); } //return false; }); $("#ilm-seaded").click(function(e){ my.settingTemplate("#ilm-seaded-dropdown"); //w.ilm.Popup("seaded",w.ilm.Options); //return false; }); $("#fctitle").on("click",function(){ w.ilm.setEstPlace(w.ilm.nextPlace()); //w.ilm.reloadest(); return false; }); $("#datepicker").datepicker({ dateFormat: 'yy-mm-dd', timezone: "+0"+(((my.addDst)?1:0)+2)+"00", onSelect: function(dateText, inst) { w.ilm.setDate(dateText); //w.ilm.reload(); } }); $("#curtime").on("click",function(){ $("#datepicker").datepicker('show'); }); $("#curplace").on("click",function(){ w.ilm.setCurPlace(w.ilm.nextCurPlace()); //w.ilm.reload(); return false; }); w.ilm.loadBase(); w.ilm.loadInt(1000 * 60); // 1min w.ilm.loadEstInt(1000 * 60 * 10); // 10min $('#backgr').css({"display" : "block"}); $(w).on("keydown", function (e) { //w.console.log("pressed" + e.keyCode); var obj = $("#popup"); if(!obj) return; if (e.keyCode === 27 || e.keyCode === 13 ) { w.ilm.Popup("lingid", w.ilm.Lingid); } /*if (e.keyCode === 27 && obj.style.display === "block") { w.ilm.showLinks(); } else if (e.keyCode === 13 && obj.style.display === "none") { w.ilm.showLinks(); }*/ }); $(w).on('hashchange', function() { console.log("hash changed " + w.location.hash); w.ilm.hash_data(); }); }); })(window);
aivoprykk/ilmcharts
src/js/docfix.js
JavaScript
mit
3,683
<?php /* Safe sample input : get the $_GET['userData'] in an array sanitize : use of intval construction : use of sprintf via a %u */ /*Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.*/ $array = array(); $array[] = 'safe' ; $array[] = $_GET['userData'] ; $array[] = 'safe' ; $tainted = $array[1] ; $tainted = intval($tainted); $query = sprintf("SELECT * FROM COURSE c WHERE c.id IN (SELECT idcourse FROM REGISTRATION WHERE idstudent=%u)", $tainted); $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); // Connection to the database (address, user, password) mysql_select_db('dbname') ; echo "query : ". $query ."<br /><br />" ; $res = mysql_query($query); //execution while ($data = mysql_fetch_array($res)) { print_r($data) ; echo "<br />" ; } mysql_close($conn);
designsecurity/progpilot
projects/tests/tests/vulntestsuite/CWE_89__array-GET__func_intval__multiple_select-sprintf_%u.php
PHP
mit
1,651
import setupStore from 'dummy/tests/helpers/store'; import Ember from 'ember'; import {module, test} from 'qunit'; import DS from 'ember-data'; var env, store; var attr = DS.attr; var hasMany = DS.hasMany; var belongsTo = DS.belongsTo; var run = Ember.run; var Post, Tag; module("unit/many_array - DS.ManyArray", { beforeEach() { Post = DS.Model.extend({ title: attr('string'), tags: hasMany('tag', { async: false }) }); Tag = DS.Model.extend({ name: attr('string'), post: belongsTo('post', { async: false }) }); env = setupStore({ post: Post, tag: Tag }); store = env.store; }, afterEach() { run(function() { store.destroy(); }); } }); test("manyArray.save() calls save() on all records", function(assert) { assert.expect(3); run(function() { Tag.reopen({ save() { assert.ok(true, 'record.save() was called'); return Ember.RSVP.resolve(); } }); store.push({ data: [{ type: 'tag', id: '1', attributes: { name: 'Ember.js' } }, { type: 'tag', id: '2', attributes: { name: 'Tomster' } }, { type: 'post', id: '3', attributes: { title: 'A framework for creating ambitious web applications' }, relationships: { tags: { data: [ { type: 'tag', id: '1' }, { type: 'tag', id: '2' } ] } } }] }); var post = store.peekRecord('post', 3); post.get('tags').save().then(function() { assert.ok(true, 'manyArray.save() promise resolved'); }); }); }); test("manyArray trigger arrayContentChange functions with the correct values", function(assert) { assert.expect(12); var willChangeStartIdx; var willChangeRemoveAmt; var willChangeAddAmt; var originalArrayContentWillChange = DS.ManyArray.prototype.arrayContentWillChange; var originalArrayContentDidChange = DS.ManyArray.prototype.arrayContentDidChange; DS.ManyArray.reopen({ arrayContentWillChange(startIdx, removeAmt, addAmt) { willChangeStartIdx = startIdx; willChangeRemoveAmt = removeAmt; willChangeAddAmt = addAmt; return this._super.apply(this, arguments); }, arrayContentDidChange(startIdx, removeAmt, addAmt) { assert.equal(startIdx, willChangeStartIdx, 'WillChange and DidChange startIdx should match'); assert.equal(removeAmt, willChangeRemoveAmt, 'WillChange and DidChange removeAmt should match'); assert.equal(addAmt, willChangeAddAmt, 'WillChange and DidChange addAmt should match'); return this._super.apply(this, arguments); } }); run(function() { store.push({ data: [{ type: 'tag', id: '1', attributes: { name: 'Ember.js' } }, { type: 'tag', id: '2', attributes: { name: 'Tomster' } }, { type: 'post', id: '3', attributes: { title: 'A framework for creating ambitious web applications' }, relationships: { tags: { data: [ { type: 'tag', id: '1' } ] } } }] }); store.peekRecord('post', 3); store.push({ data: { type: 'post', id: '3', attributes: { title: 'A framework for creating ambitious web applications' }, relationships: { tags: { data: [ { type: 'tag', id: '1' }, { type: 'tag', id: '2' } ] } } } }); store.peekRecord('post', 3); }); DS.ManyArray.reopen({ arrayContentWillChange: originalArrayContentWillChange, arrayContentDidChange: originalArrayContentDidChange }); });
nickiaconis/data
tests/unit/many-array-test.js
JavaScript
mit
3,924
using System.Threading; using System.Threading.Tasks; namespace FluentSpotifyApi.Builder.Me.Following { /// <summary> /// The builder for "playlists/{playlistId}/followers" endpoint. /// </summary> public interface IFollowedPlaylistBuilder { /// <summary> /// Adds the current user as a follower of a playlist. /// </summary> /// <param name="id">The ID of playlist.</param> /// <param name="isPublic"> /// Defaults to <c>true</c>. If <c>true</c> the playlist will be included in user’s public playlists, if false it will remain private. /// To be able to follow playlists privately, the user must have granted the <c>playlist-modify-private</c> scope. /// </param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> Task FollowAsync(string id, bool? isPublic = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Removes the current user as a follower of a playlist. /// </summary> /// <param name="id">The ID of playlist.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> Task UnfollowAsync(string id, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Checks to see if current user is following a specified playlist. /// </summary> /// <param name="id">The ID of playlist.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> Task<bool> CheckAsync(string id, CancellationToken cancellationToken = default(CancellationToken)); } }
dotnetfan/FluentSpotifyApi
src/FluentSpotifyApi/Builder/Me/Following/IFollowedPlaylistBuilder.cs
C#
mit
1,776
<?php // This file is generated by Composer require_once 'vendor/autoload.php'; // Load .env file Dotenv::load(__DIR__); // Function to calculate the percentage function percent($amount, $total) { $countA = $amount / $total; $countB = $countA * 100; // Round number $count = number_format($countB, 0); return $count; } // Load portfolio data $info_json = json_decode(file_get_contents("data/info.json"), true); if (!getenv('GITHUB_API_TOKEN')) { die('No "GITHUB_API_TOKEN" found in .env file!'); } // Initiate API client $client = new \Github\Client(); // Authenticate using API token in .env $client->authenticate(getenv('GITHUB_API_TOKEN'), null, Github\Client::AUTH_HTTP_TOKEN); // I often forget to add a project, so passing "list" as argument // to this script, will only generate a list of all existing GitHub // repositories as well as associate them with their creation date // so you can see which ones you've forget to add here recently if (@$argv[1] === 'list') { // We need to create a pagniation to parse more than 30 repositories $repositoryApi = $client->api('user'); $paginator = new Github\ResultPager($client); $repositories = $paginator->fetchAll($repositoryApi, 'repositories', array('frdmn')); // Iterate through repositories foreach ($repositories as $project) { $forkString = ($project['fork'] ? '(F) ' : ''); echo $project['created_at'].' '.$forkString.$project['name']."\n"; } // Exit without status code exit(0); } foreach ($info_json['projects'] as $name => $project) { $repository = $client->api('repo')->show($project['owner'], $project['alias']); $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['name'] = $repository['name']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['description'] = $repository['description']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['github'] = $repository['full_name']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['stars'] = $repository['stargazers_count']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['watcher'] = $repository['watchers_count']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['forks'] = $repository['forks']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['language'] = $repository['language']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['created'] = $repository['created_at']; $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['updated'] = $repository['updated_at']; // Languages $languages = $client->api('repo')->languages($project['owner'], $project['alias']); foreach ($languages as $language => $size) { $json_prepare['projects'][$project['owner'].'/'.$project['alias']]['languages'][$language] = percent($size, array_sum($languages)); } } // Encode as JSON and print $json = json_encode($json_prepare, JSON_PRETTY_PRINT); echo $json; // Dump if /?dump is set if (isset($_GET['dump'])) { var_dump($repositories); } // Exit without status code exit(0);
frdmn/frd.mn
parser.php
PHP
mit
3,239
package org import ( "fmt" "strings" "unicode" "unicode/utf8" ) // OrgWriter export an org document into pretty printed org document. type OrgWriter struct { ExtendingWriter Writer TagsColumn int strings.Builder indent string } var emphasisOrgBorders = map[string][]string{ "_": []string{"_", "_"}, "*": []string{"*", "*"}, "/": []string{"/", "/"}, "+": []string{"+", "+"}, "~": []string{"~", "~"}, "=": []string{"=", "="}, "_{}": []string{"_{", "}"}, "^{}": []string{"^{", "}"}, } func NewOrgWriter() *OrgWriter { return &OrgWriter{ TagsColumn: 77, } } func (w *OrgWriter) WriterWithExtensions() Writer { if w.ExtendingWriter != nil { return w.ExtendingWriter } return w } func (w *OrgWriter) Before(d *Document) {} func (w *OrgWriter) After(d *Document) {} func (w *OrgWriter) WriteNodesAsString(nodes ...Node) string { builder := w.Builder w.Builder = strings.Builder{} WriteNodes(w, nodes...) out := w.String() w.Builder = builder return out } func (w *OrgWriter) WriteHeadline(h Headline) { start := w.Len() w.WriteString(strings.Repeat("*", h.Lvl)) if h.Status != "" { w.WriteString(" " + h.Status) } if h.Priority != "" { w.WriteString(" [#" + h.Priority + "]") } w.WriteString(" ") WriteNodes(w, h.Title...) if len(h.Tags) != 0 { tString := ":" + strings.Join(h.Tags, ":") + ":" if n := w.TagsColumn - len(tString) - (w.Len() - start); n > 0 { w.WriteString(strings.Repeat(" ", n) + tString) } else { w.WriteString(" " + tString) } } w.WriteString("\n") if len(h.Children) != 0 { w.WriteString(w.indent) } if h.Properties != nil { WriteNodes(w, *h.Properties) } WriteNodes(w, h.Children...) } func (w *OrgWriter) WriteBlock(b Block) { w.WriteString(w.indent + "#+BEGIN_" + b.Name) if len(b.Parameters) != 0 { w.WriteString(" " + strings.Join(b.Parameters, " ")) } w.WriteString("\n") if isRawTextBlock(b.Name) { w.WriteString(w.indent) } WriteNodes(w, b.Children...) if !isRawTextBlock(b.Name) { w.WriteString(w.indent) } w.WriteString("#+END_" + b.Name + "\n") } func (w *OrgWriter) WriteDrawer(d Drawer) { w.WriteString(w.indent + ":" + d.Name + ":\n") WriteNodes(w, d.Children...) w.WriteString(w.indent + ":END:\n") } func (w *OrgWriter) WritePropertyDrawer(d PropertyDrawer) { w.WriteString(":PROPERTIES:\n") for _, kvPair := range d.Properties { k, v := kvPair[0], kvPair[1] if v != "" { v = " " + v } w.WriteString(fmt.Sprintf(":%s:%s\n", k, v)) } w.WriteString(":END:\n") } func (w *OrgWriter) WriteFootnoteDefinition(f FootnoteDefinition) { w.WriteString(fmt.Sprintf("[fn:%s]", f.Name)) content := w.WriteNodesAsString(f.Children...) if content != "" && !unicode.IsSpace(rune(content[0])) { w.WriteString(" ") } w.WriteString(content) } func (w *OrgWriter) WriteParagraph(p Paragraph) { content := w.WriteNodesAsString(p.Children...) if len(content) > 0 && content[0] != '\n' { w.WriteString(w.indent) } w.WriteString(content + "\n") } func (w *OrgWriter) WriteExample(e Example) { for _, n := range e.Children { w.WriteString(w.indent + ":") if content := w.WriteNodesAsString(n); content != "" { w.WriteString(" " + content) } w.WriteString("\n") } } func (w *OrgWriter) WriteKeyword(k Keyword) { w.WriteString(w.indent + "#+" + k.Key + ":") if k.Value != "" { w.WriteString(" " + k.Value) } w.WriteString("\n") } func (w *OrgWriter) WriteInclude(i Include) { w.WriteKeyword(i.Keyword) } func (w *OrgWriter) WriteNodeWithMeta(n NodeWithMeta) { for _, ns := range n.Meta.Caption { w.WriteString("#+CAPTION: ") WriteNodes(w, ns...) w.WriteString("\n") } for _, attributes := range n.Meta.HTMLAttributes { w.WriteString("#+ATTR_HTML: ") w.WriteString(strings.Join(attributes, " ") + "\n") } WriteNodes(w, n.Node) } func (w *OrgWriter) WriteNodeWithName(n NodeWithName) { w.WriteString(fmt.Sprintf("#+NAME: %s\n", n.Name)) WriteNodes(w, n.Node) } func (w *OrgWriter) WriteComment(c Comment) { w.WriteString(w.indent + "#" + c.Content + "\n") } func (w *OrgWriter) WriteList(l List) { WriteNodes(w, l.Items...) } func (w *OrgWriter) WriteListItem(li ListItem) { originalBuilder, originalIndent := w.Builder, w.indent w.Builder, w.indent = strings.Builder{}, w.indent+strings.Repeat(" ", len(li.Bullet)+1) WriteNodes(w, li.Children...) content := strings.TrimPrefix(w.String(), w.indent) w.Builder, w.indent = originalBuilder, originalIndent w.WriteString(w.indent + li.Bullet) if li.Status != "" { w.WriteString(fmt.Sprintf(" [%s]", li.Status)) } if len(content) > 0 && content[0] == '\n' { w.WriteString(content) } else { w.WriteString(" " + content) } } func (w *OrgWriter) WriteDescriptiveListItem(di DescriptiveListItem) { w.WriteString(w.indent + di.Bullet) if di.Status != "" { w.WriteString(fmt.Sprintf(" [%s]", di.Status)) } indent := w.indent + strings.Repeat(" ", len(di.Bullet)+1) if len(di.Term) != 0 { term := w.WriteNodesAsString(di.Term...) w.WriteString(" " + term + " ::") indent = indent + strings.Repeat(" ", len(term)+4) } originalBuilder, originalIndent := w.Builder, w.indent w.Builder, w.indent = strings.Builder{}, indent WriteNodes(w, di.Details...) details := strings.TrimPrefix(w.String(), w.indent) w.Builder, w.indent = originalBuilder, originalIndent if len(details) > 0 && details[0] == '\n' { w.WriteString(details) } else { w.WriteString(" " + details) } } func (w *OrgWriter) WriteTable(t Table) { for _, row := range t.Rows { w.WriteString(w.indent) if len(row.Columns) == 0 { w.WriteString(`|`) for i := 0; i < len(t.ColumnInfos); i++ { w.WriteString(strings.Repeat("-", t.ColumnInfos[i].Len+2)) if i < len(t.ColumnInfos)-1 { w.WriteString("+") } } w.WriteString(`|`) } else { w.WriteString(`|`) for _, column := range row.Columns { w.WriteString(` `) content := w.WriteNodesAsString(column.Children...) if content == "" { content = " " } n := column.Len - utf8.RuneCountInString(content) if n < 0 { n = 0 } if column.Align == "center" { if n%2 != 0 { w.WriteString(" ") } w.WriteString(strings.Repeat(" ", n/2) + content + strings.Repeat(" ", n/2)) } else if column.Align == "right" { w.WriteString(strings.Repeat(" ", n) + content) } else { w.WriteString(content + strings.Repeat(" ", n)) } w.WriteString(` |`) } } w.WriteString("\n") } } func (w *OrgWriter) WriteHorizontalRule(hr HorizontalRule) { w.WriteString(w.indent + "-----\n") } func (w *OrgWriter) WriteText(t Text) { w.WriteString(t.Content) } func (w *OrgWriter) WriteEmphasis(e Emphasis) { borders, ok := emphasisOrgBorders[e.Kind] if !ok { panic(fmt.Sprintf("bad emphasis %#v", e)) } w.WriteString(borders[0]) WriteNodes(w, e.Content...) w.WriteString(borders[1]) } func (w *OrgWriter) WriteLatexFragment(l LatexFragment) { w.WriteString(l.OpeningPair) WriteNodes(w, l.Content...) w.WriteString(l.ClosingPair) } func (w *OrgWriter) WriteStatisticToken(s StatisticToken) { w.WriteString(fmt.Sprintf("[%s]", s.Content)) } func (w *OrgWriter) WriteLineBreak(l LineBreak) { w.WriteString(strings.Repeat("\n"+w.indent, l.Count)) } func (w *OrgWriter) WriteExplicitLineBreak(l ExplicitLineBreak) { w.WriteString(`\\` + "\n" + w.indent) } func (w *OrgWriter) WriteTimestamp(t Timestamp) { w.WriteString("<") if t.IsDate { w.WriteString(t.Time.Format(datestampFormat)) } else { w.WriteString(t.Time.Format(timestampFormat)) } if t.Interval != "" { w.WriteString(" " + t.Interval) } w.WriteString(">") } func (w *OrgWriter) WriteFootnoteLink(l FootnoteLink) { w.WriteString("[fn:" + l.Name) if l.Definition != nil { w.WriteString(":") WriteNodes(w, l.Definition.Children[0].(Paragraph).Children...) } w.WriteString("]") } func (w *OrgWriter) WriteRegularLink(l RegularLink) { if l.AutoLink { w.WriteString(l.URL) } else if l.Description == nil { w.WriteString(fmt.Sprintf("[[%s]]", l.URL)) } else { w.WriteString(fmt.Sprintf("[[%s][%s]]", l.URL, w.WriteNodesAsString(l.Description...))) } }
typeless/gitea
vendor/github.com/niklasfasching/go-org/org/org_writer.go
GO
mit
8,133