text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Add missing number case for traverser | /**
* Traverser for Intl AST.
*
* @param {object} ast Intl AST (from intl-messageformat-parser)
* @param {object} visitor Visitor object for traversal
*/
export const traverser = (ast, visitor) => {
function traverse(node, parent) {
/*jshint maxcomplexity:false*/
if (Array.isArray(node)) {
... | /**
* Traverser for Intl AST.
*
* @param {object} ast Intl AST (from intl-messageformat-parser)
* @param {object} visitor Visitor object for traversal
*/
export const traverser = (ast, visitor) => {
function traverse(node, parent) {
/*jshint maxcomplexity:false*/
if (Array.isArray(node)) {
... |
Check the model beig indexed | from django.core.management import BaseCommand
from django.db.models import get_app, get_models
from django.conf import settings
from common.utilities.search_utils import index_instance
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'--test',
acti... | from django.core.management import BaseCommand
from django.db.models import get_app, get_models
from django.conf import settings
from common.utilities.search_utils import index_instance
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'--test',
acti... |
Revert "set null soap parameters"
This reverts commit 0000599 | <?php
/**
* Created by PhpStorm.
* User: Administrador
* Date: 03/10/2017
* Time: 09:47 AM.
*/
namespace Greenter\Ws\Services;
use Greenter\Ws\Header\WSSESecurityHeader;
/**
* Class SoapClient.
*/
class SoapClient implements WsClientInterface
{
private $client;
/**
* SoapClient constructor.
... | <?php
/**
* Created by PhpStorm.
* User: Administrador
* Date: 03/10/2017
* Time: 09:47 AM.
*/
namespace Greenter\Ws\Services;
use Greenter\Ws\Header\WSSESecurityHeader;
/**
* Class SoapClient.
*/
class SoapClient implements WsClientInterface
{
private $client;
/**
* SoapClient constructor.
... |
Fix typo in modal (CantMoveAttached) message. | define(function (require) {
var React = require('react/addons'),
BootstrapModalMixin = require('components/mixins/BootstrapModalMixin.react');
return React.createClass({
displayName: "CantMoveAttached",
mixins: [BootstrapModalMixin],
confirm: function () {
t... | define(function (require) {
var React = require('react/addons'),
BootstrapModalMixin = require('components/mixins/BootstrapModalMixin.react');
return React.createClass({
displayName: "CantMoveAttached",
mixins: [BootstrapModalMixin],
confirm: function () {
t... |
Mark all fields as read only in the dashboard | from django.contrib import admin
from jarbas.core.models import Reimbursement
class SuspiciousListFilter(admin.SimpleListFilter):
title = 'Is suspicious'
parameter_name = 'is_suspicions'
def lookups(self, request, model_admin):
return (
('yes', 'Yes'),
('no', 'No'),
... | from django.contrib import admin
from jarbas.core.models import Reimbursement
class SuspiciousListFilter(admin.SimpleListFilter):
title = 'Is suspicious'
parameter_name = 'is_suspicions'
def lookups(self, request, model_admin):
return (
('yes', 'Yes'),
('no', 'No'),
... |
Use php array sugar syntax | <?php
namespace Rezzza\RestApiBehatExtension;
abstract class ExpectationFailed extends \Exception
{
abstract public function getContextText();
/**
* Returns exception message with additional context info.
*
* @return string
*/
public function __toString()
{
try {
... | <?php
namespace Rezzza\RestApiBehatExtension;
abstract class ExpectationFailed extends \Exception
{
abstract function getContextText();
/**
* Returns exception message with additional context info.
*
* @return string
*/
public function __toString()
{
try {
$con... |
Update NavLinks: use gatsby-link to avoid code chunks necessary for pages not being loaded. | import React from 'react'
import NavLink from 'gatsby-link'
import styles from './navigation.module.styl'
export default ({ sports }) => (
<nav>
<ol className={`${styles['sports-list']}`}>
{
sports.map(({ node }, idx) => (
<li key={idx} className={`${styles['sport-item']}`}>
... | import React from 'react'
import { NavLink } from 'react-router-dom'
import styles from './navigation.module.styl'
export default ({ sports }) => (
<nav>
<ol className={`${styles['sports-list']}`}>
{
sports.map(({ node }, idx) => (
<li key={idx} className={`${styles['sport-item']}`}>
... |
Call toString on action type before displaying | import React, { Component } from 'react';
import JSONTree from 'react-json-tree';
const styles = {
actionBar: {
paddingTop: 8,
paddingBottom: 7,
paddingLeft: 16
},
payload: {
margin: 0,
overflow: 'auto'
}
};
export default class LogMonitorAction extends Component {
renderPayload(payload)... | import React, { Component } from 'react';
import JSONTree from 'react-json-tree';
const styles = {
actionBar: {
paddingTop: 8,
paddingBottom: 7,
paddingLeft: 16
},
payload: {
margin: 0,
overflow: 'auto'
}
};
export default class LogMonitorAction extends Component {
renderPayload(payload)... |
Remove TODO for done thing
git-svn-id: 4b387fe5ada7764508e2ca96c335714e4c1692c6@1257 0d517254-b314-0410-acde-c619094fa49f | package edu.northwestern.bioinformatics.studycalendar.domain.delta;
import edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeInnerNode;
import edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeNode;
import javax.persistence.Entity;
import javax.persistence.DiscriminatorValue;
import javax.persis... | package edu.northwestern.bioinformatics.studycalendar.domain.delta;
import edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeInnerNode;
import edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeNode;
import javax.persistence.Entity;
import javax.persistence.DiscriminatorValue;
import javax.persis... |
Fix a brace syntax error | // ==UserScript==
// @name TwitchEmote4Facebook
// @description adds the Twitch emotes to the facebook chat
// @homepage https://github.com/Kiniamaro/TwitchEmote4Facebook
// @version 0.1.0
// @include https://www.facebook.com/*
// @match https://raw.githubusercontent.com/Kiniamaro/TwitchEmote4Facebook/master/emotes.js
... | // ==UserScript==
// @name TwitchEmote4Facebook
// @description adds the Twitch emotes to the facebook chat
// @homepage https://github.com/Kiniamaro/TwitchEmote4Facebook
// @version 0.1.0
// @include https://www.facebook.com/*
// @match https://raw.githubusercontent.com/Kiniamaro/TwitchEmote4Facebook/master/emotes.js
... |
Remove call to expandContentPanel action on slide edit URL/load | import {shortTitle} from '../../configs/general';
import slideIdTypeError from '../error/slideIdTypeError';
import { AllowedPattern } from '../error/util/allowedPattern';
import expandContentPanel from '../deckpagelayout/expandContentPanel';
import serviceUnavailable from '../error/serviceUnavailable';
const log = requ... | import {shortTitle} from '../../configs/general';
import slideIdTypeError from '../error/slideIdTypeError';
import { AllowedPattern } from '../error/util/allowedPattern';
import expandContentPanel from '../deckpagelayout/expandContentPanel';
import serviceUnavailable from '../error/serviceUnavailable';
const log = requ... |
Use a more pleasant color for LineChart | import VisualizationComponent from './../resplendent';
import vcharts from 'vcharts';
export default class LineChart extends VisualizationComponent {
constructor (el, data) {
super(el);
let values = data.values.map((x) => x[1]);
let minY = Math.min(...values);
if (minY === -Infinity) {
minY =... | import VisualizationComponent from './../resplendent';
import vcharts from 'vcharts';
export default class LineChart extends VisualizationComponent {
constructor (el, data) {
super(el);
let values = data.values.map((x) => x[1]);
let minY = Math.min(...values);
if (minY === -Infinity) {
minY =... |
Fix resolving of packup index.html template | var path = require('path');
var fs = require('fs');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = function(options) {
return {
entry: [
'webpack-dev-server/client?http://localhost:' + options.port,
'webpack/hot/only-dev-server',
optio... | var path = require('path');
var fs = require('fs');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = function(options) {
return {
entry: [
'webpack-dev-server/client?http://localhost:' + options.port,
'webpack/hot/only-dev-server',
optio... |
Add error checking for missing json schema | var wrappedRequest = {}
_.each(_currentRequest._getAccessibleProperties(), function(property){
if(typeof _currentRequest[property] == 'function'){
wrappedRequest[property] = function(){
return _currentRequest[property](Array.prototype.slice.call(arguments))
}
}else{
wrappedRe... | var wrappedRequest = {}
_.each(_currentRequest._getAccessibleProperties(), function(property){
if(typeof _currentRequest[property] == 'function'){
wrappedRequest[property] = function(){
return _currentRequest[property](Array.prototype.slice.call(arguments))
}
}else{
wrappedRe... |
Fix new notifications on old subjects not appearing | <?php namespace Flarum\Core\Notifications;
use Flarum\Core\Users\User;
class NotificationRepository
{
/**
* Find a user's notifications.
*
* @param User $user
* @param int|null $limit
* @param int $offset
* @return \Illuminate\Database\Eloquent\Collection
*/
public function ... | <?php namespace Flarum\Core\Notifications;
use Flarum\Core\Users\User;
class NotificationRepository
{
/**
* Find a user's notifications.
*
* @param User $user
* @param int|null $limit
* @param int $offset
* @return \Illuminate\Database\Eloquent\Collection
*/
public function ... |
Fix error in error log | import hashlib
from datapackage_pipelines.utilities.extended_json import json
from ..errors import SpecError
from .dependency_resolver import resolve_dependencies
class HashCalculator(object):
def __init__(self):
self.all_pipeline_ids = {}
def calculate_hash(self, spec):
cache_hash = None... | import hashlib
from datapackage_pipelines.utilities.extended_json import json
from ..errors import SpecError
from .dependency_resolver import resolve_dependencies
class HashCalculator(object):
def __init__(self):
self.all_pipeline_ids = {}
def calculate_hash(self, spec):
cache_hash = None... |
Add real plugin state tests for plugins that always work (meta, containers, services). | from contextlib import contextmanager
from os import path
from unittest import TestCase
from dictdiffer import diff
from jsontest import JsonTest
from mock import patch
from canaryd_packages import six
from canaryd.plugin import get_plugin_by_name
class TestPluginRealStates(TestCase):
def run_plugin(self, plug... | from contextlib import contextmanager
from os import path
from unittest import TestCase
from canaryd_packages import six
from dictdiffer import diff
from jsontest import JsonTest
from mock import patch
from canaryd.plugin import get_plugin_by_name
@six.add_metaclass(JsonTest)
class TestPluginStates(TestCase):
j... |
Fix typo in upgrade script
git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@1647 af82e41b-90c4-0310-8c96-b1721e28e2e2 | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... |
Add build history seeder to initial seed | <?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
try {
// Miscellaneous Data (e.g. counts)
$this->call(MiscSeeder::class);
// Users, Stats, ... | <?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
try {
// Miscellaneous Data (e.g. counts)
$this->call(MiscSeeder::class);
// Users, Stats, ... |
Fix minor typo in DownloaderHandlers comment | """Download handlers for different schemes"""
from twisted.internet import defer
from scrapy.exceptions import NotSupported, NotConfigured
from scrapy.utils.httpobj import urlparse_cached
from scrapy.utils.misc import load_object
from scrapy import signals
class DownloadHandlers(object):
def __init__(self, craw... | """Download handlers for different schemes"""
from twisted.internet import defer
from scrapy.exceptions import NotSupported, NotConfigured
from scrapy.utils.httpobj import urlparse_cached
from scrapy.utils.misc import load_object
from scrapy import signals
class DownloadHandlers(object):
def __init__(self, craw... |
Allow overriding overflow for sticky table | /* eslint-disable react/prefer-stateless-function */
import React from 'react';
import { Body as TableBody } from 'reactabular-table';
class Body extends React.Component {
constructor(props) {
super(props);
this.ref = null;
}
render() {
const { style, tableHeader, onScroll, ...props } = this.props;
... | /* eslint-disable react/prefer-stateless-function */
import React from 'react';
import { Body as TableBody } from 'reactabular-table';
class Body extends React.Component {
constructor(props) {
super(props);
this.ref = null;
}
render() {
const { style, tableHeader, onScroll, ...props } = this.props;
... |
Allow overriding host/port of S3 service to connect to.
Hardcode non-vhost calling convention, at least for now.
(The host name overriding typically doesn't work with vhosts;
"BUCKET.localhost" is not very helpful.)
To use a local S3-compatible service, put something like
this in ~/.boto:
[Boto]
s3_host = localhos... | import boto.s3.connection
import optparse
def main():
parser = optparse.OptionParser(
usage='%prog BUCKET [KEY]',
)
parser.add_option(
'--method',
default='GET',
help='HTTP method to use [default: %default]',
)
parser.add_option(
'--expiry',
t... | import boto.s3.connection
import optparse
def main():
parser = optparse.OptionParser(
usage='%prog BUCKET [KEY]',
)
parser.add_option(
'--method',
default='GET',
help='HTTP method to use [default: %default]',
)
parser.add_option(
'--expiry',
t... |
Optimize formatting of main file | /*global
define,
require,
window,
console,
_
*/
/*jslint devel:true,
white: true
*/
define([
'jquery',
'underscore',
'./properties',
'./initialproperties',
'./lib/js/extensionUtils',
'text!./lib/c... | /*global
define,
require,
window,
console,
_
*/
/*jslint devel:true,
white: true
*/
define([
'jquery',
'underscore',
'./properties',
'./initialproperties',
'./lib/js/extensionUtils',
'text!./lib/c... |
Revert array_walk to foreach for php 5.3 compat | <?php
namespace OpenConext\EngineBlock\Logger\Formatter;
use EngineBlock_Exception;
use Monolog\Formatter\FormatterInterface;
use OpenConext\EngineBlock\Logger\Message\AdditionalInfo;
final class AdditionalInfoFormatter implements FormatterInterface
{
/**
* @var FormatterInterface
*/
private $forma... | <?php
namespace OpenConext\EngineBlock\Logger\Formatter;
use EngineBlock_Exception;
use Monolog\Formatter\FormatterInterface;
use OpenConext\EngineBlock\Logger\Message\AdditionalInfo;
final class AdditionalInfoFormatter implements FormatterInterface
{
/**
* @var FormatterInterface
*/
private $forma... |
Put the console command in the request scope | <?php
namespace Forex\Bundle\EmailBundle\Command;
use Forex\Bundle\EmailBundle\Entity\EmailMessage;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterf... | <?php
namespace Forex\Bundle\EmailBundle\Command;
use Forex\Bundle\EmailBundle\Entity\EmailMessage;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterf... |
Verify the config file before use | <?php
namespace Craft;
class SyncCommand extends BaseCommand
{
public function actionPlugin()
{
echo "Synchronizing plugins\n";
if (!craft()->config->exists('activePlugins', 'plugins')) {
echo "You need to specify plugins in craft/config/plugins.php before using this functionality.... | <?php
namespace Craft;
class SyncCommand extends BaseCommand
{
public function actionPlugin()
{
echo "Synchronizing plugins\n";
$requiredPlugins = array_merge(['Console'], craft()->config->get('activePlugins', 'plugins'));
$currentPlugins = craft()->plugins->getPlugins(false);
... |
Include path in plugin info regardless of source. | var _ = require('lodash');
var fs = require('fs');
var path = require('path');
module.exports = {
filter: function(plugins) {
var toLoad = [];
_.forOwn(plugins, function(options, name) {
if(!options)
return;
if(options === true) {
toLoad.push... | var _ = require('lodash');
var fs = require('fs');
var path = require('path');
module.exports = {
filter: function(plugins) {
var toLoad = [];
_.forOwn(plugins, function(options, name) {
if(!options)
return;
if(options === true) {
toLoad.push... |
Fix phpstan error with static call to instance method | <?php
/**
* Copyright (c) Qobo Ltd. (https://www.qobo.biz)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Qobo Ltd. (https://www.qobo.biz)
* @license ... | <?php
/**
* Copyright (c) Qobo Ltd. (https://www.qobo.biz)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Qobo Ltd. (https://www.qobo.biz)
* @license ... |
BAP-2898: Add widgets to render lists of calls and emails on shopping cart and order page
- small fix in email listener | <?php
namespace Oro\Bundle\EmailBundle\EventListener\Datagrid;
use Oro\Bundle\DataGridBundle\Datasource\Orm\OrmDatasource;
use Oro\Bundle\DataGridBundle\Event\BuildAfter;
use Oro\Bundle\EmailBundle\Datagrid\EmailQueryFactory;
class EmailListener
{
/**
* @var EmailQueryFactory
*/
protected $factory;... | <?php
namespace Oro\Bundle\EmailBundle\EventListener\Datagrid;
use Oro\Bundle\DataGridBundle\Datasource\Orm\OrmDatasource;
use Oro\Bundle\DataGridBundle\Event\BuildAfter;
use Oro\Bundle\EmailBundle\Datagrid\EmailQueryFactory;
class EmailListener
{
/**
* @var EmailQueryFactory
*/
protected $factory;... |
Add key param to geojson scraper
Sometimes we encounter a geojson file with no 'id' attribute
This allows us to specify a property to use as a key instead | import json
import os
import urllib.request
from retry import retry
from urllib.error import HTTPError
from common import store_history, truncate, summarise
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] ... | import json
import os
import urllib.request
from retry import retry
from urllib.error import HTTPError
from common import store_history, truncate, summarise
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] ... |
Fix if statements checking if header/footer exist | from IPython.nbconvert.preprocessors import Preprocessor
from IPython.nbformat.current import read as read_nb
from IPython.utils.traitlets import Unicode
class IncludeHeaderFooter(Preprocessor):
"""A preprocessor for adding header and/or footer cells to a notebook."""
header = Unicode("", config=True, help="... | from IPython.nbconvert.preprocessors import Preprocessor
from IPython.nbformat.current import read as read_nb
from IPython.utils.traitlets import Unicode
class IncludeHeaderFooter(Preprocessor):
"""A preprocessor for adding header and/or footer cells to a notebook."""
header = Unicode("", config=True, help="... |
Fix project on home page if there's only 1 |
App.HomeController = Ember.ObjectController.extend({
needs: ['currentUser'],
project: null,
isCampaignHomePage: false,
projectIndex: 0,
actions: {
nextProject: function() { // TODO: similar thing for fundraisers?
var projects = this.get('projects');
this.incrementPropert... |
App.HomeController = Ember.ObjectController.extend({
needs: ['currentUser'],
project: null,
isCampaignHomePage: false,
projectIndex: 1,
actions: {
nextProject: function() { // TODO: similar thing for fundraisers?
var projects = this.get('projects');
this.incrementPropert... |
Fix error with file not found when clearing templates cache
Signed-off-by: Sam Poyigi <ccc2dd82f84c4106203d3b58d5938b70cab9f94a@users.noreply.github.com> | <?php
namespace System\Helpers;
use Igniter\Flame\Support\Facades\File;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
class CacheHelper
{
use \Igniter\Flame\Traits\Singleton;
/**
* Execute the console command.
*/
public static function clear()
{
Cache::f... | <?php
namespace System\Helpers;
use Igniter\Flame\Support\Facades\File;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
class CacheHelper
{
use \Igniter\Flame\Traits\Singleton;
/**
* Execute the console command.
*/
public static function clear()
{
Cache::f... |
Make the first group a non-capturing one and remove the last group | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// @flow
/**
* Takes a string and returns the string with public URLs removed.
* It doesn't remove the URLs lik... | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// @flow
/**
* Takes a string and returns the string with public URLs removed.
* It doesn't remove the URLs lik... |
Update 'search_term' functon. Add 'match_phrase' function. | from django.shortcuts import render
from elasticsearch import Elasticsearch
from django.http import HttpResponse
def search(request):
if request.method == 'GET':
term = request.GET.get('term_search')
if term == None:
term = ""
response = search_term(term)
pages = []
... | from django.shortcuts import render
from elasticsearch import Elasticsearch
from django.http import HttpResponse
def search(request):
if request.method == 'GET':
term = request.GET.get('term_search')
if term == None:
term = ""
response = search_term(term)
pages = []
... |
Add missing form type mapping in the form utils | <?php
namespace LAG\AdminBundle\Utils;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\Numbe... | <?php
namespace LAG\AdminBundle\Utils;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\Numbe... |
Fix password_reset_confirm URL for django change.
Django changed the uid parameter to the password_reset_confirm view to be
base64-encoded instead of base36. This means our URL had to change a bit.
Trivial change. | from __future__ import unicode_literals
from django.conf.urls import patterns, url
urlpatterns = patterns(
"reviewboard.accounts.views",
url(r'^register/$', 'account_register',
{'next_url': 'dashboard'}, name="register"),
url(r'^preferences/$', 'user_preferences', name="user-preferences"),
)
ur... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
urlpatterns = patterns(
"reviewboard.accounts.views",
url(r'^register/$', 'account_register',
{'next_url': 'dashboard'}, name="register"),
url(r'^preferences/$', 'user_preferences', name="user-preferences"),
)
ur... |
Remove upper bound on jaraco.util. Incompatibility will be handled as it's encountered. | import sys
import setuptools
def read_long_description():
with open('README.rst') as f:
data = f.read()
with open('CHANGES.rst') as f:
data += '\n\n' + f.read()
return data
importlib_req = ['importlib'] if sys.version_info < (2,7) else []
argparse_req = ['argparse'] if sys.ver... | import sys
import setuptools
def read_long_description():
with open('README.rst') as f:
data = f.read()
with open('CHANGES.rst') as f:
data += '\n\n' + f.read()
return data
importlib_req = ['importlib'] if sys.version_info < (2,7) else []
argparse_req = ['argparse'] if sys.ver... |
Opcodes: Add tests for final two functions in ArrayAccess (only throw exceptions) | <?php
namespace BitWasp\Bitcoin\Tests\Script;
use BitWasp\Bitcoin\Script\Opcodes;
class OpcodesTest extends \PHPUnit_Framework_TestCase
{
public function testGetOpByName()
{
$op = new OpCodes;
$expected = 0;
$lookupOpName = 'OP_0';
$val = $op->getOpByName('OP_0');
$thi... | <?php
namespace BitWasp\Bitcoin\Tests\Script;
use BitWasp\Bitcoin\Script\Opcodes;
class OpcodesTest extends \PHPUnit_Framework_TestCase
{
public function testGetOpByName()
{
$op = new OpCodes;
$expected = 0;
$lookupOpName = 'OP_0';
$val = $op->getOpByName('OP_0');
$thi... |
Move 'open all' link to same line as bug lings.
Rework JS a bit more. | "use strict";
var bugRe = /\bbug (\d+)\b/i;
var bugURL = 'https://bugzilla.mozilla.org/show_bug.cgi?id=';
function getBugIds() {
let bugIds = [];
$('a.message, div.commit-desc pre').each(function(){
let match = bugRe.exec(this.textContent);
if (match) {
let bugId = match[1];
... | "use strict";
var bugRe = /\bbug (\d+)\b/i;
var bugURL = 'https://bugzilla.mozilla.org/show_bug.cgi?id=';
function getBugIds() {
let bugIds = [];
$('a.message, div.commit-desc pre').each(function(){
let match = bugRe.exec(this.textContent);
if (match) {
let bugId = match[1];
... |
Remove support for Python 2. | import copy
import json
from urllib.parse import urlencode
import html5lib
import requests
from application import APPLICATION as APP
class BaseProvider(object):
# ==== HELPER METHODS ====
def parse_html(self, url, css_selector, timeout=60, cache=True):
html = self._http_get(url, timeout=timeout, cac... | import copy
import json
import requests
import html5lib
from application import APPLICATION as APP
# Be compatible with python 2 and 3
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
class BaseProvider(object):
# ==== HELPER METHODS ====
def parse_html(self, ur... |
Update URL since repository has moved to pytest-dev | from setuptools import setup
with open("README.rst") as readme_file:
readme = readme_file.read()
setup(
name='pytest-describe',
version='1.0.0',
description='Describe-style plugin for pytest',
long_description=readme,
long_description_content_type='text/x-rst',
url='https://github.com/py... | from setuptools import setup
with open("README.rst") as readme_file:
readme = readme_file.read()
setup(
name='pytest-describe',
version='1.0.0',
description='Describe-style plugin for pytest',
long_description=readme,
long_description_content_type='text/x-rst',
url='https://github.com/ro... |
Fix author email for pypi packaging | from setuptools import setup
from setuptools import find_packages
import versioneer
# README #
def readme():
with open('README.rst') as f:
return f.read()
setup(name='fair',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Python package to perform calcu... | from setuptools import setup
from setuptools import find_packages
import versioneer
# README #
def readme():
with open('README.rst') as f:
return f.read()
setup(name='fair',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Python package to perform calcu... |
Allow to modify the size of batchOperation | <?php
/**
* AppShell file
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must reta... | <?php
/**
* AppShell file
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must reta... |
Add method for limiting clients by grant. | <?php
namespace Northstar\Auth\Repositories;
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
use Northstar\Auth\Entities\ClientEntity;
use Northstar\Models\Client;
class ClientRepository implements ClientRepositoryInterface
{
/**
* Get a client.
*
* @param string $clientIdent... | <?php
namespace Northstar\Auth\Repositories;
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
use Northstar\Auth\Entities\ClientEntity;
use Northstar\Models\Client;
class ClientRepository implements ClientRepositoryInterface
{
/**
* Get a client.
*
* @param string $clientIdent... |
Fix test after notification classes change | 'use strict';
/*global $*/
describe('ACP edit user group', function () {
it('should save changes', function (done) {
let user;
let adminGroupId;
TEST.browser
.do.auth('admin_users_usergroups_edit', usr => {
user = usr;
})
.fn(cb => TEST.N.models.users.UserGroup.findIdByName(... | 'use strict';
/*global $*/
describe('ACP edit user group', function () {
it('should save changes', function (done) {
let user;
let adminGroupId;
TEST.browser
.do.auth('admin_users_usergroups_edit', usr => {
user = usr;
})
.fn(cb => TEST.N.models.users.UserGroup.findIdByName(... |
Check autoAnchor before child iteration | package com.bottomsheetbehavior;
import android.support.design.widget.CoordinatorLayout;
import android.view.View;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.ThemedReactContext;
public class CoordinatorLayoutMan... | package com.bottomsheetbehavior;
import android.support.design.widget.CoordinatorLayout;
import android.view.View;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.ThemedReactContext;
public class CoordinatorLayoutMan... |
Disable toasts for network broadcast events. | package com.github.tuxdude.yani.network;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.widget.Toast;
import com.github.tuxdude.yani.utils.Logger;
public class NetworkBroadcastListener extends BroadcastRecei... | package com.github.tuxdude.yani.network;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.widget.Toast;
import com.github.tuxdude.yani.utils.Logger;
public class NetworkBroadcastListener extends BroadcastRecei... |
Update repeated to password type. | <?php namespace Kris\LaravelFormBuilder\Fields;
class RepeatedType extends ParentType
{
/**
* Get the template, can be config variable or view path
*
* @return string
*/
protected function getTemplate()
{
return 'repeated';
}
protected function getDefaults()
{
... | <?php namespace Kris\LaravelFormBuilder\Fields;
class RepeatedType extends ParentType
{
/**
* Get the template, can be config variable or view path
*
* @return string
*/
protected function getTemplate()
{
return 'repeated';
}
protected function getDefaults()
{
... |
Use or operator in python to tidy up completion building. | import vim, syncrequest, types
class Completion:
def get_completions(self, column, partialWord):
parameters = {}
parameters['column'] = vim.eval(column)
parameters['wordToComplete'] = vim.eval(partialWord)
parameters['WantDocumentationForEveryCompletionResult'] = \
bool(... | import vim, syncrequest, types
class Completion:
def get_completions(self, column, partialWord):
parameters = {}
parameters['column'] = vim.eval(column)
parameters['wordToComplete'] = vim.eval(partialWord)
parameters['WantDocumentationForEveryCompletionResult'] = \
bool(... |
Add some more visionary words | 'use strict';
module.exports = defineRules;
var visionaryWords = [
/blue\s*sk(?:y|ies)/,
/enlighten(?:ed|ing)?/,
/green\s*fields?/,
/incentivi[sz]e/,
'paradigm',
/producti[sz]e/,
/reach(?:ed|ing) out/,
/synerg(?:y|ize|ise)/,
/visionar(?:y|ies)/
];
function defineRules (linter) {
... | 'use strict';
module.exports = defineRules;
var visionaryWords = [
/blue\s*sk(?:y|ies)/,
/enlighten(?:ed|ing)?/,
/green\s*fields?/,
/reach(?:ed|ing) out/,
/visionar(?:y|ies)/
];
function defineRules (linter) {
// Visionary terminology
linter.addRule({
name: 'Visionary Terminology... |
Add parenthesis to print statement | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... |
Add missing semi-colons and if/else that statement | var gaTracker = (function(dLayer) {
// Push the object to the dataLayer
// Parameters:
// eventName, category, action, label, Type String
// value Type Number (int)
var pushEventToDataLayer = function(eventName, category, action, label, value) {
dLayer.push({
"event": eventName,... | var gaTracker = (function(dLayer) {
// Push the object to the dataLayer
// Parameters:
// eventName, category, action, label, Type String
// value Type Number (int)
var pushEventToDataLayer = function(eventName, category, action, label, value) {
dLayer.push({
"event": eventName,... |
Fix so migrations get included with pypi package. Update version | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-tenant-users',
version='0.2... | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-tenant-users',
version='0.2... |
Disable test that calls System.exit | package com.netflix.governator;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Singleton;
import org.testng.annotations.Test;
public class Sh... | package com.netflix.governator;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Singleton;
import org.testng.annotations.Test;
public class Sh... |
Fix in the apply() method in list context (did not returned the correct list when slice and sliceProperties) | <?php
/*
* Data Object
* https://github.com/ivopetkov/data-object
* Copyright (c) Ivo Petkov
* Free to use under the MIT license.
*/
namespace IvoPetkov;
/**
*
*/
trait DataListContextTrait
{
/**
* An array containing all the actions.
*
* @var array
*/
public $actions = [];
... | <?php
/*
* Data Object
* https://github.com/ivopetkov/data-object
* Copyright (c) Ivo Petkov
* Free to use under the MIT license.
*/
namespace IvoPetkov;
/**
*
*/
trait DataListContextTrait
{
/**
* An array containing all the actions.
*
* @var array
*/
public $actions = [];
... |
Disable downloader for non-existing tile test | var test = require('tape'),
almostEqual = function(t, actual, expected, delta, msg) {
var d = Math.abs(actual - expected);
delta = delta || 1e-9;
msg = msg || 'Should be almost equal';
if (d > delta) {
t.equal(actual, expected, msg);
} else {
t.ok(true... | var test = require('tape'),
almostEqual = function(t, actual, expected, delta, msg) {
var d = Math.abs(actual - expected);
delta = delta || 1e-9;
msg = msg || 'Should be almost equal';
if (d > delta) {
t.equal(actual, expected, msg);
} else {
t.ok(true... |
Make sure that .py file is used, even if .pyc got executed
If python already byte-compiled the source code to .pyc file,
the __file__ points to .pyc, rather than to .py, which breaks the
copying mechanism.
Use regex substitution to make sure we're always copying the original
source file. | '''
Monkey patch setuptools to write faster console_scripts with this format:
from mymodule import entry_function
entry_function()
This is better.
'''
from setuptools.command import easy_install
@classmethod
def get_args(cls, dist, header=None):
"""
Yield write_script() argument tuples for a distrib... | '''
Monkey patch setuptools to write faster console_scripts with this format:
from mymodule import entry_function
entry_function()
This is better.
'''
from setuptools.command import easy_install
@classmethod
def get_args(cls, dist, header=None):
"""
Yield write_script() argument tuples for a distrib... |
docs: Fix simple typo, convertable -> convertible
There is a small typo in django_enumfield/tests/test_validators.py.
Should read `convertible` rather than `convertable`. | import unittest
from django.db import models
from django_enumfield.exceptions import InvalidStatusOperationError
from django_enumfield.tests.models import BeerStyle, Person, PersonStatus
from django_enumfield.validators import validate_available_choice
class ValidatorTest(unittest.TestCase):
def test_validate_a... | import unittest
from django.db import models
from django_enumfield.exceptions import InvalidStatusOperationError
from django_enumfield.tests.models import BeerStyle, Person, PersonStatus
from django_enumfield.validators import validate_available_choice
class ValidatorTest(unittest.TestCase):
def test_validate_a... |
Add static highlighting on serviceDescription field | from flask import Markup
class SearchResults(object):
"""Provides access to the search results information"""
def __init__(self, response, lots_by_slug):
self.search_results = response['services']
self._lots = lots_by_slug
self._annotate()
self.total = response['meta']['total'... | from flask import Markup
class SearchResults(object):
"""Provides access to the search results information"""
def __init__(self, response, lots_by_slug):
self.search_results = response['services']
self._lots = lots_by_slug
self._annotate()
self.total = response['meta']['total'... |
FIX keep-fnames for minify now works | const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const path = require('path');
const commonConfig = require('./webpack.config.common.js');
const AppCachePlugin = require('appcache-webpack-plugin');
module.exports = function(options) {
const ENV = options.ENV || 'production';
... | const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const path = require('path');
const commonConfig = require('./webpack.config.common.js');
const AppCachePlugin = require('appcache-webpack-plugin');
module.exports = function(options) {
const ENV = options.ENV || 'production';
... |
Update help line and print system number | import sys
import datetime
import csv
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import timezone
from radio.models import *
class Command(BaseCommand):
help = 'Export talkgroup info'
def add_arguments(self, parser):
parser.add_... | import sys
import datetime
import csv
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import timezone
from radio.models import *
class Command(BaseCommand):
help = 'Import talkgroup info'
def add_arguments(self, parser):
parser.add_... |
Remove "v" shortcut (allready use for verbosity) | <?php
/*
* This file is part of Octower.
*
* (c) William Pottier <developer@william-pottier.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Octower\Command;
use Octower\Metadata\Project;
use Octower\Packager;
use S... | <?php
/*
* This file is part of Octower.
*
* (c) William Pottier <developer@william-pottier.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Octower\Command;
use Octower\Metadata\Project;
use Octower\Packager;
use S... |
Correct culture code for Español | /*!
* numbro.js language configuration
* language : spanish Spain
* author : Hernan Garcia : https://github.com/hgarcia
*/
(function () {
var language = {
delimiters: {
thousands: '.',
decimal: ','
},
abbreviations: {
thousand: 'k',
million... | /*!
* numbro.js language configuration
* language : spanish Spain
* author : Hernan Garcia : https://github.com/hgarcia
*/
(function () {
var language = {
delimiters: {
thousands: '.',
decimal: ','
},
abbreviations: {
thousand: 'k',
million... |
Create a ImmediateWorker that executes the posted jobs on the same thread synchronously | import queue
from bot.multithreading.work import Work
class Worker:
def run(self):
raise NotImplementedError()
def post(self, work: Work):
raise NotImplementedError()
def shutdown(self):
raise NotImplementedError()
class AbstractWorker(Worker):
def __init__(self, name: str... | import queue
from bot.multithreading.work import Work
class Worker:
def run(self):
raise NotImplementedError()
def post(self, work: Work):
raise NotImplementedError()
def shutdown(self):
raise NotImplementedError()
class AbstractWorker(Worker):
def __init__(self, name: str... |
Revert "Moved API URL out of dev settings."
This reverts commit 134f113e3a2461ae9f7509c3998950726b640b8f. | /* eslint-env node */
'use strict';
module.exports = function (environment) {
let ENV = {
modulePrefix: 'frontend',
environment,
rootURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember c... | /* eslint-env node */
'use strict';
module.exports = function (environment) {
let ENV = {
modulePrefix: 'frontend',
environment,
rootURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember c... |
Correct comment on parsing route parameters instead of query | 'use strict'
module.exports = (function(){
/**
* Import modules
*/
const footballDb = require('./../db/footballDb')
/**
* football module API
*/
return {
'leagues': leagues,
'leagueTable_id': leagueTable_id
}
/**
* football module API --... | 'use strict'
module.exports = (function(){
/**
* Import modules
*/
const footballDb = require('./../db/footballDb')
/**
* football module API
*/
return {
'leagues': leagues,
'leagueTable_id': leagueTable_id
}
/**
* football module API --... |
Add notes for debugging Vega | 'use strict';
// In order to debug your Vega spec, run the following command in your browser's console:
// view = angular.element(document.getElementsByName('<name attribute>')).scope().$$childHead.vegaView
// You can then use the variable view as described in https://vega.github.io/vega/docs/api/debugging/
angular.m... | 'use strict';
angular.module('arachne.visualizations.directives')
.directive('con10tVega', function () { // con10t-vega
return {
restrict: 'E',
scope: {
spec: '@',
name: '@'
},
link: function(scope, element, attrs) {
... |
Fix spelling mistake in invite command description | package com.avairebot.orion.commands.utility;
import com.avairebot.orion.Orion;
import com.avairebot.orion.contracts.commands.AbstractCommand;
import com.avairebot.orion.factories.MessageFactory;
import net.dv8tion.jda.core.entities.Message;
import java.util.Arrays;
import java.util.Collections;
import java.util.List... | package com.avairebot.orion.commands.utility;
import com.avairebot.orion.Orion;
import com.avairebot.orion.contracts.commands.AbstractCommand;
import com.avairebot.orion.factories.MessageFactory;
import net.dv8tion.jda.core.entities.Message;
import java.util.Arrays;
import java.util.Collections;
import java.util.List... |
Fix authorization when permission was used multiple times. | <?php
namespace Yajra\Acl\Traits;
use Illuminate\Support\Collection;
use Illuminate\Support\Fluent;
trait AuthorizesPermissionResources
{
/**
* Permission resource ability mapping.
*
* @var array
*/
protected $resourcePermissionMap = [
'index' => 'lists',
'create' => 'c... | <?php
namespace Yajra\Acl\Traits;
trait AuthorizesPermissionResources
{
/**
* Permission resource ability mapping.
*
* @var array
*/
protected $resourcePermissionMap = [
'index' => 'lists',
'create' => 'create',
'store' => 'create',
'show' => 'view',... |
Add .dmg and .sig to copied file extensions | 'use strict';
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
return {
target: {
files: [
{
expand: true,
cwd: 'src/',
src: [
'**/*.html',
... | 'use strict';
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
return {
target: {
files: [
{
expand: true,
cwd: 'src/',
src: [
'**/*.html',
... |
Add a link to the 'add library' instructions in the footer | import React from 'react';
import Link from '../components/Link';
export default () => {
return (
<footer className="footer">
<style jsx>{`
.footer {
border-top: 1px solid #ececec;
width: 100%;
}
.footer-container {
width: 100%;
max-width: 1... | import React from 'react';
import Link from '../components/Link';
export default () => {
return (
<footer className="footer">
<style jsx>{`
.footer {
border-top: 1px solid #ececec;
width: 100%;
}
.footer-container {
width: 100%;
max-width: 1... |
Fix delete project in admin list | angular
.module('app')
.controller('projectListController', [
'$scope',
'projectService',
'flash',
'MetaMachine',
'$location',
function($scope, projectAPI, notification, MetaMachine, $location) {
$scope.projects = projectAPI.getAll();
MetaMachine.title("Projec... | angular
.module('app')
.controller('projectListController', [
'$scope',
'projectService',
'flash',
'MetaMachine',
'$location',
function($scope, projectAPI, notification, MetaMachine, $location) {
$scope.projects = projectAPI.getAll();
MetaMachine.title("Projec... |
Fix email and password validation. | <?php
namespace Application\Module {
class User extends \Application\Module {
public function Index() {
return $this->Login();
}
public function Login() {
$Request = $this->getRequest();
$User = $this->getModel("User");
if (!empty($Request['... | <?php
namespace Application\Module {
class User extends \Application\Module {
public function Index() {
return $this->Login();
}
public function Login() {
$Request = $this->getRequest();
$User = $this->getModel("User");
if (isset($Request['A... |
Move up/down votes from the far right to just before the title
Now that it's only two icons (and will be only 1 soon), it makes more sense to put it here. | <?php
use yii\helpers\Html;
/* @var $model ShortCirquit\LinkoScopeApi\models\Link */
?>
<div>
<div>
<?= ($index + 1) ?>:
<?= Html::a('<span class="glyphicon glyphicon-arrow-up"></span>', ['up', 'id' => $model->id,], ['title' => 'Up']) ?>
<?= Html::a('<span class="glyphicon glyphi... | <?php
use yii\helpers\Html;
/* @var $model ShortCirquit\LinkoScopeApi\models\Link */
?>
<div>
<div>
<?= ($index + 1) ?>:
[<?= Html::a($model->title, $model->url, ['target' => '_blank',]); ?>]
(<?= parse_url($model->url, PHP_URL_HOST) ?>)
</div>
<?php if (!Yii::$app->user->i... |
Add source links to all comments | "use strict";
module.exports = React.createClass({displayName: 'CommentView',
render: function() {
var comment = this.props.comment;
if (!comment) {
return (
<div>
No comment.
</div>
);
}
var htmlBody = co... | "use strict";
module.exports = React.createClass({displayName: 'CommentView',
render: function() {
var comment = this.props.comment;
if (!comment) {
return (
<div>
No comment.
</div>
);
}
var htmlBody = co... |
Revert "Print "Geschaeftsprozessmodelle" when 'l' has been pressed"
This reverts commit d8b19a1f8486ea6259783d2be898e11cc9ed48c4. | package rogue.creature;
import java.util.Collection;
import jade.fov.RayCaster;
import jade.fov.ViewField;
import jade.ui.Camera;
import jade.ui.Terminal;
import jade.util.datatype.ColoredChar;
import jade.util.datatype.Coordinate;
import jade.util.datatype.Direction;
public class Player extends Creature implements C... | package rogue.creature;
import java.util.Collection;
import jade.fov.RayCaster;
import jade.fov.ViewField;
import jade.ui.Camera;
import jade.ui.Terminal;
import jade.util.datatype.ColoredChar;
import jade.util.datatype.Coordinate;
import jade.util.datatype.Direction;
public class Player extends Creature implements C... |
Downgrade to guzzle 2.8 for react compatibility | <?php
namespace RabbitMQ\Management;
use Guzzle\Common\Collection;
use Guzzle\Service\Client;
use RabbitMQ\Management\Exception\RuntimeException;
class HttpClient extends Client
{
private $hydrator;
public function getHydrator()
{
if (!$this->hydrator) {
$this->hydrator = new Hydrato... | <?php
namespace RabbitMQ\Management;
use Guzzle\Common\Collection;
use Guzzle\Service\Client;
class HttpClient extends Client
{
private $hydrator;
public function getHydrator()
{
if (!$this->hydrator) {
$this->hydrator = new Hydrator();
}
return $this->hydrator;
... |
Fix the vote buttons which weren't appearing when signed in
This fixes a bug whereby the vote buttons were not appearing on proposal pages even if you were signed in. | import Ember from "ember";
import ENV from '../../config/environment';
// global _gaq //
export default Ember.ArrayController.extend({
needs: [ "proposal", "application" ],
proposal: Ember.computed.alias("controllers.proposal.model"),
isOpen: Ember.computed.alias("controllers.proposal.isOpen"),
currentUser: Em... | import Ember from "ember";
import ENV from '../../config/environment';
// global _gaq //
export default Ember.ArrayController.extend({
needs: [ "proposal", "application" ],
proposal: Ember.computed.alias("controllers.proposal.model"),
isOpen: Ember.computed.alias("controllers.proposal.isOpen"),
currentUser: Em... |
Move ProxyStore creation to tabris._init method
Creating the ProxyStore inside _init ensures a fresh ProxyStore
when _init is called again to reset a tabris mock in tests.
Change-Id: I443047400cb6168afe92b9718b3d7ac581afb69e | import {extend} from './util';
import Events from './Events';
import NativeBridge from './NativeBridge';
import ProxyStore from './ProxyStore';
export default function Tabris() {
this._loadFunctions = [];
this._ready = false;
this._init = this._init.bind(this);
this._notify = this._notify.bind(this);
}
extend... | import {extend} from './util';
import Events from './Events';
import NativeBridge from './NativeBridge';
import ProxyStore from './ProxyStore';
export default function Tabris() {
this._loadFunctions = [];
this._proxies = new ProxyStore();
this._ready = false;
this._init = this._init.bind(this);
this._notify ... |
Use env name MYSQL_DATABASE instead of MYSQL_DB
MYSQL_DATABASE matches the environment variable name expected by the
Docker MySQL image (https://hub.docker.com/_/mysql/) which will make it
easier to set up deployments, as I can just set up a secret with
MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD and so on, and allow t... | import Knex from 'knex';
import dotenv from 'dotenv';
dotenv.config()
const dbs = {
get public() {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#smart_self-overwriting_lazy_getters
delete this.public;
return this.public = Knex({
client: 'mys... | import Knex from 'knex';
import dotenv from 'dotenv';
dotenv.config()
const dbs = {
get public() {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#smart_self-overwriting_lazy_getters
delete this.public;
return this.public = Knex({
client: 'mys... |
Edit the parameters. Not fix yet | from random import choice
from pygraphc.evaluation.InternalEvaluation import InternalEvaluation
class SimulatedAnnealing(object):
def __init__(self, tmin, tmax, alpha, parameters, energy_type, max_iteration):
"""The constructor of Simulated Annealing method.
Parameters
----------
... | from random import choice
from pygraphc.evaluation.InternalEvaluation import InternalEvaluation
class SimulatedAnnealing(object):
def __init__(self, method, tmin, tmax, parameter, energy_type):
"""The constructor of Simulated Annealing method.
Parameters
----------
method : s... |
Fix to Product block product lookup | <?php
namespace Concrete\Package\VividStore\Src\VividStore\Utilities;
use Controller;
use Core;
use User;
use Database;
defined('C5_EXECUTE') or die(_("Access Denied."));
class ProductFinder extends Controller
{
public function getProductMatch()
{
$u = new User();
if (!$u->isLoggedI... | <?php
namespace Concrete\Package\VividStore\Src\VividStore\Utilities;
use Controller;
use Core;
use User;
use Database;
defined('C5_EXECUTE') or die(_("Access Denied."));
class ProductFinder extends Controller
{
public function getProductMatch()
{
$u = new User();
if (!$u->isLoggedI... |
Fix old bug - close stream after reading | package com.crowdin.cli.utils.file;
import com.crowdin.cli.utils.MessageSource;
import org.yaml.snakeyaml.Yaml;
import java.io.*;
import java.util.Map;
import java.util.ResourceBundle;
public class FileReader {
private static final ResourceBundle RESOURCE_BUNDLE = MessageSource.RESOURCE_BUNDLE;
private st... | package com.crowdin.cli.utils.file;
import com.crowdin.cli.utils.MessageSource;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.Map;
import java.util.ResourceBundle;
public class FileReader {
... |
Add Acme\DemoBundle to main bundles, for testing | <?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\Sec... | <?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\Sec... |
Fix - Configuration is not displayed | 'use strict';
angular.module('<%=angularAppName%>')
.config(function ($stateProvider) {
$stateProvider
.state('configuration', {
parent: 'admin',
url: '/configuration',
data: {
roles: ['ROLE_ADMIN']
},
... | 'use strict';
angular.module('<%=angularAppName%>')
.config(function ($stateProvider) {
$stateProvider
.state('configuration', {
parent: 'admin',
url: '/configuration',
data: {
roles: ['ROLE_ADMIN']
},
... |
Allow to specify arguments for new function | /* See license.txt for terms of usage */
define([
"firebug/lib/trace"
],
function(FBTrace) {
// ********************************************************************************************* //
// Constants
const Cc = Components.classes;
const Ci = Components.interfaces;
var consoleService = Cc["@mozilla.org/con... | /* See license.txt for terms of usage */
define([
"firebug/lib/trace"
],
function(FBTrace) {
// ********************************************************************************************* //
// Constants
const Cc = Components.classes;
const Ci = Components.interfaces;
var consoleService = Cc["@mozilla.org/con... |
Add the missing logical not in the scan model validation | define(['backbone'], function(Backbone) {
return Backbone.Model.extend({
idAttribute: 'SCANPARAMETERSMODELID',
urlRoot: '/exp/parameters/models',
defaults: {
SEQUENCENUMBER: null,
START: null,
STOP: null,
STEP: null,
ARRAY: ... | define(['backbone'], function(Backbone) {
return Backbone.Model.extend({
idAttribute: 'SCANPARAMETERSMODELID',
urlRoot: '/exp/parameters/models',
defaults: {
SEQUENCENUMBER: null,
START: null,
STOP: null,
STEP: null,
ARRAY: ... |
Check whether read file is actually a file, and if it's not too big. | var fs = require('fs'),
expandHomeDir = require('expand-home-dir'),
async = require('async')
;
function readFile(fileLocation, cb) {
fs.stat(fileLocation, function (stats) {
if (stats.size > Math.pow(1024, 2) || !stats.isFile()) {
cb(new Error('File ' + fileLocation + ' too large or... | var fs = require('fs'),
expandHomeDir = require('expand-home-dir'),
async = require('async')
;
function readFile(fileLocation, cb) {
fs.readFile(fileLocation, {encoding: 'utf8'}, function (err, fileContents) {
if (err) {
cb(err);
return;
}
cb(null, fileCo... |
Add todo for hp stuff | # -*- coding: utf-8 -*-
import hackarena.constants
from hackarena.constants import Classes
from hackarena.constants import Spell
from hackarena.game_objects import BaseGameObject
AVAILABLE_SPELLS = {
Classes.TANK: [Spell.TANK_ATTACK, Spell.TANK_AOE],
Classes.MAGE: [Spell.MAGE_DIRECT_DAMAGE, Spell.MAGE_AOE],
... | # -*- coding: utf-8 -*-
import hackarena.constants
from hackarena.constants import Classes
from hackarena.constants import Spell
from hackarena.game_objects import BaseGameObject
AVAILABLE_SPELLS = {
Classes.TANK: [Spell.TANK_ATTACK, Spell.TANK_AOE],
Classes.MAGE: [Spell.MAGE_DIRECT_DAMAGE, Spell.MAGE_AOE],
... |
Use MEDIUMINT for steps per day (no effect, not used, and ignored by sqlite) | package nodomain.freeyourgadget.gadgetbridge.database.schema;
import android.database.sqlite.SQLiteDatabase;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_... | package nodomain.freeyourgadget.gadgetbridge.database.schema;
import android.database.sqlite.SQLiteDatabase;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_... |
Fix routing deprecation for Ember 2.13 | import Ember from 'ember';
import Config from 'ember-routable-modal/configuration';
export default Ember.Service.extend({
routing: Ember.inject.service('-routing'),
routeName: null,
activeListener: function() {
if (typeof Ember.$ !== 'undefined') {
Ember.$('body')[this.get('routeName') ... | import Ember from 'ember';
import Config from 'ember-routable-modal/configuration';
export default Ember.Service.extend({
routing: Ember.inject.service('-routing'),
routeName: null,
activeListener: function() {
if (typeof Ember.$ !== 'undefined') {
Ember.$('body')[this.get('routeName') ... |
Make comment of 'add_a_getter' method | import copy
def add_a_field(cls, field):
setattr(cls, field.string, field)
pass
def add_a_getter(cls, field):
fieldname = field.string
getter_template = copy.deepcopy(field.get_getterTemplate())
getter_template.__doc__ = "get%s - method to get value of field: %s" % (fieldname,fieldname)
getter... | import copy
def add_a_field(cls, field):
setattr(cls, field.string, field)
pass
def add_a_getter(cls, field):
fieldname = field.string
getter_template = copy.deepcopy(field.get_getterTemplate())
getter_template.__doc__ = "get%s - method to get value of field: %s" % (fieldname,fieldname)
getter... |
Fix testcase for Cache dispense | <?php
/**
* CacheTest.php.
*/
namespace Pagon;
class CacheTest extends \PHPUnit_Framework_TestCase
{
/**
* @var App
*/
protected $app;
public function setUp()
{
$this->app = new App(array(
'cache' => array(
'user' => array(
'type' =... | <?php
/**
* CacheTest.php.
*/
namespace Pagon;
class CacheTest extends \PHPUnit_Framework_TestCase
{
/**
* @var App
*/
protected $app;
public function setUp()
{
$this->app = new App(array(
'cache' => array(
'user' => array(
'type' =... |
Set default currency to USD if none | import { fromJS } from 'immutable';
import {
SERVER_DATA_AUTHORIZE,
SERVER_DATA_BALANCE,
SERVER_DATA_PAYOUT_CURRENCIES,
SERVER_DATA_BUY,
UPDATE_TOKEN,
} from '../_constants/ActionTypes';
const initialState = fromJS({
loginid: '',
fullname: '',
currency: 'USD',
balance: 0,
token:... | import { fromJS } from 'immutable';
import {
SERVER_DATA_AUTHORIZE,
SERVER_DATA_BALANCE,
SERVER_DATA_PAYOUT_CURRENCIES,
SERVER_DATA_BUY,
UPDATE_TOKEN,
} from '../_constants/ActionTypes';
const initialState = fromJS({
loginid: '',
fullname: '',
currency: 'USD',
balance: 0,
token:... |
Add lenient to abstract BaseSource signature | #
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
class BaseSource(object):
def __init__(self, id):
self.id = id
if not getattr(self, 'log', False):
raise NotImplementedError('Abstract base class, log property '
... | #
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
class BaseSource(object):
def __init__(self, id):
self.id = id
if not getattr(self, 'log', False):
raise NotImplementedError('Abstract base class, log property '
... |
Change maker self URL name | from django.conf.urls import patterns, url
from maker.views import (RegsitrationView,
AuthenticationView,
MakerSelfView,
MakerProfileView,
ResetPasswordRequestView,
ResetPasswordP... | from django.conf.urls import patterns, url
from maker.views import (RegsitrationView,
AuthenticationView,
MakerSelfView,
MakerProfileView,
ResetPasswordRequestView,
ResetPasswordP... |
BB-3603: Add new flag to the role entity
- removed unneseccary empty line | <?php
namespace Oro\Bundle\UserBundle\Tests\Unit\Entity;
use Oro\Bundle\UserBundle\Entity\Role;
class RoleTest extends \PHPUnit_Framework_TestCase
{
public function testCreate()
{
$strRole = 'foo';
$role = new Role($strRole);
$this->assertEquals($strRole, $role->getLabel());
... | <?php
namespace Oro\Bundle\UserBundle\Tests\Unit\Entity;
use Oro\Bundle\UserBundle\Entity\Role;
class RoleTest extends \PHPUnit_Framework_TestCase
{
public function testCreate()
{
$strRole = 'foo';
$role = new Role($strRole);
$this->assertEquals($strRole, $role->getLabel());
... |
Include course semester and year in results | /** Course search utility for admin **/
!function(app, $) {
$(document).ready(function() {
if($('.courses-search-query').length) {
var target = $('.courses-search-query');
$.ajax({
url: target.data('autocompleteurl'),
dataType: "json",
success: function(courses) {
ta... | /** Course search utility for admin **/
!function(app, $) {
$(document).ready(function() {
if($('.courses-search-query').length) {
var target = $('.courses-search-query');
$.ajax({
url: target.data('autocompleteurl'),
dataType: "json",
success: function(courses) {
ta... |
Upd: Normalize behaviour of getVersionNumber on windows.
The windows version returns `2.2.9.0`, whereas the iOS and android version limit it to `2.2.9`. | AppVersionProxy = {
getVersionNumber: function (successCallback, failCallback, args) {
var version = Windows.ApplicationModel.Package.current.id.version;
successCallback([version.major, version.minor, version.build].join('.'));
},
getAppName: function (successCallback, failCallback, args) {
if(Windows... | AppVersionProxy = {
getVersionNumber: function (successCallback, failCallback, args) {
var version = Windows.ApplicationModel.Package.current.id.version;
successCallback([version.major, version.minor, version.build, version.revision].join('.'));
},
getAppName: function (successCallback, failCallback, args... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.