text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Add Image to ENTITY_TYPE Enum Useful for rich text editor inline image support
export const BLOCK_TYPE = { // This is used to represent a normal text block (paragraph). UNSTYLED: 'unstyled', HEADER_ONE: 'header-one', HEADER_TWO: 'header-two', HEADER_THREE: 'header-three', HEADER_FOUR: 'header-four', HEADER_FIVE: 'header-five', HEADER_SIX: 'header-six', UNORDERED_LIST_ITEM: 'unor...
export const BLOCK_TYPE = { // This is used to represent a normal text block (paragraph). UNSTYLED: 'unstyled', HEADER_ONE: 'header-one', HEADER_TWO: 'header-two', HEADER_THREE: 'header-three', HEADER_FOUR: 'header-four', HEADER_FIVE: 'header-five', HEADER_SIX: 'header-six', UNORDERED_LIST_ITEM: 'unor...
Change contact field and author field for PyPI.
""" ``onecodex`` ------------ ``onecodex`` provides a command line client for interaction with the One Codex API. Links ````` * `One Codex: <https://www.onecodex.com/>` * `API Docs: <http://docs.onecodex.com/>` """ from setuptools import setup setup( name='onecodex', version='0.0.1', url='https://www...
""" ``onecodex`` ------------ ``onecodex`` provides a command line client for interaction with the One Codex API. Links ````` * `One Codex: <https://www.onecodex.com/>` * `API Docs: <http://docs.onecodex.com/>` """ from setuptools import setup setup( name='onecodex', version='0.0.1', url='https://www...
Enforce name conventions for test-created activities
/** * */ package test.issues.strava; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import java.util.Arrays; import java.util.List; import javastrava.api.v3.model.StravaComment; import javastrava.api.v3.rest.API; import javastrava.api.v3.rest.ActivityAPI; import org.juni...
/** * */ package test.issues.strava; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import java.util.Arrays; import java.util.List; import javastrava.api.v3.model.StravaComment; import javastrava.api.v3.rest.API; import javastrava.api.v3.rest.ActivityAPI; import org.juni...
Replace let with var for compatibility issue
'use strict'; // Bubble sort has worst-case and average complexity both О(n^2), // where n is the number of items being sorted. // The significant advantage that bubble sort has over most other implementations, // even quicksort, but not insertion sort, is that the ability to detect that the // list is sorted is effic...
'use strict'; // Bubble sort has worst-case and average complexity both О(n^2), // where n is the number of items being sorted. // The significant advantage that bubble sort has over most other implementations, // even quicksort, but not insertion sort, is that the ability to detect that the // list is sorted is effic...
Fix property name for ember-simple-auth
import Ember from 'ember'; import DS from 'ember-data'; import ENV from '../config/environment'; function getToken() { var token; var session = window.localStorage['ember_simple_auth-session']; if (session) { token = JSON.parse(session)['authenticated']; if ('attributes' in token) { ...
import Ember from 'ember'; import DS from 'ember-data'; import ENV from '../config/environment'; function getToken() { var token; var session = window.localStorage['ember_simple_auth:session']; if (session) { token = JSON.parse(session)['authenticated']; if ('attributes' in token) { ...
Remove TYPE_FREE and TYPE_PRO as we no longer need them
<?php /** * BoxBilling * * @copyright BoxBilling, Inc (https://www.boxbilling.org) * @license Apache-2.0 * * Copyright BoxBilling, Inc * This source file is subject to the Apache-2.0 License that is bundled * with this source code in the file LICENSE */ final class Box_Version { const VERSION = '0.0.1'...
<?php /** * BoxBilling * * @copyright BoxBilling, Inc (https://www.boxbilling.org) * @license Apache-2.0 * * Copyright BoxBilling, Inc * This source file is subject to the Apache-2.0 License that is bundled * with this source code in the file LICENSE */ final class Box_Version { const VERSION = '0.0.1'...
Resolve class based transform deprecation ember-source 3.27+: Using class based template compilation plugins is deprecated, please update to the functional style
'use strict'; /* eslint-env node */ let TEST_SELECTOR_PREFIX = /data-test-.*/; function isTestSelectorParam(param) { return param.type === 'PathExpression' && TEST_SELECTOR_PREFIX.test(param.original); } module.exports = function(env) { let b = env.syntax.builders; let transform = (node) => { if ('sex...
'use strict'; /* eslint-env node */ let TEST_SELECTOR_PREFIX = /data-test-.*/; function TransformTestSelectorParamsToHashPairs() { this.syntax = null; } function isTestSelectorParam(param) { return param.type === 'PathExpression' && TEST_SELECTOR_PREFIX.test(param.original); } TransformTestSelectorParamsTo...
Make the files server only
Package.describe({ name: 'capsulecat:model-factories', version: '1.0.0', summary: 'Easily generate data for your models using factories', git: 'https://github.com/CapsuleCat/MeteorModelFactories', documentation: 'README.md' }); function includeFiles(api) { api.use('ecmascript'); api.use('underscore'); ...
Package.describe({ name: 'capsulecat:model-factories', version: '1.0.0', summary: 'Easily generate data for your models using factories', git: 'https://github.com/CapsuleCat/MeteorModelFactories', documentation: 'README.md' }); function includeFiles(api) { api.use('ecmascript'); api.use('underscore'); ...
Set correct email config for salesforce sync. BB-1530
try: from .secrets import * except ImportError: import sys sys.exit('secrets.py settings file not found. Please run `prepare.sh` to create one.') from .base import * # # We need this specific override because having the salesforce app and bluebottle_salesforce # enabled causes tests to fail in our other ...
try: from .secrets import * except ImportError: import sys sys.exit('secrets.py settings file not found. Please run `prepare.sh` to create one.') from .base import * # # We need this specific override because having the salesforce app and bluebottle_salesforce # enabled causes tests to fail in our other ...
fix/webFetch-encoding: Add content-encoding headers for webfetch response. Set 'chunked'
import logger from 'logger'; import { getAppObj } from '../network'; const safeRoute = { method : 'GET', path : '/safe/{link*}', handler : async ( request, reply ) => { try { const link = `safe://${request.params.link}`; const app = getAppObj(); ...
import logger from 'logger'; import { getAppObj } from '../network'; const safeRoute = { method : 'GET', path : '/safe/{link*}', handler : async ( request, reply ) => { try { const link = `safe://${request.params.link}`; const app = getAppObj(); ...
Fix the deleter that was never tested.
'use strict'; const Promise = require('bluebird'); const rmdir = Promise.promisify(require('rimraf')); const db = require('../shared/db'); module.exports = function() { getOldFolders().then(deleteFolders).done(); }; function getOldFolders() { return Promise.using(db(), function(client) { return clien...
'use strict'; const Promise = require('bluebird'); const rmdir = Promise.promisify(require('rimraf')); const db = require('../shared/db'); module.exports = function() { getOldFolders().then(deleteFolders).done(); }; function getOldFolders() { return Promise.using(db(), function(client) { return clien...
Add getters for visitor/visit properties.
package com.woopra.java.sdk; import java.util.HashMap; public class WoopraVisitor { public static String EMAIL = "email"; public static String UNIQUE_ID = "uniqueId"; protected HashMap<String, Object> properties = new HashMap<String, Object>(); private String ipAddress = ""; private String cookieValue = ""; ...
package com.woopra.java.sdk; import java.util.HashMap; public class WoopraVisitor { public static String EMAIL = "email"; public static String UNIQUE_ID = "uniqueId"; protected HashMap<String, Object> properties = new HashMap<String, Object>(); private String ipAddress = ""; private String cookieValue = ""; ...
Enforce image on backend users images to be actual images
<?php namespace Nodes\Backend\Models\User\Validation; use Nodes\Validation\AbstractValidator; /** * Class UserValidation. */ class UserValidator extends AbstractValidator { /** * Validation rules. * * @var array */ protected $rules = [ 'create' => [ 'name' => ['requi...
<?php namespace Nodes\Backend\Models\User\Validation; use Nodes\Validation\AbstractValidator; /** * Class UserValidation. */ class UserValidator extends AbstractValidator { /** * Validation rules. * * @var array */ protected $rules = [ 'create' => [ 'name' => ['requi...
Use new options for dummy/docs app
/*jshint node:true*/ /* global require, module */ var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { var app = new EmberAddon(defaults, { // Add options here babel: { includePolyfill: false }, SemanticUI: { paths: { fonts: 'assets...
/*jshint node:true*/ /* global require, module */ var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { var app = new EmberAddon(defaults, { // Add options here babel: { includePolyfill: false } }); /* This build file specifies the options fo...
Swap hitzer inverse test to use np.testing
import numpy as np import pytest import clifford as cf class TestClosedForm: @pytest.mark.parametrize('p, q', [ (p, total_dims - p) for total_dims in [1, 2, 3, 4, 5] for p in range(total_dims + 1) ]) def test_hitzer_inverse(self, p, q): Ntests = 100 layout, blades...
import numpy as np import pytest import clifford as cf class TestClosedForm: @pytest.mark.parametrize('p, q', [ (p, total_dims - p) for total_dims in [1, 2, 3, 4, 5] for p in range(total_dims + 1) ]) def test_hitzer_inverse(self, p, q): Ntests = 100 layout, blades...
Replace NullOutputStream with inline implementation Using `NullOutputStream` in `FluxProgrammTest` introduced a depdency on Apache Commons IO which can easily be avoided.
/* * Copyright 2013, 2014 Deutsche Nationalbibliothek * * Licensed under the Apache License, Version 2.0 the "License"; * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicab...
/* * Copyright 2013, 2014 Deutsche Nationalbibliothek * * Licensed under the Apache License, Version 2.0 the "License"; * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicab...
Send authorization tokens in `fetch`
import { inject as service } from '@ember/service'; import fetch from 'fetch'; import Route from '@ember/routing/route'; import ResetScrollPositionMixin from 'frontend/mixins/reset-scroll-position'; export default Route.extend(ResetScrollPositionMixin, { intl: service(), session: service(), queryParams: { ...
import { inject as service } from '@ember/service'; import fetch from 'fetch'; import Route from '@ember/routing/route'; import ResetScrollPositionMixin from 'frontend/mixins/reset-scroll-position'; export default Route.extend(ResetScrollPositionMixin, { intl: service(), session: service(), queryParams: { ...
Clean JSON object creation code
var express = require('express'); var router = express.Router(); var funfacts = [ 'Ants stretch when they wake up in the morning.', 'The state of Florida is bigger than England.', 'Some bamboo plants can grow almost a meter in just one day.', 'Olympic gold medals are actually made mostly of silver.', 'On ave...
var express = require('express'); var router = express.Router(); var funfacts = [ 'Ants stretch when they wake up in the morning.', 'The state of Florida is bigger than England.', 'Some bamboo plants can grow almost a meter in just one day.', 'Olympic gold medals are actually made mostly of silver.', 'On ave...
Fix teardown of resize handler in content management screen refs #5659 ([comment](https://github.com/TryGhost/Ghost/issues/5659#issuecomment-137114898)) - cleans up resize handler on willDestroy hook of gh-content-view-container
import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'section', classNames: ['gh-view', 'content-view-container'], previewIsHidden: false, resizeService: Ember.inject.service(), _resizeListener: null, calculatePreviewIsHidden: function () { if (this.$('.conten...
import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'section', classNames: ['gh-view', 'content-view-container'], previewIsHidden: false, resizeService: Ember.inject.service(), calculatePreviewIsHidden: function () { if (this.$('.content-preview').length) { ...
Fix no header test for csv formatter
import unittest, argparse from echolalia.formatter.csver import Formatter class CsverTestCase(unittest.TestCase): def setUp(self): self.parser = argparse.ArgumentParser() self.data = [{'char': chr(i), 'order': i - 96} for i in xrange(97, 100)] self.formatter = Formatter() def test_add_args(self): ...
import unittest, argparse from echolalia.formatter.csver import Formatter class CsverTestCase(unittest.TestCase): def setUp(self): self.parser = argparse.ArgumentParser() self.data = [{'char': chr(i), 'order': i - 96} for i in xrange(97, 100)] self.formatter = Formatter() def test_add_args(self): ...
Create response for request and create env var for twilio account.
var express = require('express'); var router = express.Router(); var app = express(); router.get('/sendSMS', function(req, res, next){ var number = req.query['number']; var body_message = req.query['message']; var client = require('twilio')(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN); ...
var express = require('express'); var router = express.Router(); var app = express(); router.get('/sendSMS', function(req, res, next){ var number = req.query['number']; var body_message = req.query['message']; var client = require('twilio')('AC525c4929b17f0023e6067967a16232f0', '7a1cfcc80b4adc7634cf037b3d...
Format mismatch, can not use historic node name
package main import "crypto" import "strings" // Checksum algos import ( _ "crypto/md5" _ "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" ) // Man, why don't people allow their table to be exported... var checksumLookupTable = map[string]crypto.Hash{ "md5": crypto.MD5, "sha1": cr...
package main import "crypto" import "strings" // Checksum algos import ( _ "crypto/md5" _ "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" ) // Man, why don't people allow their table to be exported... var checksumLookupTable = map[string]crypto.Hash{ "md5": crypto.MD5, "sha1": cr...
Make the test mod take the version from the API.
package gigaherz.graph.api; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecr...
package gigaherz.graph.api; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecr...
Customize Messenger widget - remove useless param
KylinApp.service('MessageService', function () { var options = { extraClasses: 'messenger-fixed messenger-on-top messenger-on-right', theme: 'air' }; this.sendMsg = function (msg, type, actions, sticky) { var data = { message: msg, type: angular.isDefined(ty...
KylinApp.service('MessageService', function (GraphBuilder) { var options = { extraClasses: 'messenger-fixed messenger-on-top messenger-on-right', theme: 'air' }; this.sendMsg = function (msg, type, actions, sticky) { var data = { message: msg, type: angular....
Add missing header file to the list of sources
try: from setuptools import setup from setuptools.extension import Extension except ImportError: from distutils.core import setup, Extension def main(): module = Extension('rrdtool', sources=['rrdtoolmodule.h', 'rrdtoolmodule.c'], include_dirs=['/usr/local...
try: from setuptools import setup from setuptools.extension import Extension except ImportError: from distutils.core import setup, Extension def main(): module = Extension('rrdtool', sources=['rrdtoolmodule.c'], include_dirs=['/usr/local/include'], ...
Fix many ESLint errors (STRIPES-100)
// We have to remove node_modules/react to avoid having multiple copies loaded. // eslint-disable-next-line import/no-unresolved import React from 'react'; import List from '@folio/stripes-components/lib/List'; import TextField from '@folio/stripes-components/lib/TextField'; import Icon from '@folio/stripes-components/...
import React from 'react'; import css from './ListDropdown.css'; import List from '@folio/stripes-components/lib/List'; import TextField from '@folio/stripes-components/lib/TextField'; import Button from '@folio/stripes-components/lib/Button'; import Icon from '@folio/stripes-components/lib/Icon'; function ListDropdow...
Remove unneeded error parameter for login form
var angular = require('angular'); angular.module('LoginComp', ['AuthSvc']).component('loginComponent', { templateUrl: '/views/shimapan/login-form.html', controller: ['$scope', '$timeout', 'AuthService', function ($scope, $timeout, AuthService) { $scope.login = function () { AuthService.logi...
var angular = require('angular'); angular.module('LoginComp', ['AuthSvc']).component('loginComponent', { templateUrl: '/views/shimapan/login-form.html', controller: ['$scope', '$timeout', 'AuthService', function ($scope, $timeout, AuthService) { $scope.login = function () { AuthService.logi...
Make server module requirements explicit
Donations.App = Space.Application.define('Donations.App', { configuration: { appId: 'Donations.App' }, requiredModules: [ 'Space.messaging', 'Space.accounts', 'Space.accountsUi', 'Space.eventSourcing', 'Donations.domain' ], singletons: [ // APIS 'Donations.OrgRegistrationApi...
Donations.App = Space.Application.define('Donations.App', { configuration: { appId: 'Donations.App' }, requiredModules: [ 'Space.accounts', 'Space.accountsUi', 'Donations.domain' ], singletons: [ // APIS 'Donations.OrgRegistrationApi', 'Donations.OrgApi', 'Donations.AppealsA...
Fix error with data being passed to redirect method This fixes a bug where the title was being passed to the wrong method which caused the redirect to error.
const router = require('express').Router() const { getProjectDetails } = require('./shared.middleware') const { populateDetailsFormMiddleware, investmentDetailsFormPostMiddleware, } = require('./form.middleware') function createGetHandler (req, res) { if (!res.locals.equityCompany) { return res.redirect('/...
const router = require('express').Router() const { getProjectDetails } = require('./shared.middleware') const { populateDetailsFormMiddleware, investmentDetailsFormPostMiddleware, } = require('./form.middleware') function createGetHandler (req, res) { if (!res.locals.equityCompany) { return res.redirect('/...
Make test print meta strings
package com.io7m.jcanephora; import java.io.IOException; import javax.media.opengl.GLContext; import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.io7m.jaux.Constraints.ConstraintError; public class GLMetaJOGL30Test { private GLContext context; @Be...
package com.io7m.jcanephora; import java.io.IOException; import javax.media.opengl.GLContext; import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.io7m.jaux.Constraints.ConstraintError; public class GLMetaJOGL30Test { private GLContext context; @Be...
Replace readRegexp() with next() in Holder
const AstNode = require('./ast-node'); class Holder extends AstNode { type() { return 'holder'; } /** * @param {ParseContext} context * @return {boolean} */ read(context) { const config = context.config(); const tm = context.lookaheadTextManager(); try { tm.next(config.openDeli...
const AstNode = require('./ast-node'); class Holder extends AstNode { type() { return 'holder'; } /** * @param {ParseContext} context * @return {boolean} */ read(context) { const config = context.config(); const tm = context.lookaheadTextManager(); try { tm.next(config.openDeli...
Fix wrong config includes in kit package
"""Adhocracy extension.""" from pyramid.config import Configurator from adhocracy_core import root_factory def includeme(config): """Setup adhocracy extension. The kit package should be exactly like the spd package but with different root permissions and default translations for the emails. """ ...
"""Adhocracy extension.""" from pyramid.config import Configurator from adhocracy_core import root_factory def includeme(config): """Setup adhocracy extension. The kit package should be exactly like the spd package but with different root permissions and default translations for the emails. """ ...
Fix populateByService and make it functional
import fp from 'lodash/fp'; import { plural } from 'pluralize'; const populateList = (list, idField) => (data) => { return fp.map((doc) => { let item = data.find((item) => { return String(doc[idField]) === String(item.id); }); return item; })(list); }; const populateByService = (app, idField, ty...
import { flatten, groupBy, map, omit } from 'lodash'; import { plural } from 'pluralize'; export function populateByService(app, documents, idField, typeField, options) { let types = groupBy(documents, typeField); return Promise.all( Object.keys(types).map((type) => { let entries = types[type]; ret...
Create SweetScroll instance after updated current page order
// @flow import { PureComponent } from 'react' import scrollParent from 'scrollparent' import SweetScroll from 'sweet-scroll' import type { Children } from 'react' import Wrapper from './Wrapper' type Props = { width: number, currentPageOrder: number, children?: ?Children, } export default class Scroller exte...
// @flow import { PureComponent } from 'react' import scrollParent from 'scrollparent' import SweetScroll from 'sweet-scroll' import type { Children } from 'react' import Wrapper from './Wrapper' type Props = { width: number, currentPageOrder: number, children?: ?Children, } export default class Scroller exte...
Fix CircleCI artifacts env path
const fs = require('fs') const glob = require('glob') const outputDirectory = [process.env.$CIRCLE_ARTIFACTS, 'snapshots'] .filter(x => x) .join('/') const createDir = dir => { const splitPath = dir.split('/') splitPath.reduce((path, subPath) => { if (!fs.existsSync(path)) { console.log(`Create dire...
const fs = require('fs') const glob = require('glob') const outputDirectory = [process.env.CIRCLE_ARTIFACTS, 'snapshots'] .filter(x => x) .join('/') const createDir = dir => { const splitPath = dir.split('/') splitPath.reduce((path, subPath) => { if (!fs.existsSync(path)) { console.log(`Create direc...
Add decoding of the recieved data
<?php /** * Main entry point * * @author Ivanis Kouamé <ivanis.kouame@smile.fr> * @copyright 2015 Smile */ const ROOT_PATH = __DIR__; require_once __DIR__ . '/../app/bootstrap.php'; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; $app = new Silex\Application(); ...
<?php /** * Main entry point * * @author Ivanis Kouamé <ivanis.kouame@smile.fr> * @copyright 2015 Smile */ const ROOT_PATH = __DIR__; require_once __DIR__ . '/../app/bootstrap.php'; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; $app = new Silex\Application(); ...
Make signature of test auth source match that of class it extends
<?php namespace SimpleSAML\Test\Auth; use SimpleSAML\Auth\SourceFactory; use SimpleSAML\Test\Utils\ClearStateTestCase; /** * Tests for SimpleSAML_Auth_Source */ class SourceTest extends ClearStateTestCase { public function testParseAuthSource() { $class = new \ReflectionClass('SimpleSAML_Auth_Sourc...
<?php namespace SimpleSAML\Test\Auth; use SimpleSAML\Auth\SourceFactory; use SimpleSAML\Test\Utils\ClearStateTestCase; /** * Tests for SimpleSAML_Auth_Source */ class SourceTest extends ClearStateTestCase { public function testParseAuthSource() { $class = new \ReflectionClass('SimpleSAML_Auth_Sourc...
Expand figure when window is resized
from PyQt4 import QtGui,QtCore import matplotlib as mpl from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure import matplotlib.mlab as mlab import matplotlib.gridspec...
from PyQt4 import QtGui import matplotlib as mpl from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure import matplotlib.mlab as mlab import matplotlib.gridspec as gri...
Add compare method from com.thaiopensource.relaxng.output.common.
package com.thaiopensource.xml.util; public final class Name { final private String namespaceUri; final private String localName; final private int hc; public Name(String namespaceUri, String localName) { this.namespaceUri = namespaceUri; this.localName = localName; this.hc = namespaceUri.hashCo...
package com.thaiopensource.xml.util; public final class Name { final private String namespaceUri; final private String localName; final private int hc; public Name(String namespaceUri, String localName) { this.namespaceUri = namespaceUri; this.localName = localName; this.hc = namespaceUri.hashCo...
Clean one last new line.
<?php namespace TypiCMS\Modules\Core\Http\Controllers; use Illuminate\Routing\Controller; abstract class BaseApiController extends Controller { /** * Array of endpoints that do not require authorization. */ protected $publicEndpoints = []; protected $repository; public function __constru...
<?php namespace TypiCMS\Modules\Core\Http\Controllers; use Illuminate\Routing\Controller; abstract class BaseApiController extends Controller { /** * Array of endpoints that do not require authorization. */ protected $publicEndpoints = []; protected $repository; public function __constr...
Make photos and videos accessible
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', admin.site.urls), url(r'^publication/', include('project.publications.urls')), url(r'^google/', include('djangoogle.urls')), url(r'^...
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', admin.site.urls), url(r'^publication/', include('project.publications.urls')), #url(r'^google/', include('project.google.urls')), ur...
Fix docstring and class name
# # Copyright (c) 2006, 2007 Canonical # # Written by Gustavo Niemeyer <gustavo@niemeyer.net> # # This file is part of Storm Object Relational Mapper. # # Storm is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Found...
# # Copyright (c) 2006, 2007 Canonical # # Written by Gustavo Niemeyer <gustavo@niemeyer.net> # # This file is part of Storm Object Relational Mapper. # # Storm is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Found...
Update RequestVote step 1 test data
package raft import ( "reflect" "testing" ) // 1. Reply false if term < currentTerm (#5.1) // Note: test based on Figure 7; server is leader line; peer is case (a) func TestCM_RpcRV_TermLessThanCurrentTerm(t *testing.T) { f := func(setup func(t *testing.T) (mcm *managedConsensusModule, mrs *mockRpcSender)) { mcm...
package raft import ( "reflect" "testing" ) func makeRVWithTerm(term TermNo) *RpcRequestVote { return &RpcRequestVote{term, 0, 0} } // 1. Reply false if term < currentTerm (#5.1) // Note: this test assumes server in sync with the Figure 7 leader func TestCM_RpcRV_TermLessThanCurrentTerm(t *testing.T) { f := func...
Make the default duration of the transition in the 'setSmooth' method of SmoothHelper a property.
Dashboard.SmoothHelper = Ember.Mixin.create({ _smoothHelperInterval: 10, _smoothHelperDuration: 1000, _smoothHelperProperties: function() { return {}; }.property(), setSmooth: function(property, value, duration) { var p = this.get('_smoothHelperProperties'); var d = typeof duration !== 'undefine...
Dashboard.SmoothHelper = Ember.Mixin.create({ _smoothHelperInterval: 10, _smoothHelperProperties: function() { return {}; }.property(), setSmooth: function(property, value, duration) { var p = this.get('_smoothHelperProperties'); var d = typeof duration !== 'undefined' ? duration : 1000; if (p...
Fix map tiles (thanks Colin)
define(['leaflet'], function (leaflet) { /** * @constructor */ function MapView(mapDivId) { this.map = leaflet.map(mapDivId); leaflet.tileLayer( 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', { id: 'map...
define(['leaflet'], function (leaflet) { /** * @constructor */ function MapView(mapDivId) { this.map = leaflet.map(mapDivId); leaflet.tileLayer( 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png32?access_token={accessToken}', { attri...
Use implicit paths to predefined conf files
"use strict"; angular.module('arethusa.core').constant('MAIN_ROUTE', { controller: 'MainCtrl', template: '<div ng-include="template"></div>', resolve: { loadConfiguration: function($q, $http, $route, configurator) { var params = $route.current.params; var confPath = './static/configs/'; var...
"use strict"; angular.module('arethusa.core').constant('MAIN_ROUTE', { controller: 'MainCtrl', template: '<div ng-include="template"></div>', resolve: { loadConfiguration: function($q, $http, $route, configurator) { var files = { default: './static/configs/default.json', staging: './sta...
Add roles "body:wrapper", "toolbar:wrapper", "page:wrapper"
const GitBook = require('gitbook-core'); const { React } = GitBook; const Page = require('./Page'); const Toolbar = require('./Toolbar'); const Body = React.createClass({ propTypes: { page: GitBook.PropTypes.Page, readme: GitBook.PropTypes.Readme }, render() { const { page, read...
const GitBook = require('gitbook-core'); const { React } = GitBook; const Page = require('./Page'); const Toolbar = require('./Toolbar'); const Body = React.createClass({ propTypes: { page: GitBook.PropTypes.Page, readme: GitBook.PropTypes.Readme }, render() { const { page, read...
Simplify and make it a bit easier to read output
<?php /* All code covered by the BSD license located at http://silverstripe.org/bsd-license/ */ namespace Marketo\CliTools; use Composer\Script\Event; /** * Task for applying patch files from a folder to a source trunk * * Assumes that the patches were created relative to the root folder of the application, and ...
<?php /* All code covered by the BSD license located at http://silverstripe.org/bsd-license/ */ namespace Marketo\CliTools; use Composer\Script\Event; /** * Task for applying patch files from a folder to a source trunk * * Assumes that the patches were created relative to the root folder of the application, and ...
Fix a wrong config in sample application.
package org.mym.prettylog; import android.app.Application; import org.mym.plog.PLog; import org.mym.plog.config.PLogConfig; /** * <p> * This class shows how to init PLog Library. * </p> * Created by muyangmin on 9/1/16. * * @author muyangmin * @since V1.3.0 */ public class PLogApplication extends Application...
package org.mym.prettylog; import android.app.Application; import org.mym.plog.PLog; import org.mym.plog.config.PLogConfig; /** * <p> * This class shows how to init PLog Library. * </p> * Created by muyangmin on 9/1/16. * * @author muyangmin * @since V3.94 */ public class PLogApplication extends Application ...
Refactor API endpoint to match naming convention in server/config/routes.js
angular.module( 'moviematch.services', [] ) .factory( 'Auth', function( ) {} ) .factory( 'Session', function( ) {} ) .factory( 'Match', function( $http ) { return { sendVote: function( sessionID, userID, movieID, vote ) { return $http.post( // returns a promise; if you want to make use of a callback simp...
angular.module( 'moviematch.services', [] ) .factory( 'Auth', function( ) {} ) .factory( 'Session', function( ) {} ) .factory( 'Match', function( $http ) { return { sendVote: function( sessionID, userID, movieID, vote ) { return $http.post( // returns a promise; if you want to make use of a callback simp...
Remove initialize() from duration mapper
/** * Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org> * * 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/. */ package org.seedstack.coffig.mappe...
/** * Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org> * * 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/. */ package org.seedstack.coffig.mappe...
Fix handling projectTemplate with no name
import Ember from 'ember'; import C from 'ui/utils/constants'; export default Ember.Route.extend({ catalog: Ember.inject.service(), allServices: Ember.inject.service(), model() { return Ember.RSVP.hash({ catalogInfo: this.get('catalog').fetchTemplates({templateBase: C.EXTERNAL_ID.KIND_INFRA, category:...
import Ember from 'ember'; import C from 'ui/utils/constants'; export default Ember.Route.extend({ catalog: Ember.inject.service(), allServices: Ember.inject.service(), model() { return Ember.RSVP.hash({ catalogInfo: this.get('catalog').fetchTemplates({templateBase: C.EXTERNAL_ID.KIND_INFRA, category:...
Add typing module as dependencies for python versions older than 3.5
from setuptools import setup, find_packages import os.path import re import sys package_name = 'sqlalchemy_dict' py_version = sys.version_info[:2] # reading package's version (same way sqlalchemy does) with open(os.path.join(os.path.dirname(__file__), package_name, '__init__.py')) as v_file: package_version = re....
from setuptools import setup, find_packages import os.path import re package_name = 'sqlalchemy_dict' # reading package's version (same way sqlalchemy does) with open(os.path.join(os.path.dirname(__file__), package_name, '__init__.py')) as v_file: package_version = re.compile(r".*__version__ = '(.*?)'", re.S).mat...
Extend the container interface from app.
<?php namespace Illuminate\Contracts\Foundation; use Illuminate\Contracts\Container\Container; interface Application extends Container { /** * Register a service provider with the application. * * @param \Illuminate\Support\ServiceProvider|string $provider * @param array $options * @param bool $for...
<?php namespace Illuminate\Contracts\Foundation; interface Application { /** * Register a service provider with the application. * * @param \Illuminate\Support\ServiceProvider|string $provider * @param array $options * @param bool $force * @return \Illuminate\Support\ServiceProvider */ public f...
Correct the expected exception to be EmptyPhpSourceCode
<?php namespace BetterReflectionTest\SourceLocator; use BetterReflection\Identifier\Identifier; use BetterReflection\Identifier\IdentifierType; use BetterReflection\SourceLocator\StringSourceLocator; use BetterReflection\SourceLocator\Exception\EmptyPhpSourceCode; /** * @covers \BetterReflection\SourceLocator\Strin...
<?php namespace BetterReflectionTest\SourceLocator; use BetterReflection\Identifier\Identifier; use BetterReflection\Identifier\IdentifierType; use BetterReflection\SourceLocator\StringSourceLocator; use InvalidArgumentException; /** * @covers \BetterReflection\SourceLocator\StringSourceLocator */ class StringSour...
Add `float` to always convert list
/** * Consider: * * .a { * margin: 0 5px 0 0; * } * * .a { * margin: 0; * } * * Would be converted to: * * html[dir='ltr'] .a { * margin: 0 5px 0 0; * } * * html[dir='rtl'] .a { * margin: 0 0 0 5px; * } * * .a { * margin: 0; * } * * As the...
/** * Consider: * * .a { * margin: 0 5px 0 0; * } * * .a { * margin: 0; * } * * Would be converted to: * * html[dir='ltr'] .a { * margin: 0 5px 0 0; * } * * html[dir='rtl'] .a { * margin: 0 0 0 5px; * } * * .a { * margin: 0; * } * * As the...
[chore] Add bower.json and package.json to jshint checks
module.exports = function(grunt) { grunt.initConfig({ jshint: { files: ['*.js', 'client/app/*.js', 'server/**/*.js', 'database/**/*.js', '*.json'], options: { ignores: [ // (TODO: add lib files here) ] } }, uglify: { my_target: { files: { ...
module.exports = function(grunt) { grunt.initConfig({ jshint: { files: ['*.js', 'client/app/*.js', 'server/**/*.js', 'database/**/*.js'], options: { ignores: [ // (TODO: add lib files here) ] } }, uglify: { my_target: { files: { 'client...
Update Closure LANGUAGE_IN flag to match tsc's target.
/** * @license * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This * code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt The complete set of authors may be * found at http://polymer.github.io/AUTHORS.txt The complete set of * contributors may b...
/** * @license * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This * code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt The complete set of authors may be * found at http://polymer.github.io/AUTHORS.txt The complete set of * contributors may b...
Correct variables, and have it add to number given in get request.
<html> <head> <title>Number Counter</title> </head> <body> <?php $date = $_GET['date']; if (!isset($num)) die("Give me a number boo"); if ($num < 0) die ("Yo, digits are not valid, bro..."); $num = $numend; echo "<h2>Counting towards ".$num.":"."</h2>"; for ($num=$numend; $numend>=0; $numend++) {...
<html> <head> <title>Number Counter</title> </head> <body> <?php $date = $_GET['date']; if (!isset($num)) die("Give me a number boo"); if ($num < 0) die ("Yo, digits are not valid, bro..."); $num = $numend; echo "<h2>Counting towards ".$date.":"."</h2>"; for ($num=$numend; $numend>=0; $numend++) ...
Change package name in loadmodule call Not much reason to do this. It just happened.
# -*- coding: utf-8 -*- """ mathdeck.loadproblem ~~~~~~~~~~~~~~~~~~~~ This module loads a problem file as a module. :copyright: (c) 2015 by Patrick Spencer. :license: Apache 2.0, see ../LICENSE for more details. """ import os import sys # Load problem file as def load_file_as_module(file_path): """ Load p...
# -*- coding: utf-8 -*- """ mathdeck.loadproblem ~~~~~~~~~~~~ This module loads a problem file as a module. :copyright: (c) 2015 by Patrick Spencer. :license: Apache 2.0, see ../LICENSE for more details. """ import os import sys # Load problem file as def load_file_as_module(file): """ Load problem file a...
Add 'reverse' argument to get_enum_as_dict.
# Copyright 2013 Rackspace # # 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...
# Copyright 2013 Rackspace # # 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...
Add autofocus to login form
<?php session_start(); ?> <!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8" /> <title>SSBO Ticketing - Login</title> <meta name="description" content="SSBO Ticketing System Login" /> <meta name="author" content="Marius Runde" /> <!-- Stylesheet --> <link rel="stylesheet" href="style.css" /...
<?php session_start(); ?> <!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8" /> <title>SSBO Ticketing - Login</title> <meta name="description" content="SSBO Ticketing System Login" /> <meta name="author" content="Marius Runde" /> <!-- Stylesheet --> <link rel="stylesheet" href="style.css" /...
Add text for mobile devices
import React, {PropTypes} from 'react'; import LeftSidebar from "./views/leftsidebar/LeftSidebar"; import {appComponents} from "./ConfigMap"; import AppController from "./controller/AppController"; class App extends React.Component { render(){ return ( <div className="app-wrapper "> <div className="row vis...
import React, {PropTypes} from 'react'; import LeftSidebar from "./views/leftsidebar/LeftSidebar"; import {appComponents} from "./ConfigMap"; import AppController from "./controller/AppController"; class App extends React.Component { render(){ return ( <div className="app-wrapper "> <div className="row ...
Refactor to use shorthand req res
var helpers = require( '../config/helpers' ); var Session = require( './sessions' ); module.exports = { getAllSessions: function( reqw, res, next ) { Session.findAll() .then( function( sessions ) { res.send( sessions ); }) }, addSession: function( req, res, next ) { var sessionName = req....
var helpers = require( '../config/helpers' ); var Session = require( './sessions' ); module.exports = { getAllSessions: function( reqw, res, next ) { Session.findAll() .then( function( sessions ) { response.send( sessions ); }) }, addSession: function( req, res, next ) { var sessionName =...
views: Use url_for for base redirection
from flask import redirect, url_for from skylines import app import skylines.views.i18n import skylines.views.login import skylines.views.search from skylines.views.about import about_blueprint from skylines.views.api import api_blueprint from skylines.views.flights import flights_blueprint from skylines.views.notif...
from flask import redirect from skylines import app import skylines.views.i18n import skylines.views.login import skylines.views.search from skylines.views.about import about_blueprint from skylines.views.api import api_blueprint from skylines.views.flights import flights_blueprint from skylines.views.notifications ...
Use ioutil.ReadFile instead of os.Openfile with O_CREATE. No need to create an empty file if meta data key is not found.
package plugin import ( "io/ioutil" "os" "path/filepath" "github.com/pkg/errors" ) type metaDataStore struct { dir string installTarget *installTarget } var errDisaleMetaDataStore = errors.New("MetaData disabled. could not detect owner/repo") func newMetaDataStore(pluginDir string, target *installT...
package plugin import ( "io/ioutil" "os" "path/filepath" "github.com/pkg/errors" ) type metaDataStore struct { dir string installTarget *installTarget } var errDisaleMetaDataStore = errors.New("MetaData disabled. could not detect owner/repo") func newMetaDataStore(pluginDir string, target *installT...
Fix printf format bug: use %v for structs
package translator import ( "github.com/Shopify/go-lua" "github.com/fsouza/go-dockerclient" "reflect" "testing" ) func TestUnknownPropertiesConfig(t *testing.T) { source := `x = {blah = 5}` expected := docker.Config{} state := lua.NewState() if err := lua.DoString(state, source); err != nil { t.Errorf("Er...
package translator import ( "github.com/Shopify/go-lua" "github.com/fsouza/go-dockerclient" "reflect" "testing" ) func TestUnknownPropertiesConfig(t *testing.T) { source := `x = {blah = 5}` expected := docker.Config{} state := lua.NewState() if err := lua.DoString(state, source); err != nil { t.Errorf("Er...
Append HISTORY to long description on PyPI
from setuptools import setup def fread(fn): return open(fn, 'rb').read().decode('utf-8') setup( name='tox-travis', description='Seamless integration of Tox into Travis CI', long_description=fread('README.rst') + '\n\n' + fread('HISTORY.rst'), author='Ryan Hiebert', author_email='ryan@ryanhieb...
from setuptools import setup setup( name='tox-travis', description='Seamless integration of Tox into Travis CI', long_description=open('README.rst', 'rb').read().decode('utf-8'), author='Ryan Hiebert', author_email='ryan@ryanhiebert.com', url='https://github.com/ryanhiebert/tox-travis', lic...
Update control alignment (was relying in platform-specific margins)
// Hello page // exports.View = { title: "Hello World", elements: [ { control: "text", value: "Enter your name:", font: { size: 12, bold: true } }, { control: "stackpanel", orientation: "Horizontal", contents: [ { control: "text", value: "First name:", fontsize: 12, width: 200,...
// Hello page // exports.View = { title: "Hello World", elements: [ { control: "stackpanel", orientation: "Horizontal", contents: [ { control: "text", value: "First name:", fontsize: 12, width: 200, textAlignment: "Right", margin: { top: 10, right: 10 } }, { control: "edit",...
[lite] Update benchmark app to try to load flex first if available to support the case when we build the flex version. PiperOrigin-RevId: 370787699 Change-Id: I6fb52db0c50a3a2fafb7d698960f6ae57cdce8df
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Fix types in util tests
// Copyright 2016 Albert Nigmatzianov. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package util import ( "bytes" "testing" ) var ( sizeInt int = 15351 sizeBytes = []byte{0, 0, 0x77, 0x77} ) func TestParseSize(t *testing.T) { ...
// Copyright 2016 Albert Nigmatzianov. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package util import ( "bytes" "testing" ) var ( sizeInt int64 = 15351 sizeBytes = []byte{0, 0, 0x77, 0x77} ) func TestParseSize(t *testing.T...
Send stream responses to the OutputStream, to handle binary formats
/** * Copyright 2008 Matthew Hillsdon * * 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 agre...
/** * Copyright 2008 Matthew Hillsdon * * 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 agre...
Change to [ and ]
var shouldAddEventListener; // define a handler function doc_keyUp(e) { // this would test if keyCode 219 ([) or keyCode 221 (]) was pressed if (e.keyCode == 219) { console.log("Keyboard for like triggered."); document.querySelector("#top-level-buttons > ytd-toggle-button-renderer:nth-child(1) > a")...
var shouldAddEventListener; // define a handler function doc_keyUp(e) { // this would test if keyCode 85 (u) or keyCode 73 (i) was pressed if (e.keyCode == 85) { console.log("Keyboard for like triggered."); document.querySelector("#top-level-buttons > ytd-toggle-button-renderer:nth-child(1) > a").cl...
Update loadConfig to allow duplicates
/* jshint node:true */ 'use strict'; module.exports = function (grunt) { var config = { pkg: grunt.file.readJSON('package.json'), srcDir: 'src', destDir: 'dist', tempDir: 'tmp', }; // load plugins require('load-grunt-tasks')(grunt); // load task definitions grunt.loadTasks('tasks'); //...
/* jshint node:true */ 'use strict'; module.exports = function (grunt) { var config = { pkg: grunt.file.readJSON('package.json'), srcDir: 'src', destDir: 'dist', tempDir: 'tmp', }; // load plugins require('load-grunt-tasks')(grunt); // load task definitions grunt.loadTasks('tasks'); //...
Correct the view of capturist dashboard
from django.contrib.auth.decorators import user_passes_test, login_required from django.shortcuts import render from perfiles_usuario.utils import is_capturista from estudios_socioeconomicos.models import Estudio @login_required #@user_passes_test(is_capturista) def capturista_dashboard(request): """View to rend...
from django.contrib.auth.decorators import user_passes_test, login_required from django.shortcuts import render from perfiles_usuario.utils import is_capturista from estudios_socioeconomicos.models import Estudio @login_required @user_passes_test(is_capturista) def capturista_dashboard(request): """View to rende...
Improve comment abotu Tachyons in counter-clodable-styled.js
// This is a modification of the previous example which adds some styling using the Tachyons CSS library. // Tachyons predefines many classes which do common CSS tasks. // You can add these classes to your div using the Mithril ".cssClass" notation after the HTML tag name. // If there is no leading tag name before the ...
// This is a modification of the previous example which adds some styling using the Tachyons CSS library. // Tachyons predefines many classes which do common CSS tasks. // You can add these classes to your div using the Mithril ".cssClass" notation after the HTML tag name. // If there is no leading tag name before the ...
Prepare for next dev cycle
#!/usr/bin/env python # coding: utf-8 from setuptools import setup, find_packages setup( name="bentoo", description="Benchmarking tools", version="0.16.dev", packages=find_packages(), scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py", "scripts/bentoo-collector.py", "sc...
#!/usr/bin/env python # coding: utf-8 from setuptools import setup, find_packages setup( name="bentoo", description="Benchmarking tools", version="0.15", packages=find_packages(), scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py", "scripts/bentoo-collector.py", "script...
Fix implementation for SpiderMonkey (firefox)
function render(world) { var rendering = ''; for (var y = world.boundaries()['y']['min']; y <= world.boundaries()['y']['max']; y++) { for (var x = world.boundaries()['x']['min']; x <= world.boundaries()['x']['max']; x++) { var cell = world.cell_at(x, y); rendering += (cell ? cell.to_char() : ' ').re...
function render(world) { var rendering = ''; for (var y = world.boundaries()['y']['min']; y <= world.boundaries()['y']['max']; y++) { for (var x = world.boundaries()['x']['min']; x <= world.boundaries()['x']['max']; x++) { var cell = world.cell_at(x, y); rendering += (cell ? cell.to_char() : ' ').re...
Remove dots from generic types
const DocumentedItem = require('./item'); class DocumentedVarType extends DocumentedItem { registerMetaInfo(data) { this.directData = data; } serialize() { const names = []; for(const name of this.directData.names) names.push(this.constructor.splitVarName(name)); if(!this.directData.description && !this.di...
const DocumentedItem = require('./item'); class DocumentedVarType extends DocumentedItem { registerMetaInfo(data) { this.directData = data; } serialize() { const names = []; for(const name of this.directData.names) names.push(this.constructor.splitVarName(name)); if(!this.directData.description && !this.di...
Fix docs and label and use more intuitive function name
'use strict'; /*! * Dependencies */ var debug = require('debug')('ooyala:closedCaptions') /** * Upload Closed Caption file for video asset * * @param {String} asset id * @param {Buffer} caption file contents * @return {Promise} promise */ exports.uploadVideoClosedCaptions = function(id, file) { var rej =...
'use strict'; /*! * Dependencies */ var debug = require('debug')('ooyala:thumbnails') /** * TODO: There is a size limit on what can be sent, no idea what that limit * actually is. If found, add it here for validation * * Upload thumbnail image as the custom image for the video. * This does not automatically s...
Fix date range in worklog_period
from datetime import date from django.db.models import Max, Min def worklog_period(obj): activity_period = obj.worklogentries.aggregate(Max('date'), Min('date')) article_period = obj.articleentries.aggregate(Max('date'), Min('date')) min_date = date(1900, 1, 1) max_date = date(3000, 1, 1) if no...
from datetime import date from django.db.models import Max, Min def worklog_period(obj): activity_period = obj.worklogentries.aggregate(Max('date'), Min('date')) article_period = obj.articleentries.aggregate(Max('date'), Min('date')) min_date = date(1, 1, 1) max_date = date(3000, 1, 1) if not (...
Fix function names being lost in binding
'use strict'; const { reduceAsync, identity } = require('../utilities'); const { rpcHandlers } = require('../rpc'); // Reducer function that takes the schema as input and output, // and iterate over rpc-specific reduce functions const rpcReducer = function ({ schema, processors, postProcess = identity }) { return r...
'use strict'; const { reduceAsync, identity } = require('../utilities'); const { rpcHandlers } = require('../rpc'); // Returns a reducer function that takes the schema as input and output, // and iterate over rpc-specific reduce functions const getRpcReducer = function (name, postProcess) { const processors = getPr...
Load test Randomizer lazily to avoid confliction in prod runtime.
package cfvbaibai.cardfantasy.test; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; import cfvbaibai.cardfantasy.Randomizer; import cfvbaibai.cardfantasy.StaticRandomizer; import cfvbaibai.cardfantasy.engine.GameEngine; import cfvbaibai.cardfantasy.game.De...
package cfvbaibai.cardfantasy.test; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; import cfvbaibai.cardfantasy.Randomizer; import cfvbaibai.cardfantasy.StaticRandomizer; import cfvbaibai.cardfantasy.engine.GameEngine; import cfvbaibai.cardfantasy.game.De...
Fix pretty print not ignoring shardID
const pino = require('pino') const serializers = require('./serializers.js') const getConfig = require('../../config.js').get function createLogger (shardID) { const config = getConfig() const prettyPrint = { translateTime: 'yyyy-mm-dd HH:MM:ss', messageFormat: '[{shardID}] \x1b[0m{msg}', ignore: 'host...
const pino = require('pino') const serializers = require('./serializers.js') const getConfig = require('../../config.js').get function createLogger (shardID) { const config = getConfig() const prettyPrint = { translateTime: 'yyyy-mm-dd HH:MM:ss', messageFormat: '[{shardID}] \x1b[0m{msg}', ignore: 'host...
Fix CS regarding nullable arguments
<?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\Serializer\Extractor; use Symfony\Component\PropertyI...
<?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\Serializer\Extractor; use Symfony\Component\PropertyI...
Patch by Russel Owen: if we have command line arguments zap pyc files in the directories given.
#!/usr/local/bin/python """Recursively zap all .pyc files""" import os import sys # set doit true to actually delete files # set doit false to just print what would be deleted doit = 1 def main(): if not sys.argv[1:]: if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files ...
# Zap .pyc files import os import sys doit = 1 def main(): if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]: print 'Usage: zappyc dir ...' sys.exit(1) for dir in...
Return the original function value for static methods, too
var is = require('core-util-is') // added in Node 0.12 /** * Instrument an object or class so that anytime a method is invoked, it gets * logged to the console. * * @param {function} constructor */ module.exports = function (constructor) { Object.keys(constructor).forEach(function (methodName) { if (!is.is...
var is = require('core-util-is') // added in Node 0.12 /** * Instrument an object or class so that anytime a method is invoked, it gets * logged to the console. * * @param {function} constructor */ module.exports = function (constructor) { Object.keys(constructor).forEach(function (methodName) { if (!is.is...
Add error message if an id is not found in TaskStatus (should never happen)
package slave import ( "fmt" "github.com/aaronang/cong-the-ripper/lib" ) func (s *Slave) addTask(task lib.Task) { taskStatus := lib.TaskStatus{ Id: task.ID, JobId: task.JobID, Status: lib.Running, Progress: task.Start, } s.heartbeat.TaskStatus = append(s.heartbeat.TaskStatus, taskStatus) } f...
package slave import ( "fmt" "github.com/aaronang/cong-the-ripper/lib" ) func (s *Slave) addTask(task lib.Task) { taskStatus := lib.TaskStatus{ Id: task.ID, JobId: task.JobID, Status: lib.Running, Progress: task.Start, } s.heartbeat.TaskStatus = append(s.heartbeat.TaskStatus, taskStatus) } f...
Update proj4js from 2.4.4 to 2.5.0
/******************************************************************************* * Copyright 2014, 2018 gwt-ol3 * * 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...
/******************************************************************************* * Copyright 2014, 2017 gwt-ol3 * * 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...
Refactor the title into a getter method
import cuid from 'cuid'; import {database, auth} from '@/config/firebase'; export default function (post = {}) { // Properties this.id = post.id || cuid(); this.created = post.created || Date.now(); this.lastEdited = post.lastEdited || null; this.lastSaved = post.lastSaved || null; this.lastPublished = po...
import cuid from 'cuid'; import {database, auth} from '@/config/firebase'; export default function (post = {}) { // Properties this.id = post.id || cuid(); this.title = post.title || ''; this.created = post.created || Date.now(); this.lastEdited = post.lastEdited || null; this.lastSaved = post.lastSaved |...
Add name to custom filter
<?php /* * Copyright 2016 Jack Sleight <http://jacksleight.com/> * This source file is subject to the MIT license that is bundled with this package in the file LICENCE. */ namespace Coast\Filter\Rule; use Coast\Filter\Rule; class Custom extends Rule { protected $_func = []; public function __construct(call...
<?php /* * Copyright 2016 Jack Sleight <http://jacksleight.com/> * This source file is subject to the MIT license that is bundled with this package in the file LICENCE. */ namespace Coast\Filter\Rule; use Coast\Filter\Rule; class Custom extends Rule { protected $_func = []; public function __construct(call...
Add bridge between Entry and User(which will be created on the next commit)
import datetime import psycopg2 from sqlalchemy import ( Column, DateTime, Integer, Unicode, UnicodeText, ForeignKey, ) from pyramid.security import Allow, Everyone from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import ( scoped_session, sessionmaker, ...
import datetime import psycopg2 from sqlalchemy import ( Column, DateTime, Integer, Unicode, UnicodeText, ) from pyramid.security import Allow, Everyone from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import ( scoped_session, sessionmaker, ) from zope.sqla...
Make tests more resilient by using a better selector
module.exports = { // get zero () { return browser.element('button*=0)'); }, get zero () { return browser.element('button*=0'); }, get one () { return browser.element('button*=1'); }, get two () { return browser.element('button*=2'); }, get three () { return browser.element('button*=3'); }, get four () { re...
module.exports = { get zero () { return browser.element('.digits:nth-child(1)'); }, get one () { return browser.element('.digits:nth-child(2)'); }, get two () { return browser.element('.digits:nth-child(3)'); }, get three () { return browser.element('.digits:nth-child(4)'); }, get four () { return browser.ele...
Set desired qt version explicitly in run_quince.py
#!C:\Users\qlab\Anaconda3\envs\pyqt5\python.exe # coding: utf-8 # Raytheon BBN Technologies 2016 # Contributiors: Graham Rowlands # # This file runs the main loop # Use PyQt5 by default import os os.environ["QT_API"] = 'pyqt5' from qtpy.QtWidgets import QApplication import sys import argparse from quince.view import...
#!C:\Users\qlab\Anaconda3\envs\pyqt5\python.exe # coding: utf-8 # Raytheon BBN Technologies 2016 # Contributiors: Graham Rowlands # # This file runs the main loop from qtpy.QtWidgets import QApplication import sys import argparse from quince.view import * if __name__ == "__main__": parser = argparse.ArgumentPar...
Comment out old demos for now.
/// <reference path="../typings/angularjs/angular.d.ts"/> angular.module('MyModule', ['ngRoute']); angular.module('MyModule').config(function ($routeProvider) { $routeProvider.when("/main", { controller: "maincontroller", templateUrl: "app/views/main.html" }); // $routeProvider.when("/collisions",...
/// <reference path="../typings/angularjs/angular.d.ts"/> angular.module('MyModule', ['ngRoute']); angular.module('MyModule').config(function ($routeProvider) { $routeProvider.when("/main", { controller: "maincontroller", templateUrl: "app/views/main.html" }); $routeProvider.when("/collisions", {...
[schema] Validate that type name is a string
import leven from 'leven' import humanize from 'humanize-list' import {error, HELP_IDS} from '../createValidationResult' const quote = str => `"${str}"` export function validateTypeName(typeName: string, visitorContext) { const possibleTypeNames = visitorContext.getTypeNames() if (!typeName) { return [ ...
import leven from 'leven' import humanize from 'humanize-list' import {error, HELP_IDS} from '../createValidationResult' const quote = str => `"${str}"` export function validateTypeName(typeName: string, visitorContext) { const possibleTypeNames = visitorContext.getTypeNames() if (!typeName) { return [ ...
Fix buildpack typo to buildpacks
exports.topics = [ { name: 'apps', description: 'manage apps' }, { name: 'info', hidden: true, }, { name: 'maintenance', description: 'manage maintenance mode for an app' }, { name: 'stack', description: 'manage the stack for an app' }, { name: 'buildpacks', description: 'manage the build...
exports.topics = [ { name: 'apps', description: 'manage apps' }, { name: 'info', hidden: true, }, { name: 'maintenance', description: 'manage maintenance mode for an app' }, { name: 'stack', description: 'manage the stack for an app' }, { name: 'buildpacks', description: 'manage the build...
Make sure we use an accessor rather than a private var for overriding
package ca.uhnresearch.pughlab.tracker.restlets; import org.restlet.Context; import org.restlet.Request; import org.restlet.Response; import org.restlet.Restlet; import org.restlet.data.Status; import org.restlet.routing.Filter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class DefaultingFilter ex...
package ca.uhnresearch.pughlab.tracker.restlets; import org.restlet.Context; import org.restlet.Request; import org.restlet.Response; import org.restlet.Restlet; import org.restlet.data.Status; import org.restlet.routing.Filter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class DefaultingFilter ex...
Remove server name and port
$(function() { var s = io.connect('/'); s.on("connect", function () { console.log("connected"); }); s.on("disconnect", function (client) { console.log("disconnected"); }); s.on("receive_stdout", function (data) { $("pre#stdout").append(data.value); // var msg = value.replace( /[!@$%<>'"&|]/g,...
$(function() { var s = io.connect('http://localhost:3000'); s.on("connect", function () { console.log("connected"); }); s.on("disconnect", function (client) { console.log("disconnected"); }); s.on("receive_stdout", function (data) { $("pre#stdout").append(data.value); // var msg = value.repla...
Put the calculated value on the right
from tests.base_case import ChatBotMongoTestCase class RepetitiveResponseFilterTestCase(ChatBotMongoTestCase): """ Test case for the RepetitiveResponseFilter class. """ def test_filter_selection(self): """ Test that repetitive responses are filtered out of the results. """ ...
from tests.base_case import ChatBotMongoTestCase class RepetitiveResponseFilterTestCase(ChatBotMongoTestCase): """ Test case for the RepetitiveResponseFilter class. """ def test_filter_selection(self): """ Test that repetitive responses are filtered out of the results. """ ...