text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
contrib/exporters/allinone: Fix default config file name
/* * Copyright (C) 2019 IBM, 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 ofthe License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
/* * Copyright (C) 2019 IBM, 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 ofthe License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
Use PHP 8 constructor property promotion
<?php declare(strict_types = 1); /** * /src/Serializer/CollectionNormalizer.php * * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com> */ namespace App\Serializer\Normalizer; use Doctrine\Common\Collections\Collection; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Seri...
<?php declare(strict_types = 1); /** * /src/Serializer/CollectionNormalizer.php * * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com> */ namespace App\Serializer\Normalizer; use Doctrine\Common\Collections\Collection; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Seri...
Fix for it not detecting the sock_modules folder
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ gitclone: { docs: { options: { directory: "site", repository: "https://github.com/SockDrawer/SockBot.git", branch: "gh-pages" } } }, mkdocs: { dist: { src: '.', options: { clean: true } } },...
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ gitclone: { docs: { options: { directory: "site", repository: "https://github.com/SockDrawer/SockBot.git", branch: "gh-pages" } } }, mkdocs: { dist: { src: '.', options: { clean: true } } },...
Add a way to dump the header during setup.py runs
import os import re import sys import cffi _directive_re = re.compile(r'^\s*#.*?$(?m)') def make_ffi(module_path, crate_path, cached_header_filename=None): """Creates a FFI instance for the given configuration.""" if cached_header_filename is not None and \ os.path.isfile(cached_header_filename): ...
import os import re import cffi _directive_re = re.compile(r'^\s*#.*?$(?m)') def make_ffi(module_path, crate_path, cached_header_filename=None): """Creates a FFI instance for the given configuration.""" if cached_header_filename is not None and \ os.path.isfile(cached_header_filename): with o...
Add test for no validator case
import { moduleForComponent, test } from 'ember-qunit'; import { click, fillIn, find, focus, triggerEvent } from 'ember-native-dom-helpers'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('ember-x-editable', 'Integration | Component | ember x editable', { integration: true }); test('mouseEnter/mou...
import { moduleForComponent, test } from 'ember-qunit'; import { find, focus, triggerEvent } from 'ember-native-dom-helpers'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('ember-x-editable', 'Integration | Component | ember x editable', { integration: true }); test('mouseEnter/mouseLeave', async...
Support multiple servers and retries
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. import sys from time import time from ntplib import NTPClient from qrl.core import logger ntp_servers = ['pool.ntp.org', 'ntp.ubuntu.com'] NTP_VERSION = 3 NTP_RETRI...
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. import sys from time import time from ntplib import NTPClient from qrl.core import logger ntp_server = 'pool.ntp.org' version = 3 times = 5 drift = None def get_n...
Check whether the asset url start with a slash
<?php use Silex\Application; use Silex\Provider\TwigServiceProvider; use Silex\Provider\RoutingServiceProvider; use Silex\Provider\ValidatorServiceProvider; use Silex\Provider\ServiceControllerServiceProvider; use Silex\Provider\HttpFragmentServiceProvider; $app = new Application(); $app->register(new RoutingServiceP...
<?php use Silex\Application; use Silex\Provider\TwigServiceProvider; use Silex\Provider\RoutingServiceProvider; use Silex\Provider\ValidatorServiceProvider; use Silex\Provider\ServiceControllerServiceProvider; use Silex\Provider\HttpFragmentServiceProvider; $app = new Application(); $app->register(new RoutingServiceP...
Make rad entity repository concrete This allows us to configure doctrine to use it as default repository (see 759bcc44ca1ec5a13c7dbf8727d8edd587c35e46). The default alias generation method has been rewritten using the doctrine's inflector.
<?php namespace Knp\RadBundle\Doctrine; use Doctrine\ORM\EntityRepository as BaseEntityRepository; use Doctrine\ORM\QueryBuilder; use Doctrine\Common\Util\Inflector; class EntityRepository extends BaseEntityRepository { public function __call($method, $arguments) { if (0 === strpos($method, 'find')) ...
<?php namespace Knp\RadBundle\Doctrine; use Doctrine\ORM\EntityRepository as BaseEntityRepository; use Doctrine\ORM\QueryBuilder; abstract class EntityRepository extends BaseEntityRepository { public function __call($method, $arguments) { if (0 === strpos($method, 'find')) { if (method_ex...
Create required known_hosts file if it does not exists
import os import logging from ...subprocess import check_output def _get_known_hosts_path(): ssh_dir = os.path.expanduser('~root/.ssh') if not os.path.isdir(ssh_dir): os.makedirs(ssh_dir) return os.path.join(ssh_dir, 'known_hosts') def ensure_known_hosts(hosts): known_hosts_path = _get_known_...
import os import logging from ...subprocess import check_output def _get_known_hosts_path(): ssh_dir = os.path.expanduser('~root/.ssh') if not os.path.isdir(ssh_dir): os.makedirs(ssh_dir) return os.path.join(ssh_dir, 'known_hosts') def ensure_known_hosts(hosts): known_hosts_path = _get_known_...
Fix SCSS engine error message
'use strict'; var Engine = require('./engine'); var herit = require('herit'); var path = require('path'); module.exports = herit(Engine, { defaults: function () { return { paths: [], indentedSyntax: false }; }, run: function (asset, cb) { try { var sass = require('node-sass'); ...
'use strict'; var Engine = require('./engine'); var herit = require('herit'); var path = require('path'); module.exports = herit(Engine, { defaults: function () { return { paths: [], indentedSyntax: false }; }, run: function (asset, cb) { try { var sass = require('node-sass'); ...
Fix empty servername problem when initially adding server.
package org.muteswan.client.data; import org.json.JSONException; import org.json.JSONObject; import org.muteswan.client.MuteLog; public class MuteswanServer { private String hostname; private ServerInfo serverInfo; public class ServerInfo { public String Name = ""; public void setName(String arg) { ...
package org.muteswan.client.data; import org.json.JSONException; import org.json.JSONObject; public class MuteswanServer { private String hostname; private ServerInfo serverInfo; public class ServerInfo { public String Name = ""; public void setName(String arg) { this.Name = arg; } public S...
Enable tunnel only through environment variable
module.exports = { // Minimal configuration needed 'SLACK_CLIENT_ID': process.env.SLACK_CLIENT_ID || 'YOUR_SLACK_CLIENT_ID', 'SLACK_SECRET': process.env.SLACK_SECRET || 'YOUR_SLACK_SECRET', 'VERIFICATION_TOKEN': process.env.VERIFICATION_TOKEN || 'YOUR_VERIFICATION_TOKEN', 'API_KEY': process.env.API_KEY || 'YO...
module.exports = { // Minimal configuration needed 'SLACK_CLIENT_ID': process.env.SLACK_CLIENT_ID || 'YOUR_SLACK_CLIENT_ID', 'SLACK_SECRET': process.env.SLACK_SECRET || 'YOUR_SLACK_SECRET', 'VERIFICATION_TOKEN': process.env.VERIFICATION_TOKEN || 'YOUR_VERIFICATION_TOKEN', 'API_KEY': process.env.API_KEY || 'YO...
Patch parts of `FloorDivideOp` in source order.
import BinaryOpPatcher from './BinaryOpPatcher.js'; export default class FloorDivideOpPatcher extends BinaryOpPatcher { /** * LEFT '//' RIGHT */ patchAsExpression() { let operator = this.getOperatorToken(); // `a // b` → `Math.floor(a // b` // ^^^^^^^^^^^ this.insert(this.content...
import BinaryOpPatcher from './BinaryOpPatcher.js'; export default class FloorDivideOpPatcher extends BinaryOpPatcher { /** * LEFT '//' RIGHT */ patchAsExpression() { let operator = this.getOperatorToken(); // `a // b` → `Math.floor(a // b` // ^^^^^^^^^^^ this.insert(this.contentS...
Use correct MIT license classifier. `LICENSE` contains the MIT/Expat license but `setup.py` uses the LGPLv3 classifier. I assume the later is an oversight.
from setuptools import setup setup( name='pytest-flakes', description='pytest plugin to check source code with pyflakes', long_description=open("README.rst").read(), license="MIT license", version='1.0.1', author='Florian Schulze, Holger Krekel and Ronny Pfannschmidt', author_email='florian...
from setuptools import setup setup( name='pytest-flakes', description='pytest plugin to check source code with pyflakes', long_description=open("README.rst").read(), license="MIT license", version='1.0.1', author='Florian Schulze, Holger Krekel and Ronny Pfannschmidt', author_email='florian...
Use singleton method instead of share method on service provider registration for Laravel 5.4 support
<?php namespace Thomaswelton\LaravelGravatar; use Illuminate\Support\ServiceProvider; class LaravelGravatarServiceProvider extends ServiceProvider { /** * Boot the service provider. */ public function boot() { $this->setupConfig(); } /** * Setup the config. */ pro...
<?php namespace Thomaswelton\LaravelGravatar; use Illuminate\Support\ServiceProvider; class LaravelGravatarServiceProvider extends ServiceProvider { /** * Boot the service provider. */ public function boot() { $this->setupConfig(); } /** * Setup the config. */ pro...
auditlog: Remove pre_init_hook reference from openerp, no pre_init hook exists any more
# -*- coding: utf-8 -*- # © 2015 ABF OSIELL <http://osiell.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': "Audit Log", 'version': "9.0.1.0.0", 'author': "ABF OSIELL,Odoo Community Association (OCA)", 'license': "AGPL-3", 'website': "http://www.osiell.com", 'categ...
# -*- coding: utf-8 -*- # © 2015 ABF OSIELL <http://osiell.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': "Audit Log", 'version': "9.0.1.0.0", 'author': "ABF OSIELL,Odoo Community Association (OCA)", 'license': "AGPL-3", 'website': "http://www.osiell.com", 'categ...
Fix failed tempest tests with KeystoneV2 Change-Id: I78e6a2363d006c6feec84db4d755974e6a6a81b4 Signed-off-by: Ruslan Aliev <f0566964e0d23c2ac49e399e34dbe87edb487aa1@mirantis.com>
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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 ...
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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 ...
Set max width and height for inventory items
'use strict'; const React = require('react'); const {string} = React.PropTypes; const InventoryDetail = React.createClass({ displayName: 'InventoryDetail', propTypes: { // state name: string.isRequired, type: string.isRequired, image: string.isRequired }, render() { return ( <div st...
'use strict'; const React = require('react'); const {string} = React.PropTypes; const InventoryDetail = React.createClass({ displayName: 'InventoryDetail', propTypes: { // state name: string.isRequired, type: string.isRequired, image: string.isRequired }, render() { return ( <div st...
JCR-2357: Duplicate entries in the index - javadoc git-svn-id: 02b679d096242155780e1604e997947d154ee04a@828343 13f79535-47bb-0310-9956-ffa450edef68
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
Use a separate method to get all peers of a torrent
import urllib from random import randint from urlparse import urlparse from torrent import Torrent from trackers.udp import UDPTracker class Client(object): __TORRENTS = {} def __init__(self): self.peer_id = urllib.quote("-AZ2470-" + "".join([str(randint(0, 9)) for i in xrange(12)])) @property def torr...
from urlparse import urlparse from torrent import Torrent from trackers.udp import UDPTracker class Client(object): __TORRENTS = {} @property def torrents(self): return self.__TORRENTS @torrents.setter def torrents(self, new_torrent): self.__TORRENTS[new_torrent] = Torrent(new_torrent) def dow...
Add title to main frame
package viewer; import maze.Maze; import javax.swing.*; import java.awt.*; /** * @author Nick Hirakawa */ public class MazeViewer extends JFrame { private JPanel panel; public MazeViewer(Maze maze, int cellSize){ this(maze, cellSize, cellSize / 4); } public MazeViewer(Maze maze, int cell...
package viewer; import maze.Maze; import javax.swing.*; import java.awt.*; /** * @author Nick Hirakawa */ public class MazeViewer extends JFrame { private JPanel panel; public MazeViewer(Maze maze, int cellSize){ this(maze, cellSize, cellSize / 4); } public MazeViewer(Maze maze, int cell...
Update bluprint to install latest telling-stories-dashboard
/*jshint node:true*/ var existsSync = require('exists-sync'); module.exports = { description: 'Install telling-stories dependencies', normalizeEntityName: function() {}, afterInstall: function() { // Register shutdown animation to the end of every acceptance test if (existsSync('tests/helpers/module-f...
/*jshint node:true*/ var existsSync = require('exists-sync'); module.exports = { description: 'Install telling-stories dependencies', normalizeEntityName: function() {}, afterInstall: function() { // Register shutdown animation to the end of every acceptance test if (existsSync('tests/helpers/module-f...
Update selectors following update from master.
( function( $ ) { 'use strict'; var api = wp.customize; // Nav bar text color. api( 'amp_navbar_color', function( value ) { value.bind( function( to ) { $( 'nav.amp-wp-title-bar a' ).css( 'color', to ); $( 'nav.amp-wp-title-bar div' ).css( 'color', to ); } ); } ); // Nav bar background color. api( '...
( function( $ ) { 'use strict'; var api = wp.customize; // Nav bar text color. api( 'amp_navbar_color', function( value ) { value.bind( function( to ) { $( 'nav.title-bar a' ).css( 'color', to ); $( 'nav.title-bar div' ).css( 'color', to ); } ); } ); // Nav bar background color. api( 'amp_navbar_bac...
Use a much simpler (and faster) output building step. This implementation is much easeir to read, and is a lot clearer about what's going on. It turns out that it's about 3 times faster in python too!
import random import time def counting_sort(array): k = max(array) counts = [0]*(k+1) for x in array: counts[x] += 1 output = [] for x in xrange(k+1): output += [x]*counts[x] return output if __name__ == "__main__": assert counting_sort([5,3,2,1]) == [1,2,3,5] x = []...
import random import time def counting_sort(array): k = max(array) counts = [0]*(k+1) for x in array: counts[x] += 1 total = 0 for i in range(0,k+1): c = counts[i] counts[i] = total total = total + c output = [0]*len(array) for x in array: output[co...
Fix mailchimp test which depends on how many people are on our mailchimp testing list
<?php require_once('tests/php/base.php'); class CashSeedTests extends UnitTestCase { function testS3Seed(){ $settings = new S3Seed(1,1); $this->assertIsa($settings, 'S3Seed'); } function testTwitterSeed(){ $user_id = 1; $settings_id = 1; $twitter = new TwitterSeed($user_id,$settings_id); $th...
<?php require_once('tests/php/base.php'); class CashSeedTests extends UnitTestCase { function testS3Seed(){ $settings = new S3Seed(1,1); $this->assertIsa($settings, 'S3Seed'); } function testTwitterSeed(){ $user_id = 1; $settings_id = 1; $twitter = new TwitterSeed($user_id,$settings_id); $th...
Add 'force' option to core autoload & activate artisan command calls
<?php declare(strict_types=1); namespace Cortex\Foundation\Console\Commands; use Illuminate\Console\Command; class CoreInstallCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'cortex:install {--f|force : Force the op...
<?php declare(strict_types=1); namespace Cortex\Foundation\Console\Commands; use Illuminate\Console\Command; class CoreInstallCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'cortex:install {--f|force : Force the op...
[chore] Move `sanity/typescript` before prettier extensions
module.exports = { root: true, parser: '@typescript-eslint/parser', globals: { __DEV__: true, }, env: { node: true, browser: true, }, settings: { react: {version: '16.9.0'}, }, extends: [ 'sanity', 'sanity/react', 'sanity/import', 'plugin:@typescript-eslint/recommended'...
module.exports = { root: true, parser: '@typescript-eslint/parser', globals: { __DEV__: true, }, env: { node: true, browser: true, }, settings: { react: {version: '16.9.0'}, }, extends: [ 'sanity', 'sanity/react', 'sanity/import', 'plugin:@typescript-eslint/recommended'...
Fix test that wasn't running
import mock import unittest from cumulusci.core.config import ServiceConfig from cumulusci.core.config import TaskConfig from cumulusci.tasks.github import PullRequests from cumulusci.tests.util import create_project_config class TestPullRequests(unittest.TestCase): def test_run_task(self): project_confi...
import mock import unittest from cumulusci.core.config import ServiceConfig from cumulusci.core.config import TaskConfig from cumulusci.tasks.github import PullRequests from cumulusci.tests.util import create_project_config @mock.patch("cumulusci.tasks.github.base.get_github_api_for_user", mock.Mock()) class TestPul...
Add pre-commit as a test dependency
#!/usr/bin/env python import sys from setuptools import setup from shortuuid import __version__ assert sys.version >= "2.5", "Requires Python v2.5 or above." classifiers = [ "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Program...
#!/usr/bin/env python import sys from setuptools import setup from shortuuid import __version__ assert sys.version >= "2.5", "Requires Python v2.5 or above." classifiers = [ "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Program...
Enhance `expectPromise` helper to first check existence of `then`.
/*! resol-vbus | Copyright (c) 2013-2014, Daniel Wippermann | MIT license */ 'use strict'; var _ = require('lodash'); var Q = require('q'); var testUtils = { performAsyncTest: function(done, callback) { return Q.fcall(callback).then(function() { done(); }).fail(function(reason) { ...
/*! resol-vbus | Copyright (c) 2013-2014, Daniel Wippermann | MIT license */ 'use strict'; var _ = require('lodash'); var Q = require('q'); var testUtils = { performAsyncTest: function(done, callback) { return Q.fcall(callback).then(function() { done(); }).fail(function(reason) { ...
IMCMS-233: Apply new UI to the admin panel and editors: - Versioned content no more stealing it's version's id.
package com.imcode.imcms.mapping.jpa.doc.content; import com.imcode.imcms.mapping.jpa.doc.Version; import javax.persistence.*; import javax.validation.constraints.NotNull; @MappedSuperclass public abstract class VersionedContent { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer i...
package com.imcode.imcms.mapping.jpa.doc.content; import com.imcode.imcms.mapping.jpa.doc.Version; import javax.persistence.*; import javax.validation.constraints.NotNull; @MappedSuperclass public abstract class VersionedContent { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer i...
Add buster.assert hook when it's available
function testCase(name, tests) { var testCase = TestCase(name); for (var test in tests) { if (test != "setUp" && test != "tearDown") { testCase.prototype["test " + test] = tests[test]; } else { testCase.prototype[test] = tests[test]; } } return testCase;...
function testCase(name, tests) { var testCase = TestCase(name); for (var test in tests) { if (test != "setUp" && test != "tearDown") { testCase.prototype["test " + test] = tests[test]; } else { testCase.prototype[test] = tests[test]; } } return testCase;...
Set memory_limit to be unlimited for tests
<?php require_once realpath(__DIR__ . '/../core/slir.class.php'); abstract class SLIRTestCase extends PHPUnit_Framework_TestCase { /** * @var SLIR */ protected $slir; /** * @return void */ protected function setUp() { $this->slir = new SLIR(); SLIRConfig::$defaultImagePath = null; ...
<?php require_once realpath(__DIR__ . '/../core/slir.class.php'); abstract class SLIRTestCase extends PHPUnit_Framework_TestCase { /** * @var SLIR */ protected $slir; /** * @return void */ protected function setUp() { $this->slir = new SLIR(); SLIRConfig::$defaultImagePath = null; ...
Store partner credentials as config.
<?php abstract class ShippingEasy { public static $apiKey; public static $apiSecret; public static $partnerApiKey; public static $partnerApiSecret; public static $apiBase = 'https://app.shippingeasy.com'; public static $apiVersion = null; const VERSION = '0.4.0'; public static function getApiKey() {...
<?php abstract class ShippingEasy { public static $apiKey; public static $apiSecret; public static $apiBase = 'https://app.shippingeasy.com'; public static $apiVersion = null; const VERSION = '0.4.0'; public static function getApiKey() { return self::$apiKey; } public static function setApiKey(...
Improve error message when Component is not found in Cache
package com.axellience.vuegwt.client.definitions; import com.axellience.vuegwt.client.VueComponent; import java.util.HashMap; import java.util.Map; /** * A Cache for generated VueComponentDefinitions. * Using static initializer block, VueComponentDefinitions register an instance of themselves in * this Cache. * ...
package com.axellience.vuegwt.client.definitions; import com.axellience.vuegwt.client.VueComponent; import java.util.HashMap; import java.util.Map; /** * A Cache for generated VueComponentDefinitions. * Using static initializer block, VueComponentDefinitions register an instance of themselves in * this Cache. * ...
Set controller for register view
"use strict"; var app = angular.module("VinculacionApp", ['ui.router', 'ngAnimate']); app.config(['$stateProvider', '$urlRouterProvider',function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/'); $stateProvider .state('landing', { url: '/', templateUrl: '../templates/landing.html' ...
"use strict"; var app = angular.module("VinculacionApp", ['ui.router', 'ngAnimate']); app.config(['$stateProvider', '$urlRouterProvider',function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/'); $stateProvider .state('landing', { url: '/', templateUrl: '../templates/landing.html' ...
SAML2: Support metadata overrides of SingleLogoutService for IdP initiated SLO.
<?php require_once('../../../www/_include.php'); $config = SimpleSAML_Configuration::getInstance(); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $session = SimpleSAML_Session::getInstance(); SimpleSAML_Logger::info('SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single L...
<?php require_once('../../../www/_include.php'); $config = SimpleSAML_Configuration::getInstance(); $session = SimpleSAML_Session::getInstance(); SimpleSAML_Logger::info('SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single Logout'); if (!$config->getValue('enable.saml20-idp', false)) { SimpleSAML_Ut...
Update declared Python version to 3.6
from __future__ import absolute_import #from distutils.core import setup from setuptools import setup descr = """ microscopium: unsupervised sample clustering and dataset exploration for high content screens. """ DISTNAME = 'microscopium' DESCRIPTION = 'Clustering of High Content Screen Images' LON...
from __future__ import absolute_import #from distutils.core import setup from setuptools import setup descr = """ microscopium: unsupervised sample clustering and dataset exploration for high content screens. """ DISTNAME = 'microscopium' DESCRIPTION = 'Clustering of High Content Screen Images' LON...
Fix ENONET error found by galusben
//load zip csv into memory into a format we can easily iterate over //executed when gps2zip is required var fs = require('fs'); var zips = []; try { var data = fs.readFileSync(__dirname + '/zips.json', 'ascii'); //zips is a global defined up top zips = JSON.parse(data); } catch (err) { console.error("There was an ...
//load zip csv into memory into a format we can easily iterate over //executed when gps2zip is required var fs = require('fs'); var zips = []; try { var data = fs.readFileSync('zips.json', 'ascii'); //zips is a global defined up top zips = JSON.parse(data); } catch (err) { console.error("There was an error opening...
DERBY-6945: Remove a spurious character from a method signature; commit derby-6945-35-aa-removeSpuriousCharacter.diff. git-svn-id: 2c06e9c5008124d912b69f0b82df29d4867c0ce2@1831487 13f79535-47bb-0310-9956-ffa450edef68
/* Derby - Class org.apache.derby.loc.client.clientmessagesProviderImpl Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file...
/* Derby - Class org.apache.derby.loc.client.clientmessagesProviderImpl Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file...
Use type.name to determine component type. displayName is only for debug
import React, { Component, Children } from 'react'; import PropTypes from 'prop-types'; export default class Switch extends Component { componentDidMount() {} render() { const children = Children.toArray(this.props.children); const caseToRender = children.filter( child => child.type.name === 'Case' &...
import React, { Component, Children } from 'react'; import PropTypes from 'prop-types'; export default class Switch extends Component { componentDidMount() {} render() { const children = Children.toArray(this.props.children); const caseToRender = children.filter( child => child.type.displayName === '...
Allow the ingester to work without a report key
import boto.sns import simplejson as json import logging from memoized_property import memoized_property import os class SNSReporter(object): '''report ingestion events to SNS''' def __init__(self, report_key): self.report_key = report_key self.logger = logging.getLogger(self._log_name) @...
import boto.sns import simplejson as json import logging from memoized_property import memoized_property import os from datalake_common.errors import InsufficientConfiguration class SNSReporter(object): '''report ingestion events to SNS''' def __init__(self, report_key): self.report_key = report_key ...
Enable searching in task list by label.
# -*- coding: utf-8 -*- import django.forms as forms from django.db.models import Q class TaskSearchForm(forms.Form): search = forms.CharField(required=False) my = forms.BooleanField(required=False) def get_query(self, request): self.is_valid() search = self.cleaned_data["search"] ...
# -*- coding: utf-8 -*- import django.forms as forms from django.db.models import Q class TaskSearchForm(forms.Form): search = forms.CharField(required=False) my = forms.BooleanField(required=False) def get_query(self, request): self.is_valid() search = self.cleaned_data["search"] ...
Add PHP version to debug info.
@if (config('app.debug')) <p id="debuginfo"> <?php // Git HEAD if (function_exists('exec')) { $githead = exec('git rev-parse --short=7 HEAD'); echo "<span><strong>Git HEAD: </strong> <em>$githead</em> </span>"; } // Script exec...
@if (config('app.debug')) <p id="debuginfo"> <?php // Git HEAD if (function_exists('exec')) { $githead = exec('git rev-parse --short=7 HEAD'); echo "<span><strong>Git HEAD: </strong> <em>$githead</em> </span>"; } // Script exec...
Add color for error message.
MSG_INFO = 0x01 MSG_WARNING = 0x02 MSG_ERROR = 0x04 MSG_VERBOSE = 0x08 MSG_ALL = MSG_INFO | MSG_WARNING | MSG_ERROR | MSG_VERBOSE def logi(msg): print("[INFO] " + msg) def logv(msg): print("[VERBOSE] " + msg) def logw(msg): print("[WARNING] " + msg) def loge(msg): print("\033[1;31m[ERROR] " + ...
MSG_INFO = 0x01 MSG_WARNING = 0x02 MSG_ERROR = 0x04 MSG_VERBOSE = 0x08 MSG_ALL = MSG_INFO | MSG_WARNING | MSG_ERROR | MSG_VERBOSE def logi(msg): print("[INFO] " + msg) def logv(msg): print("[VERBOSE] " + msg) def logw(msg): print("[WARNING] " + msg) def loge(msg): print("[ERROR] " + msg) clas...
Revert "Increase JVM heap for logserver-container"
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.container.handler.ThreadpoolConfig; imp...
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.container.handler.ThreadpoolConfig; imp...
Use default connection for DB repository
<?php namespace Krucas\Counter\Integration\Laravel; use Illuminate\Support\ServiceProvider; use Krucas\Counter\Counter; class CounterServiceProvider extends ServiceProvider { /** * Bootstrap service provider. * * @return void */ public function boot() { $this->publishes(array( ...
<?php namespace Krucas\Counter\Integration\Laravel; use Illuminate\Support\ServiceProvider; use Krucas\Counter\Counter; class CounterServiceProvider extends ServiceProvider { /** * Bootstrap service provider. * * @return void */ public function boot() { $this->publishes(array( ...
Change variance of type parameter
package ceylon.language; import com.redhat.ceylon.compiler.java.metadata.Annotation; import com.redhat.ceylon.compiler.java.metadata.Annotations; import com.redhat.ceylon.compiler.java.metadata.CaseTypes; import com.redhat.ceylon.compiler.java.metadata.Ceylon; import com.redhat.ceylon.compiler.java.metadata.Name; impo...
package ceylon.language; import com.redhat.ceylon.compiler.java.metadata.Annotation; import com.redhat.ceylon.compiler.java.metadata.Annotations; import com.redhat.ceylon.compiler.java.metadata.CaseTypes; import com.redhat.ceylon.compiler.java.metadata.Ceylon; import com.redhat.ceylon.compiler.java.metadata.Name; impo...
Add solution to problem 68
/* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * 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 ...
/* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * 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 ...
Update to use dynamic ports
/** * Firefox proxy settings implementation * TODO(salomegeo): rewrite it in typescript */ var prefsvc = require("sdk/preferences/service"); var proxyConfig = function() { this.running_ = false; }; proxyConfig.startUsingProxy = function(endpoint) { if (!this.running_) { this.running_ = true; // Store ...
/** * Firefox proxy settings implementation * TODO(salomegeo): rewrite it in typescript */ var prefsvc = require("sdk/preferences/service"); var proxyConfig = function() { this.running_ = false; }; proxyConfig.startUsingProxy = function(endpoint) { if (!this.running_) { this.running_ = true; this.sock...
Convert tabs to spaces per PEP 8.
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in ...
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) f...
Add pre and post run functions (needs cleanup).
var path = require('path') , fs = require('fs') , TOML = require('toml') , bundles = require('./bundles') , useIfAvailable = require('./utils/useifavailable'); function main(pre, post) { var IoC = require('electrolyte'); var dirname = path.dirname(require.main.filename); // TODO: Make this more gener...
var path = require('path') , fs = require('fs') , TOML = require('toml') , bundles = require('./bundles') , useIfAvailable = require('./utils/useifavailable'); function main() { var IoC = require('electrolyte'); var dirname = path.dirname(require.main.filename); // TODO: Make this more generic/config...
Fix assert_raises for catching parents of exceptions.
from __future__ import unicode_literals """ Patch courtesy of: https://marmida.com/blog/index.php/2012/08/08/monkey-patching-assert_raises/ """ # code for monkey-patching import nose.tools # let's fix nose.tools.assert_raises (which is really unittest.assertRaises) # so that it always supports context management # i...
from __future__ import unicode_literals """ Patch courtesy of: https://marmida.com/blog/index.php/2012/08/08/monkey-patching-assert_raises/ """ # code for monkey-patching import nose.tools # let's fix nose.tools.assert_raises (which is really unittest.assertRaises) # so that it always supports context management # i...
emoji: Add type annotations to selectors. This fully covers this (small) file with types.
/* @flow */ import { createSelector } from 'reselect'; import type { Selector, RealmEmojiState } from '../types'; import { getRawRealmEmoji } from '../directSelectors'; import { getAuth } from '../account/accountSelectors'; import { getFullUrl } from '../utils/url'; export const getAllRealmEmojiById: Selector<RealmEmo...
/* @flow */ import { createSelector } from 'reselect'; import { getRawRealmEmoji } from '../directSelectors'; import { getAuth } from '../account/accountSelectors'; import { getFullUrl } from '../utils/url'; export const getAllRealmEmojiById = createSelector(getAuth, getRawRealmEmoji, (auth, emojis) => Object.keys(e...
Make sure class is not finalized
package org.realityforge.ssf; import java.io.Serializable; import javax.annotation.Nonnull; public class SimpleSessionInfo implements SessionInfo, Serializable { private final String _sessionID; private final String _username; private long _createdAt; private long _lastAccessedAt; public SimpleSessionInf...
package org.realityforge.ssf; import java.io.Serializable; import javax.annotation.Nonnull; public final class SimpleSessionInfo implements SessionInfo, Serializable { private final String _sessionID; private final String _username; private long _createdAt; private long _lastAccessedAt; public SimpleSess...
Change qt5reactor-fork dependency to qt5reactor. The author of qt5reactor has now changed the name.
from setuptools import setup, find_packages try: from pyqt_distutils.build_ui import build_ui cmdclass={'build_ui': build_ui} except ImportError: cmdclass={} setup( name='gauges', version='0.1', description='PyQt5 + Autobahn/Twisted version of Gauges Crossbar demo', url='http://github.com/...
from setuptools import setup, find_packages try: from pyqt_distutils.build_ui import build_ui cmdclass={'build_ui': build_ui} except ImportError: cmdclass={} setup( name='gauges', version='0.1', description='PyQt5 + Autobahn/Twisted version of Gauges Crossbar demo', url='http://github.com/...
Refactor findById to use angular filter.
(function() { angular.module('notely.notes.service', []) .service('notes', notesService); notesService['$inject'] = ['$http', '$filter']; function notesService($http, $filter) { var notes = []; var nevernoteBasePath = 'https://nevernote-1150.herokuapp.com/api/v1/'; var user = { apiKey: '$2a...
(function() { angular.module('notely.notes.service', []) .service('notes', notesService); notesService['$inject'] = ['$http']; function notesService($http) { var notes = []; var nevernoteBasePath = 'https://nevernote-1150.herokuapp.com/api/v1/'; var user = { apiKey: '$2a$10$3UAODMts8D3bK8uq...
Add import for other python versions
from __future__ import absolute_import from operator import itemgetter mapping = { 'has_header': True, 'currency': 'EUR', 'delimiter': ';', 'bank': 'GLS Bank', 'account': itemgetter('Kontonummer'), # Chop up the dotted German date format and put it in ridiculous M/D/Y order 'date': lambda ...
from operator import itemgetter mapping = { 'has_header': True, 'currency': 'EUR', 'delimiter': ';', 'bank': 'GLS Bank', 'account': itemgetter('Kontonummer'), # Chop up the dotted German date format and put it in ridiculous M/D/Y order 'date': lambda r: r['Buchungstag'][3:5] + '/' ...
fix(replacement): Fix file extension added when redirect didn't have one
import resolveNode from "../helpers/resolveNode"; import match from "../helpers/matchRedirect"; import {relative, dirname, extname} from "path"; export default function (t, originalPath, {opts: {root, extensions}, file: {opts: {filename}}}, regexps) { const requiredFilename = resolveNode(dirname(filename), originalPa...
import resolveNode from "../helpers/resolveNode"; import match from "../helpers/matchRedirect"; import {relative, dirname} from "path"; export default function (t, originalPath, {opts: {root, extensions}, file: {opts: {filename}}}, regexps) { const requiredFilename = resolveNode(dirname(filename), originalPath.node.v...
Change it to output the result to console,not file
var fs = require('fs'); var log4js = require('log4js'); var logger = log4js.getLogger('Converter'); var inputFile = process.argv[2]; if(!inputFile){ printUsage(); } /** * * If user have not input the path of text file, * It will show the correct usage of script. * */ function printUsage(){ var out = ...
var fs = require('fs'); var inputFile = process.argv[2]; var outputFile = process.argv[3]; if(!inputFile || !outputFile){ printUsage(); } /** * * If user have not input the path of text file(for input) or json file(for output), * It will show the correct usage of script. * */ function printUsage(){ v...
Remove database details from acceptance test
import shelve from whatsmyrank.players import START_RANK from whatsmyrank.players import PlayerRepository def test_shows_player_rating(browser, test_server, database_url): player_repo = PlayerRepository(database_url, START_RANK) player_repo.create('p1') app = ScoringApp(browser, test_server) app.vis...
import shelve def test_shows_player_rating(browser, test_server, database_url): with shelve.open(database_url) as db: db.clear() db['p1'] = 1000 app = ScoringApp(browser, test_server) app.visit('/') app.shows('P1 1000') def test_user_adding(browser, test_server): app = ScoringAp...
Read iceServers from the querystring
var qs = require('querystring'); var defaults = require('cog/defaults'); var quickconnect = require('rtc-quickconnect'); var getUserMedia = require('getusermedia'); var params = defaults(qs.parse(location.search.slice(1)), { signaller: 'http://switchboard.rtc.io/', iceServers: [] }); var qc; function connect(str...
var qs = require('querystring'); var defaults = require('cog/defaults'); var quickconnect = require('rtc-quickconnect'); var getUserMedia = require('getusermedia'); var params = defaults(qs.parse(location.search.slice(1)), { signaller: 'http://switchboard.rtc.io/' }); var qc; function connect(stream) { // create...
Refresh the JWT token on page load
import { User } from './ActionTypes'; import { post } from '../http'; import { replaceWith } from 'redux-react-router'; function putInLocalStorage(key) { return (payload) => { window.localStorage.setItem(key, JSON.stringify(payload)); return payload; }; } function clearLocalStorage(key) { window.localSt...
import { User } from './ActionTypes'; import { post } from '../http'; import { replaceWith } from 'redux-react-router'; function putInLocalStorage(key) { return (payload) => { window.localStorage.setItem(key, JSON.stringify(payload)); return payload; }; } function performLogin(username, password) { retu...
Make importlib dependency only take place if you need it
#!/usr/bin/env python from setuptools import find_packages, Command setup_params = dict( name='bugimporters', version=0.1, author='Various contributers to the OpenHatch project, Berry Phillips', author_email='all@openhatch.org, berryphillips@gmail.com', packages=find_packages(), description='B...
#!/usr/bin/env python from setuptools import find_packages, Command setup_params = dict( name='bugimporters', version=0.1, author='Various contributers to the OpenHatch project, Berry Phillips', author_email='all@openhatch.org, berryphillips@gmail.com', packages=find_packages(), description='B...
Adjust logging level while removing Backups module
package monoxide.forgebackup.coremod.asm; import java.util.Map; import monoxide.forgebackup.BackupLog; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.MethodNode; import com.google.common.collect.Maps; public class Ess...
package monoxide.forgebackup.coremod.asm; import java.util.Map; import monoxide.forgebackup.BackupLog; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.MethodNode; import com.google.common.collect.Maps; public class Ess...
Remove the exception lists from the API which judges whether a ReportItemHandle binds to a Linked Data Set
package org.eclipse.birt.report.data.adapter.api; import java.lang.reflect.Method; import org.eclipse.birt.report.model.api.ReportItemHandle; public class LinkedDataSetUtil { private static String GET_LINKED_DATA_MODEL_METHOD = "getLinkedDataModel"; public static boolean bindToLinkedDataSet( ReportIt...
package org.eclipse.birt.report.data.adapter.api; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import org.eclipse.birt.report.model.api.ReportItemHandle; public class LinkedDataSetUtil { private static String GET_LINKED_DATA_MODEL_METHOD = "getLinkedDataModel"; ...
Fix logic error in schedule filter
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from wafer.talks.models import TalkType, Talk, TalkUrl class ScheduleListFilter(admin.SimpleListFilter): title = _('in schedule') parameter_name = 'schedule' def lookups(self, request, model_admin): return ( ...
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from wafer.talks.models import TalkType, Talk, TalkUrl class ScheduleListFilter(admin.SimpleListFilter): title = _('in schedule') parameter_name = 'schedule' def lookups(self, request, model_admin): return ( ...
Use 100 images in list Again, a bit more real-world-ish stress testing here.
package com.wrapp.android.webimageexample; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; public class WebImageListAdapter extends BaseAdapter { private static final boolean USE_AWESOME_IMAGES = true; private static final int NUM_IMAGES = 100; private static final in...
package com.wrapp.android.webimageexample; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; public class WebImageListAdapter extends BaseAdapter { private static final boolean USE_AWESOME_IMAGES = true; private static final int NUM_IMAGES = 50; private static final int...
Fix rule number parameter check A parameter validation of rule number must be effective in preventing OS command execution.
(function() { var num = parseInt(request.param.num, 10).toString(10); var rule = data.rules[num] || null; if (rule === null) return response.error(404); switch (request.method) { case 'GET': response.head(200); response.end(JSON.stringify(rule, null, ' ')); return; case 'PUT': if (request....
(function() { var rule = data.rules[parseInt(request.param.num, 10)] || null; if (rule === null) return response.error(404); switch (request.method) { case 'GET': response.head(200); response.end(JSON.stringify(rule, null, ' ')); return; case 'PUT': if (request.headers['content-type'].match...
Rewrite EvangengelistStatus.php for better performance
<?php /** * This package fetches the data of requested individual using the Github API and ranks the Individual into * categories based on the number of public repositories the individual possesses. *@package Open Source Evangelist Agnostic Package *@author Surajudeen AKANDE <surajudeen.akande@andela.com> *@licen...
<?php /** * This package fetches the data of requested individual using the Github API and ranks the Individual into * categories based on the number of public repositories the individual possesses. *@package Open Source Evangelist Agnostic Package *@author Surajudeen AKANDE <surajudeen.akande@andela.com> *@licen...
Use normal string to encapsulate the default tpl
package template import ( "errors" "io/ioutil" "text/template" ) const defaultTemplate = "{{ range . }}{{ . }}\n\n{{ end }}" // ------------------------------------------------------- // Parser. // ------------------------------------------------------- // Parse a template (and select the appropriate engine base...
package template import ( "errors" "io/ioutil" "text/template" ) const defaultTemplate = `{{ range . }} {{ . }} {{ end }} ` // ------------------------------------------------------- // Parser. // ------------------------------------------------------- // Parse a template (and select the appropriate engine based...
Add example to start using commander.js
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, unused:true, curly:true, browser:false, indent:4, maxerr:50 */ /*global require, console, process*/ (function () { 'use strict'; var program = require('commander'), packageJSON = require('./../package....
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, unused:true, curly:true, browser:false, indent:4, maxerr:50 */ /*global require, console, process*/ // TODO: It needs paramns definition var cliHelp = require('commander'); cliHelp .version('0.0.1') .option('-p, -...
Change Bleed effect to use a material rather than a mysterious color id
package de.slikey.effectlib.effect; import de.slikey.effectlib.EffectManager; import de.slikey.effectlib.EffectType; import de.slikey.effectlib.util.RandomUtils; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Entity; public class BleedEffect extends de.slike...
package de.slikey.effectlib.effect; import de.slikey.effectlib.EffectManager; import de.slikey.effectlib.EffectType; import de.slikey.effectlib.util.RandomUtils; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.entity.Entity; public class BleedEffect extends de.slikey.effectlib.Effect { /*...
Add explicit setup for Django 1.7
#!/usr/bin/env python import sys from django.conf import settings if not settings.configured: settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } }, INSTALLED_APPS=( ...
#!/usr/bin/env python import sys from django.conf import settings if not settings.configured: settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } }, INSTALLED_APPS=( ...
Update the API to make it more semantic.
""" Database Emulator for the teammetrics project Temporarily the data is generated by accessing data available at http://blend.debian.org/liststats """ import urllib2 import logging def extractMetrics(team, metric): """ Parses the data available at the url into a data structure. """ url = "http://blends.debian.n...
""" Database Emulator for the teammetrics project Temporarily the data is generated by accessing data available at http://blend.debian.org/liststats """ import urllib2 import logging def extractMetrics(team, metric): """ Parses the data available at the url into a data structure. """ url = "http://blends.debian.n...
Return pointer from NewTimingPipe function
package pipeline import ( "time" ) // TimingPipe invokes a custom callback function with the amount of time required to run a specific Pipe type TimingPipe struct { timedPipe Pipe callback func(begin time.Time, duration time.Duration) } // NewTimingPipe creates a new timing pipe func NewTimingPipe(timedPipe Pipe...
package pipeline import ( "time" ) // TimingPipe invokes a custom callback function with the amount of time required to run a specific Pipe type TimingPipe struct { timedPipe Pipe callback func(begin time.Time, duration time.Duration) } // NewTimingPipe creates a new timing pipe func NewTimingPipe(timedPipe Pipe...
Fix - TaxedProductMixin is abstract model
from django.db import models from django.utils.translation import ugettext_lazy as _ class TaxGroup(models.Model): name = models.CharField(_("group name"), max_length=100) rate = models.DecimalField(_("rate"), max_digits=4, decimal_places=2, help_text=_("Percentile rate of the t...
from django.db import models from django.utils.translation import ugettext_lazy as _ class TaxGroup(models.Model): name = models.CharField(_("group name"), max_length=100) rate = models.DecimalField(_("rate"), max_digits=4, decimal_places=2, help_text=_("Percentile rate of the t...
Add short flags for version and verbose to match 'python' command
import logging import pkgutil import pi import pi.commands commands = {} for imp_importer, name, ispkg in pkgutil.iter_modules(pi.commands.__path__): fullname = pi.commands.__name__ + '.' + name # if fullname not in sys.modules: imp_loader = imp_importer.find_module(fullname) module = imp_loader.load...
import logging import pkgutil import pi import pi.commands commands = {} for imp_importer, name, ispkg in pkgutil.iter_modules(pi.commands.__path__): fullname = pi.commands.__name__ + '.' + name # if fullname not in sys.modules: imp_loader = imp_importer.find_module(fullname) module = imp_loader.load...
Add toString method to basic resource key. git-svn-id: ddbd9cf08712f046fd96251fb76032477531c99f@83 2c5795a3-9673-4752-9eb2-864809377e00
/* * Altimos JUtil * * Copyright (C) 2010-2011 Jan Graichen <jan.graichen@gmx.de> * * 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/LIC...
/* * Altimos JUtil * * Copyright (C) 2010-2011 Jan Graichen <jan.graichen@gmx.de> * * 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/LIC...
Add pixel diff to list of recognized tasks BUG=skia:6778 Change-Id: I61a9562930516f88e1f6308d9a36eda4978f129a Reviewed-on: https://skia-review.googlesource.com/20600 Reviewed-by: Ravi Mistry <9fa2e7438b8cb730f96b74865492597170561628@google.com> Commit-Queue: Ravi Mistry <9fa2e7438b8cb730f96b74865492597170561628@googl...
/* List of all task types. */ package task_types import ( "go.skia.org/infra/ct/go/ctfe/admin_tasks" "go.skia.org/infra/ct/go/ctfe/capture_skps" "go.skia.org/infra/ct/go/ctfe/chromium_analysis" "go.skia.org/infra/ct/go/ctfe/chromium_builds" "go.skia.org/infra/ct/go/ctfe/chromium_perf" "go.skia.org/infra/ct/go/...
/* List of all task types. */ package task_types import ( "go.skia.org/infra/ct/go/ctfe/admin_tasks" "go.skia.org/infra/ct/go/ctfe/capture_skps" "go.skia.org/infra/ct/go/ctfe/chromium_analysis" "go.skia.org/infra/ct/go/ctfe/chromium_builds" "go.skia.org/infra/ct/go/ctfe/chromium_perf" "go.skia.org/infra/ct/go/...
Watch task not re-symlinking template indexes The watch task does that now.
'use strict'; (() => { const debounce = (func, wait, immediate) => { let timeout; return () => { const context = this; const args = arguments; const later = () => { timeout = null; if (!immediate) func.apply(context, args); }; const callNow = immediate && !timeo...
'use strict'; (() => { const debounce = (func, wait, immediate) => { let timeout; return () => { const context = this; const args = arguments; const later = () => { timeout = null; if (!immediate) func.apply(context, args); }; const callNow = immediate && !timeo...
Update basic auth realm from festapp-server to conference-server
var FESTAPP_REALM = 'Basic realm="conference-server"'; function validateBasicAuth(accounts, req, res, next) { if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) { if (accounts.indexOf(new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString()) !== -1) { next();...
var FESTAPP_REALM = 'Basic realm="festapp-server"'; function validateBasicAuth(accounts, req, res, next) { if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) { if (accounts.indexOf(new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString()) !== -1) { next(); ...
Fix encoding issue PHP 5.4
<?php namespace Koara\Io; class FileReader implements Reader { private $fileName; private $index; public function __construct($fileName) { $this->fileName = $fileName; } public function read(&$buffer, $offset, $length) { $filecontent = @file_get_contents($this->fileName, false, null, $this->ind...
<?php namespace Koara\Io; class FileReader implements Reader { private $fileName; private $index; public function __construct($fileName) { $this->fileName = $fileName; } public function read(&$buffer, $offset, $length) { $filecontent = @file_get_contents($this->fileName, false, null, $this->ind...
Allow zeros for recurring interval
from ckan.lib.navl.validators import ignore_empty, not_empty from ckan.logic.validators import ( name_validator, boolean_validator, natural_number_validator, isodate, group_id_exists) def default_inventory_entry_schema(): schema = { 'id': [unicode, ignore_empty], 'title': [unicode, not_emp...
from ckan.lib.navl.validators import ignore_empty, not_empty from ckan.logic.validators import ( name_validator, boolean_validator, is_positive_integer, isodate, group_id_exists) def default_inventory_entry_schema(): schema = { 'id': [unicode, ignore_empty], 'title': [unicode, not_empty], ...
Fix build with Sphinx 4. `add_stylesheet` was deprecated in 1.8 and removed in 4.0 [1]. The replacement, `add_css_file` was added in 1.0, which is older than any version required by `breathe`. [1] https://www.sphinx-doc.org/en/master/extdev/deprecated.html?highlight=add_stylesheet
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import subprocess on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if on_rtd: subprocess.call('cd ..; doxygen', shell=True) import sphinx_rtd_theme html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] def se...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import subprocess on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if on_rtd: subprocess.call('cd ..; doxygen', shell=True) import sphinx_rtd_theme html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] def set...
Remove all html from divider and use papi_html_tag
<?php // Exit if accessed directly defined( 'ABSPATH' ) || exit; /** * Papi Property Divider class. * * @package Papi */ class Papi_Property_Divider extends Papi_Property { /** * Display property html. */ public function html() { $options = $this->get_options(); papi_render_html_tag( 'div', [ 'clas...
<?php // Exit if accessed directly defined( 'ABSPATH' ) || exit; /** * Papi Property Divider class. * * @package Papi */ class Papi_Property_Divider extends Papi_Property { /** * Display property html. */ public function html() { $options = $this->get_options(); ?> <div class="papi-property-divider" ...
Fix script to extract changelog for Python 3
#!/usr/bin/python import sys if len(sys.argv) < 2: print("Usage: %s <changelog> [<version>]" % (sys.argv[0],)) sys.exit(1) changelog = open(sys.argv[1]).readlines() version = "latest" if len(sys.argv) > 2: version = sys.argv[2] start = 0 end = -1 for i, line in enumerate(changelog): if line.startsw...
#!/usr/bin/python import sys if len(sys.argv) < 2: print("Usage: %s <changelog> [<version>]" % (sys.argv[0],)) sys.exit(1) changelog = open(sys.argv[1]).readlines() version = "latest" if len(sys.argv) > 2: version = sys.argv[2] start = 0 end = -1 for i, line in enumerate(changelog): if line.startsw...
Add JSONParser.js to ViewlessModels - working in node again
/** * @license * Copyright 2012 Google Inc. All Rights Reserved. * * 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 requir...
/** * @license * Copyright 2012 Google Inc. All Rights Reserved. * * 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 requir...
Update administration tool copyright year
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2008 osCommerce Released under the GNU General Public License */ ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="center" class="smallText"> <?php /* The followi...
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2008 osCommerce Released under the GNU General Public License */ ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="center" class="smallText"> <?php /* The followi...
Add togglepause command documentation and change command order
module.exports = { help: (message, config) => { const p = config.prefix; message.channel.send( `\`\`\`diff ++ MUSIC COMMANDS ++ ${p}play URL - Plays a song at a YouTube URL. ${p}stop - Interrupts the current song. ${p}queue - Says the current queue. ${p}clearqueue - Clears the queue. ${p}ple...
module.exports = { help: (message, config) => { const p = config.prefix; message.channel.send( `\`\`\`diff ++ MUSIC COMMANDS ++ ${p}play URL - Plays a song at a YouTube URL. ${p}stop - Interrupts the current song. ${p}queue - Says the current queue. ${p}pleasestop - Clears the queue and inte...
[docs/hugo] Move to hugo version 0.82.0 When adding more pinmux signals and pads, we run into a funny error where HUGO can't read the generated pinmux register documentation anymore since the file is too big. This file limitation has just recently (3 months ago) been removed. See https://github.com/gohugoio/hugo/pull...
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 # Version requirements for various tools. Checked by tooling (e.g. fusesoc), # and inserted into the documentation. # # Entries are keyed by tool name. The value is either ...
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 # Version requirements for various tools. Checked by tooling (e.g. fusesoc), # and inserted into the documentation. # # Entries are keyed by tool name. The value is either ...
Add message when volume attached to instance outside project
/** @jsx React.DOM */ define( [ 'react', 'backbone' ], function (React, Backbone) { return React.createClass({ propTypes: { volume: React.PropTypes.instanceOf(Backbone.Model).isRequired, instances: React.PropTypes.instanceOf(Backbone.Collection).isRequired }, rend...
/** @jsx React.DOM */ define( [ 'react', 'backbone' ], function (React, Backbone) { return React.createClass({ propTypes: { volume: React.PropTypes.instanceOf(Backbone.Model).isRequired, instances: React.PropTypes.instanceOf(Backbone.Collection).isRequired }, rend...
Correct base_url usage, and force commit
from flask import current_app from changes.config import queue, db from changes.backends.jenkins.builder import JenkinsBuilder from changes.constants import Status from changes.models.build import Build @queue.job def sync_build(build_id): try: build = Build.query.get(build_id) if build.status ==...
from flask import current_app from changes.config import queue from changes.backends.jenkins.builder import JenkinsBuilder from changes.constants import Status from changes.models.build import Build @queue.job def sync_build(build_id): try: build = Build.query.get(build_id) if build.status == Sta...
Convert 'ttp' string to link even if it appears at the first position of response
// ==UserScript== // @name Modify URL @2ch // @namespace curipha // @description Modify texts starting with "ttp://" to anchor and redirect URIs to direct link // @include http://*.2ch.net/* // @include http://*.bbspink.com/* // @version 0.1.2 // @grant none // @noframes ...
// ==UserScript== // @name Modify URL @2ch // @namespace curipha // @description Modify texts starting with "ttp://" to anchor and redirect URIs to direct link // @include http://*.2ch.net/* // @include http://*.bbspink.com/* // @version 0.1.2 // @grant none // @noframes ...
Throw error instead of returning it.
// http://cs.selu.edu/~rbyrd/math/midpoint/ // ((x1+x2)/2), ((y1+y2)/2) var point = require('turf-point'); /** * Takes two point features and returns a point between the two. * * @module turf/midpoint * @param {Point} a * @param {Point} b * @return {Point} a point between the two * @example * var pt1 = turf.po...
// http://cs.selu.edu/~rbyrd/math/midpoint/ // ((x1+x2)/2), ((y1+y2)/2) var point = require('turf-point'); /** * Takes two point features and returns a point between the two. * * @module turf/midpoint * @param {Point} a * @param {Point} b * @return {Point} a point between the two * @example * var pt1 = turf.po...
Store released dark_lang codes as all lower-case
""" Models for the dark-launching languages """ from django.db import models from config_models.models import ConfigurationModel class DarkLangConfig(ConfigurationModel): """ Configuration for the dark_lang django app """ released_languages = models.TextField( blank=True, help_text="A...
""" Models for the dark-launching languages """ from django.db import models from config_models.models import ConfigurationModel class DarkLangConfig(ConfigurationModel): """ Configuration for the dark_lang django app """ released_languages = models.TextField( blank=True, help_text="A...
Use 'my_counts' as name for MyCountsListView
from django.conf.urls import patterns, include, url from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.contrib.auth.views import login, logout from cellcounter.main.views import new_count, view_cou...
from django.conf.urls import patterns, include, url from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.contrib.auth.views import login, logout from cellcounter.main.views import new_count, view_cou...
Drop try/catch that causes uncaught errors in the Observer to be silently ignored
import threading import time from observer.event_loop import PlanetStackObserver from observer.event_manager import EventListener from util.logger import Logger, logging logger = Logger(level=logging.INFO) class Backend: def run(self): # start the openstack observer observer = PlanetS...
import threading import time from observer.event_loop import PlanetStackObserver from observer.event_manager import EventListener from util.logger import Logger, logging logger = Logger(level=logging.INFO) class Backend: def run(self): try: # start the openstack observer obser...
Make POST request when updating object
<?php /** * Abstraction of an instance resource from the Twilio API. * * @category Services * @package Services_Twilio * @author Neuman Vong <neuman@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT * @link http://pear.php.net/package/Services_Twilio */ abstract class Services_Twilio...
<?php /** * Abstraction of an instance resource from the Twilio API. * * @category Services * @package Services_Twilio * @author Neuman Vong <neuman@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT * @link http://pear.php.net/package/Services_Twilio */ abstract class Services_Twilio...
[IMP] Use TransientModel for the dummy model used in translation testing
# -*- coding: utf-8 -*- import openerp from openerp.tools.translate import _ class m(openerp.osv.orm.TransientModel): """ A model to provide source strings. """ _name = 'test.translation.import' _columns = { 'name': openerp.osv.fields.char( '1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25...
# -*- coding: utf-8 -*- import openerp from openerp.tools.translate import _ class m(openerp.osv.osv.Model): """ A model to provide source strings. """ _name = 'test.translation.import' _columns = { 'name': openerp.osv.fields.char( '1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KT...