text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix "moveFeature" tool initialization errors
(function () { "use strict"; if (window.ol && ol.source && !ol.source.VectorEventType) { // HACK: monkey patch event types not present in current OL6 repackage build // @see https://github.com/openlayers/openlayers/blob/main/src/ol/source/VectorEventType.js ol.source.VectorEventType = { ...
(function () { "use strict"; if (window.ol && ol.source && !ol.source.VectorEventType) { // HACK: monkey patch event types not present in current OL6 repackage build // @see https://github.com/openlayers/openlayers/blob/main/src/ol/source/VectorEventType.js ol.source.VectorEventType = { ...
Resolve getter e setter para isObrigatorio
package br.fameg.edu.domain.model; import java.math.BigDecimal; import java.sql.Date; import javax.persistence.*; @Entity public class Trabalho { @Id @GeneratedValue private Long id; @Column(nullable = false) private String descricao; @OneToOne private Professor professor; @Column(n...
package br.fameg.edu.domain.model; import java.math.BigDecimal; import java.sql.Date; import javax.persistence.*; @Entity public class Trabalho { @Id @GeneratedValue private Long id; @Column(nullable = false) private String descricao; @OneToOne private Professor professor; @Column(n...
Fix warnings in php7.2 by initialising the operands array
<?php /* * This file is part of the Ruler package, an OpenSky project. * * (c) 2011 OpenSky Project Inc * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Ruler; /** * @author Jordan Raub <jordan@raub.me> */ abstract cl...
<?php /* * This file is part of the Ruler package, an OpenSky project. * * (c) 2011 OpenSky Project Inc * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Ruler; /** * @author Jordan Raub <jordan@raub.me> */ abstract cl...
Allow themes to overload BoomCMS views (e.g. for customising login page / user generation email
<?php namespace BoomCMS\ServiceProviders; use BoomCMS\Core\Template\Manager as TemplateManager; use BoomCMS\Support\Helpers\Config; use Illuminate\Support\ServiceProvider; class TemplateServiceProvider extends ServiceProvider { protected $themes = []; /** * Bootstrap any application services. * ...
<?php namespace BoomCMS\ServiceProviders; use BoomCMS\Core\Template\Manager as TemplateManager; use BoomCMS\Support\Helpers\Config; use Illuminate\Support\ServiceProvider; class TemplateServiceProvider extends ServiceProvider { protected $themes = []; /** * Bootstrap any application services. * ...
Fix error after login: V1 is not a function
(function () { angular .module('auth') .controller('LoginController', LoginController); LoginController.$inject = [ 'AuthService', 'Notification', '$scope', '$location' ]; function LoginController(AuthService, Notification, $scope, $location) { ...
(function () { angular .module('auth') .controller('LoginController', LoginController); LoginController.$inject = [ 'AuthService', 'Notification', '$scope', '$location' ]; function LoginController(AuthService, Notification, $scope, $location) { ...
Support default exports with babel-jsm-plugin
var exportIds = []; function exportEnterHandler(node, parent) { // For variable declarations since exports will have multiple id names in one if (node.declaration.declarations) { node.declaration.declarations.forEach(function(declaration) { exportIds.push(declaration.id.name); }.bind(this)); retur...
module.exports = function (babel) { var exportIds = []; var t = babel.types; return new babel.Transformer("babel-jsm-plugin", { ExportNamedDeclaration: { enter: function(node, parent) { // For variable declarations since exports will have multiple id names in one if (node.declaration.dec...
Use Blade's helper to check for the first row
<!DOCTYPE html> <html lang="en"> <head> <title>Print Table</title> <meta charset="UTF-8"> <meta name=description content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap CSS --> <link href="https://maxcdn.bootstrapcdn.com/boots...
<!DOCTYPE html> <html lang="en"> <head> <title>Print Table</title> <meta charset="UTF-8"> <meta name=description content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap CSS --> <link href="https://maxcdn.bootstrapcdn.com/boots...
Reorder function in importer base class.
OV.ImporterBase = class { constructor () { this.extension = null; this.callbacks = null; this.model = null; this.error = null; this.message = null; } Import (content, extension, callbacks) { this.extension = extension; this.callbacks = callbacks; ...
OV.ImporterBase = class { constructor () { this.extension = null; this.callbacks = null; this.model = null; this.error = null; this.message = null; } Import (content, extension, callbacks) { this.extension = extension; this.callbacks = callbacks; ...
Fix version to include 2.0 for now (3.0 appears unfindable)
import os from setuptools import find_packages, setup from asgiref import __version__ # We use the README as the long_description readme_path = os.path.join(os.path.dirname(__file__), "README.rst") setup( name='asgiref', version=__version__, url='http://github.com/django/asgiref/', author='Django So...
import os from setuptools import find_packages, setup from asgiref import __version__ # We use the README as the long_description readme_path = os.path.join(os.path.dirname(__file__), "README.rst") setup( name='asgiref', version=__version__, url='http://github.com/django/asgiref/', author='Django So...
Fix endless execution of integration tests
var injection = require('../services/injection.js'); var Q = require('q'); var mongoose = require('mongoose'); module.exports = function (test, fixtureName, testFn) { var dbUrl = 'mongodb://localhost:27017/' + fixtureName; var cleanUp = function () { return Q.nbind(mongoose.connect, mongoose)(dbUrl).t...
var injection = require('../services/injection.js'); var Q = require('q'); var mongoose = require('mongoose'); module.exports = function (test, fixtureName, testFn) { var dbUrl = 'mongodb://localhost:27017/' + fixtureName; var cleanUp = function () { return Q.nbind(mongoose.connect, mongoose)(dbUrl).t...
Add DHCP lease binding to the protocol
// Copyright 2014, Renasar Technologies Inc. /* jshint: node:true */ 'use strict'; var di = require('di'); module.exports = eventsProtocolFactory; di.annotate(eventsProtocolFactory, new di.Provide('Protocol.Events')); di.annotate(eventsProtocolFactory, new di.Inject( 'Services.Messenger', 'Proto...
// Copyright 2014, Renasar Technologies Inc. /* jshint: node:true */ 'use strict'; var di = require('di'); module.exports = eventsProtocolFactory; di.annotate(eventsProtocolFactory, new di.Provide('Protocol.Events')); di.annotate(eventsProtocolFactory, new di.Inject( 'Services.Messenger', 'Proto...
Fix samples comparison after upgrading to MSON Zoo 3.0.
import React from 'react'; import ReactDomServer from 'react-dom/server'; import msonZoo from 'mson-zoo'; import jsBeautify from 'js-beautify'; import fs from 'fs'; import path from 'path'; import assert from 'assert'; import dedent from 'dedent'; import parseMson from '../playground/parseMson'; import { Attributes } ...
import React from 'react'; import ReactDomServer from 'react-dom/server'; import msonZoo from 'mson-zoo'; import jsBeautify from 'js-beautify'; import fs from 'fs'; import path from 'path'; import assert from 'assert'; import dedent from 'dedent'; import parseMson from '../playground/parseMson'; import { Attributes }...
Add dirname to resolve.root to fix import linting in Atom
var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var BundleTracker = require('webpack-bundle-tracker'); var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin"); module.exports = { context: __dirname, devtool: 'eval-sou...
var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var BundleTracker = require('webpack-bundle-tracker'); var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin"); module.exports = { context: __dirname, devtool: 'eval-sou...
Add a watch for html changes and launch htmlmin
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { build: ['Gruntfile.js', 'src/**/*.js'] }, watch: { scripts: { files: 'src/**/*.js', tasks: ['jshint'] }, html: { files:...
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { build: ['Gruntfile.js', 'src/**/*.js'] }, watch: { scripts: { files: 'src/**/*.js', tasks: ['jshint'] } }, copy: { buil...
Make input type = "number" This should help display the correct keyboard on mobile devices
import React from 'react'; import RIEStatefulBase from './RIEStatefulBase'; export default class RIENumber extends RIEStatefulBase { constructor(props) { super(props); } static propTypes = { format: React.PropTypes.func }; validate = (value) => { return !isNaN(value) && i...
import React from 'react'; import RIEStatefulBase from './RIEStatefulBase'; export default class RIENumber extends RIEStatefulBase { constructor(props) { super(props); } static propTypes = { format: React.PropTypes.func }; validate = (value) => { return !isNaN(value) && i...
Fix router behaviour for manually changed URLs
class RcdHistoryRouter { constructor() { this.routes = {}; this.defaultRoute; window.onpopstate = (event) => { this.refreshState(); }; } init() { return this; } addDefaultRoute(callback) { this.defaultRoute = callback; return this...
class RcdHistoryRouter { constructor() { this.routes = {}; this.defaultRoute; window.onpopstate = (event) => this.setState(event.state); } init() { return this; } addDefaultRoute(callback) { this.defaultRoute = callback; return this; } addRo...
Make plugin name bold in /help
import Plugin from "./Plugin"; export default class MasterPlugin extends Plugin { static get plugin() { return { name: "MasterPlugin", description: "", help: "This plugin has access to PluginManager and will perform all the 'meta'/'super' actions.", type: P...
import Plugin from "./Plugin"; export default class MasterPlugin extends Plugin { static get plugin() { return { name: "MasterPlugin", description: "", help: "This plugin has access to PluginManager and will perform all the 'meta'/'super' actions.", type: P...
Write a specific message to the queue
async function activemq_service(args) { /* description("ActiveMQ Service") base_component_id("activemq_service") load_once_from_file(true) only_run_on_server(true) */ var promise = new Promise(async function(returnfn) { // // test_connection // try { const stompit = r...
async function activemq_service(args) { /* description("ActiveMQ Service") base_component_id("activemq_service") load_once_from_file(true) only_run_on_server(true) */ var promise = new Promise(async function(returnfn) { // // test_connection // try { const stompit = r...
Fix issues with loading from dict
# Copyright (c) 2010 John Reese # Licensed under the MIT license import yaml from combine import CombineError MANIFEST_FORMAT = 1 class Manifest: def __init__(self): self.properties = {"manifest-format": MANIFEST_FORMAT} self.actions = [] def add_property(self, name, value): self.p...
# Copyright (c) 2010 John Reese # Licensed under the MIT license import yaml from combine import CombineError MANIFEST_FORMAT = 1 class Manifest: def __init__(self): self.properties = {"manifest-format": MANIFEST_FORMAT} self.actions = [] def add_property(self, name, value): self.p...
Replace "type" form option with "entry_type".
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\UserBundle\Config...
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\UserBundle\Config...
Add extension to DI configuration
<?php namespace DMS\Bundle\TwigExtensionBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link h...
<?php namespace DMS\Bundle\TwigExtensionBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link h...
Fix bug for numpy's irfftn address #232 Fix bug for numpy's irfftn. The size of the returned array must be passed because the returned size is potentially not unique. Without this change only the return kernel would possibly have the wrong shape.
from .abstract import _AbstractMicrostructureBasis import numpy as np class _RealFFTBasis(_AbstractMicrostructureBasis): def __init__(self, *args, **kwargs): super(_RealFFTBasis, self).__init__(*args, **kwargs) def _fftn(self, X, threads=1, avoid_copy=True): if self._pyfftw: retur...
from .abstract import _AbstractMicrostructureBasis import numpy as np class _RealFFTBasis(_AbstractMicrostructureBasis): def __init__(self, *args, **kwargs): super(_RealFFTBasis, self).__init__(*args, **kwargs) def _fftn(self, X, threads=1, avoid_copy=True): if self._pyfftw: retur...
Handle empty response form /suggest
/** * Created by Tomasz Gabrysiak @ Infermedica on 08/02/2017. */ import html from '../../templates/helpers'; const template = (context) => { return new Promise((resolve) => { context.api.getSuggestedSymptoms(context.data).then((suggestedSymptoms) => { if (!suggestedSymptoms.length) { resolve('<...
/** * Created by Tomasz Gabrysiak @ Infermedica on 08/02/2017. */ import html from '../../templates/helpers'; const template = (context) => { return new Promise((resolve) => { context.api.getSuggestedSymptoms(context.data).then((suggestedSymptoms) => { resolve(html` <h5 class="card-title">Do y...
Use 'end' instead of 'exit' to guarantee that streams are flushed.
var cp = require('child_process'); var Q = require('q'); var createError = require('./createError'); // Executes a shell command // Buffers the stdout and stderr // If an error occurs, a meaningfull error is generated function cmd(command, args, options) { var process, stderr = '', stdout = '', ...
var cp = require('child_process'); var Q = require('q'); var createError = require('./createError'); // Executes a shell command // Buffers the stdout and stderr // If an error occurs, a meaningfull error is generated function cmd(command, args, options) { var process, stderr = '', stdout = '', ...
Fix misplaced colon in test suite
#! usr/bin/env python3 import unittest from sqlviz import Schema # Tests will go here...eventually class InventorySchemaSpec (unittest.TestCase): def setUp (self): self.schema = Schema( """DROP TABLE Inventory; CREATE TABLE Inventory ( id INT PRIMARY...
#! usr/bin/env python3 import unittest from sqlviz import Schema # Tests will go here...eventually class InventorySchemaSpec (unittest.TestCase): def setUp (self): self.schema = Schema( """DROP TABLE Inventory; CREATE TABLE Inventory ( id INT PRIMARY...
Set a timer to detect when the mouse stops moving
buttonCodeToChar = {1: "Left", 2: "Middle", 3: "Right"}; buttonCharToCode = {"Left": 1, "Middle": 2, "Right": 3}; function Mouse() { // It'd be good to get this info on construction this.x = -1; this.y = -1; this.dx = 0; this.dy = 0; this.events = []; this.timeout = null; this.UpdatePo...
buttonCodeToChar = {1: "Left", 2: "Middle", 3: "Right"}; buttonCharToCode = {"Left": 1, "Middle": 2, "Right": 3}; function Mouse() { // It'd be good to get this info on construction this.x = -1; this.y = -1; this.dx = 0; this.dy = 0; this.events = []; this.UpdatePosition = function(nx, ny)...
Add Evil Martians link to footer
import React, { Component } from "react" import styles from "./index.css" import logo from "./evilmartians.svg" export default class Footer extends Component { render() { return ( <footer className={ styles.root } role="contentinfo"> <div className={ styles.inner }> <div className={ sty...
import React, { Component } from "react" import styles from "./index.css" import logo from "./evilmartians.svg" export default class Footer extends Component { render() { return ( <footer className={ styles.root } role="contentinfo"> <div className={ styles.inner }> <div className={ sty...
Print table if no file format provided
import csv import json import os from tabulate import tabulate def write_data(d, u, f=None): if f is not None: directory = './data/' if not os.path.exists(directory): os.makedirs(directory) file = open(directory + u + '.' + f, 'w') if f == 'json': file.w...
import colour import csv import json import os import pprint # write to file as json, csv, markdown, plaintext or print table def write_data(data, user, format=None): if format is not None: directory = './data/' if not os.path.exists(directory): os.makedirs(directory) f = ...
Add the new tags at the end
<?php namespace PMT\WebBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Symfony\Component\HttpFoundation\JsonResponse; class AjaxController extends Controller { ...
<?php namespace PMT\WebBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Symfony\Component\HttpFoundation\JsonResponse; class AjaxController extends Controller { ...
Use ExecutorService instead of Executor
package de.haw.vs.nameservice.connectionhandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class Server implements IServer { ...
package de.haw.vs.nameservice.connectionhandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.concurrent.Executor; import java.util.concurrent.Executors; public class Server implements IServer { privat...
Fix broken reference to YouTube metadata
<?php require_once __DIR__ . '/../bootstrap.php'; $client = new Madcoda\Youtube(['key' => $config->youtube->key]); $mostRecentVideoDateTime = $db->getRead()->fetchValue( "SELECT `datetime` FROM `jpemeric_stream`.`youtube` ORDER BY `datetime` DESC LIMIT 1" ); $mostRecentVideoDateTime = new DateTime($mostRecentVid...
<?php require_once __DIR__ . '/../bootstrap.php'; $client = new Madcoda\Youtube(['key' => $config->youtube->key]); $mostRecentVideoDateTime = $db->getRead()->fetchValue( "SELECT `datetime` FROM `jpemeric_stream`.`youtube` ORDER BY `datetime` DESC LIMIT 1" ); $mostRecentVideoDateTime = new DateTime($mostRecentVid...
Add falsey arguments check to loop condition
(function(root, factory) { 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. /* istanbul ignore next */ if (typeof define === 'function' && define.amd) { define('stack-generator', ['stackframe'], factory); } else if (typeof exports ===...
(function(root, factory) { 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. /* istanbul ignore next */ if (typeof define === 'function' && define.amd) { define('stack-generator', ['stackframe'], factory); } else if (typeof exports ===...
Insert custom commands through the getCommands() function.
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Languages * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Templates T...
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Languages * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Templates T...
Check if error available on output
"""Test mixins.""" import os import sys import six from django.core.management import call_command from django.utils.six import StringIO class CallCommandMixin(object): """A mixin to provide command execution shortcuts.""" def setUp(self): """Replace stdin""" super(CallCommandMixin, self)....
"""Test mixins.""" import os import sys import six from django.core.management import call_command class CallCommandMixin(object): """A mixin to provide command execution shortcuts.""" def setUp(self): """Replace stdin""" super(CallCommandMixin, self).setUp() self.stdin = sys.stdin...
Sort elements according to newEntityIds order.
import { without } from 'substance' export default function updateEntityChildArray(editorSession, nodeId, tagName, attribute, oldEntityIds, newEntityIds) { editorSession.transaction(tx => { let node = tx.get(nodeId) let addedEntityIds = without(newEntityIds, ...oldEntityIds) let removedEntityIds = with...
import { without } from 'substance' export default function updateEntityChildArray(editorSession, nodeId, tagName, attribute, oldEntityIds, newEntityIds) { editorSession.transaction(tx => { let node = tx.get(nodeId) let addedEntityIds = without(newEntityIds, ...oldEntityIds) let removedEntityIds = with...
Remove backslash escaping where it is not needed.
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\Utils\Form\Type; ...
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\Utils\Form\Type; ...
Check observer callback functionhood at registration
/* * debugger.io: An interactive web scripting sandbox * * observers.js: mutation observers */ define([ 'config', 'utils', 'jquery', 'underscore', 'bus' ], function( config, utils, $, _, bus ) { 'use strict'; var observers = utils.module('observers'); var listeners = {}; var last_lid = 0; var Mu...
/* * debugger.io: An interactive web scripting sandbox * * observers.js: mutation observers */ define([ 'config', 'utils', 'jquery', 'underscore', 'bus' ], function( config, utils, $, _, bus ) { 'use strict'; var observers = utils.module('observers'); var listeners = {}; var last_lid = 0; var Mu...
Allow modification of the prohibited keys array, via class methods
<?php namespace Silktide\LazyBoy\Controller; use Symfony\Component\HttpFoundation\JsonResponse; /** * RestControllerTrait */ trait RestControllerTrait { private $prohibitedKeys = [ "password" => true, "salt" => true ]; protected function success($data = null, $code = 200) { ...
<?php namespace Silktide\LazyBoy\Controller; use Symfony\Component\HttpFoundation\JsonResponse; /** * RestControllerTrait */ trait RestControllerTrait { private $prohibitedKeys = [ "password" => true, "salt" => true ]; protected function success($data = null, $code = 200) { ...
Fix: Enable Config instantiation from kwargs only
# -*- coding: utf-8 -*- # Copyright (c) 2012 theo crevon # # See the file LICENSE for copying permission. from ConfigParser import ConfigParser from utils.snippets import items_to_dict class Config(dict): """ Unix shells like environment class. Implements add, get, load, flush methods. Handles lists of...
# -*- coding: utf-8 -*- # Copyright (c) 2012 theo crevon # # See the file LICENSE for copying permission. from ConfigParser import ConfigParser from utils.snippets import items_to_dict class Config(dict): """ Unix shells like environment class. Implements add, get, load, flush methods. Handles lists of...
Set cov-core dependency to 1.11
import setuptools setuptools.setup(name='pytest-cov', version='1.6', description='py.test plugin for coverage reporting with ' 'support for both centralised and distributed testing, ' 'including subprocesses and multiprocessing', long...
import setuptools setuptools.setup(name='pytest-cov', version='1.6', description='py.test plugin for coverage reporting with ' 'support for both centralised and distributed testing, ' 'including subprocesses and multiprocessing', long...
Change return type hinting to reference the Proxy class
<?php declare(strict_types=1); namespace ProxyManager\ProxyGenerator\NullObject\MethodGenerator; use ProxyManager\Generator\MethodGenerator; use ProxyManager\ProxyGenerator\Util\Properties; use ReflectionClass; use ReflectionProperty; use Zend\Code\Generator\Exception\InvalidArgumentException; use function array_map...
<?php declare(strict_types=1); namespace ProxyManager\ProxyGenerator\NullObject\MethodGenerator; use ProxyManager\Generator\MethodGenerator; use ProxyManager\ProxyGenerator\Util\Properties; use ReflectionClass; use ReflectionProperty; use Zend\Code\Generator\Exception\InvalidArgumentException; use function array_map...
Fix centering of provider list
var m = require('mithril'); var utils = require('./utils'); var MESSAGES = JSON.parse(require('raw!./messages.json')); var Footer = {}; Footer.view = function(ctrl) { return m('', [ m( 'ul.provider-footer.col-xs-12.col-lg-10.col-lg-offset-1', { style: { ...
var m = require('mithril'); var utils = require('./utils'); var MESSAGES = JSON.parse(require('raw!./messages.json')); var Footer = {}; Footer.view = function(ctrl) { return m('', [ m( 'ul.provider-footer.col-xs-12.col-lg-10.col-lg-offset-2', { style: { ...
Apply new symfony preset fixer "phpdoc_types_null_last"
<?php namespace Kunstmaan\VotingBundle\EventListener; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\VotingBundle\Entity\AbstractVote; use Kunstmaan\VotingBundle\Event\EventInterface; abstract class AbstractVoteListener { /** * @var EntityManagerInterface */ protected $em; /** * @...
<?php namespace Kunstmaan\VotingBundle\EventListener; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\VotingBundle\Entity\AbstractVote; use Kunstmaan\VotingBundle\Event\EventInterface; abstract class AbstractVoteListener { /** * @var EntityManagerInterface */ protected $em; /** * @...
Set CURLOPT_RETURNTRANSFER to true so that the string value of the transfer is returned rather than outputting it directly.
<?php namespace Zipkin\Reporters\Http; use BadFunctionCallException; use RuntimeException; final class CurlFactory implements ClientFactory { private function __construct() { } /** * @return CurlFactory * @throws \BadFunctionCallException if the curl extension is not installed. */ ...
<?php namespace Zipkin\Reporters\Http; use BadFunctionCallException; use RuntimeException; final class CurlFactory implements ClientFactory { private function __construct() { } /** * @return CurlFactory * @throws \BadFunctionCallException if the curl extension is not installed. */ ...
Revert "Temporarily disable rpc authorization on configserver" This reverts commit 0ce64af793fe21b6047af2be1b973b525b008c3a.
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.rpc.security; import com.google.inject.Inject; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.config.provision.security.NodeIdentifier; import com.y...
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.rpc.security; import com.google.inject.Inject; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.config.provision.security.NodeIdentifier; import com.y...
Upgrade dependencies a wee bit
import sys from setuptools import setup, find_packages import mut REQUIRES = [ 'boto>=2.39,<2.40', 'certifi', 'docopt>=0.6,<0.7', 'docutils', 'dominate>=2.1,<2.2', 'libgiza>=0.2.13,<0.3', 'PyYAML', 'requests>2.9,<2.10', 'rstcloth>=0.2.6', 'sphinx>=1.5', ] # Need a fallback for ...
import sys from setuptools import setup, find_packages import mut REQUIRES = [ 'boto>=2.39,<2.40', 'certifi', 'docopt>=0.6,<0.7', 'docutils', 'dominate>=2.1,<2.2', 'libgiza>=0.2.13,<0.3', 'PyYAML', 'requests>2.9,<2.10', 'rstcloth>0.2.5', 'sphinx>1.4', ] # Need a fallback for th...
Fix invalid typehint for subject in is_granted Twig function
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\Twig\Extension; use Symfony\Component\Security\Acl\Voter...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\Twig\Extension; use Symfony\Component\Security\Acl\Voter...
Add ability to set hashing function in SimpleHash
package gash // A simple chained hash. type SimpleHash struct { items [][]*KvPair capacity int fn HashFn } func CreateSimpleHash(capacity int, fn HashFn) SimpleHash { table := SimpleHash{} table.capacity = capacity table.items = make([][]*KvPair, capacity) for index := range table.items {...
package gash // A simple chained hash. type SimpleHash struct { items [][]*KvPair capacity int } func CreateSimpleHash(capacity int) SimpleHash { table := SimpleHash{} table.capacity = capacity table.items = make([][]*KvPair, capacity) for index := range table.items { table.items[inde...
Mark saturation as an epic ability
package org.cyclops.everlastingabilities.ability.config; import net.minecraft.init.MobEffects; import net.minecraft.item.EnumRarity; import org.cyclops.cyclopscore.helper.MinecraftHelpers; import org.cyclops.everlastingabilities.ability.AbilityTypePotionEffectSelf; import org.cyclops.everlastingabilities.core.config.e...
package org.cyclops.everlastingabilities.ability.config; import net.minecraft.init.MobEffects; import net.minecraft.item.EnumRarity; import org.cyclops.cyclopscore.helper.MinecraftHelpers; import org.cyclops.everlastingabilities.ability.AbilityTypePotionEffectSelf; import org.cyclops.everlastingabilities.core.config.e...
Update calculator request for new CRONUS versions
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); define('CRONUS_BASE', 'http://hess.ess.washington.edu/'); define('CRONUS_URI', CRONUS_BASE . 'cgi-bin/matweb'); class Calculator { public static function send($submitText, $calcType) { // prepare for a curl call if ($cal...
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); define('CRONUS_BASE', 'http://hess.ess.washington.edu/'); define('CRONUS_URI', CRONUS_BASE . 'cgi-bin/matweb'); class Calculator { function send($submitText, $calcType) { // prepare for a curl call $fields = array( ...
Add log if worker is down
<?php namespace APIBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use FOS\RestBundle\Controller\Annotations as Rest; use Nelmio\ApiDocBundle\Ann...
<?php namespace APIBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use FOS\RestBundle\Controller\Annotations as Rest; use Nelmio\ApiDocBundle\Ann...
Set default values for command and args
import json from collections import OrderedDict from .command import ShellCommand from .settings import FormatterSettings class Formatter(): def __init__(self, name, command='', args='', formatter=None): self.__name = name self.__settings = FormatterSettings(name.lower()) if formatter: ...
import json from collections import OrderedDict from .command import ShellCommand from .settings import FormatterSettings class Formatter(): def __init__(self, name, command=None, args=None, formatter=None): self.__name = name self.__format = formatter self.__settings = FormatterSettings(n...
Rename folers, convert to lowercase
/*Config*/ var concat = require( 'gulp-concat' ); var gulp = require( 'gulp' ); var rename = require( 'gulp-rename' ); var runSequence = require( 'run-sequence' ); var sourceMaps = require( 'gulp-sourcemaps' ); /*SASS/CSS*/ var autoPrefixer = require( 'gulp-autoprefixer' ); var cssMin = require( 'gulp-cssnano' ); var s...
/*Config*/ var concat = require( 'gulp-concat' ); var gulp = require( 'gulp' ); var rename = require( 'gulp-rename' ); var runSequence = require( 'run-sequence' ); var sourceMaps = require( 'gulp-sourcemaps' ); /*SASS/CSS*/ var autoPrefixer = require( 'gulp-autoprefixer' ); var cssMin = require( 'gulp-cssnano' ); var s...
Fix help text and debug.
<?php namespace FireflyIII\Http\Controllers; use FireflyIII\Helpers\Help\HelpInterface; use Log; use Preferences; use Response; /** * Class HelpController * * @package FireflyIII\Http\Controllers */ class HelpController extends Controller { /** * HelpController constructor. */ public function __...
<?php namespace FireflyIII\Http\Controllers; use FireflyIII\Helpers\Help\HelpInterface; use Log; use Preferences; use Response; /** * Class HelpController * * @package FireflyIII\Http\Controllers */ class HelpController extends Controller { /** * HelpController constructor. */ public function __...
Use app.extensions to get perm reference.
# -*- coding: utf-8 -*- from flask import Blueprint, render_template, current_app, url_for, redirect, request, flash bp = Blueprint('perm-admin', __name__, template_folder='templates', static_folder='static') @bp.route('/') def index(): if not current_app.extensions['perm'].has_perm_admin_logined(): retu...
# -*- coding: utf-8 -*- from flask import Blueprint, render_template, current_app, url_for, redirect, request, flash bp = Blueprint('perm-admin', __name__, template_folder='templates', static_folder='static') @bp.route('/') def index(): if not bp.perm.has_perm_admin_logined(): return redirect(url_for('pe...
Fix planning page on Safari new Date("…") cannot parse ISO8601 with a timezone on certain non-fully ES5 compliant browsers
App.Views.PlanningView = Backbone.View.extend({ className: 'planning', initialize: function() { this.lessons = this.collection; this.lessons.on('add change remove reset', this.render, this); }, render: function() { var lessons = this.lessons.toArray(); // Build day vie...
App.Views.PlanningView = Backbone.View.extend({ className: 'planning', initialize: function() { this.lessons = this.collection; this.lessons.on('add change remove reset', this.render, this); }, render: function() { var lessons = this.lessons.toArray(); // Build day vie...
Add deferVisibleCompile option (default: false) This defers compilation of visible elements too. Will be useful for incrementally showing long lists.
(function () { 'use strict'; angular.module('ngDeferredShow', []) .directive('ngDeferredShow', function ($parse, $timeout, $animate) { var timeoutBatches = {}; return { restrict: 'A', transclude: 'element', multiElement: true, ...
(function () { 'use strict'; angular.module('ngDeferredShow', []) .directive('ngDeferredShow', function ($parse, $timeout, $animate) { var timeoutBatches = {}; return { restrict: 'A', transclude: 'element', multiElement: true, ...
Add a note about caching
# Copyright (c) 2015 Ansible, Inc.. # All Rights Reserved. import json from django.conf import settings as django_settings from awx.main.models.configuration import TowerSettings class TowerConfiguration(object): # TODO: Caching so we don't have to hit the database every time for settings def __getattr__(sel...
# Copyright (c) 2015 Ansible, Inc.. # All Rights Reserved. import json from django.conf import settings as django_settings from awx.main.models.configuration import TowerSettings class TowerConfiguration(object): def __getattr__(self, key): ts = TowerSettings.objects.filter(key=key) if not ts.exi...
Move error catch outside of the returned promise
import Promise from 'bluebird'; import {EventEmitter} from 'events'; import lodash from 'lodash'; export class Store extends EventEmitter { constructor(dispatcher) { super(); this.dispatcher = dispatcher; this._callbackId = dispatcher.register(dispatchHandler.bind(this)); this._tri...
import Promise from 'bluebird'; import {EventEmitter} from 'events'; import lodash from 'lodash'; export class Store extends EventEmitter { constructor(dispatcher) { super(); this.dispatcher = dispatcher; this._callbackId = dispatcher.register(dispatchHandler.bind(this)); this._tri...
Message.Note: Fix isNote prop for rendering This resolve the React warning for `isNote` rendering for `Message.Action`.
// @flow import React from 'react' import Text from '../Text' import ChatBlock from './ChatBlock' import classNames from '../../utilities/classNames' import { providerContextTypes } from './propTypes' import type { MessageChat, MessageThemeContext } from './types' type Props = MessageChat & { className?: string, i...
// @flow import React from 'react' import Text from '../Text' import ChatBlock from './ChatBlock' import classNames from '../../utilities/classNames' import { providerContextTypes } from './propTypes' import type { MessageChat, MessageThemeContext } from './types' type Props = MessageChat & { className?: string, i...
BUG: Fix a failing test due to refactor
""" Testing the MlabSceneModel """ import unittest import numpy as np from enthought.traits.api import HasTraits, Instance from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel from enthought.mayavi import mlab from test_mlab_integration import TestMlabNullEngine #######################################...
""" Testing the MlabSceneModel """ import unittest from enthought.traits.api import HasTraits, Instance from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel from enthought.mayavi import mlab from test_mlab_integration import TestMlabNullEngine ###########################################################...
Fix ThreadListItem prop type checking
var ChatThreadActionCreators = require('../actions/ChatThreadActionCreators'); var React = require('react'); var cx = require('react/lib/cx'); var TimeAgo = require('./TimeAgo.react'); var Avatar = require('./Avatar.react'); var Status = require('./Status.react'); var ChatMessageUtils = require('../utils/ChatMessageUti...
var ChatThreadActionCreators = require('../actions/ChatThreadActionCreators'); var React = require('react'); var cx = require('react/lib/cx'); var TimeAgo = require('./TimeAgo.react'); var Avatar = require('./Avatar.react'); var Status = require('./Status.react'); var ChatMessageUtils = require('../utils/ChatMessageUti...
Test case to verify creation of api documentation web page
///////////////////// // gulp-node-slate // ///////////////////// // Run: // $ cd gulp-node-slate // $ npm update // $ npm run mocha var assert = require('assert'); var es = require('event-stream'); var fs = require('fs'); var File = require('vinyl'); var gulpNodeSlate = requi...
///////////////////// // gulp-node-slate // ///////////////////// // Run: // $ cd gulp-node-slate // $ npm update // $ npm run mocha var assert = require('assert'); var es = require('event-stream'); var File = require('vinyl'); var gulpNodeSlate = require('../index.js'); ///////////////...
Bump version: 0.0.20 -> 0.0.21 [ci skip]
# /setup.py # # Installation and setup script for parse-shebang # # See /LICENCE.md for Copyright information """Installation and setup script for parse-shebang.""" from setuptools import find_packages, setup setup(name="parse-shebang", version="0.0.21", description="""Parse shebangs and return their comp...
# /setup.py # # Installation and setup script for parse-shebang # # See /LICENCE.md for Copyright information """Installation and setup script for parse-shebang.""" from setuptools import find_packages, setup setup(name="parse-shebang", version="0.0.20", description="""Parse shebangs and return their comp...
Add old browser compat routine for loading pictures
import Loader from 'src/modules/lazy-loader'; let observer; let galleryContainer; const loader = new Loader({ url: '/api/gallery', page: 2, limit: 1, }); function lastPost() { const posts = document.querySelectorAll('.gallery-post'); return posts[posts.length - 1]; } function observeLastPost() { if (!ob...
import axios from 'axios'; function Loader(options = {}) { this.page = options.page || 0; this.limit = options.limit || 1; this.url = options.url || ''; this.nextPage = () => { this.page += 1; return axios.get(this.url, { params: { page: this.page, limit: this.limit, }, ...
Use the updated pymongo syntax for mongo snapshot cursor
#!/usr/bin/env python import datetime import logging import api def get_now_str(): format = '%d.%h-%H:%M:%S' now = datetime.datetime.now() now_str = datetime.datetime.strftime(now, format) return now_str if __name__ == '__main__': collections = api.SEARCHABLE_COLLECTIONS api.logger.setLeve...
#!/usr/bin/env python import datetime import logging import api def get_now_str(): format = '%d.%h-%H:%M:%S' now = datetime.datetime.now() now_str = datetime.datetime.strftime(now, format) return now_str if __name__ == '__main__': collections = api.SEARCHABLE_COLLECTIONS api.logger.setLeve...
Watch files, but consider example working on plunkr
const browserSync = require('browser-sync'); const path = require('path'); const url = require('url'); const server = browserSync.create(); server.init({ port: 3000, files: [ '**/*.js', '**/*.html', '**/*.css' ], server: { baseDir: __dirname, routes: { "/node_modules...
const browserSync = require('browser-sync'); const path = require('path'); const url = require('url'); const server = browserSync.create(); server.init({ port: 3000, server: { baseDir: __dirname, routes: { "/node_modules": "node_modules", "/src": "src" } }, ...
Make is so we run performance against merged patches
import ConfigParser import json import time from pygerrit import client from pygerrit import events class Listener(object): def __init__(self, gerrit_user): self.gerrit_user = gerrit_user def start_listening(self): self.gerrit = client.GerritClient( host='review.openstack.org', ...
import ConfigParser import json import time from pygerrit import client from pygerrit import events class Listener(object): def __init__(self, gerrit_user): self.gerrit_user = gerrit_user def start_listening(self): self.gerrit = client.GerritClient( host='review.openstack.org', ...
Use in, because has_key seems to be deprecated Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
import unittest from parameterized import parameterized from som.vm.universe import Universe class SomTest(unittest.TestCase): @parameterized.expand([ ("ClassStructure",), ("Array" ,), ("Block" ,), ("ClassLoading" ,), ("Closure" ,), ("Coercio...
import unittest from parameterized import parameterized from som.vm.universe import Universe class SomTest(unittest.TestCase): @parameterized.expand([ ("ClassStructure",), ("Array" ,), ("Block" ,), ("ClassLoading" ,), ("Closure" ,), ("Coercio...
Make cleverbot module behave like a typing human
/** * Created by Julian/Wolke on 27.11.2016. */ let Manager = require('../../structures/manager'); let Cleverbot = require('cleverbot'); let re = /<@[0-9].*>/g; let cleverbotKey = remConfig.cleverbot_api_key; class CleverBotManager extends Manager { constructor() { super(); this.cleverbot = new ...
/** * Created by Julian/Wolke on 27.11.2016. */ let Manager = require('../../structures/manager'); let Cleverbot = require('cleverbot'); let re = /<@[0-9].*>/g; let cleverbotKey = remConfig.cleverbot_api_key; class CleverBotManager extends Manager { constructor() { super(); this.cleverbot = new ...
Mark ObjC testcase as skipUnlessDarwin and fix a typo in test function. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@326640 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit cb9b1a2163f960e34721f74bad30622fda71e43b)
"""Test that the clang modules cache directory can be controlled.""" from __future__ import print_function import unittest2 import os import time import platform import shutil import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ObjCMo...
"""Test that the clang modules cache directory can be controlled.""" from __future__ import print_function import unittest2 import os import time import platform import shutil import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ObjCMo...
Include migrations in package and bump version to v0.3
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name="django-trello-webhooks", version="0.3", packages=[ ...
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name="django-trello-webhooks", version="0.2", packages=[ ...
Fix minor merge conflic in whitespace
'use strict'; import React, { Component } from 'react'; import Swiper from 'react-native-swiper'; import { Text, View, StyleSheet, Image, } from 'react-native'; class DetailImages extends Component { render(){ return ( <Swiper style={styles.wrapper} height={360} showsButtons={true}> ...
'use strict'; import React, { Component } from 'react'; import Swiper from 'react-native-swiper'; import { Text, View, StyleSheet, Image, } from 'react-native'; class DetailImages extends Component { render(){ return ( <Swiper style={styles.wrapper} height={360} showsButtons={true}> ...
Use BulkText instead of Text in input keyword Fixes #164
from TestStack.White.UIItems import TextBox from WhiteLibrary.keywords.librarycomponent import LibraryComponent from WhiteLibrary.keywords.robotlibcore import keyword class TextBoxKeywords(LibraryComponent): @keyword def input_text_to_textbox(self, locator, input_value): """Writes text to a textbox. ...
from TestStack.White.UIItems import TextBox from WhiteLibrary.keywords.librarycomponent import LibraryComponent from WhiteLibrary.keywords.robotlibcore import keyword class TextBoxKeywords(LibraryComponent): @keyword def input_text_to_textbox(self, locator, input_value): """Writes text to a textbox. ...
Setup: Define content type Markdown for description.
from setuptools import setup, find_packages from foliant import __version__ as foliant_version SHORT_DESCRIPTION = 'Modular, Markdown-based documentation generator that makes \ pdf, docx, html, and more.' try: with open('README.md', encoding='utf8') as readme: LONG_DESCRIPTION = readme.read() except Fi...
from setuptools import setup, find_packages from foliant import __version__ as foliant_version SHORT_DESCRIPTION = 'Modular, Markdown-based documentation generator that makes \ pdf, docx, html, and more.' try: with open('README.md', encoding='utf8') as readme: LONG_DESCRIPTION = readme.read() except Fi...
Add field `confirm_password` and `remember_me` to form
<?php namespace User\Form; use Zend\Form\Form; class UserForm extends Form { public function __construct($name = null) { parent::__construct('user'); $this->setAttribute('method', 'post'); $this->add(array( 'name' => 'id', 'type' => 'Hidden', )); ...
<?php namespace User\Form; use Zend\Form\Form; class UserForm extends Form { public function __construct($name = null) { parent::__construct('user'); $this->setAttribute('method', 'post'); $this->add(array( 'name' => 'id', 'type' => 'Hidden', )); ...
Fix invalid path for Bootstrap js file
var elixir = require('laravel-elixir'); elixir(function(mix) { mix.copy( 'node_modules/bootstrap/dist/fonts', 'public/build/fonts' ); mix.copy( 'node_modules/font-awesome/fonts', 'public/build/fonts' ); mix.copy( 'node_modules/ionicons/dist/fonts', ...
var elixir = require('laravel-elixir'); elixir(function(mix) { mix.copy( 'node_modules/bootstrap/dist/fonts', 'public/build/fonts' ); mix.copy( 'node_modules/font-awesome/fonts', 'public/build/fonts' ); mix.copy( 'node_modules/ionicons/dist/fonts', ...
Use version 1.2 of TLS
var cp = require('child_process'), ps = require('ps-node'), Q = require('q'), debug = require('debug')('cheapseats'), phantomPath = require('phantomjs').path; var webdriverProcess; var driver = { init: function (browser, config) { return browser.init() .setWindowSize(config.browserWidth, ...
var cp = require('child_process'), ps = require('ps-node'), Q = require('q'), debug = require('debug')('cheapseats'), phantomPath = require('phantomjs').path; var webdriverProcess; var driver = { init: function (browser, config) { return browser.init() .setWindowSize(config.browserWidth, ...
Use ::class keyword to get class names
<?php namespace AuthorBooks\Model; use Maghead\Schema\DeclareSchema; class AuthorSchema extends DeclareSchema { public function schema() { $this->column('name') ->varchar(128) ->findable() ; $this->column('email') ->required() ->find...
<?php namespace AuthorBooks\Model; use Maghead\Schema\DeclareSchema; class AuthorSchema extends DeclareSchema { public function schema() { $this->column('name') ->varchar(128) ->findable() ; $this->column('email') ->required() ->find...
Fix Laravel Scheduled Task monitoring
<?php /* * This file is part of the Blackfire SDK package. * * (c) Blackfire <support@blackfire.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Blackfire\Bridge\Laravel; use Illuminate\Console\Events\CommandFinishe...
<?php /* * This file is part of the Blackfire SDK package. * * (c) Blackfire <support@blackfire.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Blackfire\Bridge\Laravel; use Illuminate\Console\Events\CommandFinishe...
Check if Buzz library is installed.
<?php namespace Geocoder\Tests\HttpAdapter; use Geocoder\Tests\TestCase; use Geocoder\HttpAdapter\BuzzHttpAdapter; /** * @author William Durand <william.durand1@gmail.com> */ class BuzzHttpAdapterTest extends TestCase { protected function setUp() { if (!class_exists('Buzz\Browser')) { ...
<?php namespace Geocoder\Tests\HttpAdapter; use Geocoder\Tests\TestCase; use Geocoder\HttpAdapter\BuzzHttpAdapter; /** * @author William Durand <william.durand1@gmail.com> */ class BuzzHttpAdapterTest extends TestCase { public function testGetNullContent() { $buzz = new BuzzHttpAdapter(); ...
fix: Change reducers to return a new state The changes in the comment reducer were not committed befire
import { ADD_VOTE_COMMENT, CREATE_COMMENT, REMOVE_COMMENT, REMOVE_VOTE_COMMENT, SET_COMMENTS, UPDATE_COMMENT } from "../actions/Comment"; import {REMOVE_POST} from "../actions/Post"; const initialStateComments = { comments:[] }; export default function comment(state = initialStateComments...
import { ADD_VOTE_COMMENT, CREATE_COMMENT, REMOVE_COMMENT, REMOVE_VOTE_COMMENT, SET_COMMENTS, UPDATE_COMMENT } from "../actions/Comment"; import {REMOVE_POST} from "../actions/Post"; const initialStateComments = { comments:[] }; export default function comment(state = initialStateComments...
Add method to delete a category.
package com.github.cstroe.spendhawk.entity; import com.github.cstroe.spendhawk.util.HibernateUtil; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import java.util.List; /** * The category for an expense. Categories are at the user level, so that * many accounts can use the same...
package com.github.cstroe.spendhawk.entity; import com.github.cstroe.spendhawk.util.HibernateUtil; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import java.util.List; /** * The category for an expense. Categories are at the user level, so that * many accounts can use the same...
Remove es2015 from karma presets
const path = require('path') module.exports = function(config) { config.set({ files: [ // all files ending in 'test' 'test/e2e/*.spec.js' // each file acts as entry point for the webpack configuration ], // frameworks to use frameworks: ['mocha'], preprocessors: { // on...
const path = require('path') module.exports = function(config) { config.set({ files: [ // all files ending in 'test' 'test/e2e/*.spec.js' // each file acts as entry point for the webpack configuration ], // frameworks to use frameworks: ['mocha'], preprocessors: { // on...
Use one of the stock examples for the open/save test
#!/usr/bin/env python import os import unittest from xml.etree import ElementTree from openfilerooms import openFileRooms from savefilerooms import saveFileRooms class Test(unittest.TestCase): test_output = "a.rooms" def test1(self): fpath = os.path.abspath(__file__) path, _ = os.path.split(...
#!/usr/bin/env python import unittest from xml.etree import ElementTree from openfilerooms import openFileRooms from savefilerooms import saveFileRooms class Test(unittest.TestCase): def test1(self): source = "world1.rooms" dest = 'a.rooms' openFileRooms(source) saveFileRooms(des...
Use String as lock key
package com.yahoo.concurrent.classlock; import java.util.HashMap; import java.util.Map; import java.util.function.BooleanSupplier; /** * @author valerijf */ public class ClassLocking { private final Map<String, ClassLock> classLocks = new HashMap<>(); private final Object monitor = new Object(); public...
package com.yahoo.concurrent.classlock; import java.util.HashMap; import java.util.Map; import java.util.function.BooleanSupplier; /** * @author valerijf */ public class ClassLocking { private final Map<Class<?>, ClassLock> classLocks = new HashMap<>(); private final Object monitor = new Object(); publ...
Use ijson to parse the test262 results. Parsing the output all at once can cause out-of-memory errors in automated testing.
#!/usr/bin/env python3 import ijson import sys PREFIXES = [ ["FAIL", "PASS"], ["EXPECTED FAIL", "UNEXPECTED PASS"], ] def parse_expected_failures(): expected_failures = set() with open("expected-failures.txt", "r") as fp: for line in fp: line = line.strip() if not lin...
#!/usr/bin/env python3 import json import sys PREFIXES = [ ["FAIL", "PASS"], ["EXPECTED FAIL", "UNEXPECTED PASS"], ] def parse_expected_failures(): expected_failures = set() with open("expected-failures.txt", "r") as fp: for line in fp: line = line.strip() if not line...
Return json from all schema controller paths
<?php namespace App\Http\Controllers; use App\Repositories\SchemaRepository; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class SchemaController extends Controller { /** * @var Schem...
<?php namespace App\Http\Controllers; use App\Repositories\SchemaRepository; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class SchemaController extends Controller { /** * @var Schem...
Fix pad_tx off by one error + nits Summary: See title Test Plan: test_runner.py Reviewers: deadalnix, schancel, #bitcoin_abc Reviewed By: schancel, #bitcoin_abc Subscribers: teamcity Differential Revision: https://reviews.bitcoinabc.org/D2096
from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT from .mininode import CTransaction, FromHex, ToHex, CTxOut from .script import OP_RETURN, CScript import random from binascii import hexlify, unhexlify # Pad outputs until it reaches at least min_size def pad_tx(tx, min_size=None): if min_size is None: ...
from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT from .mininode import CTransaction, FromHex, ToHex, CTxOut from .script import OP_RETURN, CScript import random from binascii import hexlify, unhexlify # Pad outputs until it reaches at least min_size def pad_tx(tx, min_size=None): if min_size is None: ...
Use Date type for history on server side
module.exports = { user: { type: 'document', schema: { attributes: { name: String } }, user: true }, project: { type: 'document', schema: { attributes: { name: String, description:...
module.exports = { user: { type: 'document', schema: { attributes: { name: String } }, user: true }, project: { type: 'document', schema: { attributes: { name: String, description:...
Use class constants instead of strings
<?php namespace SumoCoders\FrameworkMultiUserBundle\Form; use SumoCoders\FrameworkMultiUserBundle\DataTransferObject\RequestPasswordDataTransferObject; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfo...
<?php namespace SumoCoders\FrameworkMultiUserBundle\Form; use SumoCoders\FrameworkMultiUserBundle\DataTransferObject\RequestPasswordDataTransferObject; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class Reque...
Fix big preventing some JS from executing
<?php if (!$_SKIP_HEADER) {?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width...
<?php if (!$_SKIP_HEADER) {?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width...
Remove deprecated class name props to Dropzone component
import React from "react"; import Dropzone from "react-dropzone"; import classNames from "classnames"; import "./DropHandler.css"; export default class DropHandler extends React.Component { handleDrop = (files) => { this.props.importSequenceFromFile(files[0]); }; render() { const { children, style, class...
import React from "react"; import Dropzone from "react-dropzone"; import classNames from "classnames"; import "./DropHandler.css"; export default class DropHandler extends React.Component { handleDrop = (files) => { this.props.importSequenceFromFile(files[0]); }; render() { const { children, style, class...
Use SecureTemporaryFile for Source Interface requests
from io import BytesIO from flask import wrappers from secure_tempfile import SecureTemporaryFile class RequestThatSecuresFileUploads(wrappers.Request): def _secure_file_stream(self, total_content_length, content_type, filename=None, content_length=None): """Storage class for...
from flask import wrappers from tempfile import NamedTemporaryFile from io import BytesIO class RequestThatSecuresFileUploads(wrappers.Request): def _secure_file_stream(self, total_content_length, content_type, filename=None, content_length=None): if total_content_length > 1024 * 5...
Remove obsolete import of handleRequest function. git-svn-id: fac99be8204c57f0935f741ea919b5bf0077cdf6@9490 688a9155-6ab5-4160-a077-9df41f55a9e9
import('helma.webapp', 'webapp'); import('model'); // the main action is invoked for http://localhost:8080/ // this also shows simple skin rendering function index_action(req, res) { if (req.params.save) { createBook(req, res); } if (req.params.remove) { removeBook(req, res); } var ...
import('helma.webapp', 'webapp'); import('model'); var handleRequest = webapp.handleRequest; // the main action is invoked for http://localhost:8080/ // this also shows simple skin rendering function index_action(req, res) { if (req.params.save) { createBook(req, res); } if (req.params.remove) { ...
Fix broken code, comment out sun.awt.X11.XLayerProtocol git-svn-id: 67bc77c75b8364e4e9cdff0eb6560f5818674cd8@2216 ca793f91-a31e-0410-b540-2769d408b6a1
package dr.inference.model; import dr.xml.*; //import sun.awt.X11.XLayerProtocol; /** * @author Joseph Heled * Date: 4/09/2009 */ public class ValuesPoolParser extends dr.xml.AbstractXMLObjectParser { public static String VALUES_POOL = "valuesPool"; public static String VALUES = "values"; publ...
package dr.inference.model; import dr.xml.*; import sun.awt.X11.XLayerProtocol; /** * @author Joseph Heled * Date: 4/09/2009 */ public class ValuesPoolParser extends dr.xml.AbstractXMLObjectParser { public static String VALUES_POOL = "valuesPool"; public static String VALUES = "values"; public...
Disable log component on test environment
<?php return [ 'request' => [ 'class' => \blink\http\Request::class, 'middleware' => [], ], 'response' => [ 'class' => \blink\http\Response::class, 'middleware' => [ \rethink\hrouter\restapi\middleware\ResponseFormatter::class, ], ], 'session' => [...
<?php return [ 'request' => [ 'class' => \blink\http\Request::class, 'middleware' => [], ], 'response' => [ 'class' => \blink\http\Response::class, 'middleware' => [ \rethink\hrouter\restapi\middleware\ResponseFormatter::class, ], ], 'session' => [...
Update 4chan plugin for 1.7.9 compatibility
<?php class Af_4chan extends Plugin { function about() { return array(0.1, "Fetch full size image from 4chan /b/ feed", "Markus Wiik"); } function init($host) { $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { $owner_uid = $art...
<?php class Af_4chan extends Plugin { function about() { return array(0.1, "Fetch full size image from 4chan /b/ feed", "Markus Wiik"); } function init($host) { $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { $owner_uid = $art...
Change initialization method from cssParser() to init() Change selectorFound event type to cssRuleFound
/*! * cssParser Wef plugin * Copyright (c) 2011 Pablo Escalada * MIT Licensed */ //requires: wef.events, console, cssParser //exports: cssParser /** * The cssParser plugin */ (function () { //TODO: CssParserAdapter var cssParser = { name:"cssParser", version:"0.0.1", description:...
/*! * cssParser Wef plugin * Copyright (c) 2011 Pablo Escalada * MIT Licensed */ //requires: wef.events, console, cssParser //exports: cssParser //events: onSelector, onProperty /** * The cssParser plugin */ (function () { var cssParser = { name:"cssParser", version:"0.0.1", descript...
Clean up strings to use format and add better comments
''' Manage the state of the hosts file ''' def present(name, ip): ''' Ensures that the named host is present with the given ip ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} if __salt__['hosts.has_pair'](ip, name): ret['result'] = Tr...
''' Manage the state of the hosts file ''' def present(name, ip): ''' Ensures that the named host is present with the given ip ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} if __salt__['hosts.has_pair'](ip, name): ret['result'] = Tr...