text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Remove webpack bundle analyzer for netlify deploy | const path = require('path');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = env => ({
context: __dirname,
entry: './src/index.js',
devtool: env.prod ? 'cheap-module-source-map' : 'eval',
output: {
path: path.join(__dirname, '/dist'),
filename: 'b... | const path = require('path');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = env => ({
context: __dirname,
entry: './src/index.js',
devtool: env.prod ? 'cheap-module-source-map' : 'eval',
output: {
path: path.join(__dirname, '/dist'),
filename: 'b... |
Fix the reload when adding and option
Oh JavaScript.
How do I hate thee? Let me count the ways.
We now pas a function:
$scope.notifyOptionAdded
rather than a function call
$scope.notifyOptionAdded()
so that promises work, rather than running synchronously. | /// <reference path="../Services/VoteService.js" />
'use strict';
(function () {
angular
.module('GVA.Voting')
.controller('AddVoterOptionDialogController', AddVoterOptionDialogController);
AddVoterOptionDialogController.$inject = ['$scope', 'VoteService'];
function AddVoterOptionDialogC... | /// <reference path="../Services/VoteService.js" />
'use strict';
(function () {
angular
.module('GVA.Voting')
.controller('AddVoterOptionDialogController', AddVoterOptionDialogController);
AddVoterOptionDialogController.$inject = ['$scope', 'VoteService'];
function AddVoterOptionDialogC... |
Stop mixing extension configuration and context options | <?php
namespace sablonier\carousel;
use Bolt\Extension\SimpleExtension;
class CarouselExtension extends SimpleExtension
{
/**
* {@inheritdoc}
*/
protected function registerTwigFunctions()
{
return [
'carousel' => ['carouselFunction']
];
}
/**
* {@in... | <?php
namespace sablonier\carousel;
use Bolt\Extension\SimpleExtension;
class CarouselExtension extends SimpleExtension
{
/**
* {@inheritdoc}
*/
protected function registerTwigFunctions()
{
return [
'carousel' => ['carouselFunction']
];
}
/**
* {@in... |
Check an extra possible data dir when installing in a venv
When installing spec-cleaner in a virtual env, the data files
(i.e. "excludes-bracketing.txt") are available in a different
directory. Also check this directory.
Fixes #128 | # vim: set ts=4 sw=4 et: coding=UTF-8
import os
from .rpmexception import RpmException
class FileUtils(object):
"""
Class working with file operations.
Read/write..
"""
# file variable
f = None
def open_datafile(self, name):
"""
Function to open data files.
Use... | # vim: set ts=4 sw=4 et: coding=UTF-8
import os
from .rpmexception import RpmException
class FileUtils(object):
"""
Class working with file operations.
Read/write..
"""
# file variable
f = None
def open_datafile(self, name):
"""
Function to open data files.
Use... |
Add some protection against a failed load of Multiverse | package com.elmakers.mine.bukkit.protection;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.buk... | package com.elmakers.mine.bukkit.protection;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class MultiverseManager implements PVPManager {
private boolean enabled = false;
pr... |
Clone only valid react element | import React, {
PureComponent,
createElement,
Children,
cloneElement,
isValidElement
} from 'react';
import PropTypes from 'prop-types';
import eventManager from './../util/eventManager';
class ContextMenuProvider extends PureComponent {
static propTypes = {
id: PropTypes.oneOfType([
PropTypes.s... | import React, {
PureComponent,
createElement,
Children,
cloneElement
} from 'react';
import PropTypes from 'prop-types';
import eventManager from './../util/eventManager';
class ContextMenuProvider extends PureComponent {
static propTypes = {
id: PropTypes.oneOfType([
PropTypes.string,
PropT... |
Use redis pipelining when sending events | import datetime
import redis
import time
import urlparse
import beaver.transport
class RedisTransport(beaver.transport.Transport):
def __init__(self, beaver_config, file_config, logger=None):
super(RedisTransport, self).__init__(beaver_config, file_config, logger=logger)
redis_url = beaver_conf... | import datetime
import redis
import time
import urlparse
import beaver.transport
class RedisTransport(beaver.transport.Transport):
def __init__(self, beaver_config, file_config, logger=None):
super(RedisTransport, self).__init__(beaver_config, file_config, logger=logger)
redis_url = beaver_conf... |
Fix the configuration property access | <?php
namespace PHPYAM\extra;
use PHPYAM\core\interfaces\IConfiguration;
/**
* TODO comment.
*
* @package PHPYAM\extra
* @author Thierry BLIND
* @since 01/04/2022
* @copyright 2014-2022 Thierry BLIND
*/
class Configuration implements IConfiguration
{
/**
*
* {@inheritdoc}
... | <?php
namespace PHPYAM\extra;
use PHPYAM\core\interfaces\IConfiguration;
/**
* TODO comment.
*
* @package PHPYAM\extra
* @author Thierry BLIND
* @since 01/04/2022
* @copyright 2014-2022 Thierry BLIND
*/
class Configuration implements IConfiguration
{
/**
*
* {@inheritdoc}
... |
Fix error handling to catch if JSON is not returned | import six
class APIError(Exception):
"SmartFile API base Exception."
pass
class RequestError(APIError):
""" Exception for issues regarding a request. """
def __init__(self, exc, *args, **kwargs):
self.exc = exc
self.detail = str(exc)
super(RequestError, self).__init__(*args,... | import six
class APIError(Exception):
"SmartFile API base Exception."
pass
class RequestError(APIError):
""" Exception for issues regarding a request. """
def __init__(self, exc, *args, **kwargs):
self.exc = exc
self.detail = str(exc)
super(RequestError, self).__init__(*args,... |
Add setters for limited motor | package com.thegongoliers.output.motors;
import com.thegongoliers.annotations.Untested;
import java.util.function.BooleanSupplier;
@Untested
public class LimiterMotorModule implements MotorModule {
private BooleanSupplier mPositiveLimit;
private BooleanSupplier mNegativeLimit;
public LimiterMotorModule... | package com.thegongoliers.output.motors;
import com.thegongoliers.annotations.Untested;
import java.util.function.BooleanSupplier;
@Untested
public class LimiterMotorModule implements MotorModule {
private BooleanSupplier mPositiveLimit;
private BooleanSupplier mNegativeLimit;
public LimiterMotorModule... |
Add previous exception to DeleteHandlingException | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Doctrine\ORM\Handler;
use Doctrine\ORM\E... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Doctrine\ORM\Handler;
use Doctrine\ORM\E... |
Add a todo in a test | package org.twig.extension;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CoreTests {
@Test
public void canEnsureIterableOnIterable() {
Iterable<String> list = new ArrayList<>();
Iterable<String> ensure... | package org.twig.extension;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CoreTests {
@Test
public void canEnsureIterableOnIterable() {
Iterable<String> list = new ArrayList<>();
Iterable<String> ensure... |
Increase timeout for elm tests. | var expect = require('chai').expect;
var count = require('count-substring');
var htmlToText = require('html-to-text');
module.exports = function (browser) {
describe("The tests written in Elm", function () {
it('should pass', function () {
return browser
.url('http://localhost:8... | var expect = require('chai').expect;
var count = require('count-substring');
var htmlToText = require('html-to-text');
module.exports = function (browser) {
describe("The tests written in Elm", function () {
it('should pass', function () {
return browser
.url('http://localhost:8... |
Augment unit test for show_hist | import openpnm as op
class GenericGeometryTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[3, 3, 3])
self.geo = op.geometry.StickAndBall(network=self.net,
pores=self.net.Ps,
throats=self.net.Ts)... | import openpnm as op
class GenericGeometryTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[3, 3, 3])
self.geo = op.geometry.StickAndBall(network=self.net,
pores=self.net.Ps,
throats=self.net.Ts)... |
Create returns object as well | /**
* Created by Itay Herskovits on 2/1/15.
*/
(function () {
angular.module('mytodoApp')
.service('TodoService', ['$http', 'Backand', 'AuthService', TodoService]);
function TodoService($http, Backand, AuthService) {
var self = this;
var objectName = 'todo';
self.readAll =... | /**
* Created by Itay Herskovits on 2/1/15.
*/
(function () {
angular.module('mytodoApp')
.service('TodoService', ['$http', 'Backand', 'AuthService', TodoService]);
function TodoService($http, Backand, AuthService) {
var self = this;
var objectName = 'todo';
self.readAll =... |
Fix mismatched args in CMake.build | import os
from buildtools.bt_logging import log
from buildtools.os_utils import cmd, ENV
class CMake(object):
def __init__(self):
self.flags = {}
self.generator = None
def setFlag(self, key, val):
log.info('CMake: {} = {}'.format(key, val))
self.flags[key] = val
... | import os
from buildtools.bt_logging import log
from buildtools.os_utils import cmd, ENV
class CMake(object):
def __init__(self):
self.flags = {}
self.generator = None
def setFlag(self, key, val):
log.info('CMake: {} = {}'.format(key, val))
self.flags[key] = val
... |
Handle 2 digit year DOBs | (function() {
'use strict';
angular
.module('core.formData')
.factory('FormDataService', FormDataService);
FormDataService.$inject = ['$sessionStorage', '_'];
/* @ngInject */
function FormDataService($sessionStorage, _) {
var formData = $sessionStorage.formData || {};
var service = {
... | (function() {
'use strict';
angular
.module('core.formData')
.factory('FormDataService', FormDataService);
FormDataService.$inject = ['$sessionStorage', '_'];
/* @ngInject */
function FormDataService($sessionStorage, _) {
var formData = $sessionStorage.formData || {};
var service = {
... |
Add DASH to Coinbase ticker | const _ = require('lodash/fp')
const axios = require('axios')
const BN = require('../../../bn')
function getBuyPrice (obj) {
const currencyPair = obj.currencyPair
return axios({
method: 'get',
url: `https://api.coinbase.com/v2/prices/${currencyPair}/buy`,
headers: {'CB-Version': '2017-07-10'}
})
... | const _ = require('lodash/fp')
const axios = require('axios')
const BN = require('../../../bn')
function getBuyPrice (obj) {
const currencyPair = obj.currencyPair
return axios({
method: 'get',
url: `https://api.coinbase.com/v2/prices/${currencyPair}/buy`,
headers: {'CB-Version': '2017-07-10'}
})
... |
Use a list for main elements | from urllib.request import Request, urlopen
from .renderers import XMLRenderer
class Client:
def __init__(self, hostname, auth_info):
self.base_url = 'http://{}/MRWEnvio.asmx'.format(hostname)
self.auth_info = auth_info
self.renderer = XMLRenderer()
def make_http_request(self, pickup... | from urllib.request import Request, urlopen
from .renderers import XMLRenderer
class Client:
def __init__(self, hostname, auth_info):
self.base_url = 'http://{}/MRWEnvio.asmx'.format(hostname)
self.auth_info = auth_info
self.renderer = XMLRenderer()
def make_http_request(self, pickup... |
Fix prod'n webpack conf for linked deps | var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var path = require("path");
module.exports = {
context: __dirname,
entry: [
'./ditto/static/chat/js/base.js',
],
output: {
path: path.resolve('./ditto/static/dist'),
publicPath: '/... | var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var path = require("path");
module.exports = {
context: __dirname,
entry: [
'./ditto/static/chat/js/base.js',
],
output: {
path: path.resolve('./ditto/static/dist'),
publicPath: '/... |
Remove test button from dashboard | @extends('mconsole::app')
@section('content')
<div class="row">
<div class="col-xs-12">
<div class="portlet light">
<div class="portlet-title">
<div class="caption">
<i class="icon-bulb font-dark"></i>
<span cla... | @extends('mconsole::app')
@section('content')
<div class="btn red btn-outline">TEST</div>
<div class="row">
<div class="col-xs-12">
<div class="portlet light">
<div class="portlet-title">
<div class="caption">
<i class="icon-b... |
Add a comment on HAR encoding. | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... | #!/usr/bin/env python
import datetime
import json
import logging
import urllib2
class HarManager(object):
def __init__(self, args):
self._logger = logging.getLogger('kcaa.proxy_util')
self.pageref = 1
proxy_root = 'http://{}/proxy/{}'.format(args.proxy_controller,
... |
Add stealth address to scope. | define(['./module', 'darkwallet'], function (controllers, DarkWallet) {
'use strict';
controllers.controller('ReceiveStealthCtrl', ['$scope', 'notify', function($scope, notify) {
// function to receive stealth information
$scope.receiveStealth = function() {
notify.note("stealth", "initializing");
n... | define(['./module', 'darkwallet'], function (controllers, DarkWallet) {
'use strict';
controllers.controller('ReceiveStealthCtrl', ['$scope', 'notify', function($scope, notify) {
// function to receive stealth information
$scope.receiveStealth = function() {
notify.note("stealth", "initializing");
n... |
Add tests folder to lint task | 'use strict';
var path = require('path');
var argv = require('yargs').default('browser', true).argv;
var pkg = require('../package.json');
var dest = 'build';
var src = 'src';
var tests = 'tests';
var ENVIRONMENT = argv.env || process.env.env || 'development';
var APP_NAME = pkg.name;
module.exports = {
environmen... | 'use strict';
var path = require('path');
var argv = require('yargs').default('browser', true).argv;
var pkg = require('../package.json');
var dest = 'build';
var src = 'src';
var ENVIRONMENT = argv.env || process.env.env || 'development';
var APP_NAME = pkg.name;
module.exports = {
environment: ENVIRONMENT,
lic... |
Set mongo id in database after command was consumed | <?php
namespace Command;
use Database\Connect;
use Config\Config;
use Database\Query;
class setData
{
/**
* setData constructor.
*
* @param \Aura\Web\Request $request
* @param \Aura\Web\Response $response
* @param \Aura\View\View $view
*/
public function __construct($request, $r... | <?php
namespace Command;
use Database\Connect;
use Config\Config;
use Database\Query;
class setData
{
/**
* setData constructor.
*
* @param \Aura\Web\Request $request
* @param \Aura\Web\Response $response
* @param \Aura\View\View $view
*/
public function __construct($request, $r... |
Change from planning to in beta | import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info <= (2, 4):
error = 'Requires Python Version 2.5 or above... exiting.'
print >> sys.stderr, error
sys.exit(1)
requirements = [
'requests',
]
setup(name='googlemaps',
version='2... | import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info <= (2, 4):
error = 'Requires Python Version 2.5 or above... exiting.'
print >> sys.stderr, error
sys.exit(1)
requirements = [
'requests',
]
setup(name='googlemaps',
version='2... |
Fix login with active dominion not being redirect to status screen | <?php
namespace OpenDominion\Http\Controllers\Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use OpenDominion\Http\Controllers\AbstractController;
use OpenDominion\Models\User;
use OpenDominion\Services\AnalyticsService;
use OpenDominion\Services\DominionSelectorService;
class ... | <?php
namespace OpenDominion\Http\Controllers\Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use OpenDominion\Http\Controllers\AbstractController;
use OpenDominion\Models\User;
use OpenDominion\Services\AnalyticsService;
use OpenDominion\Services\DominionSelectorService;
class ... |
Check for known file extensions |
require(['ByteSource', 'AppleVolume'], function(ByteSource, AppleVolume) {
'use strict';
function makeFileDrop(el, callback) {
if (typeof el === 'string') {
el = document.getElementById(el);
if (!el) {
console.error('filedrop element not found');
return;
}
el.addEv... |
require(['ByteSource', 'AppleVolume'], function(ByteSource, AppleVolume) {
'use strict';
function makeFileDrop(el, callback) {
if (typeof el === 'string') {
el = document.getElementById(el);
if (!el) {
console.error('filedrop element not found');
return;
}
el.addEv... |
parity-client: Simplify command name length calculation | package com.paritytrading.parity.client.command;
import com.paritytrading.parity.client.TerminalClient;
import java.util.Scanner;
class HelpCommand implements Command {
@Override
public void execute(TerminalClient client, Scanner arguments) throws CommandException {
if (arguments.hasNext()) {
... | package com.paritytrading.parity.client.command;
import com.paritytrading.parity.client.TerminalClient;
import java.util.Scanner;
class HelpCommand implements Command {
@Override
public void execute(TerminalClient client, Scanner arguments) throws CommandException {
if (arguments.hasNext()) {
... |
Make sure the app menu state is set | (function () {
'use strict';
function EditorMenuDirective($injector, treeService, navigationService, umbModelMapper, appState) {
function link(scope, el, attr, ctrl) {
scope.dropdown = {
isOpen: false
};
function onInit() {
getOpti... | (function () {
'use strict';
function EditorMenuDirective($injector, treeService, navigationService, umbModelMapper, appState) {
function link(scope, el, attr, ctrl) {
scope.dropdown = {
isOpen: false
};
function onInit() {
getOpti... |
Use more sane numbers for initial data | from orbit import satellite
from django.core.management.base import BaseCommand
from base.tests import ObservationFactory, StationFactory
from base.models import Satellite
class Command(BaseCommand):
help = 'Create initial fixtures'
def handle(self, *args, **options):
ObservationFactory.create_batc... | from orbit import satellite
from django.core.management.base import BaseCommand
from base.tests import ObservationFactory, StationFactory
from base.models import Satellite
class Command(BaseCommand):
help = 'Create initial fixtures'
def handle(self, *args, **options):
ObservationFactory.create_batc... |
Fix window size before running tests
To make tests as repeatable as possible. | const wd = require('wd');
const Promise = require('bluebird');
const browser = require('./browser');
const normalise = require('./normalise-logs');
function test (opts) {
return function () {
return Promise.using(browser(opts.browser), (session) => {
return session
.setWindowSize(1024, 768)
... | const wd = require('wd');
const Promise = require('bluebird');
const browser = require('./browser');
const normalise = require('./normalise-logs');
function test (opts) {
return function () {
return Promise.using(browser(opts.browser), (session) => {
return session
.get(opts.url)
.then(() =... |
Test added for retrieval under views-expired scenario. | <?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Faker\Generator;
use Rhumsaa\Uuid\Uuid;
class SecretTest extends TestCase
{
use DatabaseTransactions;
/**
* Test secret creation.... | <?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Faker\Generator;
use Rhumsaa\Uuid\Uuid;
class SecretTest extends TestCase
{
use DatabaseTransactions;
/**
* Test secret creation.... |
Add project run to project result. | from __future__ import absolute_import
import logging
import traceback
from celery import shared_task
from celery.utils.log import get_task_logger
from datastore.models import ProjectRun
logger = get_task_logger(__name__)
@shared_task
def execute_project_run(project_run_pk):
try:
project_run = Projec... | from __future__ import absolute_import
import logging
import traceback
from celery import shared_task
from celery.utils.log import get_task_logger
from datastore.models import ProjectRun
logger = get_task_logger(__name__)
@shared_task
def execute_project_run(project_run_pk):
try:
project_run = Projec... |
Add @xstate/graph to changeset-managed packages | const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.... | const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.... |
Use __dirname when setting the root | // require Johnny's static
var JohhnysStatic = require("../index")
// require http
, http = require('http');
// set static server: public folder
JohhnysStatic.setStaticServer({root: __dirname + "/public"});
// set routes
JohhnysStatic.setRoutes({
"/": { "url": "/html/index.html" }
, "/test1/": { "u... | // require Johnny's static
var JohhnysStatic = require("../index")
// require http
, http = require('http');
// set static server: public folder
JohhnysStatic.setStaticServer({root: "./public"});
// set routes
JohhnysStatic.setRoutes({
"/": { "url": __dirname + "/html/index.html" }
, "/test1/": { "... |
Fix React error from missing keys | import React from "react";
import { GraphManager } from "./index";
export default class AbstractGraph extends React.Component {
constructor(props) {
super(props);
let properties;
try {
// TODO: Make sure the name is not going to change in the build
properties = ... | import React from "react";
import { GraphManager } from "./index";
export default class AbstractGraph extends React.Component {
constructor(props) {
super(props);
let properties;
try {
// TODO: Make sure the name is not going to change in the build
properties = ... |
Change location of static files on server | from fabric.api import local, env, sudo
env.hosts = ['nkhumphreys.co.uk']
env.user = 'root'
NAME = "gobananas"
def deploy():
base_cmd = "scp -r {local_path} root@{host}:{remote_path}"
remote_path = "/tmp"
template_path = "/var/www/templates/"
static_path = "/var/www/nkhumphreys/assets/static/"
... | from fabric.api import local, env, sudo
env.hosts = ['nkhumphreys.co.uk']
env.user = 'root'
NAME = "gobananas"
def deploy():
base_cmd = "scp -r {local_path} root@{host}:{remote_path}"
remote_path = "/tmp"
template_path = "/var/www/templates/"
static_path = "/var/www/static/"
for h in env.hosts... |
Remove unneeded noParse build rules | 'use strict';
const path = require('path');
const loaders = require('./webpack/loaders');
const plugins = require('./webpack/plugins');
module.exports = {
entry: {
app: './src/index.ts',
// and vendor files separate
vendor: [
'@angular/core',
'@angular/compiler',
'@angular/common',
... | 'use strict';
const path = require('path');
const loaders = require('./webpack/loaders');
const plugins = require('./webpack/plugins');
module.exports = {
entry: {
app: './src/index.ts',
// and vendor files separate
vendor: [
'@angular/core',
'@angular/compiler',
'@angular/common',
... |
Fix Direct parser's token separator
The idea is to support tabs as a separator, besides spaces. | package pt.ist.rc.paragraph.loader.direct;
import pt.ist.rc.paragraph.model.Graph;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.function.Function;
public class DirectLoader<VV, EV> {
private final Reader r;
private final Function<String, VV> loadVertexDat... | package pt.ist.rc.paragraph.loader.direct;
import pt.ist.rc.paragraph.model.Graph;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.function.Function;
public class DirectLoader<VV, EV> {
private final Reader r;
private final Function<String, VV> loadVertexDat... |
Fix form validator (lot cleaner) | ////////////////////////////
// Form Validator factory //
////////////////////////////
'use strict';
pay.factory('FormValidator', [function () {
return function (form, imageSelector, imageValidator) {
var formValid = true;
// Image validation
if (typeof imageValidator !== 'und... | ////////////////////////////
// Form Validator factory //
////////////////////////////
'use strict';
pay.factory('FormValidator', [function () {
return function (form, imageSelector, imageValidator) {
// If we end directly the function, all errors may be not thrown
var formValid = true;
... |
Set stage to maximized screen | package GUI;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
public class App extends Appli... | package GUI;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
public class App extends Appli... |
Stop doing an excessive amount of work in `diffusion.rawdiffquery`
Ref T11665.
Without `-n 1`, this logs the ENTIRE history of the repository. We
actually get the right result, but this is egregiously slow. Add `-n 1`
to return only one result.
It appears that I wrote this wrong way back in 2011, in D953. This
query... | <?php
final class DiffusionGitRawDiffQuery extends DiffusionRawDiffQuery {
protected function newQueryFuture() {
$drequest = $this->getRequest();
$repository = $drequest->getRepository();
$commit = $this->getAnchorCommit();
$options = array(
'-M',
'-C',
'--no-ext-diff',
'--... | <?php
final class DiffusionGitRawDiffQuery extends DiffusionRawDiffQuery {
protected function newQueryFuture() {
$drequest = $this->getRequest();
$repository = $drequest->getRepository();
$commit = $this->getAnchorCommit();
$options = array(
'-M',
'-C',
'--no-ext-diff',
'--... |
KiwiShell: Insert sleep when waiting user input | /*
* Expand Eeadline object
*/
Readline.inputLine = function(){
let line = null ;
while(line == null){
line = Readline.input() ;
sleep(0.1) ;
}
console.print("\n") ; // insert newline after the input
return line ;
}
Readline.inputInteger = function() {
let result = null ;
while(result == null){
let line... | /*
* Expand Eeadline object
*/
Readline.inputLine = function(){
let line = null ;
while(line == null){
line = Readline.input() ;
}
console.print("\n") ; // insert newline after the input
return line ;
}
Readline.inputInteger = function() {
let result = null ;
while(result == null){
let line = Readline.inp... |
Fix apidoc to allow `npm install` to complete | module.exports = function(app) {
/**
* @apiGroup buildings
* @apiName Show list of buildings
* @apiVersion 3.0.0
* @api {get} buildings Show list of available buildings
* @apiSuccess {[]} buildings List of buildings
* @apiError InternalServerError
*/
app.get('/api/v3/... | module.exports = function(app) {
/**
* @apiGroup buildings
* @apiName Show list of buildings
* @apiVersion 3.0.0
* @api {get} buildings Show list of available buildings
* @apiSuccess {[]} buildings List of buildings
* @apiError InternalServerError
*/
app.get('/api/v3/... |
Fix typos in record_format hash | // Main Module for searchthedocs demo
define(function (require) {
var _ = require('underscore'),
$ = require('jquery'),
SearchTheDocsView = require('searchthedocs/src/searchthedocs');
var searchthedocs_main = function() {
var search_options = {
default_endpoint: 'sections',
endpoints: {
... | // Main Module for searchthedocs demo
define(function (require) {
var _ = require('underscore'),
$ = require('jquery'),
SearchTheDocsView = require('searchthedocs/src/searchthedocs');
var searchthedocs_main = function() {
var search_options = {
default_endpoint: 'sections',
endpoints: {
... |
Switch back to var syntax for all functions | import { select, local } from "d3-selection";
var myLocal = local(),
noop = function (){};
export default function (tagName, className){
var create = noop,
render = noop,
destroy = noop,
myCreate = function (){
var my = myLocal.set(this, {
selection: select(this),
st... | import { select, local } from "d3-selection";
var myLocal = local(),
noop = function (){};
export default function (tagName, className){
var create = noop,
render = noop,
destroy = noop,
myCreate = function (){
var my = myLocal.set(this, {
selection: select(this),
st... |
[tasks] Fix wrong rendering of priority | /*
* Set of functions to make data more readable.
*/
import { mapGetters } from 'vuex'
import { formatDate, formatFullDate, formatSimpleDate } from '@/lib/time'
export const formatListMixin = {
created () {
},
mounted () {
},
beforeDestroy () {
},
computed: {
...mapGetters([
'organisatio... | /*
* Set of functions to make data more readable.
*/
import { mapGetters } from 'vuex'
import { formatDate, formatFullDate, formatSimpleDate } from '@/lib/time'
export const formatListMixin = {
created () {
},
mounted () {
},
beforeDestroy () {
},
computed: {
...mapGetters([
'organisatio... |
Remove Node RSS restart interval in favor of kubernetes cron job | var _ = require('lodash'),
async = require('async'),
checkForFiling = require('./check'),
request = require('request'),
models = require('../../models'),
parser = require('rss-parser');
// var interval = 60000;
function queueFilingsToCheck() {
console.log('checking RSS');
parser.parseURL... | var _ = require('lodash'),
async = require('async'),
checkForFiling = require('./check'),
request = require('request'),
models = require('../../models'),
parser = require('rss-parser');
var interval = 60000;
function queueFilingsToCheck() {
console.log('checking RSS');
parser.parseURL('h... |
Fix require on Node.js 0.12. | // Control-flow utilities.
var cadence = require('cadence')
// Evented message queue.
var Procession = require('./procession')
// Create a splitter that will split the given queue.
//
function Splitter (queue, splits) {
this._shifter = queue.shifter()
this._map = {}
this._array = []
for (var key in s... | // Control-flow utilities.
var cadence = require('cadence')
// Evented message queue.
var Procession = require('.')
// Create a splitter that will split the given queue.
//
function Splitter (queue, splits) {
this._shifter = queue.shifter()
this._map = {}
this._array = []
for (var key in splits) {
... |
Throw an exception when allow_url_fopen is disabled | <?php
namespace Airbrake\Http;
use Airbrake\Exception;
use InvalidArgumentException;
class Factory
{
/**
* HTTP client generation.
*
* @param string|null $handler
*
* @throws Exception If the cURL extension or the Guzzle client aren't available (if required).
* @throw... | <?php
namespace Airbrake\Http;
use Airbrake\Exception;
use InvalidArgumentException;
class Factory
{
/**
* HTTP client generation.
*
* @param string|null $handler
*
* @throws Exception If the cURL extension or the Guzzle client aren't available (if required).
* @throw... |
Use the new RulesEngine configuration service for vars | angular.module('OpiferEntityPicker', ['ui.bootstrap.typeahead'])
.directive('entityPicker', function() {
var tpl =
'<input type="text" ng-model="search" typeahead="object.name for object in getObject($viewValue)" typeahead-on-select="onSelect($item, $model, $label)" typeahead-loading="loadingL... | angular.module('OpiferEntityPicker', ['ui.bootstrap.typeahead'])
.directive('entityPicker', function() {
var tpl =
'<input type="text" ng-model="search" typeahead="object.name for object in getObject($viewValue)" typeahead-on-select="onSelect($item, $model, $label)" typeahead-loading="loadingL... |
Make RequestType a normal class, not an enum.
This removes the restriction of needing Python >= 3.4. RequestType is
now a normal class with class variables (fixes #19). | import json
from pyglab.exceptions import RequestError
import requests
class RequestType(object):
GET = 1
POST = 2
PUT = 3
DELETE = 4
class ApiRequest:
_request_creators = {
RequestType.GET: requests.get,
RequestType.POST: requests.post,
RequestType.PUT: requests.put,
... | import enum
import json
from pyglab.exceptions import RequestError
import requests
@enum.unique
class RequestType(enum.Enum):
GET = 1
POST = 2
PUT = 3
DELETE = 4
class ApiRequest:
_request_creators = {
RequestType.GET: requests.get,
RequestType.POST: requests.post,
RequestT... |
Fix importing force_text tests for 1.4 compatibility
use 1.4 compat code | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.test import TestCase
try:
from django.utils.encoding import force_text
except ImportError:
from django.utils.encoding import force_unicode as force_text
from import_export.formats import base_formats
class XLSTest(TestCa... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.test import TestCase
from django.utils.text import force_text
from import_export.formats import base_formats
class XLSTest(TestCase):
def test_binary_format(self):
self.assertTrue(base_formats.XLS().is_binary())
cl... |
Correct configuration root & remove unnecessary $rootNode variable | <?php
/*
* This file is part of CacheToolBundle.
*
* (c) Samuel Gordalina <samuel.gordalina@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CacheTool\Bundle\DependencyInjection;
use Symfony\Component\Config\... | <?php
/*
* This file is part of CacheToolBundle.
*
* (c) Samuel Gordalina <samuel.gordalina@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CacheTool\Bundle\DependencyInjection;
use Symfony\Component\Config\... |
OEE-624: Add multi language support for Outlook layouts | <?php
namespace Oro\Bundle\SoapBundle\Tests\EventListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Oro\Bundle\SoapBundle\EventListener\LocaleListener;
class LocaleListenerTest extends \PHPUnit_Framework_... | <?php
namespace Oro\Bundle\SoapBundle\Tests\EventListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Oro\Bundle\SoapBundle\EventListener\LocaleListener;
class LocaleListenerTest extends \PHPUnit_Framework_... |
Make use allow more connections per pool. Now capped at 10. | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice colin@daedrum.net
import threading
class ResourceGenerator:
def __init__(self, generate = lambda:None,... | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice colin@daedrum.net
import threading
class ResourceGenerator:
def __init__(self, generate = lambda:None,... |
Fix route parameters for a row action | <?php
/*
* This file is part of the DataGridBundle.
*
* (c) Stanislav Turza <sorien@mail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sorien\DataGridBundle\Grid\Column;
use Sorien\DataGridBundle\Grid\Action\Row... | <?php
/*
* This file is part of the DataGridBundle.
*
* (c) Stanislav Turza <sorien@mail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sorien\DataGridBundle\Grid\Column;
use Sorien\DataGridBundle\Grid\Action\Row... |
Modify libCategories.so path to use hdfs.
git-svn-id: 41b0c0219f7416f0d477a2a4ae2b791f31fdedae@100 72e40b64-262a-4186-abad-0444e9ae7036 | package es.tid.ps.dynamicprofile.dictionary;
/**
* Class that defines the native methods to access the comScore dictionary API
* via JNI.
*
* @author dmicol
*/
public class CSDictionaryJNIInterface {
/**
* Initializes the dictionary wrapper using the terms in domain file.
*
* @param iMode
... | package es.tid.ps.dynamicprofile.dictionary;
/**
* Class that defines the native methods to access the comScore dictionary API
* via JNI.
*
* @author dmicol
*/
public class CSDictionaryJNIInterface {
/**
* Initializes the dictionary wrapper using the terms in domain file.
*
* @param iMode
... |
Fix on_error triggered twice issue
If some error happens, the on_error will be triggered twice. | var request = require('request');
var path = require('path');
var fs = require('fs');
function on_error(err, options) {
if (options.done) {
return options.done(err);
}
throw err;
}
module.exports = function(options) {
if (!options.url) {
throw new Error('The option url is required... | var request = require('request');
var path = require('path');
var fs = require('fs');
function on_error(err, options) {
if (options.done) {
return options.done(err);
}
throw err;
}
module.exports = function(options) {
if (!options.url) {
throw new Error('The option url is required... |
Use activity context not application context | package com.fedorvlasov.lazylist;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class LazyAd... | package com.fedorvlasov.lazylist;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class LazyAdapter exten... |
Add missing "devel" and "undef". Remove "indent" since it was moved to jscs. | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
jshint: {
grunt: {
src: ['Gruntfile.js']
},
main: {
src: ['tock.js'],
options: {
'browser': true,
'camelcase': true,
'curly': true,
'd... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
jshint: {
grunt: {
src: ['Gruntfile.js']
},
main: {
src: ['tock.js'],
options: {
'browser': true,
'camelcase': true,
'curly': true,
'e... |
Replace tab indentation with 4 spaces | #!/usr/bin/env python
# Copyright 2016 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 ... | #!/usr/bin/env python
# Copyright 2016 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 ... |
Update chpl_task to only default to muxed when ugni comm is used.
This expands upon (and fixes) #1640 and #1635.
* [ ] Run printchplenv on mac and confirm it still works.
* [ ] Emulate cray-x* with module and confirm comm, tasks are ugni, muxed.
```bash
(
export CHPL_MODULE_HOME=$CHPL_HOME
export CHPL_HOST_PLATF... | #!/usr/bin/env python
import sys, os
import chpl_arch, chpl_platform, chpl_compiler, chpl_comm
from utils import memoize
import utils
@memoize
def get():
tasks_val = os.environ.get('CHPL_TASKS')
if not tasks_val:
arch_val = chpl_arch.get('target', get_lcd=True)
platform_val = chpl_platform.get... | #!/usr/bin/env python
import sys, os
import chpl_arch, chpl_platform, chpl_compiler
from utils import memoize
import utils
@memoize
def get():
tasks_val = os.environ.get('CHPL_TASKS')
if not tasks_val:
arch_val = chpl_arch.get('target', get_lcd=True)
platform_val = chpl_platform.get()
... |
Add method to check is content is in another collection | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... |
Fix tests python 2.6 support | from s3authbasic.testing import BaseAppTest, AUTH_ENVIRON
class ViewsTests(BaseAppTest):
def test_validpath(self):
for (path, expect) in (
('/', 'home'),
('/index.html', 'home'),
('/level1', 'level 1'),
('/level1/', 'level 1'),
('/level1/index.h... | from s3authbasic.testing import BaseAppTest, AUTH_ENVIRON
class ViewsTests(BaseAppTest):
def test_validpath(self):
for (path, expect) in (
('/', 'home'),
('/index.html', 'home'),
('/level1', 'level 1'),
('/level1/', 'level 1'),
('/level1/index.h... |
Fix issue with UTCDateTime constructor. | <?php
namespace Northstar\Console\Commands;
use Northstar\Models\User;
use MongoDB\BSON\UTCDateTime;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
class RemoveOldBirthdates extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
prote... | <?php
namespace Northstar\Console\Commands;
use Northstar\Models\User;
use MongoDB\BSON\UTCDateTime;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
class RemoveOldBirthdates extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
prote... |
Add the getService shorcut method | <?php
namespace A5sys\MinkContext\Context;
use Behat\MinkExtension\Context\MinkContext;
/**
* A symfony2 context
*/
class SymfonyContext extends MinkContext
{
use \A5sys\MinkContext\Traits\MinkTrait;
protected $em = null;
protected $kernel = null;
protected $container = null;
protected $doctri... | <?php
namespace A5sys\MinkContext\Context;
use Behat\MinkExtension\Context\MinkContext;
/**
* A symfony2 context
*/
class SymfonyContext extends MinkContext
{
use \A5sys\MinkContext\Traits\MinkTrait;
protected $em = null;
protected $kernel = null;
protected $container = null;
protected $doctri... |
Add Pillow to tests require | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
# Dynamically calculate the version based on photologue.VERSION
version_tuple = __import__('photologue').VERSION
if len(version_tuple) == 3:
version = "%d.%d.%s" % ve... | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
# Dynamically calculate the version based on photologue.VERSION
version_tuple = __import__('photologue').VERSION
if len(version_tuple) == 3:
version = "%d.%d.%s" % ve... |
OEE-1075: Update rate converter to support fixation logic
- Add freeze case in unit tests
- Rewrite converter for base currency amount usage instead of rate
- Remove unused param from convert method | <?php
namespace Oro\Bundle\CurrencyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Oro\Bundle\DataAuditBundle\Metadata\Annotation as Oro;
class MultiCurrency
{
use CurrencyAwareTrait;
protected $value;
protected $baseCurrencyValue = null;
/**
* @param string $value
* @param string $cu... | <?php
namespace Oro\Bundle\CurrencyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Oro\Bundle\DataAuditBundle\Metadata\Annotation as Oro;
class MultiCurrency
{
use CurrencyAwareTrait;
protected $value;
protected $rate;
protected $baseCurrencyValue;
/**
* @param string $value
* @pa... |
Fix &h not being removed from the message properly | package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;
public class CommandAlert extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getP... | package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;
public class CommandAlert extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getP... |
Add check to ensure second argument is an integer | <?php
namespace DMS\Bundle\TwigExtensionBundle\Twig\Date;
/**
* Adds support for Padding a String in Twig
*/
class PadStringExtension extends \Twig_Extension
{
/**
* Name of Extension
*
* @return string
*/
public function getName()
{
return 'PadStringExtension';
}
/**... | <?php
namespace DMS\Bundle\TwigExtensionBundle\Twig\Date;
/**
* Adds support for Padding a String in Twig
*/
class PadStringExtension extends \Twig_Extension
{
/**
* Name of Extension
*
* @return string
*/
public function getName()
{
return 'PadStringExtension';
}
/**... |
Move return statement in _lookup_user into except/else flow | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... | from django.contrib.auth import get_user_model
from django.conf import settings
from django.contrib.auth.models import check_password
from django.core.validators import validate_email
from django.forms import ValidationError
User = get_user_model()
class EmailOrUsernameAuthBackend():
"""
A custom authenticati... |
Add new config variables to example config | var fs = require('fs');
var splitca = require('split-ca');
module.exports = {
webServerPort: 8080,
/* MySQL config */
MySQL_Hostname: 'localhost',
MySQL_Username: 'root',
MySQL_Password: '',
MySQL_Database: 'janusvr',
/* Redis config */
redis: {
host: "127.0.0.1",
... | var fs = require('fs');
var splitca = require('split-ca');
module.exports = {
webServerPort: 8080,
/* MySQL config */
MySQL_Hostname: 'localhost',
MySQL_Username: 'root',
MySQL_Password: '',
MySQL_Database: 'janusvr',
/* Redis config */
redis: {
host: "127.0.0.1",
... |
Set HOME, allow errors to pass through to stdout/stderr | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
import shutil
import subprocess
import tempfile
from string import Template
from .artifact import Artifact
LOG = logging.getLogger(__name__)
class MWM(object):
name = 'mwm'
description = 'maps.me MWM'
cmd = Template... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
import shutil
import subprocess
import tempfile
from string import Template
from .artifact import Artifact
LOG = logging.getLogger(__name__)
class MWM(object):
name = 'mwm'
description = 'maps.me MWM'
cmd = Template... |
Fix up some settings for start_zone() | import xmlrpclib
from supervisor.xmlrpc import SupervisorTransport
def start_zone(port=1300, zoneid="defaultzone", processgroup='zones', autorestart=False):
s = xmlrpclib.ServerProxy('http://localhost:9001')
import socket
try:
version = s.twiddler.getAPIVersion()
except(socket.error), exc:
... | import xmlrpclib
from supervisor.xmlrpc import SupervisorTransport
def start_zone(port=1300, zoneid="defaultzone", processgroup='zones', autorestart=False):
s = xmlrpclib.ServerProxy('http://localhost:9001')
import socket
try:
version = s.twiddler.getAPIVersion()
except(socket.error), exc:
... |
Fix linting issue after updating mocha-eslint. | var stringUtil = require('ember-cli-string-utils');
var SilentError = require('silent-error');
var pathUtil = require('ember-cli-path-utils');
module.exports = {
description: 'Generates an ember-data adapter.',
availableOptions: [
{ name: 'base-class', type: String }
],
locals: function(options) {
... | var stringUtil = require('ember-cli-string-utils');
var SilentError = require('silent-error');
var pathUtil = require('ember-cli-path-utils');
module.exports = {
description: 'Generates an ember-data adapter.',
availableOptions: [
{ name: 'base-class', type: String }
],
locals: function(options) {
... |
Change timer test so that we can reproduce the random issue. Change
timings. | package competitive.programming.timemanagement;
import static org.junit.Assert.fail;
import org.junit.Test;
public class TimerTest {
@Test
public void nonStartedTimerDoesNotTimeout() {
Timer timer = new Timer();
try {
timer.timeCheck();
sleep(1);
... | package competitive.programming.timemanagement;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Test;
import competitive.programming.timemanagement.TimeoutException;
import competitive.programming.timemanagement.Timer;
public class TimerTest {
@Test
p... |
Use match instead of query string for now. | var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host: process.env.ELASTICSEARCH,
});
function query(q) {
return client.search({
index: 'chadocs',
type: 'document',
body: {
query: {
filtered: {
query:... | var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host: process.env.ELASTICSEARCH,
});
function query(q) {
return client.search({
index: 'chadocs',
type: 'document',
body: {
query: {
filtered: {
query:... |
Add type to import method | <?php
namespace CfdiUtils\Nodes;
use \DOMElement;
class XmlNodeImporter
{
/**
* Local record for registered namespaces to avoid set the namespace declaration in every children
* @var string[]
*/
private $registeredNamespaces = [];
public function import(DOMElement $element): NodeInterface
... | <?php
namespace CfdiUtils\Nodes;
use DOMElement;
class XmlNodeImporter
{
/**
* Local record for registered namespaces to avoid set the namespace declaration in every children
* @var string[]
*/
private $registeredNamespaces = [];
public function import($element): NodeInterface
{
... |
Remove simplekv requirement, mark as procution instead of beta | """
Flask-JWT-Extended
-------------------
Flask-Login provides jwt endpoint protection for Flask.
"""
from setuptools import setup
setup(name='Flask-JWT-Extended',
version='2.4.1',
url='https://github.com/vimalloc/flask-jwt-extended',
license='MIT',
author='Landon Gilbert-Bland',
author_... | """
Flask-JWT-Extended
-------------------
Flask-Login provides jwt endpoint protection for Flask.
"""
from setuptools import setup
setup(name='Flask-JWT-Extended',
version='2.4.1',
url='https://github.com/vimalloc/flask-jwt-extended',
license='MIT',
author='Landon Gilbert-Bland',
author_... |
Revert my previous 'fix' for point projection | var cornerstoneTools = (function ($, cornerstone, cornerstoneTools) {
"use strict";
if(cornerstoneTools === undefined) {
cornerstoneTools = {};
}
if(cornerstoneTools.referenceLines === undefined) {
cornerstoneTools.referenceLines = {};
}
// projects a patient point to an image... | var cornerstoneTools = (function ($, cornerstone, cornerstoneTools) {
"use strict";
if(cornerstoneTools === undefined) {
cornerstoneTools = {};
}
if(cornerstoneTools.referenceLines === undefined) {
cornerstoneTools.referenceLines = {};
}
// projects a patient point to an image... |
Fix rendering in show status
When rendering in the show status, if the labels span multiple lines,
the formatting breaks. Adding the clearfix to the fieldgroup ensures
that each row of the form is correctly rendered. | @if (in_array($field->type, array('hidden','auto')) OR !$field->has_wrapper )
{!! $field->output !!}
@if ($field->message!='')
<span class="help-block">
<span class="glyphicon glyphicon-warning-sign"></span>
{!! $field->message !!}
</span>
@endif
@else
<div class="form-group c... | @if (in_array($field->type, array('hidden','auto')) OR !$field->has_wrapper )
{!! $field->output !!}
@if ($field->message!='')
<span class="help-block">
<span class="glyphicon glyphicon-warning-sign"></span>
{!! $field->message !!}
</span>
@endif
@else
<div class="form-group{!... |
Add animation for button nav on IPhone | functions = {
setButtonNav : function () {
var windowWidth = $(window).width(),
buttonNav = $('.side-nav__button');
buttonNav.addClass('on-mobile');
}
};
$(document).ready(function () {
functions.setButtonNav();
$('.side-nav-container').hover(function () {
$(this).... | $(document).ready(function () {
$('.side-nav-container').hover(function () {
$(this).addClass('is-showed');
$('.kudo').addClass('hide');
}, function() {
$(this).removeClass('is-showed');
$('.kudo').removeClass('hide');
});
$(window).scroll(function () {
var logo... |
Add missing first word to replied messages | package net.wayward_realms.waywardchat;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ReplyCommand implements CommandExecutor {
private WaywardChat plugin;
publ... | package net.wayward_realms.waywardchat;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ReplyCommand implements CommandExecutor {
private WaywardChat plugin;
publ... |
Send a message instead of posting error. Let us free up more document memory. | // ==UserScript==
// @include http://youtube.com/html5
// @include http://www.youtube.com/html5
// @include https://youtube.com/html5
// @include https://www.youtube.com/html5
// ==/UserScript==
(function() {
window.addEventListener('DOMContentLoaded', function()
{
submitFormWithSessionToken();
}, false);
... | // ==UserScript==
// @include http://youtube.com/html5
// @include http://www.youtube.com/html5
// @include https://youtube.com/html5
// @include https://www.youtube.com/html5
// ==/UserScript==
(function() {
window.addEventListener('DOMContentLoaded', function()
{
submitFormWithSessionToken();
}, false);
... |
FIX : fenêtre login ne se ferme plus sur clic en dehors popup ou esc | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
(function () {
define([], function () {
var appRun = function ($rootScope, $sessionStorage, $state, $uibModal, authService... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
(function () {
define([], function () {
var appRun = function ($rootScope, $sessionStorage, $state, $uibModal, authService... |
Revert "Use activity context not application context"
This reverts commit e5ef5b32fc6592df810815226c0297485c4a83c3. | package com.fedorvlasov.lazylist;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class LazyAdapter exten... | package com.fedorvlasov.lazylist;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class LazyAd... |
Add name config property to the simple config fixture | module.exports = function() {
return {
'translation.af': JSON.stringify({
'' : {
'domain' : 'messages',
'lang' : 'af',
'plural_forms' : 'nplurals=2; plural=(n != 1);'
},
'yes' : [null, 'ja'],
'no' : [null, 'nee... | module.exports = function() {
return {
'translation.af': JSON.stringify({
'' : {
'domain' : 'messages',
'lang' : 'af',
'plural_forms' : 'nplurals=2; plural=(n != 1);'
},
'yes' : [null, 'ja'],
'no' : [null, 'nee... |
Update leaflet request to be over https | from django.contrib.gis.forms import widgets
class LeafletPointWidget(widgets.BaseGeometryWidget):
template_name = 'leaflet/leaflet.html'
class Media:
css = {
'all': ('https://cdnjs.cloudflare.com/ajax/libs/leaflet/v0.7.7/leaflet.css',
'leaflet/css/location_form.css',
... | from django.contrib.gis.forms import widgets
class LeafletPointWidget(widgets.BaseGeometryWidget):
template_name = 'leaflet/leaflet.html'
class Media:
css = {
'all': ('https://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css',
'leaflet/css/location_form.css',
... |
Make lodash an external for real | var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: {
'tree-chooser': './src/index.js',
'tree-chooser.min': './src/index.js'
},
output: {
path: './dist',
filename: '[name].js',
library: 'tree-choo... | var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: {
'tree-chooser': './src/index.js',
'tree-chooser.min': './src/index.js'
},
output: {
path: './dist',
filename: '[name].js'
},
externals: {
... |
Change SpectrometerReader a little so it can handle more data formats. | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 7 12:04:18 2015
@author: wirkert
"""
import numpy as np
from msi.io.reader import Reader
from msi.msi import Msi
class SpectrometerReader(Reader):
def __init__(self):
pass
def read(self, file_to_read):
# our spectrometer like to follow german... | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 7 12:04:18 2015
@author: wirkert
"""
import numpy as np
from msi.io.reader import Reader
from msi.msi import Msi
class SpectrometerReader(Reader):
def __init__(self):
pass
def read(self, file_to_read):
# our spectrometer like to follow german... |
Add method to get all families of currently loaded elements | class Lattice(object):
def __init__(self, name):
self.name = name
self._elements = []
def __getitem__(self, i):
return self._elements[i]
def __len__(self):
''' Get the number of elements in the lattice '''
return len(self._elements)
def __str__(self):
... | class Lattice(object):
def __init__(self, name):
self.name = name
self._elements = []
def __getitem__(self, i):
return self._elements[i]
def __len__(self):
''' Get the number of elements in the lattice '''
return len(self._elements)
def __str__(self):
... |
Move mcapid calls to top of api to make it easier to identify REST routes that need to be replaced | class AccountsAPIService {
/*@ngInject*/
constructor(apiService, Restangular, toast) {
this.apiService = apiService;
this.Restangular = Restangular;
this.toast = toast;
}
createAccount(name, email, password) {
return this.Restangular.one('v3').one('createNewUser').custom... | class AccountsAPIService {
/*@ngInject*/
constructor(apiService, Restangular, toast) {
this.apiService = apiService;
this.Restangular = Restangular;
this.toast = toast;
}
createAccount(name, email, password) {
return this.Restangular.one('v3').one('createNewUser').custom... |
Fix 6547 test case to account for new formatTime return | function runTest()
{
FBTest.sysout("issue6547.START");
FBTest.openNewTab(basePath + "cookies/6547/issue6547.php", function(win)
{
FBTest.openFirebug();
FBTest.selectPanel("net");
FBTestFireCookie.enableCookiePanel();
FBTest.enableNetPanel(function(win)
{
... | function runTest()
{
FBTest.sysout("issue6547.START");
FBTest.openNewTab(basePath + "cookies/6547/issue6547.php", function(win)
{
FBTest.openFirebug();
FBTest.selectPanel("net");
FBTestFireCookie.enableCookiePanel();
FBTest.enableNetPanel(function(win)
{
... |
Change source to point to which part of the request caused the error, and add the specific reason to detail |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
""" Custom exception handler that returns errors object as an array """
# Import inside method to avoid errors when the OSF is loaded without Django
from rest_framework.view... |
Make the whole retry page tappable | import React from "react-native";
import Page from "./page";
const {
StyleSheet,
View,
Text,
Image,
TouchableOpacity
} = React;
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center"
},
failed: {
fontSize:... | import React from "react-native";
import Page from "./page";
const {
StyleSheet,
View,
Text,
Image,
TouchableOpacity
} = React;
const styles = StyleSheet.create({
failed: {
fontSize: 18
},
button: {
flexDirection: "row",
alignItems: "center",
padding: 16... |
Add back in geolocate url name. | from django.conf.urls.defaults import patterns, url, include
from django.views.generic.simple import direct_to_template
import django.views.static
import settings
import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
... | from django.conf.urls.defaults import patterns, url, include
from django.views.generic.simple import direct_to_template
import django.views.static
import settings
import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
... |
Clear indices list before reload |
function DropdownCtrl($scope, $http, Data, pubsub) {
$scope.data = Data;
$scope.pubsub = pubsub;
$scope.indices = [];
$scope.types = [];
$scope.pubsub.subscribe('HOST_CHANGED', function(newHost){
$scope.data.host = newHost;
$scope.loadMappings();
});
$scope.loadMappings = func... |
function DropdownCtrl($scope, $http, Data, pubsub) {
$scope.data = Data;
$scope.pubsub = pubsub;
$scope.indices = [];
$scope.types = [];
$scope.pubsub.subscribe('HOST_CHANGED', function(newHost){
$scope.data.host = newHost;
$scope.loadMappings();
});
$scope.loadMappings = func... |
Reset the padding on the background articles | (function() {
var root = this,
Peeler = function() {},
articles = document.querySelectorAll("article"),
viewportWidth = root.innerWidth,
aspectRatio = 1200/1440,
bodyHeight = 0,
articleStates = [];
Peeler.prototype.bind = function() {
var article,
i,
len,
... | (function() {
var root = this,
Peeler = function() {},
articles = document.querySelectorAll("article"),
viewportWidth = root.innerWidth,
aspectRatio = 1200/1440,
bodyHeight = 0,
articleStates = [];
Peeler.prototype.bind = function() {
var article,
i,
len,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.