text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Use keys instead of iterkeys to go through all keys on clean_query_set
# django from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # standard library def paginate(request, objects, page_size=25): paginator = Paginator(objects, page_size) page = request.GET.get('p') try: paginated_objects = paginator.page(page) except PageNotAnInteger: ...
# django from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # standard library def paginate(request, objects, page_size=25): paginator = Paginator(objects, page_size) page = request.GET.get('p') try: paginated_objects = paginator.page(page) except PageNotAnInteger: ...
install: Clean up after read-package-json's _id mess
'use strict' var defaultTemplate = { package: { dependencies: {}, devDependencies: {}, optionalDependencies: {}, _requiredBy: [], _phantomChildren: {} }, loaded: false, children: [], requiredBy: [], missingDeps: {}, missingDevDeps: {}, path: null, realpath: null } function isLink...
'use strict' var defaultTemplate = { package: { dependencies: {}, devDependencies: {}, optionalDependencies: {}, _requiredBy: [], _phantomChildren: {} }, loaded: false, children: [], requiredBy: [], missingDeps: {}, missingDevDeps: {}, path: null, realpath: null } function isLink...
Clean up code and add timestamp
const quotes = JSON.parse(require('fs').readFileSync('./data/backup-2016-11-03.json', 'utf8')) const config = require('./config') const Twit = require('twit') const T = new Twit(config.oauth_creds) function randomQuote () { return quotes[Math.floor(Math.random() * quotes.length)] } function tweetMessage (quote) { ...
const fs = require('fs') const Twit = require('twit') const config = require('./config') const quotes = JSON.parse(fs.readFileSync('./data/backup-2016-11-03.json', 'utf8')) const T = new Twit(config.oauth_creds) function randomQuote () { return quotes[Math.floor(Math.random() * quotes.length)] } function tweetMess...
Update javadoc for propgation comparison enum
/* * Copyright 2013 MovingBlocks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
/* * Copyright 2013 MovingBlocks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
Remove unnecessary import of a class in the same package.
package com.topsy.jmxproxy; import com.topsy.jmxproxy.jmx.ConnectionManager; import io.dropwizard.Application; import io.dropwizard.assets.AssetsBundle; import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Environment; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JMXProxyApplica...
package com.topsy.jmxproxy; import com.topsy.jmxproxy.jmx.ConnectionManager; import com.topsy.jmxproxy.JMXProxyResource; import io.dropwizard.Application; import io.dropwizard.assets.AssetsBundle; import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Environment; import org.slf4j.Logger; import org.slf4j....
Remove description missing warning from field sets
import styles from './styles/DefaultFieldset.css' import React, {PropTypes} from 'react' export default function Fieldset(props) { const {fieldset, legend, description} = props return ( <fieldset className={styles.root} data-nesting-level={props.level}> <legend className={styles.legend}>{legend || fields...
import styles from './styles/DefaultFieldset.css' import React, {PropTypes} from 'react' export default function Fieldset(props) { const {fieldset, legend, description} = props return ( <fieldset className={styles.root} data-nesting-level={props.level}> <legend className={styles.legend}>{legend || fields...
Fix collecstatic command return value delete_file() method should return a boolean, was missing a return when calling super()
import hashlib from django.contrib.staticfiles.management.commands import collectstatic from cumulus.storage import CloudFilesStorage class Command(collectstatic.Command): def delete_file(self, path, prefixed_path, source_storage): """ Checks if the target file should be deleted if it already ex...
import hashlib from django.contrib.staticfiles.management.commands import collectstatic from cumulus.storage import CloudFilesStorage class Command(collectstatic.Command): def delete_file(self, path, prefixed_path, source_storage): """ Checks if the target file should be deleted if it already ex...
Add a param check to be able to boot with an old cache The parameter is always defined in the bundle. However, in non-debug mode, the kernel needs to be able to boot with the old cache to clear the cache, so we need the parameter check. closes #260
<?php namespace Stof\DoctrineExtensionsBundle; use Stof\DoctrineExtensionsBundle\DependencyInjection\Compiler\SecurityContextPass; use Stof\DoctrineExtensionsBundle\DependencyInjection\Compiler\ValidateExtensionConfigurationPass; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjectio...
<?php namespace Stof\DoctrineExtensionsBundle; use Stof\DoctrineExtensionsBundle\DependencyInjection\Compiler\SecurityContextPass; use Stof\DoctrineExtensionsBundle\DependencyInjection\Compiler\ValidateExtensionConfigurationPass; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjectio...
Replace localhost lookup with static IP to fix test. Calling InetAddress.getLocalHost() will cause a lookup to occur that may fail with a java.net.UnknownHostException if the system the test is running on is not configured correctly. This is often fixed by echoing "127.0.0.1 $HOSTNAME" to /etc/hosts, but in this case...
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Remove index file created in test
#!/usr/bin/env python import unittest import subprocess class TestSimpleMapping(unittest.TestCase): def test_map_1_read(self): subprocess.run(['python', 'bin/sillymap', 'index', 'tests/test_data/reference.fa']) result = subprocess.run(['python', 'bin/sillymap', 'map', 'tests/test_data/reference.fa'...
#!/usr/bin/env python import unittest import subprocess class TestSimpleMapping(unittest.TestCase): def test_map_1_read(self): subprocess.run(['python', 'bin/sillymap', 'index', 'tests/test_data/reference.fa']) result = subprocess.run(['python', 'bin/sillymap', 'map', 'tests/test_data/reference.fa'...
Fix variable we're looking for.
"""General deployment utilities (not Fabric commands).""" from fabric.api import cd, require, local, env from buedafab import deploy def make_archive(): """Create a compressed archive of the project's repository, complete with submodules. TODO We used to used git-archive-all to archive the submodules as ...
"""General deployment utilities (not Fabric commands).""" from fabric.api import cd, require, local, env from buedafab import deploy def make_archive(): """Create a compressed archive of the project's repository, complete with submodules. TODO We used to used git-archive-all to archive the submodules as ...
Correct pbm with empty gtu
<?php /** * This class has been auto-generated by the Doctrine ORM Framework */ class GtuTable extends DarwinTable { /* function witch return an array of countries sorted by id @ListId an array of Id */ public function getCountries($listId) { if(empty($listId)) return array(); $q = Doctrine_Quer...
<?php /** * This class has been auto-generated by the Doctrine ORM Framework */ class GtuTable extends DarwinTable { /* function witch return an array of countries sorted by id @ListId an array of Id */ public function getCountries($listId) { $q = Doctrine_Query::create()-> from('TagGroups t'...
Deal with existing symlinks and add more error checking
#!/usr/bin/python # FIXME Need to handle the case when symlinks already exists import os theme_dir = os.path.expanduser('~/.themes/olpc/gtk-2.0') gtkrc_dest = os.path.join(theme_dir, 'gtkrc') engine_dir = os.path.expanduser('~/.gtk-2.0/engines') engine_dest = os.path.join(engine_dir, 'libolpc.so') src_dir = os.pat...
#!/usr/bin/python # FIXME Need to handle the case when symlinks already exists import os theme_dir = os.path.expanduser('~/.themes/olpc/gtk-2.0') engine_dir = os.path.expanduser('~/.gtk-2.0/engines') src_dir = os.path.abspath(os.path.dirname(__file__)) if not os.path.exists(theme_dir): try: os.makedirs(theme_dir...
Use pg_lowrite for writing resource to PostgreSQL Use pg_lowwrite instead of pg_import for writing resource to PostgreSQL database.
<?php $temp = explode ( '.', $_FILES [ 'fileToUpload' ] [ 'name' ] ); $extension = end ( $temp ); if ( $extension !== 'pdf' ) die ( 'Invalid extension' ); if ( $_FILES [ 'fileToUpload' ] [ 'error' ] > 0 ) { die ( 'Error code: ' . $_FILES [ 'fileToUpload' ] [ 'error' ] ); } else { require_once ( 'da...
<?php $uploadDirectory = 'resourceUploads/'; $temp = explode ( '.', $_FILES [ 'fileToUpload' ] [ 'name' ] ); $extension = end ( $temp ); if ( $extension !== 'pdf' ) die ( 'Invalid extension' ); if ( $_FILES [ 'fileToUpload' ] [ 'error' ] > 0 ) { die ( 'Error code: ' . $_FILES [ 'fileToUpload' ] [ 'erro...
Make authentication adapter available in the request
<?php /* * This file is part of the Active Collab Authentication project. * * (c) A51 doo <info@activecollab.com>. All rights reserved. */ namespace ActiveCollab\Authentication\Adapter; use ActiveCollab\Authentication\AuthenticationResult\Transport\Authentication\AuthenticationTransportInterface; use ActiveColla...
<?php /* * This file is part of the Active Collab Authentication project. * * (c) A51 doo <info@activecollab.com>. All rights reserved. */ namespace ActiveCollab\Authentication\Adapter; use ActiveCollab\Authentication\AuthenticationResult\Transport\Authentication\AuthenticationTransportInterface; use ActiveColla...
tests: Use HTTP 1.1 instead of HTTP 1.0 Envoy does not support HTTP 1.0, so use HTTP 1.1 instead. Signed-off-by: Jarno Rajahalme <0f1ab0ac7dffd9db21aa539af2fd4bb04abc3ad4@covalent.io>
import socket, sys if len(sys.argv) != 6: print('Wrong number of arguments. Usage: ./21-ct-clean-up-nc.py <localport> <timeout> <remote-address> <remote-port> <HTTP path>') localport = int(sys.argv[1]) timeout = int(sys.argv[2]) serverAddr = sys.argv[3] serverPort = int(sys.argv[4]) httpPath = sys.argv[5] if ":" n...
import socket, sys if len(sys.argv) != 6: print('Wrong number of arguments. Usage: ./21-ct-clean-up-nc.py <localport> <timeout> <remote-address> <remote-port> <HTTP path>') localport = int(sys.argv[1]) timeout = int(sys.argv[2]) serverAddr = sys.argv[3] serverPort = int(sys.argv[4]) httpPath = sys.argv[5] if ":" n...
Fix bad indentation that broke PEP8 !
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak backend import This module contains utility tools to import Nagios-like flat files configuration into an Alignak REST backend. """ # Application version and manifest VERSION = (0, 4, 3) __application__ = u"Alignak backend import" __short_version_...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak backend import This module contains utility tools to import Nagios-like flat files configuration into an Alignak REST backend. """ # Application version and manifest VERSION = (0, 4, 3) __application__ = u"Alignak backend import" __short_version__ = '...
Add hooks to plugin API
const attachments = require('./data/attachments'); const { beforeNewThread } = require('./hooks'); module.exports = { getPluginAPI({ bot, knex, config, commands }) { return { bot, knex, config, commands: { manager: commands.manager, addGlobalCommand: commands.addGlobalComm...
const attachments = require('./data/attachments'); module.exports = { getPluginAPI({ bot, knex, config, commands }) { return { bot, knex, config, commands: { manager: commands.manager, addGlobalCommand: commands.addGlobalCommand, addInboxServerCommand: commands.add...
Remove comments from Block implementations
Blockly.JavaScript['roll_forward'] = function(block) { var value_speed = Blockly.JavaScript.valueToCode(block, 'speed', Blockly.JavaScript.ORDER_ATOMIC); var code = 'alert("forward '+value_speed+'");'; return code; }; Blockly.JavaScript['roll_reverse'] = function(block) { var value_speed = Blockly.JavaScript.v...
Blockly.JavaScript['roll_forward'] = function(block) { var value_speed = Blockly.JavaScript.valueToCode(block, 'speed', Blockly.JavaScript.ORDER_ATOMIC); // TODO: Assemble JavaScript into code variable. var code = 'alert("forward '+value_speed+'");'; return code; }; Blockly.JavaScript['roll_reverse'] = functio...
Clarify demo code comment on channels In Go, channels always behave as "first in, first out." Setting the channel's size to 1 makes it behave like a semaphore.
/* Demonstrate how to use channels and goroutines to keep the program alive. Iterate over a slice of numbers, passing each each i to a function that calculates the base10 log of i. We don't actually care what the return value is. Instead, the function just signals a channel that its work is done. Based on ...
/* Demonstrate how to use channels and goroutines to keep the program alive. Iterate over a slice of numbers, passing each each i to a function that calculates the base10 log of i. We don't actually care what the return value is. Instead, the function just signals a channel that its work is done. Based on ...
Make thread-visiblity icon use thread-icon Summary: Made it so thread-visiblity uses thread-icon.react.js instead of its own icon. Test Plan: Checked in thread settings to see if icon still worked. Also checked private threads before and after updates to make sure they still work. And also made sure normal threads st...
// @flow import * as React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { threadTypes, type ThreadType } from 'lib/types/thread-types'; import ThreadIcon from './thread-icon.react'; type Props = {| +threadType: ThreadType, +color: string, |}; function ThreadVisibility(props: Props...
// @flow import * as React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialIcons'; import { threadTypes, type ThreadType } from 'lib/types/thread-types'; type Props = {| +threadType: ThreadType, +color: string, |}; function ThreadVisibility...
Add enabled param and move some params from schema to init for socket-control
// TODO: Remove unnecessary bits from schema AFRAME.registerComponent('socket-controls', { schema: { updateRate: {default: 100}, // Dynamic updateRate in Hz playerId: {default: ''}, socket: {default: null}, enabled: {default: true} }, init: function() { const data = this.data; const sock...
// TODO: Remove unnecessary bits from schema AFRAME.registerComponent('socket-controls', { schema: { previousPos: {default: new THREE.Vector3()}, currentPos: {default: new THREE.Vector3()}, nextPos: {default: new THREE.Vector3()}, updateRate: {default: 100}, // Dynamic updateRate in Hz playerId: ...
Fix deleted line during merge
from django.conf import settings from django.contrib import admin from geotrek.feedback import models as feedback_models if 'modeltranslation' in settings.INSTALLED_APPS: from modeltranslation.admin import TabbedTranslationAdmin else: from django.contrib.admin import ModelAdmin as TabbedTranslationAdmin cla...
from django.conf import settings from django.contrib import admin from geotrek.feedback import models as feedback_models if 'modeltranslation' in settings.INSTALLED_APPS: from modeltranslation.admin import TabbedTranslationAdmin else: from django.contrib.admin import ModelAdmin as TabbedTranslationAdmin cla...
Allow minor versions of python-telegram-bot dep
#!/usr/bin/env python from distutils.core import setup from setuptools import find_packages REQUIREMENTS = [ 'python-telegram-bot~=5.3.0', 'blinker', 'python-dateutil', 'dogpile.cache==0.6.2', 'mongoengine==0.10.6', 'polling', 'pytz', 'ipython', 'ipdb', 'requests', 'apsche...
#!/usr/bin/env python from distutils.core import setup from setuptools import find_packages REQUIREMENTS = [ 'python-telegram-bot==5.3.0', 'blinker', 'python-dateutil', 'dogpile.cache==0.6.2', 'mongoengine==0.10.6', 'polling', 'pytz', 'ipython', 'ipdb', 'requests', 'apsche...
Remove explicit AMD name for greater portability. See http://requirejs.org/docs/api.html#modulename.
// Public object SockJS = (function(){ var _document = document; var _window = window; var utils = {}; <!-- include lib/reventtarget.js --> <!-- include lib/simpleevent.js --> <!-- include lib/eventemitter.js --> <!-- include lib/utils.js --> <!-- include lib/dom.js --> <!-- i...
// Public object SockJS = (function(){ var _document = document; var _window = window; var utils = {}; <!-- include lib/reventtarget.js --> <!-- include lib/simpleevent.js --> <!-- include lib/eventemitter.js --> <!-- include lib/utils.js --> <!-- include lib/dom.js --> <!-- i...
Add tideways config to getcomposer.org
<?php use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; if (class_exists('Tideways\Profiler')) { \Tideways\Profiler::start(array('api_key' => trim(file_get_contents(__DIR__.'/tideways.key')))); } if (!isset($env) ||...
<?php use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; if (!isset($env) || $env !== 'dev') { // force ssl $app->before(function (Request $request) { // skip SSL & non-GET/HEAD requests if (strtol...
Insert Filled Value as Well, otherwise SQLite saves NULL
<?php $message = ""; // initial message echo($_POST['request_data']); if( isset($_POST['request_data']) ){ // Includes database connection include "db_connect.php"; // Gets the data from post $name = $_POST['request_data']; // Makes query with post data $statement = $db->prepare('INSERT INTO requests(name,...
<?php $message = ""; // initial message echo($_POST['request_data']); if( isset($_POST['request_data']) ){ // Includes database connection include "db_connect.php"; // Gets the data from post $name = $_POST['request_data']; // Makes query with post data $statement = $db->prepare('INSERT INTO requests(name)...
Fix noPasswordManager name for docs Fix `noPasswordManager` for documentation. https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:no-password-manager
/** * @ngdoc directive * @name umbraco.directives.directive:noPasswordManager * @attribte * @function * @description * Added attributes to block password manager elements should as LastPass * @example * <example module="umbraco.directives"> * <file name="index.html"> * <input type="text" no-password-manager...
/** * @ngdoc directive * @name umbraco.directives.directive:no-password-manager * @attribte * @function * @description * Added attributes to block password manager elements should as LastPass * @example * <example module="umbraco.directives"> * <file name="index.html"> * <input type="text" no-password-manag...
Remove unused visitor role handing from code.
import { callController } from '../../util/apiConnection'; export const getAvailableRoles = () => { const route = '/roles/available'; const prefix = 'AVAILABLEROLES_GET_ALL_'; return callController(route, prefix); } export const saveRole = (role) => { const route = '/roles'; const prefix = 'ROLE_S...
import { callController } from '../../util/apiConnection'; export const getAvailableRoles = () => { const route = '/roles/available'; const prefix = 'AVAILABLEROLES_GET_ALL_'; return callController(route, prefix); } export const saveRole = (role) => { const route = '/roles'; const prefix = 'ROLE_S...
Switch redis to use the from_url method
class BaseStore(object): def set(self, key, value): raise NotImplementedError def get(self, key): raise NotImplementedError class InMemoryStore(BaseStore): def __init__(self, *args, **kwargs): super(InMemoryStore, self).__init__(*args, **kwargs) self._data = {} def...
class BaseStore(object): def set(self, key, value): raise NotImplementedError def get(self, key): raise NotImplementedError class InMemoryStore(BaseStore): def __init__(self, *args, **kwargs): super(InMemoryStore, self).__init__(*args, **kwargs) self._data = {} def...
Move some functionality into the storage module
import os import errno import importlib from urllib2 import quote def import_consumer(consumer_name): # TODO Make suer that consumer_name will always import the correct module return importlib.import_module('scrapi.consumers.{}'.format(consumer_name)) # :: Str -> Str def doc_id_to_path(doc_id): replacem...
import os import errno import importlib from scrapi import settings def import_consumer(consumer_name): # TODO Make suer that consumer_name will always import the correct module return importlib.import_module('scrapi.consumers.{}'.format(consumer_name)) def build_norm_dir(consumer_name, timestamp, norm_doc...
Add django-filter to the required packages
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist bdist_wininst upload -r pypi') sys.exit() with open('README.rst') as f: readme = f.read() with open('LI...
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist bdist_wininst upload -r pypi') sys.exit() with open('README.rst') as f: readme = f.read() with open('LI...
Update LUA test to perform interpolation
from kat.harness import Query from abstract_tests import AmbassadorTest, ServiceType, HTTP class LuaTest(AmbassadorTest): target: ServiceType def init(self): self.target = HTTP() self.env = ["LUA_SCRIPTS_ENABLED=Processed"] def manifests(self) -> str: return super().manifests() +...
from kat.harness import Query from abstract_tests import AmbassadorTest, ServiceType, HTTP class LuaTest(AmbassadorTest): target: ServiceType def init(self): self.target = HTTP() def manifests(self) -> str: return super().manifests() + self.format(''' --- apiVersion: getambassador.io/v1 ...
Enable resolve find brand from multiple directories
'use strict' const createDirectoryFlow = require('../../directory/create-flow') const { accesories, sails } = require('../../directory') const createAddFactory = require('../create-add') const category = require('../../category') const carbon = require('./carbon') const size = require('./size') const type = require('....
'use strict' const createAddFactory = require('../create-add') const { sails } = require('../../directory') const category = require('../../category') const carbon = require('./carbon') const size = require('./size') const type = require('./type') function factory (log) { const createAdd = createAddFactory('mast', ...
Add support for extracting the token from request headers Clients can now set the `Api-Token` header instead of supplying the token as a GET or POST parameter.
from functools import wraps from django.conf import settings from django.http import HttpResponse from django.contrib.auth import authenticate, login def get_token(request): "Attempts to retrieve a token from the request." if 'token' in request.REQUEST: return request.REQUEST['token'] if 'HTTP_API...
from functools import wraps from django.conf import settings from django.http import HttpResponse from django.contrib.auth import authenticate, login def get_token(request): return request.REQUEST.get('token', '') def check_auth(func): @wraps(func) def inner(self, request, *args, **kwargs): auth...
Add python_requires to help pip
from setuptools import setup, find_packages __version__ = "unknown" # "import" __version__ for line in open("sfs/__init__.py"): if line.startswith("__version__"): exec(line) break setup( name="sfs", version=__version__, packages=find_packages(), install_requires=[ 'numpy!=...
from setuptools import setup, find_packages __version__ = "unknown" # "import" __version__ for line in open("sfs/__init__.py"): if line.startswith("__version__"): exec(line) break setup( name="sfs", version=__version__, packages=find_packages(), install_requires=[ 'numpy!=...
[BUG] Fix txfee API call with added support for old API calls [ADD] txfee_auto to API Calls [ADD] txfee_manual to API Calls [ADD] confirmations to API Calls
<?php // Make sure we are called from index.php if (!defined('SECURITY')) die('Hacking attempt'); // Check if the API is activated $api->isActive(); // Check user token $user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']); // Output JSON format $data = array( // coin info 'curr...
<?php // Make sure we are called from index.php if (!defined('SECURITY')) die('Hacking attempt'); // Check if the API is activated $api->isActive(); // Check user token $user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']); // Output JSON format $data = array( // coin info 'curr...
Reduce included scope for services tests.
'use strict'; describe('IMS service', function(){ var $httpBackend; var IMS; beforeEach(module('Marvin.Services')); beforeEach(inject(function(_IMS_, _$httpBackend_){ $httpBackend = _$httpBackend_; IMS = _IMS_; })); // Stupid test. it('returns an object', function(){ expect(typeof(IMS)).t...
'use strict'; describe('IMS service', function(){ var $httpBackend; var IMS; beforeEach(module('Marvin')); beforeEach(inject(function(_IMS_, _$httpBackend_){ $httpBackend = _$httpBackend_; IMS = _IMS_; })); // Stupid test. it('returns an object', function(){ expect(typeof(IMS)).toBe('obje...
Add compare method from com.thaiopensource.relaxng.output.common. git-svn-id: ca8e9bb6f3f9b50a093b443c23951d3c25ca0913@1968 369101cc-9a96-11dd-8e58-870c635edf7a
package com.thaiopensource.xml.util; public final class Name { final private String namespaceUri; final private String localName; final private int hc; public Name(String namespaceUri, String localName) { this.namespaceUri = namespaceUri; this.localName = localName; this.hc = namespaceUri.hashCo...
package com.thaiopensource.xml.util; public final class Name { final private String namespaceUri; final private String localName; final private int hc; public Name(String namespaceUri, String localName) { this.namespaceUri = namespaceUri; this.localName = localName; this.hc = namespaceUri.hashCo...
Change the username min length constraint to what BW allows.
// common constants, shared between multiple pieces of code (and likely client and server) export const EMAIL_PATTERN = /^[^@]+@[^@]+$/ export const EMAIL_MINLENGTH = 3 export const EMAIL_MAXLENGTH = 100 export const LOBBY_NAME_MAXLENGTH = 50 export const PASSWORD_MINLENGTH = 6 export const PORT_MIN_NUMBER = 0 expo...
// common constants, shared between multiple pieces of code (and likely client and server) export const EMAIL_PATTERN = /^[^@]+@[^@]+$/ export const EMAIL_MINLENGTH = 3 export const EMAIL_MAXLENGTH = 100 export const LOBBY_NAME_MAXLENGTH = 50 export const PASSWORD_MINLENGTH = 6 export const PORT_MIN_NUMBER = 0 expo...
Update charms.hadoop reference to follow convention
from charms.reactive import when, when_not, set_state, remove_state from charms.layer.hadoop_base import get_hadoop_base from jujubigdata.handlers import YARN from jujubigdata import utils @when('resourcemanager.ready') @when_not('nodemanager.started') def start_nodemanager(resourcemanager): hadoop = get_hadoop_b...
from charms.reactive import when, when_not, set_state, remove_state from charms.hadoop import get_hadoop_base from jujubigdata.handlers import YARN from jujubigdata import utils @when('resourcemanager.ready') @when_not('nodemanager.started') def start_nodemanager(resourcemanager): hadoop = get_hadoop_base() y...
Add a size option to the ocConfirm service
angular.module('orderCloud') .factory('ocConfirm', OrderCloudConfirmService) .controller('ConfirmModalCtrl', ConfirmModalController) ; function OrderCloudConfirmService($uibModal) { var service = { Confirm: _confirm }; function _confirm(options) { return $uibModal.open({ ...
angular.module('orderCloud') .factory('ocConfirm', OrderCloudConfirmService) .controller('ConfirmModalCtrl', ConfirmModalController) ; function OrderCloudConfirmService($uibModal) { var service = { Confirm: _confirm }; function _confirm(options) { return $uibModal.open({ ...
Use the slim jquery file
const minimist = require('minimist'); const options = minimist(process.argv.slice(2)); const isProduction = options.env === 'production'; let config = { console_options: options, isProduction: isProduction, src: { js: './src/js/**/*.js', vue: { // src : dist './src/js/app.js': 'app.js', ...
const minimist = require('minimist'); const options = minimist(process.argv.slice(2)); const isProduction = options.env === 'production'; let config = { console_options: options, isProduction: isProduction, src: { js: './src/js/**/*.js', vue: { // src : dist './src/js/app.js': 'app.js', ...
Use view "title" as default tab title.
/** * @class SMITHY/DojoBorderView * View implementation for Dojo Tab Container to support smithy "tabs" * layout mode. */ define([ "../declare", "dijit/layout/TabContainer" ], function ( declare, TabContainer ) { var module = declare(TabContainer, { constructor: function (config) { ...
/** * @class SMITHY/DojoBorderView * View implementation for Dojo Tab Container to support smithy "tabs" * layout mode. */ define([ "../declare", "dijit/layout/TabContainer" ], function ( declare, TabContainer ) { var module = declare(TabContainer, { constructor: function (config) { ...
Add global package-level declaration to make the whole file example work
package fnlog_test import ( "github.com/northbright/fnlog" "log" ) var ( noTagLog *log.Logger ) func Example() { iLog := fnlog.New("i") wLog := fnlog.New("w") eLog := fnlog.New("e") // Global *log.Logger noTagLog = fnlog.New("") iLog.Printf("print infos") wLog.Printf("print warnnings") eLog.Printf("prin...
package fnlog_test import ( "github.com/northbright/fnlog" "log" ) func Example() { iLog := fnlog.New("i") wLog := fnlog.New("w") eLog := fnlog.New("e") var noTagLog *log.Logger = fnlog.New("") iLog.Printf("print infos") wLog.Printf("print warnnings") eLog.Printf("print errors") noTagLog.Printf("print mess...
Support title props in addition to children
import { ADD, SHOW, DISMISS } from './actions.js' const INITIAL_STATE = { items: [], current: null } function transformProps (item) { const { title } = item const transformedItem = Object.assign({}, item) if (title) { transformedItem.children = title } return transformedItem } function show...
import { ADD, SHOW, DISMISS } from './actions.js' const INITIAL_STATE = { items: [], current: null } function show (state, payload) { return { ...state, current: Object.assign({}, payload) } } function add (state, payload) { if (!state.current) { return { ...state, current: Ob...
Update bg image extraction to support Safari
(function() { // // Avoid sudden background resize on mobile browsers when the address bar is hidden. // var homeTop = document.querySelector('.home__top'); var windowWidth; function onWindowResize() { if (window.innerWidth !== windowWidth) { windowWidth = window.innerWidth...
(function() { // // Avoid sudden background resize on mobile browsers when the address bar is hidden. // var homeTop = document.querySelector('.home__top'); var windowWidth; function onWindowResize() { if (window.innerWidth !== windowWidth) { windowWidth = window.innerWidth...
Use CUnicode for width and height in ImageWidget
"""ButtonWidget class. Represents a button in the frontend using a widget. Allows user to listen for click events on the button and trigger backend code when the clicks are fired. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. #...
"""ButtonWidget class. Represents a button in the frontend using a widget. Allows user to listen for click events on the button and trigger backend code when the clicks are fired. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. #...
[MIG] Bump module version to 10.0.1.0.0
# -*- coding: utf-8 -*- # Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Purchase', 'license': 'AGPL-3', 'category': 'Localisation', 'author': 'Akretion, Odoo Community Association (OCA)', 'website': 'htt...
# -*- coding: utf-8 -*- # Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Purchase', 'license': 'AGPL-3', 'category': 'Localisation', 'author': 'Akretion, Odoo Community Association (OCA)', 'website': 'htt...
Add addImmediate to Queue class
org.bustany.TrackerBird.Queue = function(delay) { this._delay = 100; this._items = []; this._active = false; var queue = this; this._timerEvent = { notify: function(timer) { queue._active = false; queue.process(); } }; } org.bustany.TrackerBird.Queue.prototype.add = function(item) { this._items.push(item); thi...
org.bustany.TrackerBird.Queue = function(delay) { this._delay = 100; this._items = []; this._active = false; var queue = this; this._timerEvent = { notify: function(timer) { queue._active = false; queue.process(); } }; } org.bustany.TrackerBird.Queue.prototype.add = function(item) { this._items.push(item); thi...
Remove test for default options
'use strict'; var grunt = require('grunt'); /* ======== A Handy Little Nodeunit Reference ======== https://github.com/caolan/nodeunit Test methods: test.expect(numAssertions) test.done() Test assertions: test.ok(value, [message]) test.equal(actual, expected, [message]) test.notEqual(actual, expected, [messa...
'use strict'; var grunt = require('grunt'); /* ======== A Handy Little Nodeunit Reference ======== https://github.com/caolan/nodeunit Test methods: test.expect(numAssertions) test.done() Test assertions: test.ok(value, [message]) test.equal(actual, expected, [message]) test.notEqual(actual, expected, [messa...
Add select item packet ID
module.exports = { // Packet constants PLAYER_START: "1", PLAYER_ADD: "2", PLAYER_ANGLE: "2", PLAYER_UPDATE: "3", PLAYER_ATTACK :"4", LEADERBOAD: "5", PLAYER_MOVE: "3", PLAYER_REMOVE: "4", LEADERS_UPDATE: "5", SELECT_ITEM: "5", LOAD_GAME_OBJ: "6", PLAYER_UPGRADE: "6",...
module.exports = { // Packet constants PLAYER_START: "1", PLAYER_ADD: "2", PLAYER_ANGLE: "2", PLAYER_UPDATE: "3", PLAYER_ATTACK :"4", LEADERBOAD: "5", PLAYER_MOVE: "3", PLAYER_REMOVE: "4", LEADERS_UPDATE: "5", LOAD_GAME_OBJ: "6", PLAYER_UPGRADE: "6", GATHER_ANIM: "7",...
Add ordereddict package for Python 2.6
#!/usr/bin/env python import sys from setuptools import setup from ts3 import __version__ tests_require = ['mock'] if sys.version < '2.7': tests_require.append('unittest2') tests_require.append('ordereddict') setup( name="python-ts3", version=__version__, description="TS3 ServerQuery library ...
#!/usr/bin/env python import sys from setuptools import setup from ts3 import __version__ tests_require = ['mock'] if sys.version < '2.7': tests_require.append('unittest2') setup( name="python-ts3", version=__version__, description="TS3 ServerQuery library for Python", author="Andrew Willaims",...
Refactor image open to with block
#!/usr/local/bin/python3 # Python Challenge - 22 # http://www.pythonchallenge.com/pc/hex/copper.html # http://www.pythonchallenge.com/pc/hex/white.gif # Username: butter; Password: fly # Keyword: ''' Uses Anaconda environment with Pillow for image processing - Python 3.7, numpy, and Pillow (PIL) - Run `source ...
#!/usr/local/bin/python3 # Python Challenge - 22 # http://www.pythonchallenge.com/pc/hex/copper.html # http://www.pythonchallenge.com/pc/hex/white.gif # Username: butter; Password: fly # Keyword: ''' Uses Anaconda environment with Pillow for image processing - Python 3.7, numpy, and Pillow (PIL) - Run `source ...
Move importing of source to class setup
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() if version < '3000': from libsass i...
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils class TestPathutils(TestCase): @classmethod def setUpCla...
Add optional parameter to optional()
<?php namespace Structr\Tree\Composite; use Structr\Tree\Base\PrototypeNode; use Structr\Exception; class MapKeyNode extends PrototypeNode { private $_required = true; private $_optional = false; private $_defaultValue = null; private $_name; public function setName($name) { $this->_na...
<?php namespace Structr\Tree\Composite; use Structr\Tree\Base\PrototypeNode; use Structr\Exception; class MapKeyNode extends PrototypeNode { private $_required = true; private $_optional = false; private $_defaultValue = null; private $_name; public function setName($name) { $this->_na...
Fix test file first line
package main import ( "github.com/stretchr/testify/assert" "testing" "github.com/michaelklishin/rabbit-hole" "reflect" ) func TestGraphDefinition(t *testing.T){ var rabbitmq RabbitMQPlugin graphdef := rabbitmq.GraphDefinition() if len(graphdef) != 2 { t.Error("GetTempfilename: %d should be 2", len(graphdef)...
README.mdpackage main import ( "github.com/stretchr/testify/assert" "testing" "github.com/michaelklishin/rabbit-hole" "reflect" ) func TestGraphDefinition(t *testing.T){ var rabbitmq RabbitMQPlugin graphdef := rabbitmq.GraphDefinition() if len(graphdef) != 2 { t.Error("GetTempfilename: %d should be 2", len(...
[fix] Clean javascript. Empty value when cloning inputs.
document.addEventListener('DOMContentLoaded', function() { // Variables var liMenu = document.querySelectorAll('#apps a') , colors = ['bluebg','purplebg','redbg','orangebg','greenbg','darkbluebg','lightbluebg','yellowbg','lightpinkbg'] , addMailAlias = document.getElementById('add-mailalias') , addMail...
document.addEventListener('DOMContentLoaded', function() { var liMenu = document.querySelectorAll('#apps a'), colors = ['bluebg','purplebg','redbg','orangebg','greenbg','darkbluebg','lightbluebg','yellowbg','lightpinkbg'], addMailAlias = document.getElementById('add-mailalias'), addMaildrop = docume...
Replace '五輕關廠' with '走入同志家庭' in subnav Replace the '五輕關廠' link with '走入同志家庭' in sub-navigation menu
export const categoryPath = { taiwanPath: '/category/taiwan', reviewPath: '/category/review', photographyPath: '/photography', intlPath: '/category/intl', culturePath: '/category/culture' } export const navPath = [ { title: '台灣', path: '/category/taiwan' }, { title: '國際兩岸', path:'/category/intl' }, { t...
export const categoryPath = { taiwanPath: '/category/taiwan', reviewPath: '/category/review', photographyPath: '/photography', intlPath: '/category/intl', culturePath: '/category/culture' } export const navPath = [ { title: '台灣', path: '/category/taiwan' }, { title: '國際兩岸', path:'/category/intl' }, { t...
Fix test json property name again
package main import ( "fmt" "net/http" "testing" "github.com/urfave/cli" ) func TestCmdToot(t *testing.T) { toot := "" testWithServer( func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case "/api/v1/statuses": toot = r.FormValue("status") fmt.Fprintln(w, `{"id": 2345}`) ret...
package main import ( "fmt" "net/http" "testing" "github.com/urfave/cli" ) func TestCmdToot(t *testing.T) { toot := "" testWithServer( func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case "/api/v1/statuses": toot = r.FormValue("status") fmt.Fprintln(w, `{"ID": 2345}`) ret...
UPDATE age of account now printing out
<h1>Create Bank Account</h1> <fieldset> <legend>Account Information</legend> <?php echo form_open('banks/create_bank'); echo form_input('bank_name', set_value('bank_name', 'Account Name')); echo form_input('interest', set_value('interest', 'Interest Rate')); echo form_input('start_amount', set_...
<h1>Create Bank Account</h1> <fieldset> <legend>Account Information</legend> <?php echo form_open('banks/create_bank'); echo form_input('bank_name', set_value('bank_name', 'Account Name')); echo form_input('interest', set_value('interest', 'Interest Rate')); echo form_input('start_amount', set_...
Use htmlentities in the HTML git-svn-id: 3b6cb4556d214d66df54bca2662d7ef408f367bf@3404 46e82423-29d8-e211-989e-002590a4cdd4
<?php # # $Id: login.php,v 1.1.2.9 2005-09-05 19:53:24 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # if (IsSet($_GET['origin'])) $origin = $_GET["origin"]; ?> <form action="<?php echo $_SERVER["PHP_SELF"] . "?origin=$origin" ?>" method="POST" name="l"> <input type="hidden" name="custom_set...
<?php # # $Id: login.php,v 1.1.2.8 2003-12-01 18:17:47 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # if (IsSet($_GET['origin'])) $origin = $_GET["origin"]; ?> <form action="<?php echo $_SERVER["PHP_SELF"] . "?origin=$origin" ?>" method="POST" name="l"> <input type="hidden" name="custom_set...
Fix extractEnvelopeInfo breakage due to go-stellar-base api change
package txsub import ( "github.com/stellar/go-stellar-base/build" "github.com/stellar/go-stellar-base/strkey" "github.com/stellar/go-stellar-base/xdr" "golang.org/x/net/context" ) type envelopeInfo struct { Hash string Sequence uint64 SourceAddress string } func extractEnvelopeInfo(ctx context.C...
package txsub import ( "github.com/stellar/go-stellar-base/build" "github.com/stellar/go-stellar-base/strkey" "github.com/stellar/go-stellar-base/xdr" "golang.org/x/net/context" ) type envelopeInfo struct { Hash string Sequence uint64 SourceAddress string } func extractEnvelopeInfo(ctx context.C...
Add javadoc, make position final.
package uk.ac.ebi.quickgo.annotation.validation.loader; /** * Specify the columns for Database Cross Reference file. * * @author Tony Wardell * Date: 07/11/2016 * Time: 18:16 * Created with IntelliJ IDEA. * * Specify the layout of the DB_XREFS_ENTITIES.dat.gz file. * DATABASE ENTITY_TYPE_ID ENTITY_TYP...
package uk.ac.ebi.quickgo.annotation.validation.loader; /** * @author Tony Wardell * Date: 07/11/2016 * Time: 18:16 * Created with IntelliJ IDEA. * * Specify the layout of the DB_XREFS_ENTITIES.dat.gz file. * DATABASE ENTITY_TYPE_ID ENTITY_TYPE_NAME LOCAL_ID_SYNTAX URL_SYNTAX * */ public enum D...
Return value of execute method fixed (NoOP).
package aima.basic.vaccum; import aima.basic.Agent; import aima.basic.AgentProgram; import aima.basic.Percept; /** * @author Ravi Mohan * */ public class ModelBasedTVEVaccumAgentProgram extends AgentProgram { VaccumEnvironmentModel myModel; ModelBasedTVEVaccumAgentProgram(VaccumEnvironmentModel mo...
package aima.basic.vaccum; import aima.basic.AgentProgram; import aima.basic.Percept; /** * @author Ravi Mohan * */ public class ModelBasedTVEVaccumAgentProgram extends AgentProgram { VaccumEnvironmentModel myModel; ModelBasedTVEVaccumAgentProgram(VaccumEnvironmentModel model) { myModel = model;...
Change version checking to only halt on yarn error
import { spawn } from 'cross-spawn'; import hasYarn from './has_yarn'; const packageManager = hasYarn() ? 'yarn' : 'npm'; export default function latestVersion(packageName) { return new Promise((resolve, reject) => { const command = spawn(packageManager, ['info', packageName, 'version', '--json', '--silent'], {...
import { spawn } from 'cross-spawn'; import hasYarn from './has_yarn'; const packageManager = hasYarn() ? 'yarn' : 'npm'; export default function latestVersion(packageName) { return new Promise((resolve, reject) => { const command = spawn(packageManager, ['info', packageName, 'version', '--json', '--silent'], {...
fix: Use new method call for API summary
<?php /** @var \nochso\WriteMe\Markdown\InteractiveTemplate $this */ ?> <?php $this->ask('composer.name', 'Enter the name as used on packagist', null, '/.+/'); ?> # @composer.name@ <?php if ($this->ask('composer.description', 'Enter a one-line description of the project (optional)') !== ''): ?> @composer.description@ ...
<?php /** @var \nochso\WriteMe\Markdown\InteractiveTemplate $this */ ?> <?php $this->ask('composer.name', 'Enter the name as used on packagist', null, '/.+/'); ?> # @composer.name@ <?php if ($this->ask('composer.description', 'Enter a one-line description of the project (optional)') !== ''): ?> @composer.description@ ...
Add DerbyMagic9600 as another possible timer device (DerbyMagic timer running at 9600 baud).
package org.jeffpiazza.derby.devices; import java.lang.reflect.Method; public class AllDeviceTypes { // The universe of all possible device classes @SuppressWarnings(value = "unchecked") public static final Class<? extends TimerDevice>[] allDeviceClasses = (Class<? extends TimerDevice>[]) new Class[]{ ...
package org.jeffpiazza.derby.devices; import java.lang.reflect.Method; public class AllDeviceTypes { // The universe of all possible device classes @SuppressWarnings(value = "unchecked") public static final Class<? extends TimerDevice>[] allDeviceClasses = (Class<? extends TimerDevice>[]) new Class[]{ ...
Implement server-side rollback, for daemon versions that support this Server-side rollback can take advantage of the rollback-specific update parameters, instead of being treated as a normal update that happens to go back to a previous version of the spec. Signed-off-by: Aaron Lehmann <8ecfc6017a87905413dcd7d63696a2a...
package client import ( "encoding/json" "net/url" "strconv" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "golang.org/x/net/context" ) // ServiceUpdate updates a Service. func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swa...
package client import ( "encoding/json" "net/url" "strconv" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "golang.org/x/net/context" ) // ServiceUpdate updates a Service. func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swa...
Fix syntax for node 10
const REQUIRED_FIELDS = Object.freeze(['to']); const OPTIONAL_FIELDS = Object.freeze([ 'customer_id', 'transactional_message_id', 'message_data', 'from', 'from_id', 'reply_to', 'reply_to_id', 'bcc', 'subject', 'body', 'plaintext_body', 'amp_body', 'fake_bcc', 'hide_body', ]); module.exports...
const REQUIRED_FIELDS = Object.freeze(['to']); const OPTIONAL_FIELDS = Object.freeze([ 'customer_id', 'transactional_message_id', 'message_data', 'from', 'from_id', 'reply_to', 'reply_to_id', 'bcc', 'subject', 'body', 'plaintext_body', 'amp_body', 'fake_bcc', 'hide_body', ]); module.exports...
Make our failing partial stats test pass
var selftest = require('../selftest.js'); var Sandbox = selftest.Sandbox; selftest.define("report-stats", function () { var s = new Sandbox; var run = s.run("create", "foo"); run.expectExit(0); s.cd("foo"); // verify that identifier file exists for new apps var identifier = s.read(".meteor/identifier"); ...
var selftest = require('../selftest.js'); var Sandbox = selftest.Sandbox; selftest.define("report-stats", function () { var s = new Sandbox; run = s.run("create", "foo"); run.expectExit(0); s.cd("foo"); // verify that identifier file exists for new apps var identifier = s.read(".meteor/identifier"); se...
Update Adapter to match API
Ember.Adapter = Ember.Object.extend({ find: function(record, id) { throw new Error('Ember.Adapter subclasses must implement find'); }, findQuery: function(klass, records, params) { throw new Error('Ember.Adapter subclasses must implement findQuery'); }, findMany: function(klass, records, ids) { ...
Ember.Adapter = Ember.Object.extend({ find: function(record, id) { throw new Error('Ember.Adapter subclasses must implement find'); }, findQuery: function(record, id) { throw new Error('Ember.Adapter subclasses must implement findQuery'); }, findMany: function(record, id) { throw new Error('Embe...
UPDATE: Use services by service const's
<?php namespace Heystack\Subsystem\Ecommerce\Traits; use Heystack\Subsystem\Core\ServiceStore; use Heystack\Subsystem\Core\Services; trait OutputHandlerControllerTrait { /** * Process the request to the controller and direct it to the correct input * and output controllers via the input and output pro...
<?php namespace Heystack\Subsystem\Ecommerce\Traits; use Heystack\Subsystem\Core\ServiceStore; trait OutputHandlerControllerTrait { /** * Process the request to the controller and direct it to the correct input * and output controllers via the input and output processor services. * * @return...
Documentation: Change wording from future to present tense
# -*- coding: utf-8 -*- class Object: """Represents a generic Spectrum object Supported Operations: +-----------+--------------------------------------+ | Operation | Description | +===========+======================================+ | x == y | Checks if t...
# -*- coding: utf-8 -*- class Object: """Represents a generic Spectrum object Supported Operations: +-----------+--------------------------------------+ | Operation | Description | +===========+======================================+ | x == y | Checks if t...
Fix error in watch mode
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var DependenciesBlock = require("./DependenciesBlock"); function AsyncDependenciesBlock(name, module, loc) { DependenciesBlock.call(this); this.chunkName = name; this.chunks = null; this.module = module; this.loc =...
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var DependenciesBlock = require("./DependenciesBlock"); function AsyncDependenciesBlock(name, module, loc) { DependenciesBlock.call(this); this.chunkName = name; this.chunks = null; this.module = module; this.loc =...
Support document object as first argument
export default createNodeIterator function createNodeIterator(root, whatToShow = 0xFFFFFFFF, filter = null) { const doc = (root.nodeType == 9) || root.ownerDocument const iter = doc.createNodeIterator(root, whatToShow, filter, false) return new NodeIterator(iter, root, whatToShow, filter) } class NodeIterator...
export default createNodeIterator function createNodeIterator(root, whatToShow = 0xFFFFFFFF, filter = null) { const doc = root.ownerDocument const iter = doc.createNodeIterator(root, whatToShow, filter, false) return new NodeIterator(iter, root, whatToShow, filter) } class NodeIterator { constructor(iter, r...
Sort lists prior to computing len of candidates
# A special triplet is defined as: a <= b <= c for # a in list_a, b in list_b, and c in list_c def get_num_special_triplets(list_a, list_b, list_c): # remove duplicates and sort lists list_a = sorted(set(list_a)) list_b = sorted(set(list_b)) list_c = sorted(set(list_c)) num_special_triplets = 0 ...
# A special triplet is defined as: a <= b <= c for # a in list_a, b in list_b, and c in list_c def get_num_special_triplets(list_a, list_b, list_c): num_special_triplets = 0 for b in list_b: len_a_candidates = len([a for a in list_a if a <= b]) len_c_candidates = len([c for c in list_c if c <...
Fix test, text it not outputted anymore - assert class value instead
<?php /** * @group Advanced_SocialBookmarks */ class Kwc_Advanced_SocialBookmarks_Test extends Kwc_TestAbstract { public function testIt() { $this->_init('Kwc_Advanced_SocialBookmarks_Root'); $page1 = $this->_root->getChildComponent('_page1'); $page2 = $page1->getChildComponent('_page2...
<?php /** * @group Advanced_SocialBookmarks */ class Kwc_Advanced_SocialBookmarks_Test extends Kwc_TestAbstract { public function testIt() { $this->_init('Kwc_Advanced_SocialBookmarks_Root'); $page1 = $this->_root->getChildComponent('_page1'); $page2 = $page1->getChildComponent('_page2...
Add tab for filling logbook
<?php /* @var $this yii\web\View */ use yii\helpers\Html; use yii\bootstrap\Tabs; use app\models\ProfileForm; $this->title = 'Home'; ?> <title>Home</title> <!-- For Pjax's sake --> <div class="site-index"> <?= Tabs::widget([ 'items' => [ [ 'label' => 'Profile', 'content' => $this...
<?php /* @var $this yii\web\View */ use yii\helpers\Html; use yii\bootstrap\Tabs; $this->title = 'Home'; ?> <title>Home</title> <!-- For Pjax's sake --> <div class="site-index"> <?= Tabs::widget([ 'items' => [ [ 'label' => 'Profile', 'content' => $this->render('profile'), ...
Make settings a plugin global.
(function ($) { var defaults = { }; var settings = {}; var slides = []; var root, header, footer; var current = 0; var invisible = "slides-invisible"; function initslides (element) { root = $(element); header = root.find("> header"); footer = root.find("> footer"...
(function ($) { var defaults = { }; var slides = []; var root, header, footer; var current = 0; var invisible = "slides-invisible"; function initslides (element, settings) { root = $(element); header = root.find("> header"); footer = root.find("> footer"); /...
Add filter text to signs
def playerIcons(poi): if poi['id'] == 'Player': poi['icon'] = "http://overviewer.org/avatar/%s" % poi['EntityId'] return "Last known location for %s" % poi['EntityId'] # Only signs with "-- RENDER --" on the last line will be shown # Otherwise, people can't have secret bases and the render is too b...
def playerIcons(poi): if poi['id'] == 'Player': poi['icon'] = "http://overviewer.org/avatar/%s" % poi['EntityId'] return "Last known location for %s" % poi['EntityId'] def signFilter(poi): if poi['id'] == 'Sign': return "\n".join([poi['Text1'], poi['Text2'], poi['Text3'], poi['Text4']])...
Read posts per page from metadata collection
Meteor.publish("post_list", function(page_num){ const posts_per_page = MetaData.findOne({type: "posts"}).posts_per_page; //validating the page number var page_number = page_num; if(!/^[0-9]+$/gi.test(page_num)){ return []; } else if(page_num <= 0) { return []; } return Posts.find({},{ limit:...
Meteor.publish("post_list", function(page_num){ const posts_per_page = 10; //validating the page number var page_number = page_num; if(!/^[0-9]+$/gi.test(page_num)){ return []; } else if(page_num <= 0) { return []; } return Posts.find({},{ limit: posts_per_page, skip: (parseInt(page_numb...
Store IDs as signed integers
package instana // SpanContext holds the basic Span metadata. type SpanContext struct { // A probabilistically unique identifier for a [multi-span] trace. TraceID int64 // A probabilistically unique identifier for a span. SpanID int64 // Whether the trace is sampled. Sampled bool // The span's associated bag...
package instana // SpanContext holds the basic Span metadata. type SpanContext struct { // A probabilistically unique identifier for a [multi-span] trace. TraceID uint64 // A probabilistically unique identifier for a span. SpanID uint64 // Whether the trace is sampled. Sampled bool // The span's associated b...
Fix build breakage due to api change Change-Id: I72661c51f277cb9aa3df0bd5a16756408b53ab7f
/* * Copyright (C) 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
/* * Copyright (C) 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Set up for v0.23 development
"""SoCo (Sonos Controller) is a simple library to control Sonos speakers.""" # There is no need for all strings here to be unicode, and Py2 cannot import # modules with unicode names so do not use from __future__ import # unicode_literals # https://github.com/SoCo/SoCo/issues/98 # import logging from .core import S...
"""SoCo (Sonos Controller) is a simple library to control Sonos speakers.""" # There is no need for all strings here to be unicode, and Py2 cannot import # modules with unicode names so do not use from __future__ import # unicode_literals # https://github.com/SoCo/SoCo/issues/98 # import logging from .core import S...
fix: Fix an issue with navigation button types.
import React, { PropTypes } from 'react'; import { PersianNumber } from 'react-persian'; export default class Heading extends React.Component { static propTypes = { month: PropTypes.object.isRequired, onNext: PropTypes.func.isRequired, onPrev: PropTypes.func.isRequired, prevMonthElement: PropTypes.el...
import React, { PropTypes } from 'react'; import { PersianNumber } from 'react-persian'; export default class Heading extends React.Component { static propTypes = { month: PropTypes.object.isRequired, onNext: PropTypes.func.isRequired, onPrev: PropTypes.func.isRequired, prevMonthElement: PropTypes.el...
Revert "Look for description in error caught" This reverts commit 18171100cc4cdf32d31dcf526254c708fd42812d.
var context; window.addEventListener('load', init, false); function init() { try { var dogBarkingUrl = 'https://upload.wikimedia.org/wikipedia/commons/c/ce/Sound-of-dog.ogg'; var dogBarkingBuffer = null; // Fix up prefixing window.AudioContext = window.AudioContext || window.webkitAudioContext; context = ne...
var context; window.addEventListener('load', init, false); function init() { try { var dogBarkingUrl = 'https://upload.wikimedia.org/wikipedia/commons/c/ce/Sound-of-dog.ogg'; var dogBarkingBuffer = null; // Fix up prefixing window.AudioContext = window.AudioContext || window.webkitAudioContext; context = ne...
Add enrollment_code to U2F client
/* * oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. * * Copyright (c) 2014, Gluu */ package org.xdi.oxauth.client.fido.u2f; import org.xdi.oxauth.model.fido.u2f.protocol.RegisterRequestMessage; import org.xdi.oxauth.model.fido.u2f.protocol.RegisterStatus; ...
/* * oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. * * Copyright (c) 2014, Gluu */ package org.xdi.oxauth.client.fido.u2f; import org.xdi.oxauth.model.fido.u2f.protocol.RegisterRequestMessage; import org.xdi.oxauth.model.fido.u2f.protocol.RegisterStatus; ...
Change upload file to public read
package uploader import ( "fmt" "os" "launchpad.net/goamz/aws" "launchpad.net/goamz/s3" ) const ( defaultS3BufferSize = 5 * 1024 * 1024 ) type S3 struct { Bucket *s3.Bucket BufferSize int64 } func (s3Uploader *S3) Init() error { s3Region := os.Getenv("S3_REGION") region, ok := aws.Regions[s3Region] i...
package uploader import ( "fmt" "os" "launchpad.net/goamz/aws" "launchpad.net/goamz/s3" ) const ( defaultS3BufferSize = 5 * 1024 * 1024 ) type S3 struct { Bucket *s3.Bucket BufferSize int64 } func (s3Uploader *S3) Init() error { s3Region := os.Getenv("S3_REGION") region, ok := aws.Regions[s3Region] if...
Use same order as matplotlib for PySize/PyQT
import os import warnings qt_api = os.environ.get('QT_API') if qt_api is None: try: import PyQt4 qt_api = 'pyqt' except ImportError: try: import PySide qt_api = 'pyside' except ImportError: qt_api = None # Note that we don't want ...
import os import warnings qt_api = os.environ.get('QT_API') if qt_api is None: try: import PySide qt_api = 'pyside' except ImportError: try: import PyQt4 qt_api = 'pyqt' except ImportError: qt_api = None # Note that we don't want ...
Add error for invalid pda transitions
export class UnknownCharError extends Error { constructor(unknownChar) { super(`Character '${unknownChar}' is not a part of the alphabet.`) } } export class UnknownStateError extends Error { constructor(stateName) { super(`State '${stateName}' doesn't exist in the automata.`) } } expor...
export class UnknownCharError extends Error { constructor(unknownChar) { super(`Character '${unknownChar}' is not a part of the alphabet.`) } } export class UnknownStateError extends Error { constructor(stateName) { super(`State '${stateName}' doesn't exist in the automata.`) } } expor...
Fix tokenizing of comment after closing brace of last message
module.exports = function (sch) { var noComments = function (line) { var i = line.indexOf('//') return i > -1 ? line.slice(0, i) : line } var noMultilineComments = function () { var inside = false return function (token) { if (token === '/*') { inside = true return false ...
module.exports = function (sch) { var noComments = function (line) { var i = line.indexOf('//') return i > -1 ? line.slice(0, i) : line } var noMultilineComments = function () { var inside = false return function (token) { if (token === '/*') { inside = true return false ...
Fix issue with HDF5 objects that don't have a value
import os import h5py from glue.core import Data def read_step_to_data(filename, step_id=0): """ Given a filename and a step ID, read in the data into a new Data object. """ f = h5py.File(filename, 'r') try: group = f['Step#{0}'.format(step_id)] except KeyError: raise ValueEr...
import os import h5py from glue.core import Data def read_step_to_data(filename, step_id=0): """ Given a filename and a step ID, read in the data into a new Data object. """ f = h5py.File(filename, 'r') try: group = f['Step#{0}'.format(step_id)] except KeyError: raise ValueEr...
BAP-11558: Add force Resync parameter for IMAP synchronization command
<?php namespace Oro\Bundle\EmailBundle\Sync\Model; class SynchronizationProcessorSettings { /** @var bool In this mode all emails will be re-synced again for checked folders */ protected $forceMode = false; /** @var bool Allows to define show or hide log messages during resync of emails */ protected...
<?php namespace Oro\Bundle\EmailBundle\Sync\Model; class SynchronizationProcessorSettings { /** @var bool In this mode all emails will be re-synced again for checked folders */ protected $forceMode = false; /** @var bool Allows to define show or hide log messages during resync of emails */ protected...
Add check to not add messages twice
/** * @class Denkmal_Component_MessageList_All * @extends Denkmal_Component_MessageList_Abstract */ var Denkmal_Component_MessageList_All = Denkmal_Component_MessageList_Abstract.extend({ /** @type String */ _class: 'Denkmal_Component_MessageList_All', ready: function() { this.bindStream('global-internal...
/** * @class Denkmal_Component_MessageList_All * @extends Denkmal_Component_MessageList_Abstract */ var Denkmal_Component_MessageList_All = Denkmal_Component_MessageList_Abstract.extend({ /** @type String */ _class: 'Denkmal_Component_MessageList_All', ready: function() { this.bindStream('global-internal...
Remove script defer to see if it fixes travis visual regression tests
var components = require('./components'); var javascript = require('../tasks/javascript'); var extend = require('extend'); /** * Helper function for rendering a page * Abstracted out here to reduce some duplication in the main server */ var renderPage = function(hbs, data) { return new Promise(function(resolve, ...
var components = require('./components'); var javascript = require('../tasks/javascript'); var extend = require('extend'); /** * Helper function for rendering a page * Abstracted out here to reduce some duplication in the main server */ var renderPage = function(hbs, data) { return new Promise(function(resolve, ...
Rename 'util' to 'GipsyUtil' in overlay.
{ let GipsyUtil = {}; Components.utils.import("resource://gipsy/util.jsm", GipsyUtil); let myId = "gipsy-button"; // ID of button to add let afterId = "search-container"; // ID of element to insert after let navBar = document.getElementById("nav-bar"); if (navBar && !GipsyUtil.g...
{ let util = {}; Components.utils.import("resource://gipsy/util.jsm", util); let myId = "gipsy-button"; // ID of button to add let afterId = "search-container"; // ID of element to insert after let navBar = document.getElementById("nav-bar"); if (navBar && !util.get_bool_pref('b...
Add more directories to narrow by default
"use babel"; export const DEFAULT_ACTIVE_FILE_DIR = 'Active file\'s directory'; export const DEFAULT_PROJECT_ROOT = 'Project root'; export const DEFAULT_EMPTY = 'Empty'; export let config = { helmDirSwitch: { title: 'Shortcuts for fast directory switching', description: 'See README for details.',...
"use babel"; export const DEFAULT_ACTIVE_FILE_DIR = 'Active file\'s directory'; export const DEFAULT_PROJECT_ROOT = 'Project root'; export const DEFAULT_EMPTY = 'Empty'; export let config = { helmDirSwitch: { title: 'Shortcuts for fast directory switching', description: 'See README for details.',...
Remove description for config options
package com.crowdin.cli.commands.parts; import com.crowdin.cli.commands.functionality.PropertiesBuilder; import com.crowdin.cli.properties.Params; import com.crowdin.cli.properties.PropertiesBean; import picocli.CommandLine; import java.io.File; public abstract class PropertiesBuilderCommandPart extends Command { ...
package com.crowdin.cli.commands.parts; import com.crowdin.cli.commands.functionality.PropertiesBuilder; import com.crowdin.cli.properties.Params; import com.crowdin.cli.properties.PropertiesBean; import picocli.CommandLine; import java.io.File; public abstract class PropertiesBuilderCommandPart extends Command { ...
Revert "Logging on cli mode" This reverts commit 66dbfea49de3584da69436f9ca9f719b66875617.
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyrig...
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyrig...