text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Use real readthedocs API again
// 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: { ...
Update the path and the url
<?php /* * This file is part of the AlphaLemonThemeEngineBundle and it is distributed * under the MIT License. To use this bundle you must leave * intact this copyright notice. * * Copyright (c) AlphaLemon <webmaster@alphalemon.com> * * For the full copyright and license information, please view the LICENSE * f...
<?php /* * This file is part of the AlphaLemonThemeEngineBundle and it is distributed * under the MIT License. To use this bundle you must leave * intact this copyright notice. * * Copyright (c) AlphaLemon <webmaster@alphalemon.com> * * For the full copyright and license information, please view the LICENSE * f...
Change docstrong to reflect actual endpoint
from django.http import (HttpResponse, HttpResponseNotFound) from django.contrib.gis.measure import D from working_waterfronts.working_waterfronts_api.models import PointOfInterest from working_waterfronts.working_waterfronts_api.functions import get_lat_long_prox import json from .serializer ...
from django.http import (HttpResponse, HttpResponseNotFound) from django.contrib.gis.measure import D from working_waterfronts.working_waterfronts_api.models import PointOfInterest from working_waterfronts.working_waterfronts_api.functions import get_lat_long_prox import json from .serializer ...
Handle 404 when user doesn't exist in SIS
<?php namespace UBC\Exam\MainBundle\EventListener; use GuzzleHttp\Exception\ClientException; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; use UBC\LtCommons\Service\StudentService; class CourseInjectionListener { protected $session; p...
<?php namespace UBC\Exam\MainBundle\EventListener; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; use UBC\LtCommons\Service\StudentService; class CourseInjectionListener { protected $session; protected $service; public function __...
Make it clear that we are using an email as username
<?php namespace SumoCoders\FrameworkMultiUserBundle\Security; use SumoCoders\FrameworkMultiUserBundle\User\Interfaces\User; use SumoCoders\FrameworkMultiUserBundle\User\UserRepositoryCollection; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\User\UserInterface; use...
<?php namespace SumoCoders\FrameworkMultiUserBundle\Security; use SumoCoders\FrameworkMultiUserBundle\User\Interfaces\User; use SumoCoders\FrameworkMultiUserBundle\User\UserRepositoryCollection; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\User\UserInterface; use...
Reduce gemfire server logging to warning
module.exports = function(grunt) { grunt.initConfig( { pkg: grunt.file.readJSON('package.json'), shell: { rebuild: { command: 'npm install --build-from-source' }, benchmarkNode: { command: 'node benchmark/node/benchmark.js' }, startServer: {...
module.exports = function(grunt) { grunt.initConfig( { pkg: grunt.file.readJSON('package.json'), shell: { rebuild: { command: 'npm install --build-from-source' }, benchmarkNode: { command: 'node benchmark/node/benchmark.js' }, startServer: {...
Define subprocesses in the context of the root process. Maybe this is more readable?
from simpy import Simulation, InterruptedException def test_simple_process(): def pem(ctx, result): while True: result.append(ctx.now) yield ctx.wait(1) result = [] Simulation(pem, result).simulate(until=4) assert result == [0, 1, 2, 3] def test_interrupt(): def r...
from simpy import Simulation, InterruptedException def test_simple_process(): def pem(ctx, result): while True: result.append(ctx.now) yield ctx.wait(1) result = [] Simulation(pem, result).simulate(until=4) assert result == [0, 1, 2, 3] def test_interrupt(): def p...
Update requirement to Python 3.6
import sys from setuptools import setup if sys.version_info < (3, 6): raise Exception("Python 3.6 or higher is required. Your version is %s." % sys.version) long_description = open('README.rst').read() __version__ = "" exec(open('ehforwarderbot/__version__.py').read()) setup( name='ehforwarderbot', pack...
import sys from setuptools import setup if sys.version_info < (3, 5): raise Exception("Python 3.5 or higher is required. Your version is %s." % sys.version) long_description = open('README.rst').read() __version__ = "" exec(open('ehforwarderbot/__version__.py').read()) setup( name='ehforwarderbot', pack...
Remove remote receipt validation as we do not have it
angular.module('focus.services') .factory('Store', function(AudioLibrary) { var functions = { initStore: function (){ console.log("Initializing Store") if (!window.store) { console.log('Store not available'); return; } var platform = device.platform...
angular.module('focus.services') .factory('Store', function(AudioLibrary) { var functions = { initStore: function (){ console.log("Initializing Store") if (!window.store) { console.log('Store not available'); return; } var platform = device.platform...
Fix power entering the relay via FE or TESLA not working right
package mcjty.rftools.blocks.relay; import net.darkhax.tesla.api.ITeslaConsumer; import net.minecraft.util.EnumFacing; import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.fml.common.Optional; import javax.annotation.Nullable; import mcjty.lib.varia.EnergyTools; @Optional.Interface(iface = "ne...
package mcjty.rftools.blocks.relay; import net.darkhax.tesla.api.ITeslaConsumer; import net.minecraft.util.EnumFacing; import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.fml.common.Optional; import javax.annotation.Nullable; import mcjty.lib.varia.EnergyTools; @Optional.Interface(iface = "ne...
Disable foreign key checks when creating round_id column
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateRoundsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('rounds', function (Blueprint $table) { ...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateRoundsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('rounds', function (Blueprint $table) { ...
Fix action type which has incorrectly named ActionType.
import {RequestUtil} from 'mesosphere-shared-reactjs'; import { REQUEST_SIDEBAR_OPEN, REQUEST_SIDEBAR_CLOSE, REQUEST_CLI_INSTRUCTIONS, REQUEST_VERSIONS_SUCCESS, REQUEST_VERSIONS_ERROR, REQUEST_SIDEBAR_WIDTH_CHANGE } from '../constants/ActionTypes'; import Config from '../config/Config'; var AppDispatcher ...
import {RequestUtil} from 'mesosphere-shared-reactjs'; import ActionTypes from '../constants/ActionTypes'; import Config from '../config/Config'; var AppDispatcher = require('./AppDispatcher'); module.exports = { open: function () { AppDispatcher.handleSidebarAction({ type: ActionTypes.REQUEST_SIDEBAR_O...
PROC-592: Add nonnull for fields in the model
package com.indeed.proctor.store; import javax.annotation.Nonnull; import java.util.Objects; import java.util.Set; /** * Details of a single revision */ public class RevisionDetails { @Nonnull private final Revision revision; @Nonnull private final Set<String> modifiedTests; public RevisionDeta...
package com.indeed.proctor.store; import java.util.Objects; import java.util.Set; /** * Details of a single revision */ public class RevisionDetails { private final Revision revision; private final Set<String> modifiedTests; public RevisionDetails( final Revision revision, final...
Generalize to allow editing other configuration
import owebunit import urlparse from wolis_test_case import WolisTestCase class AcpLoginTestCase(WolisTestCase): def test_disable_captcha(self): self.login('morpheus', 'morpheus') self.acp_login('morpheus', 'morpheus') self.change_acp_knob( link_text='Spambot countermea...
import owebunit import urlparse from wolis_test_case import WolisTestCase class AcpLoginTestCase(WolisTestCase): def test_disable_captcha(self): self.login('morpheus', 'morpheus') self.acp_login('morpheus', 'morpheus') start_url = '/adm/index.php' self.get_with_sid(start_ur...
Add form-horizontal class for the view section
@extends('layouts.app') @section('page-title') {!! $t[$type.'_title'] or trans('eliurkis::crud.'.$type.'_title') !!} @stop @section('content') <div id="form-manage" class="row form-horizontal"> @foreach ($fields as $name => $field) <div class="{{ $formColsClasses[0] }} fieldtype_{{ $field[...
@extends('layouts.app') @section('page-title') {!! $t[$type.'_title'] or trans('eliurkis::crud.'.$type.'_title') !!} @stop @section('content') <div id="form-manage" class="row"> @foreach ($fields as $name => $field) <div class="{{ $formColsClasses[0] }} fieldtype_{{ $field['type'] }} field...
Add support for component initialization that returns lists
from importlib import import_module from collections import Iterable import json def read_component_configuration(path): if path.endswith('.json'): with open(path) as f: config = json.load(f) return apply_defaults(config) else: raise ValueError("Unknown components config...
from importlib import import_module import json def read_component_configuration(path): if path.endswith('.json'): with open(path) as f: config = json.load(f) return apply_defaults(config) else: raise ValueError("Unknown components configuration type: {}".format(path)) ...
Set the Authorization header if a token exists
var svcMod = angular.module( "linksWeb.service-api", [] ); svcMod.factory( 'API', [ "$http", "$window", function ( $http, $window ) { var apiRequest = function ( method, path, requestData, callback ) { var headers = { "Content-Type": "application/json" }; if ( $window.sessio...
var svcMod = angular.module( "linksWeb.service-api", [] ); svcMod.factory( 'API', [ "$http", "$window", function ( $http, $window ) { var apiRequest = function ( method, path, requestData, callback ) { var headers = { "Content-Type": "application/json", "Authorization": "Token " ...
Correct error for array list
<?php /** * Created by EBelair. * User: manu * Date: 07/03/14 * Time: 19:20 */ namespace SuchTable\Element; use SuchTable\Element; use SuchTable\Exception\InvalidArgumentException; abstract class AbstractList extends Element { public function prepare() { if ($this->isPrepared === true) { ...
<?php /** * Created by EBelair. * User: manu * Date: 07/03/14 * Time: 19:20 */ namespace SuchTable\Element; use SuchTable\Element; use SuchTable\Exception\InvalidArgumentException; abstract class AbstractList extends Element { public function prepare() { if ($this->isPrepared === true) { ...
Revert "Don't separate the validating generator" This reverts commit f6851039a91adb5a3f9c130862e652df5aabe674.
<?php declare(strict_types=1); namespace App\Generators; use GuzzleHttp\Promise\Promise; /** * This is the validating generator class. * * @author Graham Campbell <graham@alt-three.com> */ class ValidatingGenerator implements GeneratorInterface { /** * The generator to wrap. * * @var \App\Gen...
<?php declare(strict_types=1); namespace App\Generators; use GuzzleHttp\Promise\Promise; /** * This is the validating generator class. * * @author Graham Campbell <graham@alt-three.com> */ class ValidatingGenerator implements GeneratorInterface { /** * The generator to wrap. * * @var \App\Gen...
Remove the sudo killall from the CLI script, as it prompts for a password regardless of nopasswd settings. NOTE: if upgrading from a version prior to this version, a reboot may be required!
<?php namespace App\Console\Command; use Doctrine\ORM\EntityManager; use Entity\Station; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class RestartRadio extends CommandAbstract { /** * {@inheritdoc} */ protected function configure() { ...
<?php namespace App\Console\Command; use Doctrine\ORM\EntityManager; use Entity\Station; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class RestartRadio extends CommandAbstract { /** * {@inheritdoc} */ protected function configure() { ...
Update PHPUnit tests for Yii models.
<?php namespace Sil\SilAuth\tests\unit\models; use Sil\SilAuth\models\User; use PHPUnit\Framework\TestCase; class UserTest extends TestCase { public function testChangingAnExistingUuid() { // Arrange: $uniqId = uniqid(); $user = new User(); $user->attributes = [ 'em...
<?php namespace Sil\SilAuth\tests\unit\models; use Sil\SilAuth\models\User; use PHPUnit\Framework\TestCase; class UserTest extends TestCase { public function testChangingAnExistingUuid() { // Arrange: $user = new User(); // Pre-assert: $this->assertTrue($user->save());...
Add support for pit.only(), parity with it.only()
function install(globalObject) { if (!globalObject.jasmine) { throw new Error( 'It looks like you\'re trying to install jasmine-pit before installing ' + 'jasmine! Make sure there is a `jasmine` property on the global object ' + '(window/global/etc) before calling install().' ); } var j...
function install(globalObject) { if (!globalObject.jasmine) { throw new Error( 'It looks like you\'re trying to install jasmine-pit before installing ' + 'jasmine! Make sure there is a `jasmine` property on the global object ' + '(window/global/etc) before calling install().' ); } var j...
Add additional check if plugin has already been registered
/** * Install plugin. */ import Url from './url/index'; import Http from './http/index'; import Promise from './promise'; import Resource from './resource'; import Util, {options} from './util'; function plugin(Vue) { if (plugin.installed) { return; } Util(Vue); Vue.url = Url; Vue.htt...
/** * Install plugin. */ import Url from './url/index'; import Http from './http/index'; import Promise from './promise'; import Resource from './resource'; import Util, {options} from './util'; function plugin(Vue) { if (plugin.installed) { return; } Util(Vue); Vue.url = Url; Vue.htt...
Use common colors, Reset after message. Switch to colors that don't mess up on using light color schemes.
import os import logging import types import json import six class JsonFormatter(logging.Formatter): def format(self, record): data = { "level": record.levelno, "levelName": record.levelname, "msg": logging.Formatter.format(self, record) } if type(re...
import os import logging import types import json import six class JsonFormatter(logging.Formatter): def format(self, record): data = { "level": record.levelno, "levelName": record.levelname, "msg": logging.Formatter.format(self, record) } if type(re...
Split delay configuration into default_delay and specific_delays
import threading import collections import itertools import time import zephyr class DelayedRealTimeStream(threading.Thread): def __init__(self, signal_collector, callbacks, default_delay, specific_delays={}): threading.Thread.__init__(self) self.signal_collector = signal_collector ...
import threading import collections import itertools import time import zephyr class DelayedRealTimeStream(threading.Thread): def __init__(self, signal_collector, callbacks, delay): threading.Thread.__init__(self) self.signal_collector = signal_collector self.callbacks = callb...
Replace get_the_post_thumbnail custom image tag generation.
<article id="post-<?php echo $singlePost->ID; ?>" <?php post_class('row'); ?>> <div class="small-12 medium-4 column"> <?php if (has_post_thumbnail( $singlePost->ID ) ) { $thumbnailId = get_post_thumbnail_id( $singlePost->ID ); $imageTitle = get_the_title( $thumbnailId ); ...
<article id="post-<?php echo $singlePost->ID; ?>" <?php post_class('row'); ?>> <div class="small-12 medium-4 column"> <?php if (has_post_thumbnail( $singlePost->ID ) ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id( $singlePost->ID ), 'large' ); ?> ...
Fix unit test to sign action creators
import * as signUpActions from './signUp'; import reducer from './signUp'; describe('signUp reducer', () => { it('should return the initial state', () => { expect( reducer(undefined, {}) ).toEqual({ isFetchingSuccessful: false, isFetching: false, errorMessage: {} } ) ...
import * as signUpActions from './signUp'; import reducer from './signUp'; describe('signUp reducer', () => { it('should return the initial state', () => { expect( reducer(undefined, {}) ).toEqual({ isFetchingSuccessful: false, isFetching: false, errorMessage: {} } ) ...
Refactor if statement for clarity.
import React from 'react'; import { Link } from 'react-router-dom'; import { Button } from 'react-bootstrap'; import ModifyTitle from '../containers/ModifyTitle'; import ModifyIngredients from '../containers/ModifyIngredients'; import PropTypes from 'prop-types'; const ReviewRecipe = (props) => { return ( <div> ...
import React from 'react'; import { Link } from 'react-router-dom'; import { Button } from 'react-bootstrap'; import ModifyTitle from '../containers/ModifyTitle'; import ModifyIngredients from '../containers/ModifyIngredients'; import PropTypes from 'prop-types'; const ReviewRecipe = (props) => { return ( <div> ...
Split out the different headers into their own methods for greater flexibility.
function parseQString(qString) { var d = /^\s*q=([01](?:\.\d+))\s*$/.exec(qString); if (!!d) { return 1; } return Number(d[1]); } function sortQArrayString(content) { var entries = content.split(','), sortData = []; entries.forEach(function(rec) { var s = rec.spl...
function parseQString(qString) { var d = /^\s*q=([01](?:\.\d+))\s*$/.exec(qString); if (!!d) { return 1; } return Number(d[1]); } function sortQArrayString(content) { var entries = content.split(','), sortData = []; entries.forEach(function(rec) { var s = rec.spl...
Change blocky renderer solution color
'use strict'; // Paint a single cell in the maze a solid color padded with a single px of // blank space. module.exports = function (maze, canvas, opts, x, y) { var cellSize = opts.cellSize; var colors = { '-2': 'dodgerblue', // Solution. '-1': 'dodgerblue', // Solution. '0': 'black'...
'use strict'; // Paint a single cell in the maze a solid color padded with a single px of // blank space. module.exports = function (maze, canvas, opts, x, y) { var cellSize = opts.cellSize; var colors = { '-2': 'red', // Solution. '-1': 'red', // Solution. '0': 'black', ...
Fix email address for pypi
#!/usr/bin/python # -*- coding: utf-8 -*- from setuptools import setup setup(name='rdspgbadger', version='1.2.0', description=("Fetch logs from RDS postgres instance and use them with " "pgbadger to generate a report."), url='http://github.com/fpietka/rds-pgbadger', author=...
#!/usr/bin/python # -*- coding: utf-8 -*- from setuptools import setup setup(name='rdspgbadger', version='1.2.0', description=("Fetch logs from RDS postgres instance and use them with " "pgbadger to generate a report."), url='http://github.com/fpietka/rds-pgbadger', author=...
Update context for one calendar
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool import datetime from django.utils.translation import ugettext as _ from events.models import CalendarEventsPlugin as CalendarEventsPluginModel from events.models import AllEventsPlugin as AllEventsPluginModel from events.models import Eve...
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool import datetime from django.utils.translation import ugettext as _ from events.models import CalendarEventsPlugin as CalendarEventsPluginModel from events.models import AllEventsPlugin as AllEventsPluginModel from events.models import Eve...
Fix the name for the installerDb field to match our conventions.
package org.opennms.netmgt.dao.db; import java.io.ByteArrayOutputStream; import java.io.PrintStream; public class PopulatedTemporaryDatabaseTestCase extends TemporaryDatabaseTestCase { private InstallerDb m_installerDb; private ByteArrayOutputStream m_outputStream; protected void se...
package org.opennms.netmgt.dao.db; import java.io.ByteArrayOutputStream; import java.io.PrintStream; public class PopulatedTemporaryDatabaseTestCase extends TemporaryDatabaseTestCase { private InstallerDb installerDb; private ByteArrayOutputStream m_outputStream; protected void setU...
Make modal close button more visible
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { actions } from '../../../store'; const ModalContent = connect( null, dispatch => { return { handleClose() { actions.hideModal(dispatch); } }; ...
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { actions } from '../../../store'; const ModalContent = connect( null, dispatch => { return { handleClose() { actions.hideModal(dispatch); } }; ...
Reset image when choosing new filter
package ui; import rgb.InvertRGBStrategy; import rgb.RGBStrategy; import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage; /** * Created by nick on 10/22/15. */ public class RGBPanel extends JPanel { private BufferedImage originalImage; private BufferedImage image; private RGBStra...
package ui; import rgb.InvertRGBStrategy; import rgb.RGBStrategy; import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage; /** * Created by nick on 10/22/15. */ public class RGBPanel extends JPanel { private BufferedImage image; private RGBStrategy converter; public RGBPanel(){ ...
Use the value accessor as the binding context for the template
// Expose plugin as an AMD module if AMD loader is present: (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['knockout', 'jquery'], factory); } else { window.ko.bindingHandlers.veil = factory(ko, jQuery); } }(function (ko, $) { 'use strict'; /** * A...
// Expose plugin as an AMD module if AMD loader is present: (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['knockout', 'jquery'], factory); } else { window.ko.bindingHandlers.veil = factory(ko, jQuery); } }(function (ko, $) { 'use strict'; /** * A...
Fix renderer problems in case of non-transit layer ids
/* * Copyright (C) 2017 con terra GmbH (info@conterra.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
/* * Copyright (C) 2017 con terra GmbH (info@conterra.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
Load all settings instead of explicit list for first login
import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { get } from '@ember/object'; import C from 'ui/utils/constants'; import { isDevBuild } from 'shared/utils/parse-version'; export default Route.extend({ access: service(), settings: service(), globalStore...
import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { get } from '@ember/object'; import C from 'ui/utils/constants'; import { isDevBuild } from 'shared/utils/parse-version'; export default Route.extend({ access: service(), settings: service(), globalStore...
Add instance methods to single player imports Fixes https://github.com/CookPete/react-player/issues/376
import React, { Component } from 'react' import { propTypes, defaultProps, DEPRECATED_CONFIG_PROPS } from './props' import { getConfig, omit, isEqual } from './utils' import Player from './Player' const SUPPORTED_PROPS = Object.keys(propTypes) export default function createSinglePlayer (activePlayer) { return clas...
import React, { Component } from 'react' import { propTypes, defaultProps, DEPRECATED_CONFIG_PROPS } from './props' import { getConfig, omit, isEqual } from './utils' import Player from './Player' const SUPPORTED_PROPS = Object.keys(propTypes) export default function createSinglePlayer (activePlayer) { return clas...
Improve the responses. In the case of the success the json was invalid. It required quotes
""" @author: Ferdinand E. Silva @email: ferdinandsilva@ferdinandsilva.com @website: http://ferdinandsilva.com """ import os from django.utils import simplejson as json class qqFileUploader(object): def __init__(self, allowedExtensions=None, sizeLimit=1024): self.allowedExtensions = allowedExtensions or [...
""" @author: Ferdinand E. Silva @email: ferdinandsilva@ferdinandsilva.com @website: http://ferdinandsilva.com """ import os class qqFileUploader(object): def __init__(self, allowedExtensions=None, sizeLimit=1024): self.allowedExtensions = allowedExtensions or [] self.sizeLimit = sizeLimit de...
Exit quickly to avoid side effects
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.wpi.first.wpilibj.templates.commands; import edu.wpi.first.wpilibj.buttons.JoystickButton; import edu.wpi.first.wpilibj.camera.AxisCamera; /** * * @author profplump */ public class ReadSetCamera extends ...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.wpi.first.wpilibj.templates.commands; import edu.wpi.first.wpilibj.buttons.JoystickButton; import edu.wpi.first.wpilibj.camera.AxisCamera; /** * * @author profplump */ public class ReadSetCamera extends ...
Tweak argument unpacking for rendering decorator. Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
<?php namespace Orchestra\View; use BadMethodCallException; class Decorator { /** * The registered custom macros. * * @var array */ protected $macros = []; /** * Registers a custom macro. * * @param string $name * @param \Closure $macro * * @return v...
<?php namespace Orchestra\View; use BadMethodCallException; class Decorator { /** * The registered custom macros. * * @var array */ protected $macros = []; /** * Registers a custom macro. * * @param string $name * @param \Closure $macro * * @return v...
Fix controller call for static methods
<?php namespace MicroFW\Routing; use MicroFW\Http\Response; use MicroFW\Http\IResponse; use MicroFW\Core\Exceptions\NotValidResponseException; class Router { /** @var array */ private $routes; public function __construct($routes) { $this->routes = $routes; } /** * Return respons...
<?php namespace MicroFW\Routing; use MicroFW\Http\Response; use MicroFW\Http\IResponse; use MicroFW\Core\Exceptions\NotValidResponseException; class Router { /** @var array */ private $routes; public function __construct($routes) { $this->routes = $routes; } /** * Return respons...
Make function name match the module name.
/*global define*/ define(function() { "use strict"; var context2DsByWidthAndHeight = {}; /** * Extract a pixel array from a loaded image. Draws the image * into a canvas so it can read the pixels back. * * @exports getImagePixels * * @param {Image} image The image to extract...
/*global define*/ define(function() { "use strict"; var context2DsByWidthAndHeight = {}; /** * Extract a pixel array from a loaded image. Draws the image * into a canvas so it can read the pixels back. * * @param {Image} image The image to extract pixels from. * * @returns {...
Add DataFile class to split words of a line and count it
#!/usr/bin/python # coding: latin-1 #------------------------------------------------------------------------------# # Artificial Intelligence - Bayes Classification Algorithms # # ============================================================================ # # Organization: HE-Arc Engineering ...
#!/usr/bin/python # coding: latin-1 #------------------------------------------------------------------------------# # Artificial Intelligence - Bayes Classification Algorithms # # ============================================================================ # # Organization: HE-Arc Engineering ...
Use glyphicons in the header so they download earlier.
/* * @flow */ import * as React from 'react'; import {getClassName} from './Bootstrap/GlyphiconNames'; export default function Navbar() { return ( <nav className="navbar navbar-default navbar-fixed-top navbar-inverse"> <div className="container-fluid"> <div className="navbar-header"> ...
/* * @flow */ import * as React from 'react'; export default function Navbar() { return ( <nav className="navbar navbar-default navbar-fixed-top navbar-inverse"> <div className="container-fluid"> <div className="navbar-header"> <a className="navbar-brand" href="/" onClick={(e: Syntheti...
Throw more applicable exception, and spell it right this time.
<?php namespace ComplexPie; class Data extends Extension { protected static $static_ext = array(); public static function add_static_extension($extpoint, $ext, $priority) { if ($extpoint === 'get' && !is_callable($ext)) { throw new \InvalidArgumentException("$ext is not cal...
<?php namespace ComplexPie; class Data extends Extension { protected static $static_ext = array(); public static function add_static_extension($extpoint, $ext, $priority) { if ($extpoint === 'get' && !is_callable($ext)) { throw new Excetpion("$ext is not callable"); ...
refactor(smButton): Use to manage css classes
(function() { 'use strict'; angular .module('semantic.ui.elements.button', []) .directive('smButton', smButton); smButton['$inject'] = ['$animate']; function smButton($animate) { return { restrict:'E', replace: true, transclude: true, template: setTemplate, link: function(s...
(function() { 'use strict'; angular .module('semantic.ui.elements.button', []) .directive('smButton', smButton); function smButton() { return { restrict:'E', replace: true, transclude: true, template: setTemplate, link: function(scope, element, attrs, ctrl, transclude) { ...
Add iterable to list of not allowed doubles types in specification
<?php namespace spec\PhpSpec\CodeAnalysis; use PhpSpec\CodeAnalysis\DisallowedScalarTypehintException; use PhpSpec\CodeAnalysis\NamespaceResolver; use PhpSpec\ObjectBehavior; use Prophecy\Argument; class StaticRejectingNamespaceResolverSpec extends ObjectBehavior { function let(NamespaceResolver $namespaceResolv...
<?php namespace spec\PhpSpec\CodeAnalysis; use PhpSpec\CodeAnalysis\NamespaceResolver; use PhpSpec\ObjectBehavior; use Prophecy\Argument; class StaticRejectingNamespaceResolverSpec extends ObjectBehavior { function let(NamespaceResolver $namespaceResolver) { $this->beConstructedWith($namespaceResolve...
Fix FBTest: again the inline editor can be async on Mac
function runTest() { FBTest.sysout("issue5755.START"); FBTest.openNewTab(basePath + "html/5755/issue5755.html", function (win) { FBTest.openFirebug(); var panel = FBTest.selectPanel("html"); if (FBTest.ok(panel, "Firebug must be opened and switched to HTML panel now.")) { ...
function runTest() { FBTest.sysout("issue5755.START"); FBTest.openNewTab(basePath + "html/5755/issue5755.html", function (win) { FBTest.openFirebug(); var panel = FBTest.selectPanel("html"); if (FBTest.ok(panel, "Firebug must be opened and switched to HTML panel now.")) { ...
Set the git author name and e-mail
import git import os from django.conf import settings from django.http import HttpResponseRedirect from django.shortcuts import render class SaveContentMixin(): """Save exam or question content to a git repository and to a database.""" # object = None # request = None # template_name = None ...
import git import os from django.conf import settings from django.http import HttpResponseRedirect from django.shortcuts import render class SaveContentMixin(): """Save exam or question content to a git repository and to a database.""" # object = None # request = None # template_name = None ...
Use string literals when declaring event listeners
<?php namespace NUSWhispers\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider { /** * The event listener mappings for the application. * * @var array */ protected $listen = [ 'NUSWhisp...
<?php namespace NUSWhispers\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider { /** * The event listener mappings for the application. * * @var array */ protected $listen = [ \NUSWhisp...
Allow the event sink host to be configured
'use strict' const ndjson = require('ndjson'), request = require('request'), zlib = require('zlib') module.exports = (readableObjectStream, eventWriteKey, eventSinkHost) => { const options = { url: `https://${eventSinkHost || 'event-sink.appuri.net'}/e?jsonConnectorApiKey=${eventWriteKey}`, ...
'use strict' const ndjson = require('ndjson'), request = require('request'), zlib = require('zlib') module.exports = (readableObjectStream, eventWriteKey) => { const options = { url: `https://event-sink.appuri.net/e?jsonConnectorApiKey=${eventWriteKey}`, headers: { 'Cont...
Update Laravel .htaccess to fix redirect loop on DirectoryIndex pages such as /tests/
(function(exports) { "use strict"; var request = require('request'); var Sink = require('pipette').Sink; var unzipper = require('../process-zip'); var fs = require('fs'); exports.downloadLaravel = function(grunt, init, done) { unzipper.processZip(request('https://github.com/laravel/laravel/archive/mast...
(function(exports) { "use strict"; var request = require('request'); var Sink = require('pipette').Sink; var unzipper = require('../process-zip'); var fs = require('fs'); exports.downloadLaravel = function(grunt, init, done) { unzipper.processZip(request('https://github.com/laravel/laravel/archive/mast...
Update name property, rename id in failed function call.
(function (env) { "use strict"; env.ddg_spice_rfc = function(api_result) { if (!api_result || api_result.error || api_result.message == "no results.") { return Spice.failed('request_for_comments'); } Spice.add({ id: "rfc", name: "Answer", ...
(function (env) { "use strict"; env.ddg_spice_rfc = function(api_result) { if (!api_result || api_result.error || api_result.message == "no results.") { return Spice.failed('rfc'); } Spice.add({ id: "rfc", name: "Reference", data: api_res...
Make sure django is 1.8 or higher
#!/usr/bin/env python """ Install wagtailvideos using setuptools """ with open('README.rst', 'r') as f: readme = f.read() from setuptools import find_packages, setup setup( name='wagtailvideos', version='0.1.11', description="A wagtail module for uploading and displaying videos in various codecs.", ...
#!/usr/bin/env python """ Install wagtailvideos using setuptools """ with open('README.rst', 'r') as f: readme = f.read() from setuptools import find_packages, setup setup( name='wagtailvideos', version='0.1.11', description="A wagtail module for uploading and displaying videos in various codecs.", ...
Add assert to num knots validation unit test
import h2o import numpy as np from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator from tests import pyunit_utils def knots_error(): # load and prepare California housing dataset np.random.seed(1234) data = h2o.H2OFrame( python_obj={'C1': list(np.random.randint(0, 9, size=1000)), ...
import h2o import numpy as np from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator from tests import pyunit_utils def knots_error(): # load and prepare California housing dataset np.random.seed(1234) data = h2o.H2OFrame( python_obj={'C1': list(np.random.randint(0, 9, size=1000)), ...
Move progressbar stuff to dedicated function
var QuestionView = function (data) { //View for the overview screen this.createProgressBar = function() { var answered = app.model.getCategoryAnswered(data); if (answered){ var progress = Math.round(answered.sizeFinished / answered.sizeQuestions); log('Current category progress: ' + progress); ...
var QuestionView = function (data) { //View for the overview screen this.initialize = function () { // View constructor if (app.loggedin == true){ //Show all categories log('Loading question..'); result = app.model.getQuestion(data); if (result){ ...
Handle toJSON call with missing this.data
"use strict"; var util = require("util"); var AbstractError = require("./AbstractError.js"), defaultRenderer = require("./defaultRenderer.js"); /** * generate Error-classes based on AbstractError * * @param error * @returns {Function} */ function erroz(error) { var errorFn = function (data) { ...
"use strict"; var util = require("util"); var AbstractError = require("./AbstractError.js"), defaultRenderer = require("./defaultRenderer.js"); /** * generate Error-classes based on AbstractError * * @param error * @returns {Function} */ function erroz(error) { var errorFn = function (data) { ...
Fix form submission bug in comment dialog
;(function($, ns) { ns.Comment = chorus.dialogs.Base.extend({ className : "comment", title : t("comments.new_dialog.title"), persistent : true, events: { "submit form": "save" }, makeModel : function(options){ this._super("makeModel", options)...
;(function($, ns) { ns.Comment = chorus.dialogs.Base.extend({ className : "comment", title : t("comments.new_dialog.title"), persistent : true, events: { "submit form": "save" }, makeModel : function(options){ this._super("makeModel", options)...
Delete whitespace at line 7 Delete a white space for travis
from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User class ControlerLogoutTest(TestCase): """Unit test suite for testing the controler of Logout in the app: tosp_auth. Test that if the functionality of logout is correct. """...
from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User class ControlerLogoutTest(TestCase): """Unit test suite for testing the controler of Logout in the app: tosp_auth. Test that if the functionality of logout is correct. ""...
Fix for fixtures populator entity array
<?php namespace Kunstmaan\FixturesBundle\Populator; use Doctrine\Common\Collections\ArrayCollection; use Kunstmaan\FixturesBundle\Populator\Methods\MethodInterface; class Populator { /** * @var MethodInterface[] */ private $populators; public function __construct() { $this->popula...
<?php namespace Kunstmaan\FixturesBundle\Populator; use Doctrine\Common\Collections\ArrayCollection; use Kunstmaan\FixturesBundle\Populator\Methods\MethodInterface; class Populator { /** * @var MethodInterface[] */ private $populators; public function __construct() { $this->popula...
Make owner visible to superusers
from django.contrib import admin from .models import FileUpload class FileUploadAdmin(admin.ModelAdmin): def get_changeform_initial_data(self, request): return {'owner': request.user} def get_fields(self, request, obj=None): if request.user.is_superuser: return ['file', 'url_name...
from django.contrib import admin from .models import FileUpload class FileUploadAdmin(admin.ModelAdmin): readonly_fields = ['owner'] def get_fields(self, request, obj=None): if request.user.is_superuser: return ['file', 'url_name', 'owner'] else: return ['file', 'url_...
Allow `@tailwind screens` directive inside an at-rule
import _ from 'lodash' import postcss from 'postcss' import cloneNodes from '../util/cloneNodes' import buildMediaQuery from '../util/buildMediaQuery' export default function(config) { return function(css) { const screens = config().screens const responsiveRules = [] let finalRules = [] css.walkAtRu...
import _ from 'lodash' import postcss from 'postcss' import cloneNodes from '../util/cloneNodes' import buildMediaQuery from '../util/buildMediaQuery' export default function(config) { return function(css) { const screens = config().screens const responsiveRules = [] let finalRules = [] css.walkAtRu...
Use an IRC username that's not already registered.
from buildbot.status import html, words from buildbot.status.web.authz import Authz from .djangoauth import DjangoAuth authz = Authz( auth = DjangoAuth(), gracefulShutdown = 'auth', forceBuild = 'auth', forceAllBuilds = 'auth', pingBuilder = 'auth', stopBuild = 'auth', stopAllBuilds = 'auth...
from buildbot.status import html, words from buildbot.status.web.authz import Authz from .djangoauth import DjangoAuth authz = Authz( auth = DjangoAuth(), gracefulShutdown = 'auth', forceBuild = 'auth', forceAllBuilds = 'auth', pingBuilder = 'auth', stopBuild = 'auth', stopAllBuilds = 'auth...
Fix plotband label unmount crashing
import React, { useRef, useEffect, useState } from 'react'; import uuid from 'uuid/v4'; import { attempt } from 'lodash-es'; import useModifiedProps from '../UseModifiedProps'; import useAxis from '../UseAxis'; export default function usePlotBandLineLifecycle(props, plotType) { const { id = uuid, axisId, children, ....
import React, { useRef, useEffect, useState } from 'react'; import uuid from 'uuid/v4'; import { attempt } from 'lodash-es'; import useModifiedProps from '../UseModifiedProps'; import useAxis from '../UseAxis'; export default function usePlotBandLineLifecycle(props, plotType) { const { id = uuid, axisId, children, ....
Make check against None instead of falsey things.
import logging import lintreview.tools as tools from lintreview.diff import DiffCollection from lintreview.review import Problems from lintreview.review import Review log = logging.getLogger(__name__) class Processor(object): def __init__(self, client, number, head, target_path): self._client = client ...
import logging import lintreview.tools as tools from lintreview.diff import DiffCollection from lintreview.review import Problems from lintreview.review import Review log = logging.getLogger(__name__) class Processor(object): def __init__(self, client, number, head, target_path): self._client = client ...
Add Waldo joke and simplify HAL joke
import re from pal.services.service import Service from pal.services.service import wrap_response class JokeService(Service): _JOKES = { 'pod bay doors': "I'm sorry Jeff, I'm afraid I can't do that.", 'laws of robotics': "1. A robot may not injure a human being or, through...
import re from pal.services.service import Service from pal.services.service import wrap_response class JokeService(Service): _JOKES = { 'open the pod bay doors pal': "I'm sorry, Jeff, I'm afraid I can't do that.", 'laws of robotics': "1. A robot may not injure a human bei...
Sort fundraiser on newest on hp
from django.utils.timezone import now from apps.banners.models import Slide from apps.campaigns.models import Campaign from apps.fundraisers.models import FundRaiser from apps.projects.models import Project from apps.quotes.models import Quote from apps.statistics.models import Statistic # Instead of serving all the...
from django.utils.timezone import now from apps.banners.models import Slide from apps.campaigns.models import Campaign from apps.fundraisers.models import FundRaiser from apps.projects.models import Project from apps.quotes.models import Quote from apps.statistics.models import Statistic # Instead of serving all the...
Use API Deep Merge in all w4t
/** * Copyright (c) 2014 by Center Open Middleware. All Rights Reserved. * Titanium Appcelerator 3.3.0GA * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * App Base Development Framework Team * * Alejandro F.Carrera * Carlos Blanc...
/** * Copyright (c) 2014 by Center Open Middleware. All Rights Reserved. * Titanium Appcelerator 3.3.0GA * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * App Base Development Framework Team * * Alejandro F.Carrera * Carlos Blanc...
system: Fix typo for requiring L10nProvider files
<?php /** * Factory class for providing Localization implementations * @author M2Mobi, Heinz Wiesinger */ class L10nFactory { /** * Instance of the L10nProvider * @var array */ private static $lprovider; /** * Constructor */ public function __construct() { } ...
<?php /** * Factory class for providing Localization implementations * @author M2Mobi, Heinz Wiesinger */ class L10nFactory { /** * Instance of the L10nProvider * @var array */ private static $lprovider; /** * Constructor */ public function __construct() { } ...
Fix margins on index titles
@if (!$hideTitle && !empty($post_title)) @typography([ 'id' => 'mod-posts-' . $ID . '-label', 'element' => 'h4', 'variant' => 'h2', 'classList' => ['module-title'] ]) {!! apply_filters('the_title', $post_title) !!} @endtypography @endif <div class="o-grid"> @fo...
@if (!$hideTitle && !empty($post_title)) @typography(['element' => 'h2']) {!! apply_filters('the_title', $post_title) !!} @endtypography @endif <div class="o-grid"> @foreach ($items as $item) <div class="{{ apply_filters('Municipio/Controller/Archive/GridColumnClass', $columnClass) }}"> ...
[FIX] Fix issue on root directory
package com.freak.asteroid.randomiser; import android.app.Activity; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import java.io.File; public class MainActivity extends Activity { @Override pr...
package com.freak.asteroid.randomiser; import android.app.Activity; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import java.io.File; public class MainActivity extends Activity { @Override pr...
Comment out our global stuff for now
"""The application's Globals object""" import logging import inspect from tg import config from shove import Shove from moksha.exc import CacheBackendException from moksha.lib.cache import Cache log = logging.getLogger(__name__) class Globals(object): """Globals acts as a container for objects available throu...
"""The application's Globals object""" import logging import inspect from tg import config from shove import Shove from moksha.exc import CacheBackendException from moksha.lib.cache import Cache log = logging.getLogger(__name__) class Globals(object): """Globals acts as a container for objects available throu...
Set a user agent for the webhook if not provided
# Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. import logging import requests import json from django.utils.encoding import smart_text from awx.main.notifications.base import TowerBaseEmailBackend from awx.main.utils import get_awx_version logger = logging.getLogger('awx.main.notifications.webhook_backen...
# Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. import logging import requests import json from django.utils.encoding import smart_text from awx.main.notifications.base import TowerBaseEmailBackend logger = logging.getLogger('awx.main.notifications.webhook_backend') class WebhookBackend(TowerBaseEmailBac...
Remove the tabindex that flickity adds so it does not tab to it, rather it will tab to natural tabbable elements inside the hero area.
var Flickity = require('flickity'); (function(Flickity) { "use strict"; if(document.querySelector('.rotate') !== null) { new Flickity('.rotate', { on: { ready: function() { // Get the height of the first image that loaded and dynamically set the height ...
var Flickity = require('flickity'); (function(Flickity) { "use strict"; if(document.querySelector('.rotate') !== null) { new Flickity('.rotate', { on: { ready: function() { // Get the height of the first image that loaded and dynamically set the height ...
Move disconnect decision into Connection.handle
import asyncio from .message import Message class Connection: """ Communicates with an IRC network. Incoming data is transformed into Message objects, and sent to `listeners`. """ def __init__(self, listeners, host, port, ssl=True): self.listeners = listeners self.host = host ...
import asyncio from .message import Message class Connection: """ Communicates with an IRC network. Incoming data is transformed into Message objects, and sent to `listeners`. """ def __init__(self, listeners, host, port, ssl=True): self.listeners = listeners self.host = host ...
Remove magic numbers and print statements
package seedu.ezdo.model; import java.util.EmptyStackException; /* * Array-based implementation for a stack with fixed size. Used for undo & redo stacks. * If stack goes past max capacity, the oldest item to be pushed is replaced. */ public class FixedStack<T> { private int index; private T[] array; p...
package seedu.ezdo.model; import java.util.EmptyStackException; /* * Array-based implementation for a stack with fixed size. Used for undo & redo stacks. * If stack goes past max capacity, the oldest item to be pushed is replaced. */ public class FixedStack<T> { private int index; private T[] array; p...
Create a temp folder when project is being created
<?php namespace ActiveCollab\Shade\Command; use ActiveCollab\Shade\Project, ActiveCollab\Shade\Element\Video; use Symfony\Component\Console\Command\Command, Symfony\Component\Console\Input\InputInterface, Symfony\Component\Console\Output\OutputInterface; /** * Create a new project * * @package Activ...
<?php namespace ActiveCollab\Shade\Command; use ActiveCollab\Shade\Project, ActiveCollab\Shade\Element\Video; use Symfony\Component\Console\Command\Command, Symfony\Component\Console\Input\InputInterface, Symfony\Component\Console\Output\OutputInterface; /** * Create a new project * * @package Activ...
Fix hasNext method to only stop when play not have winned
package wumpus; import java.util.ArrayList; import java.util.Iterator; import java.util.NoSuchElementException; import wumpus.Environment.*; /** * The iteration of plays that the player can take until reaches its end. */ public class Runner implements Iterable<Player>, Iterator<Player> { private static final i...
package wumpus; import java.util.ArrayList; import java.util.Iterator; import java.util.NoSuchElementException; import wumpus.Environment.*; /** * The iteration of plays that the player can take until reaches its end. */ public class Runner implements Iterable<Player>, Iterator<Player> { private static final i...
Fix attempt to unset static property
<?php namespace Aedart\Scaffold\Cache; use Aedart\Scaffold\Containers\IoC; use Aedart\Scaffold\Contracts\Builders\IndexBuilder; use Illuminate\Contracts\Cache\Repository; /** * Cache Helper * * @author Alin Eugen Deac <aedart@gmail.com> * @package Aedart\Scaffold\Cache */ class CacheHelper { /** * Defau...
<?php namespace Aedart\Scaffold\Cache; use Aedart\Scaffold\Containers\IoC; use Aedart\Scaffold\Contracts\Builders\IndexBuilder; use Illuminate\Contracts\Cache\Repository; /** * Cache Helper * * @author Alin Eugen Deac <aedart@gmail.com> * @package Aedart\Scaffold\Cache */ class CacheHelper { /** * Defau...
Add repr to Deployment class
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.users import User class Deployment(GitHubCore): CUSTOM_HEADERS = { 'Accept': 'application/vnd.github.cannonball-preview+json' } def __init__(self, deployment, session=None): super(Deployment, self).__init__(dep...
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.users import User class Deployment(GitHubCore): CUSTOM_HEADERS = { 'Accept': 'application/vnd.github.cannonball-preview+json' } def __init__(self, deployment, session=None): super(Deployment, self).__init__(dep...
Use aggregation to namespace the connection id re #506
define(['backbone', '../models/dataset/connection'], function(Backbone, Connection) { 'use strict'; var ConnectionPool = Backbone.Collection.extend({ model: Connection, initialize: function(models, options) { this.dataset = options['dataset']; this.defaultCut =...
define(['backbone', '../models/dataset/connection'], function(Backbone, Connection) { 'use strict'; var ConnectionPool = Backbone.Collection.extend({ model: Connection, initialize: function(models, options) { this.dataset = options['dataset']; this.defaultCut =...
Add Model::newInstance() and create() methods example.
<?php /** * PunyApp: * The puny developer framework for rapid compiling. */ class SampleModel extends PunyApp_Model { public function addUser($userid, $email, $pass) { if ($this->isUserId($userid)) { return false; } $sample = $this->newInstance(); $sample->userid = $userid; $sample->...
<?php /** * PunyApp: * The puny developer framework for rapid compiling. */ class SampleModel extends PunyApp_Model { public function addUser($user_id, $email, $pass) { if ($this->isUserId($user_id)) { return false; } return $this->insert(array( 'userId' => ':userId', 'email' => ...
Add addType method to page
var registerMiddleware = require('./middleware'), registerModel = require('./model'), registerApi = require('./api'); module.exports = function setup(options, imports, register) { var frontend = imports.frontend.app, backend = imports.backend, content = imports.content, security = i...
var registerMiddleware = require('./middleware'), registerModel = require('./model'), registerApi = require('./api'); module.exports = function setup(options, imports, register) { var frontend = imports.frontend.app, backend = imports.backend, content = imports.content, security = i...
Use single quotes to reflect the existing conversion
var kickass = require('../index'); var params = { q: 'test', field:'seeders', order:'desc' } describe('kickass', function(){ it('should contain an array of torrents', function(done) { kickass(params, function(err, result) { expect(err).toBeNull(); expect(result.list.length).n...
var kickass = require('../index'); var params = { q: 'test', field:'seeders', order:'desc' } describe('kickass', function(){ it('should contain an array of torrents', function(done) { kickass(params, function(err, result) { expect(err).toBeNull(); expect(result.list.length).n...
Switch from arrays to Sets
import normalizeEvents from './tools/normalizeEvents'; import normalizeListener from './tools/normalizeListener'; export default function stereo () { let listeners = {}; let emitter = { on(events, listener) { // Normalize arguments. events = normalizeEvents(events); listener = normalizeListe...
import normalizeEvents from './tools/normalizeEvents'; import normalizeListener from './tools/normalizeListener'; export default function stereo () { let listeners = {}; let emitter = { on(events, listener) { // Normalize arguments. events = normalizeEvents(events); listener = normalizeListe...
Fix compilation issue on not latest JDKs
/* * (c) 2015 CenturyLink. 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 applicable law or a...
/* * (c) 2015 CenturyLink. 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 applicable law or a...
Use more robust quickfix parser. The yamllint implementation had some issues that the common code does not.
import os import logging from lintreview.tools import Tool from lintreview.tools import run_command, process_quickfix from lintreview.utils import in_path log = logging.getLogger(__name__) class Yamllint(Tool): name = 'yamllint' def check_dependencies(self): """ See if yamllint is on the PA...
import os import logging from lintreview.tools import Tool from lintreview.tools import run_command from lintreview.utils import in_path log = logging.getLogger(__name__) class Yamllint(Tool): name = 'yamllint' def check_dependencies(self): """ See if yamllint is on the PATH """ ...
Change the exception with a more sensible one
<?php namespace Ojs\JournalBundle\Entity; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\NoResultException; /** * ArticleFileRepository * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class ArticleFileRepository extends EntityRepository { /** * Get...
<?php namespace Ojs\JournalBundle\Entity; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\NoResultException; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; /** * ArticleFileRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. ...
[IMP] Add debug assets to HTTP cases
# -*- coding: utf-8 -*- # Copyright <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp.tests.common import HttpCase, TransactionCase class SomethingCase(TransactionCase): def setUp(self, *args, **kwargs): super(SomethingCase, self).setUp(*args, **kwargs) ...
# -*- coding: utf-8 -*- # Copyright <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp.tests.common import HttpCase, TransactionCase class SomethingCase(TransactionCase): def setUp(self, *args, **kwargs): super(SomethingCase, self).setUp(*args, **kwargs) ...
Allow for error handler to be passed as parameter So that errors can be properly handled in cases like Promises etc.
(function(){ module.exports = concat var fs = require('fs') function concat(files, target, done, errFunction){ validateInputs(files, target, done, errFunction) var writeStream = fs.createWriteStream(target, {flags: 'a'}) writeFiles(files.reverse(), writeStream, done, errFunction) } fun...
(function(){ module.exports = concat var fs = require('fs') function concat(files, target, done){ validateInputs(files, target, done) var writeStream = fs.createWriteStream(target, {flags: 'a'}) writeFiles(files.reverse(), writeStream, done) } function writeFiles(files, writeStream, ca...
Add retry for socket error
import socket from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException from deployer.util import retry __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): ...
from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): if isinstance(result.result, TaskExecutionEx...
Add missing EDUPUB property "seriespage"
package com.adobe.epubcheck.vocab; public class StagingEdupubVocab { public static final String URI = "http://www.idpf.org/epub/vocab/structure/#"; public static final Vocab VOCAB = new EnumVocab(EPUB_TYPES.class, URI); public static enum EPUB_TYPES { ABSTRACT, ANSWER, ANSWERS, ASSESSMENTS, ...
package com.adobe.epubcheck.vocab; public class StagingEdupubVocab { public static final String URI = "http://www.idpf.org/epub/vocab/structure/#"; public static final Vocab VOCAB = new EnumVocab(EPUB_TYPES.class, URI); public static enum EPUB_TYPES { ABSTRACT, ANSWER, ANSWERS, ASSESSMENTS, ...
Set status to 5 - Production/Stable Signed-off-by: Chris Warrick <de6f931166e131a07f31c96c765aee08f061d1a5@gmail.com>
#!/usr/bin/env python # -*- encoding: utf-8 -*- import io from setuptools import setup with open('requirements.txt', 'r') as fh: dependencies = [l.strip() for l in fh] setup(name='coil', version='1.3.1', description='A user-friendly CMS frontend for Nikola.', keywords='coil,nikola,cms', au...
#!/usr/bin/env python # -*- encoding: utf-8 -*- import io from setuptools import setup with open('requirements.txt', 'r') as fh: dependencies = [l.strip() for l in fh] setup(name='coil', version='1.3.1', description='A user-friendly CMS frontend for Nikola.', keywords='coil,nikola,cms', au...
Set searchableEntity Id in constructor In order to break earlier if there is no primary key
<?php namespace Algolia\SearchBundle\Searchable; use Algolia\SearchBundle\Normalizer\SearchableArrayNormalizer; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Serializer\Serializer; class SearchableEntity implements SearchableEntityInterface { private $id; protected $index...
<?php namespace Algolia\SearchBundle\Searchable; use Algolia\SearchBundle\Normalizer\SearchableArrayNormalizer; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Serializer\Serializer; class SearchableEntity implements SearchableEntityInterface { protected $indexName; protect...
Add pypi links to issues and docs [ci skip]
"""colorise module setup script for distribution.""" from setuptools import setup import os def get_version(filename): with open(filename) as fh: for line in fh: if line.startswith('__version__'): return line.split('=')[-1].strip()[1:-1] setup( name='colorise', versi...
"""colorise module setup script for distribution.""" from setuptools import setup import os def get_version(filename): with open(filename) as fh: for line in fh: if line.startswith('__version__'): return line.split('=')[-1].strip()[1:-1] setup( name='colorise', versi...
Fix regression where unable to open file on remote.
from sublime_plugin import TextCommand from ...core.base_command import BaseCommand from ..github import open_file_in_browser class GsOpenFileOnRemoteCommand(TextCommand, BaseCommand): """ Open a new browser window to the web-version of the currently opened (or specified) file. If `preselect` is `True`,...
from sublime_plugin import TextCommand from ...common.file_and_repo import FileAndRepo from ..github import open_file_in_browser class GsOpenFileOnRemoteCommand(TextCommand, FileAndRepo): """ Open a new browser window to the web-version of the currently opened (or specified) file. If `preselect` is `Tru...
Change positioning of rows in spendings' index view
@extends('layout') @section('body') <div class="wrapper my-3"> <h2>{{ __('general.spendings') }}</h2> <div class="box mt-3"> @if (count($spendings)) @foreach ($spendings as $spending) <div class="box__section row"> <div class="...
@extends('layout') @section('body') <div class="wrapper my-3"> <h2>{{ __('general.spendings') }}</h2> <div class="box mt-3"> @if (count($spendings)) @foreach ($spendings as $spending) <div class="box__section row"> <div class="...
Remove redundant stacktrace from the test console
package io.quarkus.reactive.mssql.client; import java.net.ConnectException; import java.sql.SQLException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.w...
package io.quarkus.reactive.mssql.client; import java.net.ConnectException; import java.sql.SQLException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.w...