text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
FIX BUILD compiler error in 509selector unit test git-svn-id: f26ccc5efe72c2bd8e1c40f599fe313f2692e4de@6293 a612230a-c5fa-0310-af8b-88eea846685b
/* * * * Copyright (C) 2006 SIPfoundry Inc. * Licensed by SIPfoundry under the LGPL license. * * Copyright (C) 2006 Pingtel Corp. * Licensed to SIPfoundry under a Contributor Agreement. * * $ */ package org.sipfoundry.sipxconfig.common; import org.sipfoundry.sipxconfig.common.X509Selector; import junit....
/* * * * Copyright (C) 2006 SIPfoundry Inc. * Licensed by SIPfoundry under the LGPL license. * * Copyright (C) 2006 Pingtel Corp. * Licensed to SIPfoundry under a Contributor Agreement. * * $ */ package org.sipfoundry.sipxconfig.common; import org.sipfoundry.sipxconfig.common.X509Selector; import junit....
Make Fields type more concrete.
/* @flow */ import type { Decoder, Decode } from "./Decoder" import { Error, TypeError, ThrownError } from "./Error" import { FieldError } from "./Field" import * as Variant from "./Decoder" export type Record<a> = Decoder<$ObjMap<a, <b>(Decoder<b>) => b>> export type Fields<a> = $ObjMap<a, <b>(b) => Decoder<b>> & { ...
/* @flow */ import type { Decoder, Decode } from "./Decoder" import { Error, TypeError, ThrownError } from "./Error" import { FieldError } from "./Field" import * as Variant from "./Decoder" export type Record<a> = Decoder<$ObjMap<a, <b>(Decoder<b>) => b>> export type Fields<a> = $ObjMap<a, <b>(b) => Decoder<b>> exp...
Throw error if an EtchComponent subclass doesn't implement render()
/** @babel */ /** @jsx etch.dom */ import {Emitter} from 'atom' import etch from 'etch' export default class EtchComponent { constructor (props) { this.props = props etch.initialize(this) this.setScheduler(atom.views) this.emitter = new Emitter() this.emitter.emit('component-did-mount') } ...
/** @babel */ /** @jsx etch.dom */ import {Emitter} from 'atom' import etch from 'etch' export default class EtchComponent { constructor (props) { this.props = props etch.initialize(this) this.setScheduler(atom.views) this.emitter = new Emitter() this.emitter.emit('component-did-mount') } ...
Return a freshly defined error class.
(function(root) { if (typeof exports !== 'undefined') { var _ = require('underscore'); var util = require('./util') } else { var util = Substance.util; } var errors = {}; SubstanceError = function(name, code, message) { this.message = message; this.name = name; this.code = code; this.stack = util.cal...
(function(root) { if (typeof exports !== 'undefined') { var _ = require('underscore'); var util = require('./util') } else { var util = Substance.util; } var errors = {}; SubstanceError = function(name, code, message) { this.message = message; this.name = name; this.code = code; this.stack = util.cal...
Allow control char as rule "variable"
// L-System Rule Parser function RuleParser(str) { this.str = str; this.rules = {}; this.parse = function() { var c, d; var env = 0; var rule_str; var variable; for (var i = 0; i < this.str.length; i++) { c = this.str[i]; if (i > 0) { d = this.str[i-1]; } else { d = null;...
// L-System Rule Parser function RuleParser(str) { this.str = str; this.rules = {}; this.parse = function() { var c, d; var env = 0; var rule_str; var variable; for (var i = 0; i < this.str.length; i++) { c = this.str[i]; if (i > 0) { d = this.str[i-1]; } else { d = null;...
Fix case, it's not ARGV it's argv for php
#!/usr/local/bin/php -f <?php /* upgrade embedded users serial console */ require_once("globals.inc"); require_once("config.inc"); require_once("functions.inc"); if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { if(!empty($config['system']['gitsync']['repositoryur...
#!/usr/local/bin/php -f <?php /* upgrade embedded users serial console */ require_once("globals.inc"); require_once("config.inc"); require_once("functions.inc"); if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { if(!empty($config['system']['gitsync']['repositoryur...
Rename the 'contain' TestCase to TestContain
import unittest from robber import expect from robber.matchers.contain import Contain class TestContain(unittest.TestCase): def test_matches(self): expect(Contain({'key': 'value'}, 'key').matches()) == True expect(Contain([1, 2, 3], 2).matches()) == True expect(Contain((1, 2, 3), 3).matches...
import unittest from robber import expect from robber.matchers.contain import Contain class TestAbove(unittest.TestCase): def test_matches(self): expect(Contain({'key': 'value'}, 'key').matches()) == True expect(Contain([1, 2, 3], 2).matches()) == True expect(Contain((1, 2, 3), 3).matches()...
Adjust check for sites running under a subdir
<?php namespace Croogo\Core\Routing\Filter; use Cake\Core\Configure; use Cake\Event\Event; use Cake\Routing\DispatcherFilter; use Croogo\Core\Utility\StringConverter; /** * Class HomePageFilter */ class HomePageFilter extends DispatcherFilter { /** * Priority setting. * * This filter should be r...
<?php namespace Croogo\Core\Routing\Filter; use Cake\Core\Configure; use Cake\Event\Event; use Cake\Routing\DispatcherFilter; use Croogo\Core\Utility\StringConverter; /** * Class HomePageFilter */ class HomePageFilter extends DispatcherFilter { /** * Priority setting. * * This filter should be r...
Use ol.has.TOUCH to check if the device support touch events
import $ from 'jquery'; import angular from 'angular'; import {TOUCH} from 'ol/has.js'; function bootstrap(module) { const interface_ = $('meta[name=interface]')[0].getAttribute('content'); const dynamicUrl_ = $('meta[name=dynamicUrl]')[0].getAttribute('content'); const dynamicUrl = `${dynamicUrl_}?interface=${...
// FIXME DocumentTouch is deprecated, see: // https://developer.mozilla.org/en-US/docs/Web/API/DocumentTouch /* global DocumentTouch */ import $ from 'jquery'; import angular from 'angular'; function bootstrap(module) { const interface_ = $('meta[name=interface]')[0].getAttribute('content'); const dynamicUrl_ = $...
Fix : replace deprecated request.param() api by request.params
const express = require('express'); const router = express.Router(); const puppeteer = require('puppeteer'); router.get('/', function (req, res, next) { puppeteer.launch().then(async browser => { const page = await browser.newPage(); page.setViewport({ width: req.params.width ? parseInt(req.params.wid...
const express = require('express'); const router = express.Router(); const puppeteer = require('puppeteer'); router.get('/', function (req, res, next) { puppeteer.launch().then(async browser => { const page = await browser.newPage(); page.setViewport({ width: req.param('width') ? parseInt(req.param('w...
Update manifest paths to use variables
<?php namespace CFPropertyList; require_once( 'cfpropertylist-2.0.1/CFPropertyList.php' ); // Get the munki repo directory $plist = new CFPropertyList( '/Library/Preferences/com.github.munki.plist' ); $arrPref = $plist->toArray(); $munki_repo = $arrPref['MUNKI_REPO']; // Get the varib...
<?php namespace CFPropertyList; require_once( 'cfpropertylist-2.0.1/CFPropertyList.php' ); // Get the munki repo directory $plist = new CFPropertyList( '/Library/Preferences/com.github.munki.plist' ); $arrPref = $plist->toArray(); $munki_repo = $arrPref['MUNKI_REPO']; // Get the varibles passed b...
Set up for showing schedule
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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 o...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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 o...
Add description to rst plugin
"""Check that files contains valid ReStructuredText.""" import os import fnmatch import restructuredtext_lint DEFAULTS = { 'files': '*.rst', } def make_message(error): return '%s %s:%s %s\n' % ( error.type, error.source, error.line, error.message, ) def check(file_staged_for_commit, options): ...
import os import fnmatch import restructuredtext_lint DEFAULTS = { 'files': '*.rst', } def make_message(error): return '%s %s:%s %s\n' % ( error.type, error.source, error.line, error.message, ) def check(file_staged_for_commit, options): basename = os.path.basename(file_staged_for_commit.p...
Use hash based location type for now to support IE9 / ember bug
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, baseURL: '/', locationType: 'hash', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-contr...
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, baseURL: '/', locationType: 'auto', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-contr...
Fix naming bug in doc test
from unittest import TestCase import importlib def get_undocumented_wildcards(modulename): namespace = importlib.import_module(modulename) loc = namespace.__dict__ undocumented = [] for key, val in loc.items(): if (key[0] != "_") and (key not in {"_", "In", "Out", "get_ipython", "exit", "quit"...
from unittest import TestCase import importlib def get_undocumented_wildcards(modulename): namespace = importlib.import_module(modulename) loc = namespace.__dict__ undocumented = [] for key, val in loc.items(): if (key[0] != "_") and (key not in {"_", "In", "Out", "get_ipython", "exit", "quit"...
Use the correct base path.
# Licensed to the StackStorm, Inc ('StackStorm') 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 not use th...
# Licensed to the StackStorm, Inc ('StackStorm') 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 not use th...
Replace the take name error with one that made more sense to display on the login view.
'use strict'; var Q = require('q'); module.exports = { findByName: function(name) { var deferred = Q.defer(); if(name === null || name === undefined) { deferred.reject('What are we supposed to name you?'); return deferred.promise; } User.findOne({ name: name }).exec(function(err, user)...
'use strict'; var Q = require('q'); module.exports = { findByName: function(name) { var deferred = Q.defer(); if(name === null || name === undefined) { deferred.reject('What are we supposed to name you?'); return deferred.promise; } User.findOne({ name: name }).exec(function(err, user)...
Add units and different translation types to translate from position effect
import { SplashEffect } from "./effect.js"; import { Linear } from "../interpolation.js"; export class TranslateFromPosition extends SplashEffect { constructor(element, options) { super(element); options = options || {}; this.x = options.x || 0; this.y = options.y || 0; // Can be whatever, but the effect...
import { SplashEffect } from "./effect.js"; import { Linear } from "../interpolation.js"; export class TranslateFromPosition extends SplashEffect { constructor(element, options) { super(element); options = options || {}; this.x = options.x || 0; this.y = options.y || 0; this.interpolation = options.inter...
Define block "code" for highlighting
var Prism = require('prismjs'); var path = require('path'); var prismCSS = require.resolve('prismjs/themes/prism.css'); var DEFAULT_LANGUAGE = 'javascript'; var MAP_LANGUAGES = { 'py': 'python', 'js': 'javascript', 'json': 'javascript', 'rb': 'ruby', 'csharp': 'cs', }; var assets = { assets: path.dirname...
var Prism = require('prismjs'); var cheerio = require('cheerio'); var path = require('path'); var prismCSS = require.resolve('prismjs/themes/prism.css'); module.exports = { book: { assets: path.dirname(prismCSS), css: [path.basename(prismCSS)] }, hooks: { page: function (page) { page.sections....
T7646: Fix buildplan ac on Herald. Summary: Fixes T7646. Test Plan: Repeat steps described in T7646 and expect disabled build plans not displayed. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T7646 Differential Revision: ht...
<?php final class HarbormasterBuildPlanDatasource extends PhabricatorTypeaheadDatasource { public function getPlaceholderText() { return pht('Type a build plan name...'); } public function getDatasourceApplicationClass() { return 'PhabricatorHarbormasterApplication'; } public function loadResult...
<?php final class HarbormasterBuildPlanDatasource extends PhabricatorTypeaheadDatasource { public function getPlaceholderText() { return pht('Type a build plan name...'); } public function getDatasourceApplicationClass() { return 'PhabricatorHarbormasterApplication'; } public function loadResult...
Fix the calculation of SpyReport.ValidUntil
package entities import ( "fmt" "time" "github.com/Vladimiroff/vec2d" ) type SpyReport struct { Player string Name string Owner string Position *vec2d.Vector ShipCount int32 ValidUntil int64 CreatedAt int64 } // Database key. func (s *SpyReport) Key() string { return fmt.Sprintf("spy_r...
package entities import ( "fmt" "time" "github.com/Vladimiroff/vec2d" ) type SpyReport struct { Player string Name string Owner string Position *vec2d.Vector ShipCount int32 ValidUntil int64 CreatedAt int64 } // Database key. func (s *SpyReport) Key() string { return fmt.Sprintf("spy_r...
Add colormap option to show().
import code import collections import logging import sys import numpy import rasterio logger = logging.getLogger('rasterio') Stats = collections.namedtuple('Stats', ['min', 'max', 'mean']) def main(banner, dataset): def show(source, cmap='gray'): """Show a raster using matplotlib. The raste...
import code import collections import logging import sys import numpy import rasterio logger = logging.getLogger('rasterio') Stats = collections.namedtuple('Stats', ['min', 'max', 'mean']) def main(banner, dataset): def show(source): """Show a raster using matplotlib. The raster may be eith...
Add the promisification in the service in order to be treated by the view.
/* global Promise */ var Reference = require('../models/reference'); var References = require('../models/references'); var Promisify = require('../models/promisify'); /*Instances of both model and collection of virtual machines.*/ var promiseReference = Promisify.Convert.Model(new Reference()); var promiseReferences = ...
/* global Promise */ var Reference = require('../models/reference'); var reference = new Reference(); // var References = require('../models/references'); // var references = new References(); var Promisify = require('../models/promisify'); var promiseCollection = new Promisify.Collection(); promiseCollection.url = ref...
Enable form submit by pressing enter
module.exports = (model, dispatch) => { const root = document.createElement('div'); if (model.channelOnEdit === null) { return root; } const c = model.channelOnEdit; const title = model.channels[c].title; const row = document.createElement('div'); row.classList.add('row'); row.classList.add('row...
module.exports = (model, dispatch) => { const root = document.createElement('div'); if (model.channelOnEdit === null) { return root; } const c = model.channelOnEdit; const title = model.channels[c].title; const row = document.createElement('div'); row.classList.add('row'); row.classList.add('row...
Fix bug in mondegreen rule (The correct versions should all be in the left column.)
# -*- coding: utf-8 -*- """Mondegreens. --- layout: post source: Garner's Modern American Usage source_url: http://amzn.to/15wF76r title: mondegreens date: 2014-06-10 12:31:19 categories: writing --- Points out preferred form. """ from tools import memoize, preferred_forms_check @memoize def che...
# -*- coding: utf-8 -*- """Mondegreens. --- layout: post source: Garner's Modern American Usage source_url: http://amzn.to/15wF76r title: mondegreens date: 2014-06-10 12:31:19 categories: writing --- Points out preferred form. """ from tools import memoize, preferred_forms_check @memoize def che...
Use default logger when not in dev
"use strict"; var express = require("express"), helpers = require("./src/helpers"); module.exports = function () { var app = express(); app.use( express.compress() ); // development only if ("development" == app.get("env")) { app.use(express.logger("dev")); } else { app.use(express.logger("de...
"use strict"; var express = require("express"), helpers = require("./src/helpers"); module.exports = function () { var app = express(); app.use( express.compress() ); // development only if ("development" == app.get("env")) { app.use(express.logger("dev")); } // Set up the default response a...
Add wrapper for event data elem
from __future__ import print_function import boto3 import json import os import btr3baseball jobTable = os.environ['JOB_TABLE'] jobQueue = os.environ['JOB_QUEUE'] queue = boto3.resource('sqs').get_queue_by_name(QueueName=jobQueue) jobRepo = btr3baseball.JobRepository(jobTable) dsRepo = btr3baseball.DatasourceReposito...
from __future__ import print_function import boto3 import json import os import btr3baseball jobTable = os.environ['JOB_TABLE'] jobQueue = os.environ['JOB_QUEUE'] queue = boto3.resource('sqs').get_queue_by_name(QueueName=jobQueue) jobRepo = btr3baseball.JobRepository(jobTable) dsRepo = btr3baseball.DatasourceReposito...
Fix Compilation Error in React Native 0.47.0
package com.rt2zz.reactnativecontacts; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.ArrayList; import...
package com.rt2zz.reactnativecontacts; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.ArrayList; import...
Rename variables used for setting up logging
import logging import sys logger = logging.getLogger() formatter = logging.Formatter("%(message)s") handler = logging.StreamHandler(sys.stdout) handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.INFO) UNDERLINE_SYMBOL = "-" def log_title(logline): logger.info(logline) logger....
import logging import sys logger = logging.getLogger() logFormatter = logging.Formatter("%(message)s") consoleHandler = logging.StreamHandler(sys.stdout) consoleHandler.setFormatter(logFormatter) logger.addHandler(consoleHandler) logger.setLevel(logging.INFO) UNDERLINE_SYMBOL = "-" def log_title(logline): logge...
Simplify test to check for no aerialway property
# http://www.openstreetmap.org/way/219071307 assert_has_feature( 16, 10478, 25338, 'roads', { 'id': 219071307, 'kind': 'minor_road', 'service': 'drive_through' }) # http://www.openstreetmap.org/way/258020271 assert_has_feature( 16, 11077, 25458, 'roads', { 'id': 258020271, 'kind': 'aerialway', 'aerialw...
# http://www.openstreetmap.org/way/219071307 assert_has_feature( 16, 10478, 25338, 'roads', { 'id': 219071307, 'kind': 'minor_road', 'service': 'drive_through' }) # http://www.openstreetmap.org/way/258020271 assert_has_feature( 16, 11077, 25458, 'roads', { 'id': 258020271, 'kind': 'aerialway', 'aerialw...
Add comments to function and loop for clarity
/*This function will take the updated index number from my loop, apply these rules, and then output ping, pong, pingpong or the index number into the outputList */ var pingPongType = function(i) { if ((i % 5 === 0) || (i % 3 === 0) || (i % 15 === 0)) { if (i % 15 === 0) { return "pingpong"; } else if ...
var pingPongType = function(i) { if ((i % 5 === 0) || (i % 3 === 0) || (i % 15 === 0)) { if (i % 15 === 0) { return "pingpong"; } else if (i % 5 === 0) { return "pong"; } else { return "ping"; } } else { return i; } } $(function() { $("#game").submit(function(event) ...
Make +s actually definitely clear the cdata dictionary
from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["channel"].mode and cdata["channel"].name not in data["user"].channels: data["cdata"].clear() # other +s stuff is hiding in other modules. ...
from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["channel"].mode and cdata["channel"].name not in data["user"].channels: data["cdata"] = {} # other +s stuff is hiding in other modules. cla...
Increase UpdateUserWorker: 1 -> 3
package com.github.k0kubun.github_ranking; import com.github.k0kubun.github_ranking.config.Config; import com.github.k0kubun.github_ranking.worker.UpdateUserWorker; import com.github.k0kubun.github_ranking.worker.WorkerManager; import javax.sql.DataSource; public class Main { private static final int NUM_UPDATE_U...
package com.github.k0kubun.github_ranking; import com.github.k0kubun.github_ranking.config.Config; import com.github.k0kubun.github_ranking.worker.UpdateUserWorker; import com.github.k0kubun.github_ranking.worker.WorkerManager; import javax.sql.DataSource; public class Main { public static void main(String[] args...
Fix deprecation for symfony/config 4.2+
<?php namespace Hype\MailchimpBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { $treeBuilder = new Tre...
<?php namespace Hype\MailchimpBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { $treeBuilder = new Tre...
Put function in scope & corect object usage
// Defining Module var demoApp = angular.module('demoApp', ['ngRoute']); // Defining Module Routes demoApp.config(function($routeProvider) { $routeProvider .when('/view1', { controller: 'simpleController', templateUrl: 'partials/view1.html' }) .when('/view2', { ...
// Defining Module var demoApp = angular.module('demoApp', ['ngRoute']); // Defining Module Routes demoApp.config(function($routeProvider) { $routeProvider .when('/view1', { controller: 'simpleController', templateUrl: 'partials/view1.html' }) .when('/view2', { ...
Add list of category codes to offices
from rest_framework import serializers from rest_framework_gis import serializers as gis_serializers from .models import Location, Office, Organisation class DistanceField(serializers.ReadOnlyField): def to_representation(self, obj): # miles return obj.mi class OrganisationSerializer(serializer...
from rest_framework import serializers from rest_framework_gis import serializers as gis_serializers from .models import Location, Office, Organisation class DistanceField(serializers.ReadOnlyField): def to_representation(self, obj): # miles return obj.mi class OrganisationSerializer(serializer...
BAP-10771: Migrate data audit command to be executed in new message queue - fix tests
<?php namespace Oro\Bundle\DataAuditBundle\Migrations\Schema\v1_7; use Doctrine\DBAL\Schema\Schema; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migration\QueryBag; class AddCollectionTypeColumn implements Migration { /** * {@inheritdoc} */ public function up(S...
<?php namespace Oro\Bundle\DataAuditBundle\Migrations\Schema\v1_7; use Doctrine\DBAL\Schema\Schema; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migration\QueryBag; class AddCollectionTypeColumn implements Migration { /** * {@inheritdoc} */ public function up(S...
Rename datetime to dateTime to keep consistency.
<?php namespace CatLab\Requirements\Enums; /** * Interface PropertyType * @package CatLab\RESTResource\Contracts */ class PropertyType { const INTEGER = 'integer'; const STRING = 'string'; const DATETIME = 'dateTime'; const NUMBER = 'number'; const BOOL = 'boolean'; const OBJECT = 'object';...
<?php namespace CatLab\Requirements\Enums; /** * Interface PropertyType * @package CatLab\RESTResource\Contracts */ class PropertyType { const INTEGER = 'integer'; const STRING = 'string'; const DATETIME = 'datetime'; const NUMBER = 'number'; const BOOL = 'boolean'; const OBJECT = 'object';...
Add visible version number in bottom corner of pages.
import React from 'react'; import styles from '../styles/core.scss'; import GlobalHeader from 'components/GlobalHeader'; var pjson = require('../../package.json'); // Note: Stateless/function components *will not* hot reload! // react-transform *only* works on component classes. // // Since layouts rarely change, they...
import React from 'react'; import styles from '../styles/core.scss'; import GlobalHeader from 'components/GlobalHeader'; // Note: Stateless/function components *will not* hot reload! // react-transform *only* works on component classes. // // Since layouts rarely change, they are a good place to // leverage React's ne...
Fix CSP errors in dummy app
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, baseURL: '/', locationType: 'auto', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-contr...
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, baseURL: '/', locationType: 'auto', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-contr...
Fix startup error message when vendor directory not found
<?php use app\core\router\Router; use josegonzalez\Dotenv\Loader; use app\core\logging\Logger; define('APP_ROOT_DIR', realpath('..')); define('APP_LIB_DIR', APP_ROOT_DIR . '/app/lib'); if (!file_exists(APP_ROOT_DIR . '/vendor/autoload.php')) { http_response_code(500); echo '<h1>"vendor" directory not found!<...
<?php use app\core\router\Router; use josegonzalez\Dotenv\Loader; use app\core\logging\Logger; define('APP_ROOT_DIR', realpath('..')); define('APP_LIB_DIR', APP_ROOT_DIR . '/app/lib'); if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != "guest" || $_SERVER['PHP_AUT...
Fix of hardcoded alias on JjUsers.UserUser
<?php class UserUser extends JjUsersAppModel { var $name = 'UserUser'; var $actsAs = array( 'Containable', 'Acl' => array('type' => 'requester'), 'JjUsers.AddAliasToAcl' => array('type' => 'requester', 'field' => 'username') ); var $validate = array( 'user_group_id' => array( 'numeric' ...
<?php class UserUser extends JjUsersAppModel { var $name = 'UserUser'; var $actsAs = array( 'Containable', 'Acl' => array('type' => 'requester'), 'JjUsers.AddAliasToAcl' => array('type' => 'requester', 'field' => 'username') ); var $validate = array( 'user_group_id' => array( 'numeric' ...
Add helper method to VM
/* * Copyright 2020 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
/* * Copyright 2020 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Fix <\textarea> in codeeditor breaks out of the editors textarea
@if ($this->previewMode) <div class="form-control-static">{!! $value !!}</div> @else <div class="field-codeeditor size-{{ $size }}" data-control="code-editor" data-mode="{{ $mode }}" data-theme="{{ $theme }}" data-line-separator="{{ $lineSeparator }}" data-read-on...
@if ($this->previewMode) <div class="form-control-static">{!! $value !!}</div> @else <div class="field-codeeditor size-{{ $size }}" data-control="code-editor" data-mode="{{ $mode }}" data-theme="{{ $theme }}" data-line-separator="{{ $lineSeparator }}" data-read-on...
Fix commented out avatar in profile-cards-react-with-styles
/* eslint-disable react/prop-types */ import React from 'react'; import { Image, View, Text } from 'react-sketchapp'; import { css, withStyles } from '../withStyles'; const Profile = ({ user, styles }) => ( <View {...css(styles.container)}> <Image source={user.profile_image_url} {...css(styles.avatar)} /> <V...
/* eslint-disable react/prop-types */ import React from 'react'; import { Image, View, Text } from 'react-sketchapp'; import { css, withStyles } from '../withStyles'; const Profile = ({ user, styles }) => ( <View {...css(styles.container)}> {/* <Image source={user.profile_image_url} {...css(styles.avatar)} /> */...
Index of the list should be an int
#!/usr/bin/python # -*- coding: utf-8 -*- """ Convenience functions for in memory deduplication """ import collections import dedupe.core def dataSample(data, sample_size): '''Randomly sample pairs of records from a data dictionary''' data_list = data.values() random_pairs = dedupe.core.randomPair...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Convenience functions for in memory deduplication """ import collections import dedupe.core def dataSample(data, sample_size): '''Randomly sample pairs of records from a data dictionary''' data_list = data.values() random_pairs = dedupe.core.randomPair...
[Tmpl] Add predefined type for temporary varibles.
package goutils import ( "bytes" "text/template" "github.com/hoveychen/go-utils/gomap" ) var ( textTmplCache = gomap.New() ) type Var map[string]interface{} func Sprintt(textTmpl string, data interface{}) string { ret := textTmplCache.GetOrCreate(textTmpl, func() interface{} { tpl, err := template.New("test...
package goutils import ( "bytes" "text/template" "github.com/hoveychen/go-utils/gomap" ) var ( textTmplCache = gomap.New() ) func Sprintt(textTmpl string, data interface{}) string { ret := textTmplCache.GetOrCreate(textTmpl, func() interface{} { tpl, err := template.New("test").Parse(textTmpl) if err != ni...
Make elections URLs match less
from django.conf.urls import url from elections import views from elections.helpers import ElectionIDSwitcher urlpatterns = [ url( "^elections/$", views.ElectionListView.as_view(), name="election_list_view", ), url( "^elections/(?P<election>[^/]+)/$", ElectionIDSwit...
from django.conf.urls import url from elections import views from elections.helpers import ElectionIDSwitcher urlpatterns = [ url( "elections/$", views.ElectionListView.as_view(), name="election_list_view", ), url( "elections/(?P<election>[^/]+)/$", ElectionIDSwitch...
Remove version number from Python shebang. On special request from someone trying to purge python2.2 from code indexed internally at Google. git-svn-id: http://src.chromium.org/svn/trunk/src@7071 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: 6b204b6013b516c1f312ac19097dcdc068f85b93
#!/usr/bin/python # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.Finge...
#!/usr/bin/python2.2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.Fi...
Split Webpack build to main and vendor chunks
const webpack = require("webpack"); const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin"); module.exports = { entry: "./src/index.ts", resolve: { extensions: [".tsx", ".ts", ".js"] }, ...
const webpack = require("webpack"); const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin"); module.exports = { entry: "./src/index.ts", resolve: { extensions: [".tsx", ".ts", ".js"] }, ...
Switch to use keyup, but only perform lookup on input change.
var BookLookup = { } BookLookup.find_by_isbn = function(isbn, callback) { $.getJSON('/books/isbn/'+ encodeURI(isbn), callback); } BookLookup.find_and_render = function(isbn) { if (isbn == "") { $('#book-placeholder').html(''); return; } $('#book-placeholder').addClass('loading').html('Searching for b...
var BookLookup = { } BookLookup.find_by_isbn = function(isbn, callback) { $.getJSON('/books/isbn/'+ encodeURI(isbn), callback); } BookLookup.find_and_render = function(isbn) { if (isbn == "") { $('#book-placeholder').html(''); return; } $('#book-placeholder').addClass('loading').html('Searching for b...
Rename "marker" to "nextAvailableIndex" for better readability * Initialize poolSize with 1 (doubling 0 is not smart :)
(function () { 'use strict'; function ObjectPoolMaker(Constructor, size) { var objectPool = [], nextAvailableIndex = 0, poolSize = size || 1; if (poolSize) { expandPool(poolSize); } function expandPool(newSize) { var i; for (i = 0; i < newSize - poolSize; i++) {...
(function () { 'use strict'; function ObjectPoolMaker(Constructor, size) { var objectPool = [], marker = 0, poolSize = size || 0; if (poolSize) { expandPool(poolSize); } function expandPool(newSize) { var i; for (i = 0; i < newSize - poolSize; i++) { obj...
Update featured image Interchange queries Removed 'default' named media query which does not exist in Foundation 6. http://foundation.zurb.com/sites/docs/interchange.html#named-media-queries
<?php // If a feature image is set, get the id, so it can be injected as a css background property if (has_post_thumbnail($post->ID) ) : $feat_img_id = get_post_thumbnail_id(); $hero_img_alt = get_post_meta($feat_img_id, '_wp_attachment_image_alt', true); // get alt attribute /* Use ID to get the attachm...
<?php // If a feature image is set, get the id, so it can be injected as a css background property if (has_post_thumbnail($post->ID) ) : $feat_img_id = get_post_thumbnail_id(); $hero_img_alt = get_post_meta($feat_img_id, '_wp_attachment_image_alt', true); // get alt attribute /* Use ID to get the attachm...
Add missing return value type hint
from typing import Any, Callable, Dict, Iterable, Optional, Type from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile from pydantic.fields import ModelField __all__ = ["UploadedFile"] class UploadedFile(DjangoUploadedFile): @classmethod def __get_validators__(cls: Type["UploadedFile...
from typing import Any, Callable, Dict, Iterable, Optional, Type from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile from pydantic.fields import ModelField __all__ = ["UploadedFile"] class UploadedFile(DjangoUploadedFile): @classmethod def __get_validators__(cls: Type["UploadedFile...
Add a dependency that got dropped.
"""Setup data for aib2ofx.""" from setuptools import setup setup( name='aib2ofx', description='Download data from aib.ie in OFX format', version='0.6', author='Jakub Turski', author_email='yacoob@gmail.com', url='http://github.com/yacoob/aib2ofx', packages=['aib2ofx'], entry_points={ ...
"""Setup data for aib2ofx.""" from setuptools import setup setup( name='aib2ofx', description='Download data from aib.ie in OFX format', version='0.6', author='Jakub Turski', author_email='yacoob@gmail.com', url='http://github.com/yacoob/aib2ofx', packages=['aib2ofx'], entry_points={ ...
[PhpUnitBridge] Enforce @-silencing of deprecation notices according to new policy
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml\Tests; use Symfony\Component\Yaml\Yaml; class Y...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml\Tests; use Symfony\Component\Yaml\Yaml; class Y...
Remove todo on lissu php ajax call. It returns and empty array in case of problems
sites_to_check = [ { "name": "Lissu Monitor", "url": "http://lissu.tampere.fi/monitor.php?stop=0014", "acceptable_statuses": [200], "mandatory_strings": [ "table2" ] }, { "name": "Siri API", "url": "https://siri.ij2010.tampere.fi/ws", ...
sites_to_check = [ { "name": "Lissu Monitor", "url": "http://lissu.tampere.fi/monitor.php?stop=0014", "acceptable_statuses": [200], "mandatory_strings": [ "table2" ] }, { "name": "Siri API", "url": "https://siri.ij2010.tampere.fi/ws", ...
Revert previous commit adding storage methods git-svn-id: 522c0d53943162a6437d919c1900af0a20491c0c@962477 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 ...
Enable markdown for PyPI README
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.te...
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.te...
Support for a LOT of tests
var stresstest = require('stresstest'); var timeouttest = require('timeouttest'); var win = Ti.UI.createWindow({}); var list = Ti.UI.createScrollView({ width: Ti.UI.SIZE, height: Ti.UI.SIZE, layout: 'vertical' }); win.add(list); [ { title: 'Execute Stress Test', handle: stresstest }, { title...
var stresstest = require('stresstest'); var timeouttest = require('timeouttest'); var win = Ti.UI.createWindow({}); var list = Ti.UI.createView({ width: Ti.UI.SIZE, height: Ti.UI.SIZE, layout: 'vertical' }); win.add(list); [ { title: 'Execute Stress Test', handle: stresstest }, { title: 'Tim...
Add browserSync notification upon compilation step
var _ = require('lodash'); var browserSync = require('browser-sync'); function BrowserSyncPlugin(browserSyncOptions, options) { var self = this; var defaultOptions = { reload: true, name: 'bs-webpack-plugin', callback: undefined }; self.browserSyncOptions = _.extend({}, browserSyncOptions); sel...
var _ = require('lodash'); var browserSync = require('browser-sync'); function BrowserSyncPlugin(browserSyncOptions, options) { var self = this; var defaultOptions = { reload: true, name: 'bs-webpack-plugin', callback: undefined }; self.browserSyncOptions = _.extend({}, browserSyncOptions); sel...
Add a dataprovider for tab completion test Add a couple more complicated `new` invocations.
<?php namespace Psy\Test\Readline; use Psy\Readline\TabCompletion; use Psy\Context; class TabCompletionTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider classesInput */ public function testClassesCompletion($word, $index, $line, $point, $end, $expect) { $context = new Conte...
<?php namespace Psy\Test\Readline; use Psy\Readline\TabCompletion; use Psy\Context; /** * Class TabCompletionTest * @package Psy\Test\Readline */ class TabCompletionTest extends \PHPUnit_Framework_TestCase { public function testClassesCompletion() { class_alias('\Psy\Test\Readline\TabCompletionTes...
Allow dynamic event handlers to throw checked exceptions
/* * This file is part of SpongeAPI, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Soft...
/* * This file is part of SpongeAPI, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Soft...
Remove test for sessions for Coursera API
import unittest from mooc_aggregator_restful_api import coursera class CourseraTestCase(unittest.TestCase): ''' Unit Tests for module udacity ''' def setUp(self): self.coursera_test_object = coursera.CourseraAPI() def test_coursera_api_courses_response(self): self.assertEqual(s...
import unittest from mooc_aggregator_restful_api import coursera class CourseraTestCase(unittest.TestCase): ''' Unit Tests for module udacity ''' def setUp(self): self.coursera_test_object = coursera.CourseraAPI() def test_coursera_api_courses_response(self): self.assertEqual(s...
Disable Python 3 conversion until it's been tested.
import sys from setuptools import setup meta = dict( name="stacklogger", version="0.1.0", description="A stack-aware logging extension", author="Will Maier", author_email="willmaier@ml1.net", py_modules=["stacklogger"], test_suite="tests.py", install_requires=["setuptools"], keywor...
import sys from setuptools import setup meta = dict( name="stacklogger", version="0.1.0", description="A stack-aware logging extension", author="Will Maier", author_email="willmaier@ml1.net", py_modules=["stacklogger"], test_suite="tests.py", install_requires=["setuptools"], keywor...
Make password not to show in status bar
<?php if(!isset($conn)) die; ?><header> <h1>Super-Simple-Vunlerable-Guestbook</h1> <ul class="nav"> <?php function protect($url, $pwd) { return "javascript:(/********************************************************************************/prompt('Password') == '{$pwd}') && (location.hre...
<?php if(!isset($conn)) die; ?><header> <h1>Super-Simple-Vunlerable-Guestbook</h1> <ul class="nav"> <?php function protect($url, $pwd) { return "javascript:(prompt('Password') == '{$pwd}') && (location.href = '{$url}') || void(0);"; } $navs = [ [ 'Home', './...
Remove old method of adding datafiles.
#!/usr/bin/env python # -*- coding: utf8 -*- from setuptools import setup setup(name='pynxc', version='0.1.7', description='A Python to NXC Converter for programming ' 'LEGO MINDSTORMS Robots', author='Brian Blais', author_email='bblais@bryant.edu', maintainer='Marek Šuppa', ...
#!/usr/bin/env python # -*- coding: utf8 -*- from setuptools import setup setup(name='pynxc', version='0.1.7', description='A Python to NXC Converter for programming ' 'LEGO MINDSTORMS Robots', author='Brian Blais', author_email='bblais@bryant.edu', maintainer='Marek Šuppa', ...
Use fix module names to abstract from account base controller.
<?php namespace account\base; use Yii; class Controller extends \luya\web\Controller { public function getRules() { return [ [ 'allow' => true, 'actions' => [], // apply to all actions by default 'roles' => ['@'], ], ]; ...
<?php namespace account\base; class Controller extends \luya\web\Controller { public function getRules() { return [ [ 'allow' => true, 'actions' => [], // apply to all actions by default 'roles' => ['@'], ], ]; } ...
Add due and change names of boilerplates Close #58
import React from 'react'; import {Decorator as Cerebral} from 'cerebral-view-react'; import styles from './styles.css'; const boilerplates = { 'react': 'React', 'cerebral': 'Cerebral', 'redux': 'Redux', 'cycle': 'Cycle JS', 'vue': 'Vue JS' }; @Cerebral() class Boilerplates extends React.Component { rende...
import React from 'react'; import {Decorator as Cerebral} from 'cerebral-view-react'; import styles from './styles.css'; const boilerplates = { 'react': 'React', 'cerebral': 'Cerebral with React', 'redux': 'Redux Counter', 'cycle': 'Cycle JS' }; @Cerebral() class Boilerplates extends React.Component { rende...
Initialize seq without type in take test class
package com.jmonad.seq; import org.junit.Test; public class SeqTakeTest { private Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; private Seq<Integer> elements = new Seq<>(numbers); @Test public void takeListElementsTest() { assert elements.take(5).toArrayList().toString().equals("[1, 2, 3, 4, 5]"); ...
package com.jmonad.seq; import org.junit.Test; public class SeqTakeTest { private Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; private Seq<Integer> elements = new Seq<Integer>(numbers); @Test public void takeListElementsTest() { assert elements.take(5).toArrayList().toString().equals("[1, 2, 3, 4,...
Add explanatory and TODO notes
'use strict'; var request = require('request'); var opts = { uri: 'https://api.github.com' + '/users/' + parseParams(process.argv[2]) + '/events', json: true, method: 'GET', headers: { 'User-Agent': 'nodejs script' } } request(opts, function (err, res, body) { if (err) throw new Error...
'use strict'; var request = require('request'); var opts = { uri: 'https://api.github.com' + '/users/' + parseParams(process.argv[2]) + '/events', json: true, method: 'GET', headers: { 'User-Agent': 'nodejs script' } } request(opts, function (err, res, body) { if (err) throw new Error...
[TACHYON-1559] Update doc to reference method directly and defend against IDE refactors
/* * Licensed to the University of California, Berkeley 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 no...
/* * Licensed to the University of California, Berkeley 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 no...
Make done a top-level function rather than a nested one.
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, port class Options(usage.Options): optParameters = [ ["host", "h",...
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, port class Options(usage.Options): optParameters = [ ["host", "h",...
Fix unit tests for arg_parser
import unittest from tailorscad.arg_parser import parse_args class TestArgParser(unittest.TestCase): def test_parse_args_none(self): args = [] argv = [] args = parse_args(argv) self.assertFalse(args.config) def test_parse_args_inknown(self): args = [] ar...
import unittest from tailorscad.arg_parser import parse_args class TestArgParser(unittest.TestCase): def test_parse_args_none(self): args = [] argv = [] args = parse_args(argv) self.assertFalse(args) def test_parse_args_inknown(self): args = [] argv = ['...
Change the update method for receive the layout attribute
<?php /** *Base class to persist data * *@author Vinicius Pinheiro <viny-pinheiro@hotmail.com> *@license MIT License *@link http://eletronjun.com.br/controller/updateCategory.php */ require_once __DIR__ . "/../class/autoload.php"; use \model\Category as Category; use \dao\CategoryDAO as CategoryDAO; use \exc...
<?php /** *Base class to persist data * *@author Vinicius Pinheiro <viny-pinheiro@hotmail.com> *@license MIT License *@link http://eletronjun.com.br/controller/updateCategory.php */ require_once __DIR__ . "/../class/autoload.php"; use \model\Category as Category; use \dao\CategoryDAO as CategoryDAO; use \exc...
Update component name after rebase
import Vue from "vue/dist/vue.esm"; import VueRouter from 'vue-router'; Vue.use(VueRouter); Vue.config.productionTip = process.env.NODE_ENV == "development"; import store from "../store/index"; import "../config/axios"; import "../directives/selectionchange"; import contenteditableDirective from "vue-contenteditable-...
import Vue from "vue/dist/vue.esm"; import VueRouter from 'vue-router'; Vue.use(VueRouter); Vue.config.productionTip = process.env.NODE_ENV == "development"; import store from "../store/index"; import "../config/axios"; import "../directives/selectionchange"; import contenteditableDirective from "vue-contenteditable-...
Fix electron file to der-reader dist
'use strict'; var webspeechapi, vibrateWebApi, DerReader; const env = require('./env/env.json').env; if (env === 'dev') { webspeechapi = require('../modules/tts.webapi/tts.webapi.js'); vibrateWebApi = require('../modules/vibrate.webapi/vibrate.webapi.js'); DerReader = require('../modules/der-reader/dist/der-re...
'use strict'; var webspeechapi, vibrateWebApi, DerReader; const env = require('./env/env.json').env; if (env === 'dev') { webspeechapi = require('./../modules/tts.webapi/tts.webapi.js'); vibrateWebApi = require('./../modules/vibrate.webapi/vibrate.webapi.js'); DerReader = require('./../modules/der-reader/der-r...
Add conf arg to check function
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import division, absolute_import, with_statement, print_function, unicode_literals from collections impor...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import division, absolute_import, with_statement, print_function, unicode_literals from collections impor...
Add a todo in the file.
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.nio.file.Files; import java.util.*; import machine.learning.ARL; public class Programme { //TODO fixe the exemple in java public static void main(String[] args) throws FileNotFoundException { ArrayL...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.nio.file.Files; import java.util.*; import machine.learning.ARL; public class Programme { public static void main(String[] args) throws FileNotFoundException { ArrayList array = new ArrayList<Double>();...
Use the reset adder from the banks properly
import importlib import os import sys import unittest import code import struct code_path = os.path.dirname(__file__) code_path = os.path.join(code_path, os.pardir) sys.path.append(code_path) import MOS6502 class TestCartHeaderParsing(unittest.TestCase): def testMagic(self): cpu = MOS6502.CPU() c...
import importlib import os import sys import unittest import code import struct code_path = os.path.dirname(__file__) code_path = os.path.join(code_path, os.pardir) sys.path.append(code_path) import MOS6502 class TestCartHeaderParsing(unittest.TestCase): def testMagic(self): cpu = MOS6502.CPU() c...
Use players 0 and 1 instead of 1 and 2 Makes it easier to communicate with ANN, as 1 is truthy and 0 is falsy. Players are also slightly more clear when Connect4 is printed.
class Connect4(object): def __init__(self): self.pieces = [[] for i in xrange(7)] self.turn = 0 def move(self, column): self.pieces[column % 7].append(self.turn) self.turn = 1 - self.turn def __str__(self): output = '' for i in xrange(6): output ...
class Connect4(object): def __init__(self): self.pieces = [[] for i in xrange(7)] self.turn = 1 def move(self, column): self.pieces[column % 7].append(self.turn) self.turn = 3 - self.turn def __str__(self): output = '' for i in xrange(6): output ...
Change error message per readme.
var Office365ConnectorHook = require("./index.js"), winston = require('winston'), Logger = winston.Logger, Console = winston.transports.Console, hookUrl = process.env.HOOK_URL; if (!hookUrl) { console.warn("No process.env.HOOK_URL set. Please set it to your Connector Webhook URL before running this...
var Office365ConnectorHook = require("./index.js"), winston = require('winston'), Logger = winston.Logger, Console = winston.transports.Console, hookUrl = process.env.HOOK_URL; if (!hookUrl) { console.warn("No process.env.HOOK_URL set. Please set it to your Connector Webhook URL before running this...
Use subsitution for bundle names
const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:8080', 'webpack/hot/only-dev-server', './app/index.js' ], output: { path: path.resolve(__dirname, '...
const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:8080', 'webpack/hot/only-dev-server', './app/index.js' ], output: { path: path.resolve(__dirname, '...
Make test_run_command_on_agent connect to all agents Increase testing of SSH connection handling by connecting to all agents in the cluster.
from shakedown import * def test_run_command(): exit_status, output = run_command(master_ip(), 'cat /etc/motd') assert exit_status def test_run_command_on_master(): exit_status, output = run_command_on_master('uname -a') assert exit_status assert output.startswith('Linux') def test_run_command_o...
from shakedown import * def test_run_command(): exit_status, output = run_command(master_ip(), 'cat /etc/motd') assert exit_status def test_run_command_on_master(): exit_status, output = run_command_on_master('uname -a') assert exit_status assert output.startswith('Linux') def test_run_command_o...
Fix test for lastcmd mode.
package edit import ( "testing" "github.com/elves/elvish/edit/ui" ) var ( theLine = "qw search 'foo bar ~y'" theLastCmd = newLastCmd(theLine) lastcmdFilterTests = []listingFilterTestCases{ {"", []shown{ {"M-1", ui.Unstyled(theLine)}, {"0", ui.Unstyled("qw")}, {"1", ui.Unstyled("search")}, {"2"...
package edit import ( "testing" "github.com/elves/elvish/edit/ui" ) var ( theLine = "qw search 'foo bar ~y'" theLastCmd = newLastCmd(theLine) lastcmdFilterTests = []listingFilterTestCases{ {"", []shown{ {"M-,", ui.Unstyled(theLine)}, {"0", ui.Unstyled("qw")}, {"1", ui.Unstyled("search")}, {"2"...
Add test for inner criteria referencing another inner criteria
/* * Copyright 2019 Immutables Authors and Contributors * * 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 applica...
/* * Copyright 2019 Immutables Authors and Contributors * * 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 applica...
Rename AsyncSignal to CoroutineSignal for clarity of purpose
from inspect import signature import asyncio class Signal(object): def __init__(self, parameters): self._parameters = frozenset(parameters) self._receivers = set() def connect(self, receiver): # Check that the callback can be called with the given parameter names if __debug__:...
from inspect import signature import asyncio class Signal(object): def __init__(self, parameters): self._parameters = frozenset(parameters) self._receivers = set() def connect(self, receiver): # Check that the callback can be called with the given parameter names if __debug__:...
Change inf command to nfo and remove err messages
package main import ( "log" "net" ) func StartServer() { listener, err := net.Listen("tcp", Config.String("listen")) if err != nil { log.Fatal(err) } defer listener.Close() for { conn, err := listener.Accept() if err != nil { log.Fatal(err) } go communicate(conn) } } func communicate(conn net.Co...
package main import ( "log" "net" ) func StartServer() { listener, err := net.Listen("tcp", Config.String("listen")) if err != nil { log.Fatal(err) } defer listener.Close() for { conn, err := listener.Accept() if err != nil { log.Fatal(err) } go communicate(conn) } } func communicate(conn net.Co...
BAP-3040: Improve date conditions in filters - fix error message
<?php namespace Oro\Bundle\FilterBundle\Expression\Exception; use Oro\Bundle\DataGridBundle\Exception\UserInputErrorExceptionInterface; class ExpressionDenied extends SyntaxException implements UserInputErrorExceptionInterface { /** @var string */ private $template = 'Variable of type “%s” cannot be used wit...
<?php namespace Oro\Bundle\FilterBundle\Expression\Exception; use Oro\Bundle\DataGridBundle\Exception\UserInputErrorExceptionInterface; class ExpressionDenied extends SyntaxException implements UserInputErrorExceptionInterface { /** @var string */ private $template = 'Expression with "%s" are not supported!'...
Remove unnecessary final on interface JAVA-1215
/* * Copyright (c) 2008-2014 MongoDB, Inc. * * 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...
/* * Copyright (c) 2008-2014 MongoDB, Inc. * * 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...
Add compile step to tests before execution
'use strict'; var gulp = require('gulp'), browserify = require('browserify'), transform = require('vinyl-transform'), uglify = require('gulp-uglify'), sourcemaps = require('gulp-sourcemaps'), jasmine = require('gulp-jasmine'); gulp.task('default', ['javascript']); gulp.task('javascript', function...
'use strict'; var gulp = require('gulp'), browserify = require('browserify'), transform = require('vinyl-transform'), uglify = require('gulp-uglify'), sourcemaps = require('gulp-sourcemaps'), jasmine = require('gulp-jasmine'); gulp.task('default', ['javascript']); gulp.task('javascript', function...
Fix reload on delete post
function deletePost(value, post_id, user_id, csrf_token) { $.ajax( { type: 'post', url: 'delete.php', data: { type: 2, // refer to /delete.php for information about this POST data. value: value, post_id: post_id, user_id: user_id, ...
function deletePost(value, post_id, user_id, csrf_token) { $.ajax( { type: 'post', url: 'delete.php', data: { type: 2, // refer to /delete.php for information about this POST data. value: value, post_id: post_id, user_id: user_id, ...
Use XHTML break tag in Urban_dictionary Spice.
// `ddg_spice_urban_dictionary` is a callback function that gets // "urban dictionary cool" or "urban dictionary ROTFL." // Note: This plugin can display adult content and profanity. function ddg_spice_urban_dictionary(response) { if (!(response || response.response.result_type === "exact" || response.li...
// `ddg_spice_urban_dictionary` is a callback function that gets // "urban dictionary cool" or "urban dictionary ROTFL." // Note: This plugin can display adult content and profanity. function ddg_spice_urban_dictionary(response) { if (!(response || response.response.result_type === "exact" || response.li...
Update pi-montecarlo example to use `sum` again.
# encoding: utf-8 # --------------------------------------------------------------------------- # Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc. # Distributed under the terms of the BSD License. See COPYING.rst. # --------------------------------------------------------------------------- """...
# encoding: utf-8 # --------------------------------------------------------------------------- # Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc. # Distributed under the terms of the BSD License. See COPYING.rst. # --------------------------------------------------------------------------- """...
Change line end characters to UNIX (\r\n -> \n)
from django.conf import settings from os import path, listdir from lxml import etree class XmlJsonImportModuleException(Exception): pass if not hasattr(settings, 'XSLT_FILES_DIR'): raise XmlJsonImportModuleException('Settings must contain XSLT_FILES_DIR parameter') if not path.exists(settings.XSLT_FILES_DIR)...
from django.conf import settings from os import path, listdir from lxml import etree class XmlJsonImportModuleException(Exception): pass if not hasattr(settings, 'XSLT_FILES_DIR'): raise XmlJsonImportModuleException('Settings must contain XSLT_FILES_DIR parameter') if not path.exists(settings.XSLT_...
Add getValue for checkbox-form-field to return the correct value
Kwf.FrontendForm.Checkbox = Ext.extend(Kwf.FrontendForm.Field, { initField: function() { this.el.select('input').each(function(input) { input.on('click', function() { this.fireEvent('change', this.getValue()); }, this); }, this); }, clearValue: functio...
Kwf.FrontendForm.Checkbox = Ext.extend(Kwf.FrontendForm.Field, { initField: function() { this.el.select('input').each(function(input) { input.on('click', function() { this.fireEvent('change', this.getValue()); }, this); }, this); }, clearValue: functio...
Handle the case where JSLint complains about arguments in try/catch already being defined (we use the name 'e' consistently for catch(e) - will work to standardize on that now).
load("build/jslint.js"); var src = readFile("dist/jquery.js"); JSLINT(src, { evil: true, forin: true, maxerr: 100 }); // All of the following are known issues that we think are 'ok' // (in contradiction with JSLint) more information here: // http://docs.jquery.com/JQuery_Core_Style_Guidelines var ok = { "Expected a...
load("build/jslint.js"); var src = readFile("dist/jquery.js"); JSLINT(src, { evil: true, forin: true, maxerr: 100 }); // All of the following are known issues that we think are 'ok' // (in contradiction with JSLint) more information here: // http://docs.jquery.com/JQuery_Core_Style_Guidelines var ok = { "Expected a...
HPlus: Change Makibes F68 device type
package nodomain.freeyourgadget.gadgetbridge.model; /** * For every supported device, a device type constant must exist. * * Note: they key of every constant is stored in the DB, so it is fixed forever, * and may not be changed. */ public enum DeviceType { UNKNOWN(-1), PEBBLE(1), MIBAND(10), MIBAN...
package nodomain.freeyourgadget.gadgetbridge.model; /** * For every supported device, a device type constant must exist. * * Note: they key of every constant is stored in the DB, so it is fixed forever, * and may not be changed. */ public enum DeviceType { UNKNOWN(-1), PEBBLE(1), MIBAND(10), MIBAN...
Fix typo in Adler32 name.
package au.com.acegi.hashbench.hashers; import java.nio.ByteBuffer; import java.util.Map; import java.util.zip.Adler32; public class AdlerHasher implements Hasher { public static final String JRE_ADLER_32 = "adler32-jre"; public static final void register(final Map<String, Hasher> hashers) { hashers.put(Adle...
package au.com.acegi.hashbench.hashers; import java.nio.ByteBuffer; import java.util.Map; import java.util.zip.Adler32; public class AdlerHasher implements Hasher { public static final String JRE_ADLER_32 = "adler320-jre"; public static final void register(final Map<String, Hasher> hashers) { hashers.put(Adl...
Add LDAP settings to default config.
<?php /* * Copyright 2016 Lukas Metzger <developer@lukas-metzger.com>. * * 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 ...
<?php /* * Copyright 2016 Lukas Metzger <developer@lukas-metzger.com>. * * 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 ...