code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
line_mean
float64
0.5
100
line_max
int64
1
1k
alpha_frac
float64
0.25
1
autogenerated
bool
1 class
<?php /** * Created by PhpStorm. * User: jmannion * Date: 04/08/14 * Time: 22:17 */ namespace JamesMannion\ForumBundle\Form\User; use Symfony\Component\Form\FormBuilderInterface; use JamesMannion\ForumBundle\Constants\Label; use JamesMannion\ForumBundle\Constants\Button; use JamesMannion\ForumBundle\Constants\Validation; use Doctrine\ORM\EntityRepository; use Symfony\Component\Form\AbstractType; class UserCreateForm extends AbstractType { private $name = 'userCreateForm'; public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add( 'username', 'text', array( 'mapped' => true, 'required' => true, 'label' => Label::REGISTRATION_USERNAME, 'max_length' => 100, ) ) ->add( 'email', 'repeated', array( 'type' => 'email', 'mapped' => true, 'required' => true, 'max_length' => 100, 'invalid_message' => Validation::REGISTRATION_EMAIL_MATCH, 'first_options' => array( 'label' => Label::REGISTRATION_EMAIL, ), 'second_options' => array( 'label' => Label::REGISTRATION_REPEAT_EMAIL), ) ) ->add( 'password', 'repeated', array( 'mapped' => true, 'type' => 'password', 'required' => true, 'max_length' => 100, 'invalid_message' => Validation::REGISTRATION_PASSWORD_MATCH, 'first_options' => array('label' => Label::REGISTRATION_PASSWORD), 'second_options' => array('label' => Label::REGISTRATION_REPEAT_PASSWORD) ) ) ->add( 'memorableQuestion', 'entity', array( 'mapped' => true, 'required' => true, 'label' => Label::REGISTRATION_MEMORABLE_QUESTION, 'class' => 'JamesMannionForumBundle:MemorableQuestion', 'query_builder' => function(EntityRepository $er) { return $er->createQueryBuilder('q') ->orderBy('q.question', 'ASC'); } ) ) ->add( 'memorableAnswer', 'text', array( 'mapped' => true, 'required' => true, 'label' => Label::REGISTRATION_MEMORABLE_ANSWER, 'max_length' => 100, ) ) ->add( 'save', 'submit', array( 'label' => Button::REGISTRATION_SUBMIT ) ); } /** * @return string */ public function getName() { return $this->name; } }
mannion007/JamesMannionForum
src/JamesMannion/ForumBundle/Form/User/UserCreateForm.php
PHP
mit
3,204
28.136364
89
0.430087
false
/** * @file main.c * @brief Main routine * * @section License * * Copyright (C) 2010-2015 Oryx Embedded SARL. All rights reserved. * * This program 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Oryx Embedded SARL (www.oryx-embedded.com) * @version 1.6.4 **/ //Dependencies #include <stdlib.h> #include "stm32f4xx.h" #include "stm32f4_discovery.h" #include "stm32f4_discovery_lcd.h" #include "os_port.h" #include "core/net.h" #include "drivers/stm32f4x7_eth.h" #include "drivers/lan8720.h" #include "dhcp/dhcp_client.h" #include "ipv6/slaac.h" #include "smtp/smtp_client.h" #include "yarrow.h" #include "error.h" #include "debug.h" //Application configuration #define APP_MAC_ADDR "00-AB-CD-EF-04-07" #define APP_USE_DHCP ENABLED #define APP_IPV4_HOST_ADDR "192.168.0.20" #define APP_IPV4_SUBNET_MASK "255.255.255.0" #define APP_IPV4_DEFAULT_GATEWAY "192.168.0.254" #define APP_IPV4_PRIMARY_DNS "8.8.8.8" #define APP_IPV4_SECONDARY_DNS "8.8.4.4" #define APP_USE_SLAAC ENABLED #define APP_IPV6_LINK_LOCAL_ADDR "fe80::407" #define APP_IPV6_PREFIX "2001:db8::" #define APP_IPV6_PREFIX_LENGTH 64 #define APP_IPV6_GLOBAL_ADDR "2001:db8::407" #define APP_IPV6_ROUTER "fe80::1" #define APP_IPV6_PRIMARY_DNS "2001:4860:4860::8888" #define APP_IPV6_SECONDARY_DNS "2001:4860:4860::8844" //Global variables uint_t lcdLine = 0; uint_t lcdColumn = 0; DhcpClientSettings dhcpClientSettings; DhcpClientCtx dhcpClientContext; SlaacSettings slaacSettings; SlaacContext slaacContext; YarrowContext yarrowContext; uint8_t seed[32]; /** * @brief Set cursor location * @param[in] line Line number * @param[in] column Column number **/ void lcdSetCursor(uint_t line, uint_t column) { lcdLine = MIN(line, 10); lcdColumn = MIN(column, 20); } /** * @brief Write a character to the LCD display * @param[in] c Character to be written **/ void lcdPutChar(char_t c) { if(c == '\r') { lcdColumn = 0; } else if(c == '\n') { lcdColumn = 0; lcdLine++; } else if(lcdLine < 10 && lcdColumn < 20) { //Display current character LCD_DisplayChar(lcdLine * 24, lcdColumn * 16, c); //Advance the cursor position if(++lcdColumn >= 20) { lcdColumn = 0; lcdLine++; } } } /** * @brief I/O initialization **/ void ioInit(void) { GPIO_InitTypeDef GPIO_InitStructure; //LED configuration STM_EVAL_LEDInit(LED3); STM_EVAL_LEDInit(LED4); STM_EVAL_LEDInit(LED5); STM_EVAL_LEDInit(LED6); //Clear LEDs STM_EVAL_LEDOff(LED3); STM_EVAL_LEDOff(LED4); STM_EVAL_LEDOff(LED5); STM_EVAL_LEDOff(LED6); //Initialize user button STM_EVAL_PBInit(BUTTON_USER, BUTTON_MODE_GPIO); //Enable GPIOE clock RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE); //Configure PE2 (PHY_RST) pin as an output GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOE, &GPIO_InitStructure); //Reset PHY transceiver (hard reset) GPIO_ResetBits(GPIOE, GPIO_Pin_2); sleep(10); GPIO_SetBits(GPIOE, GPIO_Pin_2); sleep(10); } /** * @brief SMTP client test routine * @return Error code **/ error_t smtpClientTest(void) { error_t error; //Authentication information static SmtpAuthInfo authInfo = { NULL, //Network interface "smtp.gmail.com", //SMTP server name 25, //SMTP server port "username", //User name "password", //Password FALSE, //Use STARTTLS rather than implicit TLS YARROW_PRNG_ALGO, //PRNG algorithm &yarrowContext //PRNG context }; //Recipients static SmtpMailAddr recipients[2] = { {"Alice", "alice@example.com", SMTP_RCPT_TYPE_TO}, //First recipient {"Bob", "bob@example.com", SMTP_RCPT_TYPE_CC} //Second recipient }; //Mail contents static SmtpMail mail = { {"Charlie", "charlie@gmail.com"}, //From recipients, //Recipients 2, //Recipient count "", //Date "SMTP Client Demo", //Subject "Hello World!" //Body }; //Send mail error = smtpSendMail(&authInfo, &mail); //Return status code return error; } /** * @brief User task **/ void userTask(void *param) { char_t buffer[40]; //Point to the network interface NetInterface *interface = &netInterface[0]; //Initialize LCD display lcdSetCursor(2, 0); printf("IPv4 Addr\r\n"); lcdSetCursor(5, 0); printf("Press user button\r\nto run test\r\n"); //Endless loop while(1) { //Display IPv4 host address lcdSetCursor(3, 0); printf("%-16s\r\n", ipv4AddrToString(interface->ipv4Config.addr, buffer)); //User button pressed? if(STM_EVAL_PBGetState(BUTTON_USER)) { //SMTP client test routine smtpClientTest(); //Wait for the user button to be released while(STM_EVAL_PBGetState(BUTTON_USER)); } //Loop delay osDelayTask(100); } } /** * @brief LED blinking task **/ void blinkTask(void *parameters) { //Endless loop while(1) { STM_EVAL_LEDOn(LED4); osDelayTask(100); STM_EVAL_LEDOff(LED4); osDelayTask(900); } } /** * @brief Main entry point * @return Unused value **/ int_t main(void) { error_t error; uint_t i; uint32_t value; NetInterface *interface; OsTask *task; MacAddr macAddr; #if (APP_USE_DHCP == DISABLED) Ipv4Addr ipv4Addr; #endif #if (APP_USE_SLAAC == DISABLED) Ipv6Addr ipv6Addr; #endif //Initialize kernel osInitKernel(); //Configure debug UART debugInit(115200); //Start-up message TRACE_INFO("\r\n"); TRACE_INFO("***********************************\r\n"); TRACE_INFO("*** CycloneTCP SMTP Client Demo ***\r\n"); TRACE_INFO("***********************************\r\n"); TRACE_INFO("Copyright: 2010-2015 Oryx Embedded SARL\r\n"); TRACE_INFO("Compiled: %s %s\r\n", __DATE__, __TIME__); TRACE_INFO("Target: STM32F407\r\n"); TRACE_INFO("\r\n"); //Configure I/Os ioInit(); //Initialize LCD display STM32f4_Discovery_LCD_Init(); LCD_SetBackColor(Blue); LCD_SetTextColor(White); LCD_SetFont(&Font16x24); LCD_Clear(Blue); //Welcome message lcdSetCursor(0, 0); printf("SMTP Client Demo\r\n"); //Enable RNG peripheral clock RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_RNG, ENABLE); //Enable RNG RNG_Cmd(ENABLE); //Generate a random seed for(i = 0; i < 32; i += 4) { //Wait for the RNG to contain a valid data while(RNG_GetFlagStatus(RNG_FLAG_DRDY) == RESET); //Get 32-bit random value value = RNG_GetRandomNumber(); //Copy random value seed[i] = value & 0xFF; seed[i + 1] = (value >> 8) & 0xFF; seed[i + 2] = (value >> 16) & 0xFF; seed[i + 3] = (value >> 24) & 0xFF; } //PRNG initialization error = yarrowInit(&yarrowContext); //Any error to report? if(error) { //Debug message TRACE_ERROR("Failed to initialize PRNG!\r\n"); } //Properly seed the PRNG error = yarrowSeed(&yarrowContext, seed, sizeof(seed)); //Any error to report? if(error) { //Debug message TRACE_ERROR("Failed to seed PRNG!\r\n"); } //TCP/IP stack initialization error = netInit(); //Any error to report? if(error) { //Debug message TRACE_ERROR("Failed to initialize TCP/IP stack!\r\n"); } //Configure the first Ethernet interface interface = &netInterface[0]; //Set interface name netSetInterfaceName(interface, "eth0"); //Set host name netSetHostname(interface, "SMTPClientDemo"); //Select the relevant network adapter netSetDriver(interface, &stm32f4x7EthDriver); netSetPhyDriver(interface, &lan8720PhyDriver); //Set host MAC address macStringToAddr(APP_MAC_ADDR, &macAddr); netSetMacAddr(interface, &macAddr); //Initialize network interface error = netConfigInterface(interface); //Any error to report? if(error) { //Debug message TRACE_ERROR("Failed to configure interface %s!\r\n", interface->name); } #if (IPV4_SUPPORT == ENABLED) #if (APP_USE_DHCP == ENABLED) //Get default settings dhcpClientGetDefaultSettings(&dhcpClientSettings); //Set the network interface to be configured by DHCP dhcpClientSettings.interface = interface; //Disable rapid commit option dhcpClientSettings.rapidCommit = FALSE; //DHCP client initialization error = dhcpClientInit(&dhcpClientContext, &dhcpClientSettings); //Failed to initialize DHCP client? if(error) { //Debug message TRACE_ERROR("Failed to initialize DHCP client!\r\n"); } //Start DHCP client error = dhcpClientStart(&dhcpClientContext); //Failed to start DHCP client? if(error) { //Debug message TRACE_ERROR("Failed to start DHCP client!\r\n"); } #else //Set IPv4 host address ipv4StringToAddr(APP_IPV4_HOST_ADDR, &ipv4Addr); ipv4SetHostAddr(interface, ipv4Addr); //Set subnet mask ipv4StringToAddr(APP_IPV4_SUBNET_MASK, &ipv4Addr); ipv4SetSubnetMask(interface, ipv4Addr); //Set default gateway ipv4StringToAddr(APP_IPV4_DEFAULT_GATEWAY, &ipv4Addr); ipv4SetDefaultGateway(interface, ipv4Addr); //Set primary and secondary DNS servers ipv4StringToAddr(APP_IPV4_PRIMARY_DNS, &ipv4Addr); ipv4SetDnsServer(interface, 0, ipv4Addr); ipv4StringToAddr(APP_IPV4_SECONDARY_DNS, &ipv4Addr); ipv4SetDnsServer(interface, 1, ipv4Addr); #endif #endif #if (IPV6_SUPPORT == ENABLED) #if (APP_USE_SLAAC == ENABLED) //Get default settings slaacGetDefaultSettings(&slaacSettings); //Set the network interface to be configured slaacSettings.interface = interface; //SLAAC initialization error = slaacInit(&slaacContext, &slaacSettings); //Failed to initialize SLAAC? if(error) { //Debug message TRACE_ERROR("Failed to initialize SLAAC!\r\n"); } //Start IPv6 address autoconfiguration process error = slaacStart(&slaacContext); //Failed to start SLAAC process? if(error) { //Debug message TRACE_ERROR("Failed to start SLAAC!\r\n"); } #else //Set link-local address ipv6StringToAddr(APP_IPV6_LINK_LOCAL_ADDR, &ipv6Addr); ipv6SetLinkLocalAddr(interface, &ipv6Addr); //Set IPv6 prefix ipv6StringToAddr(APP_IPV6_PREFIX, &ipv6Addr); ipv6SetPrefix(interface, &ipv6Addr, APP_IPV6_PREFIX_LENGTH); //Set global address ipv6StringToAddr(APP_IPV6_GLOBAL_ADDR, &ipv6Addr); ipv6SetGlobalAddr(interface, &ipv6Addr); //Set router ipv6StringToAddr(APP_IPV6_ROUTER, &ipv6Addr); ipv6SetRouter(interface, &ipv6Addr); //Set primary and secondary DNS servers ipv6StringToAddr(APP_IPV6_PRIMARY_DNS, &ipv6Addr); ipv6SetDnsServer(interface, 0, &ipv6Addr); ipv6StringToAddr(APP_IPV6_SECONDARY_DNS, &ipv6Addr); ipv6SetDnsServer(interface, 1, &ipv6Addr); #endif #endif //Create user task task = osCreateTask("User Task", userTask, NULL, 800, 1); //Failed to create the task? if(task == OS_INVALID_HANDLE) { //Debug message TRACE_ERROR("Failed to create task!\r\n"); } //Create a task to blink the LED task = osCreateTask("Blink", blinkTask, NULL, 500, 1); //Failed to create the task? if(task == OS_INVALID_HANDLE) { //Debug message TRACE_ERROR("Failed to create task!\r\n"); } //Start the execution of tasks osStartKernel(); //This function should never return return 0; }
miragecentury/M2_SE_RTOS_Project
Project/LPC1549_Keil/CycloneTCP_SSL_Crypto_Open_1_6_4/demo/st/stm32f4_discovery/smtp_client_demo/src/main.c
C
mit
12,503
23.80754
80
0.648404
false
### Standalone SearchBox ```jsx const { compose, withProps, lifecycle } = require("recompose"); const { withScriptjs, } = require("react-google-maps"); const { StandaloneSearchBox } = require("react-google-maps/lib/components/places/StandaloneSearchBox"); const PlacesWithStandaloneSearchBox = compose( withProps({ googleMapURL: "https://maps.googleapis.com/maps/api/js?key=AIzaSyC4R6AN7SmujjPUIGKdyao2Kqitzr1kiRg&v=3.exp&libraries=geometry,drawing,places", loadingElement: <div style={{ height: `100%` }} />, containerElement: <div style={{ height: `400px` }} />, }), lifecycle({ componentWillMount() { const refs = {} this.setState({ places: [], onSearchBoxMounted: ref => { refs.searchBox = ref; }, onPlacesChanged: () => { const places = refs.searchBox.getPlaces(); this.setState({ places, }); }, }) }, }), withScriptjs )(props => <div data-standalone-searchbox=""> <StandaloneSearchBox ref={props.onSearchBoxMounted} bounds={props.bounds} onPlacesChanged={props.onPlacesChanged} > <input type="text" placeholder="Customized your placeholder" style={{ boxSizing: `border-box`, border: `1px solid transparent`, width: `240px`, height: `32px`, padding: `0 12px`, borderRadius: `3px`, boxShadow: `0 2px 6px rgba(0, 0, 0, 0.3)`, fontSize: `14px`, outline: `none`, textOverflow: `ellipses`, }} /> </StandaloneSearchBox> <ol> {props.places.map(({ place_id, formatted_address, geometry: { location } }) => <li key={place_id}> {formatted_address} {" at "} ({location.lat()}, {location.lng()}) </li> )} </ol> </div> ); <PlacesWithStandaloneSearchBox /> ```
tomchentw/react-google-maps
src/components/places/StandaloneSearchBox.md
Markdown
mit
1,945
25.643836
146
0.564524
false
/*! Slidebox.JS - v1.0 - 2013-11-30 * http://github.com/trevanhetzel/slidebox * * Copyright (c) 2013 Trevan Hetzel <trevan.co>; * Licensed under the MIT license */ slidebox = function (params) { // Carousel carousel = function () { var $carousel = $(params.container).children(".carousel"), $carouselItem = $(".carousel li"), $triggerLeft = $(params.leftTrigger), $triggerRight = $(params.rightTrigger), total = $carouselItem.length, current = 0; var moveLeft = function () { if ( current > 0 ) { $carousel.animate({ "left": "+=" + params.length + "px" }, params.speed ); current--; } }; var moveRight = function () { if ( current < total - 2 ) { $carousel.animate({ "left": "-=" + params.length + "px" }, params.speed ); current++; } }; // Initiliaze moveLeft on trigger click $triggerLeft.on("click", function () { moveLeft(); }); // Initiliaze moveRight on trigger click $triggerRight.on("click", function () { moveRight(); }); // Initiliaze moveLeft on left keypress $(document).keydown(function (e){ if (e.keyCode == 37) { moveLeft(); } }); // Initiliaze moveRight on right keypress $(document).keydown(function (e){ if (e.keyCode == 39) { moveRight(); } }); }, // Lightbox lightbox = function () { var trigger = ".carousel li a"; // Close lightbox when pressing esc key $(document).keydown(function (e){ if (e.keyCode == 27) { closeLightbox(); } }); $(document) // Close lightbox on any click .on("click", function () { closeLightbox(); }) // If clicked on a thumbnail trigger, proceed .on("click", trigger, function (e) { var $this = $(this); // Prevent from clicking through e.preventDefault(); e.stopPropagation(); // Grab the image URL dest = $this.attr("href"); // Grab the caption from data attribute capt = $this.children("img").data("caption"); enlarge(dest, capt); /* If clicked on an enlarged image, stop propagation so it doesn't get the close function */ $(document).on("click", ".lightbox img", function (e) { e.stopPropagation(); }); }); closeLightbox = function () { $(".lightbox-cont").remove(); $(".lightbox").remove(); }, enlarge = function (dest, capt) { // Create new DOM elements $("body").append("<div class='lightbox-cont'></div><div class='lightbox'></div>"); $(".lightbox").html(function () { return "<img src='" + dest + "'><div class='lightbox-caption'>" + capt + "</div>"; }); } } // Initialize functions carousel(); lightbox(); };
trevanhetzel/slidebox
slidebox.js
JavaScript
mit
3,369
27.083333
98
0.461858
false
<?php // ============================================================================= // VIEWS/ETHOS/_POST-CAROUSEL.PHP // ----------------------------------------------------------------------------- // Outputs the post carousel that appears at the top of the masthead. // ============================================================================= GLOBAL $post_carousel_entry_id; $post_carousel_entry_id = get_the_ID(); $is_enabled = x_get_option( 'x_ethos_post_carousel_enable', '' ) == '1'; $count = x_get_option( 'x_ethos_post_carousel_count' ); $display = x_get_option( 'x_ethos_post_carousel_display' ); switch ( $display ) { case 'most-commented' : $args = array( 'post_type' => 'post', 'posts_per_page' => $count, 'orderby' => 'comment_count', 'order' => 'DESC' ); break; case 'random' : $args = array( 'post_type' => 'post', 'posts_per_page' => $count, 'orderby' => 'rand' ); break; case 'featured' : $args = array( 'post_type' => 'post', 'posts_per_page' => $count, 'orderby' => 'date', 'meta_key' => '_x_ethos_post_carousel_display', 'meta_value' => 'on' ); break; } ?> <?php if ( $is_enabled ) : ?> <ul class="x-post-carousel unstyled"> <?php $wp_query = new WP_Query( $args ); ?> <?php if ( $wp_query->have_posts() ) : ?> <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <li class="x-post-carousel-item"> <?php x_ethos_entry_cover( 'post-carousel' ); ?> </li> <?php endwhile; ?> <?php endif; ?> <?php wp_reset_query(); ?> <script> jQuery(document).ready(function() { jQuery('.x-post-carousel').slick({ speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_large' ); ?>, slidesToScroll : 1, responsive : [ { breakpoint : 1500, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_large' ); ?> } }, { breakpoint : 1200, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_medium' ); ?> } }, { breakpoint : 979, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_small' ); ?> } }, { breakpoint : 550, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_small' ); ?> } } ] }); }); </script> </ul> <?php endif; ?>
whskyneat/element-wheels-blog
web/app/themes/x/framework/views/ethos/_post-carousel.php
PHP
mit
2,761
31.494118
170
0.484607
false
import test from 'ava'; import Server from '../../src/server'; import IO from '../../src/socket-io'; test.cb('mock socket invokes each handler with unique reference', t => { const socketUrl = 'ws://roomy'; const server = new Server(socketUrl); const socket = new IO(socketUrl); let handlerInvoked = 0; const handler3 = function handlerFunc() { t.true(true); handlerInvoked += 1; }; // Same functions but different scopes/contexts socket.on('custom-event', handler3.bind(Object.create(null))); socket.on('custom-event', handler3.bind(Object.create(null))); // Same functions with same scope/context (only one should be added) socket.on('custom-event', handler3); socket.on('custom-event', handler3); // not expected socket.on('connect', () => { socket.join('room'); server.to('room').emit('custom-event'); }); setTimeout(() => { t.is(handlerInvoked, 3, 'handler invoked too many times'); server.close(); t.end(); }, 500); }); test.cb('mock socket invokes each handler per socket', t => { const socketUrl = 'ws://roomy'; const server = new Server(socketUrl); const socketA = new IO(socketUrl); const socketB = new IO(socketUrl); let handlerInvoked = 0; const handler3 = function handlerFunc() { t.true(true); handlerInvoked += 1; }; // Same functions but different scopes/contexts socketA.on('custom-event', handler3.bind(socketA)); socketB.on('custom-event', handler3.bind(socketB)); // Same functions with same scope/context (only one should be added) socketA.on('custom-event', handler3); socketA.on('custom-event', handler3); // not expected socketB.on('custom-event', handler3.bind(socketB)); // expected because bind creates a new method socketA.on('connect', () => { socketA.join('room'); socketB.join('room'); server.to('room').emit('custom-event'); }); setTimeout(() => { t.is(handlerInvoked, 4, 'handler invoked too many times'); server.close(); t.end(); }, 500); });
thoov/mock-socket
tests/issues/65.test.js
JavaScript
mit
2,017
28.231884
99
0.65642
false
import React from 'react' import PropTypes from 'prop-types' import VelocityTrimControls from './VelocityTrimControls' import Instrument from '../../images/Instrument' import styles from '../../styles/velocityTrim' import { trimShape } from '../../reducers/velocityTrim' const handleKeyDown = (event, item, bank, userChangedTrimEnd) => { let delta = 0 event.nativeEvent.preventDefault() switch (event.key) { case 'ArrowUp': delta = 1 break case 'ArrowDown': delta = -1 break case 'PageUp': delta = 5 break case 'PageDown': delta = -5 break case 'Enter': delta = 100 break case 'Escape': delta = -100 break default: break } if (delta !== 0) { delta += item.trim if (delta < 0) delta = 0 if (delta > 100) delta = 100 userChangedTrimEnd(item.note, delta, bank) } } const VelocityTrim = (props) => { const { item, bank, selected, playNote, selectTrim, userChangedTrimEnd } = props const { note, trim, group, name } = item return ( <section tabIndex={note} onKeyDown={e => handleKeyDown(e, item, bank, userChangedTrimEnd)} onMouseUp={() => (selected ? null : selectTrim(note))} className={selected ? styles.selected : ''} role="presentation" > <div className={styles.header} onMouseUp={() => playNote(note, Math.round(127 * (trim / 100)), bank)} role="button" tabIndex={note} > <div>{note}</div> <div>{group}</div> <div>{Instrument(group)}</div> </div> <div className={styles.noteName} title={name} > {name} </div> <VelocityTrimControls {...props} /> </section> ) } VelocityTrim.propTypes = { item: trimShape.isRequired, selected: PropTypes.bool.isRequired, playNote: PropTypes.func.isRequired, selectTrim: PropTypes.func.isRequired, userChangedTrimEnd: PropTypes.func.isRequired, bank: PropTypes.number.isRequired, } export default VelocityTrim
dkadrios/zendrum-stompblock-client
src/components/trims/VelocityTrim.js
JavaScript
mit
2,066
23.305882
82
0.60697
false
class CreateTips < ActiveRecord::Migration[5.0] def change create_table :tips do |t| t.text :body t.timestamps end end end
agonzalez0515/Coco-app
db/migrate/20161220004643_create_tips.rb
Ruby
mit
148
15.444444
47
0.635135
false
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class MY_Controller extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper('url'); } } class Admin_Controller extends MY_Controller { public function __construct() { parent::__construct(); $this->is_logged_in(); } public function is_logged_in() { } }
bivinvinod/footballCrazy
application/core/MY_Controller.php
PHP
mit
439
15.884615
63
0.585421
false
# chrome-launcher-cli [![Build Status](https://travis-ci.org/ragingwind/chrome-launcher-cli.svg?branch=master)](https://travis-ci.org/ragingwind/chrome-launcher-cli) > Chrome Launcher for CLI, which is a CLI tool extended from [chrome-launcher](https://www.npmjs.com/package/chrome-launcher). Please visit to [chrome-launcher](https://www.npmjs.com/package/chrome-launcher) page for more information. ## Install ``` $ npm install -g chrome-launcher-cli ``` ## Usage ```js chrome --help ``` ## Receipts ### Test with Chrome Extension ``` chrome --app=file://test/index.html --system-developer-mode --load-extension=/test/extension --enable-extensions ``` ## License MIT © [Jimmy Moon](http://ragingwind.me)
ragingwind/chrome-launcher-cli
readme.md
Markdown
mit
719
23.758621
234
0.721448
false
/* * Copyright (c) 2014-2016, Santili Y-HRAH KRONG * 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. * * 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 HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sqlcreatetable.hpp> namespace cppsqlx { SQLCreateTable::SQLCreateTable(std::string tablename) { _objectname = tablename; _objecttype = "TABLE"; } std::string SQLCreateTable::toString() { std::string query; query = "CREATE "; query += _objecttype + " " + _objectname; if(_ds) { query += "(\n"; for(auto i = 1; i <= _ds->rowSize() ; i++) { query += _ds->at(i).name() + " " + _ds->at(i).type(); if(i != _ds->rowSize()) query += ",\n"; } query += "\n)"; } else { query += " AS\n"; query += _select; } switch(sqldialect_) { case DBPROVIDER::GREENPLUM : { query+= "\nDISTRIBUTED RANDOMLY"; break; } default: break; } return query; }; SQLCreateTable& SQLCreateTable::as(std::string select) { _select = select; return *this; } SQLCreateTable& SQLCreateTable::sameAs(std::shared_ptr<Dataset> ds) { _ds = ds; return *this; } };/*namespace cppsqlx*/
Santili/cppsqlx
source/sqlcreatetable.cpp
C++
mit
2,452
26.550562
83
0.655383
false
<?php /** * Link posts * * @package Start Here * @since Start Here 1.0.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="post-header"> <div class="header-metas"> <?php sh_post_format(); ?> <?php if( is_singular() ) { edit_post_link( __( 'Edit', 'textdomain' ), '<span class="edit-link">', '</span>' ); } ?> <span class="post-date"> <time class="published" datetime="<?php echo get_the_time('c'); ?>"><a title="<?php _e( 'Permalink to: ', 'textdomain' ); echo the_title(); ?>" href="<?php the_permalink(); ?>"><?php echo get_the_date(); ?></a></time> </span> <span class="post-author"> <?php _e( '- By ', 'textdomain' ); ?><a title="<?php _e('See other posts by ', 'textdomain'); the_author_meta( 'display_name' ); ?>" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author_meta( 'display_name' ); ?></a> </span> </div> </header> <div class="<?php if( is_single() ) { echo 'post-content'; } else { echo 'link-content'; } ?>"> <?php the_content(''); ?> </div> <?php if( !is_single() && has_excerpt() ) : ?> <?php the_excerpt(); ?> <a class="read-more" href="<?php the_permalink(); ?>" title="<?php echo _e( 'Read more', 'textdomain' ); ?>"><i class="g"></i><?php echo _e( 'Read more', 'textdomain' ); ?></a> <?php endif; ?> <?php if( is_single() ) : ?> <footer class="post-footer"> <ul class="taxo-metas"> <?php if( get_the_category() ) { ?><li class="category"><i class="gicn gicn-category"></i><?php the_category(' &#8226; '); ?></li><?php } ?> <li class="tag-links"><i class="gicn gicn-tag"></i><?php $tags_list = get_the_tag_list( '', __( ' ', 'textdomain' ) ); if ( $tags_list ) : printf( __( '%1$s', 'textdomain' ), $tags_list ); else : _e( 'No tags', 'textdomain' ); endif; ?> </li> </ul> </footer> <?php endif; ?> </article>
Manoz/start-here
start-here/templates/content-link.php
PHP
mit
2,213
37.553571
270
0.462268
false
/*! HTML5 Boilerplate v5.2.0 | MIT License | https://html5boilerplate.com/ */ /* * What follows is the result of much research on cross-browser styling. * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal, * Kroc Camen, and the H5BP dev community and team. */ /* ========================================================================== Base styles: opinionated defaults ========================================================================== */ html { color: #222; font-size: 1em; line-height: 1.4; } /* * Remove text-shadow in selection highlight: * https://twitter.com/miketaylr/status/12228805301 * * These selection rule sets have to be separate. * Customize the background color to match your design. */ ::-moz-selection { background: #b3d4fc; text-shadow: none; } ::selection { background: #b3d4fc; text-shadow: none; } /* * A better looking default horizontal rule */ hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } /* * Remove the gap between audio, canvas, iframes, * images, videos and the bottom of their containers: * https://github.com/h5bp/html5-boilerplate/issues/440 */ audio, canvas, iframe, img, svg, video { vertical-align: middle; } /* * Remove default fieldset styles. */ fieldset { border: 0; margin: 0; padding: 0; } /* * Allow only vertical resizing of textareas. */ textarea { resize: vertical; } /* ========================================================================== Browser Upgrade Prompt ========================================================================== */ .browserupgrade { margin: 0.2em 0; background: #ccc; color: #000; padding: 0.2em 0; } /* ========================================================================== GENERAL!!! ========================================================================== */ body { font-family: 'Oswald', sans-serif; background-image: url("../img/fond.jpg") !important; background-position: center; width: 100%; height: 500px; background-size: cover; } .fondecran{ height: 100%; } /* ========================================================================== NAVBAR!!! ========================================================================== */ #mainmenu { padding-bottom: 2%; } #mainmenu li a { padding-top: 6px; padding-bottom: 0px; margin-top: 7px; height: 34px; } .container { width: 83%; } #likefb { width: 70px; margin-top: -6%; } .border-nav { border-left: 1px dotted grey; } #logo1 { margin-top: -13px; width: 60%; } /*//////-- NAVBAR --//////*/ /*/////-- Content --//////*/ #slogan1 { background-color: rgba(0,120,215,0.2); } /* footer */ #footer { color: grey; height: 63px; background-color: #608A0C; } #footer h1 { font-size: 1em; padding-left: 20px; } #footer3 { padding-top: 11px; } #footer2 { font-size: 1.5em; color: white; background-color: #87C316; height : 60px; background-image: url(../img/shadow.png); background-size: cover; } .border-nav2 { border-left: 1px dotted grey; } .joueur{ position: absolute; width: 10%; } .vide { position: absolute; width: 10%; } /* ========================================================================== Helper classes ========================================================================== */ /* * Hide visually and from screen readers: */ .hidden { display: none !important; } /* * Hide only visually, but have it available for screen readers: * http://snook.ca/archives/html_and_css/hiding-content-for-accessibility */ .visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } /* * Extends the .visuallyhidden class to allow the element * to be focusable when navigated to via the keyboard: * https://www.drupal.org/node/897638 */ .visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } /* * Hide visually and from screen readers, but maintain layout */ .invisible { visibility: hidden; } /* * Clearfix: contain floats * * For modern browsers * 1. The space content is one way to avoid an Opera bug when the * `contenteditable` attribute is included anywhere else in the document. * Otherwise it causes space to appear at the top and bottom of elements * that receive the `clearfix` class. * 2. The use of `table` rather than `block` is only necessary if using * `:before` to contain the top-margins of child elements. */ .clearfix:before, .clearfix:after { content: " "; /* 1 */ display: table; /* 2 */ } .clearfix:after { clear: both; } /* ========================================================================== EXAMPLE Media Queries for Responsive Design. These examples override the primary ('mobile first') styles. Modify as content requires. ========================================================================== */ @media only screen and (min-width: 35em) { /* Style adjustments for viewports that meet the condition */ } @media print, (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 1.25dppx), (min-resolution: 120dpi) { /* Style adjustments for high resolution devices */ } /* ========================================================================== Print styles. Inlined to avoid the additional HTTP request: http://www.phpied.com/delay-loading-your-print-css/ ========================================================================== */ @media print { *, *:before, *:after { background: transparent !important; color: #000 !important; /* Black prints faster: http://www.sanbeiji.com/archives/953 */ box-shadow: none !important; text-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } /* * Don't show links that are fragment identifiers, * or use the `javascript:` pseudo protocol */ a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } /* * Printing Tables: * http://css-discuss.incutio.com/wiki/Printing_Tables */ thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } }
Simplon-Roubaix/ChallengeDimTeam
css/main.css
CSS
mit
7,136
19.215297
80
0.507147
false
#!/bin/bash SCRIPT_PATH="${BASH_SOURCE[0]}"; if ([ -h "${SCRIPT_PATH}" ]) then while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done fi pushd . > /dev/null cd `dirname ${SCRIPT_PATH}` > /dev/null SCRIPT_PATH=`pwd`; popd > /dev/null if ! [ -f $SCRIPT_PATH/.nuget/nuget.exe ] then wget "https://www.nuget.org/nuget.exe" -P $SCRIPT_PATH/.nuget/ fi mono $SCRIPT_PATH/.nuget/nuget.exe update -self SCRIPT_PATH="${BASH_SOURCE[0]}"; if ([ -h "${SCRIPT_PATH}" ]) then while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done fi pushd . > /dev/null cd `dirname ${SCRIPT_PATH}` > /dev/null SCRIPT_PATH=`pwd`; popd > /dev/null mono $SCRIPT_PATH/.nuget/NuGet.exe update -self mono $SCRIPT_PATH/.nuget/NuGet.exe install FAKE -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion -Version 4.16.1 mono $SCRIPT_PATH/.nuget/NuGet.exe install xunit.runner.console -OutputDirectory $SCRIPT_PATH/packages/FAKE -ExcludeVersion -Version 2.0.0 mono $SCRIPT_PATH/.nuget/NuGet.exe install NUnit.Console -OutputDirectory $SCRIPT_PATH/packages/FAKE -ExcludeVersion -Version 3.2.1 mono $SCRIPT_PATH/.nuget/NuGet.exe install NBench.Runner -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion -Version 0.3.1 if ! [ -e $SCRIPT_PATH/packages/SourceLink.Fake/tools/SourceLink.fsx ] ; then mono $SCRIPT_PATH/.nuget/NuGet.exe install SourceLink.Fake -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion fi export encoding=utf-8 mono $SCRIPT_PATH/packages/FAKE/tools/FAKE.exe build.fsx "$@"
Horusiath/Hyperion
build.sh
Shell
mit
1,543
33.288889
138
0.711601
false
#include <assert.h> #include <SDL2/SDL.h> #include <SDL2/SDL_ttf.h> #include <video/gl.h> #include <xxhash.h> #include <memtrack.h> #include "base/stack.h" #include "core/common.h" #include "base/math_ext.h" #include "core/asset.h" #include "core/configs.h" #include "core/frame.h" #include "core/logerr.h" #include <core/application.h> #include "core/video.h" #include "video/resources_detail.h" #include <core/audio.h> static int running = 1; static STACK *states_stack; static APP_STATE *allstates; static size_t states_num; NEON_API void application_next_state(unsigned int state) { if (state > states_num) { LOG_ERROR("State(%d) out of range", state); exit(EXIT_FAILURE); } push_stack(states_stack, &allstates[state]); ((APP_STATE*)top_stack(states_stack))->on_init(); frame_flush(); } NEON_API void application_back_state(void) { ((APP_STATE*)pop_stack(states_stack))->on_cleanup(); frame_flush(); } static void application_cleanup(void) { configs_cleanup(); asset_close(); audio_cleanup(); video_cleanup(); while (!is_stack_empty(states_stack)) application_back_state(); delete_stack(states_stack); } #ifdef OPENAL_BACKEND #define SDL_INIT_FLAGS (SDL_INIT_VIDEO | SDL_INIT_TIMER) #else #define SDL_INIT_FLAGS (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) #endif NEON_API int application_exec(const char *title, APP_STATE *states, size_t states_n) { allstates = states; states_num = states_n; if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { LOG_ERROR("%s\n", SDL_GetError()); return EXIT_FAILURE; } atexit(SDL_Quit); if (TTF_Init() < 0) { LOG_ERROR("%s\n", TTF_GetError()); return EXIT_FAILURE; } atexit(TTF_Quit); if ((states_stack = new_stack(sizeof(APP_STATE), states_n + 1)) == NULL) { LOG_ERROR("%s\n", "Can\'t create game states stack"); return EXIT_FAILURE; } LOG("%s launched...\n", title); LOG("Platform: %s\n", SDL_GetPlatform()); video_init(title); audio_init(); atexit(application_cleanup); application_next_state(0); if (is_stack_empty(states_stack)) { LOG_CRITICAL("%s\n", "No game states"); exit(EXIT_FAILURE); } SDL_Event event; Uint64 current = 0; Uint64 last = 0; float accumulator = 0.0f; while(running) { frame_begin(); while(SDL_PollEvent(&event)) { ((APP_STATE*)top_stack(states_stack))->on_event(&event); } asset_process(); resources_process(); last = current; current = SDL_GetPerformanceCounter(); Uint64 freq = SDL_GetPerformanceFrequency(); float delta = (double)(current - last) / (double)freq; accumulator += CLAMP(delta, 0.f, 0.2f); while(accumulator >= TIMESTEP) { accumulator -= TIMESTEP; ((APP_STATE*)top_stack(states_stack))->on_update(TIMESTEP); } ((APP_STATE*)top_stack(states_stack))->on_present(screen.width, screen.height, accumulator / TIMESTEP); video_swap_buffers(); frame_end(); SDL_Delay(1); } return EXIT_SUCCESS; } NEON_API void application_quit(void) { running = 0; }
m1nuz/neon-core
neon/src/core/application.c
C
mit
3,306
21.187919
111
0.603448
false
# Scrapy settings for helloscrapy project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: # # http://doc.scrapy.org/en/latest/topics/settings.html # BOT_NAME = 'helloscrapy' SPIDER_MODULES = ['helloscrapy.spiders'] NEWSPIDER_MODULE = 'helloscrapy.spiders' # Crawl responsibly by identifying yourself (and your website) on the user-agent #USER_AGENT = 'helloscrapy (+http://www.yourdomain.com)' DOWNLOAD_DELAY = 3 ROBOTSTXT_OBEY = True
orangain/helloscrapy
helloscrapy/settings.py
Python
mit
525
28.166667
80
0.75619
false
""" Django settings for djangoApp project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'r&j)3lay4i$rm44n%h)bsv_q(9ysqhl@7@aibjm2b=1)0fag9n' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'djangoApp.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'djangoApp.wsgi.application' # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/'
reggieroby/devpack
frameworks/djangoApp/djangoApp/settings.py
Python
mit
3,105
24.875
91
0.688245
false
--- layout: page title: Pearl Group Dinner date: 2016-05-24 author: Margaret Norris tags: weekly links, java status: published summary: Pellentesque in hendrerit tortor. Quisque sollicitudin urna id. banner: images/banner/leisure-04.jpg booking: startDate: 08/14/2018 endDate: 08/18/2018 ctyhocn: NYCEMHX groupCode: PGD published: true --- Nam fermentum enim a dui venenatis accumsan. Vestibulum nec ultricies nisl, nec viverra quam. Donec et massa eget libero lobortis posuere. Vestibulum lobortis odio sed lorem laoreet suscipit. Duis nibh ligula, viverra vitae pulvinar et, tristique eget dui. Fusce fermentum mi eget vehicula tincidunt. Nulla non commodo nulla. Morbi id tincidunt ex. Ut ornare eget enim a efficitur. In ullamcorper lacus eu faucibus mollis. Proin a sollicitudin elit, ut ultricies risus. Praesent ut ornare nulla. Pellentesque porta augue ex, vitae facilisis elit iaculis vel. Aliquam facilisis egestas urna vitae varius. Mauris metus enim, molestie non facilisis a, varius non nibh. Aliquam tristique odio interdum elit posuere commodo eu nec metus. Fusce maximus luctus tortor a congue. Nunc volutpat tempor lacus, dignissim rhoncus risus vehicula in. Cras viverra rutrum convallis. Aliquam quis neque vel lectus ultrices tempor quis vitae ligula. In nec suscipit lacus. Quisque iaculis pulvinar cursus. * Donec fringilla magna a neque bibendum efficitur * Vestibulum porttitor nulla eget turpis malesuada porttitor * Curabitur ac risus at orci vestibulum feugiat et laoreet nulla. Quisque nec cursus nisl, vel sodales turpis. Maecenas vel tristique erat, in sollicitudin turpis. Ut suscipit ipsum ac lectus posuere scelerisque. Integer risus diam, ultrices ac elit sed, luctus tempus magna. Nam et maximus est. Etiam vulputate, dolor et luctus accumsan, nunc nulla pulvinar mauris, ut convallis orci est nec libero. Praesent egestas ac sem laoreet vulputate. Vivamus eleifend ante a neque viverra fermentum. Proin pharetra mollis faucibus. Nunc non volutpat arcu. Etiam luctus neque lectus, a vulputate magna interdum non. Nam ac hendrerit sem. Pellentesque elementum in mauris vulputate tincidunt.
KlishGroup/prose-pogs
pogs/N/NYCEMHX/PGD/index.md
Markdown
mit
2,134
87.916667
617
0.810684
false
--- layout: page title: Warren Guardian Company Conference date: 2016-05-24 author: Emily Harmon tags: weekly links, java status: published summary: Pellentesque porttitor arcu velit, in facilisis tellus volutpat non. Nulla. banner: images/banner/leisure-02.jpg booking: startDate: 12/20/2018 endDate: 12/23/2018 ctyhocn: NBFELHX groupCode: WGCC published: true --- Maecenas ultrices enim id sapien semper, non auctor sapien varius. Nulla a commodo sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Cras laoreet, dolor consectetur convallis aliquet, ipsum risus feugiat justo, vitae laoreet tellus diam at quam. Quisque ut lectus in sapien consectetur posuere. Sed rutrum ultricies odio, non porttitor lectus cursus quis. Etiam auctor ullamcorper dolor, non semper sapien feugiat ac. * Ut nec nulla molestie, pretium erat vitae, feugiat turpis * Mauris vitae enim ut magna malesuada lobortis * Sed id felis vestibulum, elementum turpis id, luctus mauris * Sed eu augue at mi congue viverra * Integer elementum lectus quis scelerisque mollis. Morbi ullamcorper diam nec urna sodales egestas. Nam commodo tellus ut convallis feugiat. Fusce aliquam nisl ut libero pharetra, a convallis felis dapibus. Sed ut mi fermentum, laoreet nulla quis, sollicitudin orci. Praesent id tempus quam. Maecenas elementum varius iaculis. Suspendisse in leo sit amet tellus finibus luctus sit amet sed ipsum. Quisque faucibus, ante non consectetur porttitor, mauris velit volutpat massa, quis hendrerit odio dolor eu massa. Nam mattis malesuada egestas. Sed auctor lobortis orci vel iaculis. Aenean non ligula ultricies, cursus purus in, pharetra quam. Maecenas egestas efficitur nisi, nec iaculis erat rutrum efficitur. Aenean in congue neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec nec purus quis lectus facilisis malesuada. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
KlishGroup/prose-pogs
pogs/N/NBFELHX/WGCC/index.md
Markdown
mit
1,951
77.04
881
0.808816
false
namespace Engine.Contracts { public interface IAct { /// <summary> /// Makes an act (or try) and returns how much time it takes /// </summary> /// <param name="scene">Scene on which act plays</param> /// <returns>Time passed</returns> ActResult Do(IScene scene); string Name { get; set; } bool CanDo(IActor actor, IScene scene); } public class ActResult { public int TimePassed; public string Message; } }
sheix/GameEngine
Engine/Contracts/IAct.cs
C#
mit
482
21.952381
65
0.60166
false
--- uid: SolidEdgeFramework.Properties.Name summary: remarks: All objects have names that are unique within the scope of their parent. ---
SolidEdgeCommunity/docs
docfx_project/apidoc/SolidEdgeFramework.Properties.Name.md
Markdown
mit
143
27.2
81
0.765957
false
#pragma once #include <QtCore/QPointer> #include <QtWidgets/QTabWidget> #include "backend/backend_requests_interface.h" class BreakpointModel; class PDIBackendRequests; class DisassemblyView; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// class CodeViews : public QTabWidget { public: CodeViews(BreakpointModel* breakpoints, QWidget* parent = 0); virtual ~CodeViews(); void set_breakpoint_model(BreakpointModel* breakpoints); void reload_current_file(); void toggle_breakpoint(); void set_backend_interface(PDIBackendRequests* iface); Q_SLOT void open_file(const QString& filename, bool setActive); Q_SLOT void program_counter_changed(const PDIBackendRequests::ProgramCounterChange& pc); Q_SLOT void session_ended(); private: Q_SLOT void closeTab(int index); enum Mode { SourceView, Disassembly, }; void read_settings(); void write_settings(); Mode m_mode = SourceView; int m_oldIndex = 0; // DisassemblyView* m_disassemblyView = nullptr; BreakpointModel* m_breakpoints = nullptr; QPointer<PDIBackendRequests> m_interface; QVector<QString> m_files; bool m_was_in_source_view = true; }; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// inline void CodeViews::set_breakpoint_model(BreakpointModel* breakpoints) { m_breakpoints = breakpoints; }
emoon/ProDBG
src/prodbg/ui/code_views.h
C
mit
1,505
26.87037
119
0.601329
false
--- layout: post title: "8퍼센트 플랫폼개발 인턴 후기-마지막" author: selee description: 그동안 감사했습니다! --- <p align="center"> <img src="/images/internship-4-인터뷰.jpg" alt="인턴 동기랑" width="500"> </p> ## <span style="color:#6741d9">이벤트 케러셀</span> 남은 기간에는 저번 인턴기에 쓴 이벤트 케러셀/배너 스태프 페이지 만들기 작업을 이어서 계속했다. 관리자 페이지에서 케러셀과 배너를 저장하면 관련 정보를 DB에 저장하는 API와 DB에 저장된 정보를 바탕으로 홈페이지에 케러셀과 배너를 자동으로 띄우는 API를 만들었다. 100% 완성한 게 아니라서 인수인계를 하고 가야 한다는 점이 좀 아쉽다. <p align="center"> <img src="/images/internship-4-캐러셀.png" alt="케러셀" width="300"> <img src="/images/internship-4-배너.png" alt="배너" width="300"> </p> ## <span style="color:#6741d9">9주가 호로록</span> 처음 인턴기 쓰던 순간이 생각난다. 그때는 2주도 이렇게 안 지나가는데 9주는 어떻게 버티지? 라는 생각을 했다. **근데 놀랍게도 9주가 호로로록 하고 지나가 버렸다 .** 그만큼 에잇퍼센트에서 보낸 인턴 기간이 즐거웠다는 것이고 앞으로도 이 경험은 오랫동안 기억에 남을 거 같다. ### 에잇퍼센트에게 받은 <span style="color:#6741d9">가장 큰 선물</span> 인턴으로 오기 전, 학교 시험과 과제로 개발에 신물이 났었다. 그래서 개발 공부를 거의 하지 않았고 그랬기에 초반에 업무를 하면서 꽤 고생했다. 그래도 계속 질문하고 공부하면서 일을 한, 두 개 끝내니 할만하다고 생각했다. 특히, 알림톡을 대량 발송할 수 있는 관리자 페이지를 직접 만들고 바로 마케팅팀분들이 바로 쓰시는 걸 봤을 때는 엄청 뿌듯했다. 내가 개발한 기능이 다른 누군가에게 엄청 도움이 된다는 걸 알 때마다 개발에 대한 재미를 조금씩 되찾았다. 어느새 어떻게 하면 내가 맡은 기능을 구현할 수 있을까를 고민하고 있었고 어느새 출퇴근 길 모르는 부분을 검색하고 공부하고 있었다. 인턴 기간 동안 Django, Vue, 개발 프로세스 등 많은 것을 배웠다. 하지만 무엇보다도 에잇퍼센트에서 가장 크게 얻어가는 것은 개발에 대한 흥미이다. 인턴 끝나고 어떤 내용을 공부하고 어떤 걸 만들어볼지 고민하는 나 자신이 너무 신기하다. <p align="center"> <img src="/images/internship-4-칭찬.jpg" alt="익명의 칭찬" width="500"> </p> ### <span style="color:#6741d9">님과 함께</span> 처음에 사회생활 신생아로서 눈치를 많이 볼 때 빠르게 적응할 수 있었던 가장 큰 이유는 정말 좋은 에잇퍼센트 사람들 덕분이었다. **특히, 온종일 같이 있는 플랫폼개발 팀원분들 만세** 다들 업무로 바쁘실 텐데 물어볼 때마다 친절하게 알려주시고 코드 리뷰도 정성껏 해주시고 먼저 와서 알려주시고 말 걸어주셔서 금방 적응할 수 있었다. 점심시간이나 업무 중간에 나누는 잡담 타임도 너무 재밌었다. 그래서 사실 많은 분이 재택 해서 사무실이 좀 비면 심심했다. 그 정도로 정이 많이 든 거 같다. <p align="center"> <img src="/images/internship-4-호성님과.jpg" alt="호성님과 마지막" width="500"> </p> <br> ## <span style="color:#6741d9">마지막 에피소드</span> ### 첫 재택근무 인턴 첫 2주를 제외하고 재택근무를 할 수 있었으나, 더 많이 배우고 팀원분들이랑 친해지고 싶어서 항상 사무실로 출근했다. 하지만 한 번도 재택근무 안 하고 가면 아쉬울 거 같아서 처음으로 재택근무를 했다. 잠을 두 시간 더 잘 수 있고, 퇴근하면 바로 집이라는 점은 생각보다 더 많이 행복했다. ### 당 충전하세요 <p align="center"> <img src="/images/internship-4-사탕.png" alt="사탕" width="500"> </p> 같은 인턴 동기인 미연님의 제안으로 밥도 많이 사주시고 잘 챙겨주신 에잇퍼센트 사람들에게 작은 선물을 드리기로 했다. 밸런타인데이를 기념으로 초콜릿이랑 사탕을 준비해서 사무실 테이블에 두었다. 올리자마자 나랑 미연님 사진 이모티콘이 달리는 게 재밌었다. <br> **<span style="color:#6741d9">마지막 인턴기 끝!</span>** 그동안 감사했습니다.
8percent/8percent.github.io
_posts/2021-02-19-internship-review4.md
Markdown
mit
4,596
35.630769
205
0.67563
false
.sample2 .sea { height: 300px; width: 480px; position: relative; background-image: url(media/fishing.png), url(media/mermaid.png), url(media/sea.png); background-position: top right 10px, bottom left, top left; background-repeat: no-repeat, repeat-x, repeat-x; } .sample2 .fish { background: url(media/fish.png) no-repeat; height: 70px; width: 100px; left: 30px; top: 90px; position: absolute; }
zenzontle/VillonderCoNf
MultipleBackgrounds/multiple.css
CSS
mit
408
23.058824
86
0.715686
false
/** * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval * @author James Allardice */ "use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); const { getStaticValue } = require("eslint-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { type: "suggestion", docs: { description: "disallow the use of `eval()`-like methods", category: "Best Practices", recommended: false, url: "https://eslint.org/docs/rules/no-implied-eval" }, schema: [], messages: { impliedEval: "Implied eval. Consider passing a function instead of a string." } }, create(context) { const EVAL_LIKE_FUNCS = Object.freeze(["setTimeout", "execScript", "setInterval"]); const GLOBAL_CANDIDATES = Object.freeze(["global", "window", "globalThis"]); /** * Checks whether a node is evaluated as a string or not. * @param {ASTNode} node A node to check. * @returns {boolean} True if the node is evaluated as a string. */ function isEvaluatedString(node) { if ( (node.type === "Literal" && typeof node.value === "string") || node.type === "TemplateLiteral" ) { return true; } if (node.type === "BinaryExpression" && node.operator === "+") { return isEvaluatedString(node.left) || isEvaluatedString(node.right); } return false; } /** * Checks whether a node is an Identifier node named one of the specified names. * @param {ASTNode} node A node to check. * @param {string[]} specifiers Array of specified name. * @returns {boolean} True if the node is a Identifier node which has specified name. */ function isSpecifiedIdentifier(node, specifiers) { return node.type === "Identifier" && specifiers.includes(node.name); } /** * Checks a given node is a MemberExpression node which has the specified name's * property. * @param {ASTNode} node A node to check. * @param {string[]} specifiers Array of specified name. * @returns {boolean} `true` if the node is a MemberExpression node which has * the specified name's property */ function isSpecifiedMember(node, specifiers) { return node.type === "MemberExpression" && specifiers.includes(astUtils.getStaticPropertyName(node)); } /** * Reports if the `CallExpression` node has evaluated argument. * @param {ASTNode} node A CallExpression to check. * @returns {void} */ function reportImpliedEvalCallExpression(node) { const [firstArgument] = node.arguments; if (firstArgument) { const staticValue = getStaticValue(firstArgument, context.getScope()); const isStaticString = staticValue && typeof staticValue.value === "string"; const isString = isStaticString || isEvaluatedString(firstArgument); if (isString) { context.report({ node, messageId: "impliedEval" }); } } } /** * Reports calls of `implied eval` via the global references. * @param {Variable} globalVar A global variable to check. * @returns {void} */ function reportImpliedEvalViaGlobal(globalVar) { const { references, name } = globalVar; references.forEach(ref => { const identifier = ref.identifier; let node = identifier.parent; while (isSpecifiedMember(node, [name])) { node = node.parent; } if (isSpecifiedMember(node, EVAL_LIKE_FUNCS)) { const parent = node.parent; if (parent.type === "CallExpression" && parent.callee === node) { reportImpliedEvalCallExpression(parent); } } }); } //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- return { CallExpression(node) { if (isSpecifiedIdentifier(node.callee, EVAL_LIKE_FUNCS)) { reportImpliedEvalCallExpression(node); } }, "Program:exit"() { const globalScope = context.getScope(); GLOBAL_CANDIDATES .map(candidate => astUtils.getVariableByName(globalScope, candidate)) .filter(globalVar => !!globalVar && globalVar.defs.length === 0) .forEach(reportImpliedEvalViaGlobal); } }; } };
pvamshi/eslint
lib/rules/no-implied-eval.js
JavaScript
mit
5,435
34.756579
113
0.485925
false
// // BPPopToast.h // BPKITsDemo // // Created by mikeooye on 15-3-28. // Copyright (c) 2015年 ihojin. All rights reserved. // #import <UIKit/UIKit.h> @interface BPPopToast : UIView @property (copy, nonatomic) NSString *text; - (void)popToastAtRect:(CGRect)rect inView:(UIView *)view; @end @interface NSString (BPPopToast) - (void)popToastAtRect:(CGRect)rect inView:(UIView *)view; @end
mikeooye/BPKITs
Views/BPPopToast.h
C
mit
397
17.857143
58
0.706329
false
/* --------------------------------------------------------------------------- Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- Copyright (c) 2006-2010, ASSIMP Development Team All rights reserved. Redistribution and use of this software 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 ASSIMP team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of the ASSIMP Development Team. 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 OWNER 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. --------------------------------------------------------------------------- */ #include "stdafx.h" #include "assimp_view.h" #include "RichEdit.h" namespace AssimpView { /* extern */ CLogWindow CLogWindow::s_cInstance; extern HKEY g_hRegistry; // header for the RTF log file static const char* AI_VIEW_RTF_LOG_HEADER = "{\\rtf1" "\\ansi" "\\deff0" "{" "\\fonttbl{\\f0 Courier New;}" "}" "{\\colortbl;" "\\red255\\green0\\blue0;" // red for errors "\\red255\\green120\\blue0;" // orange for warnings "\\red0\\green150\\blue0;" // green for infos "\\red0\\green0\\blue180;" // blue for debug messages "\\red0\\green0\\blue0;" // black for everything else "}}"; //------------------------------------------------------------------------------- // Message procedure for the log window //------------------------------------------------------------------------------- INT_PTR CALLBACK LogDialogProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam) { lParam; switch (uMsg) { case WM_INITDIALOG: { return TRUE; } case WM_SIZE: { int x = LOWORD(lParam); int y = HIWORD(lParam); SetWindowPos(GetDlgItem(hwndDlg,IDC_EDIT1),NULL,0,0, x-10,y-12,SWP_NOMOVE|SWP_NOZORDER); return TRUE; } case WM_CLOSE: EndDialog(hwndDlg,0); CLogWindow::Instance().bIsVisible = false; return TRUE; }; return FALSE; } //------------------------------------------------------------------------------- void CLogWindow::Init () { this->hwnd = ::CreateDialog(g_hInstance,MAKEINTRESOURCE(IDD_LOGVIEW), NULL,&LogDialogProc); if (!this->hwnd) { CLogDisplay::Instance().AddEntry("[ERROR] Unable to create logger window", D3DCOLOR_ARGB(0xFF,0,0xFF,0)); } // setup the log text this->szText = AI_VIEW_RTF_LOG_HEADER;; this->szPlainText = ""; } //------------------------------------------------------------------------------- void CLogWindow::Show() { if (this->hwnd) { ShowWindow(this->hwnd,SW_SHOW); this->bIsVisible = true; // contents aren't updated while the logger isn't displayed this->Update(); } } //------------------------------------------------------------------------------- void CMyLogStream::write(const char* message) { CLogWindow::Instance().WriteLine(message); } //------------------------------------------------------------------------------- void CLogWindow::Clear() { this->szText = AI_VIEW_RTF_LOG_HEADER;; this->szPlainText = ""; this->Update(); } //------------------------------------------------------------------------------- void CLogWindow::Update() { if (this->bIsVisible) { SETTEXTEX sInfo; sInfo.flags = ST_DEFAULT; sInfo.codepage = CP_ACP; SendDlgItemMessage(this->hwnd,IDC_EDIT1, EM_SETTEXTEX,(WPARAM)&sInfo,( LPARAM)this->szText.c_str()); } } //------------------------------------------------------------------------------- void CLogWindow::Save() { char szFileName[MAX_PATH]; DWORD dwTemp = MAX_PATH; if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LogDestination",NULL,NULL, (BYTE*)szFileName,&dwTemp)) { // Key was not found. Use C: strcpy(szFileName,""); } else { // need to remove the file name char* sz = strrchr(szFileName,'\\'); if (!sz)sz = strrchr(szFileName,'/'); if (!sz)*sz = 0; } OPENFILENAME sFilename1 = { sizeof(OPENFILENAME), g_hDlg,GetModuleHandle(NULL), "Log files\0*.txt", NULL, 0, 1, szFileName, MAX_PATH, NULL, 0, NULL, "Save log to file", OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_NOCHANGEDIR, 0, 1, ".txt", 0, NULL, NULL }; if(GetSaveFileName(&sFilename1) == 0) return; // Now store the file in the registry RegSetValueExA(g_hRegistry,"LogDestination",0,REG_SZ,(const BYTE*)szFileName,MAX_PATH); FILE* pFile = fopen(szFileName,"wt"); fprintf(pFile,this->szPlainText.c_str()); fclose(pFile); CLogDisplay::Instance().AddEntry("[INFO] The log file has been saved", D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0)); } //------------------------------------------------------------------------------- void CLogWindow::WriteLine(const char* message) { this->szPlainText.append(message); this->szPlainText.append("\r\n"); if (0 != this->szText.length()) { this->szText.resize(this->szText.length()-1); } switch (message[0]) { case 'e': case 'E': this->szText.append("{\\pard \\cf1 \\b \\fs18 "); break; case 'w': case 'W': this->szText.append("{\\pard \\cf2 \\b \\fs18 "); break; case 'i': case 'I': this->szText.append("{\\pard \\cf3 \\b \\fs18 "); break; case 'd': case 'D': this->szText.append("{\\pard \\cf4 \\b \\fs18 "); break; default: this->szText.append("{\\pard \\cf5 \\b \\fs18 "); break; } std::string _message = message; for (unsigned int i = 0; i < _message.length();++i) { if ('\\' == _message[i] || '}' == _message[i] || '{' == _message[i]) { _message.insert(i++,"\\"); } } this->szText.append(_message); this->szText.append("\\par}}"); if (this->bIsVisible && this->bUpdate) { SETTEXTEX sInfo; sInfo.flags = ST_DEFAULT; sInfo.codepage = CP_ACP; SendDlgItemMessage(this->hwnd,IDC_EDIT1, EM_SETTEXTEX,(WPARAM)&sInfo,( LPARAM)this->szText.c_str()); } return; } }; //! AssimpView
mtwilliams/mojo
dependencies/assimp-2.0.863/tools/assimp_view/LogWindow.cpp
C++
mit
6,958
26.290196
88
0.585657
false
module Tasklist end
chaimedes/HanamiTaskList
lib/tasklist.rb
Ruby
mit
20
9
15
0.85
false
--- title: "Exploring UIAlertController" date: 2014-09-07 00:00 link_to: swift --- This morning, I was working on the [sample app](https://github.com/AshFurrow/Moya/issues/39) for [Moya](https://github.com/AshFurrow/Moya), a network abstraction framework that I’ve built on top of [Alamofire](https://github.com/Alamofire/Alamofire). I needed a way to grab some user text input, so I turned to `UIAlertView`. Turns out that that’s deprecated in favour of `UIAlertController`. Hmm. <!-- more --> Looking around the internet, there weren’t very many examples of how to use this cool new class, and the [documentation](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIAlertController_class/) was sparse at best. Let’s take a look at the high-level API and then get into some of the nitty-gritty. (I’m going to write this in Swift because I am not a [dinosaur](http://t.co/Q2hvacChLu).) `UIAlertController` is a `UIViewController` subclass. This contrasts with `UIAlertView`, a `UIView` subclass. View controllers are (or at least, should be) the main unit of composition when writing iOS applications. It makes a lot of sense that Apple would replace alert views with alert view _controllers_. That’s cool. Creating an alert view controller is pretty simple. Just use the initializer to create one and then present it to the user as you would present any other view controller. ```swift let alertController = UIAlertController(title: "Title", message: "Message", preferredStyle: .Alert) presentViewController(alertController, animated: true, completion: nil) ``` Pretty straightforward. I’m using the `.Alert` preferred style, but you can use the `.ActionSheet` instead. I’m using this as a replacement for `UIAlertView`, so I’ll just discuss the alert style. If you ran this code, you’d be presented with something like the following (on beta 7). ![](/img/import/blog/uialertviewcontroller-example/C47E5C761A24426CB34230DBB2A7AF7C.png) Weird. The title is there, but the message is not present. There are also no buttons, so you can’t dismiss the controller. It’s there until you relaunch your app. Sucky. Turns out if you want buttons, you’ve got to explicitly add them to the controller before presenting it. ```swift let ok = UIAlertAction(title: "OK", style: .Default, handler: { (action) -> Void in }) let cancel = UIAlertAction(title: "Cancel", style: .Cancel) { (action) -> Void in } alertController.addAction(ok) alertController.addAction(cancel) ``` This is _worlds_ better than `UIAlertView`, despite being much more verbose. First of all, you can have multiple cancel or destructive buttons. You also specify individual closures to be executed when a button is pressed instead of some shitty delegate callback telling you which button _index_ was pressed. (If anyone out there makes a `UIAlertController+Blocks` category, I will find you, and I _will_ kill you.) ![](/img/import/blog/uialertviewcontroller-example/2A03E60C605A42789A6FAF704BB9A130.jpg) If we added the above configuration to our code, we’d get the following. ![](/img/import/blog/uialertviewcontroller-example/08BE65FFF6E243CAAD311D4115EC75B6.png) Way better. Weird that the message is now showing up. Maybe it’s a bug, or maybe it’s intended behaviour. Apple, you so cray cray. Anyway, you should also notice that the “OK” and “Cancel” buttons have been styled and positioned according to iOS conventions. Neato. What _I_ needed, however, was user input. This was possible with `UIAlertView`, so it should be possible with `UIAlertController`, right? Well, kinda. There’s an encouraging instance method named `addTextFieldWithConfigurationHandler()`, but using it is not so straightforward. Let me show you what I mean. ```swift alertController.addTextFieldWithConfigurationHandler { (textField) -> Void in // Here you can configure the text field (eg: make it secure, add a placeholder, etc) } ``` Straightforward. Run the code, get the following. ![](/img/import/blog/uialertviewcontroller-example/9EA0E4E86AB54891A9A27BC24D1C8889.png) The question now is this: how do you, in the closure for the “OK” button, access the contents of the text field? ![](/img/import/blog/uialertviewcontroller-example/0E7A01300D2F49C6947664D55AC91803.gif) There is no way for you to directly access the text field from the closure invoked when a button is pressed. [This](http://stackoverflow.com/questions/24172593/access-input-from-uialertcontroller) StackOverflow question has two possible answers. You can access the `textFields` array on the controller (assuming that the order of that array is the same as the order which you added the text fields), but this causes a reference cycle (the alert action has a strong reference to the alert view controller, which has a strong reference to the alert action). This _does_ cause a memory leak for each controller that you present. ![](/img/import/blog/uialertviewcontroller-example/31715566B57649FF8B277A3063191734.png) The other answer suggests storing the text field that’s passed into the configuration closure in a property on the presenting controller, which can later be accessed. That’s a _very_ Objective-C way of solving this problem. So what do we do? Well, I’ve been writing Swift lately, and whenever I come across a problem like this, I think “if I had [five years of Swift experience](http://instagram.com/p/rWyQdUDBhH), what would _I_ do?” My answer was the following. Let’s create a local variable, a `UITextField?` optional. In the configuration closure for the text field, assign the local variable to the text field that we’re passed in. Then we can access that local variable in our alert action closure. Sweet. The full implementation looks like this. ```swift var inputTextField: UITextField? let alertController = UIAlertController(title: "Title", message: "Message", preferredStyle: .Alert) let ok = UIAlertAction(title: "OK", style: .Default, handler: { (action) -> Void in // Do whatever you want with inputTextField?.text println("\(inputTextField?.text)") }) let cancel = UIAlertAction(title: "Cancel", style: .Cancel) { (action) -> Void in } alertController.addAction(ok) alertController.addAction(cancel) alertController.addTextFieldWithConfigurationHandler { (textField) -> Void in inputTextField = textField } presentViewController(alertController, animated: true, completion: nil) ``` I like this a lot. It avoids polluting our object with unnecessary properties, avoids memory leaks, and seems pretty “Swift”. I’ve created a [GitHub repo](https://github.com/AshFurrow/UIAlertController-Example) that I’ll keep up to date with future betas, etc. ![](/img/import/blog/uialertviewcontroller-example/09B8BCEA8BBE48239C07298CD4112B53.jpg) So yeah. The new `UIAlertController` has some great benefits: - It’s explicit - It conforms to iOS composability conventions - It’s got a clear API - It’s reusable in different contexts (iWatch vs iWatch mini) The drawbacks are: - It’s unfamiliar As we march forward into this brave new world of Swift, we need to reevaluate our approaches to familiar problems. Just because a solution that worked well in Objective-C might work OK in Swift doesn’t make it a solution _well_ suited for use in Swift. As developers, we should keep an open mind about new ideas and experiment. The way I look at it is like this: right now, the community is pretty new at Swift. We’re racing in all different directions because [no one](http://robnapier.net/i-dont-know-swift) really knows what the best practices are, yet. We need this expansion in all directions, even if a lot of those directions are going to turn out to be bad ideas. If we don’t throw it all against the wall, we won’t figure out what sticks. So next time you try and do something and get confused because Swift is unfamiliar, try all kinds of things. Could be you end up creating a brand new convention that’s adopted by the whole iOS community for years to come.
yogoo/ashfurrow-blog
source/blog/2014-09-07-uialertviewcontroller-example.markdown
Markdown
mit
8,061
95.084337
747
0.778433
false
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /** * Library to generate items for Sortable.js */ class Sortable { protected $CI; protected $mItems; protected $mPostName = 'sortable_ids'; public function __construct() { $this->CI =& get_instance(); $this->CI->load->library('parser'); $this->CI->load->library('system_message'); } // Get items to be sorted public function init($model, $order_field = 'pos') { $this->CI->load->model($model, 'm'); $ids = $this->CI->input->post($this->mPostName); // save to database if ( !empty($ids) ) { for ($i=0; $i<count($ids); $i++) { $updated = $this->CI->m->update($ids[$i], array($order_field => $i+1)); } // refresh page (interrupt other logic) $this->CI->system_message->set_success('Successfully updated sort order.'); refresh(); } // return all records in sorted order $this->CI->db->order_by($order_field, 'ASC'); $items = $this->CI->m->get_all(); $this->mItems = $items; return $this; } // Render template public function render($label_template = '{title}', $back_url = NULL) { if ( empty($this->mItems) ) { return '<p>No records are found.</p>'; } else { $html = box_open('Sort Order', 'primary'); // Render form with alert message $html.= '<form action="'.current_url().'" method="POST">'; $html.= $this->CI->system_message->render(); $html.= '<p>Drag and drop below items to sort them in ascending order:</p>'; // Generate item list by CodeIgniter Template Parser $template = '<ul class="sortable list-group"> {items} <li class="list-group-item"> <strong>'.$label_template.'</strong> <input type="hidden" name="'.$this->mPostName.'[]" value="{id}" /> </li> {/items} </ul>'; $data = array('items' => $this->mItems); $html.= $this->CI->parser->parse_string($template, $data, TRUE); if ($back_url!=NULL) $html.= btn('Back', $back_url, 'reply', 'bg-purple').' '; $html.= btn_submit('Save'); $html.= '</form>'; $html.= box_close(); return $html; } } }
jiji262/codeigniter_boilerplate
application/modules/admin/libraries/Sortable.php
PHP
mit
2,088
23.869048
79
0.591954
false
import NodeFunction from '../core/NodeFunction.js'; import NodeFunctionInput from '../core/NodeFunctionInput.js'; const declarationRegexp = /^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i; const propertiesRegexp = /[a-z_0-9]+/ig; const pragmaMain = '#pragma main'; const parse = ( source ) => { const pragmaMainIndex = source.indexOf( pragmaMain ); const mainCode = pragmaMainIndex !== - 1 ? source.substr( pragmaMainIndex + pragmaMain.length ) : source; const declaration = mainCode.match( declarationRegexp ); if ( declaration !== null && declaration.length === 5 ) { // tokenizer const inputsCode = declaration[ 4 ]; const propsMatches = []; let nameMatch = null; while ( ( nameMatch = propertiesRegexp.exec( inputsCode ) ) !== null ) { propsMatches.push( nameMatch ); } // parser const inputs = []; let i = 0; while ( i < propsMatches.length ) { const isConst = propsMatches[ i ][ 0 ] === 'const'; if ( isConst === true ) { i ++; } let qualifier = propsMatches[ i ][ 0 ]; if ( qualifier === 'in' || qualifier === 'out' || qualifier === 'inout' ) { i ++; } else { qualifier = ''; } const type = propsMatches[ i ++ ][ 0 ]; let count = Number.parseInt( propsMatches[ i ][ 0 ] ); if ( Number.isNaN( count ) === false ) i ++; else count = null; const name = propsMatches[ i ++ ][ 0 ]; inputs.push( new NodeFunctionInput( type, name, count, qualifier, isConst ) ); } // const blockCode = mainCode.substring( declaration[ 0 ].length ); const name = declaration[ 3 ] !== undefined ? declaration[ 3 ] : ''; const type = declaration[ 2 ]; const presicion = declaration[ 1 ] !== undefined ? declaration[ 1 ] : ''; const headerCode = pragmaMainIndex !== - 1 ? source.substr( 0, pragmaMainIndex ) : ''; return { type, inputs, name, presicion, inputsCode, blockCode, headerCode }; } else { throw new Error( 'FunctionNode: Function is not a GLSL code.' ); } }; class GLSLNodeFunction extends NodeFunction { constructor( source ) { const { type, inputs, name, presicion, inputsCode, blockCode, headerCode } = parse( source ); super( type, inputs, name, presicion ); this.inputsCode = inputsCode; this.blockCode = blockCode; this.headerCode = headerCode; } getCode( name = this.name ) { const headerCode = this.headerCode; const presicion = this.presicion; let declarationCode = `${ this.type } ${ name } ( ${ this.inputsCode.trim() } )`; if ( presicion !== '' ) { declarationCode = `${ presicion } ${ declarationCode }`; } return headerCode + declarationCode + this.blockCode; } } export default GLSLNodeFunction;
jpweeks/three.js
examples/jsm/renderers/nodes/parsers/GLSLNodeFunction.js
JavaScript
mit
2,740
19.296296
106
0.620073
false
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var core_1 = require('@angular/core'); var router_1 = require('@angular/router'); var app_service_1 = require("./app-service"); var AppComponent = (function () { function AppComponent(breadCrumbSvc, _router) { this.breadCrumbSvc = breadCrumbSvc; this._router = _router; this.breadCrumbSvc.setBreadCrumb('Project Dashboard'); } AppComponent.prototype.navigateHome = function () { this._router.navigate(['home']); ; }; AppComponent = __decorate([ core_1.Component({ selector: 'ts-app', templateUrl: '/app/app-component.html' }), __metadata('design:paramtypes', [app_service_1.BreadcrumbService, router_1.Router]) ], AppComponent); return AppComponent; }()); exports.AppComponent = AppComponent;
mail2yugi/ProjectTodoList
src/app/app.component.js
JavaScript
mit
1,606
46.666667
150
0.604608
false
using Feria_Desktop.View.Usuario; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Feria_Desktop.View.Mantenedor { /// <summary> /// Lógica de interacción para Bodega.xaml /// </summary> public partial class Bodega : Page { private vEditarBodega modEditarBodega; public Bodega() { InitializeComponent(); } private void btnNuevo_Click(object sender, RoutedEventArgs e) { modEditarBodega = new vEditarBodega(); modEditarBodega.ShowDialog(); } } }
lagrantorre/PortafolioTItulo
Feria Desktop/Feria Desktop/View/Mantenedor/Bodega.xaml.cs
C#
mit
912
23.540541
69
0.69163
false
/** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function arrayCopy(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++i < length) { array[i] = source[i]; } return array; } module.exports = arrayCopy;
gdgzdar/2048
node_modules/karma/node_modules/lodash/internal/arrayCopy.js
JavaScript
mit
442
21.1
57
0.615385
false
// // SNPGetStreamOperation.h // Snapper // // Created by Paul Schifferer on 12/23/12. // Copyright (c) 2012 Pilgrimage Software. All rights reserved. // #import "SNPBaseAppTokenOperation.h" @interface SNPGetStreamOperation : SNPBaseAppTokenOperation // -- Properties -- @property (nonatomic, assign) NSInteger streamId; // -- Initializers -- - (nonnull instancetype)initWithStreamId:(NSUInteger)streamId appToken:(nonnull NSString*)appToken finishBlock:(nonnull void (^)(SNPResponse* _Nonnull response))finishBlock; @end
exsortis/Snapper
Snapper/Source/Shared/SNPGetStreamOperation.h
C
mit
593
25.954545
103
0.677909
false
package de.uni.bremen.stummk.psp.calculation; import java.lang.reflect.InvocationTargetException; import java.util.List; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; import de.uni.bremen.stummk.psp.control.BarChart; import de.uni.bremen.stummk.psp.control.LineChart; import de.uni.bremen.stummk.psp.control.PieChart; import de.uni.bremen.stummk.psp.data.PSPProject; import de.uni.bremen.stummk.psp.data.ScheduleEntry; import de.uni.bremen.stummk.psp.utility.CheckOperation; import de.uni.bremen.stummk.psp.utility.Constants; import de.uni.bremen.stummk.psp.utility.DataIO; import de.uni.bremen.stummk.psp.utility.FileHash; /** * Class represents an action of the toolbar in the editor * * @author Konstantin * */ public class EditorToolbarAction extends Action implements IWorkbenchAction { private EditorToolbarController etc; /** * Constructor * * @param id the Id of the Action * @param editorToolbarController the {@link EditorToolbarController} of the * {@link EditorToolbarAction} */ public EditorToolbarAction(String id, EditorToolbarController editorToolbarController) { setId(id); this.etc = editorToolbarController; } @Override public void run() { handleAction(getId()); } private void handleAction(String id) { // execute action depending on id switch (id) { case Constants.COMMAND_SYNC: exportData(); break; case Constants.COMMAND_PLAN_ACTUAL_DIAGRAM: new BarChart(etc.getProjectPlanSummary(), "Plan vs. Actual Values - " + etc.getProjectPlanSummary().getProject().getProjectName()); break; case Constants.COMMAND_TIME_IN_PHASE_PERCENTAGE: new PieChart(etc.getProjectPlanSummary(), Constants.KEY_TIME_IN_PHASE_IDX, "Distribution of time in phase - " + etc.getProjectPlanSummary().getProject().getProjectName()); break; case Constants.COMMAND_DEFECT_INJECTED_PERCENTAGE: new PieChart(etc.getProjectPlanSummary(), Constants.KEY_DEFECTS_INJECTED_IDX, "Distribution of injected defects - " + etc.getProjectPlanSummary().getProject().getProjectName()); break; case Constants.COMMAND_DEFECT_REMOVED_PERCENTAGE: new PieChart(etc.getProjectPlanSummary(), Constants.KEY_DEFECTS_REMOVED_IDX, "Distribution of removed defects - " + etc.getProjectPlanSummary().getProject().getProjectName()); break; case Constants.COMMAND_TIME_TRACKING: List<ScheduleEntry> entries = Manager.getInstance().getSchedulePlanning(etc.getProjectPlanSummary().getProject().getProjectName()); new LineChart("Time Progress in Project - " + etc.getProjectPlanSummary().getProject().getProjectName(), Constants.CHART_TIME, entries); break; case Constants.COMMAND_EARNED_VALUE_TRACKING: List<ScheduleEntry> e = Manager.getInstance().getSchedulePlanning(etc.getProjectPlanSummary().getProject().getProjectName()); new LineChart("Earned Value Tracking in Project - " + etc.getProjectPlanSummary().getProject().getProjectName(), Constants.CHART_VALUE, e); break; } } private void exportData() { // exports data to psp-file and create hash try { Shell activeShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); IRunnableWithProgress op = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { monitor.beginTask("Export data to psp.csv file", 2); PSPProject psp = Manager.getInstance().loadBackupProject(etc.getProjectPlanSummary().getProject().getProjectName()); if (psp != null && psp.getSummary() != null) { DataIO.saveToFile(etc.getProjectPlanSummary().getProject().getProjectName(), psp, null); } monitor.worked(1); if (psp != null && psp.getSummary() != null) { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (IProject project : projects) { if (project.getName().equals(etc.getProjectPlanSummary().getProject().getProjectName())) { IFile file = CheckOperation.getProjectFile(project); String hash = FileHash.hash(file); try { file.setPersistentProperty(Constants.PROPERTY_HASH, hash); } catch (CoreException e) { e.printStackTrace(); } } } } monitor.worked(1); } finally { monitor.done(); } } }; new ProgressMonitorDialog(activeShell).run(true, true, op); } catch (InvocationTargetException | InterruptedException e) { e.printStackTrace(); } } @Override public void dispose() {} }
stummk/psp-eclipse
Source/de.uni.bremen.stummk.psp/src/de/uni/bremen/stummk/psp/calculation/EditorToolbarAction.java
Java
mit
5,479
38.702899
120
0.676036
false
1.0.0 / 2014-12-24 ================== * 0.1.2 - Add X-XSS-Protection header options * 0.1.1 - Request body or query sanitize
ziyasal/node-procexss
HISTORY.md
Markdown
mit
131
17.857143
39
0.557252
false
--- layout: post title: "From interaction-based to state-based testing" description: "Indiscriminate use of Mocks and Stubs can lead to brittle test suites. A more functional design can make state-based testing easier, leading to more robust test suites." date: 2019-02-18 8:19 UTC tags: [Unit Testing, Article Series] --- {% include JB/setup %} <div id="post"> <p> <em>{{ page.description }}</em> </p> <p> The original premise of <a href="http://amzn.to/YPdQDf">Refactoring</a> was that in order to refactor, you must have a trustworthy suite of unit tests, so that you can be confident that you didn't break any functionality. <blockquote> <p>"to refactor, the essential precondition is [...] solid tests"</p> <footer><cite>Martin Fowler, <a href="http://amzn.to/YPdQDf">Refactoring</a></cite></footer> </blockquote> The idea is that you can change how the code is organised, and as long as you don't break any tests, all is good. The experience that most people seem to have, though, is that when they change something in the code, tests break. </p> <p> This is a well-known test smell. In <a href="http://bit.ly/xunitpatterns">xUnit Test Patterns</a> this is called <em>Fragile Test</em>, and it's often caused by <em>Overspecified Software</em>. Even if you follow the proper practice of using <a href="/2013/10/23/mocks-for-commands-stubs-for-queries">Mocks for Commands, Stubs for Queries</a>, you can still end up with a code base where the tests are highly coupled to implementation details of the software. </p> <p> The cause is often that when relying on Mocks and Stubs, test verification hinges on how the System Under Test (SUT) interacts with its dependencies. For that reason, we can call such tests <em>interaction-based tests</em>. For more information, watch my Pluralsight course <a href="{{ site.production_url }}/advanced-unit-testing">Advanced Unit Testing</a>. </p> <h3 id="fb4f2eb1191943c09450c7281a6c8cb0"> Lessons from functional programming <a href="#fb4f2eb1191943c09450c7281a6c8cb0" title="permalink">#</a> </h3> <p> Another way to verify the outcome of a test is to inspect the state of the system after exercising the SUT. We can, quite naturally, call this <em>state-based testing</em>. In object-oriented design, this can lead to other problems. <a href="http://natpryce.com">Nat Pryce</a> has pointed out that <a href="http://natpryce.com/articles/000342.html">state-based testing breaks encapsulation</a>. </p> <p> Interestingly, in his article, Nat Pryce concludes: <blockquote> "I have come to think of object oriented programming as an inversion of functional programming. In a lazy functional language data is pulled through functions that transform the data and combine it into a single result. In an object oriented program, data is pushed out in messages to objects that transform the data and push it out to other objects for further processing." </blockquote> That's an impressively perceptive observation to make in 2004. I wish I was that perspicacious, but I only <a href="{{ site.production_url }}/functional-architecture-with-fsharp">reached a similar conclusion ten years later</a>. </p> <p> Functional programming is based on the fundamental principle of <a href="https://en.wikipedia.org/wiki/Referential_transparency">referential transparency</a>, which, among other things, means that data must be immutable. Thus, no objects change state. Instead, functions can return data that contains immutable state. In unit tests, you can verify that return values are as expected. <a href="/2015/05/07/functional-design-is-intrinsically-testable">Functional design is intrinsically testable</a>; we can consider it a kind of state-based testing, although the states you'd be verifying are immutable return values. </p> <p> In this article series, you'll see three different styles of testing, from interaction-based testing with Mocks and Stubs in C#, over strictly functional state-based testing in <a href="https://www.haskell.org">Haskell</a>, to pragmatic state-based testing in <a href="https://fsharp.org">F#</a>, finally looping back to C# to apply the lessons from functional programming. <ul> <li><a href="/2019/02/25/an-example-of-interaction-based-testing-in-c">An example of interaction-based testing in C#</a></li> <li><a href="/2019/03/11/an-example-of-state-based-testing-in-haskell">An example of state-based testing in Haskell</a></li> <li><a href="/2019/03/25/an-example-of-state-based-testing-in-f">An example of state based-testing in F#</a></li> <li><a href="/2019/04/01/an-example-of-state-based-testing-in-c">An example of state-based testing in C#</a></li> <li><a href="/2019/04/08/a-pure-test-spy">A pure Test Spy</a></li> </ul> The code for all of these articles is <a href="https://github.com/ploeh/UserManagement">available on GitHub</a>. </p> <h3 id="d370a0ae3bc34440b68f8fddab6c1b25"> Summary <a href="#d370a0ae3bc34440b68f8fddab6c1b25" title="permalink">#</a> </h3> <p> Adopting a more functional design, even in a fundamentally object-oriented language like C# can, in my experience, lead to a more sustainable code base. Various maintenance tasks become easier, including unit tests. Functional programming, however, is no panacea. My intent with this article series is only to inspire; to show alternatives to the ways things are normally done. Adopting one of those alternatives could lead to better code, but you must still exercise context-specific judgement. </p> <p> <strong>Next:</strong> <a href="/2019/02/25/an-example-of-interaction-based-testing-in-c">An example of interaction-based testing in C#</a>. </p> </div>
ploeh/ploeh.github.com
_posts/2019-02-18-from-interaction-based-to-state-based-testing.html
HTML
mit
5,696
88.015625
618
0.749298
false
/// This is the sensor class /// /// Sensor is a box2d fixture that is attached to a parent body /// Sensors are used to detect entities in an area. #pragma once #include <AFP/Scene/SceneNode.hpp> #include <AFP/Entity/Entity.hpp> #include <AFP/Entity/Character.hpp> namespace AFP { class Sensor : public SceneNode { public: enum Type { Foot, Surround, Vision, Jump }; /// Constructor /// /// Sensor(Entity* parent, Type type); /// Return sensor category /// /// Returns the sensor category based on the type virtual unsigned int getCategory() const; /// Create foot sensor /// /// Creates a foot sensor on feet void createFootSensor(float sizeX, float sizeY); /// Create vision sensor /// /// Creates a vision sensor for the entity. ///Takes radius in meters and the angle in degrees as parameters void createVisionSensor(float radius, float angle); /// Create surround sensor /// /// Creates a foot sensor on feet void createSurroundSensor(float radius); /// Create foot sensor /// /// Creates a foot sensor on feet void createJumpSensor(float sizeX, float sizeY); /// Begin contact /// /// Begin contact with an entity void beginContact(); /// Begin contact /// /// Begin contact with an character void beginContact(Character& character); /// End contact /// /// End contact with an entity void endContact(); /// End contact /// /// End contact with a character void endContact(Character& character); private: /// Update /// /// Update sensor data. virtual void updateCurrent(sf::Time dt, CommandQueue& commands); private: /// Sensor fixture /// /// Sensors fixture is linked to the body of the parent. b2Fixture* mFixture; /// Parent entity /// /// Entity on which the sensor is attached to Entity* mParent; /// Type /// /// Type of the sensor Type mType; }; }
Pinqvin/afp-game
include/AFP/Entity/Sensor.hpp
C++
mit
2,350
22.737374
72
0.538723
false
# Liplis-iOS デスクトップマスコット LiplisのiOS版です。仮想デスクトップ上でキャラクターがおしゃべりします。 # ライセンス MITライセンス
LipliStyle/Liplis-iOS
README.md
Markdown
mit
188
15.8
52
0.845238
false
package insanityradio.insanityradio; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class PlayPauseReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { try { FragmentNowPlaying.getInstance().playPauseButtonTapped(false); } catch (NullPointerException e) { Intent startActivityIntent = new Intent(context.getApplicationContext(), MainActivity.class); startActivityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(startActivityIntent); } } }
dylanmaryk/InsanityRadio-Android
app/src/main/java/insanityradio/insanityradio/PlayPauseReceiver.java
Java
mit
663
33.894737
105
0.726998
false
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ['HERTZ_SECRET_KEY'] # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.environ['HERTZ_DEBUG'] != 'False' ALLOWED_HOSTS = ['*' if DEBUG else os.environ['HERTZ_HOST']] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'widget_tweaks', 'attendance', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'hertz.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, 'templates'), ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'hertz.wsgi.application' # Database if 'DATABASE_HOST' in os.environ: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': os.environ['POSTGRES_USER'], 'PASSWORD': os.environ['POSTGRES_PASSWORD'], 'HOST': os.environ['DATABASE_HOST'], 'PORT': 5432, } } else: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization LANGUAGE_CODE = 'en-us' TIME_ZONE = 'America/Sao_Paulo' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') # STATICFILES_DIRS = [ # os.path.join(BASE_DIR, 'static'), # ] LOGIN_REDIRECT_URL = '/' LOGIN_URL = '/login'
seccom-ufsc/hertz
hertz/settings.py
Python
mit
3,237
24.093023
91
0.637627
false
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("Robot - Robot")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Robot - Robot")] [assembly: AssemblyCopyright("Copyright © 2014")] [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("960726e6-c6b1-4271-8c7e-94110f97ad98")] // 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")]
phristov/CSharp.DesignPatterns
Builder - Robot/Properties/AssemblyInfo.cs
C#
mit
1,402
37.861111
84
0.741244
false
<?php /* FOSUserBundle:Resetting:request_content.html.twig */ class __TwigTemplate_16fccc8b4081822ba4c49543c44f48b24850d6b4ad9846152c39968be5b4e7c7 extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 2 echo " <form action=\""; // line 3 echo $this->env->getExtension('routing')->getPath("fos_user_resetting_send_email"); echo "\" method=\"POST\" class=\"fos_user_resetting_request\"> <div> "; // line 5 if (array_key_exists("invalid_username", $context)) { // line 6 echo " <p>"; echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("resetting.request.invalid_username", array("%username%" => (isset($context["invalid_username"]) ? $context["invalid_username"] : $this->getContext($context, "invalid_username"))), "FOSUserBundle"), "html", null, true); echo "</p> "; } // line 8 echo " <label for=\"username\">"; echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("resetting.request.username", array(), "FOSUserBundle"), "html", null, true); echo "</label> <input type=\"text\" id=\"username\" name=\"username\" required=\"required\" /> </div> <div> <input type=\"submit\" value=\""; // line 12 echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("resetting.request.submit", array(), "FOSUserBundle"), "html", null, true); echo "\" /> </div> </form> "; } public function getTemplateName() { return "FOSUserBundle:Resetting:request_content.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 43 => 12, 35 => 8, 29 => 6, 27 => 5, 22 => 3, 19 => 2,); } }
thecoons/thecoontube
app/cache/dev/twig/16/fc/cc8b4081822ba4c49543c44f48b24850d6b4ad9846152c39968be5b4e7c7.php
PHP
mit
2,146
32.53125
313
0.568966
false
export default (callback) => { setTimeout(() => { callback(); setTimeout(() => { callback(); }, 3000); }, 3000); }
csxiaoyaojianxian/JavaScriptStudy
13-自动化测试&mock数据/01-jest入门/09-mock-timer.js
JavaScript
mit
158
18.875
30
0.411392
false
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>アルゴリズム計算量入門 〜 ② - イノベーション エンジニアブログ</title> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="320"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="description" content=""> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="アルゴリズム計算量入門 〜 ②"> <meta name="twitter:description" content=""> <meta property="og:type" content="article"> <meta property="og:title" content="アルゴリズム計算量入門 〜 ②"> <meta property="og:description" content=""> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"> <link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon"> <script type="text/javascript"> var _trackingid = 'LFT-10003-1'; (function() { var lft = document.createElement('script'); lft.type = 'text/javascript'; lft.async = true; lft.src = document.location.protocol + '//test.list-finder.jp/js/ja/track_test.js'; var snode = document.getElementsByTagName('script')[0]; snode.parentNode.insertBefore(lft, snode); })(); </script> <script type="text/javascript"> var _trackingid = 'LFT-10003-1'; (function() { var lft = document.createElement('script'); lft.type = 'text/javascript'; lft.async = true; lft.src = document.location.protocol + '//track.list-finder.jp/js/ja/track_prod_wao.js'; var snode = document.getElementsByTagName('script')[0]; snode.parentNode.insertBefore(lft, snode); })(); </script> <link rel="stylesheet" type="text/css" href="//tech.innovation.co.jp/themes/uno/assets/css/uno.css?v=1.0.0" /> <link rel="canonical" href="http://tech.innovation.co.jp/2018/06/25/Introduction-of-Computational-Complexity-2.html" /> <meta property="og:site_name" content="イノベーション エンジニアブログ" /> <meta property="og:type" content="article" /> <meta property="og:title" content="アルゴリズム計算量入門 〜 ②" /> <meta property="og:description" content="どうも、bigenです。 なぜ2本連続で書いているかというと、先週のブログ当番をブッチしてしまった罰ゲームです! そんなわけで、 前回の記事に引き続き、ソートアルゴリズムの計算量について見ていこうと思います。 【前回の記事のまとめ】 バブルソート: 時間計算量 O(n2), 空間計算量O(n) バケツソート: 時間計算量 O(m + n), 空間計算量O(m + n) マージソート: 時間計算量 O(n log n), 空間計算量O(n) 【まとめおわり】 今回は、実際にphpでそれぞれのアルゴリズムを動かして、「計算量本当にそれであってん..." /> <meta property="og:url" content="http://tech.innovation.co.jp/2018/06/25/Introduction-of-Computational-Complexity-2.html" /> <meta property="article:published_time" content="2018-06-24T15:00:00.000Z" /> <meta property="article:modified_time" content="2018-07-25T20:24:35.348Z" /> <meta property="article:tag" content="Complexity" /> <meta property="article:tag" content="Sort Algorithm" /> <meta property="article:tag" content="bigen" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="アルゴリズム計算量入門 〜 ②" /> <meta name="twitter:description" content="どうも、bigenです。 なぜ2本連続で書いているかというと、先週のブログ当番をブッチしてしまった罰ゲームです! そんなわけで、 前回の記事に引き続き、ソートアルゴリズムの計算量について見ていこうと思います。 【前回の記事のまとめ】 バブルソート: 時間計算量 O(n2), 空間計算量O(n) バケツソート: 時間計算量 O(m + n), 空間計算量O(m + n) マージソート: 時間計算量 O(n log n), 空間計算量O(n) 【まとめおわり】 今回は、実際にphpでそれぞれのアルゴリズムを動かして、「計算量本当にそれであってん..." /> <meta name="twitter:url" content="http://tech.innovation.co.jp/2018/06/25/Introduction-of-Computational-Complexity-2.html" /> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Article", "publisher": "イノベーション エンジニアブログ", "author": { "@type": "Person", "name": null, "image": "https://avatars2.githubusercontent.com/u/39402426?v=4", "url": "undefined/author/undefined", "sameAs": "" }, "headline": "アルゴリズム計算量入門 〜 ②", "url": "http://tech.innovation.co.jp/2018/06/25/Introduction-of-Computational-Complexity-2.html", "datePublished": "2018-06-24T15:00:00.000Z", "dateModified": "2018-07-25T20:24:35.348Z", "keywords": "Complexity, Sort Algorithm, bigen", "description": "どうも、bigenです。 なぜ2本連続で書いているかというと、先週のブログ当番をブッチしてしまった罰ゲームです! そんなわけで、 前回の記事に引き続き、ソートアルゴリズムの計算量について見ていこうと思います。 【前回の記事のまとめ】 バブルソート: 時間計算量 O(n2), 空間計算量O(n) バケツソート: 時間計算量 O(m + n), 空間計算量O(m + n) マージソート: 時間計算量 O(n log n), 空間計算量O(n) 【まとめおわり】 今回は、実際にphpでそれぞれのアルゴリズムを動かして、「計算量本当にそれであってん..." } </script> <meta name="generator" content="Ghost ?" /> <link rel="alternate" type="application/rss+xml" title="イノベーション エンジニアブログ" href="http://tech.innovation.co.jp/rss" /> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css"> </head> <body class="post-template tag-Complexity tag-Sort-Algorithm tag-bigen no-js"> <span class="mobile btn-mobile-menu"> <i class="icon icon-list btn-mobile-menu__icon"></i> <i class="icon icon-x-circle btn-mobile-close__icon hidden"></i> </span> <header class="panel-cover panel-cover--collapsed " > <div class="panel-main"> <div class="panel-main__inner panel-inverted"> <div class="panel-main__content"> <h1 class="panel-cover__title panel-title"><a href="http://tech.innovation.co.jp" title="link to homepage for イノベーション エンジニアブログ">イノベーション エンジニアブログ</a></h1> <hr class="panel-cover__divider" /> <p class="panel-cover__description">株式会社イノベーションのエンジニアたちの技術系ブログです。ITトレンド・List Finderの開発をベースに、業務外での技術研究などもブログとして発信していってます!</p> <hr class="panel-cover__divider panel-cover__divider--secondary" /> <div class="navigation-wrapper"> <nav class="cover-navigation cover-navigation--primary"> <ul class="navigation"> <li class="navigation__item"><a href="http://tech.innovation.co.jp/#blog" title="link to イノベーション エンジニアブログ blog" class="blog-button">Blog</a></li> </ul> </nav> <nav class="cover-navigation navigation--social"> <ul class="navigation"> </ul> </nav> </div> </div> </div> <div class="panel-cover--overlay"></div> </div> </header> <div class="content-wrapper"> <!-- ソーシャルボタンここから --> <div id="boxArea" style="display: table; padding: 0 0 0 2px;"> <div style="width: 74px; height: 22px; float: left;"> <a href="https://twitter.com/share" class="twitter-share-button" {count} data-lang="ja" data-dnt="true">ツイート</a> <script> !function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/ .test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs'); </script> </div> <div style="width: 76px; height: 22px; float: left;"> <div class="g-plusone" data-size="medium"></div> <script type="text/javascript"> window.___gcfg = { lang : 'ja' }; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/platform.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> </div> <div style="width: 126px; height: 22px; float: left;"> <a href="http://b.hatena.ne.jp/entry/" class="hatena-bookmark-button" data-hatena-bookmark-layout="standard-balloon" data-hatena-bookmark-lang="ja" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only@2x.png" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a> <script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script> </div> <div style="width: 117px; height: 22px; float: left;"> <a data-pocket-label="pocket" data-pocket-count="horizontal" class="pocket-btn" data-lang="en"></a> </div> <div style="width: 86px; height: 22px; float: left;"> <span><script type="text/javascript" src="//media.line.me/js/line-button.js?v=20140411"></script> <script type="text/javascript"> new media_line_me.LineButton({ "pc" : true, "lang" : "ja", "type" : "a" }); </script></span> </div> <div style="width: 114px; height: 22px; float: left;"> <script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: ja_JP </script> <script type="IN/Share" data-counter="right"></script> </div> <div style="width: 112px; height: 22px; float: left;"> <iframe scrolling="no" frameborder="0" id="fbframe" width="164" height="46" style="border:none;overflow:hidden" allowTransparency="true"></iframe> </div> <script type="text/javascript"> (function() { var url = encodeURIComponent(location.href); document.getElementById('fbframe').src="//www.facebook.com/plugins/like.php?href=" + url + "&width=164&layout=button_count&action=like&show_faces=true&share=true&height=46&appId=1613776965579453" })(); </script> </div> <script type="text/javascript"> !function(d, i) { if (!d.getElementById(i)) { var j = d.createElement("script"); j.id = i; j.src = "https://widgets.getpocket.com/v1/j/btn.js?v=1"; var w = d.getElementById(i); d.body.appendChild(j); } }(document, "pocket-btn-js"); </script> <!-- ソーシャルボタンここまで --> <div class="content-wrapper__inner"> <article class="post-container post-container--single"> <header class="post-header"> <div class="post-meta"> <time datetime="25 Jun 2018" class="post-meta__date date">25 Jun 2018</time> &#8226; <span class="post-meta__tags tags">on <a href="http://tech.innovation.co.jp/tag/Complexity">Complexity</a>, <a href="http://tech.innovation.co.jp/tag/Sort-Algorithm"> Sort Algorithm</a>, <a href="http://tech.innovation.co.jp/tag/bigen"> bigen</a></span> <span class="post-meta__author author"><img src="https://avatars2.githubusercontent.com/u/39402426?v=4" alt="profile image for " class="avatar post-meta__avatar" /> by </span> </div> <h1 class="post-title">アルゴリズム計算量入門 〜 ②</h1> </header> <section class="post tag-Complexity tag-Sort-Algorithm tag-bigen"> <div id="preamble"> <div class="sectionbody"> <div class="paragraph"> <p>どうも、bigenです。<br> なぜ2本連続で書いているかというと、先週のブログ当番をブッチしてしまった罰ゲームです!<br> <br> そんなわけで、 <a href="http://tech.innovation.co.jp/2018/06/26/Introduction-of-Computational-Complexity.html">前回の記事</a>に引き続き、ソートアルゴリズムの計算量について見ていこうと思います。<br> <br> 【前回の記事のまとめ】<br> バブルソート: 時間計算量 <strong><em>O(n<sup>2</sup>)</em></strong>, 空間計算量<strong><em>O(n)</em></strong><br> バケツソート: 時間計算量 <strong><em>O(m + n)</em></strong>, 空間計算量<strong><em>O(m + n)</em></strong><br> マージソート: 時間計算量 <strong><em>O(n</em> log <em>n)</em></strong>, 空間計算量<strong><em>O(n)</em></strong><br> 【まとめおわり】<br> <br> 今回は、実際にphpでそれぞれのアルゴリズムを動かして、「計算量本当にそれであってんの?」っていうのを見ていきたいと思います。<br> <br></p> </div> </div> </div> <div class="sect1"> <h2 id="__">前提条件</h2> <div class="sectionbody"> <div class="paragraph"> <p>OS: macOS High Sierra ver.10.13.5<br> CPU: 第7世代の2.3GHzデュアルコアIntel Core i5プロセッサ<br> メモリ: 8GB 2,133MHz LPDDR3メモリ<br> PHP version: 7.1.16<br> <br> 対象とする問題は、<br></p> </div> <div class="literalblock"> <div class="content"> <pre>1~mの範囲のランダムな自然数n個からなる配列を昇順にソートする</pre> </div> </div> <div class="paragraph"> <p>としています。<br> ソースは初心にかえって自力で用意しました。<br> 記事の末尾に付録としておいておきますので、暇な方はご参照ください。<br> <br> また、全体の流れとして、この後</p> </div> <div class="literalblock"> <div class="content"> <pre>データの数nや、データの取りうる種類mを増やした時に、計算時間とメモリの消費がどのように変化するか</pre> </div> </div> <div class="paragraph"> <p>を実測で見ていきます。</p> </div> </div> </div> <div class="sect1"> <h2 id="___2">計算時間について</h2> <div class="sectionbody"> <div class="paragraph"> <p>時間計算量は、それぞれ<br> <br> バブルソート: 時間計算量 <strong><em>O(n<sup>2</sup>)</em></strong><br> バケツソート: 時間計算量 <strong><em>O(m + n)</em></strong><br> マージソート: 時間計算量 <strong><em>O(n</em> log <em>n)</em></strong> <br> <br> でした。<br> <strong><em>O(n<sup>2</sup>)</em></strong>は「nが10倍になったら計算時間は100倍」<br> <strong><em>O(m+n)</em></strong>は「nが10倍になったら計算時間も10倍、mが10倍になったら計算時間も10倍」<br> <strong><em>O(n</em> log <em>n)</em></strong>は「nが10倍になったら計算時間は(10*ちょっと)倍、nが大きいほどちょっとは小さくなる」 <br> という意味です。<br> <br></p> </div> <div class="sect3"> <h4 id="__n">データの数が増える場合(nが増える場合)</h4> <div class="paragraph"> <p>まずはデータの範囲は1~100の自然数に固定(<strong><em>m=100</em></strong>)し、データの数<strong><em>n</em></strong>を変化させた時に計算時間がどうなるか見ていきましょう。<br> <br></p> </div> <table class="tableblock frame-all grid-all spread"> <caption class="title">Table 1. 計算時間(s) , m = 100</caption> <colgroup> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top"></th> <th class="tableblock halign-left valign-top">n=100</th> <th class="tableblock halign-left valign-top">n=1000</th> <th class="tableblock halign-left valign-top">n=10000</th> <th class="tableblock halign-left valign-top">n=100000</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バブルソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002770</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0278578</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">2.7695038</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">287.1152839</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バケツソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0000241</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0000670</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0005970</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0061991</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">マージソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002079</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0030000</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.1332741</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">11.2226848</p></td> </tr> </tbody> </table> <div class="paragraph"> <p><strong>バブルソート</strong>から見てみると、nが10倍になるにつれ、ほぼ<strong>100倍→10000倍→1000000倍</strong>ときれいに遅くなっていますね。<br> 典型的な<strong><em>O(n<sup>2</sup>)</em></strong>の増え方です。 アルゴリズムがシンプルなのもあり、他の依存要素が少ないため綺麗に比例してくれました。<br></p> </div> <div class="paragraph"> <p><strong>バケツソート</strong> は、n:100 &#8594; 1000は3倍程度しか増えていませんが、n: 1000 &#8594;10000 &#8594; 100000はほぼ10倍ずつ増えています。 これは、nが小さい領域ではデータの範囲mに依存する分が大きかったためでしょう。 <br> n=100: 100(mに依存する時間) + 20(nに依存する時間) = 120<br> n=1000: 100(mに依存する時間) + 200(nに依存する時間) = 300(3倍ぐらい)<br> n=10000: 100(mに依存する時間) + 2000(nに依存する時間) = 2100(9倍ぐらい)<br> n=10000: 100(mに依存する時間) + 20000(nに依存する時間) = 20100(10倍ぐらい)<br> みたいな感じで増えていっただろうっていうことですね。<br> 理論通りの<strong><em>O(m+n)</em></strong>っぽい増え方をしてくれています。<br></p> </div> <div class="paragraph"> <p><strong>マージソート</strong>は、理論どおりにはいってくれませんでした。<br> nが10倍ずつ増えていくとき、計算時間は<br> <strong>15倍→45倍→80倍</strong><br> と増えています。理屈上は増え方が減っていってほしいのですが・・・。<br> 原因としては、再起呼び出し条件が最適化されていなかったりするところでしょうか。<br> (呼ばなくていい再帰呼び出しをしている箇所がある)<br> それでも、計算量の増え方は、バブルソートよりかなり遅いのが見て取れます。<br> <br></p> </div> </div> <div class="sect3"> <h4 id="__m">データの取りうる範囲が大きくなる場合(mが増える場合)</h4> <div class="paragraph"> <p>次に、データの数nを固定(n=100)して、データの取りうる範囲mを大きくしてみます。<br></p> </div> <table class="tableblock frame-all grid-all spread"> <caption class="title">Table 2. 計算時間(s) , n = 100</caption> <colgroup> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top"></th> <th class="tableblock halign-left valign-top">m=100</th> <th class="tableblock halign-left valign-top">m=1000</th> <th class="tableblock halign-left valign-top">m=10000</th> <th class="tableblock halign-left valign-top">m=100000</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バブルソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0003309</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002930</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0003278</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002920</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バケツソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0000350</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0000579</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0004789</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0067119</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">マージソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002470</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002210</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002301</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.0002169</p></td> </tr> </tbody> </table> <div class="paragraph"> <p><strong>バブルソート</strong>と<strong>マージソート</strong>は<strong>データの取りうる範囲mに依存していない</strong>ことが見て取れます。<br> <br> また、<strong>バケツソート</strong>だけm=1000~100000の間で大体10倍ずつ増えていっていることが分かります。<br> <strong><em>O(m + n)</em></strong>っぽいですね!<br></p> </div> </div> </div> </div> <div class="sect1"> <h2 id="___3">メモリ使用量について</h2> <div class="sectionbody"> <div class="paragraph"> <p>空間計算量はそれぞれ、<br> <br> バブルソート: 空間計算量 <strong><em>O(n)</em></strong><br> バケツソート: 空間計算量 <strong><em>O(m + n)</em></strong><br> マージソート: 空間計算量 <strong><em>O(n)</em></strong> <br></p> </div> <div class="paragraph"> <p>でした。<br> <br> メモリ使用量を計測するのは難しいのですが、phpではざっくり図るために<br> <code>memory_get_peak_usage()</code>と<code>memory_get_usage()</code>の差を使って計測しました。<br> 計算の前後で増えたメモリ割り当て量が分かります。<br> ノイズが多いので正確ではないですが、大体の増え方はつかめるんじゃないでしょうか。<br></p> </div> <div class="sect3"> <h4 id="__n_2">データの数が増える場合(nが増える場合)</h4> <div class="paragraph"> <p>まずはじめに、データの取りうる範囲mを固定(m=100)して、データの数を増やしたときに割当てメモリがどう増えるか見てみましょう<br></p> </div> <table class="tableblock frame-all grid-all spread"> <caption class="title">Table 3. メモリ使用量(byte) , m = 100</caption> <colgroup> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top"></th> <th class="tableblock halign-left valign-top">n=100</th> <th class="tableblock halign-left valign-top">n=1000</th> <th class="tableblock halign-left valign-top">n=10000</th> <th class="tableblock halign-left valign-top">n=100000</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バブルソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36920</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">528440</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">4198480</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バケツソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">45168</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">536688</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">4206728</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">マージソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">95784</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">1112040</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">8477032</p></td> </tr> </tbody> </table> <div class="paragraph"> <p><strong>バブルソート</strong>と<strong>バケツソート</strong>はほぼ同じ増え方をしています。<br> n=1000~100000の間で大体10倍ずつ増えています。<br> <strong><em>O(n)</em></strong>とか<strong><em>O(m+n)</em></strong> っぽいですね。<br> 少し不安定なのでもう少し様子をみたかったのですが、バブルソートはデータ数がこれ以上増えると計算時間がなかなかのものだったので諦めました。<br> <br> <strong>マージソート</strong>も、他の2つに比べてメモリが多いように見えますが、増え方を見ると10倍ずつ大きくなっており、結局 <strong><em>O(n)</em></strong>っぽいですね。<br> 計算通りでした。<br></p> </div> </div> <div class="sect3"> <h4 id="__m_2">データの取りうる範囲が大きくなる場合(mが増える場合)</h4> <div class="paragraph"> <p>次に、データの数nを固定(n=100)して、データの取りうる範囲mを増やしてみました。<br></p> </div> <table class="tableblock frame-all grid-all spread"> <caption class="title">Table 4. メモリ使用量(byte) , n = 100</caption> <colgroup> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> <col style="width: 20%;"> </colgroup> <thead> <tr> <th class="tableblock halign-left valign-top"></th> <th class="tableblock halign-left valign-top">m=100</th> <th class="tableblock halign-left valign-top">m=1000</th> <th class="tableblock halign-left valign-top">m=10000</th> <th class="tableblock halign-left valign-top">m=100000</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バブルソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">バケツソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">45168</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">536688</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">4206728</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">マージソート</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">36544</p></td> </tr> </tbody> </table> <div class="paragraph"> <p>phpの基本使用料が36500byteぐらい使うのは良いとして、<strong>バケツソートだけ</strong> m=1000~100000の間で大体10倍ずつ増えていくのが分かりました。<br> <strong><em>O(m+n)</em></strong>っぽいですね。<br> また、<strong>バブルソート</strong>と<strong>マージソート</strong>は<strong>データの範囲mには依存していない</strong>ことも分かります。<br> どちらも計算通り、といったところでしょうか。<br> <br></p> </div> </div> </div> </div> <div class="sect1"> <h2 id="___4">まとめ</h2> <div class="sectionbody"> <div class="paragraph"> <p>全体として、理論上の増え方になかなか近い実測値が出たんじゃないでしょうか。<br> <br> みなさんも、エンジニアであれば<br> <strong>「とりあえず動かしてみたけど結果が返ってこない。あと1分で終わるかもしれないし、1年かもしれない。いつまで待てばいいんだ?」</strong><br> みたいな時ありますよね?<br></p> </div> <div class="paragraph"> <p>あらかじめプログラムの計算量がわかっていると、データ数だけ見れば「数時間」なのか「数日」なのか「数年」なのかぐらいは大体分かるのです。 <br> すごい!<br> <br> また、<strong><em>O(n)</em></strong>のような書き方を<strong>オーダー記法</strong>や<strong>ビッグオー記法</strong>といったりするのですが、これをわかってると<br> 「そのアルゴリズムってどれぐらい早いの?」<br> 「エヌログエヌオーダーだぜ!今までのエヌニジョウオーダーとは比べ物にならないぜ!」<br> みたいな会話ができるわけですね。<br> すごい!!<br> <br> 興味ある方は、ぜひ色々調べてみてください。<br> こちらからは以上です。<br></p> </div> <div class="sect2"> <h3 id="___5">付録</h3> <div class="paragraph"> <p>ソースコードはこちら。 GitHubはこちら。 <a href="https://github.com/bigen1925/complexity_of_sort_algorithm" class="bare">https://github.com/bigen1925/complexity_of_sort_algorithm</a></p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-php" data-lang="php">&lt;?php ////////////// // Usage // Call from command line // $ php sort.php &lt;number_of_data&gt; &lt;max_range_of_data&gt; &lt;kind_of_sort_method&gt; // Sample: $ php sort.php 1000 100 bubble ////////////// // データの数 $length_array = (int)$argv[1] ?: 1000; // データのとりうる値の上限 $max_range = (int)$argv[2] ?: 100; // ソートアルゴリズム $sort_method = $argv[3] ?: "all"; // 計測 main($length_array, $max_range, $sort_method); function main($length_array, $max_range, $sort_method) { // 1~max_rangeまでの数字から成る、ランダムな順序の数列を生成 $array = array(); for ($i=0; $i &lt; $length_array; $i++) { $array[] = rand(1, $max_range); } // 初期の割当メモリ $initial_memory_usage = memory_get_usage(); if ($sort_method === "all" || $sort_method === "bubble") { $time_start = microtime(true); bubbleSort($array); $time = microtime(true) - $time_start; echo "bubbleSort:: {$time}s\n"; } if ($sort_method === "all" || $sort_method === "buckets") { $time_start = microtime(true); bucketsSort($array, $max_range); $time = microtime(true) - $time_start; echo "bucketsSort:: {$time}s\n"; } if ($sort_method === "all" || $sort_method === "merge") { $time_start = microtime(true); mergeSort($array); $time = microtime(true) - $time_start; echo "mergeSort:: {$time}s\n"; } // プログラム実行中に追加で割り当てられたメモリ量 $used_memory = memory_get_peak_usage() - $initial_memory_usage; echo "used_memory:: {$used_memory}\n"; } // バブルソート // @param array @array ソートしたい自然数配列 // @return array ソート済みの配列 function bubbleSort(array $array) { $length = count($array); for ($i=0; $i &lt; $length; $i++) { for ($j=0; $j &lt; $length - $i - 1; $j++) { if ($array[$j] &gt; $array[$j + 1]) { $temp = $array[$j]; $array[$j] = $array[$j + 1]; $array[$j + 1] = $temp; } } } return $array; } // バケツソート // @param array $array ソートしたい自然数配列 // @param integer $max_range データのとりうる最大値 // @return array ソート済みの配列 function bucketsSort(array $array, $max_range) { $length = count($array); $buckets = array_fill(1, $max_range, 0); $sorted_array = array(); foreach ($array as $value) { $buckets[$value]++; } foreach ($buckets as $value =&gt; $count) { for ($i = 0; $i &lt; $count; $i++) { $sorted_array[] = $value; } } return $sorted_array; } // マージソート // @param array $array ソートしたい自然数配列 // @return array ソート済み配列 function mergeSort(array $array) { $length = count($array); $sorted_array = array(); if ($length &gt; 1) { $mid_index = floor(($length + 0.5) / 2); $left_array = array_slice($array, 0, $mid_index); $right_array = array_slice($array, $mid_index); $left_array = mergeSort($left_array); $right_array = mergeSort($right_array); while (count($left_array) || count($right_array)) { if (count($left_array) == 0) { $sorted_array[] = array_shift($right_array); } elseif (count($right_array) == 0) { $sorted_array[] = array_shift($left_array); } elseif ($left_array[0] &gt; $right_array[0]) { $sorted_array[] = array_shift($right_array); } else { $sorted_array[] = array_shift($left_array); } } } else { $sorted_array = $array; } return $sorted_array; }</code></pre> </div> </div> </div> </div> </div> </section> </article> <footer class="footer"> <span class="footer__copyright">&copy; 2018. All rights reserved.</span> <span class="footer__copyright"><a href="http://uno.daleanthony.com" title="link to page for Uno Ghost theme">Uno theme</a> by <a href="http://daleanthony.com" title="link to website for Dale-Anthony">Dale-Anthony</a></span> <span class="footer__copyright">Proudly published with <a href="http://hubpress.io" title="link to Hubpress website">Hubpress</a></span> </footer> </div> </div> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js?v="></script> <script type="text/javascript"> jQuery( document ).ready(function() { // change date with ago jQuery('ago.ago').each(function(){ var element = jQuery(this).parent(); element.html( moment(element.text()).fromNow()); }); }); hljs.initHighlightingOnLoad(); </script> <script type="text/javascript" src="//tech.innovation.co.jp/themes/uno/assets/js/main.js?v=1.0.0"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-105881090-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
innovation-jp/innovation-jp.github.io
2018/06/25/Introduction-of-Computational-Complexity-2.html
HTML
mit
37,551
37.412798
346
0.645337
false
### Tree `flatten` Write a procedure called `tree->list` that completely flattens a tree to a list Example usage: ```racket (tree->list '[1 2 [3 [4]] [5]]) ;;=> '[1 2 3 4 5] ```
expede/teaching-fp
lesson-plan/week-04/exercises.md
Markdown
mit
179
21.375
79
0.614525
false
.float-btn-wrapper { width: 75; height: 75; } .float-btn-shadow { width: 56; height: 56; } .float-btn { background-color: #FF69B4; border-radius: 28; width: 56; height: 56; text-align: center; vertical-align: middle; } .float-btn.down{ animation-name: down; animation-duration: 0.2s; animation-fill-mode: forwards; } .float-btn-text { color: #ffffff; font-size: 36; margin-top: -3; margin-right: -1; } @keyframes down { from { background-color: #FF69B4 } to { background-color: #FFA9B4 } }
shalomscott/urgent
app/shared/fab/fab.component.css
CSS
mit
572
17.483871
38
0.596154
false
import re import warnings import ctds from .base import TestExternalDatabase from .compat import PY3, PY36, unicode_ class TestTdsParameter(TestExternalDatabase): def test___doc__(self): self.assertEqual( ctds.Parameter.__doc__, '''\ Parameter(value, output=False) Explicitly define a parameter for :py:meth:`.callproc`, :py:meth:`.execute`, or :py:meth:`.executemany`. This is necessary to indicate whether a parameter is *SQL* `OUTPUT` or `INPUT/OUTPUT` parameter. :param object value: The parameter's value. :param bool output: Is the parameter an output parameter. ''' ) def test_parameter(self): param1 = ctds.Parameter(b'123', output=True) self.assertEqual(param1.value, b'123') self.assertTrue(isinstance(param1, ctds.Parameter)) param2 = ctds.Parameter(b'123') self.assertEqual(param1.value, b'123') self.assertEqual(type(param1), type(param2)) self.assertTrue(isinstance(param2, ctds.Parameter)) def test___repr__(self): for parameter, expected in ( ( ctds.Parameter(b'123', output=True), "ctds.Parameter(b'123', output=True)" if PY3 else "ctds.Parameter('123', output=True)" ), ( ctds.Parameter(unicode_('123'), output=False), "ctds.Parameter('123')" if PY3 else "ctds.Parameter(u'123')" ), ( ctds.Parameter(None), "ctds.Parameter(None)" ), ( ctds.Parameter(ctds.SqlVarBinary(b'4321', size=10)), "ctds.Parameter(ctds.SqlVarBinary(b'4321', size=10))" if PY3 else "ctds.Parameter(ctds.SqlVarBinary('4321', size=10))" ) ): self.assertEqual(repr(parameter), expected) def _test__cmp__(self, __cmp__, expected, oper): cases = ( (ctds.Parameter(b'1234'), ctds.Parameter(b'123')), (ctds.Parameter(b'123'), ctds.Parameter(b'123')), (ctds.Parameter(b'123'), ctds.Parameter(b'123', output=True)), (ctds.Parameter(b'123'), ctds.Parameter(b'1234')), (ctds.Parameter(b'123'), b'123'), (ctds.Parameter(b'123'), ctds.Parameter(123)), (ctds.Parameter(b'123'), unicode_('123')), (ctds.Parameter(b'123'), ctds.SqlBinary(None)), (ctds.Parameter(b'123'), 123), (ctds.Parameter(b'123'), None), ) for index, args in enumerate(cases): operation = '[{0}]: {1} {2} {3}'.format(index, repr(args[0]), oper, repr(args[1])) if expected[index] == TypeError: try: __cmp__(*args) except TypeError as ex: regex = ( r"'{0}' not supported between instances of '[^']+' and '[^']+'".format(oper) if not PY3 or PY36 else r'unorderable types: \S+ {0} \S+'.format(oper) ) self.assertTrue(re.match(regex, str(ex)), ex) else: self.fail('{0} did not fail as expected'.format(operation)) # pragma: nocover else: self.assertEqual(__cmp__(*args), expected[index], operation) def test___cmp__eq(self): self._test__cmp__( lambda left, right: left == right, ( False, True, True, False, True, False, not PY3, False, False, False, ), '==' ) def test___cmp__ne(self): self._test__cmp__( lambda left, right: left != right, ( True, False, False, True, False, True, PY3, True, True, True, ), '!=' ) def test___cmp__lt(self): self._test__cmp__( lambda left, right: left < right, ( False, False, False, True, False, TypeError if PY3 else False, TypeError if PY3 else False, TypeError if PY3 else False, TypeError if PY3 else False, TypeError if PY3 else False, ), '<' ) def test___cmp__le(self): self._test__cmp__( lambda left, right: left <= right, ( False, True, True, True, True, TypeError if PY3 else False, TypeError if PY3 else True, TypeError if PY3 else False, TypeError if PY3 else False, TypeError if PY3 else False, ), '<=' ) def test___cmp__gt(self): self._test__cmp__( lambda left, right: left > right, ( True, False, False, False, False, TypeError if PY3 else True, TypeError if PY3 else False, TypeError if PY3 else True, TypeError if PY3 else True, TypeError if PY3 else True, ), '>' ) def test___cmp__ge(self): self._test__cmp__( lambda left, right: left >= right, ( True, True, True, False, True, TypeError if PY3 else True, TypeError if PY3 else True, TypeError if PY3 else True, TypeError if PY3 else True, TypeError if PY3 else True, ), '>=' ) def test_typeerror(self): for case in (None, object(), 123, 'foobar'): self.assertRaises(TypeError, ctds.Parameter, case, b'123') self.assertRaises(TypeError, ctds.Parameter) self.assertRaises(TypeError, ctds.Parameter, output=False) for case in (None, object(), 123, 'foobar'): self.assertRaises(TypeError, ctds.Parameter, b'123', output=case) def test_reuse(self): with self.connect() as connection: with connection.cursor() as cursor: for value in ( None, 123456, unicode_('hello world'), b'some bytes', ): for output in (True, False): parameter = ctds.Parameter(value, output=output) for _ in range(0, 2): # Ignore warnings generated due to output parameters # used with result sets. with warnings.catch_warnings(record=True): cursor.execute( ''' SELECT :0 ''', (parameter,) ) self.assertEqual( [tuple(row) for row in cursor.fetchall()], [(value,)] )
zillow/ctds
tests/test_tds_parameter.py
Python
mit
7,779
32.102128
106
0.432061
false
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; namespace HolisticWare.Ph4ct3x.Server.Pages.Ph4ct3x.Communication { public class InstantMessagingChatModel : PageModel { public void OnGet() { } } }
moljac/Ph4ct3x
samples/Clients/HolisticWare.Ph4ct3x.Server.ASPnet.UI.RazorPages.shared/Pages/Ph4ct3x/Communication/InstantMessagingChat.cshtml.cs
C#
mit
361
21.4375
65
0.732591
false
/* * Copyright (c) 2014 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. */ #ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ #define MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_ #include <list> #include <memory> #include BOSS_WEBRTC_U_api__rtp_headers_h //original-code:"api/rtp_headers.h" // NOLINT(build/include) #include BOSS_WEBRTC_U_common_types_h //original-code:"common_types.h" // NOLINT(build/include) #include BOSS_WEBRTC_U_rtc_base__constructormagic_h //original-code:"rtc_base/constructormagic.h" #include BOSS_WEBRTC_U_typedefs_h //original-code:"typedefs.h" // NOLINT(build/include) namespace webrtc { class RtpHeaderParser; namespace test { // Class for handling RTP packets in test applications. class Packet { public: // Creates a packet, with the packet payload (including header bytes) in // |packet_memory|. The length of |packet_memory| is |allocated_bytes|. // The new object assumes ownership of |packet_memory| and will delete it // when the Packet object is deleted. The |time_ms| is an extra time // associated with this packet, typically used to denote arrival time. // The first bytes in |packet_memory| will be parsed using |parser|. Packet(uint8_t* packet_memory, size_t allocated_bytes, double time_ms, const RtpHeaderParser& parser); // Same as above, but with the extra argument |virtual_packet_length_bytes|. // This is typically used when reading RTP dump files that only contain the // RTP headers, and no payload (a.k.a RTP dummy files or RTP light). The // |virtual_packet_length_bytes| tells what size the packet had on wire, // including the now discarded payload, whereas |allocated_bytes| is the // length of the remaining payload (typically only the RTP header). Packet(uint8_t* packet_memory, size_t allocated_bytes, size_t virtual_packet_length_bytes, double time_ms, const RtpHeaderParser& parser); // The following two constructors are the same as above, but without a // parser. Note that when the object is constructed using any of these // methods, the header will be parsed using a default RtpHeaderParser object. // In particular, RTP header extensions won't be parsed. Packet(uint8_t* packet_memory, size_t allocated_bytes, double time_ms); Packet(uint8_t* packet_memory, size_t allocated_bytes, size_t virtual_packet_length_bytes, double time_ms); virtual ~Packet(); // Parses the first bytes of the RTP payload, interpreting them as RED headers // according to RFC 2198. The headers will be inserted into |headers|. The // caller of the method assumes ownership of the objects in the list, and // must delete them properly. bool ExtractRedHeaders(std::list<RTPHeader*>* headers) const; // Deletes all RTPHeader objects in |headers|, but does not delete |headers| // itself. static void DeleteRedHeaders(std::list<RTPHeader*>* headers); const uint8_t* payload() const { return payload_; } size_t packet_length_bytes() const { return packet_length_bytes_; } size_t payload_length_bytes() const { return payload_length_bytes_; } size_t virtual_packet_length_bytes() const { return virtual_packet_length_bytes_; } size_t virtual_payload_length_bytes() const { return virtual_payload_length_bytes_; } const RTPHeader& header() const { return header_; } void set_time_ms(double time) { time_ms_ = time; } double time_ms() const { return time_ms_; } bool valid_header() const { return valid_header_; } private: bool ParseHeader(const RtpHeaderParser& parser); void CopyToHeader(RTPHeader* destination) const; RTPHeader header_; std::unique_ptr<uint8_t[]> payload_memory_; const uint8_t* payload_; // First byte after header. const size_t packet_length_bytes_; // Total length of packet. size_t payload_length_bytes_; // Length of the payload, after RTP header. // Zero for dummy RTP packets. // Virtual lengths are used when parsing RTP header files (dummy RTP files). const size_t virtual_packet_length_bytes_; size_t virtual_payload_length_bytes_; double time_ms_; // Used to denote a packet's arrival time. bool valid_header_; // Set by the RtpHeaderParser. RTC_DISALLOW_COPY_AND_ASSIGN(Packet); }; } // namespace test } // namespace webrtc #endif // MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_H_
koobonil/Boss2D
Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/modules/audio_coding/neteq/tools/packet.h
C
mit
4,769
39.415254
103
0.709163
false
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Cross-correlations: GlobalVariables Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Cross-correlations &#160;<span id="projectnumber">1.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.8.0 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">GlobalVariables Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="global__variables_8h_source.html">global_variables.h</a>&gt;</code></p> <p><a href="class_global_variables-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a4631d1ecf5fe11e440926a3464028eb0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a4631d1ecf5fe11e440926a3464028eb0">GlobalVariables</a> ()</td></tr> <tr class="memitem:aa30e576f3563c41b63177a5ae93b9aab"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#aa30e576f3563c41b63177a5ae93b9aab">c</a> () const </td></tr> <tr class="memitem:ab8932c7446ddcc1bbf9f19d07ec44424"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ab8932c7446ddcc1bbf9f19d07ec44424">correlation_file_name</a> () const </td></tr> <tr class="memitem:ab5102be8fa70c050ab20349e47fa388d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ab5102be8fa70c050ab20349e47fa388d">h</a> () const </td></tr> <tr class="memitem:a1ae6b307005b7da0849b79173ab5b62d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a1ae6b307005b7da0849b79173ab5b62d">h0</a> () const </td></tr> <tr class="memitem:a7b251a0da7026b671d8a68279cab4ae7"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a7b251a0da7026b671d8a68279cab4ae7">lya_spectra_catalog</a> () const </td></tr> <tr class="memitem:a7ef593cd3a148af75812f2e8479595ae"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a7ef593cd3a148af75812f2e8479595ae">lya_spectra_catalog_name</a> () const </td></tr> <tr class="memitem:ac337ea3586fbb1346240ad25c696f6f0"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ac337ea3586fbb1346240ad25c696f6f0">lya_spectra_dir</a> () const </td></tr> <tr class="memitem:a2893eb2c29a895d604ac471c320f4a39"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a2893eb2c29a895d604ac471c320f4a39">lya_wl</a> () const </td></tr> <tr class="memitem:ae3688afd60bb03fd4e788d27af1ac8fe"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ae3688afd60bb03fd4e788d27af1ac8fe">max_pi</a> () const </td></tr> <tr class="memitem:a13694704b2bb849bae0d46e577246fb0"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a13694704b2bb849bae0d46e577246fb0">max_sigma</a> () const </td></tr> <tr class="memitem:aae93df7713a9e59706c8d8cd03e62a8a"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#aae93df7713a9e59706c8d8cd03e62a8a">neighbours_max_distance</a> () const </td></tr> <tr class="memitem:a7481f788f94ed1bdb590057d7a0f48ca"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a7481f788f94ed1bdb590057d7a0f48ca">normalized_correlation</a> () const </td></tr> <tr class="memitem:a8df4bf4e1962af98f59cd43947188509"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a8df4bf4e1962af98f59cd43947188509">num_bins</a> () const </td></tr> <tr class="memitem:a08ee1fac0ba1c1eccb8fd405c1f9cb1c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a08ee1fac0ba1c1eccb8fd405c1f9cb1c">num_pi_bins</a> () const </td></tr> <tr class="memitem:a09a6fd5da6b9c5a3a9aa63bee7e4466f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a09a6fd5da6b9c5a3a9aa63bee7e4466f">num_plates</a> () const </td></tr> <tr class="memitem:a054d4cf825a69d3461475a3590799774"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a054d4cf825a69d3461475a3590799774">num_points_interpolation</a> () const </td></tr> <tr class="memitem:a5ccd02c696d64e9c33fc6a7e1ba8b9ef"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a5ccd02c696d64e9c33fc6a7e1ba8b9ef">num_sigma_bins</a> () const </td></tr> <tr class="memitem:ab3641ef310a60651c562a7dc8864d0e9"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ab3641ef310a60651c562a7dc8864d0e9">objects_catalog</a> () const </td></tr> <tr class="memitem:a8412ac07504633c4abd23702b4d4d823"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a8412ac07504633c4abd23702b4d4d823">objects_catalog_name</a> () const </td></tr> <tr class="memitem:ac10711bcd7293ce5da996b4f5b79de2b"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ac10711bcd7293ce5da996b4f5b79de2b">pairs_file_name</a> () const </td></tr> <tr class="memitem:abf1a6505c3dab27b4dc58fc1634e70e7"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#abf1a6505c3dab27b4dc58fc1634e70e7">plate_neighbours</a> () const </td></tr> <tr class="memitem:a825d2ce1a68bbdca6395aa10690e3407"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a825d2ce1a68bbdca6395aa10690e3407">plots</a> () const </td></tr> <tr class="memitem:a03e3e8cbe112ab714544e57f541a693f"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a03e3e8cbe112ab714544e57f541a693f">pwd</a> () const </td></tr> <tr class="memitem:a53b4346935148918029cc1a2daaad80c"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a53b4346935148918029cc1a2daaad80c">results</a> () const </td></tr> <tr class="memitem:aba979c1ae01246184e65e4034007f0ca"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#aba979c1ae01246184e65e4034007f0ca">step_pi</a> () const </td></tr> <tr class="memitem:a0a1e6c768c7323c1da081db7c375060e"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a0a1e6c768c7323c1da081db7c375060e">step_sigma</a> () const </td></tr> <tr class="memitem:ae01eadf8a6614c2b8f5e5a5da5b0a7c3"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ae01eadf8a6614c2b8f5e5a5da5b0a7c3">wm</a> () const </td></tr> <tr class="memitem:a09e2005546be6c1147d898fbd9f040e0"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a09e2005546be6c1147d898fbd9f040e0">z_max</a> () const </td></tr> <tr class="memitem:ad2dee77ee4d577e3a9575184089735ac"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ad2dee77ee4d577e3a9575184089735ac">z_max_interpolation</a> () const </td></tr> <tr class="memitem:ac6ed0b46b3ab483ba201b193b0953905"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#ac6ed0b46b3ab483ba201b193b0953905">z_min</a> () const </td></tr> <tr class="memitem:a3f167911da6733d4f4ebf58949d24c02"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_global_variables.html#a3f167911da6733d4f4ebf58949d24c02">z_min_interpolation</a> () const </td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>global _variables.h Purpose: This file defines the class <a class="el" href="class_global_variables.html">GlobalVariables</a>. This class contains the constant variables which are used in a "global" sense</p> <dl class="section author"><dt>Author:</dt><dd>Ignasi Pérez-Ràfols (<a href="#" onclick="location.href='mai'+'lto:'+'ipr'+'af'+'ols'+'@i'+'cc.'+'ub'+'.ed'+'u'; return false;">ipraf<span style="display: none;">.nosp@m.</span>ols@<span style="display: none;">.nosp@m.</span>icc.u<span style="display: none;">.nosp@m.</span>b.ed<span style="display: none;">.nosp@m.</span>u</a>) </dd></dl> <dl class="section version"><dt>Version:</dt><dd>1.0 on 17/06/14 </dd></dl> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00025">25</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> </div><hr/><h2>Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a4631d1ecf5fe11e440926a3464028eb0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_global_variables.html#a4631d1ecf5fe11e440926a3464028eb0">GlobalVariables::GlobalVariables</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="global__variables_8cpp.html">global_variables.cpp</a> Purpose: This files contains the body for the functions defined in <a class="el" href="global__variables_8h.html">global_variables.h</a></p> <dl class="section author"><dt>Author:</dt><dd>Ignasi Pérez-Ràfols </dd></dl> <dl class="section version"><dt>Version:</dt><dd>1.0 06/17/2014 </dd></dl> <p>EXPLANATION: Cosntructs a <a class="el" href="class_global_variables.html">GlobalVariables</a> instance and initializes all its variables</p> <p>INPUTS: NONE</p> <p>OUTPUTS: NONE</p> <p>CLASSES USED: <a class="el" href="class_global_variables.html">GlobalVariables</a></p> <p>FUNCITONS USED: NONE</p> <p>Definition at line <a class="el" href="global__variables_8cpp_source.html#l00011">11</a> of file <a class="el" href="global__variables_8cpp_source.html">global_variables.cpp</a>.</p> <div class="fragment"><pre class="fragment"> { <span class="comment">//</span> <span class="comment">// general settings</span> <span class="comment">//</span> <span class="comment">//pwd_ = &quot;/Users/iprafols/cross_correlations/&quot;;</span> pwd_ = <span class="stringliteral">&quot;/triforce/iprafols/cross_correlations/&quot;</span>; results_ = pwd_ + <span class="stringliteral">&quot;results2/&quot;</span>; plots_ = pwd_ + <span class="stringliteral">&quot;plots2/&quot;</span>; objects_catalog_ = pwd_ + <span class="stringliteral">&quot;DR11Q_alpha_v0.fits&quot;</span>; objects_catalog_name_ = <span class="stringliteral">&quot;DR11Q_alpha_v0&quot;</span>; pairs_file_name_ = <span class="stringliteral">&quot;qso_spectrum_pairs_plate_&quot;</span>; correlation_file_name_ = results_ + <span class="stringliteral">&quot;correlation_bin_&quot;</span>; normalized_correlation_ = results_ + <span class="stringliteral">&quot;normalized_correlation.dat&quot;</span>; plate_neighbours_ = pwd_ + <span class="stringliteral">&quot;plate_neighbours.dat&quot;</span>; lya_spectra_dir_ = pwd_ + <span class="stringliteral">&quot;spectrum_fits_files/&quot;</span>; <span class="comment">//lya_spectra_catalog_ = pwd_ + &quot;DR11Q_spectra_forest_one_spectrum.ls&quot;;// versió per fer proves</span> lya_spectra_catalog_ = pwd_ + <span class="stringliteral">&quot;DR11Q_spectra_forest_some_spectrum.ls&quot;</span>;<span class="comment">// versió per fer proves</span> <span class="comment">//lya_spectra_catalog_ = pwd_ + &quot;DR11Q_spectra_forest_list.ls&quot;; // versió definitiva</span> lya_spectra_catalog_name_ = <span class="stringliteral">&quot;DR11Q_spectra_forest&quot;</span>; num_plates_ = 2044; <span class="comment">// DR11</span> <span class="comment">//</span> <span class="comment">// Fidutial model</span> <span class="comment">//</span> h0_ = 68.0; h_ = h0_/100.0; wm_ = 0.3; <span class="comment">//</span> <span class="comment">// bin setting</span> <span class="comment">//</span> neighbours_max_distance_ = 3.0*acos(-1.0)/180.0; <span class="comment">// (in radians)</span> max_pi_ = 50.0; <span class="comment">// (in Mpc/h)</span> max_sigma_ = 50.0; <span class="comment">// (in Mpc/h)</span> step_pi_ = 5.0; <span class="comment">// (in Mpc/h)</span> step_sigma_ = 5.0; <span class="comment">// (in Mpc/h)</span> num_pi_bins_ = int(2.0*max_pi_/step_pi_); num_sigma_bins_ = int(max_sigma_/step_sigma_); num_bins_ = num_pi_bins_*num_sigma_bins_; <span class="comment">//</span> <span class="comment">// line and redshift settings</span> <span class="comment">//</span> lya_wl_ = 1215.67; z_min_ = 2.0; z_max_ = 3.5; z_min_interpolation_ = 1.5; z_max_interpolation_ = 4.0; num_points_interpolation_ = 30000; <span class="comment">//</span> <span class="comment">// Some mathematical and physical constants</span> <span class="comment">//</span> c_ = 299792.458; }</pre></div> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="aa30e576f3563c41b63177a5ae93b9aab"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#aa30e576f3563c41b63177a5ae93b9aab">GlobalVariables::c</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00038">38</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> c_;} </pre></div> </div> </div> <a class="anchor" id="ab8932c7446ddcc1bbf9f19d07ec44424"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#ab8932c7446ddcc1bbf9f19d07ec44424">GlobalVariables::correlation_file_name</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00041">41</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> correlation_file_name_;} </pre></div> </div> </div> <a class="anchor" id="ab5102be8fa70c050ab20349e47fa388d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#ab5102be8fa70c050ab20349e47fa388d">GlobalVariables::h</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00044">44</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> h_;} </pre></div> </div> </div> <a class="anchor" id="a1ae6b307005b7da0849b79173ab5b62d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#a1ae6b307005b7da0849b79173ab5b62d">GlobalVariables::h0</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00047">47</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> h0_;} </pre></div> </div> </div> <a class="anchor" id="a7b251a0da7026b671d8a68279cab4ae7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#a7b251a0da7026b671d8a68279cab4ae7">GlobalVariables::lya_spectra_catalog</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00050">50</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> lya_spectra_catalog_;} </pre></div> </div> </div> <a class="anchor" id="a7ef593cd3a148af75812f2e8479595ae"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#a7ef593cd3a148af75812f2e8479595ae">GlobalVariables::lya_spectra_catalog_name</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00053">53</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> lya_spectra_catalog_name_;} </pre></div> </div> </div> <a class="anchor" id="ac337ea3586fbb1346240ad25c696f6f0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#ac337ea3586fbb1346240ad25c696f6f0">GlobalVariables::lya_spectra_dir</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00056">56</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> lya_spectra_dir_;} </pre></div> </div> </div> <a class="anchor" id="a2893eb2c29a895d604ac471c320f4a39"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#a2893eb2c29a895d604ac471c320f4a39">GlobalVariables::lya_wl</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00059">59</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> lya_wl_;} </pre></div> </div> </div> <a class="anchor" id="ae3688afd60bb03fd4e788d27af1ac8fe"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#ae3688afd60bb03fd4e788d27af1ac8fe">GlobalVariables::max_pi</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00062">62</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> max_pi_;} </pre></div> </div> </div> <a class="anchor" id="a13694704b2bb849bae0d46e577246fb0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#a13694704b2bb849bae0d46e577246fb0">GlobalVariables::max_sigma</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00065">65</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> max_sigma_;} </pre></div> </div> </div> <a class="anchor" id="aae93df7713a9e59706c8d8cd03e62a8a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#aae93df7713a9e59706c8d8cd03e62a8a">GlobalVariables::neighbours_max_distance</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00068">68</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> neighbours_max_distance_;} </pre></div> </div> </div> <a class="anchor" id="a7481f788f94ed1bdb590057d7a0f48ca"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#a7481f788f94ed1bdb590057d7a0f48ca">GlobalVariables::normalized_correlation</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00071">71</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> normalized_correlation_;} </pre></div> </div> </div> <a class="anchor" id="a8df4bf4e1962af98f59cd43947188509"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="class_global_variables.html#a8df4bf4e1962af98f59cd43947188509">GlobalVariables::num_bins</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00074">74</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> num_bins_;} </pre></div> </div> </div> <a class="anchor" id="a08ee1fac0ba1c1eccb8fd405c1f9cb1c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="class_global_variables.html#a08ee1fac0ba1c1eccb8fd405c1f9cb1c">GlobalVariables::num_pi_bins</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00077">77</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> num_pi_bins_;} </pre></div> </div> </div> <a class="anchor" id="a09a6fd5da6b9c5a3a9aa63bee7e4466f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="class_global_variables.html#a09a6fd5da6b9c5a3a9aa63bee7e4466f">GlobalVariables::num_plates</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00080">80</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> num_plates_;} </pre></div> </div> </div> <a class="anchor" id="a054d4cf825a69d3461475a3590799774"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="class_global_variables.html#a054d4cf825a69d3461475a3590799774">GlobalVariables::num_points_interpolation</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00083">83</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> num_points_interpolation_;} </pre></div> </div> </div> <a class="anchor" id="a5ccd02c696d64e9c33fc6a7e1ba8b9ef"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="class_global_variables.html#a5ccd02c696d64e9c33fc6a7e1ba8b9ef">GlobalVariables::num_sigma_bins</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00086">86</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> num_sigma_bins_;} </pre></div> </div> </div> <a class="anchor" id="ab3641ef310a60651c562a7dc8864d0e9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#ab3641ef310a60651c562a7dc8864d0e9">GlobalVariables::objects_catalog</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00089">89</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> objects_catalog_;} </pre></div> </div> </div> <a class="anchor" id="a8412ac07504633c4abd23702b4d4d823"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#a8412ac07504633c4abd23702b4d4d823">GlobalVariables::objects_catalog_name</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00092">92</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> objects_catalog_name_;} </pre></div> </div> </div> <a class="anchor" id="ac10711bcd7293ce5da996b4f5b79de2b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#ac10711bcd7293ce5da996b4f5b79de2b">GlobalVariables::pairs_file_name</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00095">95</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> pairs_file_name_;} </pre></div> </div> </div> <a class="anchor" id="abf1a6505c3dab27b4dc58fc1634e70e7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#abf1a6505c3dab27b4dc58fc1634e70e7">GlobalVariables::plate_neighbours</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00098">98</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> plate_neighbours_;} </pre></div> </div> </div> <a class="anchor" id="a825d2ce1a68bbdca6395aa10690e3407"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#a825d2ce1a68bbdca6395aa10690e3407">GlobalVariables::plots</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00101">101</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> plots_;} </pre></div> </div> </div> <a class="anchor" id="a03e3e8cbe112ab714544e57f541a693f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#a03e3e8cbe112ab714544e57f541a693f">GlobalVariables::pwd</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00104">104</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> pwd_;} </pre></div> </div> </div> <a class="anchor" id="a53b4346935148918029cc1a2daaad80c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_global_variables.html#a53b4346935148918029cc1a2daaad80c">GlobalVariables::results</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00107">107</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> results_;} </pre></div> </div> </div> <a class="anchor" id="aba979c1ae01246184e65e4034007f0ca"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#aba979c1ae01246184e65e4034007f0ca">GlobalVariables::step_pi</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00110">110</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> step_pi_;} </pre></div> </div> </div> <a class="anchor" id="a0a1e6c768c7323c1da081db7c375060e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#a0a1e6c768c7323c1da081db7c375060e">GlobalVariables::step_sigma</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00113">113</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> step_sigma_;} </pre></div> </div> </div> <a class="anchor" id="ae01eadf8a6614c2b8f5e5a5da5b0a7c3"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#ae01eadf8a6614c2b8f5e5a5da5b0a7c3">GlobalVariables::wm</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00116">116</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> wm_;} </pre></div> </div> </div> <a class="anchor" id="a09e2005546be6c1147d898fbd9f040e0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#a09e2005546be6c1147d898fbd9f040e0">GlobalVariables::z_max</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00119">119</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> z_max_;} </pre></div> </div> </div> <a class="anchor" id="ad2dee77ee4d577e3a9575184089735ac"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#ad2dee77ee4d577e3a9575184089735ac">GlobalVariables::z_max_interpolation</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00122">122</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> z_max_interpolation_;} </pre></div> </div> </div> <a class="anchor" id="ac6ed0b46b3ab483ba201b193b0953905"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#ac6ed0b46b3ab483ba201b193b0953905">GlobalVariables::z_min</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00125">125</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> z_min_;} </pre></div> </div> </div> <a class="anchor" id="a3f167911da6733d4f4ebf58949d24c02"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double <a class="el" href="class_global_variables.html#a3f167911da6733d4f4ebf58949d24c02">GlobalVariables::z_min_interpolation</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="global__variables_8h_source.html#l00128">128</a> of file <a class="el" href="global__variables_8h_source.html">global_variables.h</a>.</p> <div class="fragment"><pre class="fragment">{<span class="keywordflow">return</span> z_min_interpolation_;} </pre></div> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="global__variables_8h_source.html">global_variables.h</a></li> <li><a class="el" href="global__variables_8cpp_source.html">global_variables.cpp</a></li> </ul> </div><!-- contents --> <hr class="footer"/><address class="footer"><small> Generated on Tue Oct 14 2014 09:19:21 for Cross-correlations by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.0 </small></address> </body> </html>
iprafols/cross_correlations
documentation/html/class_global_variables.html
HTML
mit
44,550
52.601685
957
0.664414
false
#include "Renderer.h" #include "Core/Windows/Window.h" #include <Resources/ResourceCache.h> namespace uut { UUT_MODULE_IMPLEMENT(Renderer) {} Renderer::Renderer() : _screenSize(0) { } Renderer::~Renderer() { } ////////////////////////////////////////////////////////////////////////////// bool Renderer::OnInit() { if (!Super::OnInit()) return false; ModuleInstance<ResourceCache> cache; cache->AddResource(CreateMonoTexture(Color32::White), "white"); cache->AddResource(CreateMonoTexture(Color32::Black), "black"); return true; } void Renderer::OnDone() { } SharedPtr<Texture2D> Renderer::CreateMonoTexture(const Color32& color) { auto tex = CreateTexture(Vector2i(1), TextureAccess::Static); uint32_t* buf = static_cast<uint32_t*>(tex->Lock()); if (buf == nullptr) return nullptr; buf[0] = color.ToInt(); tex->Unlock(); return tex; } }
kolyden/uut-engine
UUT/Video/Renderer.cpp
C++
mit
896
17.666667
79
0.617188
false
package jnt.scimark2; public class kernel { // each measurement returns approx Mflops public static double measureFFT(int N, double mintime, Random R) { // initialize FFT data as complex (N real/img pairs) double x[] = RandomVector(2*N, R); double oldx[] = NewVectorCopy(x); long cycles = 1; Stopwatch Q = new Stopwatch(); while(true) { Q.start(); for (int i=0; i<cycles; i++) { FFT.transform(x); // forward transform FFT.inverse(x); // backward transform } Q.stop(); if (Q.read() >= mintime) break; cycles *= 2; } // approx Mflops final double EPS = 1.0e-10; if ( FFT.test(x) / N > EPS ) return 0.0; return FFT.num_flops(N)*cycles/ Q.read() * 1.0e-6; } // public static double measureSOR(int N, double min_time, Random R) // { // double G[][] = RandomMatrix(N, N, R); // // //Stopwatch Q = new Stopwatch(); // int cycles=1; // //while(true) // while(cycles <= 32768) // { // //Q.start(); // SOR.execute(1.25, G, cycles); // //Q.stop(); // //if (Q.read() >= min_time) break; // // cycles *= 2; // } // // approx Mflops // //return SOR.num_flops(N, N, cycles) / Q.read() * 1.0e-6; // return SOR.num_flops(N, N, cycles); // } public static double measureSOR(int N, double min_time, Random R) { double G[][] = RandomMatrix(N, N, R); int rep = 10; // 11s @ 594MHz //rep = 75; // 42.5s @ 1026MHz //rep = 150; // 68s @ 1026MHz, this just fully melts PCM, at end of benchmark //rep = 250; // 113s @ 1026MHz //rep = 300; // 126s @ 1026MHz, using this setting in my house, PCM melts fully rep = 75; // 75 short duration // 300 medium duration // 400 long duration int cycles = 2048; for (int i = 0; i < rep; i++) { SOR.execute(1.25, G, cycles); } return SOR.num_flops(N, N, cycles); } public static double measureMonteCarlo(double min_time, Random R) { Stopwatch Q = new Stopwatch(); int cycles=1; while(true) { Q.start(); MonteCarlo.integrate(cycles); Q.stop(); if (Q.read() >= min_time) break; cycles *= 2; } // approx Mflops return MonteCarlo.num_flops(cycles) / Q.read() * 1.0e-6; } public static double measureSparseMatmult(int N, int nz, double min_time, Random R) { // initialize vector multipliers and storage for result // y = A*y; double x[] = RandomVector(N, R); double y[] = new double[N]; // initialize square sparse matrix // // for this test, we create a sparse matrix wit M/nz nonzeros // per row, with spaced-out evenly between the begining of the // row to the main diagonal. Thus, the resulting pattern looks // like // +-----------------+ // +* + // +*** + // +* * * + // +** * * + // +** * * + // +* * * * + // +* * * * + // +* * * * + // +-----------------+ // // (as best reproducible with integer artihmetic) // Note that the first nr rows will have elements past // the diagonal. int nr = nz/N; // average number of nonzeros per row int anz = nr *N; // _actual_ number of nonzeros double val[] = RandomVector(anz, R); int col[] = new int[anz]; int row[] = new int[N+1]; row[0] = 0; for (int r=0; r<N; r++) { // initialize elements for row r int rowr = row[r]; row[r+1] = rowr + nr; int step = r/ nr; if (step < 1) step = 1; // take at least unit steps for (int i=0; i<nr; i++) col[rowr+i] = i*step; } //Stopwatch Q = new Stopwatch(); int cycles = 2048; //while(true) //while(cycles <= 65536) // about 20 seconds //while(cycles <= 1048576) // about 200 seconds int rep = 30; // 14 sec @ 594 for (int i = 0; i < rep; i++) { //Q.start(); SparseCompRow.matmult(y, val, row, col, x, cycles); //Q.stop(); //if (Q.read() >= min_time) break; //cycles *= 2; } // approx Mflops //return SparseCompRow.num_flops(N, nz, cycles) / Q.read() * 1.0e-6; return SparseCompRow.num_flops(N, nz, cycles); } public static double measureLU(int N, double min_time, Random R) { // compute approx Mlfops, or O if LU yields large errors double A[][] = RandomMatrix(N, N, R); double lu[][] = new double[N][N]; int pivot[] = new int[N]; //Stopwatch Q = new Stopwatch(); //while(true) //while (cycles <= 8192) //while (cycles <= 2048) // approx 20 sec //while (cycles <= 6144) // approx 30 sec @ 1242MHz //while (cycles <= 12288) // approx 60 sec @ 1242MHz //while (cycles <= 14336) // approx 70 sec @ 1242MHz //while (cycles <= 16384) // approx 80 sec @ 1242MHz int cycles = 2048; // 14 sec @ 594Hz for (int j = 0; j < cycles; j++) { //Q.start(); //for (int i=0; i<cycles; i++) //{ CopyMatrix(lu, A); LU.factor(lu, pivot); //} //Q.stop(); //if (Q.read() >= min_time) break; //cycles *= 2; } // verify that LU is correct double b[] = RandomVector(N, R); double x[] = NewVectorCopy(b); LU.solve(lu, pivot, x); final double EPS = 1.0e-12; if ( normabs(b, matvec(A,x)) / N > EPS ) return 0.0; // else return approx Mflops // //return LU.num_flops(N) * cycles / Q.read() * 1.0e-6; return LU.num_flops(N) * cycles; } private static double[] NewVectorCopy(double x[]) { int N = x.length; double y[] = new double[N]; for (int i=0; i<N; i++) y[i] = x[i]; return y; } private static void CopyVector(double B[], double A[]) { int N = A.length; for (int i=0; i<N; i++) B[i] = A[i]; } private static double normabs(double x[], double y[]) { int N = x.length; double sum = 0.0; for (int i=0; i<N; i++) sum += Math.abs(x[i]-y[i]); return sum; } public static void CopyMatrix(double B[][], double A[][]) { int M = A.length; int N = A[0].length; int remainder = N & 3; // N mod 4; for (int i=0; i<M; i++) { double Bi[] = B[i]; double Ai[] = A[i]; for (int j=0; j<remainder; j++) Bi[j] = Ai[j]; for (int j=remainder; j<N; j+=4) { Bi[j] = Ai[j]; Bi[j+1] = Ai[j+1]; Bi[j+2] = Ai[j+2]; Bi[j+3] = Ai[j+3]; } } } public static double[][] RandomMatrix(int M, int N, Random R) { double A[][] = new double[M][N]; for (int i=0; i<N; i++) for (int j=0; j<N; j++) A[i][j] = R.nextDouble(); return A; } public static double[] RandomVector(int N, Random R) { double A[] = new double[N]; for (int i=0; i<N; i++) A[i] = R.nextDouble(); return A; } private static double[] matvec(double A[][], double x[]) { int N = x.length; double y[] = new double[N]; matvec(A, x, y); return y; } private static void matvec(double A[][], double x[], double y[]) { int M = A.length; int N = A[0].length; for (int i=0; i<M; i++) { double sum = 0.0; double Ai[] = A[i]; for (int j=0; j<N; j++) sum += Ai[j] * x[j]; y[i] = sum; } } }
BU-PCM-Testbed/ThermalProfiler
app/src/main/java/jnt/scimark2/kernel.java
Java
mit
7,529
20.474627
85
0.499934
false
'use strict' const reduce = Function.bind.call(Function.call, Array.prototype.reduce); const isEnumerable = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable); const concat = Function.bind.call(Function.call, Array.prototype.concat); const keys = Reflect.ownKeys; if (!Object.values) { Object.values = (O) => reduce(keys(O), (v, k) => concat(v, typeof k === 'string' && isEnumerable(O, k) ? [O[k]] : []), []); } if (!Object.entries) { Object.entries = (O) => reduce(keys(O), (e, k) => concat(e, typeof k === 'string' && isEnumerable(O, k) ? [ [k, O[k]] ] : []), []); } //from //https://medium.com/@_jh3y/throttling-and-debouncing-in-javascript-b01cad5c8edf#.jlqokoxtu //or //https://remysharp.com/2010/07/21/throttling-function-calls function debounce(callback, delay) { let timeout; return function() { const context = this, args = arguments; clearTimeout(timeout); timeout = setTimeout(() => callback.apply(context, args), delay); }; }; function throttle(func, limit) { let inThrottle, lastFunc, throttleTimer; return function() { const context = this, args = arguments; if (inThrottle) { clearTimeout(lastFunc); return lastFunc = setTimeout(function() { func.apply(context, args); inThrottle = false; }, limit); } else { func.apply(context, args); inThrottle = true; return throttleTimer = setTimeout(() => inThrottle = false, limit); } }; }; /*END POLIFILL*/
vitaliiznak/game-fluky_colors
polifill.js
JavaScript
mit
1,634
30.442308
127
0.589963
false
class Admin::DashboardController < AdminAreaController def index #You are entering an area where no project is concerned, so forget about your current project session[:project] = nil end end
atoulme/collaboa-clone
app/controllers/admin/dashboard_controller.rb
Ruby
mit
207
24.875
97
0.748792
false
# 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::DevTestLabs::Mgmt::V2018_09_15 module Models # # Defines values for SourceControlType # module SourceControlType VsoGit = "VsoGit" GitHub = "GitHub" end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/source_control_type.rb
Ruby
mit
375
22.4375
70
0.696
false
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>retro-205 Cardatron Control Unit</title> <!-- /*********************************************************************** * retro-205/webUI D205CardatronControl.html ************************************************************************ * Copyright (c) 2015, Paul Kimpel. * Licensed under the MIT License, see * http://www.opensource.org/licenses/mit-license.php ************************************************************************ * ElectroData/Burroughs Datatron 205 Cardatron Control page. ************************************************************************ * 2015-02-01 P.Kimpel * Original version, from D205ControlConsole.html. ***********************************************************************/ --> <meta name="Author" content="Paul Kimpel"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta http-equiv="Content-Style-Type" content="text/css"> <link id=defaultStyleSheet rel=stylesheet type="text/css" href="D205Common.css"> <link id=consoleStyleSheet rel=stylesheet type="text/css" href="D205CardatronControl.css"> </head> <body id=cardatronControlBody class=deviceBody> <div id=PanelSurface> <div id=InputSetupBtn class=blackButton1>&nbsp;</div> <div id=InputSetupBtnCaption class=caption>INPUT<br>SETUP</div> <div id=ClearBtn class=redButton1>&nbsp;</div> <div id=ClearBtnCaption class=caption>GENERAL<br>CLEAR</div> </div> </body> </html>
pkimpel/retro-205
webUI/D205CardatronControl.html
HTML
mit
1,514
42.285714
90
0.567371
false
# infinite zoom plugin "infinite zoom" is an jQuery-Plugin that creates a nice foto/image show as background on DOM-containers. ## Features * applicable to any DOM-container * adjustable zoom properties * asynchronous image loading (just loads what's needed) * rendering with the high-performance CSS3-transitions ## Requirements * jQuery 1.3 or upwards * a container which must have * a 'overflow:hidden' css style * a 'position' css style * content with * a 'position' css style * a 'z-index' css style greater than 0 ## Install It`s very easy to install: 1. download or clone the current version 2. include the minified version into your code ## Usage Will coming soon! ## License See the "LICENSE" file in the root of the repo.
jtkDvlp/jQuery.infiniteZoom
README.md
Markdown
mit
759
20.685714
104
0.73386
false
<?php use History\Entities\Models\Company; use History\Entities\Models\Question; use History\Entities\Models\Request; use History\Entities\Models\Threads\Comment; use History\Entities\Models\Threads\Thread; use History\Entities\Models\User; use History\Entities\Models\Vote; use League\FactoryMuffin\FactoryMuffin; use League\FactoryMuffin\Faker\Facade; use League\FactoryMuffin\Faker\Faker; /* @var FactoryMuffin $fm */ /** @var Faker $faker */ $faker = Facade::instance(); if (!function_exists('random')) { /** * @param string $class * * @return Closure */ function random($class) { if (!$class::count()) { return 'factory|'.$class; } return function () use ($class) { return $class::pluck('id')->shuffle()->first(); }; } } $fm->define(User::class)->setDefinitions([ 'name' => $faker->userName(), 'full_name' => $faker->name(), 'email' => $faker->email(), 'contributions' => $faker->sentence(), 'company_id' => random(Company::class), 'no_votes' => $faker->randomNumber(1), 'yes_votes' => $faker->randomNumber(1), 'total_votes' => $faker->randomNumber(1), 'approval' => $faker->randomFloat(null, 0, 1), 'success' => $faker->randomFloat(null, 0, 1), 'hivemind' => $faker->randomFloat(null, 0, 1), 'created_at' => $faker->dateTimeThisYear(), 'updated_at' => $faker->dateTimeThisYear(), ]); $fm->define(Request::class)->setDefinitions([ 'name' => $faker->sentence(), 'contents' => $faker->paragraph(), 'link' => $faker->url(), 'condition' => $faker->boolean(2 / 3), 'approval' => $faker->randomFloat(null, 0, 1), 'status' => $faker->numberBetween(0, 5), 'created_at' => $faker->dateTimeThisDecade(), 'updated_at' => $faker->dateTimeThisDecade(), ])->setCallback(function (Request $request) { $users = User::pluck('id')->shuffle()->take(2); $request->authors()->sync($users->all()); }); $fm->define(Thread::class)->setDefinitions([ 'name' => $faker->sentence(), 'user_id' => random(User::class), 'request_id' => random(Request::class), 'created_at' => $faker->dateTimeThisDecade(), 'updated_at' => $faker->dateTimeThisDecade(), ]); $fm->define(Comment::class)->setDefinitions([ 'name' => $faker->sentence(), 'contents' => $faker->paragraph(), 'xref' => $faker->randomNumber(1), 'created_at' => $faker->dateTimeThisYear(), 'updated_at' => $faker->dateTimeThisYear(), 'user_id' => random(User::class), 'thread_id' => random(Thread::class), ]); $fm->define(Question::class)->setDefinitions([ 'name' => $faker->sentence(), 'choices' => ['Yes', 'No'], 'approval' => $faker->randomFloat(null, 0, 1), 'passed' => $faker->boolean(), 'request_id' => random(Request::class), 'created_at' => $faker->dateTimeThisYear(), 'updated_at' => $faker->dateTimeThisYear(), ]); $fm->define(Vote::class)->setDefinitions([ 'choice' => $faker->numberBetween(1, 2), 'question_id' => random(Question::class), 'user_id' => random(User::class), 'created_at' => $faker->dateTimeThisYear(), 'updated_at' => $faker->dateTimeThisYear(), ]); $fm->define(Company::class)->setDefinitions([ 'name' => $faker->word(), 'representation' => $faker->randomNumber(1), ]);
madewithlove/why-cant-we-have-nice-things
resources/factories/factories.php
PHP
mit
3,327
30.685714
59
0.60535
false
import {Routes} from '@angular/router'; import {JournalComponent} from '../journal/journal.component'; export const LUOO_APP_ROUTERS: Routes = [ {path: 'journal', component: JournalComponent} ]
Tneciv/Poseidon
frontend/src/app/common/routers.ts
TypeScript
mit
197
31.833333
62
0.736041
false
<template name="testWelcome"> <h2 class="center-align">Welcome Page</h2> <div class="col-sm-6 col-md-offset-4 welcome-introduction"> <p>Welcome to Fram^ Online Testing</p> <p>You have {{testingDuration}} minutes to complete your testting</p> <p>Notice 1</p> <p>Notice 2</p> <p>Notice 3</p> <p>......</p> <p>...</p> <p>ARE YOU READY ???</p> </div> <div class="center-align col-sm-12"> <button type="button" data-process-id="{{process._id}}" data-interview-index="{{this.index}}" class="btn btn-primary startTestingBtn">LET'S GO !!</button></div> </template>
danielbk08/hrtool
client/onlineTests/welcome/welcome.html
HTML
mit
605
42.285714
201
0.618182
false
// This file is part of SWGANH which is released under the MIT license. // See file LICENSE or go to http://swganh.com/LICENSE #include "swganh_core/gamesystems/gamesystems_service_binding.h" BOOST_PYTHON_MODULE(py_gamesystems) { docstring_options local_docstring_options(true, true, false); exportGameSystemsService(); }
anhstudios/swganh
src/swganh_core/GameSystems/GameSystems_service_binding.cc
C++
mit
332
29.272727
71
0.762048
false
var htmlparser = require('htmlparser2'); var _ = require('lodash'); var ent = require('ent'); module.exports = sanitizeHtml; function sanitizeHtml(html, options) { var result = ''; if (!options) { options = sanitizeHtml.defaults; } else { _.defaults(options, sanitizeHtml.defaults); } // Tags that contain something other than HTML. If we are not allowing // these tags, we should drop their content too. For other tags you would // drop the tag but keep its content. var nonTextTagsMap = { script: true, style: true }; var allowedTagsMap = {}; _.each(options.allowedTags, function(tag) { allowedTagsMap[tag] = true; }); var selfClosingMap = {}; _.each(options.selfClosing, function(tag) { selfClosingMap[tag] = true; }); var allowedAttributesMap = {}; _.each(options.allowedAttributes, function(attributes, tag) { allowedAttributesMap[tag] = {}; _.each(attributes, function(name) { allowedAttributesMap[tag][name] = true; }); }); var depth = 0; var skipMap = {}; var skipText = false; var parser = new htmlparser.Parser({ onopentag: function(name, attribs) { var skip = false; if (!_.has(allowedTagsMap, name)) { skip = true; if (_.has(nonTextTagsMap, name)) { skipText = true; } skipMap[depth] = true; } depth++; if (skip) { // We want the contents but not this tag return; } result += '<' + name; if (_.has(allowedAttributesMap, name)) { _.each(attribs, function(value, a) { if (_.has(allowedAttributesMap[name], a)) { result += ' ' + a; if ((a === 'href') || (a === 'src')) { if (naughtyHref(value)) { return; } } if (value.length) { // Values are ALREADY escaped, calling escapeHtml here // results in double escapes result += '="' + value + '"'; } } }); } if (_.has(selfClosingMap, name)) { result += " />"; } else { result += ">"; } }, ontext: function(text) { if (skipText) { return; } // It is NOT actually raw text, entities are already escaped. // If we call escapeHtml here we wind up double-escaping. result += text; }, onclosetag: function(name) { skipText = false; depth--; if (skipMap[depth]) { delete skipMap[depth]; return; } if (_.has(selfClosingMap, name)) { // Already output /> return; } result += "</" + name + ">"; } }); parser.write(html); parser.end(); return result; function escapeHtml(s) { if (s === 'undefined') { s = ''; } if (typeof(s) !== 'string') { s = s + ''; } return s.replace(/\&/g, '&amp;').replace(/</g, '&lt;').replace(/\>/g, '&gt;').replace(/\"/g, '&quot;'); } function naughtyHref(href) { // So we don't get faked out by a hex or decimal escaped javascript URL #1 href = ent.decode(href); // Browsers ignore character codes of 32 (space) and below in a surprising // number of situations. Start reading here: // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab href = href.replace(/[\x00-\x20]+/, ''); // Case insensitive so we don't get faked out by JAVASCRIPT #1 var matches = href.match(/^([a-zA-Z]+)\:/); if (!matches) { // No scheme = no way to inject js (right?) return false; } var scheme = matches[1].toLowerCase(); return (!_.contains(['http', 'https', 'ftp', 'mailto' ], scheme)); } } // Defaults are accessible to you so that you can use them as a starting point // programmatically if you wish sanitizeHtml.defaults = { allowedTags: [ 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div', 'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre' ], allowedAttributes: { a: [ 'href', 'name', 'target' ], // We don't currently allow img itself by default, but this // would make sense if we did img: [ 'src' ] }, // Lots of these won't come up by default because we don't allow them selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ] };
effello/cms
node_modules/apostrophe/node_modules/sanitize-html/index.js
JavaScript
mit
4,431
29.558621
216
0.547732
false
import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { ExtendComponent } from './src/components/extend.component'; import { SubExtendComponent } from './src/components/sub-extend.component'; const extendRoutes: Routes = [ { path: '', component: ExtendComponent, }, { path: 'main', component: ExtendComponent, }, { path: 'sub', component: SubExtendComponent }, ]; @NgModule({ imports: [ RouterModule.forChild(extendRoutes) ], exports: [ RouterModule ] }) export class ExtendRoutingModule {}
seveves/ng2-lib-test
@lib-test/extend/extend.routes.ts
TypeScript
mit
595
19.551724
75
0.663866
false
namespace UrlBuilderTests { using System; using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; using Se.Url; [TestClass] public class QueryParamTest { [TestMethod] public void DefaultQueryParam() { var url = new UrlBuilder(); Assert.AreEqual("http://localhost/", url.ToString()); } [TestMethod] public void SetQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app"); url.SetQueryParam("nid", 123); var param = url.GetQueryParam("nid"); Assert.AreEqual("123", param.ToString()); } [TestMethod] public void SetExistingQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app?nid=123"); url.SetQueryParam("nid", 321); var param = url.GetQueryParam("nid"); Assert.AreEqual("321", param.ToString()); } [TestMethod] public void SetQueryParamToNull() { var url = new UrlBuilder("http://www.shoutem.com/app"); url.SetQueryParam("nid", null); var param = url.GetQueryParam("nid"); Assert.AreEqual(null, param); } [TestMethod] public void SetQueryParamToEmtpy() { var url = new UrlBuilder("http://www.shoutem.com/app"); url.SetQueryParam("nid", string.Empty); var param = url.GetQueryParam("nid"); Assert.AreEqual(string.Empty, param.ToString()); } [TestMethod] public void AppendQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app"); url.AppendQueryParam("nid", 123); var param = url.GetQueryParam("nid"); Assert.AreEqual("123", param.ToString()); } [TestMethod] public void AppendExistingQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app"); url.SetQueryParam("role", "moderator"); url.AppendQueryParam("role", "admin"); var paramList = url.GetQueryParam("role") as IList<object>; var param1 = paramList[0]; var param2 = paramList[1]; Assert.AreEqual("moderator", param1.ToString()); Assert.AreEqual("admin", param2.ToString()); } [TestMethod] public void RemoveQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app?nid=123"); url.RemoveQueryParam("nid"); Assert.AreEqual(false, url.ContainsQueryParam("nid")); } [TestMethod] public void SetQueryParams() { var url = new UrlBuilder("http://www.shoutem.com/app"); var dictParams = new Dictionary<string, object> {{"nid", 123}, {"role", "admin"}}; url.SetQueryParams(dictParams); var param1 = url.GetQueryParam("nid"); var param2 = url.GetQueryParam("role"); Assert.AreEqual("123", param1.ToString()); Assert.AreEqual("admin", param2.ToString()); } [TestMethod] public void RemoveQueryParams() { var url = new UrlBuilder("http://www.shoutem.com/app?nid=123&role=admin"); var listParams = new List<string> {"nid", "role"}; url.RemoveQueryParams(listParams); Assert.AreEqual(false, url.ContainsQueryParam("nid")); Assert.AreEqual(false, url.ContainsQueryParam("role")); } [TestMethod] public void SetMultipleQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app?role=moderator&role=admin"); var paramList = url.GetQueryParam("role") as IList<object>; var param1 = paramList[0]; var param2 = paramList[1]; Assert.AreEqual("moderator", param1.ToString()); Assert.AreEqual("admin", param2.ToString()); } [TestMethod] public void RemoveMultipleQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app?role=moderator&role=admin"); url.RemoveQueryParam("role"); Assert.AreEqual(false, url.ContainsQueryParam("role")); } [TestMethod] public void GetQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app?nid=123&role=admin"); var param = url.GetQueryParam("role"); Assert.AreEqual("admin", param.ToString()); } [TestMethod] public void GetQueryParamNames() { var url = new UrlBuilder("http://www.shoutem.com/app"); var dictParams = new Dictionary<string, object> { { "nid", 123 }, { "role", "admin" } }; url.SetQueryParams(dictParams); var paramNames = url.GetParamNames(); CollectionAssert.AreEqual(dictParams.Keys, paramNames); } [TestMethod] public void ContainsQueryParam() { var url = new UrlBuilder("http://www.shoutem.com/app?nid=123&role=admin"); Assert.AreEqual(true, url.ContainsQueryParam("role")); } [TestMethod] [ExpectedException(typeof(ArgumentNullException))] public void ContainsQueryParamNull() { var url = new UrlBuilder("http://www.shoutem.com/app?nid=123&role=admin"); Assert.AreEqual(false, url.ContainsQueryParam(null)); } } }
shoutem/UrlBuilder
UrlBuilderTests/QueryParamTest.cs
C#
mit
5,607
30.488764
100
0.557895
false
(function(){ 'use strict' angular .module("jobDetail") .service("jobDetailService",jobDetailService); jobDetailService.$inject = ['apiService','apiOptions']; function jobDetailService(apiService,apiOptions) { var jobId; this.getJobDetail=function(jobId) { // return "ok"; return apiService.get("job/"+jobId); }; }; })();
dozgunyal/ang-oboy
app/job-detail/job-detail.service.js
JavaScript
mit
351
14.954545
56
0.672365
false
/** * Copyright MaDgIK Group 2010 - 2015. */ package madgik.exareme.worker.art.container.job; import madgik.exareme.worker.art.container.ContainerJob; import madgik.exareme.worker.art.container.ContainerJobType; import madgik.exareme.worker.art.executionEngine.session.PlanSessionReportID; /** * @author heraldkllapi */ public class TableTransferJob implements ContainerJob { public final PlanSessionReportID sessionReportID; public TableTransferJob(PlanSessionReportID sessionReportID) { this.sessionReportID = sessionReportID; } @Override public ContainerJobType getType() { return ContainerJobType.dataTransfer; } }
madgik/exareme
Exareme-Docker/src/exareme/exareme-worker/src/main/java/madgik/exareme/worker/art/container/job/TableTransferJob.java
Java
mit
667
26.791667
77
0.769115
false
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About SwansonCoin</source> <translation>Sobre o SwansonCoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;SwansonCoin&lt;/b&gt; version</source> <translation>Versão do &lt;b&gt;SwansonCoin&lt;/b&gt;</translation> </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>⏎ Este é um software experimental.⏎ ⏎ Distribuido sob a licença de software MIT/X11, veja o arquivo anexo COPYING ou http://www.opensource.org/licenses/mit-license.php.⏎ ⏎ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software de criptografia escrito por Eric Young (eay@cryptsoft.com) e sofware UPnP escrito por Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <location line="+0"/> <source>The SwansonCoin developers</source> <translation>Desenvolvedores do SwansonCoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Catálogo de endereços</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Clique duas vezes para editar o endereço ou o etiqueta</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Criar um novo endereço</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copie o endereço selecionado para a área de transferência do sistema</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Novo endereço</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your SwansonCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Estes são os seus endereços SwansonCoin para receber pagamentos. Você pode querer enviar um endereço diferente para cada remetente, para acompanhar quem está pagando.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Mostrar &amp;QR Code</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a SwansonCoin address</source> <translation>Assine uma mensagem para provar que você é dono de um endereço SwansonCoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>&amp;Assinar Mensagem</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Excluir os endereços selecionados da lista</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados na aba atual para um arquivo</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified SwansonCoin address</source> <translation>Verificar mensagem para se assegurar que ela foi assinada pelo dono de um endereço SwansonCoin específico.</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Excluir</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your SwansonCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Estes são os seus endereços SwansonCoin para receber pagamentos. Você pode querer enviar um endereço diferente para cada remetente, para acompanhar quem está pagando.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;Etiqueta</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Enviar bit&amp;coins</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Exportar Catálogo de Endereços</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Não foi possível gravar no arquivo %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Janela da Frase de Segurança</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Digite a frase de segurança</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova frase de segurança</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita a nova frase de segurança</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <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>Digite a nova frase de seguraça da sua carteira. &lt;br/&gt; Por favor, use uma frase de &lt;b&gt;10 ou mais caracteres aleatórios,&lt;/b&gt; ou &lt;b&gt;oito ou mais palavras.&lt;/b&gt;</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Criptografar carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Esta operação precisa de sua frase de segurança para desbloquear a carteira.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Esta operação precisa de sua frase de segurança para descriptografar a carteira.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Descriptografar carteira</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Alterar frase de segurança</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Digite a frase de segurança antiga e nova para a carteira.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmar criptografia da carteira</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR SWANSONCOINS&lt;/b&gt;!</source> <translation>Aviso: Se você criptografar sua carteira e perder sua senha, você vai &lt;b&gt;perder todos os seus SWANSONCOINS!&lt;/b&gt;</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Tem certeza de que deseja criptografar sua carteira?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANTE: Qualquer backup prévio que você tenha feito do seu arquivo wallet deve ser substituído pelo novo e encriptado arquivo wallet gerado. Por razões de segurança, qualquer backup do arquivo wallet não criptografado se tornará inútil assim que você começar a usar uma nova carteira criptografada.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Cuidado: A tecla Caps Lock está ligada!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Carteira criptografada</translation> </message> <message> <location line="-56"/> <source>SwansonCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your swansoncoins from being stolen by malware infecting your computer.</source> <translation>O SwansonCoin irá fechar agora para finalizar o processo de encriptação. Lembre-se de que encriptar sua carteira não protege totalmente suas swansoncoins de serem roubadas por malwares que tenham infectado o seu computador.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>A criptografia da carteira falhou</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>A criptografia da carteira falhou devido a um erro interno. Sua carteira não estava criptografada.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>A frase de segurança fornecida não confere.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>A abertura da carteira falhou</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>A frase de segurança digitada para a descriptografia da carteira estava incorreta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>A descriptografia da carteira falhou</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>A frase de segurança da carteira foi alterada com êxito.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>&amp;Assinar Mensagem...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Sincronizando com a rede...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Visão geral</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Mostrar visão geral da carteira</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transações</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Navegar pelo histórico de transações</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Editar a lista de endereços e rótulos</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Mostrar a lista de endereços para receber pagamentos</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>S&amp;air</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Sair da aplicação</translation> </message> <message> <location line="+4"/> <source>Show information about SwansonCoin</source> <translation>Mostrar informação sobre SwansonCoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Sobre &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostrar informações sobre o Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opções...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Criptografar Carteira...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup Carteira...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Mudar frase de segurança...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importando blocos do disco...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Reindexando blocos no disco...</translation> </message> <message> <location line="-347"/> <source>Send coins to a SwansonCoin address</source> <translation>Enviar moedas para um endereço swansoncoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for SwansonCoin</source> <translation>Modificar opções de configuração para swansoncoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Fazer cópia de segurança da carteira para uma outra localização</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Mudar a frase de segurança utilizada na criptografia da carteira</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Janela de &amp;Depuração</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir console de depuração e diagnóstico</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensagem...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>SwansonCoin</source> <translation>SwansonCoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Enviar</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Receber</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Endereços</translation> </message> <message> <location line="+22"/> <source>&amp;About SwansonCoin</source> <translation>&amp;Sobre o SwansonCoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Exibir/Ocultar</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Mostrar ou esconder a Janela Principal.</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Criptografar as chaves privadas que pertencem à sua carteira</translation> </message> <message> <location line="+7"/> <source>Sign messages with your SwansonCoin addresses to prove you own them</source> <translation>Assine mensagems com seus endereços SwansonCoin para provar que você é dono deles</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified SwansonCoin addresses</source> <translation>Verificar mensagens para se assegurar que elas foram assinadas pelo dono de Endereços SwansonCoin específicos</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Arquivo</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Configurações</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Ajuda</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barra de ferramentas</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>SwansonCoin client</source> <translation>Cliente SwansonCoin</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to SwansonCoin network</source> <translation><numerusform>%n conexão ativa na rede SwansonCoin</numerusform><numerusform>%n conexões ativas na rede SwansonCoin</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>Processado %1 de %2 blocos (estimado) de histórico de transações.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Processado %1 blocos do histórico de transações.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 atrás</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Último bloco recebido foi gerado %1 atrás.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transações após isso ainda não estão visíveis.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Cuidado</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Informação</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>A transação está acima do tamanho limite. Você ainda enviar ela com uma taxa de %1, que vai para os nós processam sua transação e ajuda a manter a rede. Você quer pagar a taxa?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Atualizado</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Recuperando o atraso ...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Confirmar taxa de transação</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transação enviada</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transação recebida</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantidade: %2 Tipo: %3 Endereço: %4</translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Manipulação de URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid SwansonCoin address or malformed URI parameters.</source> <translation>URI não pode ser decodificado! Isso pode ter sido causado por um endereço SwansonCoin inválido ou por parâmetros URI malformados.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. SwansonCoin can no longer continue safely and will quit.</source> <translation>Um erro fatal ocorreu. SwansonCoin não pode continuar em segurança e irá fechar.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Alerta da Rede</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Endereço</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Etiqueta</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>A etiqueta associada a esse endereço do catálogo</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Endereço</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>O endereço associado à essa entrada do seu catálogo de endereços. Isso só pode ser modificado para endereço de envio.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Novo endereço de recebimento</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Novo endereço de envio</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar endereço de recebimento</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar endereço de envio</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>O endereço digitado &quot;%1&quot; já se encontra no catálogo de endereços.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid SwansonCoin address.</source> <translation>O endereço digitado &quot;%1&quot; não é um endereço SwansonCoin válido.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Não foi possível destravar a carteira.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>A geração de nova chave falhou.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>SwansonCoin-Qt</source> <translation>SwansonCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versão</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>opções da linha de comando</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>opções da UI</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Escolher língua, por exemplo &quot;de_DE&quot; (padrão: localização do sistema)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Inicializar minimizado</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Mostrar tela inicial ao ligar (padrão: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opções</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Pagar taxa de &amp;transação</translation> </message> <message> <location line="+31"/> <source>Automatically start SwansonCoin after logging in to the system.</source> <translation>Iniciar SwansonCoin automaticamente após se logar no sistema.</translation> </message> <message> <location line="+3"/> <source>&amp;Start SwansonCoin on system login</source> <translation>Iniciar SwansonCoin no login do sistema</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Redefinir todas as opções do cliente para opções padrão.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Redefinir opções</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>Rede</translation> </message> <message> <location line="+6"/> <source>Automatically open the SwansonCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Abrir as portas do cliente SwansonCoin automaticamente no roteador. Isto só funcionará se seu roteador suportar UPnP e esta função estiver habilitada.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear porta usando &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the SwansonCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Conectar à rede SwansonCoin através de um proxy SOCKS (ex. quando estiver usando através do Tor)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Conectar através de um proxy SOCKS:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP do proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Endereço &amp;IP do proxy (ex. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta do serviço de proxy (ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versão do SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versão do proxy SOCKS (ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Janela</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Mostrar apenas um ícone na bandeja ao minimizar a janela.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar para a bandeja em vez da barra de tarefas.</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimizar em vez de sair do aplicativo quando a janela for fechada. Quando esta opção é escolhida, o aplicativo só será fechado selecionando Sair no menu Arquivo.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar ao sair</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Mostrar</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Língua da interface com usuário:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting SwansonCoin.</source> <translation>A língua da interface com usuário pode ser escolhida aqui. Esta configuração só surtirá efeito após reiniciar o SwansonCoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unidade usada para mostrar quantidades:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Escolha a unidade padrão de subdivisão para interface mostrar quando enviar swansoncoins.</translation> </message> <message> <location line="+9"/> <source>Whether to show SwansonCoin addresses in the transaction list or not.</source> <translation>Mostrar ou não endereços SwansonCoin na lista de transações.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Mostrar en&amp;dereços na lista de transações</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Aplicar</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>padrão</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Confirmar redefinição de opções</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Algumas configurações requerem reinicialização para surtirem efeito.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Você quer continuar?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Cuidado</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting SwansonCoin.</source> <translation>Esta configuração surtirá efeito após reinicializar o aplicativo SwansonCoin</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>O endereço proxy fornecido é inválido.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the SwansonCoin network after a connection is established, but this process has not completed yet.</source> <translation>A informação mostrada pode estar desatualizada. Sua carteira sincroniza automaticamente com a rede SwansonCoin depois que a conexão é estabelecida, mas este processo pode não estar completo ainda.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Não confirmadas:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Imaturo:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Saldo minerado que ainda não maturou</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transações recentes&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Seu saldo atual</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Total de transações ainda não confirmadas, e que ainda não contam no saldo atual</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>fora de sincronia</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start swansoncoin: click-to-pay handler</source> <translation>Não foi possível iniciar swansoncoin: manipulador clique-para-pagar</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Janela do código QR</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Requisitar Pagamento</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Etiqueta:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Mensagem:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Salvar como...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Erro ao codigicar o URI em código QR</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>A quantidade digitada é inválida, favor verificar.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI resultante muito longa. Tente reduzir o texto do rótulo ou da mensagem.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Salvar código QR</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Imagens PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nome do cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versão do cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informação</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Usando OpenSSL versão</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Horário de inicialização</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Número de conexões</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Na rede de teste</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Corrente de blocos</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Quantidade atual de blocos</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Total estimado de blocos</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Horário do último bloco</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Opções da linha de comando</translation> </message> <message> <location line="+7"/> <source>Show the SwansonCoin-Qt help message to get a list with possible SwansonCoin command-line options.</source> <translation>Mostrar mensagem de ajuda do SwansonCoin-Qt para obter uma lista com possíveis opções da linha de comando do SwansonCoin.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Mostrar</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Data do &apos;build&apos;</translation> </message> <message> <location line="-104"/> <source>SwansonCoin - Debug window</source> <translation>SwansonCoin - Janela de Depuração</translation> </message> <message> <location line="+25"/> <source>SwansonCoin Core</source> <translation>Núcleo SwansonCoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Arquivo de log de Depuração</translation> </message> <message> <location line="+7"/> <source>Open the SwansonCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Abrir o arquivo de log de depuração do SwansonCoin do diretório atual de dados. Isso pode levar alguns segundos para arquivos de log grandes.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Limpar console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the SwansonCoin RPC console.</source> <translation>Bem-vindo ao console SwansonCoin RPC.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use as setas para cima e para baixo para navegar pelo histórico, e &lt;b&gt;Ctrl-L&lt;/b&gt; para limpar a tela.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Digite &lt;b&gt;help&lt;/b&gt; para uma visão geral dos comandos disponíveis.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Enviar dinheiro</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Enviar para vários destinatários de uma só vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adicionar destinatário</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Remover todos os campos da transação</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirmar o envio</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; para %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirmar envio de dinheiro</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Você tem certeza que deseja enviar %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>e</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>O endereço do destinatário não é válido, favor verificar.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>A quantidade a ser paga precisa ser maior que 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>A quantidade excede seu saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>O total excede seu saldo quando uma taxa de transação de %1 é incluída.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Endereço duplicado: pode-se enviar para cada endereço apenas uma vez por transação.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Erro: Criação da transação falhou!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Erro: A transação foi rejeitada. Isso pode acontecer se alguns dos swansoncoins de sua carteira já haviam sido gastos, por exemplo se você usou uma cópia do arquivo wallet.dat e alguns swansoncoins foram gastos na cópia mas não foram marcados como gastos aqui.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Q&amp;uantidade:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Pagar &amp;Para:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</source> <translation>O endereço para onde enviar o pagamento (ex. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Digite uma etiqueta para este endereço para adicioná-lo ao catálogo de endereços</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Escolha um endereço do seu catálogo</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Remover este destinatário</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a SwansonCoin address (e.g. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</source> <translation>Digite um endereço SwansonCoin (exemplo: RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Assinaturas - Assinar / Verificar uma mensagem</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Assinar Mensagem</translation> </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>Você pode assinar mensagens com seus endereços para provar que você é o dono deles. Seja cuidadoso para não assinar algo vago, pois ataques de pishing podem tentar te enganar para dar sua assinatura de identidade para eles. Apenas assine afirmações completamente detalhadas com as quais você concorda.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</source> <translation>Endereço a ser usado para assinar a mensagem (e.g. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Escolha um endereço do catálogo</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Entre a mensagem que você quer assinar aqui</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Assinatura</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar a assinatura para a área de transferência do sistema</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this SwansonCoin address</source> <translation>Assinar mensagem para provar que você é dono deste endereço SwansonCoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </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>Forneça o endereço da assinatura, a mensagem (se assegure que você copiou quebras de linha, espaços, tabs, etc. exatamente) e a assinatura abaixo para verificar a mensagem. Cuidado para não ler mais na assinatura do que está escrito na mensagem propriamente, para evitar ser vítima de uma ataque do tipo &quot;man-in-the-middle&quot;.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</source> <translation>O endereço usado para assinar a mensagem (ex. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified SwansonCoin address</source> <translation>Verificar mensagem para se assegurar que ela foi assinada pelo dono de um endereço SwansonCoin específico.</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Verificar %Mensagem</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a SwansonCoin address (e.g. RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</source> <translation>Digite um endereço SwansonCoin (exemplo: RC74svrUSLCmjPGQrc4sYvAxzse7tpA7hE)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clique em &quot;Assinar Mensagem&quot; para gerar a assinatura</translation> </message> <message> <location line="+3"/> <source>Enter SwansonCoin signature</source> <translation>Entre com a assinatura SwansonCoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>O endereço fornecido é inválido.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Por favor, verifique o endereço e tente novamente.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>O endereço fornecido não se refere a uma chave.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Destravamento da Carteira foi cancelado.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>A chave privada para o endereço fornecido não está disponível.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Assinatura da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensagem assinada.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>A assinatura não pode ser decodificada.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Por favor, verifique a assinatura e tente novamente.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>A assinatura não corresponde ao &quot;resumo da mensagem&quot;.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verificação da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensagem verificada.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The SwansonCoin developers</source> <translation>Desenvolvedores do SwansonCoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/não confirmadas</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmações</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, difundir atráves de %n nó</numerusform><numerusform>, difundir atráves de %n nós</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Fonte</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Gerados</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>seu próprio endereço</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>etiqueta</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>matura em mais %n bloco</numerusform><numerusform>matura em mais %n blocos</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>não aceito</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Taxa de transação</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Valor líquido</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensagem</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Comentário</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID da transação</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 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>SwansonCoins gerados precisam maturar por 120 blocos antes de serem gastos. Quando você gera este bloco, ele é difundido na rede para ser adicionado ao blockchain. Se ele falhar ao ser acrescentado no blockchain, seu estado mudará para &quot;não aceito&quot; e não poderá ser gasto. Isso pode ocasionamente acontecer se outro nó gerou um bloco poucos segundos antes do seu.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informação de depuração</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transação</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Entradas</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadeiro</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, ainda não foi propagada na rede com sucesso.</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para mais %n bloco</numerusform><numerusform>Abrir para mais %n blocos</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>desconhecido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalhes da transação</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Este painel mostra uma descrição detalhada da transação</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para mais %n bloco</numerusform><numerusform>Abrir para mais %n blocos</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Offline (%1 confirmações)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Não confirmado (%1 of %2 confirmações)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmado (%1 confirmações)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Saldo minerado vai estar disponível quando ele maturar em mais %n bloco</numerusform><numerusform>Saldo minerado vai estar disponível quando ele maturar em mais %n blocos</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloco não foi recebido por nenhum outro participante da rede e provavelmente não será aceito!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Gerado mas não aceito</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recebido de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pagamento para você mesmo</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minerado</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status da transação. Passe o mouse sobre este campo para mostrar o número de confirmações.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Data e hora em que a transação foi recebida.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transação.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Endereço de destino da transação.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantidade debitada ou creditada ao saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Todos</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hoje</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mês</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mês passado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este ano</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervalo...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Para você mesmo</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minerado</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Outro</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Procure um endereço ou etiqueta</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantidade mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar ID da transação</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar etiqueta</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalhes da transação</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Exportar Dados das Transações</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Não foi possível gravar no arquivo %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervalo: </translation> </message> <message> <location line="+8"/> <source>to</source> <translation>para</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Send Coins</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados na aba atual para um arquivo</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Fazer cópia de segurança da Carteira</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Dados da Carteira (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Cópia de segurança Falhou</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Houve um erro ao tentar salvar os dados da carteira para uma nova localização.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Backup feito com sucesso</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Os dados da carteira foram salvos com sucesso na nova localização</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>SwansonCoin version</source> <translation>Versão do SwansonCoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or swansoncoind</source> <translation>Enviar comando para -server ou swansoncoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Lista de comandos</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Obtenha ajuda sobre um comando</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Opções:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: swansoncoin.conf)</source> <translation>Especifique um arquivo de configurações (padrão: swansoncoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: swansoncoind.pid)</source> <translation>Especifique um arquivo de pid (padrão: swansoncoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar diretório de dados</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Definir o tamanho do cache do banco de dados em megabytes (padrão: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Procurar por conexões em &lt;port&gt; (padrão: 9333 ou testnet:19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manter no máximo &lt;n&gt; conexões aos peers (padrão: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conectar a um nó para receber endereços de participantes, e desconectar.</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Especificar seu próprio endereço público</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Limite para desconectar peers mal comportados (padrão: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos para impedir que peers mal comportados reconectem (padrão: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Escutar conexões JSON-RPC na porta &lt;porta&gt; (padrão: 9332 ou testnet: 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceitar linha de comando e comandos JSON-RPC</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Rodar em segundo plano como serviço e aceitar comandos</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Usar rede de teste</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceitar conexões externas (padrão: 1 se opções -proxy ou -connect não estiverem presentes)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=swansoncoinrpc 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;SwansonCoin Alert&quot; admin@foo.com </source> <translation>%s, você deve especificar uma senha rpcpassword no arquivo de configuração:⏎ %s⏎ É recomendado que você use a seguinte senha aleatória:⏎ rpcuser=swansoncoinrpc⏎ rpcpassword=%s⏎ (você não precisa lembrar esta senha)⏎ O nome de usuário e a senha NÃO PODEM ser os mesmos.⏎ Se o arquivo não existir, crie um com permissão de leitura apenas para o dono.⏎ É recomendado também definir um alertnotify para que você seja notificado de problemas;⏎ por exemplo: alertnotify=echo %%s | mail -s &quot;SwansonCoin Alert&quot; admin@foo.com⏎ </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv6, voltando ao IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Vincular ao endereço fornecido e sempre escutar nele. Use a notação [host]:port para IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. SwansonCoin is probably already running.</source> <translation>Não foi possível obter exclusividade de escrita no endereço %s. O SwansonCoin provavelmente já está rodando.</translation> </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>Erro: A transação foi rejeitada. Isso pode acontecer se alguns dos swansoncoins de sua carteira já haviam sido gastos, por exemplo se você usou uma cópia do arquivo wallet.dat e alguns swansoncoins foram gastos na cópia mas não foram marcados como gastos aqui.</translation> </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>Erro: Esta transação requer uma taxa de transação de pelo menos %s, por causa sua quantidade, complexidade ou uso de dinheiro recebido recentemente.</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Executar comando quando um alerta relevante for recebido (%s no comando será substituído pela mensagem)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Executar comando quando uma transação da carteira mudar (%s no comando será substituído por TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Determinar tamanho máximo de transações de alta-prioridade/baixa-taxa em bytes (padrão: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Este pode ser um build de teste pré-lançamento - use por sua conta e risco - não use para mineração ou aplicações de comércio.</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Cuidado: valor de -paytxfee escolhido é muito alto! Este é o valor da taxa de transação que você irá pagar se enviar a transação.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Cuidado: Transações mostradas podem não estar corretas! Você pode precisar atualizar, ou outros nós podem precisar atualizar o cliente.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong SwansonCoin will not work properly.</source> <translation>Cuidado: Por favor, verifique que a data e hora do seu computador estão corretas! If o seu relógio estiver errado, o SwansonCoin não irá funcionar corretamente.</translation> </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>Cuidado: erro ao ler arquivo wallet.dat! Todas as chaves foram lidas corretamente, mas dados transações e do catálogo de endereços podem estar faltando ou estar incorretas.</translation> </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>Aviso: wallet.dat corrompido, dados recuperados! Arquivo wallet.dat original salvo como wallet.{timestamp}.bak em %s; se seu saldo ou transações estiverem incorretos, você deve restauras o backup.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tentar recuperar chaves privadas de um arquivo wallet.dat corrompido</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Opções de criação de blocos:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Conectar apenas a nó(s) específico(s)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Detectado Banco de dados de blocos corrompido</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descobrir os próprios endereços IP (padrão: 1 quando no modo listening e opção -externalip não estiver presente)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Você quer reconstruir o banco de dados de blocos agora?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Erro ao inicializar banco de dados de blocos</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Erro ao inicializar ambiente de banco de dados de carteira %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Erro ao carregar banco de dados de blocos</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Erro ao abrir banco de dados de blocos</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Erro: Espaço em disco insuficiente!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Erro: Carteira travada, impossível criar transação!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Erro: erro de sistema</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Falha ao escutar em qualquer porta. Use -listen=0 se você quiser isso.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Falha ao ler informação de bloco</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Falha ao ler bloco</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Falha ao sincronizar índice de blocos</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Falha ao escrever índice de blocos</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Falha ao escrever informações de bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Falha ao escrever bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Falha ao escrever informções de arquivo</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Falha ao escrever banco de dados de moedas</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Falha ao escrever índice de transações</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Falha ao escrever dados para desfazer ações</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Procurar pares usando consulta de DNS (padrão: 1 a menos que a opção -connect esteja presente)</translation> </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>Quantos blocos checar ao inicializar (padrão: 288, 0 = todos)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Quão minuciosa é a verificação dos blocos (0-4, padrão: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruir índice de blockchain a partir dos arquivos atuais blk000??.dat</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Defina o número de threads de script de verificação. (Padrão: 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Verificando blocos...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verificando carteira...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importar blocos de um arquivo externo blk000??.dat</translation> </message> <message> <location line="-76"/> <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="+77"/> <source>Information</source> <translation>Informação</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Endereço -tor inválido: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <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>Manter índice completo de transações (padrão: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Buffer máximo de recebimento por conexão, &lt;n&gt;*1000 bytes (padrão: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Buffer máximo de envio por conexão, &lt;n&gt;*1000 bytes (padrão: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Apenas aceitar cadeia de blocos correspondente a marcas de verificação internas (padrão: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Apenas conectar em nós na rede &lt;net&gt; (IPv4, IPv6, ou Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Mostrar informações extras de depuração. Implica em outras opções -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Mostrar informações extras de depuração da rede</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Pré anexar a saída de debug com estampa de tempo</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the SwansonCoin Wiki for SSL setup instructions)</source> <translation>Opções SSL: (veja a Wiki do SwansonCoin para instruções de configuração SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Escolher versão do proxy socks a ser usada (4-5, padrão: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Mandar informação de trace/debug para o console em vez de para o arquivo debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Mandar informação de trace/debug para o debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Determinar tamanho máximo de bloco em bytes (padrão: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Determinar tamanho mínimo de bloco em bytes (padrão: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Encolher arquivo debug.log ao iniciar o cliente (padrão 1 se opção -debug não estiver presente)</translation> </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>Especifique o tempo limite (timeout) da conexão em milissegundos (padrão: 5000) </translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Erro de sistema:</translation> </message> <message> <location line="+4"/> <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="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para mapear porta de escuta (padrão: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para mapear porta de escuta (padrão: 1 quando estiver escutando)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Usar proxy para alcançar serviços escondidos (padrão: mesmo que -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nome de usuário para conexões JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Cuidado</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Cuidado: Esta versão está obsoleta, atualização exigida!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Você precisa reconstruir os bancos de dados usando -reindex para mudar -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrompido, recuperação falhou</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Senha para conexões JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir conexões JSON-RPC de endereços IP específicos</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comando para nó rodando em &lt;ip&gt; (pardão: 127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Executar comando quando o melhor bloco mudar (%s no comando será substituído pelo hash do bloco)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Atualizar carteira para o formato mais recente</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Determinar tamanho do pool de endereços para &lt;n&gt; (padrão: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Re-escanear blocos procurando por transações perdidas da carteira</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para conexões JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Arquivo de certificado do servidor (padrão: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Chave privada do servidor (padrão: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Algoritmos de criptografia aceitos (padrão: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Esta mensagem de ajuda</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Impossível vincular a %s neste computador (bind retornou erro %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Conectar através de um proxy socks</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir consultas DNS para -addnode, -seednode e -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Carregando endereços...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erro ao carregar wallet.dat: Carteira corrompida</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of SwansonCoin</source> <translation>Erro ao carregar wallet.dat: Carteira requer uma versão mais nova do SwansonCoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart SwansonCoin to complete</source> <translation>A Carteira precisou ser reescrita: reinicie o SwansonCoin para completar</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Erro ao carregar wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Endereço -proxy inválido: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rede desconhecida especificada em -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Versão desconhecida do proxy -socks requisitada: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossível encontrar o endereço -bind: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossível encontrar endereço -externalip: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantidade inválida para -paytxfee=&lt;quantidade&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Quantidade inválida</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Saldo insuficiente</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Carregando índice de blocos...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adicionar um nó com o qual se conectar e tentar manter a conexão ativa</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. SwansonCoin is probably already running.</source> <translation>Impossível vincular a %s neste computador. O SwansonCoin provavelmente já está rodando.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Taxa por KB a ser acrescida nas transações que você enviar</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Carregando carteira...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Não é possível fazer downgrade da carteira</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Não foi possível escrever no endereço padrão</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Re-escaneando...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Carregamento terminado</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Para usar a opção %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="-31"/> <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>Você precisa especificar rpcpassword=&lt;senha&gt; no arquivo de configurações:⏎ %s⏎ Se o arquivo não existir, crie um com permissão de leitura apenas pelo dono</translation> </message> </context> </TS>
swansoncoin/swansoncoin
src/qt/locale/bitcoin_pt_BR.ts
TypeScript
mit
118,810
39.182499
408
0.634945
false
/* * optimization needed. */ struct ListNode { int val; struct ListNode *next; }; #ifndef NULL #define NULL ((struct ListNode *)0) #endif struct ListNode *detectCycle(struct ListNode *head) { if (!head || !head->next) return(NULL); if (head->next == head) return(head); struct ListNode *p1, *p2; int has_cycle; p1 = head; p2 = head; while (1) { if (!p2) { has_cycle = 0; break; } p1 = p1->next; p2 = p2->next; if (p2) { p2 = p2->next; } else { has_cycle = 0; break; } if (p1 == p2) { has_cycle = 1; break; } } if (!has_cycle) return(NULL); while (1) { if (head == p1) { break; } p2 = p1->next; while (p2 != p1) { if (head == p2) break; else p2 = p2->next; } if (head == p2) break; else head = head->next; } return(head); } int main(void) { return(0); }
wuzhouhui/leetcode
142_linked_list_cycle_II.c
C
mit
866
11.197183
51
0.526559
false
# Makefile for project pi-admin MODULES = sn-core sn-props sn-approute connect CLEAN_THESE_FILES = css/bootstrap.css css/bootstrap.min.css css/bootstrap-theme.css css/bootstrap-theme.min.css \ js/bootstrap.js js/bootstrap.min.js js/jquery.js js/underscore-min.js js/backbone-min.js js/handlebars.js \ js/sn-core.js fonts ./pi-admin BOOTSTRAP_VERSION = 3.0.3 JQUERY_VERSION = 1.10.2 HANDLEBARS_VERSION = 1.3.0 SNCORE_VERSION = 0.0.11 default: ./node_modules ./build clean: rm -rf ./node_modules rm -rf ./build ( cd static; rm -rf $(CLEAN_THESE_FILES) ) ./node_modules : mkdir -p ./node_modules npm install $(MODULES) ./build : ./build/bootstrap.zip ./build/sn-core.tar.gz ( cd build; unzip -o bootstrap.zip ) ( cd build; tar xzvf sn-core.tar.gz ) ( cd static; cp -r ../build/dist/* . ) ( cd static; cp ../build/sn-core-$(SNCORE_VERSION)/sn-core.js js/sn-core.js ) ( cd static/js ; wget -O jquery.js https://code.jquery.com/jquery-$(JQUERY_VERSION).min.js ) ( cd static/js ; wget -O underscore-min.js http://underscorejs.org/underscore-min.js ) ( cd static/js ; wget -O backbone-min.js http://backbonejs.org/backbone-min.js ) ( cd static/js ; wget -O handlebars.js http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v$(HANDLEBARS_VERSION).js ) ln -s /usr/bin/sn-app ./pi-admin ./build/bootstrap.zip : ./builddir ( cd build; wget -O bootstrap.zip https://github.com/twbs/bootstrap/releases/download/v$(BOOTSTRAP_VERSION)/bootstrap-$(BOOTSTRAP_VERSION)-dist.zip ) ./build/sn-core.tar.gz : ./builddir ( cd build; wget -O sn-core.tar.gz https://github.com/smithee-us/sn-core/archive/v$(SNCORE_VERSION).tar.gz ) ./builddir : mkdir -p ./build install-deb : npm install -g sn-app if [ -d /etc/init.d ]; then \ cp init/pi-admin /etc/init.d; chmod 755 /etc/init.d/pi-admin; \ if [ -e /etc/init.d/.depend.start ]; then \ insserv pi-admin; else \ update-rc.d pi-admin defaults; \ fi \ fi
smithee-us/pi-admin
Makefile
Makefile
mit
1,941
37.058824
150
0.690366
false
html, body, .container, .header { height: 100%; } /* Header */ .header { position: relative; margin: 0 auto; min-height: 560px; width: 100%; } .bg-img { position: absolute; overflow: hidden; top: 0; left: 0; right: 0; bottom: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; } .bg-img img { position: absolute; top: 0; left: 0; display: block; min-width: 100%; min-height: 100%; } .title { z-index: 1000; margin: 0 auto; padding: 0 1.25em; width: 100%; text-align: center; position: absolute; top: 50%; left: 50%; -webkit-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); } .title h1 { padding: 0 0 0.2em; color: #fff; font-weight: 800; font-size: 3.25em; margin: 0 auto; } .title p { color: #fff; padding: 0 0 0.6em; font-weight: 300; font-size: 0.85em; margin: 0 auto; } .title h1, .title p.subline { line-height: 1; } .title p.subline { font-size: 1.75em; } /* Trigger Button */ button.trigger { position: fixed; bottom: 40px; left: 50%; z-index: 5000; display: block; margin-left: -0.5em; padding: 0; width: 1em; height: 1em; border: none; background: transparent; color: transparent; font-size: 2em; cursor: pointer; } .container:not(.notrans) button.trigger { -webkit-transition: opacity 0.3s 0.5s; transition: opacity 0.3s 0.5s; } .container.modify:not(.notrans) button.trigger { opacity: 0; pointer-events: none; -webkit-transition-delay: 0s; transition-delay: 0s; } button.trigger::before { position: absolute; bottom: 100%; left: -100%; padding: 0.8em; width: 300%; color: #fff; content: attr(data-info); font-size: 0.35em; -webkit-backface-visibility: hidden; backface-visibility: hidden; } button.trigger:focus { outline: none; } button.trigger span { position: relative; display: block; overflow: hidden; width: 100%; height: 100%; } button.trigger span::before { position: absolute; top: 0; left: 0; width: 100%; height: 100%; color: #fff; content: "▼"; text-transform: none; font-weight: normal; font-style: normal; font-variant: normal; font-family: 'icomoon'; line-height: 1; speak: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } button.trigger span::after { position: absolute; top: 0; left: 0; width: 100%; height: 100%; color: #fff; content: "▼"; text-transform: none; font-weight: normal; font-style: normal; font-variant: normal; font-family: 'icomoon'; line-height: 1; speak: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } /* Conent */ .content { margin: 0 auto; padding: 0 0 3em; margin-top:100px; } @media only screen and (min-width : 320px) and (max-width : 780px){ .content { margin: 0 auto; padding: 0 0 3em; margin-top:0px; } } .content > div:not(.title) { margin: -80px auto 0; max-width: 900px; padding: 0 1.25em; } .content > div:not(.title) p { margin: 0 auto 1.5em auto; } .content > div:not(.title) p:first-child { /*font-size: 1.35em;*/ } .content h3 { margin: 0; font-size: 1.4em; } .content blockquote { padding: 0.25em; font-style: italic; font-size: 1.65em; font-family: 'Lora', serif; line-height: 1.4; } .content blockquote::before { content: '\201C'; } .content blockquote::after { content: '\201D'; } /***** Individual effects *****/ /* -------------------------- */ /* Jam 3 */ /* -------------------------- */ .intro-effect-jam3:not(.notrans) .bg-img { -webkit-transition-property: top, left, right, bottom; transition-property: top, left, right, bottom; } .intro-effect-jam3:not(.notrans) .header h1, .intro-effect-jam3:not(.notrans) .codrops-top a { -webkit-transition-property: color; transition-property: color; } .intro-effect-jam3:not(.notrans) .codrops-demos a { -webkit-transition-property: border-color, color; transition-property: border-color, color; } .intro-effect-jam3:not(.notrans) .header p { -webkit-transition-property: color, opacity, -webkit-transform; transition-property: color, opacity, transform; } .intro-effect-jam3:not(.notrans) .content > div { -webkit-transition-property: opacity, -webkit-transform; transition-property: opacity, transform; } .intro-effect-jam3:not(.notrans) .bg-img, .intro-effect-jam3:not(.notrans) .header h1, .intro-effect-jam3:not(.notrans) .codrops-top a, .intro-effect-jam3:not(.notrans) .codrops-demos a, .intro-effect-jam3:not(.notrans) .content > div { -webkit-transition-duration: 0.5s; transition-duration: 0.5s; -webkit-transition-timing-function: cubic-bezier(0.7,0,0.3,1); transition-timing-function: cubic-bezier(0.7,0,0.3,1); } .intro-effect-jam3:not(.notrans) .header p, .intro-effect-jam3:not(.notrans) .header p.subline, .intro-effect-jam3:not(.notrans) .content > div { -webkit-transition-duration: 0.2s; transition-duration: 0.2s; } .intro-effect-jam3.modify:not(.notrans) .header p, .intro-effect-jam3.modify:not(.notrans) .header p.subline, .intro-effect-jam3.modify:not(.notrans) .content > div { -webkit-transition-duration: 0.5s; transition-duration: 0.5s; } .intro-effect-jam3 .codrops-demos a { color: #fff; } .intro-effect-jam3 .codrops-demos a.current-demo { border-color: #fff; } .intro-effect-jam3.modify .codrops-demos a { color: #c03b5d; } .intro-effect-jam3.modify .codrops-demos a.current-demo { border-color: #c03b5d; } .intro-effect-jam3.container { padding: 45px 30px; } .intro-effect-jam3 .bg-img { top: -45px; right: -30px; bottom: -45px; left: -30px; background: #514753; } .intro-effect-jam3.modify .bg-img { top: 0; right: 0; bottom: 85%; left: 0; } .intro-effect-jam3.modify .header h1 { color: #514753; } .intro-effect-jam3 .header p { color: #514753; opacity: 0; -webkit-transform: translateY(150px); transform: translateY(150px); } .intro-effect-jam3.modify .header p { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); } .intro-effect-jam3 .content { padding: 0 5em 5em; } .intro-effect-jam3 .header, .intro-effect-jam3 .content { background: #fff; } .intro-effect-jam3 .content > div { opacity: 0; -webkit-transform: translateY(150px); transform: translateY(150px); } .intro-effect-jam3.modify .content > div { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); } .intro-effect-jam3.modify .codrops-top a { color: #514753; } /* Delays */ .intro-effect-jam3.modify:not(.notrans) .header p:nth-last-child(2) { -webkit-transition-delay: 0.1s; transition-delay: 0.1s; } .intro-effect-jam3.modify:not(.notrans) .header p:last-child { -webkit-transition-delay: 0.15s; transition-delay: 0.15s; } .intro-effect-jam3.modify:not(.notrans) .content > div { -webkit-transition-delay: 0.2s; transition-delay: 0.2s; } /* -------------------------- */ /* Faded gradient */ /* -------------------------- */ .intro-effect-fadeout:not(.notrans) .bg-img { -webkit-transition-property: -webkit-transform; transition-property: transform; } .intro-effect-fadeout:not(.notrans) .bg-img::after { -webkit-transition-property: opacity; transition-property: opacity; } .intro-effect-fadeout:not(.notrans) .header h1 { -webkit-transition-property: color; transition-property: color; } .intro-effect-fadeout:not(.notrans) .header p, .intro-effect-fadeout:not(.notrans) .content > div { -webkit-transition-property: -webkit-transform, opacity; transition-property: transform, opacity; } .intro-effect-fadeout:not(.notrans) .bg-img, .intro-effect-fadeout:not(.notrans) .bg-img::after, .intro-effect-fadeout:not(.notrans) .header h1, .intro-effect-fadeout:not(.notrans) .header p, .intro-effect-fadeout:not(.notrans) .content > div { -webkit-transition-duration: 0.5s; transition-duration: 0.5s; } .intro-effect-fadeout .header { overflow: hidden; } .intro-effect-fadeout.modify .bg-img { -webkit-transform: translateY(-25%); transform: translateY(-25%); } .intro-effect-fadeout .bg-img::after { content: ''; position: absolute; width: 100%; height: 101%; top: 0; left: 0; opacity: 0; pointer-events: none; background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); } .intro-effect-fadeout.modify .bg-img::after { opacity: 1; } .intro-effect-fadeout .title { text-align: left; max-width: 900px; } .intro-effect-fadeout.modify .header h1, .intro-effect-fadeout .header p { color: #514753; } .intro-effect-fadeout .header p { opacity: 0; } .intro-effect-fadeout .header p:nth-child(2) { -webkit-transform: translateX(150px); transform: translateX(150px); } .intro-effect-fadeout .header p:nth-child(3) { -webkit-transform: translateX(-150px); transform: translateX(-150px); } .intro-effect-fadeout.modify .header p:nth-child(2), .intro-effect-fadeout.modify .header p:nth-child(3) { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0); } .intro-effect-fadeout .content { z-index: 1000; position: relative; } .intro-effect-fadeout .content > div { opacity: 0; -webkit-transform: translateY(350px); transform: translateY(350px); } .intro-effect-fadeout.modify .content > div { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); } /* -------------------------- */ /* Sliced */ /* -------------------------- */ .intro-effect-sliced:not(.notrans) .bg-img, .intro-effect-sliced:not(.notrans) .title { -webkit-transition-property: -webkit-transform; transition-property: transform; } .intro-effect-sliced:not(.notrans) .header h1, .intro-effect-sliced:not(.notrans) .codrops-demos a { -webkit-transition-property: color; transition-property: color; } .intro-effect-sliced:not(.notrans) .header p { -webkit-transition-property: opacity; transition-property: opacity; } .intro-effect-sliced:not(.notrans) .content > div { -webkit-transition-property: -webkit-transform, opacity; transition-property: transform, opacity; } .intro-effect-sliced:not(.notrans) .bg-img, .intro-effect-sliced:not(.notrans) .header h1, .intro-effect-sliced:not(.notrans) .title, .intro-effect-sliced:not(.notrans) .header p, .intro-effect-sliced:not(.notrans) .content > div, .intro-effect-sliced:not(.notrans) .codrops-demos a { -webkit-transition-timing-function: cubic-bezier(0.7,0,0.3,1); transition-timing-function: cubic-bezier(0.7,0,0.3,1); -webkit-transition-duration: 0.5s; transition-duration: 0.5s; } .intro-effect-sliced.modify:not(.notrans) .header h1, .intro-effect-sliced.modify:not(.notrans) .title, .intro-effect-sliced.modify:not(.notrans) .header p, .intro-effect-sliced.modify:not(.notrans) .content > div, .intro-effect-sliced.modify:not(.notrans) .codrops-demos a { -webkit-transition-timing-function: ease; transition-timing-function: ease; } .intro-effect-sliced .bg-img:first-child { bottom: 50%; } .intro-effect-sliced .bg-img:last-child { top: 50%; position: fixed; z-index: 900; } .intro-effect-sliced .bg-img:last-child img { top: -100%; } .intro-effect-sliced.modify .bg-img:first-child { -webkit-transform: translateY(-80%); transform: translateY(-80%); } .intro-effect-sliced.modify .bg-img:last-child { -webkit-transform: translateY(100%); transform: translateY(100%); } .intro-effect-sliced .codrops-demos { text-align: center; } .intro-effect-sliced .codrops-demos a { color: #fff; font-size: 0.8em; } .intro-effect-sliced.modify .codrops-demos a { color: #cf4a5c; } .intro-effect-sliced .title { -webkit-transform: translateX(-50%) translateY(-50%) scale(0.7); transform: translateX(-50%) translateY(-50%) scale(0.7); } .intro-effect-sliced.modify .title { -webkit-transform: translateX(-50%) translateY(-50%) scale(1); transform: translateX(-50%) translateY(-50%) scale(1); } .intro-effect-sliced .header p { opacity: 0; color: #514753; } .intro-effect-sliced.modify .header p { opacity: 1; } .intro-effect-sliced.modify .header h1 { color: #514753; } .intro-effect-sliced .content > div { -webkit-transform: translateY(200px); transform: translateY(200px); opacity: 0; } .intro-effect-sliced.modify .content > div { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } /* Delays */ .intro-effect-sliced.modify:not(.notrans) .title { -webkit-transition-delay: 0.15s; transition-delay: 0.15s; } /* -------------------------- */ /* Side */ /* -------------------------- */ .intro-effect-side:not(.notrans) .bg-img::before, .intro-effect-side:not(.notrans) .title { -webkit-transition-property: -webkit-transform; transition-property: transform; } .intro-effect-side:not(.notrans) .bg-img::after { -webkit-transition-property: top, left, bottom, right, background-color; transition-property: top, left, bottom, right, background-color; } .intro-effect-side:not(.notrans) .header p { -webkit-transition-property: -webkit-transform, opacity; transition-property: transform, opacity; } .intro-effect-side:not(.notrans) .content > div { -webkit-transition-property: opacity; transition-property: opacity; } .intro-effect-side:not(.notrans) .bg-img::before, .intro-effect-side:not(.notrans) .bg-img::after, .intro-effect-side:not(.notrans) .title, .intro-effect-side:not(.notrans) .header p, .intro-effect-side:not(.notrans) .content > div { -webkit-transition-timing-function: cubic-bezier(0.7,0,0.3,1); transition-timing-function: cubic-bezier(0.7,0,0.3,1); -webkit-transition-duration: 0.5s; transition-duration: 0.5s; } .intro-effect-side .codrops-top a { color: #7b8d92; } .intro-effect-side .bg-img::before, .intro-effect-side .bg-img::after { content: ''; position: absolute; z-index: 100; } .intro-effect-side .bg-img::before { background: #fff; top: 0; left: 0; width: 60%; height: 100%; -webkit-transform: translateX(-100%); transform: translateX(-100%); } .intro-effect-side.modify .bg-img::before { -webkit-transform: translateX(0); transform: translateX(0); } .intro-effect-side .bg-img::after { border: 80px solid #fff; top: -80px; right: -80px; bottom: -80px; left: -80px; background-color: rgba(255,255,255,0.5); } .intro-effect-side.modify .bg-img::after { top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(255,255,255,0); } .intro-effect-side .codrops-demos a { color: #43939d; } .intro-effect-side .codrops-demos a.current-demo { border-bottom: 3px solid #43939d; } .intro-effect-side .title { text-align: right; left: 0; padding: 0 3em 0 2em; width: 60%; -webkit-transform: translateX(33.3%) translateY(-50%); transform: translateX(33.3%) translateY(-50%); } .intro-effect-side.modify .title { -webkit-transform: translateY(-50%); transform: translateY(-50%); } .intro-effect-side .header h1 { font-family: 'Lora', serif; font-style: italic; font-weight: 400; padding: 0 0 0.5em 0; color: #516165; } .intro-effect-side .header p { opacity: 0; color: #7b8d92; -webkit-transform: translateY(100px); transform: translateY(100px); } .intro-effect-side.modify .header p { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0); } .intro-effect-side .content > div { margin-top: 0px; opacity: 0; } .intro-effect-side.modify .content > div { opacity: 1; } .intro-effect-side button.trigger span::before, .intro-effect-side button.trigger::before { color: #516165; } /* Delays */ .intro-effect-side:not(.notrans) .title, .intro-effect-side:not(.notrans) .bg-img::before, .intro-effect-side:not(.notrans) .bg-img::after { -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } .intro-effect-side.modify:not(.notrans) .title, .intro-effect-side.modify:not(.notrans) .bg-img::before, .intro-effect-side.modify:not(.notrans) .bg-img::after { -webkit-transition-delay: 0s; transition-delay: 0s; } .intro-effect-side.modify:not(.notrans) .header p:nth-last-child(2) { -webkit-transition-delay: 0.15s; transition-delay: 0.15s; } .intro-effect-side.modify:not(.notrans) .header p:last-child { -webkit-transition-delay: 0.2s; transition-delay: 0.2s; } .intro-effect-side.modify:not(.notrans) .content > div { -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } /* -------------------------- */ /* Side Fixed */ /* -------------------------- */ .intro-effect-sidefixed:not(.notrans) .bg-img::before { -webkit-transition-property: background-color; transition-property: background-color; } .intro-effect-sidefixed:not(.notrans) .bg-img::after { -webkit-transition-property: -webkit-transform; transition-property: transform; } .intro-effect-sidefixed:not(.notrans) .title p { -webkit-transition-property: opacity; transition-property: opacity; } .intro-effect-sidefixed:not(.notrans) .content > div { -webkit-transition-property: -webkit-transform, opacity; transition-property: transform, opacity; } .intro-effect-sidefixed:not(.notrans) .bg-img::before, .intro-effect-sidefixed:not(.notrans) .bg-img::after, .intro-effect-sidefixed:not(.notrans) .title p, .intro-effect-sidefixed:not(.notrans) .content > div { -webkit-transition-timing-function: cubic-bezier(0.7,0,0.3,1); transition-timing-function: cubic-bezier(0.7,0,0.3,1); -webkit-transition-duration: 0.5s; transition-duration: 0.5s; } .intro-effect-sidefixed .header { position: absolute; } .intro-effect-sidefixed .bg-img { position: fixed; } .intro-effect-sidefixed .bg-img img { left: auto; right: 0; } .intro-effect-sidefixed .bg-img::before, .intro-effect-sidefixed .bg-img::after { content: ''; position: absolute; z-index: 100; } .intro-effect-sidefixed .bg-img::after { background: #f8ebda; top: 0; right: 0; width: 60%; height: 100%; -webkit-transform: translateX(100%); transform: translateX(100%); } .intro-effect-sidefixed.modify .bg-img::after { -webkit-transform: translateX(0); transform: translateX(0); } .intro-effect-sidefixed .bg-img::before { width: 100%; height: 100%; background-color: rgba(247,214,169,0.1); } .intro-effect-sidefixed.modify .bg-img::before { background-color: rgba(247,214,169,0.4); } .intro-effect-sidefixed .codrops-demos a { color: #f68f6c; } .intro-effect-sidefixed .title { position: relative; top: auto; left: auto; text-align: left; -webkit-transform: translateY(200px); transform: translateY(200px); } .intro-effect-sidefixed.modify .title { -webkit-transform: translateY(0); transform: translateY(0); } .intro-effect-sidefixed .title h1 { font-family: 'Playfair Display', serif; font-weight: 700; padding: 0 0 0.5em 0; color: #585a66; } .intro-effect-sidefixed .title p { opacity: 0; color: #585a66; } .intro-effect-sidefixed.modify .title p { opacity: 1; } .intro-effect-sidefixed .content { width: 60%; margin-left: 40%; padding: 0 2.5em; } .intro-effect-sidefixed .content div { position: relative; margin: 70px 0; color: #77726b; } .intro-effect-sidefixed .content div:nth-child(2) { opacity: 0; -webkit-transform: translateY(200px); transform: translateY(200px); } .intro-effect-sidefixed.modify .content div:nth-child(2) { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); } /* Delays */ .intro-effect-sidefixed:not(.notrans) .title, .intro-effect-sidefixed:not(.notrans) .bg-img::before, .intro-effect-sidefixed:not(.notrans) .bg-img::after { -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } .intro-effect-sidefixed.modify:not(.notrans) .title, .intro-effect-sidefixed.modify:not(.notrans) .bg-img::before, .intro-effect-sidefixed.modify:not(.notrans) .bg-img::after { -webkit-transition-delay: 0s; transition-delay: 0s; } .intro-effect-sidefixed.modify:not(.notrans) .content div:nth-child(2) { -webkit-transition-delay: 0.15s; transition-delay: 0.15s; } /* -------------------------- */ /* Push */ /* -------------------------- */ .intro-effect-push:not(.notrans) .header, .intro-effect-push:not(.notrans) > .title, .intro-effect-push:not(.notrans) .content > div { -webkit-transition-property: opacity, -webkit-transform; transition-property: opacity, transform; -webkit-transition-duration: 1s; transition-duration: 1s; } .intro-effect-push:not(.notrans) .header { -webkit-transition-timing-function: cubic-bezier(0.7,0,0.3,1); transition-timing-function: cubic-bezier(0.7,0,0.3,1); -webkit-transition-duration: 1.2s; transition-duration: 1.2s; } .intro-effect-push .codrops-demos a { color: #108576; } .intro-effect-push .header { position: absolute; z-index: 1500; } .intro-effect-push > .title { position: relative; top: auto; left: auto; padding: 6em 1em 2em; } .intro-effect-push .content > div { margin-top: 50px; color: #b2b2c0; } .intro-effect-push > .title, .intro-effect-push .content > div { -webkit-transform: translateY(400px); transform: translateY(400px); opacity: 0; } .intro-effect-push.modify > .title, .intro-effect-push.modify .content > div { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } .intro-effect-push.modify .header { opacity: 0; -webkit-transform: translateY(-100%) scale(0.9); transform: translateY(-100%) scale(0.9); } /* Delays */ .intro-effect-push.modify:not(.notrans) > .title { -webkit-transition-delay: 0.5s; transition-delay: 0.5s; } .intro-effect-push.modify:not(.notrans) .content > div { -webkit-transition-delay: 0.6s; transition-delay: 0.6s; } /* -------------------------- */ /* Grid */ /* -------------------------- */ .intro-effect-grid:not(.notrans) .grid li:nth-child(5) { -webkit-transition-property: -webkit-transform, opacity; transition-property: transform, opacity; } .intro-effect-grid:not(.notrans) .header p { -webkit-transition-property: opacity; transition-property: opacity; } .intro-effect-grid:not(.notrans) .bg-img, .intro-effect-grid:not(.notrans) .title { -webkit-transition-property: -webkit-transform; transition-property: transform; } .intro-effect-grid:not(.notrans) .header h1, .intro-effect-grid:not(.notrans) .codrops-demos a { -webkit-transition-property: color; transition-property: color; } .intro-effect-grid:not(.notrans) .grid li:nth-child(5), .intro-effect-grid:not(.notrans) .bg-img, .intro-effect-grid:not(.notrans) .title, .intro-effect-grid:not(.notrans) .header h1, .intro-effect-grid:not(.notrans) .header p, .intro-effect-grid:not(.notrans) .codrops-demos a { -webkit-transition-timing-function: cubic-bezier(0.7,0,0.3,1); transition-timing-function: cubic-bezier(0.7,0,0.3,1); -webkit-transition-duration: 1s; transition-duration: 1s; } .intro-effect-grid .codrops-demos a { color: #fff; } .intro-effect-grid.modify .codrops-demos a { color: #cf7000; } .intro-effect-grid .codrops-demos a.current-demo { border-bottom: 3px solid #fff; } .intro-effect-grid.modify .codrops-demos a.current-demo { border-color: #cf7000; } .intro-effect-grid .title { max-width: 900px; padding-top: 2em; } /*@media only screen (min-width : 1000px) { .intro-effect-grid .title { max-width: 900px; padding-top: 2em; padding-top: 10em; } }*/ .intro-effect-grid.modify .title { -webkit-transform: translateX(-50%) translateY(0); transform: translateX(-50%) translateY(0); } .intro-effect-grid .content > div { /*margin-top: 40px;*/ color: #2e3337; } .intro-effect-grid .header h1 { font-weight: 700; padding: 0 0 0.6em; } .intro-effect-grid.modify .header h1 { color: #2d3b44; } .intro-effect-grid .header p { opacity: 0; color: #4c6270; } .intro-effect-grid .header p.subline { font-size: 1.5em; } .intro-effect-grid.modify .header p { opacity: 1; } .intro-effect-grid .grid { list-style: none; margin: 0; padding: 0; position: absolute; top: 0; left: 0; width: 100%; height: 50%; z-index: 0; } .intro-effect-grid .grid li::after { content: ''; position: absolute; width: 100%; height: 100%; top: 0; left: 0; background: rgba(71,63,59,0.5); pointer-events: none; -webkit-transition: background 0.3s; transition: background 0.3s; } .intro-effect-grid.modify .grid li:hover::after, .intro-effect-grid.modify .grid li:nth-child(5)::after { background: rgba(71,63,59,0.1); } .intro-effect-grid .grid li { position: absolute; /*background-size: cover;*/ background-size: ; background-repeat: no-repeat; background-position: 50% 50%; cursor: pointer; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; } .intro-effect-grid .grid li h2 { font-family: 'Playfair Display', serif; font-weight: 700; padding-bottom: 0.4em; margin: 1em; color: #fff; line-height: 1; font-size: 1em; position: absolute; bottom: 0; z-index: 100; -webkit-transition: -webkit-transform 0.3s; transition: transform 0.3s; } .intro-effect-grid .grid li:hover h2 { -webkit-transform: translateY(-10px); transform: translateY(-10px); } /* .intro-effect-grid .grid li:nth-child(2) { top: 50%; left: 0; height: 50%; width: 25%; background-image: url(../img/thumbs/2.jpg); } .intro-effect-grid .grid li:nth-child(3) { top: 0; left: 25%; height: 100%; width: 25%; background-image: url(../img/thumbs/5.jpg); } .intro-effect-grid .grid li:nth-child(4) { top: 0; left: 50%; height: 50%; width: 50%; background-image: url(../img/thumbs/4.jpg); } .intro-effect-grid .grid li:nth-child(5) { top: 50%; left: 50%; height: 50%; width: 25%; background-image: url(../img/thumbs/8.jpg); -webkit-transform: scale(0); transform: scale(0); opacity: 0; } .intro-effect-grid.modify .grid li:nth-child(5) { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } .intro-effect-grid .grid li:nth-child(5) h2 { color: #de8721; } .intro-effect-grid .grid li:nth-child(6) { top: 50%; left: 75%; height: 50%; width: 25%; background-image: url(../img/thumbs/6.jpg); }*/ .intro-effect-grid.modify .bg-img { -webkit-transform: translateY(-100%); transform: translateY(-100%); } /* Media Queries */ @media screen and (max-width: 47em) { .title, .content { font-size: 70%; } .codrops-demos a { font-size: 80%; } .intro-effect-side .title { width: 100%; padding: 0 1em; -webkit-transform: translateY(-50%); transform: translateY(-50%); } .intro-effect-side.modify .bg-img::before { -webkit-transform: translateX(-100%); transform: translateX(-100%); } .intro-effect-side .bg-img::after { border-left-width: 0px; border-right-width: 0px; right: 0px; left: 0px; background: rgba(255,255,255,0.1); } .intro-effect-side.modify .bg-img::after { background: rgba(255,255,255,0.8); } .intro-effect-sidefixed .content { width: 100%; margin-left: auto; } .intro-effect-sidefixed .bg-img::after { width: 95%; } } @media screen and (max-width: 27em) { .intro-effect-jam3 .content { padding: 0 2em 5em; } .intro-effect-grid .grid li h2 { display: none; } .intro-effect-push .header .title { top: 60px; -webkit-transform: translateX(-50%); transform: translateX(-50%); } .title, .content { font-size: 50%; } button.trigger::before { display: none; } }
Shekharrajak/shekharrajak.github.io
assets/css/component.css
CSS
mit
26,902
19.948598
92
0.684029
false
package com.twitter.meil_mitu.twitter4holo.api.help; import com.twitter.meil_mitu.twitter4holo.AbsGet; import com.twitter.meil_mitu.twitter4holo.AbsOauth; import com.twitter.meil_mitu.twitter4holo.ITwitterJsonConverter; import com.twitter.meil_mitu.twitter4holo.OauthType; import com.twitter.meil_mitu.twitter4holo.ResponseData; import com.twitter.meil_mitu.twitter4holo.data.TosResult; import com.twitter.meil_mitu.twitter4holo.exception.Twitter4HoloException; public class Tos extends AbsGet<ITwitterJsonConverter>{ public Tos(AbsOauth oauth, ITwitterJsonConverter json){ super(oauth, json); } @Override public String url(){ return "https://api.twitter.com/1.1/help/tos.json"; } @Override public int allowOauthType(){ return OauthType.Oauth1 | OauthType.Oauth2; } @Override public boolean isAuthorization(){ return true; } @Override public ResponseData<TosResult> call() throws Twitter4HoloException{ return Json.toTosResultResponseData(Oauth.get(this)); } }
MeilCli/Twitter4Holo
library/src/main/java/com/twitter/meil_mitu/twitter4holo/api/help/Tos.java
Java
mit
1,064
28.555556
74
0.740602
false
module Cranium::ImportStrategy autoload :Base, 'cranium/import_strategy/base' autoload :DeleteInsert, 'cranium/import_strategy/delete_insert' autoload :Delete, 'cranium/import_strategy/delete' autoload :TruncateInsert, 'cranium/import_strategy/truncate_insert' autoload :Delta, 'cranium/import_strategy/delta' autoload :Merge, 'cranium/import_strategy/merge' end
emartech/cranium
lib/cranium/import_strategy.rb
Ruby
mit
376
36.7
69
0.787234
false
<!--<section data-ng-controller="NewsFeedsController" data-ng-init="findOne()">--> <section data-ng-controller="NewsFeedsController" data-ng-init="findOne()"> <section class="container"> <div class="page-header"> <h1>Edit News feed</h1> </div> <div class="col-md-12"> <form class="form-horizontal" data-ng-submit="update()" novalidate> <fieldset> <div class="form-group"> <!-- Enter the title of the article --> <label class="control-label" for="title">Title of the News Article</label> <div class="controls"> <input type="text" ng-model="Update_Title" data-ng-model="newsFeed.title" id="title" class="form-control" placeholder="Title" required> </div> <!-- Enter the author --> <label class="control-label" for="author">Name of the author</label> <div class="controls"> <input type="text" data-ng-model="newsFeed.author" id="author" class="form-control" placeholder="Author's name" required> </div> <!-- Enter the description of the app --> <label class="control-label" for="body_text">The body of the article</label> <div class="controls"> <textarea rows="4" type="text" data-ng-model="newsFeed.body_text" id="body_text" class="form-control" placeholder="Articles body" required> </textarea> </div> <!-- Upload picture or give link --> <label class="control-label" for="imageURL">Link to an Articles image</label> <div class="controls"> <input type="text" data-ng-model="newsFeed.imageURL" id="imageURL" class="form-control" placeholder="Image URL" required> </div> <!-- link to the app --> <label class="control-label" for="articleLink">Link to the Article</label> <div class="controls"> <input type="text" data-ng-model="newsFeed.articleLink" id="articleLink" class="form-control" placeholder="Link to the Article" required> </div> <!--article date --> <label class="control-label" for="date">Date of the article</label> <br> <div style="display:inline-block; min-height:250px; max-height:250px; background: rgba(0, 0, 0, 0.0)"> <datepicker ng-model="date" min-date="minDate" show-weeks="true" class="well well-sm" custom-class="getDayClass(date, mode)"></datepicker> </div> </div> <div class="form-group"> <input ng-model="Update_Button" type="submit" value="Update" class="btn btn-default"> </div> <div data-ng-show="error" class="text-danger"> <strong data-ng-bind="error"></strong> </div> </fieldset> </form> </div> </section> </section>
CEN3031-7C/project
modules/news-feeds/client/views/edit-news-feed.client.view_old.html
HTML
mit
3,248
58.072727
163
0.514163
false
var STATE_START = 0; var STATE_END = 1; var STATE_GROUND = 2; var STATE_FOREST = 3; var STATE_WATER = 4; function Cell(col, row) { this.col = col; this.row = row; this.state = STATE_GROUND; } Cell.prototype.draw = function() { stroke(66); switch (this.state) { case STATE_START: Color.Material.light_green[5].fill(); break; case STATE_END: Color.Material.red[5].fill(); break; case STATE_GROUND: Color.Material.green[5].fill(); break; case STATE_FOREST: Color.Material.green[9].fill(); break; case STATE_WATER: Color.Material.light_blue[5].fill(); break; default: fill(255, 0, 0); } rect(this.col * scl, this.row * scl, scl, scl); }; Cell.prototype.incrementState = function(bool) { if (bool) { // Cycle from 0 to 1 this.state = (++this.state > 1) ? 0 : this.state; } else { // Cycle from 2 to 4 this.state = (++this.state < 2 || this.state > 4) ? 2 : this.state; } //this.state = (++this.state > 4) ? 0 : this.state; //loop(); };
dylandevalia/dylan.devalia.com
old/pathfinding/cell.js
JavaScript
mit
996
20.652174
69
0.61747
false
'use strict'; /* Services */ // Demonstrate how to register services // In this case it is a simple value service. angular.module('baApp.services', []). value('version', '0.1');
alnutile/drag-and-drop-page
app/js/services.js
JavaScript
mit
183
19.333333
45
0.666667
false
var fs = require('fs'); var join = require('path').join; var iconv = require('iconv-lite'); var debug = require('debug')('ip'); var util = require('util'); var EventEmitter = require('events').EventEmitter; var thunkify = require('thunkify-wrap'); function IpUtil(ipFile, encoding, isLoad) { if (typeof encoding === 'function') { isLoad = encoding; encoding = null; } this.ipFile = joinDirectory(process.cwd(), ipFile); this.ipList = []; if (encoding && encoding.toLowerCase().indexOf('utf') > -1) { this.filter = function(buf) { return buf.toString(); }; } else { this.filter = function(buf) { return iconv.decode(new Buffer(buf), 'gbk'); }; } this.isLoad = isLoad || function(){ return true; }; this.init(); } util.inherits(IpUtil, EventEmitter); IpUtil.prototype.init = function() { var that = this; var isLoad = this.isLoad; debug('begin parse ipfile %s', this.ipFile); if (!fs.existsSync(this.ipFile)) { debug('not found ip file!'); that.emit('error', 'ipfile_not_found'); return; } var ipMap = this.ipMap = {}; var ipList = this.ipList; var getLine = readLine(this.ipFile, this.filter); var result = getLine.next(); var line; var lineNum = 0; var counter = 1; var _readLine = function () { if (result.done) { that.emit('loaded'); return; } // 避免ip读取独占cpu. if (counter % 100000 === 0) { counter = 1; setImmediate(_readLine); return; } counter++; lineNum++; line = result.value; if (!line || !line.trim()) { result = getLine.next(); _readLine(); return; } var tokens = line.split(',', 6); if (tokens.length !== 6) { debug('第%d行格式不正确: %s', lineNum, line); result = getLine.next(); _readLine(); return; } var startIp = ip2Long(tokens[0]); var endIp = ip2Long(tokens[1]); if (!startIp || !endIp) { debug('第%d行格式不正确: %s', lineNum, line); result = getLine.next(); _readLine(); return; } var country = getValue(tokens[2]); var province = getValue(tokens[3]); var city = getValue(tokens[4]); var address = getValue(tokens[5]); // 针对国家、省份、城市解析的统一判空修改 // 首先对特殊值的解析 if ('IANA' === country) { country = 'IANA'; province = 'IANA'; city = 'IANA'; } if ('局域网' === country) { country = '局域网'; province = '局域网'; city = '局域网'; } if('国外' === country) { country = '国外'; province = '国外'; city = '国外'; } if('中国' === country && ('中国' === province || '中国' === city)) { country = '中国'; province = '中国'; city = '中国'; } if (!isLoad(country, province, city)) { result = getLine.next(); setImmediate(_readLine); return; } ipMap[startIp] = { startIp: startIp, endIp: endIp, country: country, province: province, city: city, address: address }; ipList.push(startIp); result = getLine.next(); setImmediate(_readLine); }; _readLine(); var sortIp = function () { //debug(this.ipMap) debug('完成IP库的载入. 共载入 %d 条IP纪录', ipList.length); ipList.sort(function(a, b) { return a - b; }); debug('ip 索引排序完成.'); that.emit('done'); }; this.on('loaded', sortIp); }; function getValue(val) { if (!val) { return null; } val = val.trim(); if (val === 'null') { return null; } return val; } IpUtil.prototype.getIpInfo = function(ip) { if (!isIp(ip)) { return null; } if (typeof ip === 'string') { ip = ip2Long(ip); } var ipStart = this.locatStartIP(ip); debug('开始获取 ip 信息: %d', ipStart); var ipInfo = this.ipMap[ipStart]; debug('查找IP, %s 成功.', long2IP(ip)); if (ipInfo.endIp < ip) { debug('在IP库中找不到IP[%s]', long2IP(ip)); return null; } return ipInfo; }; IpUtil.prototype.refreshData = function() { }; /** * 查找ip对应的开始IP地址。如果IP库中正好有以该ip开始的IP信息,那么就是返回这个ip。 * 如果没有,则应该是比这个ip小的最大的start * @param ip * @return */ IpUtil.prototype.locatStartIP = function(ip) { debug('开始查找IP: %d', ip); var centerIP = 0; var centerIndex = 0; // 当前指针位置 var startIndex = 0; // 起始位置 var endIndex = this.ipList.length - 1; // 结束位置 var count = 0; // 循环次数 while (true) { debug('%d. start = %d, end = %d', count++, startIndex, endIndex); // 中间位置 centerIndex = Math.floor((startIndex + endIndex) / 2); centerIP = this.ipList[centerIndex]; if (centerIP < ip) { // 如果中间位置的IP小于要查询的IP,那么下一次查找后半段 startIndex = centerIndex; } else if (centerIP > ip) { // 如果中间位置的IP大于要查询的IP,那么下一次查找前半段 endIndex = centerIndex; } else { // 如果相等,那么已经找到要查询的IP break; } if (startIndex + 1 === endIndex) { // 如果开始指针和结束指针相差只有1,那么说明IP库中没有正好以该ip开始的IP信息 // 只能返回IP信息的start ip比这个ip小的最大的那条IP信息的start ip if (centerIP > ip) { centerIP = this.ipList[centerIndex - 1]; } break; } } debug('对应的IP开始地址为: %d', centerIP, centerIndex); return centerIP; }; /** * a,b,c ==> a/b/c * a,b,/tmp ==> /tmp * /a/b, c ==> /a/b/c */ function joinDirectory() { var dirs = [].slice.call(arguments, 1); var dir; for (var i = 0, len = dirs.length; i < len; i++) { dir = dirs[i]; if (/^\//.test(dir)) { // 发现根目录, 直接返回. return dir; } } return join.apply(null, [].slice.call(arguments)); } function ip2Long(ip) { if (!isIp(ip)) { return 0; } var segs = ip.split('.'); var iplong =(parseInt(segs[0]) << 24 | parseInt(segs[1]) << 16 | parseInt(segs[2]) << 8 | parseInt(segs[3])) >>> 0; return iplong; } var IP_REGEXP = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/; function isIp(str) { if (!str) { return false; } str = str.trim(); return IP_REGEXP.test(str); /** var tokens = str.split('.'); if (tokens.length !== 4) { return false; } for (var i = 0, len = tokens.length; i < len; i++) { if (parseInt(tokens[i]) > 255 || parseInt(tokens[i]) < 0) { return false; } } return true; **/ } function long2IP(ipLong) { var ip = [ipLong >> 24]; ip.push((ipLong & 16711680) >> 16); ip.push((ipLong & 65280) >> 8); ip.push(ipLong & 255); return ip.join('.'); } function *readLine(file, filter) { var buffer = fs.readFileSync(file); var i = 0, len = 0 || buffer.length; debug('load file succ', len); // 换行符. var nl = require('os').EOL.charCodeAt(0); var buf = []; while(i < len) { if (buffer[i] !== nl) { buf.push(buffer[i]); } else { yield filter(new Buffer(buf)); buf = []; } i++; } } module.exports = IpUtil; module.exports.isIP = isIp; module.exports.ip2Long = ip2Long; module.exports.long2Ip = long2IP; module.exports.getIpUtil = function *(ipFile, encoding, ipFilter) { var iputil = new IpUtil(ipFile, encoding, ipFilter); var end = thunkify.event(iputil, ['done', 'error']); yield end(); return iputil; };
leoner/iputil
index.js
JavaScript
mit
7,755
19.582609
155
0.55809
false
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("Superheroes.Services.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Superheroes.Services.Tests")] [assembly: AssemblyCopyright("Copyright © 2016")] [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("3f189b3e-c136-44ff-b1fb-03249d1473b6")] // 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")]
TelerikAcademy-Cloning/Databases
Topics/21. Service-layer/demos/Superheroes/Superheroes.Services.Tests/Properties/AssemblyInfo.cs
C#
mit
1,464
38.583333
84
0.728953
false
<HTML><HEAD> <TITLE>Review for Vertical Limit (2000)</TITLE> <LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0190865">Vertical Limit (2000)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Dennis+Schwartz">Dennis Schwartz</A></H3><HR WIDTH="40%" SIZE="4"> <P>VERTICAL LIMIT (director: Martin Campbell; screenwriters: Robert King and Terry Hayes, based on a story by Mr. King; cinematographer: David Tattersall; editor: Thom Noble; cast: Chris O'Donnell (Peter Garrett), Bill Paxton (Elliot Vaughn), Robin Tunney (Annie Garrett), Scott Glenn (Montgomery Wick), Izabella Scorupco (Monique Aubertine), Temuera Morrison (Major Rasul), Nicholas Lea (Tom McLaren), Alexander Siddig (Kareem), Steve Le Marquand (Cyril Bench), Ben Mendelsohn (Malcolm Bench), Robert Taylor (Skip Taylor), Stuart Wilson (Royce Garrett), Roshan Seth (Colonel Amir Salem); Runtime: 126; Columbia Pictures; 2000)</P> <PRE>Reviewed by Dennis Schwartz</PRE> <P>A superficial but entertaining roller-coaster-ride of nonstop action featuring cliché characters and contrived dangerous situations, mainly conceived to show off the special effects. The story is so slight that there is no danger of it interfering with the action scenes. It's a Hollywood blockbuster for those in need of escaping reality for two hours and should prove to be enjoyable for those who are willing to go with the flow of the action and suspend their critical judgment. The reward will be a visual treat of well-executed stunts and a film that had the glossy look of a National Geographic photography shoot. The director Martin Campbell ("Goldeneye") relishes in filming excesses and creating one life-and-death scene after the other. Movie viewers could go snowblind just watching a series of mountain catastrophes befall the adventurous climbers, as the film throws out almost any possible danger there is to be found on a mountain and the mountain climbers try to overcome these impossible obstacles and, there is, needlessly to say, a race-against-time sequence, with a last second rescue in the works.</P> <P>The opening eight-minute scene, derivative as it is, is brilliantly done and captures whatever underlying tension the film was to later on build up to. The Garrett family is out for a pleasure mountain climbing trip to the ochre cliffs of Monument Valley, as Peter (Chris O'Donnell) and his sister Ann (Robin Tunney) are climbing with dad Royce (Stuart Wilson) and a couple of unnamed companions. One of those companions first has his backpack fall and thereby loosens the tow rope entangling the others, trapping the family with the other two companions dangling off a peak. The companions can't hold on and tragically fall. Royce warns that the line won't hold all three for long and pleads that his son cut him loose to have any hope of saving his children. Ignoring Annie's tearful protests, Peter cuts the rope and the father falls to his death.</P> <P>It's three years later and Peter is a National Geographic photographer shooting in the Himalayas. He ends up at a Pakistani military base, where they are in the middle of a war with India. Nearby is a K2 base camp, where Annie is a crew member on billionaire sportsman Elliot Vaughn (Bill Paxton) team that is set to climb the dangerous summit of K2--the world's second-highest peak. The brother and sister reunite after becoming more distant with each other. They never discussed their father's death since the tragedy, but have gone their separate ways. Peter has abandoned mountain climbing, while Annie has become known as the fastest climber in the world and is a Sports Illustrated cover girl. She is still upset with what Peter did and could hardly face him, much less talk to him about it.</P> <P>At the richly put together base camp of Elliot's expedition, the arrogant businessman has surrounded himself with the best team money can buy, including the foremost climber in the world, Tom McLaren (Nicholas Lea). He is to lead Elliot to the summit of K2 in time to coincide with one of the planes flying overhead from Elliot's new airline he is launching. The commercial motive for the climb and the callous way he will soon treat his fellow climbers, makes him the film's designated one-dimensional villain, and adds some more spice to a film that is overspiced already with clichés.</P> <P>Warned by the base camp of severe weather conditions, Elliot refuses the leader's advice to turn back and manipulates the leader to go against his better judgment and continue on, where they reach the vertical limit at 26,000 feet--significant because the oxygen is very thin. When a wind storm hits--and, Elliot, Annie and Tom end up inside a deep cavern that becomes sealed by an avalanche, the three realize that they have only 36 hours to survive.</P> <P>Peter impatiently arranges for the rescue attempt, quickly assembling a diverse team of volunteers who have little chance of succeeding, but sign on for the glory, or their concern for the victims, or for the money offered. The Pakistani Army helps out by supplying the six rescuers with cannisters of nitroglycerin, an homage to "Wages of Fear." The rescuers will try to blast the victims out of the cavern, but must be very careful when climbing because with just one spill of the explosive liquid there is the certainty of a tremendous explosion. There will be many tremendous explosions that rock the Himalayas, and -- if mountains repeatedly exploding and climbers falling down mountain peaks in colorful ways is your idea of enjoyment, then this is the film for you.</P> <P>The rescue crew includes one of the world's beautiful supermodels, who in this film happens to be a medic and an expert climber Monique (Izabella Scorupco); a Muslim practitioner, the Pakistani porter Kareem (Alexander Siddig); the comically insane Aussie brothers Cyril and Malcolm Bench (Steve Le Marquand, Ben Mendelsohn); and, the leader of the crew, a hard-assed master mountain climber who became a hermit and for the last few years stopped everything to search only for his wife who never returned from Elliot's last tragic expedition to K2, Montgomery Wick (Scott Glenn). The craggy-faced Wick is bent on revenge against Elliot, blaming him for his tour guide wife's death. He's also a friend of Peter's father, and what goes for wisdom in this picture, comes from his rugged lips.</P> <P>The action keeps coming, the clichés get resolved somehow, and even though the action sequences couldn't possibly be real, the great photography and beautiful vistas made the locations seem out of this world. The filmmaker used the Southern Alps in New Zealand as his setting, and you could have fooled me, because it sure looked like the Himalayas. It also looked like it could be a long commercial for beautiful yuppie adventurers who are shooting an ad for Club Med, or a National Geographic TV special, or even one of those action thrillers that doesn't believe it needs good dialogue to tell its heroic fantasy story.</P> <PRE>REVIEWED ON 1/3/2001 GRADE: C+</PRE> <P>Dennis Schwartz: "Ozus' World Movie Reviews"</P> <PRE><A HREF="http://www.sover.net/~ozus">http://www.sover.net/~ozus</A></PRE> <PRE><A HREF="mailto:ozus@sover.net">ozus@sover.net</A></PRE> <P>© ALL RIGHTS RESERVED DENNIS SCHWARTZ</P> <HR><P CLASS=flush><SMALL>The review above was posted to the <A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR> The Internet Movie Database accepts no responsibility for the contents of the review and has no editorial control. Unless stated otherwise, the copyright belongs to the author.<BR> Please direct comments/criticisms of the review to relevant newsgroups.<BR> Broken URLs inthe reviews are the responsibility of the author.<BR> The formatting of the review is likely to differ from the original due to ASCII to HTML conversion. </SMALL></P> <P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P> </P></BODY></HTML>
xianjunzhengbackup/code
data science/machine_learning_for_the_web/chapter_4/movie/27363.html
HTML
mit
8,298
63.338583
206
0.774403
false
using System; using CommandLine; using System.IO; using Nancy.Hosting.Self; using SeudoBuild.Core; using SeudoBuild.Core.FileSystems; using SeudoBuild.Pipeline; using SeudoBuild.Net; namespace SeudoBuild.Agent { class Program { private const string Header = @" _ _ _ _ _ ___ ___ _ _ _| |___| |_ _ _|_| |_| | |_ -| -_| | | . | . | . | | | | | . | |___|___|___|___|___|___|___|_|_|___| "; private static ILogger _logger; [Verb("build", HelpText = "Create a local build.")] private class BuildSubOptions { [Option('t', "build-target", HelpText = "Name of the build target as specified in the project configuration file. If no build target is specified, the first target will be used.")] public string BuildTarget { get; set; } [Option('o', "output-folder", HelpText = "Path to the build output folder.")] public string OutputPath { get; set; } [Value(0, MetaName = "project", HelpText = "Path to a project configuration file.", Required = true)] public string ProjectConfigPath { get; set; } } [Verb("scan", HelpText = "List build agents found on the local network.")] private class ScanSubOptions { } [Verb("submit", HelpText = "Submit a build request for a remote build agent to fulfill.")] private class SubmitSubOptions { [Option('p', "project-config", HelpText = "Path to a project configuration file.", Required = true)] public string ProjectConfigPath { get; set; } [Option('t', "build-target", HelpText = "Name of the target to build as specified in the project configuration file.")] public string BuildTarget { get; set; } [Option('a', "agent-name", HelpText = "The unique name of a specific build agent. If not set, the job will be broadcast to all available agents.")] public string AgentName { get; set; } } [Verb("queue", HelpText = "Queue build requests received over the network.")] private class QueueSubOptions { [Option('n', "agent-name", HelpText = "A unique name for the build agent. If not set, a name will be generated.")] public string AgentName { get; set; } [Option('p', "port", HelpText = "Port on which to listen for build queue messages.")] public int? Port { get; set; } } [Verb("deploy", HelpText = "Listen for deployment messages.")] private class DeploySubOptions { } [Verb("name", Hidden = true)] private class NameSubOptions { [Option('r', "random")] public bool Random { get; set; } } public static void Main(string[] args) { _logger = new Logger(); Console.Title = "SeudoBuild"; Parser.Default.ParseArguments<BuildSubOptions, ScanSubOptions, SubmitSubOptions, QueueSubOptions, DeploySubOptions, NameSubOptions>(args) .MapResult( (BuildSubOptions opts) => Build(opts), (ScanSubOptions opts) => Scan(opts), (SubmitSubOptions opts) => Submit(opts), (QueueSubOptions opts) => Queue(opts), (DeploySubOptions opts) => Deploy(opts), (NameSubOptions opts) => ShowAgentName(opts), errs => 1 ); } /// <summary> /// Build a single target, then exit. /// </summary> private static int Build(BuildSubOptions opts) { Console.Title = "SeudoBuild • Build"; Console.WriteLine(Header); // Load pipeline modules var factory = new ModuleLoaderFactory(); IModuleLoader moduleLoader = factory.Create(_logger); // Load project config ProjectConfig projectConfig = null; try { var fs = new WindowsFileSystem(); var serializer = new Serializer(fs); var converters = moduleLoader.Registry.GetJsonConverters(); projectConfig = serializer.DeserializeFromFile<ProjectConfig>(opts.ProjectConfigPath, converters); } catch (Exception e) { Console.WriteLine("Can't parse project config:"); Console.WriteLine(e.Message); return 1; } // Execute build var builder = new Builder(moduleLoader, _logger); var parentDirectory = opts.OutputPath; if (string.IsNullOrEmpty(parentDirectory)) { // Config file's directory parentDirectory = new FileInfo(opts.ProjectConfigPath).Directory?.FullName; } var pipeline = new PipelineRunner(new PipelineConfig { BaseDirectory = parentDirectory }, _logger); bool success = builder.Build(pipeline, projectConfig, opts.BuildTarget); return success ? 0 : 1; } /// <summary> /// Discover build agents on the network. /// </summary> private static int Scan(ScanSubOptions opts) { Console.Title = "SeudoBuild • Scan"; Console.WriteLine(Header); Console.WriteLine("Looking for build agents. Press any key to exit."); // FIXME fill in port from command line argument var locator = new AgentLocator(5511); try { locator.Start(); } catch { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Could not start build agent discovery client"); Console.ResetColor(); return 1; } // FIXME don't hard-code port locator.AgentFound += (agent) => { _logger.Write($"{agent.AgentName} ({agent.Address})", LogType.Bullet); }; locator.AgentLost += (agent) => { _logger.Write($"Lost agent: {agent.AgentName} ({agent.Address})", LogType.Bullet); }; Console.WriteLine(); Console.ReadKey(); return 0; } /// <summary> /// Submit a build job to another agent. /// </summary> private static int Submit(SubmitSubOptions opts) { Console.Title = "SeudoBuild • Submit"; Console.WriteLine(Header); string configJson = null; try { configJson = File.ReadAllText(opts.ProjectConfigPath); } catch { _logger.Write("Project could not be read from " + opts.ProjectConfigPath, LogType.Failure); return 1; } var buildSubmitter = new BuildSubmitter(_logger); try { // Find agent on the network, with timeout var discoveryClient = new UdpDiscoveryClient(); buildSubmitter.Submit(discoveryClient, configJson, opts.BuildTarget, opts.AgentName); } catch (Exception e) { _logger.Write("Could not submit job: " + e.Message, LogType.Failure); return 1; } return 0; } /// <summary> /// Receive build jobs from other agents or clients, queue them, and execute them. /// Continue listening until user exits. /// </summary> private static int Queue(QueueSubOptions opts) { Console.Title = "SeudoBuild • Queue"; Console.WriteLine(Header); //string agentName = string.IsNullOrEmpty(opts.AgentName) ? AgentName.GetUniqueAgentName() : opts.AgentName; // FIXME pull port from command line argument, and incorporate into ServerBeacon object int port = 5511; if (opts.Port.HasValue) { port = opts.Port.Value; } // Starting the Nancy server will automatically execute the Bootstrapper class var uri = new Uri($"http://localhost:{port}"); using (var host = new NancyHost(uri)) { _logger.Write(""); try { host.Start(); _logger.Write("Build Queue", LogType.Header); _logger.Write(""); _logger.Write("Started build agent server: " + uri, LogType.Bullet); try { // FIXME configure the port from a command line argument var serverInfo = new UdpDiscoveryBeacon { Port = 5511 }; var discovery = new UdpDiscoveryServer(serverInfo); discovery.Start(); _logger.Write("Build agent discovery beacon started", LogType.Bullet); } catch { _logger.Write("Could not initialize build agent discovery beacon", LogType.Alert); } } catch (Exception e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Could not start build server: " + e.Message); Console.ResetColor(); return 1; } Console.WriteLine(""); Console.WriteLine("Press any key to exit."); Console.ReadKey(); } return 0; } /// <summary> /// Deploy a build product on the local machine. /// </summary> private static int Deploy(DeploySubOptions opts) { return 0; } /// <summary> /// Display the unique name for this agent. /// </summary> private static int ShowAgentName(NameSubOptions opts) { string name; name = opts.Random ? AgentName.GetRandomName() : AgentName.GetUniqueAgentName(); Console.WriteLine(); Console.WriteLine(name); Console.WriteLine(); return 0; } } }
mstevenson/SeudoBuild
SeudoBuild.Agent/Program.cs
C#
mit
10,540
35.435986
192
0.519088
false
<section ng-controller="DashboardController" ng-init="createdCourseList()"> <div class="row mt"> <div class="col-lg-12"> <div class="form-panel"> <div class="chat-room-head"> <h3> Professor Dashboard</h3> </div> <!-- <div class="page-header centered"> <h1> Professor Dashboard</h1> </div> --> <!-- <div class="room-desk"> <p class="pull-left lead">My Course (active course)</p> <a class="pull-right btn btn-lg btn-theme02" href="../courses/create">+ create course</a> </div> --> <div class="row"> <div class="col-lg-6" > <p class="lead text-center"> My Course (active course) </p> <div class="row list-group"> <div class="col-lg-12 col-md-12 col-sm-12 mb" ng-repeat="course in courses | filter:{active: true}"> <div class="pn" > <a ng-controller="CoursesController" ng-init="findNumStudentEnrolled(); getNumQuiz();" ui-sref="courses.view({courseId: course._id})" class="list-group-item"> {{course.semester}} {{course.year}} <h4> {{course.number}} {{course.name}} </h4> <button id = "edit" class="btn btn-default btn-sm pull-right" type="submit" ng-controller="CoursesListController" data-ng-click="$event.preventDefault(); $event.stopPropagation(); modalUpdate('lg', course)" > Edit </button> Number of students: {{course.enrolledStudents.length}} </br> Number of quizzes: {{numQuizzesInCourse[course._id]}} </a> </div> <!-- <div> Popover (working) -> <div ng-model="name" mydirective=""></div> </div> <div> Popover uib (notworking- uib-popover-html) -> <div ng-model="name" mydirectiveuib=""></div> </div> --> </div> <!-- <button uib-popover="I appeared on mouse enter!" popover-trigger="mouseenter" popover-placement="right" type="button" class="btn btn-default">Mouseenter</button> --> </div> </div> <div class="col-lg-6 text-center" > <a class="btn btn-lg btn-theme02 " id="submit" href="../courses/create">+ create course</a> </div> </div> <div class="row" style="margin-bottom: 30px;"> <div class="col-md-12"> <button type="button" class="btn btn-default" ng-click="isCollapsed = !isCollapsed">List all deactive courses</button> <hr> <div collapse="isCollapsed"> <!-- uib-collapse only works with bootstrap version 0.14.X --> <div class="list-group"> <div class="col-lg-12 col-md-12 col-sm-12 mb" ng-repeat="course in courses | filter:{active: false}"> <div class="pn" > <a id="course" ng-controller="CoursesController" ng-init="findNumStudentEnrolled(course._id); getNumQuiz(course._id);" ui-sref="courses.view({courseId: course._id})" class="list-group-item"> {{course.semester}} {{course.year}} <h4> {{course.number}} {{course.name}} </h4> <button id = "edit" class="btn btn-default btn-sm pull-right" type="submit" ng-controller="CoursesListController" data-ng-click="$event.preventDefault(); $event.stopPropagation(); modalUpdate('lg', course)" > Edit </button> Number of students: {{numStudentInCourse[course._id]}} </br> Number of quizzes: {{numQuizzesInCourse[course._id]}} </a> </div> </div> </div> </div> </div> </div> </div> </div><!-- col-lg-12--> </div><!-- /row --> </section>
GetItXL/iClass
modules/users/client/views/dashboard/professor-dashboard.client.view.html
HTML
mit
4,811
56.963855
270
0.426938
false
# Elevator of the Americas Welcome! This is a small project that describes an elevator in code - including dispatching and interacting with the elevator. Desired requirements: * The elevator bank must have at least 3 elevators * The elevator bank must have a way to have elevators dispatched to certain floors * The elevators must follow rules as to which one is dispatched to which floor. * When we instantiate an elevator bank, let's make sure the elevators are on random floors so we have a realistic experience. # Example ```ruby bank = ElevatorOfAmericas::ElevatorBank.new bank.dispatch_to(3, :down) # => Figures out which elevator can be dispatched to the elevator and sends it there for a certain direction bank.elevators # => Returns all elevators and where they are and perhaps state (idle, moving_up, moving_down) ``` # What to do The spec files are mostly empty or missing, we'd like to fill them out to ensure that we have a good mix of tests of different types: unit, integration, acceptance, etc. The goal is not only to write some tests, but also to have a good conversation about what good testing looks like: what's the appropriate amount and why? Although there are no time limits, we don't want to take up too much of your time, a few hours should be sufficient. Focus on quality! # Authors Robert Ross, Stafford Brooke, Phillip Baker
phillbaker/eoa-qa
README.md
Markdown
mit
1,372
48
323
0.772595
false
import { task } from 'gulp'; import { join } from 'path'; import { config } from '../utils/config'; import { sequenceTask } from '../utils/sequence-task'; import { readFileSync, writeFileSync } from 'fs'; const serve = require('browser-sync'); const webpack = require('webpack'); const webpackDevMiddelware = require('webpack-dev-middleware'); const webpackHotMiddelware = require('webpack-hot-middleware'); const proxyMiddleware = require('http-proxy-middleware'); const helper = require('../../../config/helper'); const interceptor = require('../../../config/interceptor'); const devConfigPath = join(config.webpackConfigPath, 'webpack.dev'); const prodConfigPath = join(config.webpackConfigPath, 'webpack.prod'); task('serve', sequenceTask('clean', 'docs', ':serve')); task(':serve', () => { const devConfig = require(devConfigPath); const appEntry = devConfig.entry.app; devConfig.entry.app = [ 'webpack-hot-middleware/client?noInfo=true&reload=true', ...appEntry ]; const proxyConfig = helper.getProxyConfig(); let target = proxyConfig.host; if (proxyConfig.port) { target = target += ':' + proxyConfig.port + '/'; } if (proxyConfig.path) { target = target + proxyConfig.path; } const compiler = webpack(devConfig); serve({ port: process.env.PORT || 9009, open: true, server: { baseDir: config.appPath }, middleware: [ helper.isProxy() ? proxyMiddleware(proxyConfig.prefix, { target }) : interceptor, webpackDevMiddelware(compiler, { stats: { chunks: false, modules: false }, publicPath: devConfig.output.publicPath }), webpackHotMiddelware(compiler) ] }); // 监听模拟数据改变,自动刷新 // serve.watch(root + '/mock/**/*.js').on('change', serve.reload); // serve.watch(root + '/index.html').on('change', serve.reload); }); task('build:demo', sequenceTask('docs', 'build:demo:webpack', 'build:replace:basehref')); task('build:demo:webpack', (cb?: Function) => { let buildConfig = require(prodConfigPath); if (helper.isDev()) { buildConfig = require(devConfigPath); } webpack(buildConfig, (err: any, stats: any) => { if (err) { console.log('webpack', err); } console.log('[webpack]', stats.toString({ chunks: false, errorDetails: true })); if (cb) { cb(); } }); }); task('build:replace:basehref', () => { const docsIndex = join(config.appPath, '../docs/index.html'); let indexContent = readFileSync(docsIndex, 'utf-8'); indexContent = indexContent.replace('base href="/"', 'base href="/measure/"'); writeFileSync(docsIndex, indexContent, 'utf-8'); });
zxhfighter/measure
tools/gulp/tasks/serve.ts
TypeScript
mit
2,930
29.25
89
0.592287
false
.nav, .pagination, .carousel, .panel-title a { cursor: pointer; } .done-true { text-decoration: line-through; color: #ddd; } .form-control[disabled], .form-control[readonly], .fieldset[disabled], .form-control { cursor: pointer; background-color: white; }
RichardHill/swingTrader
app/assets/css/main.css
CSS
mit
272
26.3
86
0.676471
false
// TODO: write a test that ensures that Quagga.decodeSingle returns a Promise when it should // TODO: write a test that tests the multiple: true decoding option, allowing for multiple barcodes in // a single image to be returned. // TODO: write a test that allows for locate: false and locator configs to be tested. import Quagga from '../../src/quagga'; import { QuaggaJSConfigObject } from '../../type-definitions/quagga'; import { expect } from 'chai'; import ExternalCode128Reader from '../../src/reader/code_128_reader'; // add it.allowFail see https://github.com/kellyselden/mocha-helpers/pull/4 // also see https://github.com/mochajs/mocha/issues/1480#issuecomment-487074628 if (typeof it.allowFail === 'undefined') { it.allowFail = (title: string, callback: Function) => { it(title, function() { return Promise.resolve().then(() => { return callback.apply(this, arguments); }).catch((err) => { console.trace('* error during test', err); this.skip(); }); }); }; } function runDecoderTest(name: string, config: QuaggaJSConfigObject, testSet: Array<{ name: string, result: string, format: string }>) { describe(`Decoder ${name}`, () => { testSet.forEach((sample) => { it.allowFail(`decodes ${sample.name}`, async function() { this.timeout(20000); // need to set a long timeout because laptops sometimes lag like hell in tests when they go low power const thisConfig = { ...config, src: `${typeof window !== 'undefined' ? '/' : ''}test/fixtures/${name}/${sample.name}`, }; const result = await Quagga.decodeSingle(thisConfig); // // console.warn(`* Expect result ${JSON.stringify(result)} to be an object`); expect(result).to.be.an('Object'); expect(result.codeResult).to.be.an('Object'); expect(result.codeResult.code).to.equal(sample.result); expect(result.codeResult.format).to.equal(sample.format); expect(Quagga.canvas).to.be.an('Object'); expect(Quagga.canvas.dom).to.be.an('Object'); expect(Quagga.canvas.ctx).to.be.an('Object'); }); }); }); } function generateConfig(configOverride: QuaggaJSConfigObject = {}) { const config: QuaggaJSConfigObject = { inputStream: { size: 640, ...configOverride.inputStream, }, locator: { patchSize: 'medium', halfSample: true, ...configOverride.locator, }, numOfWorkers: 0, decoder: { readers: ['ean_reader'], ...configOverride.decoder, }, locate: configOverride.locate, src: null, }; return config; } describe('End-To-End Decoder Tests with Quagga.decodeSingle', () => { runDecoderTest('ean', generateConfig(), [ { 'name': 'image-001.jpg', 'result': '3574660239843', format: 'ean_13' }, { 'name': 'image-002.jpg', 'result': '8032754490297', format: 'ean_13' }, { 'name': 'image-004.jpg', 'result': '9002233139084', format: 'ean_13' }, { 'name': 'image-003.jpg', 'result': '4006209700068', format: 'ean_13' }, { 'name': 'image-005.jpg', 'result': '8004030044005', format: 'ean_13' }, { 'name': 'image-006.jpg', 'result': '4003626011159', format: 'ean_13' }, { 'name': 'image-007.jpg', 'result': '2111220009686', format: 'ean_13' }, { 'name': 'image-008.jpg', 'result': '9000275609022', format: 'ean_13' }, { 'name': 'image-009.jpg', 'result': '9004593978587', format: 'ean_13' }, { 'name': 'image-010.jpg', 'result': '9002244845578', format: 'ean_13' }, ]); // TODO: note that the FORMAT reported from a supplement equals the parent. What exactly is the // difference between a supplement and a separate reader? is it just semantic? runDecoderTest('ean_extended', generateConfig({ inputStream: { size: 800, singleChannel: false, }, decoder: { readers: [{ format: 'ean_reader', config: { supplements: [ 'ean_5_reader', 'ean_2_reader', ], }, }], }, }), [ { 'name': 'image-001.jpg', 'result': '900437801102701', format: 'ean_13' }, { 'name': 'image-002.jpg', 'result': '419871600890101', format: 'ean_13' }, { 'name': 'image-003.jpg', 'result': '419871600890101', format: 'ean_13' }, { 'name': 'image-004.jpg', 'result': '978054466825652495', format: 'ean_13' }, { 'name': 'image-005.jpg', 'result': '419664190890712', format: 'ean_13' }, { 'name': 'image-006.jpg', 'result': '412056690699101', format: 'ean_13' }, { 'name': 'image-007.jpg', 'result': '419204531290601', format: 'ean_13' }, { 'name': 'image-008.jpg', 'result': '419871600890101', format: 'ean_13' }, { 'name': 'image-009.jpg', 'result': '978054466825652495', format: 'ean_13' }, { 'name': 'image-010.jpg', 'result': '900437801102701', format: 'ean_13' }, ]); runDecoderTest('code_128', { inputStream: { size: 800, singleChannel: false, } }, [ { 'name': 'image-001.jpg', 'result': '0001285112001000040801', format: 'code_128' }, { 'name': 'image-002.jpg', 'result': 'FANAVF14617104', format: 'code_128' }, { 'name': 'image-003.jpg', 'result': '673023', format: 'code_128' }, { 'name': 'image-004.jpg', 'result': '010210150301625334', format: 'code_128' }, { 'name': 'image-005.jpg', 'result': '419055603900009001012999', format: 'code_128' }, { 'name': 'image-006.jpg', 'result': '419055603900009001012999', format: 'code_128' }, { 'name': 'image-007.jpg', 'result': '420957479499907123456123456781', format: 'code_128' }, { 'name': 'image-008.jpg', 'result': '1020185021797280784055', format: 'code_128' }, { 'name': 'image-009.jpg', 'result': '0001285112001000040801', format: 'code_128' }, { 'name': 'image-010.jpg', 'result': '673023', format: 'code_128' }, // TODO: need to implement having different inputStream parameters to be able to // read this one -- it works only with inputStream size set to 1600 presently, but // other samples break at that high a size. // { name: 'image-011.png', result: '33c64780-a9c0-e92a-820c-fae7011c11e2' }, ]); runDecoderTest( 'code_39', generateConfig({ decoder: { readers: ['code_39_reader'], } }), [ { 'name': 'image-001.jpg', 'result': 'B3% $DAD$', format: 'code_39' }, { 'name': 'image-003.jpg', 'result': 'CODE39', format: 'code_39' }, { 'name': 'image-004.jpg', 'result': 'QUAGGAJS', format: 'code_39' }, { 'name': 'image-005.jpg', 'result': 'CODE39', format: 'code_39' }, { 'name': 'image-006.jpg', 'result': '2/4-8/16-32', format: 'code_39' }, { 'name': 'image-007.jpg', 'result': '2/4-8/16-32', format: 'code_39' }, { 'name': 'image-008.jpg', 'result': 'CODE39', format: 'code_39' }, { 'name': 'image-009.jpg', 'result': '2/4-8/16-32', format: 'code_39' }, // TODO: image 10 in this set appears to be dependent upon #191 { 'name': 'image-010.jpg', 'result': 'CODE39', format: 'code_39' }, { 'name': 'image-011.jpg', 'result': '4', format: 'code_39' }, ]); runDecoderTest( 'code_39_vin', generateConfig({ inputStream: { size: 1280, sequence: false, }, locator: { halfSample: false, }, decoder: { readers: ['code_39_vin_reader'], }, }), [ { name: 'image-001.jpg', result: '2HGFG1B86BH501831', format: 'code_39_vin' }, { name: 'image-002.jpg', result: 'JTDKB20U887718156', format: 'code_39_vin' }, // image-003 only works on the second run of a decode of it and only in browser?! wtf? { name: 'image-003.jpg', result: 'JM1BK32G071773697', format: 'code_39_vin' }, { name: 'image-004.jpg', result: 'WDBTK75G94T028954', format: 'code_39_vin' }, { name: 'image-005.jpg', result: '3VW2K7AJ9EM381173', format: 'code_39_vin' }, { name: 'image-006.jpg', result: 'JM1BL1H4XA1335663', format: 'code_39_vin' }, { name: 'image-007.jpg', result: 'JHMGE8H42AS021233', format: 'code_39_vin' }, { name: 'image-008.jpg', result: 'WMEEJ3BA4DK652562', format: 'code_39_vin' }, { name: 'image-009.jpg', result: 'WMEEJ3BA4DK652562', format: 'code_39_vin' }, //yes, 8 and 9 are same barcodes, different images slightly { name: 'image-010.jpg', result: 'WMEEJ3BA4DK652562', format: 'code_39_vin' }, // 10 also { name: 'image-011.jpg', result: '5FNRL38488B411196', format: 'code_39_vin' }, ] ); runDecoderTest( 'code_32', generateConfig({ inputStream: { size: 1280, }, locator: { patchSize: 'large', halfSample: true, }, numOfWorkers: 4, decoder: { readers: ['code_32_reader'] } }), [ { name: 'image-1.jpg', result: 'A123456788', format: 'code_32_reader' }, { name: 'image-2.jpg', result: 'A931028462', format: 'code_32_reader' }, { name: 'image-3.jpg', result: 'A931028462', format: 'code_32_reader' }, { name: 'image-4.jpg', result: 'A935776043', format: 'code_32_reader' }, { name: 'image-5.jpg', result: 'A935776043', format: 'code_32_reader' }, { name: 'image-6.jpg', result: 'A012745182', format: 'code_32_reader' }, { name: 'image-7.jpg', result: 'A029651039', format: 'code_32_reader' }, { name: 'image-8.jpg', result: 'A029651039', format: 'code_32_reader' }, { name: 'image-9.jpg', result: 'A015896018', format: 'code_32_reader' }, { name: 'image-10.jpg', result: 'A015896018', format: 'code_32_reader' }, ] ); runDecoderTest( 'ean_8', generateConfig({ decoder: { readers: ['ean_8_reader'] } }), [ { 'name': 'image-001.jpg', 'result': '42191605', format: 'ean_8' }, { 'name': 'image-002.jpg', 'result': '42191605', format: 'ean_8' }, { 'name': 'image-003.jpg', 'result': '90311208', format: 'ean_8' }, // TODO: image-004 fails in browser, this is new to running in cypress vs PhantomJS. It does not fail in node. Likely similar problem to #190 { 'name': 'image-004.jpg', 'result': '24057257', format: 'ean_8' }, // {"name": "image-005.jpg", "result": "90162602"}, { 'name': 'image-006.jpg', 'result': '24036153', format: 'ean_8' }, // {"name": "image-007.jpg", "result": "42176817"}, { 'name': 'image-008.jpg', 'result': '42191605', format: 'ean_8' }, { 'name': 'image-009.jpg', 'result': '42242215', format: 'ean_8' }, { 'name': 'image-010.jpg', 'result': '42184799', format: 'ean_8' }, ] ); runDecoderTest( 'upc', generateConfig({ decoder: { readers: ['upc_reader'] } }), [ { 'name': 'image-001.jpg', 'result': '882428015268', format: 'upc_a' }, { 'name': 'image-002.jpg', 'result': '882428015268', format: 'upc_a' }, { 'name': 'image-003.jpg', 'result': '882428015084', format: 'upc_a' }, { 'name': 'image-004.jpg', 'result': '882428015343', format: 'upc_a' }, { 'name': 'image-005.jpg', 'result': '882428015343', format: 'upc_a' }, { 'name': 'image-006.jpg', 'result': '882428015046', format: 'upc_a' }, { 'name': 'image-007.jpg', 'result': '882428015084', format: 'upc_a' }, { 'name': 'image-008.jpg', 'result': '882428015046', format: 'upc_a' }, { 'name': 'image-009.jpg', 'result': '039047013551', format: 'upc_a' }, { 'name': 'image-010.jpg', 'result': '039047013551', format: 'upc_a' }, ] ); runDecoderTest( 'upc_e', generateConfig({ decoder: { readers: ['upc_e_reader'] } }), [ { 'name': 'image-001.jpg', 'result': '04965802', format: 'upc_e' }, { 'name': 'image-002.jpg', 'result': '04965802', format: 'upc_e' }, { 'name': 'image-003.jpg', 'result': '03897425', format: 'upc_e' }, { 'name': 'image-004.jpg', 'result': '05096893', format: 'upc_e' }, { 'name': 'image-005.jpg', 'result': '05096893', format: 'upc_e' }, { 'name': 'image-006.jpg', 'result': '05096893', format: 'upc_e' }, { 'name': 'image-007.jpg', 'result': '03897425', format: 'upc_e' }, { 'name': 'image-008.jpg', 'result': '01264904', format: 'upc_e' }, { 'name': 'image-009.jpg', 'result': '01264904', format: 'upc_e' }, { 'name': 'image-010.jpg', 'result': '01264904', format: 'upc_e' }, ] ); runDecoderTest( 'codabar', generateConfig({ decoder: { readers: ['codabar_reader'] } }), [ { 'name': 'image-001.jpg', 'result': 'A10/53+17-70D', format: 'codabar' }, { 'name': 'image-002.jpg', 'result': 'B546745735B', format: 'codabar' }, { 'name': 'image-003.jpg', 'result': 'C$399.95A', format: 'codabar' }, { 'name': 'image-004.jpg', 'result': 'B546745735B', format: 'codabar' }, { 'name': 'image-005.jpg', 'result': 'C$399.95A', format: 'codabar' }, { 'name': 'image-006.jpg', 'result': 'B546745735B', format: 'codabar' }, { 'name': 'image-007.jpg', 'result': 'C$399.95A', format: 'codabar' }, { 'name': 'image-008.jpg', 'result': 'A16:9/4:3/3:2D', format: 'codabar' }, { 'name': 'image-009.jpg', 'result': 'C$399.95A', format: 'codabar' }, { 'name': 'image-010.jpg', 'result': 'C$399.95A', format: 'codabar' }, ] ); runDecoderTest( 'i2of5', generateConfig({ inputStream: { size: 800, singleChannel: false }, locator: { patchSize: 'small', halfSample: false, }, decoder: { readers: ['i2of5_reader'], }, }), [ { 'name': 'image-001.jpg', 'result': '2167361334', format: 'i2of5' }, { 'name': 'image-002.jpg', 'result': '2167361334', format: 'i2of5' }, { 'name': 'image-003.jpg', 'result': '2167361334', format: 'i2of5' }, { 'name': 'image-004.jpg', 'result': '2167361334', format: 'i2of5' }, { 'name': 'image-005.jpg', 'result': '2167361334', format: 'i2of5' }, ] ); runDecoderTest( '2of5', generateConfig({ inputStream: { size: 800, singleChannel: false }, decoder: { readers: ['2of5_reader'], }, }), [ { 'name': 'image-001.jpg', 'result': '9577149002', format: '2of5' }, { 'name': 'image-002.jpg', 'result': '9577149002', format: '2of5' }, { 'name': 'image-003.jpg', 'result': '5776158811', format: '2of5' }, { 'name': 'image-004.jpg', 'result': '0463381455', format: '2of5' }, { 'name': 'image-005.jpg', 'result': '3261594101', format: '2of5' }, { 'name': 'image-006.jpg', 'result': '3261594101', format: '2of5' }, { 'name': 'image-007.jpg', 'result': '3261594101', format: '2of5' }, { 'name': 'image-008.jpg', 'result': '6730705801', format: '2of5' }, { 'name': 'image-009.jpg', 'result': '5776158811', format: '2of5' }, { 'name': 'image-010.jpg', 'result': '5776158811', format: '2of5' }, ] ); runDecoderTest( 'code_93', generateConfig({ inputStream: { size: 800, singleChannel: false }, locator: { patchSize: 'large', halfSample: true, }, decoder: { readers: ['code_93_reader'], }, }), [ { 'name': 'image-001.jpg', 'result': 'WIWV8ETQZ1', format: 'code_93' }, { 'name': 'image-002.jpg', 'result': 'EH3C-%GU23RK3', format: 'code_93' }, { 'name': 'image-003.jpg', 'result': 'O308SIHQOXN5SA/PJ', format: 'code_93' }, { 'name': 'image-004.jpg', 'result': 'DG7Q$TV8JQ/EN', format: 'code_93' }, { 'name': 'image-005.jpg', 'result': 'DG7Q$TV8JQ/EN', format: 'code_93' }, { 'name': 'image-006.jpg', 'result': 'O308SIHQOXN5SA/PJ', format: 'code_93' }, { 'name': 'image-007.jpg', 'result': 'VOFD1DB5A.1F6QU', format: 'code_93' }, { 'name': 'image-008.jpg', 'result': 'WIWV8ETQZ1', format: 'code_93' }, { 'name': 'image-009.jpg', 'result': '4SO64P4X8 U4YUU1T-', format: 'code_93' }, { 'name': 'image-010.jpg', 'result': '4SO64P4X8 U4YUU1T-', format: 'code_93' }, ] ); }); describe('Parallel decoding works', () => { it('decodeSingle running in parallel', async () => { // TODO: we should throw in some other formats here too. const testSet = [ { 'name': 'image-001.jpg', 'result': '3574660239843', format: 'ean_13' }, { 'name': 'image-002.jpg', 'result': '8032754490297', format: 'ean_13' }, { 'name': 'image-004.jpg', 'result': '9002233139084', format: 'ean_13' }, { 'name': 'image-003.jpg', 'result': '4006209700068', format: 'ean_13' }, { 'name': 'image-005.jpg', 'result': '8004030044005', format: 'ean_13' }, { 'name': 'image-006.jpg', 'result': '4003626011159', format: 'ean_13' }, { 'name': 'image-007.jpg', 'result': '2111220009686', format: 'ean_13' }, { 'name': 'image-008.jpg', 'result': '9000275609022', format: 'ean_13' }, { 'name': 'image-009.jpg', 'result': '9004593978587', format: 'ean_13' }, { 'name': 'image-010.jpg', 'result': '9002244845578', format: 'ean_13' }, ]; const promises: Array<Promise<any>> = []; testSet.forEach(sample => { const config = generateConfig(); config.src = `${typeof window !== 'undefined' ? '/' : ''}test/fixtures/ean/${sample.name}`; promises.push(Quagga.decodeSingle(config)); }); const results = await Promise.all(promises).catch((err) => { console.warn('* error decoding simultaneously', err); throw(err); }); const testResults = testSet.map(x => x.result); results.forEach((r, index) => { expect(r).to.be.an('object'); expect(r.codeResult).to.be.an('object'); expect(r.codeResult.code).to.equal(testResults[index]); }); }); }); describe('External Reader Test, using stock code_128 reader', () => { describe('works', () => { before(() => { Quagga.registerReader('external_code_128_reader', ExternalCode128Reader); }); runDecoderTest( 'code_128', generateConfig({ inputStream: { size: 800, singleChannel: false, }, decoder: { readers: ['external_code_128_reader'], }, }), [ { 'name': 'image-001.jpg', 'result': '0001285112001000040801', format: 'code_128' }, { 'name': 'image-002.jpg', 'result': 'FANAVF14617104', format: 'code_128' }, { 'name': 'image-003.jpg', 'result': '673023', format: 'code_128' }, { 'name': 'image-004.jpg', 'result': '010210150301625334', format: 'code_128' }, { 'name': 'image-005.jpg', 'result': '419055603900009001012999', format: 'code_128' }, { 'name': 'image-006.jpg', 'result': '419055603900009001012999', format: 'code_128' }, { 'name': 'image-007.jpg', 'result': '420957479499907123456123456781', format: 'code_128' }, { 'name': 'image-008.jpg', 'result': '1020185021797280784055', format: 'code_128' }, { 'name': 'image-009.jpg', 'result': '0001285112001000040801', format: 'code_128' }, { 'name': 'image-010.jpg', 'result': '673023', format: 'code_128' }, // TODO: need to implement having different inputStream parameters to be able to // read this one -- it works only with inputStream size set to 1600 presently, but // other samples break at that high a size. // { name: 'image-011.png', result: '33c64780-a9c0-e92a-820c-fae7011c11e2' }, ] ); }); });
ericblade/quaggaJS
test/integration/integration.spec.ts
TypeScript
mit
21,244
50.814634
154
0.518311
false
import copy import pytest from peek.line import InvalidIpAddressException, Line, InvalidStatusException # 127.0.0.1 - - [01/Jan/1970:00:00:01 +0000] "GET / HTTP/1.1" 200 193 "-" "Python" test_line_contents = { 'ip_address': '127.0.0.1', 'timestamp': '[01/Jan/1970:00:00:01 +0000]', 'verb': 'GET', 'path': '/', 'status': '200', 'size': '193', 'referrer': '-', 'user_agent': 'Python' } def get_updated_line_contents(updates=None): test_contents = copy.deepcopy(test_line_contents) if updates is not None: test_contents.update(updates) return test_contents test_line = Line(line_contents=test_line_contents) class TestLineInstantiation: @pytest.mark.parametrize('expected,actual', [ ('127.0.0.1', test_line.ip_address), (1, test_line.timestamp), ('GET', test_line.verb), ('/', test_line.path), (200, test_line.status), (193, test_line.byte_count), ('-', test_line.referrer), ('Python', test_line.user_agent) ]) def test_retrieval(self, expected, actual): assert expected == actual class TestLineExceptions: def test_passing_invalid_ip_address_throws_exception(self): with pytest.raises(InvalidIpAddressException): line = Line(line_contents=get_updated_line_contents({'ip_address': 'foobar'})) def test_passing_non_parseable_status_throws_exception(self): with pytest.raises(InvalidStatusException): Line(line_contents=get_updated_line_contents({'status': 'foobar'}))
purrcat259/peek
tests/unit/test_line.py
Python
mit
1,585
29.480769
90
0.625237
false
/* Noble cread UART service example This example uses Sandeep Mistry's noble library for node.js to read and write from Bluetooth LE characteristics. It looks for a UART characteristic based on a proprietary UART service by Nordic Semiconductor. You can see this service implemented in Adafruit's BLEFriend library. created 30 Nov 2015 by Tom Igoe */ var noble = require('noble'); //noble library var util = require('util'); // utilities library // make an instance of the eventEmitter library: var EventEmitter = require('events').EventEmitter; // constructor function, so you can call new BleUart(): var BleUart = function (uuid) { var service = '6e400001b5a3f393e0a9e50e24dcca9e'; // the service you want var receive, transmit; // transmit and receive BLE characteristics var self = this; // reference to the instance of BleUart self.connected = false; // whether the remote peripheral's connected self.peripheral; // the remote peripheral as an object EventEmitter.call(self); // make a copy of EventEmitter so you can emit events if (uuid) { // if the constructor was called with a different UUID, service = uuid; // then set that as the service to search for } // The scanning function: function scan(state) { if (state === 'poweredOn') { // if the radio's on, scan for this service noble.startScanning([service], false); } // emit a 'scanning' event: self.emit('scanning', state); } // the connect function: self.connect = function(peripheral) { self.peripheral = peripheral; peripheral.connect(); // start connection attempts // the connect function. This is local to the discovery function // because it needs to know the peripheral to discover services: function discover() { // once you know you have a peripheral with the desired // service, you can stop scanning for others: noble.stopScanning(); // get the service you want on this peripheral: peripheral.discoverServices([service],explore); } // called only when the peripheral has the service you're looking for: peripheral.on('connect', discover); // when a peripheral disconnects, run disconnect: peripheral.on('disconnect', self.disconnect); } // the services and characteristics exploration function: // once you're connected, this gets run: function explore(error, services) { // this gets run by the for-loop at the end of the // explore function, below: function getCharacteristics(error, characteristics) { for (var c in characteristics) { // loop over the characteristics if (characteristics[c].notify) { // if one has the notify property receive = characteristics[c]; // then it's the receive characteristic receive.notify(true); // turn on notifications // whenever a notify event happens, get the result. // this handles repeated notifications: receive.on('data', function(data, notification) { if (notification) { // if you got a notification self.emit('data', String(data)); // emit a data event } }); } if (characteristics[c].write) { // if a characteristic has a write property transmit = characteristics[c]; // then it's the transmit characteristic } } // end of getCharacteristics() // if you've got a valid transmit and receive characteristic, // then you're truly connected. Emit a connected event: if (transmit && receive) { self.connected = true; self.emit('connected', self.connected); } } // iterate over the services discovered. If one matches // the UART service, look for its characteristics: for (var s in services) { if (services[s].uuid === service) { services[s].discoverCharacteristics([], getCharacteristics); return; } } } // the BLE write function. If there's a valid transmit characteristic, /// then write data out to it as a Buffer: self.write = function(data) { if (transmit) { transmit.write(new Buffer(data)); } } // the BLE disconnect function: self.disconnect = function() { self.connected = false; } // when the radio turns on, start scanning: noble.on('stateChange', scan); // if you discover a peripheral with the appropriate service, connect: noble.on('discover', self.connect); } util.inherits(BleUart, EventEmitter); // BleUart inherits all the EventEmitter properties module.exports = BleUart; // export BleUart
evejweinberg/SuperHeroAutoPilot
ble-uart.js
JavaScript
mit
4,710
36.086614
91
0.657749
false
var db = require('mongoose'); var Log = require('log'), log = new Log('info'); var clienttracking = require('./clienttracking.js'); var mapreduce = require('./mapreduce.js'); var io = null; exports.server = require('./adnoceserver.js'); exports.setDatabase = function(databaseConfiguration, callback) { var port = databaseConfiguration.port || '27017'; var opts = databaseConfiguration.options || {}; db.connect('mongodb://'+databaseConfiguration.host+':'+port+'/'+databaseConfiguration.name, opts, function(){ log.info('adnoce core - creating database connection to "%s" on host "%s:%s", status: %s', databaseConfiguration.name, databaseConfiguration.host, port, db.connection.readyState); if (db.connection.readyState != 1) { log.error('adnoce core - database connection not ready yet'); } if (typeof(callback) === 'function') callback(db); }); } exports.setServerSocketIO = function(io_, path_) { var path = path_ || '/adnoce'; io = io_.of(path).authorization(function (handshakeData, callback) { // @TODO: auth (e.g. ip-based on handshakeData.address) callback(null, true); }).on('connection', socketConnection); clienttracking.setSocketIO(io); } var socketConnection = function(socket_) { log.info('adnoce core - server socket client "%s" connected to endpoint "%s"', socket_.handshake.address.address, socket_.flags.endpoint); } exports.clientTrackingScript = function(req, res) { res.set({'Content-Type': 'application/javascript', 'Cache-Control': 'no-cache'}); res.send(200, clienttracking.getClientTrackingScript(req)); var additionalData = req.adnoceData || {}; additionalData.adnocetype = 1; clienttracking.processRequest(req, additionalData); }; exports.clientTrackingScriptUpdate = function(req, res) { res.set({'Content-Type': 'text/plain', 'Cache-Control': 'no-cache'}); if (!req.param('p')) res.send(400, '0'); else { res.send(200, '1'); var additionalData = req.adnoceData || {}; if (req.param('t')) additionalData.adnocetype = req.param('t'); clienttracking.updateSessionData(req.sessionID, req.param('p'), additionalData); } }; exports.addEvent = function(type, name, sessionId, additionalData) { clienttracking.addEvent(type, name, sessionId, additionalData); }; exports.MapReduce = mapreduce.MapReduce; var pushServerHealth = function(serverOSObject) { io.emit('health', {uptime: serverOSObject.uptime(), load: serverOSObject.loadavg(), memory: {total: serverOSObject.totalmem(), free: serverOSObject.freemem()}}); } exports.pushServerHealth = pushServerHealth;
hkonitzer/adnoce
lib/adnoce.js
JavaScript
mit
2,627
42.8
185
0.69547
false
class QuestionGroupTracker attr_reader :questions, :question_group_id, :question_group def initialize(question_group_id) @questions = Question.where('question_group_id=?', question_group_id) @counter = 0 @question_group_id = question_group_id @question_group = QuestionGroup.find(question_group_id) end def check_for_new_group(question) if question.question_group_id != @question_group_id || !defined?(@initial_check) initialize(question.question_group_id) @initial_check = true return true else return false end end end
weedySeaDragon/surveyor_gui
app/models/question_group_tracker.rb
Ruby
mit
588
24.565217
84
0.692177
false
import logging import requests from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template from django.utils import timezone from invitations.models import Invitation logger = logging.getLogger('email') sentry = logging.getLogger('sentry') def send_invite(message): try: invite = Invitation.objects.get( id=message.get('id'), status__in=[Invitation.PENDING, Invitation.ERROR], ) except Invitation.DoesNotExist: sentry.error("Invitation to send not found", exc_info=True, extra={'message': message}) return invite.status = Invitation.PROCESSING invite.save() context = { 'invite': invite, 'domain': Site.objects.get_current().domain, } subject = "[ContactOtter] Invitation to join ContactOtter from %s" % (invite.sender) if invite.book: subject = "[ContactOtter] Invitation to share %s's contact book" % (invite.sender) txt = get_template('email/invitation.txt').render(context) html = get_template('email/invitation.html').render(context) try: message = EmailMultiAlternatives( subject=subject, body=txt, from_email="ContactOtter <invites@contactotter.com>", to=[invite.email,], ) message.attach_alternative(html, "text/html") message.send() invite.status = Invitation.SENT invite.sent = timezone.now() invite.save() except: sentry.exception('Problem sending invite', exc_info=True, extra={'invite_id': invite.id}) invite.status = Invitation.ERROR invite.save()
phildini/logtacts
invitations/consumers.py
Python
mit
1,739
34.489796
97
0.660725
false
/* ********************************************************************************************************** * The MIT License (MIT) * * * * Copyright (c) 2016 Hypermediasystems Ges. f. Software mbH * * Web: http://www.hypermediasystems.de * * This file is part of hmssp * * * * 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; using System.Collections.Generic; using System.Dynamic; using System.Reflection; using Newtonsoft.Json; namespace HMS.SP{ /// <summary> /// <para>https://msdn.microsoft.com/en-us/library/office/jj850797.aspx#properties</para> /// </summary> public class ServerSettings : SPBase{ [JsonProperty("__HMSError")] public HMS.Util.__HMSError __HMSError_ { set; get; } [JsonProperty("__status")] public SP.__status __status_ { set; get; } [JsonProperty("__deferred")] public SP.__deferred __deferred_ { set; get; } [JsonProperty("__metadata")] public SP.__metadata __metadata_ { set; get; } public Dictionary<string, string> __rest; // no properties found /// <summary> /// <para> Endpoints </para> /// </summary> static string[] endpoints = { }; public ServerSettings(ExpandoObject expObj) { try { var use_EO = ((dynamic)expObj).entry.content.properties; HMS.SP.SPUtil.expando2obj(use_EO, this, typeof(ServerSettings)); } catch (Exception ex) { } } // used by Newtonsoft.JSON public ServerSettings() { } public ServerSettings(string json) { if( json == String.Empty ) return; dynamic jobject = Newtonsoft.Json.JsonConvert.DeserializeObject(json); dynamic refObj = jobject; if (jobject.d != null) refObj = jobject.d; string errInfo = ""; if (refObj.results != null) { if (refObj.results.Count > 1) errInfo = "Result is Collection, only 1. entry displayed."; refObj = refObj.results[0]; } List<string> usedFields = new List<string>(); usedFields.Add("__HMSError"); HMS.SP.SPUtil.dyn_ValueSet("__HMSError", refObj, this); usedFields.Add("__deferred"); this.__deferred_ = new SP.__deferred(HMS.SP.SPUtil.dyn_toString(refObj.__deferred)); usedFields.Add("__metadata"); this.__metadata_ = new SP.__metadata(HMS.SP.SPUtil.dyn_toString(refObj.__metadata)); this.__rest = new Dictionary<string, string>(); var dyn = ((Newtonsoft.Json.Linq.JContainer)refObj).First; while (dyn != null) { string Name = ((Newtonsoft.Json.Linq.JProperty)dyn).Name; string Value = ((Newtonsoft.Json.Linq.JProperty)dyn).Value.ToString(); if ( !usedFields.Contains( Name )) this.__rest.Add( Name, Value); dyn = dyn.Next; } if( errInfo != "") this.__HMSError_.info = errInfo; } } }
helmuttheis/hmsspx
hmssp/SP.gen/ServerSettings.cs
C#
mit
4,781
44.533333
113
0.515583
false
module BlocVoting.Tally.Resolution where import qualified Data.ByteString as BS data Resolution = Resolution { rCategories :: Int , rEndTimestamp :: Int , rName :: BS.ByteString , rUrl :: BS.ByteString , rVotesFor :: Integer , rVotesTotal :: Integer , rResolved :: Bool } deriving (Show, Eq) updateResolution :: Resolution -> Integer -> Integer -> Resolution updateResolution (Resolution cats endT name url for total resolved) newForVotes newTotalVotes = Resolution cats endT name url (for + newForVotes) (total + newTotalVotes) resolved
XertroV/blocvoting
src/BlocVoting/Tally/Resolution.hs
Haskell
mit
565
28.736842
95
0.730973
false
# Erase duplicate entries from history export HISTCONTROL="erasedups" # Increase history size export HISTSIZE="10000"
ridobe/dotfiles
bash/environment.sh
Shell
mit
118
22.8
38
0.813559
false
<!DOCTYPE html> <html lang="en"> <head> {{ bokeh_css }} {{ bokeh_js }} <style> {% include 'styles.css' %} </style> <meta charset="utf-8"> <title>MolExplorer</title> </head> <body> <div> <h1>Vizard</h1> {{ plot_div|indent(8) }} </div> {{ plot_script|indent(8) }} </body> </html>
MarcusOlivecrona/REINVENT
Vizard/templates/index.html
HTML
mit
387
19.368421
39
0.426357
false
//using System; //using System.Collections.Generic; //using System.Linq; //using System.Text; //using parser; // //namespace runic.lexer //{ // public class Lexer_Bootstrap_Old : Parser_Context // { // public Lexer_Bootstrap_Old(Definition definition) // : base(definition) // { // } // // public override object perform_action(string name, Pattern_Source data, Match match) // { // if (data.name == null) // data.name = name; // // var type = match.pattern.name; // switch (type) // { // case "string": // case "regex": // data = data.patterns[1]; // data.type = type; // return data; // // default: // // throw new Exception("Invalid parser method: " + name + "."); // } // // return data; // } // } //}
silentorb/runic
Runic/lexer/Lexer_Bootstrap_Old.cs
C#
mit
1,047
27.027778
104
0.422967
false
# Instruction Counter Counting number of instructions by `ptrace` system call **This repository is for experimental use, so it may contain some dangerous code. Use this repository at your own risk.** ## Requirement The code is written assuming only when using GCC on Linux. Probably it can not be compiled by compilers other than GCC. Code that assumes x64 architecture is included. In particular, it does not work on the ARM architecture. ## Usage Simply typing `make` will generate a library file named `inst_counter.a` and executable file named `inst_counter.out`. To count the number of instructions, first call `instruction_count_init`. Then surround the range of the code you want to measure with `instruction_count_start` and `instruction_count_end`. In order to accurately measure, it is desirable to compile the range to be measured without optimizing it (by using something like `__attribute__((optimize("0")))`). If you call `instruction_count_set_string` just before the measurement, you can change the string printed when measurement is over. To execute a program which contains measuring code, execute it as follows: ```sh 'inst_counter.out' <program> [<program arguments>...] ``` ## Example `sample.c` is a sample code for operation confirmation. Compile and run it as follows: ```sh make gcc -I./include -o sample sample.c inst_counter.a ./inst_counter.out ./sample ```
ToshinoriTsuboi/dma-virtual-memory
instruction_counter/Readme.md
Markdown
mit
1,399
30.088889
81
0.764832
false
// Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ 'karma-jasmine', 'karma-chrome-launcher', 'karma-spec-reporter', '@angular-devkit/build-angular/plugins/karma', ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, reporters: ['spec'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false }); };
erento/angular-lazy-responsive-images
projects/angular-lazy-responsive-images/karma.conf.js
JavaScript
mit
688
26.52
80
0.636628
false
using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using StockExchangeYahooFinance.DbContext; namespace StockExchangeYahooFinance.Migrations { [DbContext(typeof(YahooFinanceDbContext))] [Migration("20170419132834_updateExAddCountry")] partial class updateExAddCountry { protected override void BuildTargetModel(ModelBuilder modelBuilder) { modelBuilder .HasAnnotation("ProductVersion", "1.1.1") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Companies", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ADR_TSO"); b.Property<string>("ExchangeId"); b.Property<string>("IPOyear"); b.Property<string>("IndustryId"); b.Property<string>("LastSale"); b.Property<string>("MarketCap"); b.Property<string>("Name"); b.Property<string>("RegionId"); b.Property<string>("SectorId"); b.Property<string>("Symbol"); b.Property<string>("Type"); b.HasKey("Id"); b.HasIndex("ExchangeId"); b.HasIndex("IndustryId"); b.HasIndex("RegionId"); b.HasIndex("SectorId"); b.ToTable("Companies"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Country", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CountryCode"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Country"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Currencies", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Code"); b.Property<string>("Currency"); b.Property<string>("Entity"); b.Property<string>("MinorUnit"); b.Property<int>("NumericCode"); b.HasKey("Id"); b.ToTable("Currencies"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Exchange", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClosingTimeLocal"); b.Property<string>("DataProvider"); b.Property<string>("Delay"); b.Property<string>("Name"); b.Property<string>("OpeningTimeLocal"); b.Property<string>("RegionId"); b.Property<string>("StockExchangeId"); b.Property<string>("Suffix"); b.Property<string>("TradingDays"); b.Property<string>("UtcOffsetStandardTime"); b.HasKey("Id"); b.HasIndex("RegionId"); b.ToTable("Exchange"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinanceModel", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("AfterHoursChangeRealtime"); b.Property<string>("AnnualizedGain"); b.Property<string>("Ask"); b.Property<string>("AskRealtime"); b.Property<string>("AverageDailyVolume"); b.Property<string>("Bid"); b.Property<string>("BidRealtime"); b.Property<string>("BookValue"); b.Property<string>("Change"); b.Property<string>("ChangeFromFiftydayMovingAverage"); b.Property<string>("ChangeFromTwoHundreddayMovingAverage"); b.Property<string>("ChangeFromYearHigh"); b.Property<string>("ChangeFromYearLow"); b.Property<string>("ChangePercentRealtime"); b.Property<string>("ChangeRealtime"); b.Property<string>("Change_PercentChange"); b.Property<string>("ChangeinPercent"); b.Property<string>("Commission"); b.Property<string>("CompaniesId"); b.Property<string>("CurencyId"); b.Property<string>("CurrenciesId"); b.Property<string>("Currency"); b.Property<string>("Date"); b.Property<string>("DaysHigh"); b.Property<string>("DaysLow"); b.Property<string>("DaysRange"); b.Property<string>("DaysRangeRealtime"); b.Property<string>("DaysValueChange"); b.Property<string>("DaysValueChangeRealtime"); b.Property<string>("DividendPayDate"); b.Property<string>("DividendShare"); b.Property<string>("DividendYield"); b.Property<string>("EBITDA"); b.Property<string>("EPSEstimateCurrentYear"); b.Property<string>("EPSEstimateNextQuarter"); b.Property<string>("EPSEstimateNextYear"); b.Property<string>("EarningsShare"); b.Property<string>("ErrorIndicationreturnedforsymbolchangedinvalid"); b.Property<string>("ExDividendDate"); b.Property<string>("FiftydayMovingAverage"); b.Property<string>("HighLimit"); b.Property<string>("HoldingsGain"); b.Property<string>("HoldingsGainPercent"); b.Property<string>("HoldingsGainPercentRealtime"); b.Property<string>("HoldingsGainRealtime"); b.Property<string>("HoldingsValue"); b.Property<string>("HoldingsValueRealtime"); b.Property<string>("LastTradeDate"); b.Property<string>("LastTradePriceOnly"); b.Property<string>("LastTradeRealtimeWithTime"); b.Property<string>("LastTradeTime"); b.Property<string>("LastTradeWithTime"); b.Property<string>("LowLimit"); b.Property<string>("MarketCapRealtime"); b.Property<string>("MarketCapitalization"); b.Property<string>("MoreInfo"); b.Property<string>("Name"); b.Property<string>("Notes"); b.Property<string>("OneyrTargetPrice"); b.Property<string>("Open"); b.Property<string>("OrderBookRealtime"); b.Property<string>("PEGRatio"); b.Property<string>("PERatio"); b.Property<string>("PERatioRealtime"); b.Property<string>("PercebtChangeFromYearHigh"); b.Property<string>("PercentChange"); b.Property<string>("PercentChangeFromFiftydayMovingAverage"); b.Property<string>("PercentChangeFromTwoHundreddayMovingAverage"); b.Property<string>("PercentChangeFromYearLow"); b.Property<string>("PreviousClose"); b.Property<string>("PriceBook"); b.Property<string>("PriceEPSEstimateCurrentYear"); b.Property<string>("PriceEPSEstimateNextYear"); b.Property<string>("PricePaid"); b.Property<string>("PriceSales"); b.Property<string>("Rate"); b.Property<string>("SharesOwned"); b.Property<string>("ShortRatio"); b.Property<string>("StockExchange"); b.Property<string>("Symbol"); b.Property<string>("TickerTrend"); b.Property<string>("Time"); b.Property<string>("TradeDate"); b.Property<string>("TwoHundreddayMovingAverage"); b.Property<string>("Volume"); b.Property<string>("YearHigh"); b.Property<string>("YearLow"); b.Property<string>("YearRange"); b.HasKey("Id"); b.HasIndex("CompaniesId"); b.HasIndex("CurrenciesId"); b.ToTable("FinanceModel"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Industry", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Industrie"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Region", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Region"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Sector", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Sector"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Companies", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Exchange", "Exchange") .WithMany() .HasForeignKey("ExchangeId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Industry", "Industry") .WithMany() .HasForeignKey("IndustryId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Region", "Region") .WithMany() .HasForeignKey("RegionId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Sector", "Sector") .WithMany() .HasForeignKey("SectorId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.Exchange", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Region", "Region") .WithMany() .HasForeignKey("RegionId"); }); modelBuilder.Entity("StockExchangeYahooFinance.Data.Models.FinanceModel", b => { b.HasOne("StockExchangeYahooFinance.Data.Models.Companies", "Companies") .WithMany() .HasForeignKey("CompaniesId"); b.HasOne("StockExchangeYahooFinance.Data.Models.Currencies", "Currencies") .WithMany() .HasForeignKey("CurrenciesId"); }); } } }
error505/YahooFinanceApi
StockExchangeYahooFinance/Migrations/20170419132834_updateExAddCountry.Designer.cs
C#
mit
12,032
29.846154
117
0.484289
false
--- layout: post title: swyambhu before the quake nepal swyambhu date: '2015-07-25T18:15:01+02:00' tags: - Instagram - PhotoOfTheDay tumblr_url: http://deepredsky.tumblr.com/post/124997225759/swyambhu-before-the-quake-nepal-swyambhu --- <img src="/tumblr_files/tumblr_ns1mq1tesy1s8ugabo1_1280.jpg"/><br/><p>swyambhu before the quake #nepal #swyambhu #monkeytemple #photooftheday</p>
deepredsky/deepredsky.github.io
_posts/tumblr/2015-07-25-swyambhu-before-the-quake-nepal-swyambhu.html
HTML
mit
383
37.3
145
0.770235
false