text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Replace pseudo-code sketch with accurate comment | // Animate: call model update and view render at each animation frame.
//
var tickState = require('./tickState')
var render = require('./view/render')
// To indicate if started.
// Maybe to pause the animation in the future.
var running = false
// number, unix timestamp milliseconds of most recent frame.
var past = n... | // A bit of pseudo-code
//
// tickModel
// var dt
// for each canvas
// canvasParticles = canvasParticles.filterOut(particlesOutsideOrTimeout)
//
// for each particle in canvasParticles
// tick(particle)
//
// for each startOptions
// var newParticles = createParticles(imageUrls, startOptions, dt)
// ... |
Fix checkstyle issue: File does not end with a newline | /*
* Copyright 2015 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | /*
* Copyright 2015 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
Make never ending traverser consume less CPU.
Max, please review. | // Copyright 2006 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicab... | // Copyright 2006 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicab... |
fix(test): Use of StageComponent to ensure aurelia’s framework is loaded as expected. | import { Container } from 'aurelia-dependency-injection';
import { StageComponent } from 'aurelia-testing';
import { bootstrap } from 'aurelia-bootstrapper';
import { Config } from '../../src/config';
import { Collection } from '../../src/collection';
import { UseCollection } from '../../src/use-collection';
import { ... | import { Config } from '../../src/config';
import { Collection } from '../../src/collection';
import { UseCollection } from '../../src/use-collection';
import { Container } from 'aurelia-dependency-injection';
import { InjectTest } from './resources/inject-test';
let container = new Container();
let config = container... |
Add API number in get_config() | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Andre Anjos <andre.anjos@idiap.ch>
# Fri 20 Sep 14:45:01 2013
"""Blitz++ Array bindings for Python"""
import pkg_resources
from ._library import array, as_blitz
from . import version
from .version import module as __version__
from .version import api as __api_v... | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Andre Anjos <andre.anjos@idiap.ch>
# Fri 20 Sep 14:45:01 2013
"""Blitz++ Array bindings for Python"""
import pkg_resources
from ._library import array, as_blitz
from . import version
from .version import module as __version__
from .version import api as __api_v... |
Upgrade to v0.4.6 of membersuire_api_client | #!/usr/bin/env python
from setuptools import setup
import os
# Utility function to read README file
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='iss',
version='2.7.1',
description="Ideally Single Source app for MemberSuite data.",
author='AASHE... | #!/usr/bin/env python
from setuptools import setup
import os
# Utility function to read README file
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='iss',
version='2.7.1',
description="Ideally Single Source app for MemberSuite data.",
author='AASHE... |
Change SubscribeKernelListenerPass position to BEFORE_OPTIMIZATION because original one was moved to BEFORE_REMOVE since Symfony 2.3 | <?php
/*
* Copyright (c)
* Kirill chEbba Chebunin <iam@chebba.org>
*
* This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*/
namespace EventBand\Bundle;
use EventBand\Bundle\DependencyInjection\Compiler\JmsEventConfigPass;
use EventBand\Bundle\DependencyInjec... | <?php
/*
* Copyright (c)
* Kirill chEbba Chebunin <iam@chebba.org>
*
* This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*/
namespace EventBand\Bundle;
use EventBand\Bundle\DependencyInjection\Compiler\JmsEventConfigPass;
use EventBand\Bundle\DependencyInjec... |
Add type checking and piping to /dev/null | """A collection of common git actions."""
import os
from subprocess import check_output, PIPE, Popen, STDOUT
def is_valid_reference(reference):
"""Determines if a reference is valid.
:param str reference: name of the reference to validate
:return bool: whether or not the reference is valid
"""
... | """A collection of common git actions."""
from subprocess import check_output, PIPE, Popen, STDOUT
def is_valid_reference(reference):
"""Determines if a reference is valid.
:param str reference: name of the reference to validate
:return bool: whether or not the reference is valid
"""
show_ref_... |
Fix bug: api exceptions can occurs with some versions of PHP | <?php
namespace Api;
/**
* File API controller
*
* @package api
* @author Frederic Guillot
*/
class File extends Base
{
public function getFile($file_id)
{
return $this->file->getById($file_id);
}
public function getAllFiles($task_id)
{
return $this->file->getAll($task_id)... | <?php
namespace Api;
/**
* File API controller
*
* @package api
* @author Frederic Guillot
*/
class File extends Base
{
public function getFile($file_id)
{
return $this->file->getById($file_id);
}
public function getAllFiles($task_id)
{
return $this->file->getAll($task_id)... |
Allow adding workers to the router. | <?php
declare(strict_types=1);
namespace Keystone\Queue\Router;
use Keystone\Queue\Envelope;
use Keystone\Queue\Exception\RoutingException;
use Keystone\Queue\Router;
class SimpleRouter implements Router
{
/**
* @var object[]
*/
private $workers;
/**
* @param object[] $workers
*/
... | <?php
declare(strict_types=1);
namespace Keystone\Queue\Router;
use Keystone\Queue\Envelope;
use Keystone\Queue\Exception\RoutingException;
use Keystone\Queue\Router;
class SimpleRouter implements Router
{
/**
* @var object[]
*/
private $workers;
/**
* @param object[] $workers
*/
... |
Return same function if length doesn't differ | 'use strict';
var toUint = require('../number/to-uint')
, test = function (a, b) {}, desc, defineProperty
, generate, mixin;
try {
Object.defineProperty(test, 'length', { configurable: true, writable: false,
enumerable: false, value: 1 });
} catch (ignore) {}
if (test.length === 1) {
// ES6
desc = { configu... | 'use strict';
var test = function (a, b) {}, desc, defineProperty
, generate, mixin;
try {
Object.defineProperty(test, 'length', { configurable: true, writable: false,
enumerable: false, value: 1 });
} catch (ignore) {}
if (test.length === 1) {
// ES6
desc = { configurable: true, writable: false, enumerable: ... |
Set timeout to infinity for init-widgets tag | var raptorWidgets = require('../');
module.exports = function render(input, context) {
var widgetsContext = raptorWidgets.getWidgetsContext(context);
if (context.featureLastFlush === false) {
// If the rendering context doesn't support the ability to know when all of the asynchronous fragmnents
... | var raptorWidgets = require('../');
module.exports = function render(input, context) {
var widgetsContext = raptorWidgets.getWidgetsContext(context);
if (context.featureLastFlush === false) {
// If the rendering context doesn't support the ability to know when all of the asynchronous fragmnents
... |
Fix typo: delayWhileIdle should be delay_while_idle | /**
* This module defines all the arguments that may be passed to a message.
*
* Each argument may contain a field `__argName`, if the name of the field
* should be different when sent to the server.
*
* The argument may also contain a field `__argType`, if the given
* argument must be of that type. The types ... | /**
* This module defines all the arguments that may be passed to a message.
*
* Each argument may contain a field `__argName`, if the name of the field
* should be different when sent to the server.
*
* The argument may also contain a field `__argType`, if the given
* argument must be of that type. The types ... |
Add Aspect of the Turtle to Beast Mastery buffs | import SPELLS from 'common/SPELLS';
import BLOODLUST_BUFFS from 'game/BLOODLUST_BUFFS';
import CoreBuffs, { BuffDuration } from 'parser/core/modules/Buffs';
class Buffs extends CoreBuffs {
buffs() {
const combatant = this.selectedCombatant;
// Documentation:
return [
{
spell: SPELLS.BESTIA... | import SPELLS from 'common/SPELLS';
import BLOODLUST_BUFFS from 'game/BLOODLUST_BUFFS';
import CoreBuffs, { BuffDuration } from 'parser/core/modules/Buffs';
class Buffs extends CoreBuffs {
buffs() {
const combatant = this.selectedCombatant;
// Documentation:
return [
{
spell: SPELLS.BESTIA... |
Fix bug, need to return server for counting request | var pstarter = require('pstarter');
var worker = function() {
var config = require('./config');
var express = require('express');
var app = express();
var http = require('http');
var server = http.createServer(app);
var bootstrap = require('./app/bootstrap.js');
bootstrap.setupApp(app, __dirname);
bootstrap.boo... | var pstarter = require('pstarter');
var worker = function() {
var config = require('./config');
var express = require('express');
var app = express();
var http = require('http');
var server = http.createServer(app);
var bootstrap = require('./app/bootstrap.js');
bootstrap.setupApp(app, __dirname);
bootstrap.boo... |
Fix import Linter from pylam_pylint | """Load extensions."""
import os
import sys
CURDIR = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(CURDIR, '..', '..', 'deps'))
LINTERS = {}
try:
from pylama.lint.pylama_mccabe import Linter
LINTERS['mccabe'] = Linter()
except ImportError:
pass
try:
from pylama.lint.py... | """Load extensions."""
import os
import sys
CURDIR = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(CURDIR, '..', '..', 'deps'))
LINTERS = {}
try:
from pylama.lint.pylama_mccabe import Linter
LINTERS['mccabe'] = Linter()
except ImportError:
pass
try:
from pylama.lint.py... |
Update the PyPI version to 7.0.11. | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.10',
packages=['todoist', 'todoist.managers'],
author='Doist Team... |
Add date to info reported for new links | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
Update capture profiler to new spec of providing board instead of string. | import cProfile
from pqhelper import capture
def main():
cProfile.run('test_solution(catapult)')
def test_solution(board_string):
board = capture.Board(board_string)
print capture.capture(board)
skeleton = '''
..*..*..
.gm..mg.
.ms..sm.
.rs..sr.
.ggmmgg.
.rsggsr.
.rsrrsr.
ssgssgss'''
giant_rat = '''
... | import cProfile
from pqhelper import capture
def main():
cProfile.run('test_solution(catapult)')
def test_solution(board_string):
print capture.capture(board_string)
skeleton = '''
..*..*..
.gm..mg.
.ms..sm.
.rs..sr.
.ggmmgg.
.rsggsr.
.rsrrsr.
ssgssgss'''
giant_rat = '''
...mm...
..mrym..
.mgyrgm.
mygryg... |
Add exception to method signature, and add additional annotation | package uk.ac.ebi.spot.goci.service;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook... | package uk.ac.ebi.spot.goci.service;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Service;
import java.io.IOExc... |
Add failing test for multiple attributes | define([ 'janitor' ], function (Janitor) {
describe('janitor', function () {
var janitor;
var config = {
tags: {
p: []
}
};
beforeEach(function () {
janitor = new Janitor(config);
});
it('should clean attributes not in the whitelist', function () {
var p = do... | define([ 'janitor' ], function (Janitor) {
describe('janitor', function () {
var janitor;
var config = {
tags: {
p: []
}
};
beforeEach(function () {
janitor = new Janitor(config);
});
it('should clean attributes not in the whitelist', function () {
var p = do... |
docs: Update site ads on navigation | import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import useScript from '@charlietango/use-script';
import DocSidebarBase from '@theme-original/DocSidebar';
import styles from './styles.module.css';
const SCRIPT_URL = 'https://media.ethicalads.io/media/client/ethicalads.min.js';
const PUBLI... | import React from 'react';
import PropTypes from 'prop-types';
import useScript from '@charlietango/use-script';
import DocSidebarBase from '@theme-original/DocSidebar';
import styles from './styles.module.css';
const SCRIPT_URL = 'https://media.ethicalads.io/media/client/ethicalads.min.js';
const PUBLISHER_ID = 'reac... |
Change location to reset directory we store output | 'use strict';
const bodyParser = require('body-parser').json({ limit: '50mb' });
const path = require('path');
const date = require('date-and-time');
const { ensureDirSync, writeJsonSync, emptyDirSync } = require('fs-extra');
let outputDir;
function reportViolations(req, res) {
const REPORT_TIMESTAMP = date.format... | 'use strict';
const bodyParser = require('body-parser').json({ limit: '50mb' });
const path = require('path');
const date = require('date-and-time');
const { ensureDirSync, writeJsonSync, emptyDirSync } = require('fs-extra');
function reportViolations(req, res, options) {
const REPORT_TIMESTAMP = date.format(new Da... |
Refactor tests: Extracted the twitter address to a field | package org.ale.app;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
public class TwitterLinkCreatorTest {
private String twitterAddress;
@Before
public void setup(){
twitterAddress = "<a href=\"http://twitter.com/";
}
@Test
public void sh... | package org.ale.app;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class TwitterLinkCreatorTest {
@Test
public void shouldProcessSingleTwitterName() {
String result = TwitterLinkCreator.process("@foobar");
assertEquals("<a href=\"http://twitter.com/foobar\">@foobar</a>", result);... |
Enable prefetching to try it out | // This is a second entry point to speed up our query
// to fetch search results.
// We've patched react-scripts to add this as another entry
// point. E.g., the Webpack config by running lives at
// web/node_modules/react-scripts/config/webpack.config.js.
// After modifying files in react-scripts, commit the
// patche... | // This is a second entry point to speed up our query
// to fetch search results.
// We've patched react-scripts to add this as another entry
// point. E.g., the Webpack config by running lives at
// web/node_modules/react-scripts/config/webpack.config.js.
// After modifying files in react-scripts, commit the
// patche... |
Make the current request object available in views | <?php defined('SYSPATH') OR die('No direct script access.');
/**
*
* @package Boom
* @category Controllers
*/
class Boom_Controller_Page_Html extends Controller_Page
{
/**
*
* @var View
*/
public $template;
public function before()
{
parent::before();
$this->_save_last_url();
$template = $this-... | <?php defined('SYSPATH') OR die('No direct script access.');
/**
*
* @package Boom
* @category Controllers
*/
class Boom_Controller_Page_Html extends Controller_Page
{
/**
*
* @var View
*/
public $template;
public function before()
{
parent::before();
$this->_save_last_url();
$template = $this-... |
Set collapsable element's initial state to collapse. | angular.module('ui.bootstrapAddOns.collapse',['ui.bootstrap.transition'])
.directive('collapsableelement', function() {
return {
restrict: 'E',
replace: true,
scope: {
name: '='
},
transclude: true,
template: '<div class="collapse" collapse="isCollapse" ng-transclude></di... | angular.module('ui.bootstrapAddOns.collapse',['ui.bootstrap.transition'])
.directive('collapsableelement', function() {
return {
restrict: 'E',
replace: true,
scope: {
name: '='
},
transclude: true,
template: '<div class="collapse" collapse="isExpand" ng-transclude></div>... |
Update the PyPI version to 7.0. | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.26',
packages=['todoist', 'todoist.managers'],
author='Doist Team... |
Stop errors if no datasets are defined | <?php
require_once("/var/www/secure_settings/class.FlipsideSettings.php");
require_once('Autoload.php');
class DataSetFactory
{
static function get_data_set($set_name)
{
static $instances = array();
if(isset($instances[$set_name]))
{
return $instances[$set_name];
}
... | <?php
require_once("/var/www/secure_settings/class.FlipsideSettings.php");
require_once('Autoload.php');
class DataSetFactory
{
static function get_data_set($set_name)
{
static $instances = array();
if(isset($instances[$set_name]))
{
return $instances[$set_name];
}
... |
Fix syntax errors in lambda func | var https = require('https');
exports.handler = function(event, context, callback) {
// This token should live as an environmental variable set in the
// build config for Netlify.
var bearerToken = process.env.TWITTER_BEARER_TOKEN;
if (bearerToken == null) {
callback('Could not find required T... | var https = require('https');
exports.handler = function(event, context, callback) {
// This token should live as an environmental variable set in the
// build config for Netlify.
var bearerToken = process.env.TWITTER_BEARER_TOKEN;
if (bearerToken == null) {
callback('Could not find required T... |
Rename changelog types and headers | /*
* Axelor Business Solutions
*
* Copyright (C) 2005-2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distri... | /*
* Axelor Business Solutions
*
* Copyright (C) 2005-2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distri... |
Add serialization number to agent exception | /*
* Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
*
* 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
*
* Unl... | /*
* Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
*
* 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
*
* Unl... |
Use ID instead of source_blob.version | 'use strict';
let cli = require('heroku-cli-util');
let columnify = require('columnify');
module.exports = {
topic: 'builds',
needsAuth: true,
needsApp: true,
description: 'list builds',
help: 'List builds for a Heroku app',
run: cli.command(function (context, heroku) {
return heroku.request({
... | 'use strict';
let cli = require('heroku-cli-util');
let columnify = require('columnify');
module.exports = {
topic: 'builds',
needsAuth: true,
needsApp: true,
description: 'list builds',
help: 'List builds for a Heroku app',
run: cli.command(function (context, heroku) {
return heroku.request({
... |
TST: Fix pims warning test under Py3 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import pims
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performa... | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import warnings
import trackpy
import trackpy.diag
path, _ = os.path.split(os.path.abspath(__file__))
class DiagTests(unittest.TestCase):
def test_performance_report(s... |
Use click event instead of change event for checkbox list so it works in IE
svn commit r13549 | /**
* JavaScript SwatCheckboxList component
*
* @param id string Id of the matching {@link SwatCheckboxList} object.
*/
function SwatCheckboxList(id)
{
this.check_list = document.getElementsByName(id + '[]');
this.check_all = null; // a reference to a check-all js object
for (i = 0; i < this.check_list.length;... | /**
* JavaScript SwatCheckboxList component
*
* @param id string Id of the matching {@link SwatCheckboxList} object.
*/
function SwatCheckboxList(id)
{
this.check_list = document.getElementsByName(id + '[]');
this.check_all = null; // a reference to a check-all js object
for (i = 0; i < this.check_list.length;... |
Make the first word of the package description capital | from setuptools import setup, find_packages
setup(
name = "sanitize",
version = "0.33",
description = "Bringing sanitiy to world of messed-up data",
author = "Aaron Swartz",
author_email = "me@aaronsw.com",
url='http://www.aaronsw.com/2002/sanitize/',
license=open('LICENCE').read(),
classifiers... | from setuptools import setup, find_packages
setup(
name = "sanitize",
version = "0.33",
description = "bringing sanitiy to world of messed-up data",
author = "Aaron Swartz",
author_email = "me@aaronsw.com",
url='http://www.aaronsw.com/2002/sanitize/',
license=open('LICENCE').read(),
classifiers... |
Add constant name for attribute.value | /*
* Copyright 2012 Canoo Engineering AG.
*
* 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 ... | /*
* Copyright 2012 Canoo Engineering AG.
*
* 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 ... |
Fix association model with user and email | 'use strict';
var fs = require('fs');
var path = require('path');
var Sequelize = require('sequelize');
var basename = path.basename(module.filename);
var env = process.env.NODE_ENV || 'development';
if(env !== 'production') {
var config = require(__dirname + '/../config/development.json')[env];
... | 'use strict';
var fs = require('fs');
var path = require('path');
var Sequelize = require('sequelize');
var basename = path.basename(module.filename);
var env = process.env.NODE_ENV || 'development';
if(env !== 'production') {
var config = require(__dirname + '/../config/development.json')[env];
... |
Add basic example of usage | <?php namespace mitogh;
function random_image_src( $size = 'full' ){
$sources = random_images_src( $size, 1 );
$src = '';
foreach( $sources as $image_src ){
$src = $image_src;
}
return $src;
}
function random_images_src( $size = 'full', $total = 1 ){
$sources = array();
$ids = random_images_ids( $total );
... | <?php namespace mitogh;
function random_image_src( $size = 'full' ){
$sources = random_images_src( $size, 1 );
$src = '';
foreach( $sources as $image_src ){
$src = $image_src;
}
return $src;
}
function random_images_src( $size = 'full', $total = 1 ){
$sources = array();
$ids = random_images_ids( $total );
... |
Fix MODULESTATE_REPLACE bug: checked for a member literally called 'module', rather than for a member named according to the content of module. | import { routerReducer as routing } from 'react-router-redux';
import { reducer as form } from 'redux-form';
import crud from 'redux-crud'
import { combineReducers } from 'redux';
// TODO reducer registry in core via store.replaceReducer() and handle
// module state with a reducer instance for each module/key
const mo... | import { routerReducer as routing } from 'react-router-redux';
import { reducer as form } from 'redux-form';
import crud from 'redux-crud'
import { combineReducers } from 'redux';
// TODO reducer registry in core via store.replaceReducer() and handle
// module state with a reducer instance for each module/key
const mo... |
Send episode_done=True from local human agent | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""Agent does gets the loca... | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""Agent does gets the loca... |
Add test for parse;print of church terms | 'use strict';
var compiler = require('../lib/compiler');
var mocha = require('mocha');
var assert = require('../lib/assert');
var datasets = require('./lib/datasets');
mocha.suite('serialize', function () {
mocha.test('print;parse = id', function () {
var examples = [
'VAR x',
'QU... | 'use strict';
var compiler = require('../lib/compiler');
var mocha = require('mocha');
var assert = require('../lib/assert');
var datasets = require('./lib/datasets');
mocha.suite('serialize', function () {
mocha.test('print;parse = id', function () {
var examples = [
'VAR x',
'QU... |
Fix the delay for subscription and unsubscription retry | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... | from celery.task import task
@task
def subscribe(email, newsletter_list, lang=None, user=None):
from courriers.backends import get_backend
backend = get_backend()()
try:
backend.register(email=email,
newsletter_list=newsletter_list,
lang=lang,
... |
Revert "Decrease high timeout in ci"
0e16b3547b7134e032885053ddac97cb85cb7ee2 | var path = require('path');
var webpack = require('./webpack.config');
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
config.set({
basePath: '.',
frameworks: ['mocha'],
reporters: ['mocha'],
client: {
captureConsole: true,
mocha: {
... | var path = require('path');
var webpack = require('./webpack.config');
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
config.set({
basePath: '.',
frameworks: ['mocha'],
reporters: ['mocha'],
client: {
captureConsole: true,
},
files:... |
Set 10.11.0 as minimum macOS version in the .app bundle | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... |
Set a flag when config is loaded on a browser | // Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, thi... | // Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, thi... |
Use full path to api in stead of relatieve path
At this moment a relative path is used (../../../), for the cde saikuWidget. But the preview of the dashboard and the 'normal' view are on a different directory level, so one of them needs an extra ../ Fixed by using the full path /pentaho/plugin/saiku/api But this won't... | var saikuWidgetComponent = BaseComponent.extend({
update : function() {
var myself=this;
var htmlId = "#" + myself.htmlObject;
if (myself.saikuFilePath.substr(0,1) == "/") {
myself.saikuFilePath = myself.saikuFilePath.substr(1,myself.saikuFilePath.length - 1 );
}
var parameters = {};
if (myself.parame... | var saikuWidgetComponent = BaseComponent.extend({
update : function() {
var myself=this;
var htmlId = "#" + myself.htmlObject;
if (myself.saikuFilePath.substr(0,1) == "/") {
myself.saikuFilePath = myself.saikuFilePath.substr(1,myself.saikuFilePath.length - 1 );
}
var parameters = {};
if (myself.parame... |
Use the array API types for the array API type annotations | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
__all__ = ['Literal', 'Optional', 'Tuple', 'Union', '... | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
__all__ = ['Literal', 'Optional', 'Tuple', 'Union', '... |
Use singular table naming in Many To Many migration | use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class {{ucfirst($first)}}{{ucfirst($second)}} extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('{{str_singular($first)}}_{{str_singular(... | use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class {{ucfirst($first)}}{{ucfirst($second)}} extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('{{$first}}_{{$second}}',function (Bluepr... |
Use patchers for overriding data/cache directories | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
from mock import patch
temp_dir = tempfile.gettempdir()
local_data_dir_patcher = patch(
'yvs.shared.LOCAL_DATA_DIR_PATH',
os.path.join(temp_dir, 'yvs-data'))
local_cache_dir_patcher = patch(
'yvs.shared.LOCAL... | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
temp_dir = tempfile.gettempdir()
yvs.LOCAL_DATA_DIR_PATH = os.path.join(temp_dir, 'yvs-data')
yvs.LOCAL_CACHE_DIR_PATH = os.path.join(temp_dir, 'yvs-cache')
def set_up():
try:
os.mkdir(yvs.LOCAL_DATA_DIR_PA... |
Add more pypi trove classifiers | from setuptools import setup
setup(name='glreg',
version='0.9.0',
description='OpenGL XML API registry parser',
url='https://github.com/pyokagan/pyglreg',
author='Paul Tan',
author_email='pyokagan@gmail.com',
license='MIT',
classifiers=[
'Development Status :: 3 - A... | from setuptools import setup
setup(name='glreg',
version='0.9.0',
description='OpenGL XML API registry parser',
url='https://github.com/pyokagan/pyglreg',
author='Paul Tan',
author_email='pyokagan@gmail.com',
license='MIT',
classifiers=[
'Development Status :: 3 - A... |
Correct API helper scripts for getScript and getBuild | var
request = require('request'),
config = require('../../config');
exports.get = function () {
var query = arguments.length === 2 ? arguments[0] : null;
var callback = arguments[arguments.length - 1];
var options = {
uri: 'http://localhost:' + config.port + '/components',
timeout: 3000,
json: tr... | var
request = require('request'),
config = require('../../config');
exports.get = function () {
var query = arguments.length === 2 ? arguments[0] : null;
var callback = arguments[arguments.length - 1];
var options = {
uri: 'http://localhost:' + config.port + '/components',
timeout: 3000,
json: tr... |
Adjust syntax to match records | 'use strict'
const tokens = require('../database/tokens')
const KnownError = require('../utils/KnownError')
const response = (entry) => ({
id: entry.id,
created: entry.created,
updated: entry.updated
})
module.exports = {
Mutation: {
createToken: async (parent, { input }) => {
const { username, password, p... | 'use strict'
const tokens = require('../database/tokens')
const KnownError = require('../utils/KnownError')
const response = (entry) => ({
id: entry.id,
created: entry.created,
updated: entry.updated
})
module.exports = {
Mutation: {
createToken: async (parent, { input }) => {
const { username, password, p... |
Add right and bottom of area to JSON output | package technology.tabula.json;
import java.lang.reflect.Type;
import java.util.List;
import technology.tabula.RectangularTextContainer;
import technology.tabula.Table;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationCon... | package technology.tabula.json;
import java.lang.reflect.Type;
import java.util.List;
import technology.tabula.RectangularTextContainer;
import technology.tabula.Table;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationCon... |
Remove strict declaration on migration | <?php
namespace Sylius\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180102140039 extends AbstractMigration
{
public function up(Schema $schema)
{
// this up() migration is ... | <?php declare(strict_types = 1);
namespace Sylius\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180102140039 extends AbstractMigration
{
public function up(Schema $schema)
{
... |
Return json-formatted 404 for json requests on invalid routes | <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers;
class FallbackController extends Controller
{
public function __construct()
{
parent::_... | <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers;
class FallbackController extends Controller
{
public function __construct()
{
parent::_... |
Add route to list all clicks on a page | 'use strict';
var express = require('express')
, bodyParser = require('body-parser')
, mongoose = require('mongoose')
, cors = require('./cors')
, app = express();
require('./models/click');
var Click = mongoose.model('Click');
mongoose.connect('mongodb://localhost/heatmap');
app.use(bodyParser.urlencoded({e... | 'use strict';
var express = require('express')
, bodyParser = require('body-parser')
, mongoose = require('mongoose')
, cors = require('./cors')
, app = express();
require('./models/click');
var Click = mongoose.model('Click');
mongoose.connect('mongodb://localhost/heatmap');
app.use(bodyParser.urlencoded({e... |
Upgrade the Development Status classifier to stable
[skip ci] | from setuptools import setup
setup(
name='urlwait',
version='1.0',
description='A CLI utility for blocking until a service is listening',
long_description=open('README.rst').read(),
author='Paul McLanahan',
author_email='paul@mclanahan.net',
license='MIT',
py_modules=['urlwait'],
e... | from setuptools import setup
setup(
name='urlwait',
version='1.0',
description='A CLI utility for blocking until a service is listening',
long_description=open('README.rst').read(),
author='Paul McLanahan',
author_email='paul@mclanahan.net',
license='MIT',
py_modules=['urlwait'],
e... |
Bump version and eduid_common requirement | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
version = '0.1.2b3'
requires = [
'eduid-common[webapp]>=0.2.1b9',
'Flask==0.10.1',
]
test_requires = [
'WebTest==2.0.18',
'mock==1.0.1',
]
testing_extras = test_requires + [
'nose==1.2.1',
'coverage==3.6',
'no... | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
version = '0.1.2b2'
requires = [
'eduid-common[webapp]>=0.2.1b7',
'Flask==0.10.1',
]
test_requires = [
'WebTest==2.0.18',
'mock==1.0.1',
]
testing_extras = test_requires + [
'nose==1.2.1',
'coverage==3.6',
'no... |
Watch for changes in the JDL package (rebundle) | //
// See https://github.com/jenkinsci/js-builder
//
var builder = require('@jenkins-cd/js-builder');
// Disable js-builder based linting for now.
// Will get fixed with https://github.com/cloudbees/blueocean/pull/55
builder.lint('none');
// Explicitly setting the src paths in order to allow the rebundle task to
// w... | //
// See https://github.com/jenkinsci/js-builder
//
var builder = require('@jenkins-cd/js-builder');
// Disable js-builder based linting for now.
// Will get fixed with https://github.com/cloudbees/blueocean/pull/55
builder.lint('none');
// Explicitly setting the src paths in order to allow the rebundle task to
// w... |
Add space in requireEnhancedObjectLiterals error
This adds a missing space to the second } in the error message for consistency. | var assert = require('assert');
module.exports = function() { };
module.exports.prototype = {
configure: function(option) {
assert(option === true, this.getOptionName() + ' requires a true value');
},
getOptionName: function() {
return 'requireEnhancedObjectLiterals';
},
check: function(file, erro... | var assert = require('assert');
module.exports = function() { };
module.exports.prototype = {
configure: function(option) {
assert(option === true, this.getOptionName() + ' requires a true value');
},
getOptionName: function() {
return 'requireEnhancedObjectLiterals';
},
check: function(file, erro... |
Set TERM variable on shell | import OverlayRoute from 'ui/pods/overlay/route';
export default OverlayRoute.extend({
model: function() {
var container = this.modelFor('container');
var opt = {
attachStdin: true,
attachStdout: true,
tty: true,
command: ["/bin/sh","-c",'TERM=xterm-256color; export TERM; [ -x /bin/ba... | import OverlayRoute from 'ui/pods/overlay/route';
export default OverlayRoute.extend({
model: function() {
var container = this.modelFor('container');
var opt = {
attachStdin: true,
attachStdout: true,
tty: true,
command: ["/bin/sh","-c",'[ -x /bin/bash ] && exec /bin/bash || exec /bi... |
BAP-10979: Update Existing Workflows
- moved UpdateWorkflowItemFields to v1_14 | <?php
namespace Oro\Bundle\WorkflowBundle\Migrations\Schema\v1_14;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
class UpdateWorkflowItemFieldsMigration implements Migration
{
/**
* {@inheritdoc}
*/
public fu... | <?php
namespace Oro\Bundle\WorkflowBundle\Migrations\Schema;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
class UpdateWorkflowItemFieldsMigration implements Migration
{
/**
* {@inheritdoc}
*/
public function... |
Drop port from welcome page | package web
import (
"html/template"
"log"
"net/http"
"strings"
"github.com/johnmaguire/wbc/database"
)
type IndexHandler struct {
address string
database string
}
func (ih *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
id := getClient("index", r)
// Connect to database
db, err := da... | package web
import (
"html/template"
"log"
"net/http"
"github.com/johnmaguire/wbc/database"
)
type IndexHandler struct {
address string
database string
}
func (ih *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
id := getClient("index", r)
// Connect to database
db, err := database.Conn... |
Allow putting mp3 sounds in the backpack. | // eslint-disable-next-line import/no-unresolved
import soundThumbnail from '!base64-loader!./sound-thumbnail.jpg';
const soundPayload = sound => {
const assetDataUrl = sound.asset.encodeDataURI();
const assetDataFormat = sound.dataFormat;
const payload = {
type: 'sound',
name: sound.name,
... | // eslint-disable-next-line import/no-unresolved
import soundThumbnail from '!base64-loader!./sound-thumbnail.jpg';
const soundPayload = sound => {
const assetDataUrl = sound.asset.encodeDataURI();
const assetDataFormat = sound.dataFormat;
const payload = {
type: 'sound',
name: sound.name,
... |
Add support for chayns-call 52 | import * as jsonCallFunctions from './calls/index';
const jsonCalls = {
1: jsonCallFunctions.toggleWaitCursor,
2: jsonCallFunctions.selectTapp,
4: jsonCallFunctions.showPictures,
14: jsonCallFunctions.requestGeoLocation,
15: jsonCallFunctions.showVideo,
16: jsonCallFunctions.showAlert,
18:... | import * as jsonCallFunctions from './calls/index';
const jsonCalls = {
1: jsonCallFunctions.toggleWaitCursor,
2: jsonCallFunctions.selectTapp,
4: jsonCallFunctions.showPictures,
14: jsonCallFunctions.requestGeoLocation,
15: jsonCallFunctions.showVideo,
16: jsonCallFunctions.showAlert,
18:... |
Fix invalid type in JSdoc. | /**
* External dependencies
*/
import data, { TYPE_CORE } from 'GoogleComponents/data';
import { trackEvent } from 'assets/js/util/tracking';
const ACCEPTED = 'accepted';
const DISMISSED = 'dismissed';
/**
* Marks the given notification with the provided state.
*
* @param {string} id Notification ID.
* @para... | /**
* External dependencies
*/
import data, { TYPE_CORE } from 'GoogleComponents/data';
import { trackEvent } from 'assets/js/util/tracking';
const ACCEPTED = 'accepted';
const DISMISSED = 'dismissed';
/**
* Marks the given notification with the provided state.
*
* @param {string} id Notification ID.
* @param... |
Add minidump and xbe backends to extras_require | try:
from setuptools import setup
from setuptools import find_packages
packages = find_packages()
except ImportError:
from distutils.core import setup
import os
packages = [x.strip('./').replace('/','.') for x in os.popen('find -name "__init__.py" | xargs -n1 dirname').read().strip().split('\n')... | try:
from setuptools import setup
from setuptools import find_packages
packages = find_packages()
except ImportError:
from distutils.core import setup
import os
packages = [x.strip('./').replace('/','.') for x in os.popen('find -name "__init__.py" | xargs -n1 dirname').read().strip().split('\n')... |
Add build check to ensure all faces are included in lib | 'use strict';
/* Dependencies. */
var fs = require('fs');
var path = require('path');
var gemoji = require('gemoji').name;
var toJSON = require('plain-text-data-to-json');
/* Read. */
var faces = toJSON(fs.readFileSync('faces.txt', 'utf8'));
var all = [];
var unclassified = ['🤖'];
/* Manipulate. */
faces = Object.k... | 'use strict';
/* Dependencies. */
var fs = require('fs');
var path = require('path');
var gemoji = require('gemoji').name;
var toJSON = require('plain-text-data-to-json');
/* Read. */
var faces = toJSON(fs.readFileSync('faces.txt', 'utf8'));
/* Manipulate. */
faces = Object.keys(faces).sort().map(function (name) {
... |
Add comment about possible smoothScrolling in mMF | "use strict";
angular.module('arethusa.morph').directive('mirrorMorphForm', [
'morph',
'$location',
'$anchorScroll',
function(morph, $location, $anchorScroll) {
return {
restrict: 'A',
scope: {
form: '=mirrorMorphForm',
tokenId: '='
},
link: function(scope, element, ... | "use strict";
angular.module('arethusa.morph').directive('mirrorMorphForm', [
'morph',
'$location',
'$anchorScroll',
function(morph, $location, $anchorScroll) {
return {
restrict: 'A',
scope: {
form: '=mirrorMorphForm',
tokenId: '='
},
link: function(scope, element, ... |
Allow queries of names without visibility
* Fixes #224 | export class UIDatabase {
constructor(database) {
this.database = database;
}
objects(type) {
let results = this.database.objects(translateToCoreDatabaseType(type));
switch (type) {
case 'Customer':
results = results.filtered('isVisible == true AND isCustomer == true');
break;
... | export class UIDatabase {
constructor(database) {
this.database = database;
}
objects(type) {
let results = this.database.objects(translateToCoreDatabaseType(type));
switch (type) {
case 'Customer':
results = results.filtered('isVisible == true AND isCustomer == true');
break;
... |
Allow indices greater than standard array length | import fromPairs from 'lodash.frompairs';
export default class ArrayIndicesProxy {
constructor(targetArray, handler) {
const newHandler = fromPairs(Object.entries(handler).map(([name, trap]) => {
const propertyAccessTraps = ['defineProperty', 'deleteProperty', 'get', 'getOwnPropertyDescriptor', 'has', 'set... | import fromPairs from 'lodash.frompairs';
export default class ArrayIndicesProxy {
constructor(targetArray, handler) {
const newHandler = fromPairs(Object.entries(handler).map(([name, trap]) => {
const propertyAccessTraps = ['defineProperty', 'deleteProperty', 'get', 'getOwnPropertyDescriptor', 'has', 'set... |
Enable authentication for rest api | import json
from restless.dj import DjangoResource
from restless.resources import skip_prepare
from django.conf.urls import patterns, url
from harvest.models import Job
from harvest.jobstatemachine import JobStatemachine
from borg_utils.jobintervals import Triggered
class JobResource(DjangoResource):
def is_a... | import json
from restless.dj import DjangoResource
from restless.resources import skip_prepare
from django.conf.urls import patterns, url
from harvest.models import Job
from harvest.jobstatemachine import JobStatemachine
from borg_utils.jobintervals import Triggered
class JobResource(DjangoResource):
def is_a... |
Update the Migration ti have accessMask aswell | <?php
use Phinx\Migration\AbstractMigration;
class ApiKeys extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
*
* Uncomment this method if you would like to use it... | <?php
use Phinx\Migration\AbstractMigration;
class ApiKeys extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
*
* Uncomment this method if you would like to use it... |
Move docstring to appropriately placed comment | import textwrap
def test_environ(script, tmpdir):
demo = tmpdir.joinpath('warnings_demo.py')
demo.write_text(textwrap.dedent('''
from logging import basicConfig
from pip._internal.utils import deprecation
deprecation.install_warning_logger()
basicConfig()
deprecation.... | import textwrap
def test_environ(script, tmpdir):
"""$PYTHONWARNINGS was added in python2.7"""
demo = tmpdir.joinpath('warnings_demo.py')
demo.write_text(textwrap.dedent('''
from logging import basicConfig
from pip._internal.utils import deprecation
deprecation.install_warning_log... |
Add a ci gulp task | import gulp from 'gulp';
import defaults from 'lodash/defaults';
import plumber from 'gulp-plumber';
import webpack from 'webpack-stream';
import jscs from 'gulp-jscs';
import jshint from 'gulp-jshint';
import { JSXHINT as linter } from 'jshint-jsx';
import webpackPrd from './conf/webpack.prd.config';
import webpackDe... | import gulp from 'gulp';
import defaults from 'lodash/defaults';
import plumber from 'gulp-plumber';
import webpack from 'webpack-stream';
import jscs from 'gulp-jscs';
import jshint from 'gulp-jshint';
import { JSXHINT as linter } from 'jshint-jsx';
import webpackPrd from './conf/webpack.prd.config';
import webpackDe... |
Add Docstrings for class methods. | """
Name: Paul Briant
Date: 11/29/16
Class: Introduction to Python
Session: 08
Assignment: Circle Lab
Description:
Classes for Circle Lab
"""
import math
class Circle:
def __init__(self, radius):
""" Initialize circle attributes radius and diameter"""
self.radius = radius
self.diameter ... | """
Name: Paul Briant
Date: 11/29/16
Class: Introduction to Python
Session: 08
Assignment: Circle Lab
Description:
Classes for Circle Lab
"""
import math
class Circle:
def __init__(self, radius):
"""
"""
self.radius = radius
self.diameter = radius * 2
@classmethod
... |
Update Twitter test to be more robust | from unfurl import Unfurl
import unittest
class TestTwitter(unittest.TestCase):
def test_twitter(self):
""" Test a typical and a unique Twitter url """
test = Unfurl()
test.add_to_queue(
data_type='url', key=None,
value='https://twitter.com/_RyanBenson/status/109... | from unfurl import Unfurl
import unittest
class TestTwitter(unittest.TestCase):
def test_twitter(self):
""" Test a tyipcal and a unique Discord url """
# unit test for a unique Discord url.
test = Unfurl()
test.add_to_queue(data_type='url', key=None,
value='h... |
Revert "adding slot_index to impression_stats_daily"
This reverts commit 71202d2f9e2cafa5bf8ef9e0c6a355a8d65d5c7a. | import os
class DefaultConfig(object):
"""
Configuration suitable for use for development
"""
DEBUG = True
APPLICATION_ROOT = None
JSONIFY_PRETTYPRINT_REGULAR = True
STATIC_ENABLED_ENVS = {"dev", "test"}
ENVIRONMENT = "dev"
SECRET_KEY = "moz-splice-development-key"
TEMPLATE_... | import os
class DefaultConfig(object):
"""
Configuration suitable for use for development
"""
DEBUG = True
APPLICATION_ROOT = None
JSONIFY_PRETTYPRINT_REGULAR = True
STATIC_ENABLED_ENVS = {"dev", "test"}
ENVIRONMENT = "dev"
SECRET_KEY = "moz-splice-development-key"
TEMPLATE_... |
Add chech for short passwords | from flask import Flask, jsonify, request
from modals.modals import User, Bucket, Item
from api import create_app, db
from validate_email import validate_email
app = create_app('DevelopmentEnv')
@app.route('/')
def index():
response = jsonify({'Welcome Message': 'Hello'})
response.status_code = 201
retur... | from flask import Flask, jsonify, request
from modals.modals import User, Bucket, Item
from api import create_app, db
from validate_email import validate_email
app = create_app('DevelopmentEnv')
@app.route('/')
def index():
response = jsonify({'Welcome Message': 'Hello'})
response.status_code = 201
return... |
PUT para atualizar o recurso Livro | package com.fabiohideki.socialbooks.resources;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
i... | package com.fabiohideki.socialbooks.resources;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
i... |
Add assertion message to acceptance tests | import Ember from 'ember';
import { test } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
const { $ } = Ember;
// Original images sizes (from AJAX Content-Length header)
const uncompressedSizes = {
'jpg': 35863,
'png': 11795,
'svg': 4619
};
moduleForAcceptance('Accep... | import Ember from 'ember';
import { test } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
const { $ } = Ember;
// Original images sizes (from AJAX Content-Length header)
const uncompressedSizes = {
'jpg': 35863,
'png': 11795,
'svg': 4619
};
moduleForAcceptance('Accep... |
Adjust pending survey table query | <?php
namespace App\Http\Livewire;
use App\Models\TestDate;
use Illuminate\Database\Eloquent\Builder;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
class PendingSurveysTable extends DataTableComponent
{
public string $defaultSortColumn = 'test_date';
... | <?php
namespace App\Http\Livewire;
use App\Models\TestDate;
use Illuminate\Database\Eloquent\Builder;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
class PendingSurveysTable extends DataTableComponent
{
public string $defaultSortColumn = 'test_date';
... |
Change custom data type to Map<String, Object> | package com.stormpath.sdk.models;
import com.squareup.moshi.Json;
import java.io.Serializable;
import java.util.Map;
public class UserProfile implements Serializable {
@Json(name = "email")
private String email;
@Json(name = "givenName")
private String givenName;
@Json(name = "middleName")
... | package com.stormpath.sdk.models;
import com.squareup.moshi.Json;
import java.io.Serializable;
import java.util.Map;
public class UserProfile implements Serializable {
@Json(name = "email")
private String email;
@Json(name = "givenName")
private String givenName;
@Json(name = "middleName")
... |
Add ESLint rule for space-before-function-paren | module.exports = {
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"browser": false,
"node": true,
"commonjs": true,
"es6": true,
"mocha": true
},
"extends": "eslint:recommended",
"rules": {
"no-console": 0,
"indent": [
... | module.exports = {
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"browser": false,
"node": true,
"commonjs": true,
"es6": true,
"mocha": true
},
"extends": "eslint:recommended",
"rules": {
"no-console": 0,
"indent": [
... |
Fix the issue as OnInit is no longer a pointer | package mongo
import (
"errors"
"fmt"
"golang.org/x/net/context"
"github.com/rs/rest-layer/schema"
"gopkg.in/mgo.v2/bson"
)
var (
// NewObjectID is a field hook handler that generates a new Mongo ObjectID hex if
// value is nil to be used in schema with OnInit.
NewObjectID = func(ctx context.Context, value ... | package mongo
import (
"errors"
"fmt"
"golang.org/x/net/context"
"github.com/rs/rest-layer/schema"
"gopkg.in/mgo.v2/bson"
)
var (
// NewObjectID is a field hook handler that generates a new Mongo ObjectID hex if
// value is nil to be used in schema with OnInit.
NewObjectID = func(ctx context.Context, value ... |
Fix typo breaking the TS6 feature. | from merc import errors
from merc import feature
from merc import message
from merc import util
class SidFeature(feature.Feature):
NAME = __name__
install = SidFeature.install
@SidFeature.register_server_command
class Sid(message.Command):
NAME = "SID"
MIN_ARITY = 4
def __init__(self, server_name, hopcou... | from merc import errors
from merc import feature
from merc import message
from merc import util
class SidFeature(feature.Feature):
NAME = __name__
install = SidFeature.install
@SidFeature.register_server_command
class Sid(message.Command):
NAME = "SID"
MIN_ARITY = 4
def __init__(self, server_name, hopcou... |
Fix silly bug where non-empty argument lists didn't work. | /* © 2012 David Given
* This file is made available under the terms of the two-clause BSD
* license. See the file COPYING in the distribution directory for the
* full license text.
*/
package com.cowlark.cowbel.parser.parsers;
import com.cowlark.cowbel.parser.core.Location;
import com.cowlark.cowbel.parser.core.P... | /* © 2012 David Given
* This file is made available under the terms of the two-clause BSD
* license. See the file COPYING in the distribution directory for the
* full license text.
*/
package com.cowlark.cowbel.parser.parsers;
import com.cowlark.cowbel.parser.core.Location;
import com.cowlark.cowbel.parser.core.P... |
Fix paste event for IE | import lists from '../core/lists';
export default class Clipboard {
constructor(context) {
this.context = context;
this.$editable = context.layoutInfo.editable;
}
initialize() {
this.$editable.on('paste', this.pasteByEvent.bind(this));
}
/**
* paste by clipboard event
*
* @param {Event... | import lists from '../core/lists';
export default class Clipboard {
constructor(context) {
this.context = context;
this.$editable = context.layoutInfo.editable;
}
initialize() {
this.$editable.on('paste', this.pasteByEvent.bind(this));
}
/**
* paste by clipboard event
*
* @param {Event... |
nir: Remove spurious ; after nir_builder functions.
Makes -pedantic happy.
Reviewed-by: Connor Abbott <71178acffcc112b21e5858656e5751f5e4aa9364@gmail.com> | #! /usr/bin/env python
template = """\
/* Copyright (C) 2015 Broadcom
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to... | #! /usr/bin/env python
template = """\
/* Copyright (C) 2015 Broadcom
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to... |
Fix little glitch in project list when there is no icon | <div class="table-list-icons">
<?php if ($project['is_public']): ?>
<i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i>
<?php endif ?>
<?php if ($project['is_private']): ?>
<i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i>
<?php endif ... | <div class="table-list-icons">
<?php if ($project['is_public']): ?>
<i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i>
<?php endif ?>
<?php if ($project['is_private']): ?>
<i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i>
<?php endif ?>
<?ph... |
Set no embed-codes option for multi-page-test-project |
var gulp = require('gulp');
var defs = [
{
title: 'Test Index Title',
path: '',
description: 'Test index description',
twitterImage: '20euro.png',
openGraphImage: '50euro.png',
schemaImage: '100euro.png'
},
{
path: '/subpage',
title: 'Test Subpage Title',
description: 'Test s... |
var gulp = require('gulp');
var defs = [
{
title: 'Test Index Title',
path: '',
description: 'Test index description',
twitterImage: '20euro.png',
openGraphImage: '50euro.png',
schemaImage: '100euro.png'
},
{
path: '/subpage',
title: 'Test Subpage Title',
description: 'Test s... |
Add validation to logout request | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Vincent Zhang/PhoenixLAB
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u... | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Vincent Zhang/PhoenixLAB
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u... |
Revert to string based class name because of PHP 5.4 support | <?php
/*
* This file is part of the Indigo Guardian package.
*
* (c) Indigo Development Team
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Indigo\Guardian\Authenticator;
use BeatSwitch\Lock\Callers\Caller;
use Assert... | <?php
/*
* This file is part of the Indigo Guardian package.
*
* (c) Indigo Development Team
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Indigo\Guardian\Authenticator;
use BeatSwitch\Lock\Callers\Caller;
use Indigo... |
Use correct fields for address formatting | <?php
namespace HbgEventImporter;
class Location extends \HbgEventImporter\Entity\PostManager
{
public $post_type = 'location';
public function afterSave()
{
$res = Helper\Address::gmapsGetAddressComponents($this->postal_address . ' ' . $this->postal_code . ' ' . $this->city . ' ' . $this->countr... | <?php
namespace HbgEventImporter;
class Location extends \HbgEventImporter\Entity\PostManager
{
public $post_type = 'location';
public function afterSave()
{
$res = Helper\Address::gmapsGetAddressComponents($this->postalAddress . ' ' . $this->postcode . ' ' . $this->city . ' ' . $this->country);
... |
Add tray minimize, restore and quit | import path from 'path';
import os from 'os';
import { Tray, Menu } from 'electron';
export default function buildTray(win) {
const PLATFORM = os.platform();
let icon;
if (process.env.NODE_ENV === 'development') {
icon = PLATFORM === 'darwin' || PLATFORM === 'linux'
? path.join(__dirname, '../../asset... | import path from 'path';
import os from 'os';
import { Tray } from 'electron';
export default function buildTray(win) {
const PLATFORM = os.platform();
let icon;
if (process.env.NODE_ENV === 'development') {
icon = PLATFORM === 'darwin' || PLATFORM === 'linux'
? path.join(__dirname, '../../assets/imag... |
Make op address and child addresses mutable | package org.cf.smalivm.opcode;
import org.cf.smalivm.SideEffect;
public abstract class Op {
private int address;
private int[] childAddresses;
private final String opName;
Op(int address, String opName, int childAddress) {
this(address, opName, new int[] { childAddress });
}
Op(int ... | package org.cf.smalivm.opcode;
import org.cf.smalivm.SideEffect;
public abstract class Op {
private final int address;
private final int[] childAddresses;
private final String opName;
Op(int address, String opName, int childAddress) {
this(address, opName, new int[] { childAddress });
}
... |
Add error handling to user events | var express = require('express');
var DataStore = require('./regard-data-store.js');
var router = express.Router();
var dataStore = new DataStore('regard', 'website');
router.get('/userevents/:id', function (req, res, next) {
var id = req.params.id;
dataStore.getEventsForUser(id).then(function (events) ... | var express = require('express');
var DataStore = require('./regard-data-store.js');
var router = express.Router();
var dataStore = new DataStore('regard', 'website');
router.get('/userevents/:id', function (req, res, next) {
var id = req.params.id;
dataStore.getEventsForUser(id).then(function (events) ... |
Fix 'put is not a command' error on static commands | """List drivers and send them commands."""
import logging
import flask
from appengine import device, rest
class Query(object):
def iter(self):
for name, cls in device.DEVICE_TYPES.iteritems():
yield Driver(name, cls)
class Driver(object):
"""This is a fake for compatibility with the rest module"""
... | """List drivers and send them commands."""
import logging
import flask
from appengine import device, rest
class Query(object):
def iter(self):
for name, cls in device.DEVICE_TYPES.iteritems():
yield Driver(name, cls)
class Driver(object):
"""This is a fake for compatibility with the rest module"""
... |
Update for new jar and dynamic demo | <?php
require_once "../StyleJS/json/JSON.php";
$json = new Services_JSON();
$url1 = $_GET["url1"];
$url2 = $_GET["url2"];
$type = $_GET["type"];
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pipe that the child ... | <?php
$url1 = $_GET["url1"];
$url2 = $_GET["url2"];
$type = $_GET["type"];
$pagelyze="DISPLAY=:98 java -jar /var/lib/pagelyzer/jPagelyzer.jar -get score -cmode ";
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.