text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Use sed inline (unsure why mv was used originally).
# pyinfra # File: pyinfra/modules/util/files.py # Desc: common functions for handling the filesystem from types import NoneType def ensure_mode_int(mode): # Already an int (/None)? if isinstance(mode, (int, NoneType)): return mode try: # Try making an int ('700' -> 700) return in...
# pyinfra # File: pyinfra/modules/util/files.py # Desc: common functions for handling the filesystem from types import NoneType def ensure_mode_int(mode): # Already an int (/None)? if isinstance(mode, (int, NoneType)): return mode try: # Try making an int ('700' -> 700) return in...
Disable raise php limits from \CSSmin Unit tests can not be achieved due to max_execution_time set by default to 60 seconds from class \CSSmin.
<?php namespace AssetsBundle\AssetFile\AssetFileFilter; class CssAssetFileFilter extends \AssetsBundle\AssetFile\AssetFileFilter\AbstractAssetFileFilter { /** * @var string */ protected $assetFileFilterName = \AssetsBundle\AssetFile\AssetFile::ASSET_CSS; /** * @var \CSSmin */ pro...
<?php namespace AssetsBundle\AssetFile\AssetFileFilter; class CssAssetFileFilter extends \AssetsBundle\AssetFile\AssetFileFilter\AbstractAssetFileFilter { /** * @var string */ protected $assetFileFilterName = \AssetsBundle\AssetFile\AssetFile::ASSET_CSS; /** * @var \CSSmin */ pro...
Create model name dynamically in Local authenticator
'use strict'; /** * Module dependencies. */ import { UNAUTHORIZED } from 'http-codes'; import capitalize from 'capitalize'; import models from './models'; module.exports = function({ CorePOSTAuthenticator }) { return class LocalAuthenticator extends CorePOSTAuthenticator { hubToAuthenticator() { const ...
'use strict'; /** * Module dependencies. */ import { UNAUTHORIZED } from 'http-codes'; import models from './models'; module.exports = function({ CorePOSTAuthenticator }) { return class LocalAuthenticator extends CorePOSTAuthenticator { hubToAuthenticator() { const debug = this.debug; const depen...
Update unittest to be complient with a newer version of pytest
import os import sys import tempfile CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPTS_DIR = os.path.join(CURRENT_DIR, '..', 'scripts') sys.path.append(SCRIPTS_DIR) SAMPLE_DIR = os.path.join(CURRENT_DIR, 'sample') from compute_abundance import abundance_calculation import pytest @pytest.mark.paramet...
import os import sys import tempfile CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPTS_DIR = os.path.join(CURRENT_DIR, '..', 'scripts') sys.path.append(SCRIPTS_DIR) SAMPLE_DIR = os.path.join(CURRENT_DIR, 'sample') from compute_abundance import abundance_calculation import pytest @pytest.mark.paramet...
Add process_id into the $state.go statements. Have chooseExistingProcess make a REST call to get the list of processes.
(function (module) { module.controller('ProjectHomeController', ProjectHomeController); ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state", "Restangular"]; function ProjectHomeController(project, mcmodal, templates, $state, Restangular) { var ctrl = this; ctrl.pro...
(function (module) { module.controller('ProjectHomeController', ProjectHomeController); ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state"]; function ProjectHomeController(project, mcmodal, templates, $state) { var ctrl = this; ctrl.project = project; ctrl...
Fix can't build entry point by incorrect build setting
const webpack = require("webpack"); const path = require("path"); const sourceDir = path.join(__dirname, "src"); const distDir = path.join(__dirname, "dist"); module.exports = { target: "electron", context: sourceDir, entry: { index: "./index.ts", }, output: { filename: "[name].js"...
const webpack = require("webpack"); const path = require("path"); const sourceDir = path.join(__dirname, "src"); const distDir = path.join(__dirname, "dist"); module.exports = { target: "electron", context: sourceDir, entry: "./index.ts", output: { filename: "[name].js", path: distDir,...
Debug should be for socket.io instead of primus
'use strict'; var socketio = require('socket.io'); var Proto = require('uberproto'); var debug = require('debug')('feathers:socket.io'); var commons = require('feathers-commons').socket; module.exports = function (config) { return function () { var app = this; app.enable('feathers socketio'); // Monke...
'use strict'; var socketio = require('socket.io'); var Proto = require('uberproto'); var debug = require('debug')('feathers:primus'); var commons = require('feathers-commons').socket; module.exports = function (config) { return function () { var app = this; app.enable('feathers socketio'); // Monkey p...
Add news footer to media tile
(function(env) { "use strict"; env.ddg_spice_dogo_news = function(api_result) { if (!api_result || !api_result.results || !api_result.results.length) { return Spice.failed('dogo_news'); } // Get original query. var script = $('[src*="/js/spice/dogo_news/"]')[0], ...
(function(env) { "use strict"; env.ddg_spice_dogo_news = function(api_result) { if (!api_result || !api_result.results || !api_result.results.length) { return Spice.failed('dogo_news'); } // Get original query. var script = $('[src*="/js/spice/dogo_news/"]')[0], ...
Test of index action working
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Song; class SongController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $songs=Song::all(); var_dump($songs[0]...
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class SongController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // } /** * Show the form for creating a new re...
Fix array addressing in nowplaying API again. :P
<?php use \Entity\Station; use \Entity\Song; use \Entity\Schedule; class Api_NowplayingController extends \PVL\Controller\Action\Api { public function indexAction() { $file_path_api = DF_INCLUDE_STATIC.'/api/nowplaying_api.json'; $np_raw = file_get_contents($file_path_api); ...
<?php use \Entity\Station; use \Entity\Song; use \Entity\Schedule; class Api_NowplayingController extends \PVL\Controller\Action\Api { public function indexAction() { $file_path_api = DF_INCLUDE_STATIC.'/api/nowplaying_api.json'; $np_raw = file_get_contents($file_path_api); ...
Remove buffer block on web
const path = require("path"); const { DefinePlugin } = require("webpack"); const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); const SOURCE = path.resolve(__dirname, "./source"); const WEB_ENTRY = path.join(SOURCE, "web/index.js"); const DIST = path.resolve(__dirname, "./dist"); const plugins = [ ...
const path = require("path"); const { DefinePlugin } = require("webpack"); const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); const SOURCE = path.resolve(__dirname, "./source"); const WEB_ENTRY = path.join(SOURCE, "web/index.js"); const DIST = path.resolve(__dirname, "./dist"); const plugins = [ ...
Migrate extensions in upgrade script
<?php namespace Flarum\Console; use Illuminate\Contracts\Container\Container; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Output\OutputInterface; class UpgradeCommand extends Comma...
<?php namespace Flarum\Console; use Illuminate\Contracts\Container\Container; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Output\OutputInterface; class UpgradeCommand extends Comma...
Send button state for toggle buttons.
/* * Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute * * 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.o...
/* * Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute * * 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.o...
Sort returned images by date, taking into account overrides
import datetime from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import GalleryPlugin class ImagesiftPlugin(CMSPluginBase): model = GalleryPlugin name = _('Imagesift Plugin') render_template = "imagesif...
import datetime from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import GalleryPlugin class ImagesiftPlugin(CMSPluginBase): model = GalleryPlugin name = _('Imagesift Plugin') render_template = "imagesif...
Fix error on flat trace with cahe test
# -*- coding: utf-8 -*- from openfisca_web_api.handlers import get_flat_trace def test_flat_trace(): tree = { 'name': 'a', 'period': 2019, 'children': [ { 'name': 'b', 'period': 2019, 'children': [], 'parameters':...
# -*- coding: utf-8 -*- from openfisca_web_api.handlers import get_flat_trace def test_flat_trace(): tree = { 'name': 'a', 'period': 2019, 'children': [ { 'name': 'b', 'period': 2019, 'children': [], 'parameters':...
Update ORB to latest version
orb = { init: function () { let language = localStorage.getItem("orb-language"); if (language) { this.translateTo(window[language]); } else { let browser_language = navigator.language.replace('-', '_'); this.translateTo(window[browser_language.toLowerCase()]); } }, tr...
orb = { init: function () { let language = localStorage.getItem("orb-language"); if (language) { this.translateTo(window[language]); } else { let browser_language = navigator.language.replace('-', '_'); this.translateTo(window[browser_language.toLowerCase()]); } }, tr...
Use InaSAFE in the email subject line rather
# noinspection PyUnresolvedReferences from .prod import * # noqa import os print os.environ ALLOWED_HOSTS = ['*'] ADMINS = ( ('Tim Sutton', 'tim@kartoza.com'), ('Ismail Sunni', 'ismail@kartoza.com'), ('Christian Christellis', 'christian@kartoza.com'), ('Akbar Gumbira', 'akbargumbira@gmail.com'),) DA...
# noinspection PyUnresolvedReferences from .prod import * # noqa import os print os.environ ALLOWED_HOSTS = ['*'] ADMINS = ( ('Tim Sutton', 'tim@kartoza.com'), ('Ismail Sunni', 'ismail@kartoza.com'), ('Christian Christellis', 'christian@kartoza.com'), ('Akbar Gumbira', 'akbargumbira@gmail.com'),) DA...
Fix the detection of HTML5 support in the testsuite The detection relied on detecting the test method added when introducing the feature in symfony/dom-crawler. But as of Symfony 4.4, tests are stripped from the dist archives. An additional detection based on a new method added in later Symfony version is now used to ...
<?php namespace Behat\Mink\Tests\Driver; use Behat\Mink\Driver\BrowserKitDriver; use Behat\Mink\Tests\Driver\Util\FixturesKernel; use Symfony\Component\HttpKernel\Client; class BrowserKitConfig extends AbstractConfig { public static function getInstance() { return new self(); } /** * {@...
<?php namespace Behat\Mink\Tests\Driver; use Behat\Mink\Driver\BrowserKitDriver; use Behat\Mink\Tests\Driver\Util\FixturesKernel; use Symfony\Component\HttpKernel\Client; class BrowserKitConfig extends AbstractConfig { public static function getInstance() { return new self(); } /** * {@...
Add 'Z' character for Firefox date parsing.
'use strict'; UheerApp .controller('ListenController', ['$scope', '$stateParams', 'ChannelResource', 'MusicPlayer', 'config', function ($scope, $stateParams, channels, MusicPlayer, config) { $scope.toogleMute = function () { if (!$scope.channel.CurrentId) { ...
'use strict'; UheerApp .controller('ListenController', ['$scope', '$stateParams', 'ChannelResource', 'MusicPlayer', 'config', function ($scope, $stateParams, channels, MusicPlayer, config) { $scope.toogleMute = function () { if (!$scope.channel.CurrentId) { ...
Fix typo in edit form
<?php namespace DlcCategory\Form; use DlcCategory\Form\BaseForm; use DlcCategory\Service\Category as CategoryService; use Zend\Form\FormInterface; class EditCategory extends BaseForm { public function init() { parent::init(); $this->setLabel('Edit category'); } public fun...
<?php namespace DlcCategory\Form; use DlcCategory\Form\BaseForm; use DlcCategory\Service\Category as CategoryService; use Zend\Form\FormInterface; class EditCategory extends BaseForm { public function init() { parent::init(); $this->setLabel('Edit category'); } public fun...
Exclude \ from company name Change-Id: Ife5a34a09f476e196aae6178886109750bcbe934
<?php namespace Directorzone\Service; use Netsensia\Service\NetsensiaService; class CompanyService extends NetsensiaService { public function isCompanyNumberTaken($companyNumber) { $sql = "SELECT companyid " . "FROM company " . "WHERE number = :number"; ...
<?php namespace Directorzone\Service; use Netsensia\Service\NetsensiaService; class CompanyService extends NetsensiaService { public function isCompanyNumberTaken($companyNumber) { $sql = "SELECT companyid " . "FROM company " . "WHERE number = :number"; ...
Speed up DOI extraction with new regexp Previously: running the DOI extraction test suite would take just over 7 seconds; with this new optimisation, it takes under 50 milliseconds. The key is to replace the PHP logic which would incrementally strip trailing punctuation off any matched DOI until it had a valid ending...
<?php namespace Altmetric\Identifiers; class Doi { const REGEXP = <<<'EOT' { 10 # Directory indicator (always 10) \. (?: # ISBN-A 97[89]\. # ISBN (GS1) Bookland prefix \d{2,8} # ISBN registration group element and publisher prefix ...
<?php namespace Altmetric\Identifiers; class Doi { const REGEXP = <<<'EOT' { 10 # Directory indicator (always 10) \. (?: # ISBN-A 97[89]\. # ISBN (GS1) Bookland prefix \d{2,8} # ISBN registration group element and publisher prefix / # Prefix/suffix divider ...
Bump vers for uppercase Beta Code conversion Fixed with PR https://github.com/cltk/cltk/pull/778 by Eleftheria Chatziargyriou ( @Sedictious ).
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
Fix bug on start date for schedule calendar planification
define([], function() { 'use strict'; /** * Save one row * @param {$resource} resource * @returns {Promise} */ var saveRow = function($q, resource) { var deferred = $q.defer(); if (resource._id) { resource.$save(deferred.resolve, d...
define([], function() { 'use strict'; /** * Save one row * @param {$resource} resource * @returns {Promise} */ var saveRow = function($q, resource) { var deferred = $q.defer(); if (resource._id) { resource.$save(deferred.resolve, d...
Handle up button in about screen toolbar
package net.squanchy.about; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import net.squanchy.R; import net.squanchy.fonts.TypefaceStyleableActivity; import net.squanchy.navigation.Navigator; public class AboutActivity ex...
package net.squanchy.about; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.Toolbar; import net.squanchy.R; import net.squanchy.fonts.TypefaceStyleableActivity; import net.squanchy.navigation.Navigator; public class AboutActivity extends TypefaceStyleableActivit...
Add ability to get a single item from the store
import deepAssign from 'deep-assign' import getFilter from 'feathers-query-filters' import { sorter, matcher, select, _ } from 'feathers-commons' export default function makeServiceGetters (service) { const { vuexOptions } = service const idField = vuexOptions.module.idField || vuexOptions.global.idField return...
import deepAssign from 'deep-assign' import getFilter from 'feathers-query-filters' // import { sorter, matcher, select, _ } from 'feathers-commons' import { sorter, matcher, _ } from 'feathers-commons' export default function makeServiceGetters (service) { return { list (state) { return state.ids.map(id =...
Remove button to tag select.
module.exports = Backbone.View.extend({ tagName: 'select', className: 'tag-select form-control', initialize: function (options) { this.$el.selectize({ plugins: ['remove_button'], valueField: 'id', labelField: 'name', searchField: ['slug', 'name'...
module.exports = Backbone.View.extend({ tagName: 'select', className: 'tag-select form-control', initialize: function (options) { this.$el.selectize({ valueField: 'id', labelField: 'name', searchField: ['slug', 'name'], create: false, ...
Remove redundant postgres CloudFoundry fixture
import json import os import pytest from app.cloudfoundry_config import ( extract_cloudfoundry_config, set_config_env_vars, ) @pytest.fixture def cloudfoundry_config(): return { 'postgres': [{ 'credentials': { 'uri': 'postgres uri' } }], 'u...
import json import os import pytest from app.cloudfoundry_config import ( extract_cloudfoundry_config, set_config_env_vars, ) @pytest.fixture def postgres_config(): return [ { 'credentials': { 'uri': 'postgres uri' } } ] @pytest.fixture def c...
Fix FoldersList not refreshing correctly
import React, { Component } from 'react'; import Icon from 'react-fontawesome'; import classnames from 'classnames'; import AppActions from '../../actions/AppActions'; /* |-------------------------------------------------------------------------- | LibraryFolders |----------------------------------------------------...
import React, { PureComponent } from 'react'; import Icon from 'react-fontawesome'; import classnames from 'classnames'; import AppActions from '../../actions/AppActions'; /* |-------------------------------------------------------------------------- | LibraryFolders |------------------------------------------------...
Set release version to 0.3.4
from __future__ import absolute_import import celery from tornado import ioloop from .connection import ConnectionPool from .producer import NonBlockingTaskProducer from .result import AsyncResult VERSION = (0, 3, 4) __version__ = '.'.join(map(str, VERSION)) def setup_nonblocking_producer(celery_app=None, io_loop...
from __future__ import absolute_import import celery from tornado import ioloop from .connection import ConnectionPool from .producer import NonBlockingTaskProducer from .result import AsyncResult VERSION = (0, 4, 0) __version__ = '.'.join(map(str, VERSION)) + '-dev' def setup_nonblocking_producer(celery_app=None...
Remove job references from navigation
from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender class ZivinetzNavigationExtension(NavigationExtension): name = _('Zivinetz navigation extension') def children(self, page, *...
from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender class ZivinetzNavigationExtension(NavigationExtension): name = _('Zivinetz navigation extension') def children(self, page, *...
Change goals passage with service (from message)
#!/usr/bin/env python # coding UTF-8 import yaml import rospy from goal_sender_msgs.srv import ApplyGoals from goal_sender_msgs.msg import GoalSequence from goal_sender_msgs.msg import Waypoint def read_yaml(path): f = open(path, 'r') waypoints = yaml.load(f) f.close() return waypoints def get_waypo...
#!/usr/bin/env python # coding UTF-8 import yaml import rospy from goal_sender_msgs.msg import GoalSequence from goal_sender_msgs.msg import Waypoint def read_yaml(path): f = open(path, 'r') waypoints = yaml.load(f) f.close() return waypoints def pub_data(): pub = rospy.Publisher('goal_sequence'...
Switch browser list when running in Travis
module.exports = function(config) { const files = [ { pattern: 'browser/everything.html', included: false, served: true, }, { pattern: 'browser/everything.js', included: true, served: true, }, { pattern: 'spec/fixtures/*.json', included: false, ...
module.exports = function(config) { const files = [ { pattern: 'browser/everything.html', included: false, served: true, }, { pattern: 'browser/everything.js', included: true, served: true, }, { pattern: 'spec/fixtures/*.json', included: false, ...
Handle error in get diff stats
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from operator import attrgetter from django.core.management.base import BaseCommand import six from corehq.apps.domain_migration_flags.api import get_uncompleted_migrations from ...progress import C...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from operator import attrgetter from django.core.management.base import BaseCommand import six from corehq.apps.domain_migration_flags.api import get_uncompleted_migrations from ...progress import C...
Update the commit_over_52 template tag to be more efficient. Replaced several list comprehensions with in-database operations and map calls for significantly improved performance.
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] comm...
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] comm...
Add '%' in coverage badge
# -*- coding: utf8 -*- import requests from django.contrib.staticfiles import finders from django.core.cache import cache def get_badge(succeeded): key = 'badge{}'.format(succeeded) badge = cache.get(key) if badge is None: if succeeded: path = finders.find('badges/build-success.svg') ...
# -*- coding: utf8 -*- import requests from django.contrib.staticfiles import finders from django.core.cache import cache def get_badge(succeeded): key = 'badge{}'.format(succeeded) badge = cache.get(key) if badge is None: if succeeded: path = finders.find('badges/build-success.svg') ...
Split tests out into commit and acceptance tests
/* global module */ module.exports = function(grunt) { grunt.initConfig({ jshint: { all: [ 'app.js', 'blanket.js', 'gruntfile.js', 'src/**/*.js', 'test/**/*.js' ], options: { bitwise: true, camelcase: true, ...
/* global module */ module.exports = function(grunt) { grunt.initConfig({ jshint: { all: ['app.js', 'blanket.js', 'gruntfile.js', 'src/**/*.js'], options: { bitwise: true, camelcase: true, curly: true, freeze: true, ...
fix(expressions): Whitelist `DayOfWeek` enum for expressions
/* * Copyright 2017 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
/* * Copyright 2017 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
Delete request ids when we're done with them; refactor
import { _ERROR } from 'constants' const pendingIds = {} // requestIDs to timeoutIDs let nextRequestID = 0 export default function createSocketMiddleware (socket, prefix) { return ({ dispatch }) => { // dispatch incoming actions sent by the server socket.on('action', dispatch) return next => action => {...
import { _ERROR } from 'constants' const pendingIds = {} // requestIDs to timeoutIDs let nextRequestID = 0 export default function createSocketMiddleware (socket, prefix) { return ({ dispatch }) => { // dispatch incoming actions sent by the server socket.on('action', dispatch) return next => action => {...
Fix function propagation to child to avoid react bind warning in logs
/** @jsx React.DOM */ var PersonContacts = React.createClass({ getInitialState: function() { return { filterText:"" } }, handleUserInput: function(text) { this.replaceState({ filterText: text }); }, render: function () { var self = t...
/** @jsx React.DOM */ var PersonContacts = React.createClass({ getInitialState: function() { return { filterText:"" } }, handleUserInput: function(text) { this.replaceState({ filterText: text }); }, render: function () { var self = t...
Check for TrackJs already loaded and if yes, reinitialize it. Fixed version.
window._trackJs = { onError: function(payload, error) { function itemExistInList(item, list) { for (var i = 0; i < list.length; i++) { if (item.indexOf(list[i]) > -1) { return true; } } return false; } ...
window._trackJs = { onError: function(payload, error) { function itemExistInList(item, list) { for (var i = 0; i < list.length; i++) { if (item.indexOf(list[i]) > -1) { return true; } } return false; } ...
Fix paths in mail out email management command
from django.conf import settings from django.core.mail import EmailMessage from django.core.management.base import BaseCommand from django.template.loader import render_to_string from django.contrib.sites.models import Site from ...models import WaitingListEntry, Survey class Command(BaseCommand): help = "Emai...
from django.conf import settings from django.core.mail import EmailMessage from django.core.management.base import BaseCommand from django.template.loader import render_to_string from django.contrib.sites.models import Site from ...models import WaitingListEntry, Survey class Command(BaseCommand): help = "Emai...
Use decl.source.input.from as asset from
import eachUrlDecl from './eachUrlDecl' import Result from './result' import mix from 'util-mix' import getp from 'getp' export default function (customTransforms) { return function (root, result) { let postcssOpts = result.opts if (!postcssOpts.from) { return result.warn( 'postcss-custom-url r...
import eachUrlDecl from './eachUrlDecl' import Result from './result' export default function (customTransforms) { return function (root, result) { let postcssOpts = result.opts if (!postcssOpts.from) { return result.warn( 'postcss-custom-url requires postcss "from" option.' ) } ...
Fix entry point for Mako.
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') set...
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') set...
Add assertions for the Http client response
<?php declare(strict_types=1); namespace Tests; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Http; use LaravelZero\Framework\Contracts\Providers\ComposerContract; final class HttpComponentTest extends TestCase { /** @test */ public function it_installs_the_required_packages(): void...
<?php declare(strict_types=1); namespace Tests; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Http; use LaravelZero\Framework\Contracts\Providers\ComposerContract; final class HttpComponentTest extends TestCase { /** @test */ public function it_installs_the_required_packages(): void...
Fix Application providers container contract
<?php namespace Articstudio\IcebergApp\Provider; use Articstudio\IcebergApp\Contract\Container as ContainerContract; use Articstudio\IcebergApp\Support\Collection; use Articstudio\IcebergApp\Exception\Provider\NotFoundException; use Exception; use Throwable; trait ManagerByProveidersTrait { private $providers; ...
<?php namespace Articstudio\IcebergApp\Provider; use Psr\Container\ContainerInterface as ContainerContract; use Articstudio\IcebergApp\Support\Collection; use Articstudio\IcebergApp\Exception\Provider\NotFoundException; use Exception; use Throwable; trait ManagerByProveidersTrait { private $providers; publ...
Bump version for more usefulness.
from setuptools import setup, find_packages version = '0.1.0' setup(name='scoville', version=version, description="A tool for measureing tile latency.", long_description=open('README.md').read(), classifiers=[ # strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers ...
from setuptools import setup, find_packages version = '0.0.1' setup(name='scoville', version=version, description="A tool for measureing tile latency.", long_description=open('README.md').read(), classifiers=[ # strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers ...
Copy the .htaccess to the release directory
module.exports = { main: { files: [ { expand: true, cwd: 'assets/', src: ['**', '.htaccess'], dest: 'out/' } ] }, require: { src: 'vendor/requirejs/require.js', dest: 'out/js/lib/require.js' }, jQuery: { src: 'vendor/jquery/dist/jquery.js', d...
module.exports = { main: { files: [ { expand: true, cwd: 'assets/', src: ['**'], dest: 'out/' } ] }, require: { src: 'vendor/requirejs/require.js', dest: 'out/js/lib/require.js' }, jQuery: { src: 'vendor/jquery/dist/jquery.js', dest: 'out/js/...
Fix watched threads (new not all)
<?php /** @noinspection PhpIncludeInspection */ include_once('SV/UserActivity/UserActivityInjector.php'); /** @noinspection PhpIncludeInspection */ include_once('SV/UserActivity/UserCountActivityInjector.php'); class SV_UserActivity_XenForo_ControllerPublic_Watched extends XFCP_SV_UserActivity_XenForo_ControllerPublic...
<?php /** @noinspection PhpIncludeInspection */ include_once('SV/UserActivity/UserActivityInjector.php'); /** @noinspection PhpIncludeInspection */ include_once('SV/UserActivity/UserCountActivityInjector.php'); class SV_UserActivity_XenForo_ControllerPublic_Watched extends XFCP_SV_UserActivity_XenForo_ControllerPublic...
feature/oop-api-refactoring: Fix placeholders in template string
# -*- coding: utf-8 -*- from sklearn_porter.language.LanguageABC import LanguageABC class Ruby(LanguageABC): KEY = 'ruby' LABEL = 'Ruby' DEPENDENCIES = ['ruby'] TEMP_DIR = 'ruby' SUFFIX = 'rb' CMD_COMPILE = None # ruby estimator.rb <args> CMD_EXECUTE = 'ruby {src_path}' # yapf...
# -*- coding: utf-8 -*- from sklearn_porter.language.LanguageABC import LanguageABC class Ruby(LanguageABC): KEY = 'ruby' LABEL = 'Ruby' DEPENDENCIES = ['ruby'] TEMP_DIR = 'ruby' SUFFIX = 'rb' CMD_COMPILE = None # ruby estimator.rb <args> CMD_EXECUTE = 'ruby {src_path}' # yapf...
Use new API in integration tests.
(function(){ var window = this; // Utility object dom scripting normalization var DOM = { on: (function() { if(window.addEventListener) { return function(target, type, listener) { target.addEventListener(type, listener, false); }; } return function(target, type, li...
(function(){ var window = this; // Utility object dom scripting normalization var DOM = { on: (function() { if(window.addEventListener) { return function(target, type, listener) { target.addEventListener(type, listener, false); }; } return function(target, type, li...
Fix para no permitir insertar jugadores sin nombre
var UI = (function () { var ui, game, html; var clock; function UI(_game) { game = _game; ui = this; this.init(); html = $('.principal-wrapper'); html.on('click', '#add_player_btn', this.addPlayer) .on('keypress', '#player',this.enterOnPlayerInput ) ...
var UI = (function () { var ui, game, html; function UI(_game) { game = _game; ui = this; html = $('.principal-wrapper'); html .on('click', '#add_player_btn', this.addPlayer) .on('keypress', '#player',this.enterOnPlayerInput ) .on('click', '#...
Add Instagram link to footer
<?php /** * Created by PhpStorm. * User: mgrloren * Date: 7/31/15 * Time: 2:55 PM */ ?> <footer> <div class="container"> <div class="row"> <div class="col-sm-6"> <ul class="list-inline"> {{--<li><i class="icon-facebook icon-2x"></i></li>--}} ...
<?php /** * Created by PhpStorm. * User: mgrloren * Date: 7/31/15 * Time: 2:55 PM */ ?> <footer> <div class="container"> <div class="row"> <div class="col-sm-6"> <ul class="list-inline"> {{--<li><i class="icon-facebook icon-2x"></i></li>--}} ...
Allow devDependencies in demos and tests
module.exports = { "env": { "browser": true }, "extends": [ "airbnb", // These prettier configs are used to disable inherited rules that conflict // with the way prettier will format code. Full info here: // https://github.com/prettier/eslint-config-prettier "prettier", "prettier/flowt...
module.exports = { "env": { "browser": true }, "extends": [ "airbnb", // These prettier configs are used to disable inherited rules that conflict // with the way prettier will format code. Full info here: // https://github.com/prettier/eslint-config-prettier "prettier", "prettier/flowt...
Update author and trove details
from setuptools import setup, find_packages setup( name='django-flatblocks', version='0.9', description='django-flatblocks acts like django.contrib.flatpages but ' 'for parts of a page; like an editable help box you want ' 'show alongside the main content.', long_descri...
from setuptools import setup, find_packages setup( name='django-flatblocks', version='0.9', description='django-flatblocks acts like django.contrib.flatpages but ' 'for parts of a page; like an editable help box you want ' 'show alongside the main content.', long_descri...
Change logs for google music
from gmusicapi import Mobileclient def create_playlist(playlist_name, artists, email, password, max_top_tracks=2): api = Mobileclient() logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS) if not logged_in: raise Exception('Could not connect') song_ids = [] for artist_n...
from gmusicapi import Mobileclient def create_playlist(playlist_name, artists, email, password, max_top_tracks=2): api = Mobileclient() logged_in = api.login(email, password, Mobileclient.FROM_MAC_ADDRESS) if not logged_in: raise Exception('Could not connect') song_ids = [] for artist_n...
Add new swing package to exports.
/** * JFreeChart module. */ module org.jfree.chart { requires java.desktop; exports org.jfree.chart; exports org.jfree.chart.annotations; exports org.jfree.chart.axis; exports org.jfree.chart.date; exports org.jfree.chart.editor; exports org.jfree.chart.entity; exports org.jfree.chart...
/** * JFreeChart module. */ module org.jfree.chart { requires java.desktop; exports org.jfree.chart; exports org.jfree.chart.annotations; exports org.jfree.chart.axis; exports org.jfree.chart.date; exports org.jfree.chart.editor; exports org.jfree.chart.entity; exports org.jfree.chart...
Simplify SEBlock by broadcast of binary op instead of explicit broadcast_to. The main motivation of this change is to simplify the exported ONNX, but this would also improve performance.
import chainer import chainer.functions as F import chainer.links as L class SEBlock(chainer.Chain): """A squeeze-and-excitation block. This block is part of squeeze-and-excitation networks. Channel-wise multiplication weights are inferred from and applied to input feature map. Please refer to `the ...
import chainer import chainer.functions as F import chainer.links as L class SEBlock(chainer.Chain): """A squeeze-and-excitation block. This block is part of squeeze-and-excitation networks. Channel-wise multiplication weights are inferred from and applied to input feature map. Please refer to `the ...
Add error handling to guestfs initializer
from abc import ABCMeta, abstractmethod import guestfs from xii import util, error class NeedGuestFS(): __metaclass__ = ABCMeta @abstractmethod def get_tmp_volume_path(self): pass def guest(self): def _start_guestfs(): try: path = self.get_tmp_volume_pat...
from abc import ABCMeta, abstractmethod import guestfs from xii import util class NeedGuestFS(): __metaclass__ = ABCMeta @abstractmethod def get_tmp_volume_path(self): pass def guest(self): def _start_guestfs(): path = self.get_tmp_volume_path() guest = gues...
Add param doc of SAEKVStorage
# -*- coding: utf-8 -*- from . import SessionStorage class SaeKVDBStorage(SessionStorage): """ SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session :: import werobot from werobot.session.saekvstorage import SaeKVDBStorage session_storage = SaeKVDBStorage() robot = werobot.WeRoBot(token=...
# -*- coding: utf-8 -*- from . import SessionStorage class SaeKVDBStorage(SessionStorage): """ SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session :: import werobot from werobot.session.saekvstorage import SaeKVDBStorage session_storage = SaeKVDBStorage() robot = werobot.WeRoBot(token=...
Use Eloquent::getMorphClass() instead of get_class() for Morph Map support.
<?php namespace Trexology\Pointable\Models; use Illuminate\Database\Eloquent\Model; class Transaction extends Model { /** * @var string */ protected $table = 'point_transactions'; /** * @var array */ protected $guarded = ['id', 'created_at', 'updated_at']; /** * @return...
<?php namespace Trexology\Pointable\Models; use Illuminate\Database\Eloquent\Model; class Transaction extends Model { /** * @var string */ protected $table = 'point_transactions'; /** * @var array */ protected $guarded = ['id', 'created_at', 'updated_at']; /** * @return...
Test if <TextInputRow> passing unknown props to its inner <input>
import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { mount } from 'enzyme'; import TextInputRow, { PureTextInputRow, BEM } from '../TextInputRow'; describe('formRow(TextInputRow)', () => { it('renders without crashing', () => { const div = document.createElement('div'); ...
import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { mount } from 'enzyme'; import TextInputRow, { PureTextInputRow, BEM } from '../TextInputRow'; describe('formRow(TextInputRow)', () => { it('renders without crashing', () => { const div = document.createElement('div'); ...
Add comments for timed shoot
try: import wpilib except ImportError: from pyfrc import wpilib from common.autonomous_helper import StatefulAutonomous, timed_state class TimedShootAutonomous(StatefulAutonomous): ''' Tunable autonomous mode that does dumb time-based shooting decisions. Works consistently. '...
try: import wpilib except ImportError: from pyfrc import wpilib from common.autonomous_helper import StatefulAutonomous, timed_state class TimedShootAutonomous(StatefulAutonomous): ''' Tunable autonomous mode that does dumb time-based shooting decisions. Works consistently. '...
Simplify the province list API It only contains province data as a list without the separate ordering information. The order of the province data in the list is the order of provinces.
from django.views.decorators.cache import cache_page from ..models import Province, City from angkot.common.decorators import wapi def _province_to_dict(province): return dict(pid=province.id, name=province.name, code=province.code) def _city_to_dict(city): data = dict(cid=ci...
from django.views.decorators.cache import cache_page from ..models import Province, City from angkot.common.decorators import wapi def _province_to_dict(province): data = dict(pid=province.id, name=province.name, code=province.code) return (province.id, data) def _city_to_dic...
Throw exception when bad rcon
<?php /** * Created by PhpStorm. * User: Bram * Date: 1-9-2017 * Time: 06:59 */ namespace Stormyy\B3\Helper; use q3tool; use Stormyy\B3\Models\B3Server; abstract class Cod4Server { public static function getRcon(B3Server $server){ } public static function screenshotAll(B3Server $server){ ...
<?php /** * Created by PhpStorm. * User: Bram * Date: 1-9-2017 * Time: 06:59 */ namespace Stormyy\B3\Helper; use q3tool; use Stormyy\B3\Models\B3Server; abstract class Cod4Server { public static function getRcon(B3Server $server){ } public static function screenshotAll(B3Server $server){ ...
Handle geojson feature without latlon
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json from scrapy.xlib.pydispatch import dispatcher from scrapy.exceptions import DropItem from scrapy import signals cl...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json from scrapy.xlib.pydispatch import dispatcher from scrapy.exceptions import DropItem from scrapy import signals cl...
Remove unused variable from `about` view
<?php namespace app\controllers; use Yii; use yii\web\Controller; use app\models\ContactForm; class SiteController extends Controller { public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', 'view' => 'error.twig', ]...
<?php namespace app\controllers; use Yii; use yii\web\Controller; use app\models\ContactForm; class SiteController extends Controller { public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', 'view' => 'error.twig', ]...
NXDRIVE-170: Remove long timeout to make file blacklisting bug appear, waiting for the fix
import os from nxdrive.tests.common import IntegrationTestCase from nxdrive.client import LocalClient class TestIntegrationCopy(IntegrationTestCase): def test_synchronize_remote_copy(self): # Get local and remote clients local = LocalClient(os.path.join(self.local_nxdrive_folder_1, ...
import os from nxdrive.tests.common import IntegrationTestCase from nxdrive.client import LocalClient class TestIntegrationCopy(IntegrationTestCase): def test_synchronize_remote_copy(self): # Get local and remote clients local = LocalClient(os.path.join(self.local_nxdrive_folder_1, ...
CRM-323: Make Address entity plain - fixed dependencny on AbstractAddress
<?php namespace Oro\Bundle\AddressBundle\Form\Handler; use Doctrine\Common\Persistence\ObjectManager; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Oro\Bundle\AddressBundle\Entity\AbstractAddress; class AddressHandler { /** * @var FormInterface */ pro...
<?php namespace Oro\Bundle\AddressBundle\Form\Handler; use Doctrine\Common\Persistence\ObjectManager; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Oro\Bundle\AddressBundle\Entity\Address; class AddressHandler { /** * @var FormInterface */ protected $...
Fix cursor not closed in database single value query The cursor was closed too late in DbOperationSingleValueByRawQuery, after the value was returned. The only case where it was closed was when there was an unsupported column type specified. This commit fixes this issue.
package org.edx.mobile.module.db.impl; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.util.Log; class DbOperationSingleValueByRawQuery<T> extends DbOperationBase<T> { private String sqlQuery; private String[] selectionArgs; private Class<T> columnType; ...
package org.edx.mobile.module.db.impl; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.util.Log; class DbOperationSingleValueByRawQuery<T> extends DbOperationBase<T> { private String sqlQuery; private String[] selectionArgs; private Class<T> columnType; ...
Store overridden methods in _super
'use strict'; var extendPrototypeWithThese = function (prototype, extendThese) { /* Helper method to implement a simple inheritance model for object prototypes. */ var outp = prototype; if (extendThese) { for (var i = extendThese.length - 1; i >= 0; i--) { // ...
'use strict'; var extendPrototypeWithThese = function (prototype, extendThese) { /* Helper method to implement a simple inheritance model for object prototypes. */ var outp = prototype; if (extendThese) { for (var i = extendThese.length - 1; i >= 0; i--) { // ...
Add a test that ensures commas are part of non-word runs.
import unittest from halng.tokenizer import MegaHALTokenizer class testMegaHALTokenizer(unittest.TestCase): def setUp(self): self.tokenizer = MegaHALTokenizer() def testSplitEmpty(self): self.assertEquals(len(self.tokenizer.split("")), 0) def testSplitSentence(self): words = self...
import unittest from halng.tokenizer import MegaHALTokenizer class testMegaHALTokenizer(unittest.TestCase): def setUp(self): self.tokenizer = MegaHALTokenizer() def testSplitEmpty(self): self.assertEquals(len(self.tokenizer.split("")), 0) def testSplitSentence(self): words = self...
Add a new foreign key for the vehicle type
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateVehiclesTable extends Migration { /** * Run the migrations. */ public function up() { Schema::create('vehicles', function (Blueprint $table) { $table->string('code')->pri...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateVehiclesTable extends Migration { /** * Run the migrations. */ public function up() { Schema::create('vehicles', function (Blueprint $table) { $table->string('code')->pri...
Use the engine-types to get the icon
"use strict"; // Dependencies const Deffy = require("deffy") , Typpy = require("typpy") , SubElmId = require("./id") ; class SubElm { /** * SubElm * Creates a `SubElm` instance. * * @name SubElm * @function * @param {Type} type The subelement type. * @param {Object} ...
"use strict"; // Dependencies const Deffy = require("deffy") , Typpy = require("typpy") , SubElmId = require("./id") ; class SubElm { /** * SubElm * Creates a `SubElm` instance. * * @name SubElm * @function * @param {Type} type The subelement type. * @param {Object} ...
Enable debug comments in grunt-sass output file
module.exports = function(grunt) { //grunt-sass grunt.config('sass', { options: { outputStyle: 'expanded', //includePaths: ['<%= config.scss.includePaths %>'], imagePath: '../<%= config.image.dir %>', sourceComments: true }, dist: { ...
module.exports = function(grunt) { //grunt-sass grunt.config('sass', { options: { outputStyle: 'expanded', //includePaths: ['<%= config.scss.includePaths %>'], imagePath: '../<%= config.image.dir %>' }, dist: { files: { '...
Revert "maintain group draggability (why?)" This reverts commit 5c851f3da1e055e10f9bfa8c44f8841e459835cc.
define([ 'views/editor_collection_base', 'underscore', 'jquidrag', 'text!templates/groups.tpl', 'views/group_row', 'views/group_editor', 'models/group', 'models/game', 'vent', ], function( EditorCollectionView, _, jQueryUiDraggable, Template, GroupRowView, GroupEditorView, Group, Game,...
define([ 'views/editor_collection_base', 'underscore', 'jquidrag', 'text!templates/groups.tpl', 'views/group_row', 'views/group_editor', 'models/group', 'models/game', 'vent', ], function( EditorCollectionView, _, jQueryUiDraggable, Template, GroupRowView, GroupEditorView, Group, Game,...
Use `collections` array for syncing databases.
// Dependencies var MongoSyncFiles = require("../index") , Faker = require("faker") ; function generateFakeDataArray() { var docs = []; for (var i = 0; i < 30; ++i) { docs.push({ name: Faker.Name.findName() , email: Faker.Internet.email() , age: Faker.Helpers.randomN...
// Dependencies var MongoSyncFiles = require("../index") , Faker = require("faker") ; // Create database instance var MyDatabase = new MongoSyncFiles(); function generateFakeDataArray() { var docs = []; for (var i = 0; i < 30; ++i) { docs.push({ name: Faker.Name.findName() , ...
Use environment variables for Redis connection
/** * Notifications system server front-end. * * @package randy * @author Andrew Sliwinski <andrew@diy.org> */ /** * Dependencies */ var _ = require('underscore'), async = require('async'), randy = require('./lib/index.js'); /** * Server */ async.auto({ // Environment defaults // -...
/** * Notifications system server front-end. * * @package randy * @author Andrew Sliwinski <andrew@diy.org> */ /** * Dependencies */ var _ = require('underscore'), async = require('async'), randy = require('./lib/index.js'); /** * Server */ async.auto({ // Defaults // -------------...
Fix typos in exception messages and use less specific exception in management commands.
import logging l=logging.getLogger(__name__) from django.conf import settings from django.core.management.base import BaseCommand, CommandError from experiments.reports import (EngagementReportGenerator, ConversionReportGenerator) class Command(BaseCommand): help = ('update_exper...
import logging l=logging.getLogger(__name__) from django.conf import settings from django.core.management.base import BaseCommand, CommandError from experiments.reports import (EngagementReportGenerator, ConversionReportGenerator) class Command(BaseCommand): help = ('update_exper...
Add check_same_thread argument to make_db_engine_component
__all__ = [ 'make_db_engine_component', ] import logging import garage.sql.sqlite from garage import components from garage.startups.logging import LoggingComponent def make_db_engine_component( *, package_name, argument_group, argument_prefix, check_same_thread=False): """DbEngineCo...
"""Template of DbEngineComponent.""" __all__ = [ 'make_db_engine_component', ] import logging import garage.sql.sqlite from garage import components from garage.startups.logging import LoggingComponent def make_db_engine_component( *, package_name, argument_group, argument_prefi...
Make pickup collisions more sensible.
package edu.stuy.starlorn.entities; import java.awt.geom.Rectangle2D; import edu.stuy.starlorn.upgrades.Upgrade; public class Pickup extends Entity { protected Upgrade upgrade; protected double speed; public Pickup(Upgrade up, double x, double y) { super(x, y, up.getSpriteName()); upgra...
package edu.stuy.starlorn.entities; import java.awt.geom.Rectangle2D; import edu.stuy.starlorn.upgrades.Upgrade; public class Pickup extends Entity { protected Upgrade upgrade; protected double speed; public Pickup(Upgrade up, double x, double y) { super(x, y, up.getSpriteName()); upgra...
Change encrypt to use byte array Also cleaned up some code
package com.decentralizeddatabase.reno; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; import java.security.InvalidKeyException; import java.security.Key; import java...
package com.decentralizeddatabase.reno; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; import java.security.InvalidKeyException; import java.security.Key; import java...
Add reaction while fetching logs
(function(){ "use strict"; $(function(){ if($('#fluent-log').length === 0) return; new Vue({ el: "#fluent-log", paramAttributes: ["logUrl"], data: { "autoFetch": false, "logs": [], "limit": 30, "processing": false }, created: function(){ ...
(function(){ "use strict"; $(function(){ if($('#fluent-log').length === 0) return; new Vue({ el: "#fluent-log", paramAttributes: ["logUrl"], data: { "autoFetch": false, "logs": [], "limit": 30 }, created: function(){ this.fetchLogs(); ...
Add pyfits dependence and remove pytoml
#!/usr/bin/env python3 # -*- mode: python -*- from setuptools import setup, find_packages from setuptools.extension import Extension from Cython.Build import cythonize import os.path as path modules = [Extension("pypolycomp._bindings", sources=["pypolycomp/_bindings.pyx"], li...
#!/usr/bin/env python3 # -*- mode: python -*- from setuptools import setup, find_packages from setuptools.extension import Extension from Cython.Build import cythonize import os.path as path modules = [Extension("pypolycomp._bindings", sources=["pypolycomp/_bindings.pyx"], li...
Allow Pydev launch shortcuts from context of Pydev project selection.
package org.python.pydev.debug.ui; import org.eclipse.core.expressions.PropertyTester; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.python.pydev.editor.codecompletion.revisited.PythonPathHelper; import org.python.pydev.navig...
package org.python.pydev.debug.ui; import org.eclipse.core.expressions.PropertyTester; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IAdaptable; import org.python.pydev.editor.codecompletion.revisited.PythonPathHelper; import org.python.pydev.navigator.elements.IWrappedResource; public clas...
Update to get newest nose version.
from setuptools import setup, find_packages import os version = '0.4.3' here = os.path.abspath(os.path.dirname(__file__)) long_description = open(os.path.join(here, 'README.rst')).read() setup(name='specloud', version=version, description="install nosetests and plugins to ease bdd unit specs", long_...
from setuptools import setup, find_packages import os version = '0.4.3' here = os.path.abspath(os.path.dirname(__file__)) long_description = open(os.path.join(here, 'README.rst')).read() setup(name='specloud', version=version, description="install nosetests and plugins to ease bdd unit specs", long_...
Use 'contains' instead of indexOf to find substrings
package org.jenkinsci.plugins.gitclient; import java.util.ArrayList; import java.util.List; import java.util.logging.Handler; import java.util.logging.LogRecord; /** * Recording log handler to allow assertions on logging. Not intended for use * outside this package. Not intended for use outside tests. * * @author...
package org.jenkinsci.plugins.gitclient; import java.util.ArrayList; import java.util.List; import java.util.logging.Handler; import java.util.logging.LogRecord; /** * Recording log handler to allow assertions on logging. Not intended for use * outside this package. Not intended for use outside tests. * * @author...
Fix bug where tasks weren't rendered until running the first time.
var fs = require('fs'); var Backbone = require('backbone'); var swig = require('swig'); var templatePath = require('path').resolve(__dirname, 'taskview.swig'); var template = swig.compile(fs.readFileSync(templatePath, 'utf8')); module.exports = Backbone.View.extend({ tagName: 'li', template: template, in...
var fs = require('fs'); var Backbone = require('backbone'); var swig = require('swig'); var templatePath = require('path').resolve(__dirname, 'taskview.swig'); var template = swig.compile(fs.readFileSync(templatePath, 'utf8')); module.exports = Backbone.View.extend({ tagName: 'li', template: template, in...
Use exception renderable instead of uses of instanceof
<?php namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Routing\Exceptions\InvalidSignatureException; use Illuminate\Validation\ValidationException; use Throwable; class Handler extends ExceptionHandler { /** * A list of the exception types that are n...
<?php namespace App\Exceptions; use App\Exceptions\SolverException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Routing\Exceptions\InvalidSignatureException; use Illuminate\Validation\ValidationException; use Throwable; class Handler extends ExceptionHandler { /** * A li...
Remove extraneous hook, since it was moved from gobble-expression to gobble-token it doesn't need an after-token hook anymore
const OCURLY_CODE = 123; // { const CCURLY_CODE = 125; // } const OBJECT_EXP = 'ObjectExpression'; const PROPERTY = 'Property'; export default { name: 'object', init(jsep) { jsep.addBinaryOp(':', 0.5); // Object literal support jsep.hooks.add('gobble-token', function gobbleObjectExpression(env) { if (...
const OCURLY_CODE = 123; // { const CCURLY_CODE = 125; // } const OBJECT_EXP = 'ObjectExpression'; const PROPERTY = 'Property'; export default { name: 'object', init(jsep) { jsep.addBinaryOp(':', 0.5); // Object literal support function gobbleObjectExpression(env) { if (this.code === OCURLY_CODE) { ...
Fix issue with tasks executing
'use strict'; var path = require('path'), Changes = require('../model/changes'), TargetBase = function (options) { this.init(options); }; TargetBase.prototype = { CACHE_DIR: path.join(process.cwd(), 'cache'), SNAPSHOTS_DIR: path.join(process.cwd(), 'db', 'snapshots'), KEY: { NO...
'use strict'; var path = require('path'), Changes = require('../model/changes'), TargetBase = function (options) { this.init(options); }; TargetBase.prototype = { CACHE_DIR: path.join(process.cwd(), 'cache'), SNAPSHOTS_DIR: path.join(process.cwd(), 'db', 'snapshots'), KEY: { NO...
Throw Empty exception if BRPOP returns None. Add priority argument so it works with the latest version.
from Queue import Empty from redis import Redis from ghettoq.backends.base import BaseBackend DEFAULT_PORT = 6379 DEFAULT_DB = 0 class RedisBackend(BaseBackend): def __init__(self, host=None, port=None, user=None, password=None, database=None, timeout=None): if not isinstance(database, int...
from Queue import Empty from redis import Redis from ghettoq.backends.base import BaseBackend DEFAULT_PORT = 6379 DEFAULT_DB = 0 class RedisBackend(BaseBackend): def __init__(self, host=None, port=None, user=None, password=None, database=None, timeout=None): if not isinstance(database, int...
Fix bug where warnings were being printed as errors
package buildr.ipojo.cli; import java.io.File; import java.io.FileInputStream; import org.apache.felix.ipojo.manipulator.Pojoization; public class Main { public static void main( final String[] args ) { if( 4 != args.length ) { System.err.println("Usage: <input_file_name> <output_file_name> <metadat...
package buildr.ipojo.cli; import java.io.File; import java.io.FileInputStream; import org.apache.felix.ipojo.manipulator.Pojoization; public class Main { public static void main( final String[] args ) { if( 4 != args.length ) { System.err.println("Usage: <input_file_name> <output_file_name> <metadat...
Add content_type to search results JSON.
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import JsonResponse from django.shortcuts import render from wagtail.wagtailcore.models import Page from wagtail.wagtailsearch.models import Query def search(request): do_json = 'json' in request.GET search_query = requ...
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import JsonResponse from django.shortcuts import render from wagtail.wagtailcore.models import Page from wagtail.wagtailsearch.models import Query def search(request): do_json = 'json' in request.GET search_query = requ...
Work around for unit test timeouts
module.exports = function (grunt) { return { options: { frameworks: ['jasmine'], files: [ //this files data is also updated in the watch handler, if updated change there too 'bower_components/jquery/dist/jquery.js', 'bower_components/boostrap/dist/js/...
module.exports = function (grunt) { return { options: { frameworks: ['jasmine'], files: [ //this files data is also updated in the watch handler, if updated change there too 'bower_components/jquery/dist/jquery.js', 'bower_components/boostrap/dist/js/...
Add donation field to calculation
Template.register.rendered = function () { /* * Reset form select field values * to prevent an edge case bug for code push * where accommodations value was undefined */ $('#age').val(''); $('#registration_type').val(''); $('#accommodations').val(''); $('#carbon-tax').val(''); }; Te...
Template.register.rendered = function () { /* * Reset form select field values * to prevent an edge case bug for code push * where accommodations value was undefined */ $('#age').val(''); $('#registration_type').val(''); $('#accommodations').val(''); $('#carbon-tax').val(''); }; Te...
Improve test performance by using the md5 hasher for tests.
from django.conf import settings import base64 import os import os.path def pytest_configure(config): if not settings.configured: os.environ['DJANGO_SETTINGS_MODULE'] = 'sentry.conf.server' test_db = os.environ.get('DB', 'sqlite') if test_db == 'mysql': settings.DATABASES['default'].updat...
from django.conf import settings import base64 import os import os.path def pytest_configure(config): if not settings.configured: os.environ['DJANGO_SETTINGS_MODULE'] = 'sentry.conf.server' test_db = os.environ.get('DB', 'sqlite') if test_db == 'mysql': settings.DATABASES['default'].updat...
Set viewport size to 640 x 480
var page = require('webpage').create(), system = require('system'), address, output, size; page.viewportSize = { width: 640, height: 480 }; if (system.args.length < 4 || system.args.length > 5) { console.log('Usage: '+system.args[0]+' URL selector filename [zoom]'); phantom.exit(1); } else { a...
var page = require('webpage').create(), system = require('system'), address, output, size; if (system.args.length < 4 || system.args.length > 5) { console.log('Usage: '+system.args[0]+' URL selector filename [zoom]'); phantom.exit(1); } else { address = system.args[1]; selector = system.args[2]...
Remove test for rest controller.
from openspending.model.dataset import Dataset from openspending.tests.base import ControllerTestCase from openspending.tests.helpers import load_fixture from pylons import url class TestRestController(ControllerTestCase): def setup(self): super(TestRestController, self).setup() load_fixture('cr...
from openspending.model.dataset import Dataset from openspending.tests.base import ControllerTestCase from openspending.tests.helpers import load_fixture from pylons import url class TestRestController(ControllerTestCase): def setup(self): super(TestRestController, self).setup() load_fixture('cr...
Fix role restriction validation bug
const _ = require('underscore'); const logger = require('../log.js'); class CardService { constructor(db) { this.cards = db.get('cards'); this.packs = db.get('packs'); } replaceCards(cards) { return this.cards.remove({}) .then(() => this.cards.insert(cards)); } ...
const _ = require('underscore'); const logger = require('../log.js'); class CardService { constructor(db) { this.cards = db.get('cards'); this.packs = db.get('packs'); } replaceCards(cards) { return this.cards.remove({}) .then(() => this.cards.insert(cards)); } ...