text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix i18nPlugin issue introduced with g/277926 Test Plan 1. Pull down code 2. `yarn storybook` should open storybook 3. Should not throw an error for storybook regarding i18nPlugin Change-Id: I2fc15dfae332819d8e45993314f4d0529427520c Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278846 Tested-by: Service ...
const I18nPlugin = require('../ui-build/webpack/i18nPlugin') const path = require('path') const baseWebpackConfig = require('../ui-build/webpack') const root = path.resolve(__dirname, '..') module.exports = { stories: [ '../ui/**/*.stories.mdx', '../ui/**/*.stories.@(js|jsx|ts|tsx)' ], addons: [ '@s...
const I18nPlugin = require('../ui-build/webpack/i18nPlugin') const path = require('path') const baseWebpackConfig = require('../ui-build/webpack') const root = path.resolve(__dirname, '..') module.exports = { stories: [ '../ui/**/*.stories.mdx', '../ui/**/*.stories.@(js|jsx|ts|tsx)' ], addons: [ '@s...
Remove unused log message param
package com.nelsonjrodrigues.pchud; import java.io.IOException; import com.nelsonjrodrigues.pchud.net.MessageListener; import com.nelsonjrodrigues.pchud.net.NetThread; import com.nelsonjrodrigues.pchud.net.PcMessage; import com.nelsonjrodrigues.pchud.world.Worlds; import lombok.extern.slf4j.Slf4j; @Slf4j public c...
package com.nelsonjrodrigues.pchud; import java.io.IOException; import com.nelsonjrodrigues.pchud.net.MessageListener; import com.nelsonjrodrigues.pchud.net.NetThread; import com.nelsonjrodrigues.pchud.net.PcMessage; import com.nelsonjrodrigues.pchud.world.Worlds; import lombok.extern.slf4j.Slf4j; @Slf4j public c...
Remove double count in staging
<?php class DisplayImportABCD implements IDisplayModels { public function getName() { return "ABCD(EFG) XML"; } public function getColumns() { return array( 'category'=>'Category', 'expedition_name' => 'Expedition', 'gtu' => 'Sampling Location', 'taxon' => 'Taxon.', 'ig'...
<?php class DisplayImportABCD implements IDisplayModels { public function getName() { return "ABCD(EFG) XML"; } public function getColumns() { return array( 'category'=>'Category', 'expedition_name' => 'Expedition', 'gtu' => 'Sampling Location', 'taxon' => 'Taxon.', 'ig...
Add filter input on server var
<?php namespace Acd; /** * Http class * @author Acidvertigo MIT Licence */ class Http { /** * Check HTTP version * @return string */ public function protocol() { return filter_input(INPUT_SERVER,'SERVER_PROTOCOL'); } /** * Check if communication is on S...
<?php namespace Acd; /** * Http class * @author Acidvertigo MIT Licence */ class Http { /** * Check HTTP version * @return string */ public function protocol() { return $_SERVER['SERVER_PROTOCOL']; } /** * Check if communication is on SSL or not *...
Add fix bug in animation
/*! Animate.js | The MIT License (MIT) | Copyright (c) 2017 GibboK */ ; (function (animate) { 'use strict'; animate.zoomOutUp = function (selector, options) { var keyframeset = [ { opacity: 1, transform: 'none', transformOrigin: 'center bottom'...
/*! Animate.js | The MIT License (MIT) | Copyright (c) 2017 GibboK */ ; (function (animate) { 'use strict'; animate.zoomOutUp = function (selector, options) { var keyframeset = [ { opacity: 1, transform: 'none', transformOrigin: 'left center', ...
Declare and use normalOffset variable as value of original offset from top.
'use strict'; module.exports = function(app) { app.controller('NavController', ['$rootScope', 'AuthService', function($rs, AuthService) { this.signout = AuthService.signout; let $window = $(window); let $hamMenu = $('#hamburger-menu-icon'); let $banner = $('.banner-container'); let $navBar = $('...
'use strict'; module.exports = function(app) { app.controller('NavController', ['$rootScope', 'AuthService', function($rs, AuthService) { this.signout = AuthService.signout; let $window = $(window); let $hamMenu = $('#hamburger-menu-icon'); let $banner = $('.banner-container'); let $navBar = $('...
Fix trigger exception when no listeners specified
let GlobalEvents = () => { let events = {}; return { off: (eventHandle) => { let index = events[eventHandle.eventName].findIndex((singleEventHandler) => { return singleEventHandler.id !== eventHandle.handlerId; }); events[eventHandle.eventName].splic...
let GlobalEvents = () => { let events = {}; return { off: (eventHandle) => { let index = events[eventHandle.eventName].findIndex((singleEventHandler) => { return singleEventHandler.id !== eventHandle.handlerId; }); events[eventHandle.eventName].splic...
Clarify variables for Google Play credentials
package org.linuxguy.MarketBot; import org.linuxguy.MarketBot.FlowdockNotifier.FlowdockNotificationType; public class MarketBot { public static void main(String[] args) throws InterruptedException { String googlePlayUsername = "marketbotuser@gmail.com"; String googlePlayPassword = "foo"; ...
package org.linuxguy.MarketBot; import org.linuxguy.MarketBot.FlowdockNotifier.FlowdockNotificationType; public class MarketBot { public static void main(String[] args) throws InterruptedException { String username = "marketbotuser@gmail.com"; String password = "foo"; String groupMeBotI...
Add ability to override the port grizzly server starts on.
package com.fenixinfotech.grizzly.framework.playpen; import com.fenixinfotech.web.common.FrameworkServerBase; import org.glassfish.grizzly.http.server.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Loca...
package com.fenixinfotech.grizzly.framework.playpen; import com.fenixinfotech.web.common.FrameworkServerBase; import org.glassfish.grizzly.http.server.HttpHandler; import org.glassfish.grizzly.http.server.HttpServer; import org.glassfish.grizzly.http.server.Request; import org.glassfish.grizzly.http.server.Response; i...
Revert "Dashboard API routes are not meant for the browser" This reverts commit 8fcef7b711423816260aba7669283fe2840f7893.
<?php /* * This file is part of Cachet. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace CachetHQ\Cachet\Http\Routes\Dashboard; use Illuminate\Contracts\Routing\Registrar; /** * This...
<?php /* * This file is part of Cachet. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace CachetHQ\Cachet\Http\Routes\Dashboard; use Illuminate\Contracts\Routing\Registrar; /** * This...
Fix copying of files in herc/data during installation.
from setuptools import setup, find_packages import os import os.path import urllib.parse def readme(): with open('README.md') as f: return f.read() setup(name='herc', version='0.1', description='Herc is a webservice that dispatches jobs to Apache Aurora.', long_description=readme(), ...
from setuptools import setup, find_packages import os import os.path import urllib.parse def readme(): with open('README.md') as f: return f.read() setup(name='herc', version='0.1', description='Herc is a webservice that dispatches jobs to Apache Aurora.', long_description=readme(), ...
Remove the use of mapDispatchToProps
import React, { PropTypes, Component } from 'react' import { connect } from 'react-redux' import { incrementCounter, decrementCounter, incrementCounterAsync } from '../../actions/counter' import {} from './Counter.scss' class Counter extends Component { constructor () { super() this.onIncrementCounter = th...
import React, { PropTypes, Component } from 'react' import { connect } from 'react-redux' import { incrementCounter, decrementCounter, incrementCounterAsync } from '../../actions/counter' import {} from './Counter.scss' class Counter extends Component { render () { return ( <div className="counter"> ...
Add __repr__() and __str__() to Result
from ..util import cached_property class Result: def __init__(self, return_code, stdout_data, stderr_data, encoding): self.return_code = return_code self.stdout_data = stdout_data self.stderr_data = stderr_data self.encoding = encoding self.succeeded = self.return_code == ...
from ..util import cached_property class Result: def __init__(self, return_code, stdout_data, stderr_data, encoding): self.return_code = return_code self.stdout_data = stdout_data self.stderr_data = stderr_data self.encoding = encoding self.succeeded = self.return_code == ...
Remove i18n of the JS daterange filter
import moment from 'moment'; import granularities from 'models/geogranularities'; import frequencies from 'models/frequencies'; import resource_types from 'models/resource_types'; export default { filters: { /** * Display a date range in the shorter possible manner. */ daterange: ...
import moment from 'moment'; import granularities from 'models/geogranularities'; import frequencies from 'models/frequencies'; import resource_types from 'models/resource_types'; export default { filters: { /** * Display a date range in the shorter possible manner. */ daterange: ...
Fix modals by making spinner_options accessible This patch makes the spinner_options variable accessible to the modal functions again. Change-Id: I84b6c7e5813d5818b18675e385214feda178c482 Closes-Bug: 1459115
/*global angularModuleExtension*/ (function () { 'use strict'; angular.module('horizon.dashboard-app', [ 'horizon.dashboard-app.utils', 'horizon.dashboard-app.login', 'horizon.framework', 'hz.api', 'ngCookies'].concat(angularModuleExtension)) .constant('horizon.dashboard-app.conf', { ...
/*global angularModuleExtension*/ (function () { 'use strict'; angular.module('horizon.dashboard-app', [ 'horizon.dashboard-app.utils', 'horizon.dashboard-app.login', 'horizon.framework', 'hz.api', 'ngCookies'].concat(angularModuleExtension)) .constant('horizon.dashboard-app.conf', { ...
Add support for 5d20 instead of d20
import random import re from cardinal.decorators import command def parse_roll(arg): # some people might separate with commas arg = arg.rstrip(',') if match := re.match(r'^(\d+)?d(\d+)$', arg): num_dice = match.group(1) sides = match.group(2) elif match := re.match(r'^d?(\d+)$', arg)...
import random from cardinal.decorators import command class RandomPlugin: @command('roll') def roll(self, cardinal, user, channel, msg): args = msg.split(' ') args.pop(0) dice = [] for arg in args: try: sides = int(arg) dice.append(...
Add optional _ character to displayNameReg. Babel, at least in my configuration, transpiles to "function _class", so we need to catch that too.
var excludeMethods = [ /^constructor$/, /^render$/, /^component[A-Za-z]+$/, /^shouldComponentUpdate$/ ]; var displayNameReg = /^function\s+(_?[a-zA-Z]+)/; function isExcluded(methodName) { return excludeMethods.some(function (reg) { return reg.test(methodName) === false; }); } function bindToClass(...
var excludeMethods = [ /^constructor$/, /^render$/, /^component[A-Za-z]+$/, /^shouldComponentUpdate$/ ]; var displayNameReg = /^function\s+([a-zA-Z]+)/; function isExcluded(methodName) { return excludeMethods.some(function (reg) { return reg.test(methodName) === false; }); } function bindToClass(sc...
Add webargs requirement, and sort requirements.
import re import subprocess from setuptools import setup def _get_git_description(): try: return subprocess.check_output(["git", "describe"]).decode("utf-8").strip() except subprocess.CalledProcessError: return None def get_version(): description = _get_git_description() match = re...
import re import subprocess from setuptools import setup def _get_git_description(): try: return subprocess.check_output(["git", "describe"]).decode("utf-8").strip() except subprocess.CalledProcessError: return None def get_version(): description = _get_git_description() match = re...
Fix use of request service.
<?php namespace Kula\Core\Bundle\FrameworkBundle\EventListener; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Comp...
<?php namespace Kula\Core\Bundle\FrameworkBundle\EventListener; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Comp...
Add timeout config parameter with a default of 20 seconds
import logging import requests logger = logging.getLogger(__name__) class APIError(Exception): pass class BaseService(object): def __init__(self, api, **config): self.api = api self.requester = requests.session() self.config = { 'base_url': 'http://data.police.uk/api/'...
import logging import requests logger = logging.getLogger(__name__) class APIError(Exception): pass class BaseService(object): def __init__(self, api, **config): self.api = api self.requester = requests.session() self.config = { 'base_url': 'http://data.police.uk/api/'...
Allow plugins to manage multiple properties
'use strict'; var module = angular.module('kheoApp'); module.controller('ServerDetailCtrl', ['$scope', '$resource', '$routeParams', 'configuration', '_', function ($scope, $resource, $routeParams, configuration, _) { $scope.privateCount = 0; $scope.server = $resource(configuration.backend + '/servers/' +...
'use strict'; var module = angular.module('kheoApp'); module.controller('ServerDetailCtrl', ['$scope', '$resource', '$routeParams', 'configuration', '_', function ($scope, $resource, $routeParams, configuration, _) { $scope.privateCount = 0; $scope.server = $resource(configuration.backend + '/servers/' +...
Fix error message on fetching in todo detail page
import React from 'react' import { provideHooks } from 'redial' import { reduxForm } from 'redux-form' import Loader from 'react-loaders' import { viewTodo } from '../actions'; import { connect } from 'react-redux'; import { TodoUpdateForm } from './TodoForm'; import { Link } from 'react-router' @provideHooks({ fetc...
import React from 'react' import { provideHooks } from 'redial' import { reduxForm } from 'redux-form' import Loader from 'react-loaders' import { viewTodo } from '../actions'; import { connect } from 'react-redux'; import { TodoUpdateForm } from './TodoForm'; import { Link } from 'react-router' @provideHooks({ fetc...
Add wrapper functions to deal with EINTR and exceptions in dispatched-to-functions
#!/usr/bin/python import ctypes import errno import os import select import traceback import cepoll import ctimerfd def on_timer (): pass def eintr_wrap (fn, *args, **kwargs): while True: try: return fn (*args, **kwargs) except IOError, e: ...
#!/usr/bin/python import ctypes import errno import os import select import traceback import cepoll import ctimerfd def on_timer (): pass def main (): spec = ctimerfd.itimerspec () spec.it_interval.tv_sec = 0 spec.it_interval.tv_nsec = long (1e9/60) spec.it_value.tv_sec = 0 ...
Add cache buster to bundle.js
import React from 'react' import DocumentTitle from 'react-document-title' import { prefixLink } from 'gatsby-helpers' import { TypographyStyle } from 'utils/typography' const BUILD_TIME = new Date().getTime() module.exports = React.createClass({ propTypes () { return { title: React.PropTypes.string, ...
import React from 'react' import DocumentTitle from 'react-document-title' import { prefixLink } from 'gatsby-helpers' import { TypographyStyle } from 'utils/typography' module.exports = React.createClass({ propTypes () { return { title: React.PropTypes.string, } }, render () { const title = ...
Enforce consistent results for generated code
# Copyright 2008 Paul Hodge import os, string def run(functionsDirectory, outputFilename): print "dir is: " +functionsDirectory files = os.listdir(functionsDirectory) functionNames = [] for file in files: if file.endswith('.cpp'): function_name = os.path.split(file)[1][:-4] ...
# Copyright 2008 Paul Hodge import os, string def run(functionsDirectory, outputFilename): print "dir is: " +functionsDirectory files = os.listdir(functionsDirectory) functionNames = [] for file in files: if file.endswith('.cpp'): function_name = os.path.split(file)[1][:-4] ...
Set application title in titlebar.
package net.cdahmedeh.ultimeter.ui.main; import net.cdahmedeh.ultimeter.persistence.dao.TodoManager; import net.cdahmedeh.ultimeter.persistence.manager.PersistenceManager; import net.cdahmedeh.ultimeter.ui.controller.TodoController; import net.cdahmedeh.ultimeter.ui.view.TodoView; import org.eclipse.swt.layout...
package net.cdahmedeh.ultimeter.ui.main; import net.cdahmedeh.ultimeter.persistence.dao.TodoManager; import net.cdahmedeh.ultimeter.persistence.manager.PersistenceManager; import net.cdahmedeh.ultimeter.ui.controller.TodoController; import net.cdahmedeh.ultimeter.ui.view.TodoView; import org.eclipse.swt.layout...
Add support for command line parameters
'use strict'; var cp = require('child_process'); var log = console.log; module.exports = function (npmOptions) { if (typeof npmOptions != 'string' && npmOptions.constructor !== Array) { throw new Error('Parameter must be an array or a single string!') } npmOptions = [].concat(npmOptions); m...
'use strict'; var cp = require('child_process'); var log = console.log; module.exports = function () { module.constructor.prototype.require = function (path) { var self = this; try { return self.constructor._load(path, self); } catch (e) { if (e.code !== 'MODULE...
Update Java segmenter to use the same formula as the C version.
package talkhouse; public class Segmenter { private double[] buf=null; int winsz; int winshift; static final int MIN_SEGMENTS = 3; public Segmenter(int winsz, int winshift) { this.winsz = winsz; this.winshift = winshift; } public double[][] apply(double[] data) { double[] combo; if (buf...
package talkhouse; public class Segmenter { private double[] buf=null; int winsz; int winshift; static final int MIN_SEGMENTS = 3; public Segmenter(int winsz, int winshift) { this.winsz = winsz; this.winshift = winshift; } public double[][] apply(double[] data) { double[] combo; if (buf...
Align validation. Only allow one response. Fix variable name, Include hash key in row insertion
'use strict'; const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const validateResponses = function(responsesList) { if (!(Array.isArray(responsesList))) return false; for (var i=0; i < responsesList.length; i++) { if (typeof responsesList[i].question !== 'string' || ...
'use strict'; const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const validateResponses = function(responsesList) { if (!(Array.isArray(questionList))) return false; for (var i=0; i < responsesList.length; i++) { if (typeof responsesList[i].question !== 'string' || ...
Make sure the attribute key exists before setting it
<?php namespace PHPushbullet; class Device { /** * The fields that we want to retrieve for the device * * @var array $fields */ protected $fields = [ 'nickname', 'iden', 'model', 'type', ...
<?php namespace PHPushbullet; class Device { /** * The fields that we want to retrieve for the device * * @var array $fields */ protected $fields = [ 'nickname', 'iden', 'model', 'type', ...
Set unique together on news article.
"""Models used by the news publication application.""" from django.db import models from cms.apps.pages.models import Page, PageBase, PageField, HtmlField from cms.apps.news.content import NewsFeed, NewsArticle class Article(PageBase): """A news article.""" news_feed = PageField(Page, ...
"""Models used by the news publication application.""" from django.db import models from cms.apps.pages.models import Page, PageBase, PageField, HtmlField from cms.apps.news.content import NewsFeed, NewsArticle class Article(PageBase): """A news article.""" news_feed = PageField(Page, ...
Update YUI error handling logic
from collections import OrderedDict import os import StringIO from django.conf import settings from django.utils.encoding import smart_str from ..base import Processor ERROR_STRING = ("Failed to execute Java VM or yuicompressor. " "Please make sure that you have installed Java " "and ...
from collections import OrderedDict import os import StringIO from django.conf import settings from django.utils.encoding import smart_str from ..base import Processor ERROR_STRING = ("Failed to execute Java VM or yuicompressor. " "Please make sure that you have installed Java " "and ...
Fix bug with inner reset time
var Store = module.exports = function () { }; Store.prototype.hit = function (req, configuration, callback) { var self = this; var ip = req.ip; var path; if (configuration.pathLimiter) { path = (req.baseUrl) ? req.baseUrl.replace(req.path, '') : ''; ip += configuration.path || path; } var now = Da...
var Store = module.exports = function () { }; Store.prototype.hit = function (req, configuration, callback) { var self = this; var ip = req.ip; var path; if (configuration.pathLimiter) { path = (req.baseUrl) ? req.baseUrl.replace(req.path, '') : ''; ip += configuration.path || path; } var now = Da...
Fix type in property name variable
<?php namespace PhpSpec\Util; use ReflectionClass; use ReflectionProperty; class Instantiator { public function instantiate($className) { return unserialize($this->createSerializedObject($className)); } private function createSerializedObject($className) { $reflection = new Refle...
<?php namespace PhpSpec\Util; use ReflectionClass; use ReflectionProperty; class Instantiator { public function instantiate($className) { return unserialize($this->createSerializedObject($className)); } private function createSerializedObject($className) { $reflection = new Refle...
Fix mocha test (ts support)
'use strict'; module.exports = { // TODO: cache transpile(src, filename, babelConfig, tsCompilerOptions) { const babel = require('babel-core'); const tsc = require('typescript'); const gulpTsc = require('gulp-typescript'); const transformWithBabel = content => babel.transform(content, Objec...
'use strict'; module.exports = { // TODO: cache transpile(src, filename, babelConfig, tsCompilerOptions) { const babel = require('babel-core'); const tsc = require('typescript'); const gulpTsc = require('gulp-typescript'); const transformWithBabel = content => babel.transform(content, Objec...
Stop exposing asset_id in Hook Viewset
# -*- coding: utf-8 -*- from __future__ import absolute_import import constance from django.utils.translation import ugettext as _ from rest_framework import serializers from rest_framework.reverse import reverse from ..models.hook import Hook class HookSerializer(serializers.ModelSerializer): class Meta: ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import constance from django.utils.translation import ugettext as _ from rest_framework import serializers from rest_framework.reverse import reverse from ..models.hook import Hook class HookSerializer(serializers.ModelSerializer): class Meta: ...
Fix bug on initialization of controllers
<?php namespace TaskManagement; use Zend\ModuleManager\Feature\AutoloaderProviderInterface; use Zend\ModuleManager\Feature\ConfigProviderInterface; use Zend\Mvc\MvcEvent; use Zend\Stdlib\InitializableInterface; class Module implements AutoloaderProviderInterface, ConfigProviderInterface { public func...
<?php namespace TaskManagement; use Zend\ModuleManager\Feature\AutoloaderProviderInterface; use Zend\ModuleManager\Feature\ConfigProviderInterface; class Module implements AutoloaderProviderInterface, ConfigProviderInterface { public function getConfig() { return include __DIR__ . '/co...
Set RQ timeout when enqueuing
import logging from django.conf import settings from django.core.management.base import BaseCommand from django.db import connection from raven import Client from ....tasks import enqueue from ...models import UniqueFeed, Feed from ...tasks import update_feed from ...utils import FeedUpdater logger = logging.getLogg...
import logging from django.conf import settings from django.core.management.base import BaseCommand from django.db import connection from raven import Client from ....tasks import enqueue from ...models import UniqueFeed, Feed from ...tasks import update_feed from ...utils import FeedUpdater logger = logging.getLogg...
Use BrewPhase in Brew tests
var Brew = require('./brew'); var BrewPhase = require('./BrewPhase'); var expect = require('chai').expect; describe('Brew model', function() { describe('get actual phase', function() { it('should find the phase in progress', function() { var actualPhase = new BrewPhase({ min: 10, temp: 50, ...
var Brew = require('./brew'); var expect = require('chai').expect; describe('Brew model', function() { describe('get actual phase', function() { it('should find the phase in progress', function() { var brew = new Brew({ name: 'Very IPA', startDate: new Date(), phases: [{ m...
Add scalar node with skin
<?php namespace Avanzu\AdminThemeBundle\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 http://s...
<?php namespace Avanzu\AdminThemeBundle\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 http://s...
Add credentials option in order to send headers
var Timers = require('timers') var SenecaModule = require('seneca') global.setImmediate = global.setImmediate || Timers.setImmediate var SenecaExport = function(options, more_options) { options = options || {} options.legacy = options.legacy || {} options.legacy.transport = false var seneca = SenecaModule(op...
var Timers = require('timers') var SenecaModule = require('seneca') global.setImmediate = global.setImmediate || Timers.setImmediate var SenecaExport = function(options, more_options) { options = options || {} options.legacy = options.legacy || {} options.legacy.transport = false var seneca = SenecaModule(op...
Fix missing import. Add method to get all nodes with a particular attribute
""" Registry class and global node registry. """ import inspect class NotRegistered(KeyError): pass class NodeRegistry(dict): NotRegistered = NotRegistered def register(self, node): """Register a node class in the node registry.""" self[node.name] = inspect.isclass(node) and node or nod...
""" Registry class and global node registry. """ class NotRegistered(KeyError): pass __all__ = ["NodeRegistry", "nodes"] class NodeRegistry(dict): NotRegistered = NotRegistered def register(self, node): """Register a node in the node registry. The node will be automatically instantiat...
Put getMaxPriority in a separate function.
define([ 'angular' ], function(angular) { 'use strict'; angular.module('superdesk.menu', []). directive('sdMenu', function($route) { var sdMenu = { templateUrl: 'scripts/superdesk/menu/menu.html', replace: false, priority: -1, ...
define([ 'angular' ], function(angular) { 'use strict'; angular.module('superdesk.menu', []). directive('sdMenu', function($route) { return { templateUrl: 'scripts/superdesk/menu/menu.html', replace: false, priority: -1, li...
Use closing for Python 2.6 compatibility
import os import zipfile import contextlib import pytest from setuptools.command.upload_docs import upload_docs from setuptools.dist import Distribution from .textwrap import DALS from . import contexts SETUP_PY = DALS( """ from setuptools import setup setup(name='foo') """) @pytest.fixture def ...
import os import zipfile import pytest from setuptools.command.upload_docs import upload_docs from setuptools.dist import Distribution from .textwrap import DALS from . import contexts SETUP_PY = DALS( """ from setuptools import setup setup(name='foo') """) @pytest.fixture def sample_project(tmp...
Update for new extension API
<?php namespace Flarum\Sticky; use Flarum\Support\ServiceProvider; use Flarum\Extend\EventSubscribers; use Flarum\Extend\ForumAssets; use Flarum\Extend\PostType; use Flarum\Extend\SerializeAttributes; use Flarum\Extend\DiscussionGambit; use Flarum\Extend\NotificationType; use Flarum\Extend\Permission; class StickySer...
<?php namespace Flarum\Sticky; use Flarum\Support\ServiceProvider; use Illuminate\Contracts\Events\Dispatcher; class StickyServiceProvider extends ServiceProvider { /** * Bootstrap the application events. * * @return void */ public function boot(Dispatcher $events) { $events->s...
Change index page for webpack dev server
var path = require("path"); module.exports = { entry: { app: './src/app.tsx' }, output: { path: path.resolve(__dirname, 'build'), publicPath: "/build/", filename: "[name].bundle.js" }, resolve: { modules: [ "node_modules", path.resolve...
var path = require("path"); module.exports = { entry: { app: './src/app.tsx' }, output: { path: path.resolve(__dirname, 'build'), publicPath: "/build/", filename: "[name].bundle.js" }, resolve: { modules: [ "node_modules", path.resolve...
Add builds to project api
from rest_framework import serializers from .models import Build, BuildResult, Project class BuildResultSerializer(serializers.ModelSerializer): class Meta: model = BuildResult fields = ( 'id', 'coverage', 'succeeded', 'tasks', ) class Bu...
from rest_framework import serializers from .models import Build, BuildResult, Project class ProjectSerializer(serializers.ModelSerializer): class Meta: model = Project fields = ( 'id', 'owner', 'name', 'private', 'approved', ...
Increase the time before the status call during the nodes upgrade. Upgrade of nodes takes many minutes, probably even hours. We do not need to execute the status query every 5 seconds.
(function() { angular .module('crowbarApp.upgrade') .constant('ADDONS_PRECHECK_MAP', { 'ha': ['clusters_healthy'], 'ceph': ['ceph_healthy'] }) .constant('UNEXPECTED_ERROR_DATA', { title: 'unexpected_error', errors: { un...
(function() { angular .module('crowbarApp.upgrade') .constant('ADDONS_PRECHECK_MAP', { 'ha': ['clusters_healthy'], 'ceph': ['ceph_healthy'] }) .constant('UNEXPECTED_ERROR_DATA', { title: 'unexpected_error', errors: { un...
Fix validation of OpenStack select fields in request-based item form [WAL-4035]
from rest_framework import serializers class StringListSerializer(serializers.ListField): child = serializers.CharField() FIELD_CLASSES = { 'integer': serializers.IntegerField, 'date': serializers.DateField, 'time': serializers.TimeField, 'money': serializers.IntegerField, 'boolean': seriali...
from rest_framework import serializers def validate_options(options, attributes): fields = {} for name, option in options.items(): params = {} field_type = option.get('type', '') field_class = serializers.CharField if field_type == 'integer': field_class = seriali...
Test LICQ condition of constraint gradient
import unittest import numpy as np from constraints import (generate_constraints_function, generate_constraint_gradients_function, ) from robot_arm import RobotArm class TestConstraintFunctions(unittest.TestCase): def setUp(self): self.lengths = (3, 2, 2,) self.destinati...
import unittest import numpy as np from constraints import (generate_constraints_function, generate_constraint_gradients_function, ) from robot_arm import RobotArm class TestConstraintFunctions(unittest.TestCase): def setUp(self): self.lengths = (3, 2, 2,) self.destinati...
Remove instance config from closure
<?php return array( 'table' => '', 'instance' => 'Algorit\Synchronizer\Storage\SyncInterface', 'create' => function($system, $resource, $entity, $type) { $company_id = null; $representative_id = null; // Not the best code in the world. $class = explode('\\',...
<?php return array( 'table' => '', 'instance' => function() { return App::make('Algorit\Synchronizer\Storage\SyncInterface'); }, 'create' => function($system, $resource, $entity, $type) { $company_id = null; $representative_id = null; // Not the best...
Test that the serializer doesn't break on an exception
<?php namespace FluentDOM\HTML5 { use FluentDOM\Document; use FluentDOM\TestCase; require_once(__DIR__.'/../vendor/autoload.php'); class SerializerTest extends \PHPUnit_Framework_TestCase { /** * @covers FluentDOM\HTML5\Serializer */ public function testLoadReturnsImportedDocument() { ...
<?php namespace FluentDOM\HTML5 { use FluentDOM\Document; use FluentDOM\TestCase; require_once(__DIR__.'/../vendor/autoload.php'); class SerializerTest extends \PHPUnit_Framework_TestCase { /** * @covers FluentDOM\HTML5\Serializer */ public function testLoadReturnsImportedDocument() { ...
Fix installer for completely new add-on
<?php class SV_AttachmentImprovements_Installer { const AddonNameSpace = 'SV_AttachmentImprovements_'; public static function install($existingAddOn, $addOnData) { $version = isset($existingAddOn['version_id']) ? $existingAddOn['version_id'] : 0; if ($version && $version < 1000200) ...
<?php class SV_AttachmentImprovements_Installer { const AddonNameSpace = 'SV_AttachmentImprovements_'; public static function install($existingAddOn, $addOnData) { $version = isset($existingAddOn['version_id']) ? $existingAddOn['version_id'] : 0; if ($version && $version < 1000200) ...
BLD: Update version to match version reported on website
import os # BEFORE importing distutils, remove MANIFEST. distutils doesn't # properly update it when the contents of directories change. if os.path.exists('MANIFEST'): os.remove('MANIFEST') from distutils.core import setup MAJOR = 0 MINOR = 1 MICRO = 1 VERSION = ...
import os # BEFORE importing distutils, remove MANIFEST. distutils doesn't # properly update it when the contents of directories change. if os.path.exists('MANIFEST'): os.remove('MANIFEST') from distutils.core import setup MAJOR = 0 MINOR = 1 MICRO = 0 VERSION = ...
Move QUESTIONS_BUILDER from blueprint to a global variable
from flask import Flask, request, redirect from flask.ext.bootstrap import Bootstrap from config import configs from dmutils import apiclient, init_app, flask_featureflags from dmutils.content_loader import ContentLoader bootstrap = Bootstrap() data_api_client = apiclient.DataAPIClient() search_api_client = apiclient...
from flask import Flask, request, redirect from flask.ext.bootstrap import Bootstrap from config import configs from dmutils import apiclient, init_app, flask_featureflags from dmutils.content_loader import ContentLoader bootstrap = Bootstrap() data_api_client = apiclient.DataAPIClient() search_api_client = apiclient...
Use napms method from curses rather than sleep method from time
#!/usr/bin/env python import curses import os from box import Box from utils import load_yaml def main(screen): """ Draws and redraws the screen. """ # Hide the cursor. curses.curs_set(0) # Load config from file. config = load_yaml(os.path.expanduser('~/.suave/config.yml')) # Creat...
#!/usr/bin/env python import curses import os import time from box import Box from utils import load_yaml def main(screen): """ Draws and redraws the screen. """ # Hide the cursor. curses.curs_set(0) # Load config from file. config = load_yaml(os.path.expanduser('~/.suave/config.yml')) ...
Use currentUser service to set session.profileId
import Ember from 'ember'; import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; import ExpPlayerRouteMixin from 'exp-player/mixins/exp-player-route'; export default Ember.Route.extend(AuthenticatedRouteMixin, ExpPlayerRouteMixin, { currentUser: Ember.inject.service(), _get...
import Ember from 'ember'; import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; import ExpPlayerRouteMixin from 'exp-player/mixins/exp-player-route'; export default Ember.Route.extend(AuthenticatedRouteMixin, ExpPlayerRouteMixin, { _getExperiment() { return new Ember.R...
Clean cache before doing benchmark + copyright
<?php /** * Copyright 2014 Krzysztof Magosa * * 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 agree...
<?php require 'vendor/autoload.php'; $_SERVER['REQUEST_URI'] = '/test/slugifiedtext/123'; $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['HTTP_HOST'] = 'example.com'; class TestController { public function indexAction($slug, $id) { } } $bench = new \KM\Benchmark(); $bench ->execute( 'Saffron', ...
Remove <p> tags from rendered markdown
$("[name='submit']").click(function(e) { e.preventDefault(); var form = $(this).parents('form:first'); var flag = $("input[name='flag']", form).val(); var pid = $("input[name='pid']", form).val(); if (flag == "") { Materialize.toast("Flag cannot be empty!", 2000); return; } s...
$("[name='submit']").click(function(e) { e.preventDefault(); var form = $(this).parents('form:first'); var flag = $("input[name='flag']", form).val(); var pid = $("input[name='pid']", form).val(); if (flag == "") { Materialize.toast("Flag cannot be empty!", 2000); return; } s...
Switch to use two separate events instead of the single event to prevent the CSS transition problem.
/** * Created by Zack Boman on 1/31/14. * http://www.zackboman.com or tennisgent@gmail.com */ 'use strict'; (function(){ var mod = angular.module('routeStyles', ['ngRoute']); mod.directive('head', ['$rootScope','$compile', function($rootScope, $compile){ return { restr...
/** * Created by Zack Boman on 1/31/14. * http://www.zackboman.com or tennisgent@gmail.com */ (function(){ var mod = angular.module('routeStyles', ['ngRoute']); mod.directive('head', ['$rootScope','$compile', function($rootScope, $compile){ return { restrict: 'E', ...
Add exception if file does not exists
var fs = require('fs'); var jsss = require('./jsss'); var argv = process.argv; var message = require('./message'); var pkg = fs.readFileSync(__dirname + '/../package.json'); if(argv[2] !== void 0) { switch (argv[2]) { case '-v': if (argv.length === 3) { jsss.version(); } break; case...
var fs = require('fs'); var jsss = require('./jsss'); var argv = process.argv; var message = require('./message'); var pkg = fs.readFileSync(__dirname + '/../package.json'); if(argv[2] !== void 0) { switch (argv[2]) { case '-v': if (argv.length === 3) { jsss.version(); } break; case...
Fix module not found error on moment
const path = require('path'); const webpack = require('webpack'); module.exports = { entry: { app: path.resolve(__dirname, 'app/Resources/assets/js/app.js') }, output: { path: path.resolve(__dirname, 'web/builds'), filename: 'bundle.js', publicPath: '/builds/' }, mod...
const path = require('path'); const webpack = require('webpack'); module.exports = { entry: { app: path.resolve(__dirname, 'app/Resources/assets/js/app.js') }, output: { path: path.resolve(__dirname, 'web/builds'), filename: 'bundle.js', publicPath: '/builds/' }, mod...
Remove console statements from tests Remove console statements from mock objects and functions.
import Text from './text' import Browser from '../browser'; describe('Text', () => { describe('clearSelection', () => { describe('when document.body.createTextRange is defined', () => { it('calls collapse and select on the text range', () => { const mockTextRange = { collapse() {}, ...
import Text from './text' import Browser from '../browser'; describe('Text', () => { describe('clearSelection', () => { describe('when document.body.createTextRange is defined', () => { it('calls collapse and select on the text range', () => { const mockTextRange = { collapse() { ...
Fix item selection in enum property editor.
/* * Copyright 2015 Matthew Aguirre * * 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 l...
/* * Copyright 2015 Matthew Aguirre * * 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 agr...
Update the Resume toJSON method. remove need for 'activeAttributes'.
define([ 'underscore', 'backbone', 'models/profile', 'models/address', 'collections/item' ], function (_, Backbone, Profile, Address, ItemCollection) { 'use strict'; var ResumeModel = Backbone.Model.extend({ defaults: { name: '' }, hasOne: ['profile', 'address'], hasMany: ['item']...
define([ 'underscore', 'backbone', 'models/profile', 'models/address', 'collections/item' ], function (_, Backbone, Profile, Address, ItemCollection) { 'use strict'; var ResumeModel = Backbone.Model.extend({ defaults: { name: '' }, activeAttributes: ['name'], hasOne: ['profile', '...
Add support for sublime 2
import sublime_plugin import sublime import os from ..libs.global_vars import IS_ST2 class TypescriptBuildCommand(sublime_plugin.WindowCommand): def run(self): file_name = self.window.active_view().file_name() directory = os.path.dirname(file_name) if "tsconfig.json" in os.listdir(director...
import sublime_plugin import sublime import os class TypescriptBuildCommand(sublime_plugin.WindowCommand): def run(self): file_name = self.window.active_view().file_name() directory = os.path.dirname(file_name) if "tsconfig.json" in os.listdir(directory): self.window.run_comman...
Change https protocol for Chat component
/** * Chat Component * $("#chat").chat({ * ruleGroupName: "", * style: ["block"], * template: [1], * environment: "1"|"2"|"3" * }); */ ui.chat = function(conf) { var that = ui.object(); // Inheritance var getDomain = function(n) { switch (n) { case "1": ...
/** * Chat Component * $("#chat").chat({ * ruleGroupName: "", * style: ["block"], * template: [1], * environment: "1"|"2"|"3" * }); */ ui.chat = function(conf) { var that = ui.object(); // Inheritance var getDomain = function(n) { switch (n) { case "1": ...
Remove last reference to OneOf Generator
<?php use Eris\TestTrait; use Eris\Generator; class ElementsTest extends \PHPUnit_Framework_TestCase { use TestTrait; public function testElementsOnlyProducesElementsFromTheGivenArguments() { $this->forAll([ Generator\elements(1, 2, 3), ]) ->__invoke(function($numbe...
<?php use Eris\TestTrait; use Eris\Generator; class ElementsTest extends \PHPUnit_Framework_TestCase { use TestTrait; public function testElementsOnlyProducesElementsFromTheGivenArguments() { $this->forAll([ Generator\elements(1, 2, 3), ]) ->__invoke(function($numbe...
Add ID of scheduled maintenance to list group item This allows us to use a static URL to a scheduled maintenance.
<div class="timeline schedule"> <div class="panel panel-default"> <div class="panel-heading"> <strong>{{ trans('cachet.incidents.scheduled') }}</strong> </div> <div class="list-group"> @foreach($scheduled_maintenance as $schedule) <div class="list-group-it...
<div class="timeline schedule"> <div class="panel panel-default"> <div class="panel-heading"> <strong>{{ trans('cachet.incidents.scheduled') }}</strong> </div> <div class="list-group"> @foreach($scheduled_maintenance as $schedule) <div class="list-group-it...
Increase timeout for Wit.ai speech-to-text plugin
var Donna = require('../../src/'); var assert = require("assert"); describe('Wit.ai Plugin', function() { describe('#intent extraction()', function() { beforeEach(function(done) { // Init Donna var donna = new Donna({ logger: { // level: 'erro...
var Donna = require('../../src/'); var assert = require("assert"); describe('Wit.ai Plugin', function() { describe('#intent extraction()', function() { beforeEach(function(done) { // Init Donna var donna = new Donna({ logger: { // level: 'erro...
Add cors header status code
<?php namespace App\Middleware; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Slim\Container; /** * CORS preflight middleware. */ class CorsMiddleware { /** * @var Container */ protected $container; /** * Constructor. * * @param Conta...
<?php namespace App\Middleware; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Slim\Container; /** * CORS preflight middleware. */ class CorsMiddleware { /** * @var Container */ protected $container; /** * Constructor. * * @param Conta...
Change some logic to the filter instead.
var fs = require('fs'); var utils = require('amd-utils'); var task = { id : 'init', author : 'Indigo United', name : 'Init', options : { name: { description: 'The task name', 'default': 'autofile' }, dst: { description: 'Directory ...
var fs = require('fs'); var utils = require('amd-utils'); var task = { id : 'init', author : 'Indigo United', name : 'Init', options : { name: { description: 'The task name', 'default': 'autofile' }, dst: { description: 'Directory ...
Fix self-queries ignoring (since self queries are ajax)
<?php namespace tunect\Yii2JsErrorHandler; use yii\base\BootstrapInterface; class Bootstrap implements BootstrapInterface { /** * @inheritdoc */ public function bootstrap($app) { $name = Module::$moduleName; if (!$app->hasModule($name)) { $app->setModule($name, new Module($name)); ...
<?php namespace tunect\Yii2JsErrorHandler; use yii\base\BootstrapInterface; class Bootstrap implements BootstrapInterface { /** * @inheritdoc */ public function bootstrap($app) { if (($app instanceof \yii\web\Application) && $app->request->isAjax) { return; } $name ...
Handle when an OpenSSL error doesn't contain a reason (Or any other field) You can reproduce the error by running: ``` treq.get('https://nile.ghdonline.org') ``` from within a twisted program (and doing the approrpiate deferred stuff). I'm unsure how to craft a unit test for this
from six import PY3, binary_type, text_type from cryptography.hazmat.bindings.openssl.binding import Binding binding = Binding() ffi = binding.ffi lib = binding.lib def exception_from_error_queue(exceptionType): def text(charp): if not charp: return "" return native(ffi.string(charp)) ...
from six import PY3, binary_type, text_type from cryptography.hazmat.bindings.openssl.binding import Binding binding = Binding() ffi = binding.ffi lib = binding.lib def exception_from_error_queue(exceptionType): def text(charp): return native(ffi.string(charp)) errors = [] while True: err...
Fix load method response for csv time in columns reader
import CSVReader from 'readers/csv/csv'; import { isNumber } from 'base/utils'; const CSVTimeInColumnsReader = CSVReader.extend({ _name: 'csv-time_in_columns', init(readerInfo) { this._super(readerInfo); }, load() { return this._super() .then(({ data, columns }) => { const indicatorKey...
import CSVReader from 'readers/csv/csv'; import { isNumber } from 'base/utils'; const CSVTimeInColumnsReader = CSVReader.extend({ _name: 'csv-time_in_columns', init(readerInfo) { this._super(readerInfo); }, load() { return this._super() .then(({ data, columns }) => { const indicatorKey...
Add helper method phpdoc info
<?php if (! function_exists('locale')) { /** * Get the active locale. * * @return string */ function locale() { return config('app.locale', config('app.fallback_locale')); } } if (! function_exists('carbonize')) { /** * Create a Carbon object from a string. * ...
<?php if (! function_exists('locale')) { /** * Get the active locale. * * @return string */ function locale() { return config('app.locale', config('app.fallback_locale')); } } if (! function_exists('carbonize')) { /** * Create a Carbon object from a string. * ...
Use a router to navigate gui's
histomicstk.App = girder.App.extend({ initialize: function () { girder.fetchCurrentUser() .done(_.bind(function (user) { girder.eventStream = new girder.EventStream({ timeout: girder.sseTimeout || null }); this.headerView = ne...
histomicstk.App = girder.App.extend({ initialize: function () { girder.fetchCurrentUser() .done(_.bind(function (user) { girder.eventStream = new girder.EventStream({ timeout: girder.sseTimeout || null }); this.headerView = ne...
Fix issues with callback function
(function (angular) { 'use strict'; function FlotDirective(eehFlot, $interval) { return { restrict: 'AE', template: '<div class="eeh-flot"></div>', scope: { dataset: '=', options: '@', updateCallback: '=', ...
(function (angular) { 'use strict'; function FlotDirective(eehFlot, $interval) { return { restrict: 'AE', template: '<div class="eeh-flot"></div>', scope: { dataset: '=', options: '@', updateCallback: '&', ...
Revert "Remove commonjs in top level" This reverts commit a2690e601c457d27966adc6d074b9966f906e1b7.
import commonjs from '@rollup/plugin-commonjs'; import glslify from 'rollup-plugin-glslify'; import resolve from '@rollup/plugin-node-resolve'; import copy from "rollup-plugin-copy"; export default { input: ['source/gltf-sample-viewer.js'], output: [ { file: 'dist/gltf-viewer.js', ...
import commonjs from '@rollup/plugin-commonjs'; import glslify from 'rollup-plugin-glslify'; import resolve from '@rollup/plugin-node-resolve'; import copy from "rollup-plugin-copy"; export default { input: ['source/gltf-sample-viewer.js'], output: [ { file: 'dist/gltf-viewer.js', ...
Add stacktrace to java test failures
package brlyman; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; import java.util.*; import org.junit.runner.Description; import org.junit.runner.Result; import brlyman.results.*; import brlyman.results.processes.*; public class TurboListener extends RunListener { ...
package brlyman; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; import java.util.*; import org.junit.runner.Description; import org.junit.runner.Result; import brlyman.results.*; import brlyman.results.processes.*; public class TurboListener extends RunListener { ...
:art: Refactor rule to work with gonzales 3.2.1
'use strict'; var helpers = require('../helpers'); module.exports = { 'name': 'space-after-comma', 'defaults': { 'include': true }, 'detect': function (ast, parser) { var result = []; ast.traverseByTypes(['operator', 'delimiter'], function (operator, i, parent) { var next, doubleN...
'use strict'; var helpers = require('../helpers'); module.exports = { 'name': 'space-after-comma', 'defaults': { 'include': true }, 'detect': function (ast, parser) { var result = []; ast.traverseByTypes(['operator', 'delimiter'], function (operator, i, parent) { var next; if (operat...
Change style for admin language panel
<?php namespace Purethink\CMSBundle\Admin; use Sonata\AdminBundle\Admin\Admin; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Form\FormMapper; class Language extends Admin { protected $translationDomain = 'PurethinkCMSBundle'; protected $dat...
<?php namespace Purethink\CMSBundle\Admin; use Sonata\AdminBundle\Admin\Admin; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Form\FormMapper; class Language extends Admin { protected $translationDomain = 'PurethinkCMSBundle'; protected $dat...
Change validate HTTP method to PUT
import flask from flask import request, json def Response(data, status = 200): body = json.dumps(data) return flask.Response(body, status = status, mimetype = 'application/json') def SuccessResponse(dataset_id = None): return Response({ 'success': True, 'id': dataset_id }) def ErrorResponse(status = 400)...
import flask from flask import request, json def Response(data, status = 200): body = json.dumps(data) return flask.Response(body, status = status, mimetype = 'application/json') def SuccessResponse(dataset_id = None): return Response({ 'success': True, 'id': dataset_id }) def ErrorResponse(status = 400)...
Fix wrong path for jscoverage report
module.exports = function(config) { config.set({ basePath: '../../', files: [ 'web/js/vendor/angular.js', 'web/js/vendor/angular-*.js', 'test/lib/angular/angular-mocks.js', 'web/js/vendor/jquery*.js', 'web/js/**/*.js', 'test/un...
module.exports = function(config) { config.set({ basePath: '../../', files: [ 'web/js/vendor/angular.js', 'web/js/vendor/angular-*.js', 'test/lib/angular/angular-mocks.js', 'web/js/vendor/jquery*.js', 'web/js/**/*.js', 'test/un...
Use getKey for both sensors and actuators
<?php namespace actsmart\actsmart; use actsmart\actsmart\Sensors\SensorInterface; use actsmart\actsmart\Controllers\ControllerInterface; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\Response; class Agent { /** @var SensorInterface */ protected $sensors; /...
<?php namespace actsmart\actsmart; use actsmart\actsmart\Sensors\SensorInterface; use actsmart\actsmart\Controllers\ControllerInterface; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\Response; class Agent { /** @var SensorInterface */ protected $sensors; /...
Move and take out the col-md-8 piece
<h3>Change Access</h3> <form class="form-horizontal"> <!-- Select Basic --> <div class="form-group"> <div class="col-md-8"> <label class="control-label" for="access-type">Select Access Type</label> <?php $types = $dal->getAccessTypes(); $selected_user = $_GET['for']; $curr = $dal-...
<h3>Change Access</h3> <form class="form-horizontal"> <!-- Select Basic --> <div class="form-group"> <label class="col-md-8 control-label" for="access-type">Select Access Type</label> <div class="col-md-8"> <?php $types = $dal->getAccessTypes(); $selected_user = $_GET['for']; $curr ...
Update ID to match others
from ansiblelint import AnsibleLintRule try: from types import StringTypes except ImportError: # Python3 removed types.StringTypes StringTypes = str, class NoFormattingInWhenRule(AnsibleLintRule): id = 'ANSIBLE0019' shortdesc = 'No Jinja2 in when' description = '"when" lines should not include...
from ansiblelint import AnsibleLintRule try: from types import StringTypes except ImportError: # Python3 removed types.StringTypes StringTypes = str, class NoFormattingInWhenRule(AnsibleLintRule): id = 'CINCH0001' shortdesc = 'No Jinja2 in when' description = '"when" lines should not include J...
Add debugging statement to retrieve_passages function
# LING 573 Question Answering System # Code last updated 4/17/14 by Clara Gordon # This code implements an InfoRetriever for the question answering system. from pymur import * from general_classes import * import sys class InfoRetriever: # builds a QueryEnvironment associated with the indexed document collect...
# LING 573 Question Answering System # Code last updated 4/17/14 by Clara Gordon # This code implements an InfoRetriever for the question answering system. from pymur import * from general_classes import * class InfoRetriever: # builds a QueryEnvironment associated with the indexed document collection def...
Add `miniplug:ws` debug namespace, logging all incoming events
import login from 'plug-login' import socket from 'plug-socket' import createDebug from 'debug' const debug = createDebug('miniplug:connect') const debugWs = createDebug('miniplug:ws') export default function connectPlugin (options = {}) { return (mp) => { // log in const loginOpts = { host: options.host,...
import login from 'plug-login' import socket from 'plug-socket' import createDebug from 'debug' const debug = createDebug('miniplug:connect') export default function connectPlugin (options = {}) { return (mp) => { // log in const loginOpts = { host: options.host, authToken: true } function connect (o...
Fix last commit: Must ensure GUID before saving so that PK is defined
from framework import StoredObject, fields class Guid(StoredObject): _id = fields.StringField() referent = fields.AbstractForeignField() _meta = { 'optimistic': True, } class GuidStoredObject(StoredObject): # Redirect to content using URL redirect by default redirect_mode = 'redir...
from framework import StoredObject, fields class Guid(StoredObject): _id = fields.StringField() referent = fields.AbstractForeignField() _meta = { 'optimistic': True, } class GuidStoredObject(StoredObject): # Redirect to content using URL redirect by default redirect_mode = 'redir...
Use try/catch for loading mapfiles.
/** * Small wrapper around node-pool. Establishes a pool of 5 mapnik map objects * per mapfile. * @TODO: Make pool size configurable. */ module.exports = new function() { return { pools: {}, acquire: function(mapfile, options, callback) { if (!this.pools[mapfile]) { ...
/** * Small wrapper around node-pool. Establishes a pool of 5 mapnik map objects * per mapfile. * @TODO: Make pool size configurable. */ module.exports = new function() { return { pools: {}, acquire: function(mapfile, options, callback) { if (!this.pools[mapfile]) { ...
Fix: Support older devices with session cache
"use strict"; angular.module("angular-mobile-docs") .factory("FetchService", function ($http, $q, LocalStorageCache, baseUrl) { var getVersionList = function () { /* TODO: LocalStorage for already downloaded files. But also should fetch if net is available ...
"use strict"; angular.module("angular-mobile-docs") .factory("FetchService", function ($http, $q, LocalStorageCache, baseUrl) { var getVersionList = function () { /* TODO: LocalStorage for already downloaded files. But also should fetch if net is available ...
Remove old logging statements. Set up structure to build HTML
$("#search-form").submit(function (event) { var query = $("#search-box").val(); var path = window.location.pathname; //Split path, removing empty entries var splitPath = path.split('/'); splitPath = splitPath.filter(function (v) { return v !== '' }); if (splitPath.length <= 1) { search...
$("#search-form").submit(function (event) { var query = $("#search-box").val(); var path = window.location.pathname; //Split path, removing empty entries var splitPath = path.split('/'); splitPath = splitPath.filter(function (v) { return v !== '' }); if (splitPath.length <= 1) { search...
Add html to watch list since its compiled inline via browserify
var browserifyTransforms = ['brfs']; module.exports = function(grunt) { grunt.registerTask( 'default', [ 'clean', 'browserify', 'sass', 'autoprefixer' ] ); grunt.initConfig({ browserify: { options: { transform: browserifyTransforms }, dist: { ...
var browserifyTransforms = ['brfs']; module.exports = function(grunt) { grunt.registerTask( 'default', [ 'clean', 'browserify', 'sass', 'autoprefixer' ] ); grunt.initConfig({ browserify: { options: { transform: browserifyTransforms }, dist: { ...
Set RedirectView.permanent to True to match old default settings
from django.conf.urls import patterns, url, include from django.conf import settings from django.contrib import admin from django.core.urlresolvers import reverse_lazy from django.views.generic.base import RedirectView import competition admin.autodiscover() urlpatterns = patterns( '', url(r'^$', RedirectVi...
from django.conf.urls import patterns, url, include from django.conf import settings from django.contrib import admin from django.core.urlresolvers import reverse_lazy from django.views.generic.base import RedirectView import competition admin.autodiscover() urlpatterns = patterns( '', url(r'^$', RedirectVi...
Hide the option set from incompatible browsers
from __future__ import unicode_literals from itertools import chain from django import forms from django.utils.encoding import force_text from django.utils.html import format_html from django.utils.safestring import mark_safe class DataListInput(forms.TextInput): """ A form widget that displays a standard `...
from __future__ import unicode_literals from itertools import chain from django import forms from django.utils.encoding import force_text from django.utils.html import format_html from django.utils.safestring import mark_safe class DataListInput(forms.TextInput): """ A form widget that displays a standard `...
Remove constraint on dependency version
from spack import * class Hdf(Package): """HDF4 (also known as HDF) is a library and multi-object file format for storing and managing data between machines.""" homepage = "https://www.hdfgroup.org/products/hdf4/" url = "https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.11/src/hdf-4.2.11.tar.gz" ...
from spack import * class Hdf(Package): """HDF4 (also known as HDF) is a library and multi-object file format for storing and managing data between machines.""" homepage = "https://www.hdfgroup.org/products/hdf4/" url = "https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.11/src/hdf-4.2.11.tar.gz" ...
Fix version string so that we can install with pip/setuptools
"""Schemas for structured data.""" from flatland.exc import AdaptationError from flatland.schema import Array, Boolean, Compound, Constrained, Container,\ Date, DateTime, DateYYYYMMDD, Decimal, Dict, Element, Enum, Float, Form,\ Integer, JoinedString, List, Long, Mapping, MultiValue, Number,\ Pr...
"""Schemas for structured data.""" from flatland.exc import AdaptationError from flatland.schema import Array, Boolean, Compound, Constrained, Container,\ Date, DateTime, DateYYYYMMDD, Decimal, Dict, Element, Enum, Float, Form,\ Integer, JoinedString, List, Long, Mapping, MultiValue, Number,\ Pr...
Send message, even if it was a delete
/** * Copyright 2014 Nicholas Humfrey * Copyright 2013 IBM Corp. * * 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 b...
/** * Copyright 2014 Nicholas Humfrey * Copyright 2013 IBM Corp. * * 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 b...
Allow Program Readers to view comments
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com scope = "AuditImplied" description = """ A user with the ProgramReader role fo...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com scope = "AuditImplied" description = """ A user with the ProgramReader role fo...