text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Remove unnecessary space from the dashboard items
import React, { PropTypes } from 'react'; const formatValue = (item, results) => { if (!results.hasOwnProperty(item.query)) { return '—'; } return (item.formatValue || (e => e))(results[item.query]); }; const Dashboard = props => ( <div className="dashboard"> {props.items.map(item => ( <div cla...
import React, { PropTypes } from 'react'; const formatValue = (item, results) => { if (!results.hasOwnProperty(item.query)) { return '—'; } return (item.formatValue || (e => e))(results[item.query]); }; const Dashboard = props => ( <div className="dashboard"> {props.items.map(item => ( <div cla...
Use a decorator style syntax in the event attribute
import UTILS from './utils'; import HELPERS from './helpers'; const eventAttributeName = 'jtml-event'; export default class Render { constructor(func) { this.func = func; this.html = ''; } render(data, events) { this.html = this.func(data, UTILS, HELPERS); this.fragment = UTILS.fragmentFromString(this.htm...
import UTILS from './utils'; import HELPERS from './helpers'; const eventAttributeName = 'jtml-event'; export default class Render { constructor(func) { this.func = func; this.html = ''; } render(data, events) { this.html = this.func(data, UTILS, HELPERS); this.fragment = UTILS.fragmentFromString(this.htm...
Add passlib as package requirement
from setuptools import setup, find_packages setup( name='DeviceHub', version='0.1', packages=find_packages(), url='https://github.com/eReuse/DeviceHub', license='AGPLv3 License', author='eReuse team', author_email='x.bustamante@ereuse.org', description='The DeviceHub is a Device Managem...
from setuptools import setup, find_packages setup( name='DeviceHub', version='0.1', packages=find_packages(), url='https://github.com/eReuse/DeviceHub', license='AGPLv3 License', author='eReuse team', author_email='x.bustamante@ereuse.org', description='The DeviceHub is a Device Managem...
internal-test-helpers: Convert `NamespacesAssert` to ES6 class
import { run } from '@ember/runloop'; import { NAMESPACES, NAMESPACES_BY_ID } from '@ember/-internals/metal'; export default class NamespacesAssert { constructor(env) { this.env = env; } reset() {} inject() {} assert() { let { assert } = QUnit.config.current; if (NAMESPACES.length > 0) { ...
import { run } from '@ember/runloop'; import { NAMESPACES, NAMESPACES_BY_ID } from '@ember/-internals/metal'; function NamespacesAssert(env) { this.env = env; } NamespacesAssert.prototype = { reset: function() {}, inject: function() {}, assert: function() { let { assert } = QUnit.config.current; if (...
Raise exception if path not found, os not found, or command execution fails.
import os, platform, subprocess # I intend to hide the Operating Specific details of opening a folder # here in this module. # # On Mac OS X you do this with "open" # e.g. "open '\Users\golliher\Documents\Tickler File'" # On Windows you do this with "explorer" # e.g. "explorer c:\Documents and Settings\Tickler Fi...
import os, platform # I intend to hide the Operating Specific details of opening a folder # here in this module. # # On Mac OS X you do this with "open" # e.g. "open '\Users\golliher\Documents\Tickler File'" # On Windows you do this with "explorer" # e.g. "explorer c:\Documents and Settings\Tickler File" # On Lin...
Fix rl mock for tests
var EventEmitter = require("events").EventEmitter; var sinon = require("sinon"); var util = require("util"); var _ = require("lodash"); var stub = { write : sinon.stub().returns(stub), moveCursor : sinon.stub().returns(stub), setPrompt : sinon.stub().returns(stub), close : sinon.stub().r...
var EventEmitter = require("events").EventEmitter; var sinon = require("sinon"); var util = require("util"); var _ = require("lodash"); var stub = { write : sinon.stub().returns(stub), moveCursor : sinon.stub().returns(stub), setPrompt : sinon.stub().returns(stub), close : sinon.stub().r...
Add input and random explainer to utility function.
from .base import * from .gradient_based import * from .misc import * from .pattern_based import * from .relevance_based import * def create_explainer(name, output_layer, patterns=None, to_layer=None, **kwargs): return { # Utility. "input": InputExplainer, "random": ...
from .base import * from .gradient_based import * from .misc import * from .pattern_based import * from .relevance_based import * def create_explainer(name, output_layer, patterns=None, to_layer=None, **kwargs): return { # Gradient based "gradient": GradientExplainer, ...
Set the __name__ on the traversal object
class Root(object): """ The main root object for any traversal """ __name__ = None __parent__ = None def __init__(self, request): pass def __getitem__(self, key): next_ctx = None if key == 'user': next_ctx = User() if key == 'domain': ...
class Root(object): """ The main root object for any traversal """ __name__ = None __parent__ = None def __init__(self, request): pass def __getitem__(self, key): next_ctx = None if key == 'user': next_ctx = User() if key == 'domain': ...
Add missing ? to palindrome-parsing
module.exports = function (data) { var firstLine = data.split('\n')[0]; switch (firstLine) { case 'ping': case 'say-hello': case 'fizzbuzz': case 'fibonacci': case 'nth-word': case 'sort': return firstLine; case '+': return 'add';...
module.exports = function (data) { var firstLine = data.split('\n')[0]; switch (firstLine) { case 'ping': case 'say-hello': case 'fizzbuzz': case 'palindrome': case 'fibonacci': case 'nth-word': case 'sort': return firstLine; case '+'...
Update of work over prior couple weeks.
import re import sys f = open ('/var/local/meTypesetTests/tests/testOutput/'+sys.argv[1] +'/nlm/out.xml', "r") print ("open operation complete") fd = f.read() s = '' fd = re.sub(r'\&lt.*?\&gt\;', ' ', fd) pattern = re.compile(r'(?:(&#\d*|>))(.*?)(?=(&#\d*|<))') for e in re.findall(pattern, fd): s += ' ' s += e[1] ...
import re import sys f = open ('/var/local/meTypesetTests/tests/testOutput/'+sys.argv[1] +'/nlm/out.xml', "r") print ("open operation complete") fd = f.read() s = '' fd = pattern = re.compile(r'(?:(&#\d*|>))(.*?)(?=(&#\d*|<))') for e in re.findall(pattern, fd): s += ' ' s += e[1] s = re.sub('-', ' ', s) s = re.sub...
Add Props Modified To Replace State Edited In Text Add props modified to replace the state edited in the text component since props modified is used throw out the application.
let React = require("react") let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") let {div, textarea} = React.DOM let cx = require("classnames") export default class extends React.Component { static displayName = "Frig.friggingBootstrap.Text" static defaultProps = Object.assign(require(".....
let React = require("react") let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") let {div, textarea} = React.DOM let cx = require("classnames") export default class extends React.Component { static displayName = "Frig.friggingBootstrap.Text" static defaultProps = Object.assign(require(".....
Allow specification of custom settings module using DJANGO_SETTINGS_MODULE environment variable.
# vim:ts=4:sts=4:sw=4:expandtab """The core of the system. Manages the database and operational logic. Functionality is exposed over Thrift. """ import sys import os def manage(): from django.core.management import execute_manager settings_module_name = os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sator...
# vim:ts=4:sts=4:sw=4:expandtab """The core of the system. Manages the database and operational logic. Functionality is exposed over Thrift. """ import os def manage(): from django.core.management import execute_manager import satori.core.settings # HACK import django.core.management old_fmm = ...
Fix misplaced dot, causing issues with routing
<?php namespace Onion\Framework\Middleware\Internal; use Interop\Http\Middleware\ServerMiddlewareInterface; use Interop\Http\Middleware\DelegateInterface; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ResponseInterface; use Zend\Diactoros\Request\Uri; class ModulePathStripperMiddleware ...
<?php namespace Onion\Framework\Middleware\Internal; use Interop\Http\Middleware\ServerMiddlewareInterface; use Interop\Http\Middleware\DelegateInterface; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ResponseInterface; use Zend\Diactoros\Request\Uri; class ModulePathStripperMiddleware ...
Add a route to admin/news
from flask import render_template, redirect, url_for, flash, request from flask.ext.login import login_required, current_user from . import admin from .forms import ProfileForm from .. import db from ..models import User @admin.route('/') @login_required def index(): return render_template('admin/user.html', user=...
from flask import render_template, redirect, url_for, flash, request from flask.ext.login import login_required, current_user from . import admin from .forms import ProfileForm from .. import db from ..models import User @admin.route('/') @login_required def index(): return render_template('admin/user.html', user=...
Fix bug in language selection switching https://github.com/globaleaks/GlobaLeaks/issues/452
GLClient.controller('toolTipCtrl', ['$scope', '$rootScope', 'Authentication', '$location', '$cookies', 'Translations', 'Node', '$route', function($scope, $rootScope, Authentication, $location, $cookies, Translations, Node, $route) { if (!$cookies['language']) $cookies['language'] = 'en'; $scope.s...
GLClient.controller('toolTipCtrl', ['$scope', '$rootScope', 'Authentication', '$location', '$cookies', 'Translations', 'Node', '$route', function($scope, $rootScope, Authentication, $location, $cookies, Translations, Node, $route) { if (!$cookies['language']) $cookies['language'] = 'en'; $scope.s...
Fix migration for the version checking
<?php use App\Instance; use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateInstanceTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::crea...
<?php use App\Instance; use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateInstanceTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::crea...
Fix errors if helper doesn't exist
<?php /** * Hackwork v2.0.0-beta (http://git.io/hackwork) * Licensed under the MIT License. */ /* * Paths * * Omit trailing slashes here. */ // Root define('ROOT', $_SERVER['DOCUMENT_ROOT']); define('PATH', ROOT); // Core define('CORE', PATH . '/core'); define('HELPERS', CORE . '/helpers'); // Layouts defin...
<?php /** * Hackwork v2.0.0-beta (http://git.io/hackwork) * Licensed under the MIT License. */ /* * Paths * * Omit trailing slashes here. */ // Root define('ROOT', $_SERVER['DOCUMENT_ROOT']); define('PATH', ROOT); // Core define('CORE', PATH . '/core'); define('HELPERS', CORE . '/helpers'); // Layouts defin...
Add validation for new columns
<?php namespace Rogue\Http\Requests\Three; use Rogue\Http\Requests\Request; class PostRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validati...
<?php namespace Rogue\Http\Requests\Three; use Rogue\Http\Requests\Request; class PostRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validati...
Set a subscription relationship for users
<?php namespace App\Data; use UserPresenter; use App\Authorization; use Illuminate\Notifications\Notifiable; use Laracasts\Presenter\PresentableTrait; use Illuminate\Foundation\Auth\Access\Authorizable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Authorizable, Aut...
<?php namespace App\Data; use UserPresenter; use App\Authorization; use Illuminate\Notifications\Notifiable; use Laracasts\Presenter\PresentableTrait; use Illuminate\Foundation\Auth\Access\Authorizable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Authorizable, Aut...
Change log level for 'Request accepted'
import * as Types from './types' const initialState = { server: {} } const mapServerState = (serverState, state) => { return { ...state, server: serverState } } export default (state = initialState, action) => { switch (action.type) { case Types.SERVER_STATE_LOADED: return m...
import * as Types from './types' const initialState = { server: {} } const mapServerState = (serverState, state) => { return { ...state, server: serverState } } export default (state = initialState, action) => { switch (action.type) { case Types.SERVER_STATE_LOADED: return m...
Clean up code and add comments
define(['jquery', 'DoughBaseComponent'], function($, DoughBaseComponent) { 'use strict'; var ClearInput, uiEvents = { 'keydown [data-dough-clear-input]' : 'updateResetButton', 'click [data-dough-clear-input-button]' : 'resetForm' }; ClearInput = function($el, config) { this.uiEvents...
define(['jquery', 'DoughBaseComponent'], function($, DoughBaseComponent) { 'use strict'; var ClearInput, uiEvents = { 'keydown [data-dough-clear-input]' : 'updateResetButton', 'click [data-dough-clear-input-button]' : 'resetForm' }; ClearInput = function($el, config) { var _this = t...
Make Mail Queueable by default
<?php namespace FlyingLuscas\BugNotifier\Drivers; use Illuminate\Support\Facades\Mail; use FlyingLuscas\BugNotifier\Message; class MailDriver extends Driver implements DriverInterface { /** * Send e-mail message. * * @param \FlyingLuscas\BugNotifier\Message $message * * @return void ...
<?php namespace FlyingLuscas\BugNotifier\Drivers; use Illuminate\Support\Facades\Mail; use FlyingLuscas\BugNotifier\Message; class MailDriver extends Driver implements DriverInterface { /** * Send e-mail message. * * @param \FlyingLuscas\BugNotifier\Message $message * * @return void ...
Use number generator with seed
var instances = require('./../taillard'); var seed = require('./../seed-random'); var NEH = require('./../neh'); // Iterate over filtered Taillard instances var filteredInstances = instances.filter(50, 20); for(var i = 0; i < filteredInstances.length; i++) { // Overwrite Math.random by number generator with seed ...
var instances = require('./../taillard'); var NEH = require('./../neh'); var seed = require('./../seed-random'); // Iterate over filtered Taillard instances var filteredInstances = instances.filter(50, 20); for(var i = 0; i < filteredInstances.length; i++) { // Overwrite Math.random by number generator with seed ...
Add list with list test.
import pytest from eche.reader import read_str from eche.printer import print_str import math @pytest.mark.parametrize("test_input", [ '1', '-1', '0', str(math.pi), str(math.e) ]) def test_numbers(test_input): assert print_str(read_str(test_input)) == test_input @pytest.mark.parametrize("t...
import pytest from eche.reader import read_str from eche.printer import print_str import math @pytest.mark.parametrize("test_input", [ '1', '-1', '0', str(math.pi), str(math.e) ]) def test_numbers(test_input): assert print_str(read_str(test_input)) == test_input @pytest.mark.parametrize("t...
Fix project name in license section
# Yith Library Web Client is a client for Yith Library Server. # Copyright (C) 2015 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # # This file is part of Yith Library Web Client. # # Yith Library Web Client is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pub...
# Yith Library Server is a password storage server. # Copyright (C) 2015 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # # This file is part of Yith Library Server. # # Yith Library Server is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publ...
III-680: Use complete class name for Integer type hinting in docblocks to prevent IDE confusion with int.
<?php /** * @file */ namespace CultuurNet\UDB3\Search; use ValueObjects\Number\Integer; class Results { /** * @var array */ private $items; /** * @var Integer */ private $totalItems; /** * @param array $items * @param \ValueObjects\Number\Integer $totalItems ...
<?php /** * @file */ namespace CultuurNet\UDB3\Search; use ValueObjects\Number\Integer; class Results { /** * @var array */ private $items; /** * @var Integer */ private $totalItems; /** * @param array $items * @param Integer $totalItems */ public functi...
Fix a bug in the clock runner
pull.component('clockRunKiller', function () { var s = this var g = s.generic var ls = s.localStorageAdapter return [ kickOff , toggleRun ] /* Initializes a new counter */ function kickOff () { makeMaster() s.periodControl.newPeriod('run') ls.resetState() ls.setRunning() } /*...
pull.component('clockRunKiller', function () { var s = this var g = s.generic var ls = s.localStorageAdapter return [ kickOff , toggleRun ] /* Initializes a new counter */ function kickOff () { makeMaster() s.periodControl.newPeriod('run') ls.resetState() ls.setRunning() } /*...
Handle newlines in proposed json
<?php require_once("utilities.php"); $file = fopen("cached/proposed.json","w"); $count = 0; $result = doUnprotectedQuery("SELECT pv_id, pv_name, pv_lat, pv_lng, pv_images, pv_population, pv_dev_problem, DATE_FORMAT(pv_date_added, '%M %e, %Y') AS dateAdded FROM proposed_villages WHERE pv_promoted=0"); while ($row = $re...
<?php require_once("utilities.php"); $file = fopen("cached/proposed.json","w"); $count = 0; $result = doUnprotectedQuery("SELECT pv_id, pv_name, pv_lat, pv_lng, pv_images, pv_population, pv_dev_problem, DATE_FORMAT(pv_date_added, '%M %e, %Y') AS dateAdded FROM proposed_villages WHERE pv_promoted=0"); while ($row = $re...
Rename class to match intent
from twisted.web.server import Site, Request class AddSecurityHeadersRequest(Request): CSP_HEADER_VALUES = "default-src 'self'; style-src 'self' 'unsafe-inline'" def process(self): self.setHeader('Content-Security-Policy', self.CSP_HEADER_VALUES) self.setHeader('X-Content-Security-Policy', se...
from twisted.web.server import Site, Request class AddCSPHeaderRequest(Request): CSP_HEADER_VALUES = "default-src 'self'; style-src 'self' 'unsafe-inline'" def process(self): self.setHeader('Content-Security-Policy', self.CSP_HEADER_VALUES) self.setHeader('X-Content-Security-Policy', self.CSP...
Fix an import error. pylons.config doesn't exist anymore, use pylons.configuration --HG-- branch : trunk
"""Base objects to be exported for use in Controllers""" from paste.registry import StackedObjectProxy from pylons.configuration import config __all__ = ['app_globals', 'c', 'cache', 'config', 'g', 'request', 'response', 'session', 'tmpl_context', 'url'] def __figure_version(): try: from pkg_r...
"""Base objects to be exported for use in Controllers""" from paste.registry import StackedObjectProxy from pylons.config import config __all__ = ['app_globals', 'c', 'cache', 'config', 'g', 'request', 'response', 'session', 'tmpl_context', 'url'] def __figure_version(): try: from pkg_resource...
Remove % wrappers for node environment variables, fix forEach print to only print first argument.
var fs = require('fs'); var environmentVariables = [ "WEBSITE_SITE_NAME", "WEBSITE_SKU", "WEBSITE_COMPUTE_MODE", "WEBSITE_HOSTNAME", "WEBSITE_INSTANCE_ID", "WEBSITE_NODE_DEFAULT_VERSION", "WEBSOCKET_CONCURRENT_REQUEST_LIMIT", "APPDATA", "TMP", "WEBJOBS_PATH", "WEBJOBS_NAME",...
var fs = require('fs'); var environmentVariables = [ "WEBSITE_SITE_NAME", "WEBSITE_SKU", "WEBSITE_COMPUTE_MODE", "WEBSITE_HOSTNAME", "WEBSITE_INSTANCE_ID", "WEBSITE_NODE_DEFAULT_VERSION", "WEBSOCKET_CONCURRENT_REQUEST_LIMIT", "%APPDATA%", "%TMP%" ] module.exports = function (contex...
Add Bitters partials to Gulp paths to watch for changes Closes #207
var gulp = require("gulp"), autoprefix = require("gulp-autoprefixer"), sass = require("gulp-sass"), connect = require("gulp-connect"), bourbon = require("node-bourbon").includePaths; var paths = { scss: [ "./app/assets/stylesheets/**/*.scss", "./contrib/*.scss" ] }; gulp.task("sass", function () {...
var gulp = require("gulp"), autoprefix = require("gulp-autoprefixer"), sass = require("gulp-sass"), connect = require("gulp-connect"), bourbon = require("node-bourbon").includePaths; var paths = { scss: "./contrib/*.scss" }; gulp.task("sass", function () { return gulp.src(paths.scss) .pipe(sass({ ...
Use default 'django' logger to facilitate logging configuration (default config enabled console output).
""" Import the required subclasses of :class:`~qrcode.image.base.BaseImage` from the qrcode library with a fallback to SVG format when the Pillow library is not available. """ import logging from qrcode.image.svg import SvgPathImage as _SvgPathImage logger = logging.getLogger('django') try: from qrcode.image.pil im...
""" Import the required subclasses of :class:`~qrcode.image.base.BaseImage` from the qrcode library with a fallback to SVG format when the Pillow library is not available. """ import logging from qrcode.image.svg import SvgPathImage as _SvgPathImage logger = logging.getLogger(__name__) try: from qrcode.image.pil im...
Update Sami theme as default.
<?php use Sami\Sami; use Sami\Version\GitVersionCollection; use Symfony\Component\Finder\Finder; $iterator = Finder::create() ->files() ->name('*.php') ->exclude('Resources') ->in($dir = 'src'); $versions = GitVersionCollection::create($dir) ->add('develop', 'develop branch') ->add('master', ...
<?php use Sami\Sami; use Sami\Version\GitVersionCollection; use Symfony\Component\Finder\Finder; $iterator = Finder::create() ->files() ->name('*.php') ->exclude('Resources') ->in($dir = 'src'); $versions = GitVersionCollection::create($dir) ->add('develop', 'develop branch') ->add('master', ...
Functional: Fix mesos baymodel creation case Mesos expects a docker network driver type. Partially implements: blueprint mesos-functional-testing Change-Id: I74946b51c9cb852f016c6e265d1700ae8bc3aa17
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
Clean content types table and don't load tags when running loaddata
import sys from django.apps import AppConfig from django.conf import settings from common.helpers.db import db_is_initialized class CommonConfig(AppConfig): name = 'common' def ready(self): self.display_missing_environment_variables() from common.helpers.tags import import_tags_from_csv ...
from django.apps import AppConfig from django.conf import settings from common.helpers.db import db_is_initialized class CommonConfig(AppConfig): name = 'common' def ready(self): self.display_missing_environment_variables() from common.helpers.tags import import_tags_from_csv if db_is...
Disable now-unused Sentry performance traces
/* eslint no-console:0 */ // This file is automatically compiled by Webpack, along with any other files // present in this directory. You're encouraged to place your actual application logic in // a relevant structure within app/javascript and only use these pack files to reference // that code so it'll be compiled. //...
/* eslint no-console:0 */ // This file is automatically compiled by Webpack, along with any other files // present in this directory. You're encouraged to place your actual application logic in // a relevant structure within app/javascript and only use these pack files to reference // that code so it'll be compiled. //...
Use the proper column implementation.
/* * Copyright 2020, TeamDev. All rights reserved. * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following * disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR...
/* * Copyright 2020, TeamDev. All rights reserved. * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following * disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR...
Change name displayed for desktop streaming device in the media configuration panel.
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.neomedia.device; import javax.media.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; import net.java.si...
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.neomedia.device; import javax.media.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; import net.java.si...
Switch to a mutation timestamp
import logging from followthemoney import model from servicelayer.worker import Worker from ingestors.manager import Manager log = logging.getLogger(__name__) class IngestWorker(Worker): """A long running task runner that uses Redis as a task queue""" def dispatch_next(self, task, entities): next_s...
import logging from followthemoney import model from servicelayer.worker import Worker from ingestors.manager import Manager log = logging.getLogger(__name__) class IngestWorker(Worker): """A long running task runner that uses Redis as a task queue""" def dispatch_next(self, task, entities): next_s...
Remove test data from database after tests are run
var chai = require('chai'); var expect = chai.expect; var models = require('../server/db/models'); var request = require('request'); var localServerUri = 'http://127.0.0.1:3000/'; var GETUri = localServerUri + '?x=100.123456&y=-50.323&z=14.4244'; var testData = {x: 100.123456, y: -50.323, z: 14.4244, message: 'hello da...
var chai = require('chai'); var expect = chai.expect; var models = require('../server/db/models'); var request = require('request'); var localServerUri = 'http://127.0.0.1:3000/'; var GETUri = localServerUri + '?x=100.123456&y=-50.323&z=14.4244'; var testData = {x: 100.123456, y: -50.323, z: 14.4244, message: 'hello da...
Update generateToken() to return JSONResponse
<?php /** * ownCloud - oauth2 * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Jonathan Neugebauer * @copyright Jonathan Neugebauer 2016 */ namespace OCA\OAuth2\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONRespons...
<?php /** * ownCloud - oauth2 * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Jonathan Neugebauer * @copyright Jonathan Neugebauer 2016 */ namespace OCA\OAuth2\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataRespons...
Use different prop in test to prevent prop type warning
import React from 'react'; // eslint-disable-line no-unused-vars import { shallow } from 'enzyme'; import Button from '../Button'; import Icon from '../Icon'; describe('Button', () => { it('fires the onClick handler when clicked', () => { const onClick = jest.fn(); const button = shallow(<Button onClick={on...
import React from 'react'; // eslint-disable-line no-unused-vars import { shallow } from 'enzyme'; import Button from '../Button'; import Icon from '../Icon'; describe('Button', () => { it('fires the onClick handler when clicked', () => { const onClick = jest.fn(); const button = shallow(<Button onClick={on...
Fix bug with GH-1 for root-installations. The change made in dd0ecf4 fixed the URLs for Confluence installations in non-root paths (e.g., http://foo.example.com/confluence/*), but that broke root installations, because URI#resolve() interprets "//foo/bar" to mean that the host should become "foo". Instead of using ge...
package com.myyearbook.hudson.plugins.confluence; import java.net.URI; /** * Utility methods * * @author Joe Hansche <jhansche@myyearbook.com> */ public class Util { /** Relative path to resolve the XmlRpc endpoint URL */ private static final String XML_RPC_URL_PATH = "rpc/xmlrpc"; /** Relative pat...
package com.myyearbook.hudson.plugins.confluence; import java.net.URI; import java.util.logging.Logger; /** * Utility methods * * @author Joe Hansche <jhansche@myyearbook.com> */ public class Util { private static final Logger LOGGER = Logger.getLogger(Util.class.getName()); /** Relative path to resolve ...
Change to stacked inline for occurrences, also display location.
from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin from fullcalendar.models import * class EventCategoryAdmin(admin.ModelAdmin): list_display = ('name',) class OccurrenceInline(StackedDynamicInlineA...
from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from mezzanine.core.admin import TabularDynamicInlineAdmin, DisplayableAdmin from fullcalendar.models import * class EventCategoryAdmin(admin.ModelAdmin): list_display = ('name',) class OccurrenceInline(TabularDynamicInlineA...
Use production build of React when deploying
const path = require('path'); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const config = { entry: { 'bundle': './client/js/index.js' }, output: { path: path.join(__dirname, 'dist'), filename: '[name].js' }, module: { loaders: [ { ...
const path = require('path'); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const config = { entry: { 'bundle': './client/js/index.js' }, output: { path: path.join(__dirname, 'dist'), filename: '[name].js' }, module: { loaders: [ { ...
Use branch name instead of username
#!/usr/bin/env python from __future__ import print_function import requests import argparse import os import subprocess import sys if 'DAALA_ROOT' not in os.environ: print("Please specify the DAALA_ROOT environment variable to use this tool.") sys.exit(1) keyfile = open('secret_key','r') key = keyfile.read(...
#!/usr/bin/env python from __future__ import print_function import requests import argparse import os import subprocess import sys if 'DAALA_ROOT' not in os.environ: print("Please specify the DAALA_ROOT environment variable to use this tool.") sys.exit(1) keyfile = open('secret_key','r') key = keyfile.read(...
Add error treatment for existing network
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from neutron.openstack.common import log as logger from oslo.config import cfg LOG = logger.getLogger(__name__) class Manager: def __init__(self): ...
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from oslo.config import cfg class Manager: def __init__(self): self.rpc = rpc.RPC(cfg.CONF.ml2_datacom.dm_username, ...
Prepend js, improving load times
<?php class Analytics_PageTool extends PageTool { /** * Google Analytics. * This simple PageTool doesn't have any functionality in the go() method. * Instead, pass the tracking code into the track() method. */ public function go($api, $dom, $template, $tool) { } /** * Injects the required JavaScript code where ne...
<?php class Analytics_PageTool extends PageTool { /** * Google Analytics. * This simple PageTool doesn't have any functionality in the go() method. * Instead, pass the tracking code into the track() method. */ public function go($api, $dom, $template, $tool) { } /** * Injects the required JavaScript code where ne...
Fix article size in spinner
<!-- Spinner story --> <div> <div class="felix-featured-caption"><a href="<?php echo $article->getURL();?>"><?php echo $article->getTitle(); ?></a></div> <div class="felix-featured-image"> <?php if ($image = $article->getImage()) { ?> <a href="<?php echo $article->getURL();?>"> <...
<!-- Spinner story --> <div> <div class="felix-featured-caption"><a href="<?php echo $article->getURL();?>"><?php echo $article->getTitle(); ?></a></div> <div class="felix-featured-image"> <?php if ($image = $article->getImage()) { ?> <a href="<?php echo $article->getURL();?>"> <...
Change fixture for image example.
import { ProseEditor, ProseEditorConfigurator, EditorSession, ProseEditorPackage, ImagePackage } from 'substance' /* Example document */ const fixture = function(tx) { let body = tx.get('body') tx.create({ id: 'p1', type: 'paragraph', content: "Insert a new image using the image tool." }) bod...
import { ProseEditor, ProseEditorConfigurator, EditorSession, ProseEditorPackage, ImagePackage } from 'substance' /* Example document */ const fixture = function(tx) { let body = tx.get('body') tx.create({ id: 'p1', type: 'paragraph', content: "Insert a new image using the image tool." }) bod...
[User] Remove deprecated implementations of setDefaultOptions.
<?php namespace Clastic\SecurityBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files. * * To learn more see {@link http://s...
<?php namespace Clastic\SecurityBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files. * * To learn more see {@link http://s...
core: Fix ISO Domain List refresh NPE Fix ISO DomainList refresh NPE when no ISO domain is configured. Change-Id: Ied2b1490d8f66bb40f6f456d2d39bb05120e97d3 Bug-Url: https://bugzilla.redhat.com/1291202 Signed-off-by: Marek Libra <e8e92ef0eef30bdb5bafbacaf4ac8261fffd12ff@redhat.com>
package org.ovirt.engine.core.bll; import java.util.ArrayList; import java.util.List; import org.ovirt.engine.core.common.businessentities.storage.RepoImage; import org.ovirt.engine.core.common.queries.GetImagesListParametersBase; import org.ovirt.engine.core.compat.Guid; public abstract class GetImagesListQueryBas...
package org.ovirt.engine.core.bll; import java.util.List; import org.ovirt.engine.core.common.businessentities.storage.RepoImage; import org.ovirt.engine.core.common.queries.GetImagesListParametersBase; import org.ovirt.engine.core.compat.Guid; public abstract class GetImagesListQueryBase<P extends GetImagesListPar...
Use a real model in test Fake object wasn't working anymore since this component is now loading more data.
import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; import { setupMirage } from 'ember-cli-mirage/test-support'; module('Integration | Component | course sessions', function(hooks) { setupR...
import EmberObject from '@ember/object'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; module('Integration | Component | course sessions', function(hooks) { setupRenderingTest(hooks);...
Include more files inside the package.
from setuptools import setup, find_packages setup(name='DStarSniffer', version='pre-1.0', description='DStar repeater controller sniffer', url='http://github.com/elielsardanons/dstar-sniffer', author='Eliel Sardanons LU1ALY', author_email='eliel@eliel.com.ar', license='MIT', p...
from setuptools import setup, find_packages setup(name='DStarSniffer', version='pre-1.0', description='DStar repeater controller sniffer', url='http://github.com/elielsardanons/dstar-sniffer', author='Eliel Sardanons LU1ALY', author_email='eliel@eliel.com.ar', license='MIT', p...
Fix for timeout after finish.
'use strict'; exports.delayed = function delayed(ms, value) { return new Promise(resolve => setTimeout(() => resolve(value), ms)); }; exports.timeoutError = 'timeoutError'; /** * Waits a promise for specified timeout. * * @param {Promise} promiseToWait - promise to wait. * @param {number} ms - timeout in milli...
'use strict'; exports.delayed = function delayed(ms, value) { return new Promise(resolve => setTimeout(() => resolve(value), ms)); }; exports.timeoutError = 'timeoutError'; /** * Waits a promise for specified timeout. * * @param {Promise} promiseToWait - promise to wait. * @param {number} ms - timeout in milli...
Reformat HEADER_LENGTH calc slightly for readability
// Copyright (c) 2010 AFP Authors // This source code is released under the terms of the // MIT license. Please see the file LICENSE for license details. package afp import ( "os" "log" ) const CHAN_BUF_LEN = 64 //Constants to specify the type of a given filter const ( PIPE_SOURCE = iota PIPE_SINK PIPE_LINK ) ...
// Copyright (c) 2010 AFP Authors // This source code is released under the terms of the // MIT license. Please see the file LICENSE for license details. package afp import ( "os" "log" ) const CHAN_BUF_LEN = 64 //Constants to specify the type of a given filter const ( PIPE_SOURCE = iota PIPE_SINK PIPE_LINK ) ...
Use active flag instead of selected flag
/* * Copyright (c) 2014 mono * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distr...
/* * Copyright (c) 2014 mono * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distr...
Fix encoding error preventing install While running tox the installation of icecake would succeed under Python 2.7.13 but fail under 3.5.2 with an encoding error while trying to read the long description from README.rst. py35 inst-nodeps: /icecake/.tox/dist/icecake-0.6.0.zip ERROR: invocation failed (exit code 1), lo...
from setuptools import setup, find_packages from codec import open setup( # packaging information that is likely to be updated between versions name='icecake', version='0.6.0', packages=['icecake'], py_modules=['cli', 'templates', 'livejs'], entry_points=''' [console_scripts] ic...
from setuptools import setup, find_packages setup( # packaging information that is likely to be updated between versions name='icecake', version='0.6.0', packages=['icecake'], py_modules=['cli', 'templates', 'livejs'], entry_points=''' [console_scripts] icecake=icecake.cli:cli ...
Add a correct toString() method git-svn-id: 7e8def7d4256e953abb468098d8cb9b4faff0c63@5801 12255794-1b5b-4525-b599-b0510597569d
package com.arondor.common.reflection.bean.config; import java.util.Map; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.Transient; import com.arondor.common.reflection.model.config.ElementConfiguration; import com.arondor.common.reflection.model.config.MapConfi...
package com.arondor.common.reflection.bean.config; import java.util.Map; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.Transient; import com.arondor.common.reflection.model.config.ElementConfiguration; import com.arondor.common.reflection.model.config.MapConfi...
Fix test data coming back as undefined.
import $ from 'jquery'; import getScrubbedData from './dataUtils'; import { testData } from '../../test/data/test-data'; import apiKey from '../../test/apiKey'; const getWeatherData = location => { if (parseInt(location, 10)) { return $.get(`http://api.wunderground.com/api/${apiKey}/hourly/forecast10day/conditio...
import $ from 'jquery'; import getScrubbedData from './dataUtils'; import testData from '../../test/data/test-data'; import apiKey from '../../test/apiKey'; const getWeatherData = location => { if (parseInt(location, 10)) { return $.get(`http://api.wunderground.com/api/${apiKey}/hourly/forecast10day/conditions/q...
Remove run method (useless) in Base class
"""The base command.""" import ConfigParser import os import putiopy class Base(object): """A base command.""" def __init__(self, options): self.options = options class BaseClient(Base): """A base client command.""" def __init__(self, options): # update options from config file ...
"""The base command.""" import ConfigParser import os import putiopy class Base(object): """A base command.""" def __init__(self, options): self.options = options def run(self): raise NotImplementedError( 'You must implement the run() method yourself!') class BaseClient(B...
Test for behaviour when badge does not exist
<?php namespace UoMCS\OpenBadges\Backend; class BadgeTest extends DatabaseTestCase { const BADGE_EXISTS_ID = 1; const BADGE_DOES_NOT_EXIST_ID = 99999; public function testBadgeExistsDB() { $badge = Badge::get(self::BADGE_EXISTS_ID); $this->assertInstanceOf('UoMCS\\OpenBadges\\Backend\\Badge', $badge,...
<?php namespace UoMCS\OpenBadges\Backend; class BadgeTest extends DatabaseTestCase { const BADGE_EXISTS_ID = 1; const BADGE_DOES_NOT_EXIST_ID = 99999; public function testBadgeExistsDB() { $badge = Badge::get(self::BADGE_EXISTS_ID); $this->assertInstanceOf('UoMCS\\OpenBadges\\Backend\\Badge', $badge,...
Disable caching so CSRF tokens are not cached.
from form_designer.contrib.cms_plugins.form_designer_form.models import CMSFormDefinition from form_designer.views import process_form from form_designer import settings from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext as _ class FormDes...
from form_designer.contrib.cms_plugins.form_designer_form.models import CMSFormDefinition from form_designer.views import process_form from form_designer import settings from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext as _ class FormDes...
Add srcId to db def
package main const ( setNames = "SET NAMES utf8" setLocPrefix = "SET @localPrefix='+48'" outboxTable = "SMSd_Outbox" recipientsTable = "SMSd_Recipients" inboxTable = "SMSd_Inbox" ) const createOutbox = `CREATE TABLE IF NOT EXISTS ` + outboxTable + ` ( id int unsigned NOT NULL AUTO_INCREME...
package main const ( setNames = "SET NAMES utf8" setLocPrefix = "SET @localPrefix='+48'" outboxTable = "SMSd_Outbox" recipientsTable = "SMSd_Recipients" inboxTable = "SMSd_Inbox" ) const createOutbox = `CREATE TABLE IF NOT EXISTS ` + outboxTable + ` ( id int unsigned NOT NULL AUTO_INCREME...
Update constant varriables to using const
const mongoose = require('mongoose') const userSchema = new mongoose.Schema({ id: { type: String, index: { unique: true } }, twitter_id: String, twitter_credentials: mongoose.Schema.Types.Mixed, auth0_id: String, login_tokens: [ String ], profile_image_url: String, data: mongoose.Schema.Types.Mixed, cr...
const mongoose = require('mongoose') const userSchema = new mongoose.Schema({ id: { type: String, index: { unique: true } }, twitter_id: String, twitter_credentials: mongoose.Schema.Types.Mixed, auth0_id: String, login_tokens: [ String ], profile_image_url: String, data: mongoose.Schema.Types.Mixed, cr...
Hide components if user is logged
import React from 'react'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; // =========== Components =========== import App from '../components/app'; import NotFound from '../components/public-pages/not-found'; // Products import Products from '../components/products/'; // Layout import Head...
import React from 'react'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; // =========== Components =========== import App from '../components/app'; import NotFound from '../components/public-pages/not-found'; // Layout import Header from '../components/navigation/header'; import Footer fro...
Fix for the burea page on Android 4.1
/* ========================================================================== Assign Code copied from the following with moderate modifications : - https://github.com/maslennikov/shallow-extend Copyright (c) 2014 Alexey Maslennikov =====================================================================...
/* ========================================================================== Assign Code copied from the following with moderate modifications : - https://github.com/maslennikov/shallow-extend Copyright (c) 2014 Alexey Maslennikov =====================================================================...
Use index instead of shifting data
window.AdventOfCode.Day8 = ( input ) => { input = input.split( ' ' ).map( x => +x ); let part1 = 0; let index = 0; const process = () => { const childrenSize = input[ index++ ]; const metadataSize = input[ index++ ]; let values = []; let value = 0; for( let i = childrenSize; i > 0; i-- ) { values...
window.AdventOfCode.Day8 = ( input ) => { input = input.split( ' ' ).map( x => +x ); let part1 = 0; const process = () => { const childrenSize = input.shift(); const metadataSize = input.shift(); let values = []; let value = 0; for( let i = childrenSize; i > 0; i-- ) { values.push( process() ); ...
Fix https origin in CORS.
import express from 'express'; import leagueTips from 'league-tooltips'; import runTask from './cronTask'; import taskGenerator from './cronTasks/generator'; import config from './config'; import routes from './routes'; // ==== Server ==== const app = express(); app.use(leagueTips(config.key.riot, 'euw', { url: '/...
import express from 'express'; import leagueTips from 'league-tooltips'; import runTask from './cronTask'; import taskGenerator from './cronTasks/generator'; import config from './config'; import routes from './routes'; // ==== Server ==== const app = express(); app.use(leagueTips(config.key.riot, 'euw', { url: '/...
feat(a11y): Add aria key-value pairs so that a bunch of magic strings can be removed.
(function rocketbelt(window, document) { window.rb = window.rb || {}; window.rb.getShortId = function getShortId() { // Break the id into 2 parts to provide enough bits to the random number. // This should be unique up to 1:2.2 bn. var firstPart = (Math.random() * 46656) | 0; var secondPart = (Math...
(function rocketbelt(window, document) { window.rb = window.rb || {}; window.rb.getShortId = function getShortId() { // Break the id into 2 parts to provide enough bits to the random number. // This should be unique up to 1:2.2 bn. var firstPart = (Math.random() * 46656) | 0; var secondPart = (Math...
Put download stats behind !npmo feature flag
var P = require('bluebird'); var feature = require('../lib/feature-flags.js'); var MINUTE = 60; // seconds var MODIFIED_TTL = 1 * MINUTE; var DEPENDENTS_TTL = 30 * MINUTE; module.exports = function(request, reply) { var Package = require("../models/package").new(request); var Download = require("../models/downlo...
var P = require('bluebird'); var MINUTE = 60; // seconds var MODIFIED_TTL = 1 * MINUTE; var DEPENDENTS_TTL = 30 * MINUTE; module.exports = function(request, reply) { var Package = require("../models/package").new(request); var Download = require("../models/download").new({ request: request, cache: require...
Fix RSS feed some more.
from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from extensions.models import Extension class LatestExtensionsFeed(Feed): title = "Latest extensions in GNOME Shell Extensions" link = "/" description = "The latest extensions in GNOME Shell Extensions" def...
from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from extensions.models import Extension class LatestExtensionsFeed(Feed): title = "Latest extensions in GNOME Shell Extensions" link = "/" description = "The latest extensions in GNOME Shell Extensions" def...
Drop func annotations for the sake of Python 3.5
"""Version tools set.""" import os from setuptools_scm import get_version def get_version_from_scm_tag( *, root='.', relative_to=None, local_scheme='node-and-date', ): """Retrieve the version from SCM tag in Git or Hg.""" try: return get_version( root=root...
"""Version tools set.""" import os from setuptools_scm import get_version def get_version_from_scm_tag( *, root='.', relative_to=None, local_scheme='node-and-date', ) -> str: """Retrieve the version from SCM tag in Git or Hg.""" try: return get_version( ro...
Add responsive sharer to resources
<?php /* * Classic theme * Author: Jonathan Kim * Date: 30/12/2011 */ use FelixOnline\Core; if(!defined('THEME_DIRECTORY')) define('THEME_DIRECTORY', dirname(__FILE__)); if(!defined('THEME_NAME')) define('THEME_NAME', '2014'); if(!defined('THEME_URL')) define('THEME_URL', STANDARD_URL.'themes/'.THEME_NAME.'/'); ...
<?php /* * Classic theme * Author: Jonathan Kim * Date: 30/12/2011 */ use FelixOnline\Core; if(!defined('THEME_DIRECTORY')) define('THEME_DIRECTORY', dirname(__FILE__)); if(!defined('THEME_NAME')) define('THEME_NAME', '2014'); if(!defined('THEME_URL')) define('THEME_URL', STANDARD_URL.'themes/'.THEME_NAME.'/'); ...
Update methods to reflect platform information This updates the implementations of the os.type() and os.platform() methods to reflect more accurate system/platform information. os.type() has been updated to simply return 'React Native' os.platform() has been updated to return the current platform, either 'android', '...
// original: https://github.com/CoderPuppy/os-browserify var { DeviceEventEmitter, NativeModules, Platform } = require('react-native'); var RNOS = NativeModules.RNOS; // update the osInfo var osInfo = { } DeviceEventEmitter.addListener('rn-os-info', function (info) { osInfo = info; }); exports.endianness = ...
// original: https://github.com/CoderPuppy/os-browserify var { DeviceEventEmitter, NativeModules } = require('react-native'); var RNOS = NativeModules.RNOS; // update the osInfo var osInfo = { } DeviceEventEmitter.addListener('rn-os-info', function (info) { osInfo = info; }); exports.endianness = function () ...
Fix for done action bug
# coding=utf8 # Local modules from common import debug from common.action import action_classes from common.telegram import telegram_utils from dailydevo import desiringgod_utils from user import user_actions PROMPT = "Here are today's articles from desiringgod.org!\nTap on any one to get the article!" class DGDevo...
# coding=utf8 # Local modules from common import debug from common.action import action_classes from common.telegram import telegram_utils from dailydevo import desiringgod_utils from user import user_actions PROMPT = "Here are today's articles from desiringgod.org!\nTap on any one to get the article!" class DGDevo...
Add default parameter limits to distribution to be overridden by implementing classes.
<?php namespace MathPHP\Probability\Distribution; use MathPHP\Functions\Support; abstract class Distribution { // Overridden by implementing classes const PARAMETER_LIMITS = []; /** * Constructor * * @param number ...$params */ public function __construct(...$params) { ...
<?php namespace MathPHP\Probability\Distribution; use MathPHP\Functions\Support; abstract class Distribution { /** * Constructor * * @param number ...$params */ public function __construct(...$params) { $new_params = static::PARAMETER_LIMITS; $i = 0; foreach ($...
Add quieter handlers for repl
var LastFmNode = require('./lib/lastfm').LastFmNode, repl = require('repl'), config = require('./config'), _ = require('underscore'); var echoHandler = function() { _(arguments).each(function(arg) { console.log(arg); }); }; var errorHandler = function(error) { console.log('Error: ' + e...
var LastFmNode = require('./lib/lastfm').LastFmNode, repl = require('repl'), config = require('./config'), _ = require('underscore'); var echoHandler = function() { _(arguments).each(function(arg) { console.log(arg); }); }; var errorHandler = function(error) { console.log('Error: ' + e...
Set docker log encoding to utf-8
# stdlib import os from pathlib import Path from pathlib import PosixPath import subprocess # Make a log directory log_path = Path("logs") log_path.mkdir(exist_ok=True) # Get the github job name and create a directory for it job_name = os.getenv("GITHUB_JOB") job_path: PosixPath = log_path / job_name job_path.mkdir(e...
# stdlib import os from pathlib import Path from pathlib import PosixPath import subprocess # Make a log directory log_path = Path("logs") log_path.mkdir(exist_ok=True) # Get the github job name and create a directory for it job_name = os.getenv("GITHUB_JOB") job_path: PosixPath = log_path / job_name job_path.mkdir(e...
Add links to source code in documentation
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys sys.path....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys sys.path....
Change textarea vaule t output raw data
@php //php here @endphp <div class="note"> <div class="smart-editor"> <p> <input type="text" name="notes_title" class="col-fluid {{ $errors->first('notes_title', 'error') }}" placeholder="What the title of this note?" value="{{ old('notes_title', (isset...
@php //php here @endphp <div class="note"> <div class="smart-editor"> <p> <input name="notes_title" class="col-fluid {{ $errors->first('notes_title', 'error') }}" placeholder="Add the title of the Note here.." value="{{ old('notes_title', (isset($note->...
Change ICON to new loader format
define(['mac/palette2'], function(palette) { 'use strict'; return function(item) { return item.getBytes().then(function(bytes) { if (bytes.length !== 128 && bytes.length !== 256) { return Promise.reject('ICON resource expected to be 128 bytes, got ' + bytes.length); } item.withPixe...
define(['mac/palette2'], function(palette) { 'use strict'; return function(resource) { if (resource.data.length !== 128 && resource.data.length !== 256) { console.error('ICON resource expected to be 128 bytes, got ' + resource.data.length); return; } var img = document.createElement('CAN...
Update test to use new function.
const test = require('tap').test; const path = require('path'); const VirtualMachine = require('../../src/index'); const sb3 = require('../../src/serialization/sb3'); const readFileToBuffer = require('../fixtures/readProjectFile').readFileToBuffer; const projectPath = path.resolve(__dirname, '../fixtures/clone-cleanup....
const test = require('tap').test; const path = require('path'); const VirtualMachine = require('../../src/index'); const sb3 = require('../../src/serialization/sb3'); const extract = require('../fixtures/extract'); const projectPath = path.resolve(__dirname, '../fixtures/clone-cleanup.sb2'); test('serialize', t => { ...
Call main rather than start
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
Convert widget specs to jasmine 2.x syntax
define([ "public/assets/javascripts/lib/widgets/travel_insurance" ], function(TravelInsurance) { "use strict"; describe("TravelInsurance", function() { define("wnmock", function() { return {}; }); describe("pulling in the World Nomad widget", function() { var widget; beforeEach(fu...
require([ "public/assets/javascripts/lib/widgets/travel_insurance" ], function(TravelInsurance) { "use strict"; describe("TravelInsurance", function() { define("wnmock", function() { return {}; }); it("pulls in the world nomad widget", function() { var ready = false; runs(function(...
Make class final if private constructor git-svn-id: 5ccfe34f605a6c2f9041ff2965ab60012c62539a@1379860 13f79535-47bb-0310-9956-ffa450edef68
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
Change BlinkyTape baud to 115200
import blinkycolor import serial class BlinkyTape(object): def __init__(self, port, baud_rate = 115200, pixel_count = 60): self._serial = serial.Serial(port, baud_rate) self._pixel_count = pixel_count self._pixels = [blinkycolor.BLACK] * self._pixel_count @property def pixel_count(...
import blinkycolor import serial class BlinkyTape(object): def __init__(self, port, baud_rate = 57600, pixel_count = 60): self._serial = serial.Serial(port, baud_rate) self._pixel_count = pixel_count self._pixels = [blinkycolor.BLACK] * self._pixel_count @property def pixel_count(s...
refactor: Clean up test suite's common variables. Signed-off-by: Oleksii Fedorov <0263a738e29f7a423bda1d60ddbfb884af6a4010@gmail.com>
describe("Tic Tac Toe Game", function() { var playerOne = "X" var playerTwo = "O" var game beforeEach(function() { game = new Game() }) it("makes sure that player One starts", function() { var validTurn = game.put(playerOne) expect(validTurn).toEqual(true) }) it("makes sure that player T...
describe("Tic Tac Toe Game", function() { it("makes sure that player One starts", function() { var game = new Game() var playerOne = "X" var playerTwo = "O" var validTurn = game.put(playerOne) expect(validTurn).toEqual(true) }) it("makes sure that player Two does not start", function() { ...
[GitHub] Use correct URL for API
import os import urllib import requests GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com') GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com') GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID'] GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET'] GITHUB_CAL...
import os import urllib import requests GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com') GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com') GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID'] GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET'] GITHUB_CAL...
Make integration test work again with usage of SSL
#!/usr/bin/env python import urllib.parse import urllib.request def create_player(username, password, email): url = 'https://localhost:3000/players' values = {'username' : username, 'password' : password, 'email' : email } data = urllib.parse.urlencode(values) data = dat...
#!/usr/bin/env python import urllib.parse import urllib.request def create_player(username, password, email): url = 'http://localhost:3000/players' values = {'username' : username, 'password' : password, 'email' : email } data = urllib.parse.urlencode(values) data = data...
[misc] Mark new role as unstable API
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of...
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of...
Add `publication_date` property to `Tip` model. BEFORE: We had a column in the DB, but no property on the model object. AFTER: We have that property in the model.
# -*- coding: utf-8 -*- """Defines the model 'layer' for PyTips.""" from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division from sqlalchemy import func from flask.ext.sqlalchemy import BaseQuery from pytips import db clas...
# -*- coding: utf-8 -*- """Defines the model 'layer' for PyTips.""" from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division from sqlalchemy import func from flask.ext.sqlalchemy import BaseQuery from pytips import db clas...
Use auxilliary recursive method to eliminate need to create new strings via substring method
/* Write a recursive method that finds the number of occurrences of a specified letter in a string using the following method header: public static int count(String str, char a) For example, count("Welcome", 'e') returns 2. Write a test program that prompts the user to enter a string and a character, and di...
/* Write a recursive method that finds the number of occurrences of a specified letter in a string using the following method header: public static int count(String str, char a) For example, count("Welcome", 'e') returns 2. Write a test program that prompts the user to enter a string and a character, and di...
Update comment of images table migration
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateImagesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('images', functio...
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateImagesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('images', functio...
Update range to 6 figures
/* * Copyright 2015 Ryan Gilera. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
/* * Copyright 2015 Ryan Gilera. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
Add header background color based on config
import React from 'react'; import NavMenu from './NavMenu'; export default class Header extends React.Component { constructor(props) { super(props); } render() { let navMenu; if (this.props.config.headerMenuLinks.length > 0) { navMenu = <NavMenu links={this.props.config.headerMenuLinks} /...
import React from 'react'; import NavMenu from './NavMenu'; export default class Header extends React.Component { constructor(props) { super(props); } render() { let navMenu; if (this.props.config.headerMenuLinks.length > 0) { navMenu = <NavMenu links={this.props.config.headerMenuLinks} /...
Use Docker API property in fixture
import docker import pytest from webcomix.docker import DockerManager, CONTAINER_NAME @pytest.fixture def cleanup_container(): yield None client = docker.from_env() for container in client.containers.list(): if container.attrs["Config"]["Image"] == CONTAINER_NAME: container.kill() def...
import docker import pytest from webcomix.docker import DockerManager, CONTAINER_NAME @pytest.fixture def cleanup_container(): yield None client = docker.from_env() for container in client.containers().list(): if container.attrs["Config"]["Image"] == CONTAINER_NAME: container.kill() d...
Change the console log level back to WARN
import os import re import sublime from .logger import * # get the directory path to this file; LIBS_DIR = os.path.dirname(os.path.abspath(__file__)) PLUGIN_DIR = os.path.dirname(LIBS_DIR) PACKAGES_DIR = os.path.dirname(PLUGIN_DIR) PLUGIN_NAME = os.path.basename(PLUGIN_DIR) # only Sublime Text 3 build after 3072 s...
import os import re import sublime from .logger import * # get the directory path to this file; LIBS_DIR = os.path.dirname(os.path.abspath(__file__)) PLUGIN_DIR = os.path.dirname(LIBS_DIR) PACKAGES_DIR = os.path.dirname(PLUGIN_DIR) PLUGIN_NAME = os.path.basename(PLUGIN_DIR) # only Sublime Text 3 build after 3072 s...
Refresh disks on starting or stopping array
$(function() { var $array_controls = $('#array-controls'); $(document).on('click', '#array-controls a', function(e) { e.preventDefault(); var $btn = $(this), confirmed = true, action = $.trim($btn.text().toLowerCase()); if ((/stop/).test(action)) { confirmed = confirm('Really ' +...
$(function() { var $array_controls = $('#array-controls'); $(document).on('click', '#array-controls a', function(e) { e.preventDefault(); var $btn = $(this), confirmed = true, action = $.trim($btn.text().toLowerCase()); if ((/stop/).test(action)) { confirmed = confirm('Really ' +...