text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Remove default value. Use a thing straight, don't stuff it to var
var get = require('lodash.get') function getAcceptedLanguage (request) { if (!request || typeof request.get !== 'function') { return } var header = request.get('accept-language') || '' var acceptedLanguages = header.split(';') return acceptedLanguages[0] } function getQueryFromRequest (request) { re...
var get = require('lodash.get') function getAcceptedLanguage (request) { if (!request || typeof request.get !== 'function') { return } var header = request.get('accept-language') || '' var acceptedLanguages = header.split(';') return acceptedLanguages[0] } function getQueryFromRequest (request) { re...
Add test for incorrect generation
package db2 import ( "github.com/Aptomi/aptomi/pkg/slinga/util" "github.com/stretchr/testify/assert" "testing" ) func TestKey(t *testing.T) { correctKey := Key("72b062c1-7fcf-11e7-ab09-acde48001122$42") assert.Equal(t, util.UID("72b062c1-7fcf-11e7-ab09-acde48001122"), correctKey.GetUID(), "Correct UID expected"...
package db2 import ( "github.com/Aptomi/aptomi/pkg/slinga/util" "github.com/stretchr/testify/assert" "testing" ) func TestKey(t *testing.T) { correctKey := Key("72b062c1-7fcf-11e7-ab09-acde48001122$42") assert.Equal(t, util.UID("72b062c1-7fcf-11e7-ab09-acde48001122"), correctKey.GetUID(), "Correct UID expected"...
Add credit property to member REST API response
from rest_framework import viewsets, serializers from .models import MemberType, Member, MembershipApplicationTag, MembershipApplication class MemberTypeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = MemberType class MemberTypeViewSet(viewsets.ModelViewSet): serializer_class =...
from rest_framework import viewsets, serializers from .models import MemberType, Member, MembershipApplicationTag, MembershipApplication class MemberTypeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = MemberType class MemberTypeViewSet(viewsets.ModelViewSet): serializer_class =...
Allow for empty string as target
import _ from 'lodash'; const translation = (function translation() { let language = 'original'; function translate(target,override) { let lang = override || language; if (!_.isString(target) && !_.isObject(target)) { throw new Error(`Cannot translate target '${target}'`); ...
import _ from 'lodash'; const translation = (function translation() { let language = 'original'; function translate(target,override) { let lang = override || language; if (!target) { throw new Error(`Cannot translate target '${target}'`); } if (target && _.isString...
Clear local storage on log out
define(['jquery', 'app', 'services/User'], function ($, app) { var services = [ { name: 'Facebook' }, { name: 'Github' }, { name: 'Google' } ]; return app.controller('SignInController', ['$scope', '$window', 'userService', 'historyService', 'settingsService', function (scope, win, User, historySe...
define(['jquery', 'app', 'services/User'], function ($, app) { var services = [ { name: 'Facebook' }, { name: 'Github' }, { name: 'Google' } ]; return app.controller('SignInController', ['$scope', '$window', 'userService', function (scope, win, User) { scope.services = services; scope.userAva...
Set and Register view & model OPEN - task 86: Create Business(Sales-Purchases) Module http://github.com/DevOpsDistilled/OpERP/issues/issue/86
package devopsdistilled.operp.client.business.sales.panes.controllers.impl; import javax.inject.Inject; import devopsdistilled.operp.client.abstracts.EntityOperation; import devopsdistilled.operp.client.business.sales.panes.SaleDescPane; import devopsdistilled.operp.client.business.sales.panes.controllers.SaleDescPan...
package devopsdistilled.operp.client.business.sales.panes.controllers.impl; import javax.inject.Inject; import devopsdistilled.operp.client.abstracts.EntityOperation; import devopsdistilled.operp.client.business.sales.panes.SaleDescPane; import devopsdistilled.operp.client.business.sales.panes.controllers.SaleDescPan...
Correct `Builder.__call__` parameters when called by the `Simulator`
import sys from pacman103.core import control from pacman103 import conf from . import builder class Simulator(object): def __init__(self, model, dt=0.001, seed=None, use_serial=False): # Build the model self.builder = builder.Builder() self.dao = self.builder(model, dt, seed, use_serial...
import sys from pacman103.core import control from pacman103 import conf from . import builder class Simulator(object): def __init__(self, model, dt=0.001, seed=None, use_serial=False): # Build the model self.builder = builder.Builder(use_serial=use_serial) self.dao = self.builder(model,...
Add "use strict" to shuffler
/* global randomRoute:true */ // todo: make a lib and move this var shuffle = function (array) { "use strict"; var currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; temporaryValue = arra...
/* global randomRoute:true */ // todo: make a lib and move this var shuffle = function (array) { var currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; temporaryValue = array[currentIndex]; ...
[WebViewBridge] Fix a issue that requires a android.permission.VIBRATE https://github.com/hnakagawa/triaina/issues/2 reported by fumiz
package jp.mixi.triaina.webview.bridges; import com.google.inject.Inject; import android.os.Vibrator; import jp.mixi.triaina.commons.utils.ArrayUtils; import jp.mixi.triaina.webview.annotation.Bridge; import jp.mixi.triaina.webview.entity.device.VibratorVibrateParams; public class VibratorBridge implements BridgeObj...
package jp.mixi.triaina.webview.bridges; import com.google.inject.Inject; import android.os.Vibrator; import jp.mixi.triaina.commons.utils.ArrayUtils; import jp.mixi.triaina.webview.annotation.Bridge; import jp.mixi.triaina.webview.entity.device.VibratorVibrateParams; public class VibratorBridge implements BridgeObj...
Remove reference to IP in test
const Broker = require('../index') const { secureRandom, createConnection, newLogger, retryProtocol } = require('testHelpers') describe('Broker > FindGroupCoordinator', () => { let groupId, seedBroker beforeEach(async () => { groupId = `consumer-group-id-${secureRandom()}` seedBroker = new Broker({ ...
const Broker = require('../index') const { secureRandom, createConnection, newLogger, retryProtocol } = require('testHelpers') describe('Broker > FindGroupCoordinator', () => { let groupId, seedBroker beforeEach(async () => { groupId = `consumer-group-id-${secureRandom()}` seedBroker = new Broker({ ...
Address review comment: Don't state the obvious.
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Interfaces that filesystem APIs need to expose. """ from __future__ import absolute_import from zope.interface import Interface class IFilesystemSnapshots(Interface): """ Support creating and listing snapshots of a specific filesystem. ""...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Interfaces that filesystem APIs need to expose. """ from __future__ import absolute_import from zope.interface import Interface class IFilesystemSnapshots(Interface): """ Support creating and listing snapshots of a specific filesystem. ""...
Fix Undo Button initialize issue https://github.com/draft-js-plugins/draft-js-plugins/issues/718
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { EditorState } from 'draft-js'; import unionClassNames from 'union-class-names'; class UndoButton extends Component { static propTypes = { children: PropTypes.node.isRequired, theme: PropTypes.any, }; onClick = () => ...
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { EditorState } from 'draft-js'; import unionClassNames from 'union-class-names'; class UndoButton extends Component { static propTypes = { children: PropTypes.node.isRequired, theme: PropTypes.any, }; onClick = () => ...
Remove cards from default state Adding initial state, actioncreators and reducers did not remove errors being thrown; issue must be with the fundamental setup rather than lack of live data
//@flow import { createStore, compose, applyMiddleware } from "redux"; import { routerMiddleware } from "react-router-redux"; import createHistory from "history/createBrowserHistory"; import reducers from "./data/reducers"; const defaultState = {}; export const history = createHistory(); const middlewares = [routerM...
//@flow import { createStore, compose, applyMiddleware } from "redux"; import { routerMiddleware } from "react-router-redux"; import createHistory from "history/createBrowserHistory"; import reducers from "./data/reducers"; import cards from "./data/state/cards"; const defaultState = { cards }; export const history =...
Refactor to properly pull arg as a string. Issue #HAV-133 Signed-off-by: Christopher Mundus <711c73f64afdce07b7e38039a96d2224209e9a6c@kindlyops.com>
package main import ( "fmt" worker "github.com/contribsys/faktory_worker_go" keycloak "github.com/kindlyops/mappamundi/havenapi/keycloak" ) // CreateUser creates a new user with keycloak func CreateUser(ctx worker.Context, args ...interface{}) error { fmt.Println("Working on job", ctx.Jid()) err := keycloak.Key...
package main import ( "fmt" worker "github.com/contribsys/faktory_worker_go" keycloak "github.com/kindlyops/mappamundi/havenapi/keycloak" ) // CreateUser creates a new user with keycloak func CreateUser(ctx worker.Context, args ...interface{}) error { fmt.Println("Working on job", ctx.Jid()) err := keycloak.Key...
Make executable directory name consistent
package config import ( "github.com/hatofmonkeys/cloudfocker/utils" ) type RunConfig struct { ContainerName string ImageTag string PublishedPorts map[int]int Mounts map[string]string Command []string Daemon bool } func NewStageRunConfig(cloudfoundryAppDir string) (runConfig *RunConf...
package config import ( "github.com/hatofmonkeys/cloudfocker/utils" ) type RunConfig struct { ContainerName string ImageTag string PublishedPorts map[int]int Mounts map[string]string Command []string Daemon bool } func NewStageRunConfig(cloudfoundryAppDir string) (runConfig *RunConf...
:bug: Fix popper close after clicking <u-menu>
import MSinglex from '../m-singlex.vue'; export const UMenu = { name: 'u-menu', groupName: 'u-menu-group', childName: 'u-menu-item', extends: MSinglex, props: { router: { type: Boolean, default: true }, }, data() { return { parentVM: undefined, }; }, ...
import MSinglex from '../m-singlex.vue'; export const UMenu = { name: 'u-menu', groupName: 'u-menu-group', childName: 'u-menu-item', extends: MSinglex, props: { router: { type: Boolean, default: true }, }, data() { return { parentVM: undefined, }; }, ...
Remove unnecessary encoded spaces '%20'
Boom(); function Boom() { var requestedBookmarklet = window.prompt('Boom: Which One'); var boomMarklets = { plex: 'javascript:%20var%20s=document.createElement(%22script%22);s.type=%22text/javascript%22;s.src=%22https://my.plexapp.com/queue/bookmarklet_payload?uid=819f10b976818604%22;var%20h=document.g...
Boom(); function Boom() { var requestedBookmarklet = window.prompt('Boom:%20Which%20One'); var boomMarklets = { plex: 'javascript:%20var%20s=document.createElement(%22script%22);s.type=%22text/javascript%22;s.src=%22https://my.plexapp.com/queue/bookmarklet_payload?uid=819f10b976818604%22;var%20h=docume...
Add s->c message to unit test.
var assert = require('assert'); var sys = require('sys'); var WebSocket = require('websocket').WebSocket; var WebSocketServer = require('ws').Server; var PORT = 1024 + Math.floor(Math.random() * 4096); var MSG = 'This is a test: ' + (Math.random() * 100); var gotServerConnection = false; var gotServerClose = false; v...
var assert = require('assert'); var sys = require('sys'); var WebSocket = require('websocket').WebSocket; var WebSocketServer = require('ws').Server; var PORT = 1024 + Math.floor(Math.random() * 4096); var gotServerConnection = false; var gotServerClose = false; var gotOpen = true; var wss = new WebSocketServer(); w...
Remove future, bump vectormath dependencies
#!/usr/bin/env python """ properties: Fancy properties for Python. """ from distutils.core import setup from setuptools import find_packages CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Ma...
#!/usr/bin/env python """ properties: Fancy properties for Python. """ from distutils.core import setup from setuptools import find_packages CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Ma...
Make selectGameRoute be a reselect selector, so the actual object itself won't change if id and name haven't changed. boardgame-game-view looks for _gameRoute to have changed, and triggers a _resetState if it does. But before this commit, it would change every time state updated if id and name were non-nil! Part of #6...
import { createSelector } from 'reselect'; export const selectPage = (state) => state.app ? state.app.page : ""; export const selectPageExtra = (state) => state.app ? state.app.pageExtra : ""; export const selectManagers = (state) => state.list ? state.list.managers : []; export const selectGameTypeFilter = (state) =>...
export const selectPage = (state) => state.app ? state.app.page : ""; export const selectPageExtra = (state) => state.app ? state.app.pageExtra : ""; export const selectManagers = (state) => state.list ? state.list.managers : []; export const selectGameTypeFilter = (state) => state.list ? state.list.gameTypeFilter : ""...
Add test case and update changelog. Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
<?php namespace Orchestra\Support\Traits; use Illuminate\Support\Facades\File; use Symfony\Component\HttpFoundation\File\UploadedFile; use Orchestra\Support\Str; trait UploadableTrait { /** * Save uploaded file into directory. * * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file ...
<?php namespace Orchestra\Support\Traits; use Illuminate\Support\Facades\File; use Symfony\Component\HttpFoundation\File\UploadedFile; use Orchestra\Support\Str; trait UploadableTrait { /** * Save uploaded file into directory. * * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file ...
Remove string interpolation and sorting the collection.
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
# -*- coding: utf-8 -*- import re from . import export @export def fuzzyfinder(text, collection): """ Args: text (str): A partial string which is typically entered by a user. collection (iterable): A collection of strings which will be filtered based on the input ...
Fix logic related to GC of Event references using weakref.WeakValueDictionary.
from threading import Lock, Event from weakref import WeakValueDictionary class TransferEventManager(object): def __init__(self): self.events = WeakValueDictionary(dict()) self.events_lock = Lock() def acquire_event(self, path, force_clear=False): with self.events_lock: i...
from threading import Lock, Event class TransferEventManager(object): def __init__(self): self.events = dict() self.events_lock = Lock() def acquire_event(self, path, force_clear=False): with self.events_lock: if path in self.events: event_holder = self.ev...
Fix can not view apis in store
/*********************************************************************************************************************** * * * * * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * * * WSO2 Inc. licenses this file to you under the Apache License, * * Version 2.0 (the "Licens...
/*********************************************************************************************************************** * * * * * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * * * WSO2 Inc. licenses this file to you under the Apache License, * * Version 2.0 (the "Licens...
Update pyramid example with longer description
""" ==================== Build image pyramids ==================== The `build_gauassian_pyramid` function takes an image and yields successive images shrunk by a constant scale factor. Image pyramids are often used, e.g., to implement algorithms for denoising, texture discrimination, and scale- invariant detection. ""...
""" ==================== Build image pyramids ==================== This example shows how to build image pyramids. """ import numpy as np import matplotlib.pyplot as plt from skimage import data from skimage import img_as_float from skimage.transform import build_gaussian_pyramid image = data.lena() rows, cols, di...
Refactor dynamic config using smaller function that can be intercepted by alamid-plugin
"use strict"; var use = require("alamid-plugin/use.js"); var path = require("path"), argv = require("minimist")(process.argv.slice(2)); function dynamicConfig(basePath, fileName) { var env = dynamicConfig.getEnv(), filePath = dynamicConfig.getFilePath(basePath, env, fileName), config; i...
"use strict"; var path = require("path"), argv = require('minimist')(process.argv.slice(2)); function readDynamicConfig(basePath, fileName) { var env = process.env.env || argv.env || argv.ENV || readDynamicConfig.options.defaultEnv, filePath = path.join(basePath, env, fileName), config; i...
Modify get-status option in file
<?php function send_email($to_email,$subject,$message1) { require_once 'Mandrill.php'; $apikey = '%API_key%'; // use this to encrypt your api key $mandrill = new Mandrill($apikey); $message = new stdClass(); $message->html = $message1; $message->text = $message1; $message->subject = $subject; >>> function typescri...
<?php function send_email($to_email,$subject,$message1) { require_once 'Mandrill.php'; $apikey = '%API_key%'; // use this to encrypt your api key $mandrill = new Mandrill($apikey); $message = new stdClass(); $message->html = $message1; $message->text = $message1; $message->subject = $subject; >>> function typescri...
Order tests by query name.
var SparqlParser = require('../lib/sparql'); var fs = require('fs'), expect = require('chai').expect; var queriesPath = __dirname + '/../queries/'; var parsedQueriesPath = __dirname + '/../test/parsedQueries/'; describe('The SPARQL parser', function () { // Ensure the same blank node identifiers are used in ev...
var SparqlParser = require('../lib/sparql'); var fs = require('fs'), expect = require('chai').expect; var queriesPath = __dirname + '/../queries/'; var parsedQueriesPath = __dirname + '/../test/parsedQueries/'; describe('The SPARQL parser', function () { // Ensure the same blank node identifiers are used in ev...
Proto-loading: Throw if we get an error
;(function() { 'use strict'; window.textsecure = window.textsecure || {}; window.textsecure.protobuf = {}; function loadProtoBufs(filename) { return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) { if (error) { throw error; ...
;(function() { 'use strict'; window.textsecure = window.textsecure || {}; window.textsecure.protobuf = {}; function loadProtoBufs(filename) { return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) { var protos = result.build('textsecure'); ...
Add min argument for n when generating ngrams
import re from pattern import en # todo: use spacy tokenization def ngrams(text, max_n=1, min_n=1): for i in xrange(min_n-1,max_n): for n in en.ngrams(text, n=i+1): yield ' '.join(n) SENT_RE = re.compile('((?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|[\?!])\s)|(\s*\n\s*)') def iter_sent_spans(text): ...
import re from pattern import en # todo: use spacy tokenization def ngrams(text, n=1): for i in xrange(n): for n in en.ngrams(text, n=i+1): yield ' '.join(n) SENT_RE = re.compile('((?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|[\?!])\s)|(\s*\n\s*)') def iter_sent_spans(text): last = 0 for m in S...
Add suppliers feature TO SQUASH
/* eslint no-debugger: 0 */ import { combineReducers } from 'redux'; import auth from './auth'; import signupCreateReducer from './signup/create'; import signupCompleteReducer from './signup/complete'; import membershipsReducer from './groups/memberships'; import usersReducer from './users/users'; import bulkInvitatio...
/* eslint no-debugger: 0 */ import { combineReducers } from 'redux'; import auth from './auth'; import signupCreateReducer from './signup/create'; import signupCompleteReducer from './signup/complete'; import membershipsReducer from './groups/memberships'; import usersReducer from './users/users'; import bulkInvitatio...
Revert "Keep project-scripts dependency after adding package.json template data." This reverts commit 1ae48aa9a8166b97b5942396cb5b821927f0e513.
var path = require('path') var fs = require('fs-extra') var spawn = require('cross-spawn') module.exports = function(root, appName) { var selfPath = path.join(root, 'node_modules', 'jsonnull-project-scripts') var appPackage = require(path.join(root, 'package.json')) var templatePackage = require(path.join(self...
var path = require('path') var fs = require('fs-extra') var spawn = require('cross-spawn') module.exports = function(root, appName) { var selfPath = path.join(root, 'node_modules', 'jsonnull-project-scripts') var appPackage = require(path.join(root, 'package.json')) var templatePackage = require(path.join(self...
Disable button if nothing is entered in search bar
import React, { Component } from 'react'; import { View } from 'react-native'; import RepoSearchBar from './components/RepoSearchBar'; import RepoSearchButton from './components/RepoSearchButton'; import RepoList from './components/RepoList'; export default class SearchScreen extends Component { constructor(props) {...
import React, { Component } from 'react'; import { View } from 'react-native'; import RepoSearchBar from './components/RepoSearchBar'; import RepoSearchButton from './components/RepoSearchButton'; import RepoList from './components/RepoList'; export default class SearchScreen extends Component { constructor(props) {...
Resolve syntax errror during install
from setuptools import setup, find_packages setup(name='pixiedust', version='1.1.18', description='Productivity library for Jupyter Notebook', url='https://github.com/pixiedust/pixiedust', install_requires=['mpld3', 'lxml', 'geojson', 'astunparse', 'markdown', 'colour', 'requests', 'matplotlib',...
from setuptools import setup, find_packages setup(name='pixiedust', version='1.1.18', description='Productivity library for Jupyter Notebook', url='https://github.com/pixiedust/pixiedust', install_requires=['mpld3', 'lxml', 'geojson', 'astunparse', 'markdown', 'colour', 'requests', 'matplotlib',...
Remove not existing and unused trait
<?php namespace SlmMail\Mail\Message\Provider; use Zend\Mail\Message; class AlphaMail extends Message { /** * Identifier of AlphaMail project id to use * * @var int */ protected $project; /** * Variables to send to the project (they call it "payload") * * @var array ...
<?php namespace SlmMail\Mail\Message\Provider; use SlmMail\Mail\Message\ProvidesAttachments; use Zend\Mail\Message; class AlphaMail extends Message { /** * Identifier of AlphaMail project id to use * * @var int */ protected $project; /** * Variables to send to the project (they ...
Enable v1.3.0 on the development channel
{ "stable": { "CSIDE_version": "1.2.1", "nw_version": "0.21.4", "desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.", "target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip" }, "latest": { "CSIDE_version": "1.2.1", "nw_version": "0.21.4", "de...
{ "stable": { "CSIDE_version": "1.2.1", "nw_version": "0.21.4", "desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.", "target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip" }, "latest": { "CSIDE_version": "1.2.1", "nw_version": "0.21.4", "de...
Fix error propagation in middleware
'use strict'; let express = require('express'); let router = require('./router.js'); let createDatabaseManager = require('./models/dbManager.js'); let ClientError = require('./errors.js').ClientError; const dbUrl = 'mongodb://localhost:27017/athenicpaste'; function createApplication() { return createDatabaseMan...
'use strict'; let express = require('express'); let router = require('./router.js'); let createDatabaseManager = require('./models/dbManager.js'); let ClientError = require('./errors.js').ClientError; const dbUrl = 'mongodb://localhost:27017/athenicpaste'; function logErrors(err, request, response, next) { cons...
Add github to list of streams
module.path.unshift('js'); (function(){ module('import class ui.TabContainer'); module('import class marcuswestin.Layout'); module('import class lib.navigationManager'); module('import class marcuswestin.views.factory'); var layout = new marcuswestin.Layout(); var tabContainer = new ui.TabContainer(); docume...
module.path.unshift('js'); (function(){ module('import class ui.TabContainer'); module('import class marcuswestin.Layout'); module('import class lib.navigationManager'); module('import class marcuswestin.views.factory'); var layout = new marcuswestin.Layout(); var tabContainer = new ui.TabContainer(); docume...
Fix vehicle move serializing (still no idea what it does)
package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_1_9_r1__1_9_r2__1_10; import protocolsupport.api.ProtocolVersion; import protocolsupport.protocol.packet.ClientBoundPacket; import protocolsupport.protocol.packet.middle.clientbound.play.MiddleVehicleMove; import protocolsupport.protocol.packet.midd...
package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_1_9_r1__1_9_r2__1_10; import protocolsupport.api.ProtocolVersion; import protocolsupport.protocol.packet.ClientBoundPacket; import protocolsupport.protocol.packet.middle.clientbound.play.MiddleVehicleMove; import protocolsupport.protocol.packet.midd...
Correct Google Analytics for Russian domain.
<?php /* Must be included by inserting <?php require_once("../config.php"); ?> at the top of every page in www directory. */ // Site language which is used in <html lang="…"> attributes and for translations. // TODO(Alex): Generate all supported languages from one launch, without editing this constant. define('LANG'...
<?php /* Must be included by inserting <?php require_once("../config.php"); ?> at the top of every page in www directory. */ // Site language which is used in <html lang="…"> attributes and for translations. // TODO(Alex): Generate all supported languages from one launch, without editing this constant. define('LANG'...
Add rowLength to slider label
import React, { Component } from 'react'; class RowSizeControls extends Component { render() { return ( <div style={{textAlign: 'center'}}> <label>{this.props.value} images per row</label> <input style={{ display: 'block', margin: '0 auto', }} ...
import React, { Component } from 'react'; class RowSizeControls extends Component { render() { return ( <div style={{textAlign: 'center'}}> <label>Images per row</label> <input style={{ display: 'block', margin: '0 auto', }} type="range"...
Add defensive logic to csrf-ajax-filter
/* global document, $ */ /* Project specific Javascript goes here. */ /* Formatting hack to get around crispy-forms unfortunate hardcoding in helpers.FormHelper: if template_pack == 'bootstrap4': grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*') using_grid_layout = (grid_colum_matc...
/* global document, $ */ /* Project specific Javascript goes here. */ /* Formatting hack to get around crispy-forms unfortunate hardcoding in helpers.FormHelper: if template_pack == 'bootstrap4': grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*') using_grid_layout = (grid_colum_matc...
feat(config): Add custom port, UI port (commeted out) to default config
/* jshint node: true */ 'use strict'; var path = require('path'); function getTaskConfig(projectConfig) { // Browser Sync options object // https://www.browsersync.io/docs/options var taskConfig = { // Files to watch files: path.join(__dirname + '/..', projectConfig.dirs.dest), // Server config options s...
/* jshint node: true */ 'use strict'; var path = require('path'); function getTaskConfig(projectConfig) { // Browser Sync options object // https://www.browsersync.io/docs/options var taskConfig = { // Files to watch files: path.join(__dirname + '/..', projectConfig.dirs.dest), // Server config options s...
Add link to about me section
import React from 'react' import {Link} from 'react-router-dom'; import { LinkContainer } from 'react-router-bootstrap'; export default class Footer extends React.Component { constructor(props) { super(props); } render() { return ( <footer className="footer2"> <div className="footer"> ...
import React from 'react' import {Link} from 'react-router-dom'; import { LinkContainer } from 'react-router-bootstrap'; export default class Footer extends React.Component { constructor(props) { super(props); } render() { return ( <footer className="footer2"> <div className="footer"> ...
Fix up paths in system test.
from __future__ import print_function import os import netCDF4 as nc from model_test_helper import ModelTestHelper class TestCouplingFields(ModelTestHelper): def __init__(self): super(TestCouplingFields, self).__init__() def test_swflx(self): """ Compare short wave flux over a geog...
from __future__ import print_function import os import netCDF4 as nc from model_test_helper import ModelTestHelper class TestCouplingFields(ModelTestHelper): def __init__(self): super(TestCouplingFields, self).__init__() def test_swflx(self): """ Compare short wave flux over a geog...
Add ttr to product interface
<?php /** * This file is part of PMG\Queue * * Copyright (c) 2013 PMG Worldwide * * @package PMGQueue * @copyright 2013 PMG Worldwide * @license http://opensource.org/licenses/MIT MIT */ namespace PMG\Queue; /** * Producers add jobs to the queue. * * @since 0.1 * @author Christopher Davis <ch...
<?php /** * This file is part of PMG\Queue * * Copyright (c) 2013 PMG Worldwide * * @package PMGQueue * @copyright 2013 PMG Worldwide * @license http://opensource.org/licenses/MIT MIT */ namespace PMG\Queue; /** * Producers add jobs to the queue. * * @since 0.1 * @author Christopher Davis <ch...
Add tests for API login
import json import mock from rest_framework import status from bluebottle.test.utils import BluebottleTestCase from bluebottle.test.factory_models.accounts import BlueBottleUserFactory from django.core.urlresolvers import reverse class UserTokenTestCase(BluebottleTestCase): def setUp(self): super(UserTo...
import json import mock from rest_framework import status from bluebottle.test.utils import BluebottleTestCase from bluebottle.test.factory_models.accounts import BlueBottleUserFactory from django.core.urlresolvers import reverse class UserTokenTestCase(BluebottleTestCase): def setUp(self): super(UserTo...
Update to two more variable names.
<footer role="contentinfo"> <div class="wrapper"> <div class="__partner"> <span>In partnership with:</span> <img src="{{ $global_vars->footer_logo or '/dist/images/tmi-logo.png' }}" alt="partner"> </div> <nav class="alternative-nav"> <ul class="__menu -level-1"> <li><a href="/about">...
<footer role="contentinfo"> <div class="wrapper"> <div class="__partner"> <span>In partnership with:</span> <img src="{{ $global_vars->footer_logo or '/dist/images/tmi-logo.png' }}" alt="partner"> </div> <nav class="alternative-nav"> <ul class="__menu -level-1"> <li><a href="/about">...
Update namespace and implement SimpleValueObject
<?php /** * This file is part of the ValueObject package. * * (c) Lorenzo Marzullo <marzullo.lorenzo@gmail.com> */ namespace ValueObject\Enum; use MyCLabs\Enum\Enum; use ValueObject\SimpleValueObjectInterface; use ValueObject\ValueObjectInterface; /** * Class AbstractEnum. * * @package ValueObject * @author...
<?php /** * This file is part of the ValueObjects package. * * (c) Lorenzo Marzullo <marzullo.lorenzo@gmail.com> */ namespace ValueObjects\Enum; use MyCLabs\Enum\Enum; use ValueObjects\ValueObjectInterface; /** * Class AbstractEnum. * * @package ValueObjects * @author Lorenzo Marzullo <marzullo.lorenzo@gma...
Fix another misleading log message
import groundstation.proto.channel_list_pb2 from groundstation import logger log = logger.getLogger(__name__) def handle_listallchannels(self): log.info("Handling LISTALLCHANNELS") payload = self.station.channels() log.info("Sending %i channel descriptions" % (len(payload))) chunk = groundstation.pro...
import groundstation.proto.channel_list_pb2 from groundstation import logger log = logger.getLogger(__name__) def handle_listallchannels(self): log.info("Handling LISTALLCHANNELS") payload = self.station.channels() log.info("Sending %i object descriptions" % (len(payload))) chunk = groundstation.prot...
Update stacked bar example to use the hover kwarg.
from bokeh.charts import Bar, output_file, show from bokeh.charts.operations import blend from bokeh.charts.attributes import cat, color from bokeh.charts.utils import df_from_json from bokeh.sampledata.olympics2014 import data # utilize utility to make it easy to get json/dict data converted to a dataframe df = df_fr...
from bokeh.charts import Bar, output_file, show from bokeh.charts.operations import blend from bokeh.charts.attributes import cat, color from bokeh.charts.utils import df_from_json from bokeh.sampledata.olympics2014 import data from bokeh.models.tools import HoverTool # utilize utility to make it easy to get json/dic...
Remove include_package_data to install py.typed I found that sdist file does not include `py.typed`. For workaround, I found that when I remove `include_package_data` it works.
# encoding: utf-8 import sys from setuptools import setup def read_description(): with open('README.md', 'r', encoding='utf-8') as f: return f.read() setup( name='Inject', version='4.1.1', url='https://github.com/ivankorobkov/python-inject', license='Apache License 2.0', author='Iv...
# encoding: utf-8 import sys from setuptools import setup def read_description(): with open('README.md', 'r', encoding='utf-8') as f: return f.read() setup( name='Inject', version='4.1.1', url='https://github.com/ivankorobkov/python-inject', license='Apache License 2.0', author='Iv...
Fix failing test when two locales used same flag icon [#LEI-290]
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; import Ember from 'ember'; const localeStub = Ember.Service.extend({ locale: null }); moduleForComponent('language-picker', 'Integration | Component | language picker', { integration: true, beforeEach: functi...
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; import Ember from 'ember'; const localeStub = Ember.Service.extend({ locale: null }); moduleForComponent('language-picker', 'Integration | Component | language picker', { integration: true, beforeEach: functi...
Use HTTPS in download URL It appears that PyPI is now HTTPS-only.
from setuptools import setup setup( name='trac-github', version='2.1.5', author='Aymeric Augustin', author_email='aymeric.augustin@m4x.org', url='https://github.com/trac-hacks/trac-github', description='Trac - GitHub integration', download_url='https://pypi.python.org/pypi/trac-github', ...
from setuptools import setup setup( name='trac-github', version='2.1.5', author='Aymeric Augustin', author_email='aymeric.augustin@m4x.org', url='https://github.com/trac-hacks/trac-github', description='Trac - GitHub integration', download_url='http://pypi.python.org/pypi/trac-github', ...
Fix FindDepotToolsInPath not working in some cases When depot tools' path in PATH is like '/home/project/depot_tools/', FindDepotToolsInPath will not detect it because os.path.basename will get empty string. Fix this by getting its parent if its basename is empty. BUG=https://github.com/otcshare/cameo/issues/29
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
Fix use of deprecated Exception.message in Python 3
from Crypto.PublicKey import RSA from django.conf import settings from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Randomly generate a new RSA key for the OpenID server' def handle(self, *args, **options): try: key = RSA.generate(1024) f...
from Crypto.PublicKey import RSA from django.conf import settings from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Randomly generate a new RSA key for the OpenID server' def handle(self, *args, **options): try: key = RSA.generate(1024) f...
Improve unit test for HashableDict We have HashableDict introduced to network info storing, but hash function of this implementation was never tested in unit tests. Change-Id: Id48c9172ca63e19b397dc131d85ed631874142cd
# Copyright (c) 2013 Hortonworks, 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 agreed to in ...
# Copyright (c) 2013 Hortonworks, 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 agreed to in ...
Check UnixSocketSupport os specific variants only on the relevant os'
package de.gesellix.docker.client.filesocket; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Asse...
package de.gesellix.docker.client.filesocket; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; class UnixSocketFactorySupportTest { @Test @DisplayName("Supports ...
Change dependency URL for Snappy [Snappy has been migrated from Google Code to GitHub](https://github.com/golang/snappy/commit/eaa750b9bf4dcb7cb20454be850613b66cda3273). If you try to `go get` with the code.google.com URL in place, `go get` chokes because of the 302 redirect. Upstream, Shopify did the same thing [h...
package sarama import ( "bytes" "github.com/golang/snappy/snappy" "encoding/binary" ) var snappyMagic = []byte{130, 83, 78, 65, 80, 80, 89, 0} // SnappyEncode encodes binary data func snappyEncode(src []byte) ([]byte, error) { return snappy.Encode(nil, src) } // SnappyDecode decodes snappy data func snappyDecod...
package sarama import ( "bytes" "code.google.com/p/snappy-go/snappy" "encoding/binary" ) var snappyMagic = []byte{130, 83, 78, 65, 80, 80, 89, 0} // SnappyEncode encodes binary data func snappyEncode(src []byte) ([]byte, error) { return snappy.Encode(nil, src) } // SnappyDecode decodes snappy data func snappyDe...
Use <main> for main content
// Copyright © 2015-2019 Esko Luontola // This software is released under the Apache License 2.0. // The license text is at http://www.apache.org/licenses/LICENSE-2.0 /* @flow */ import "./defaultStyles"; import * as React from 'react'; import AuthenticationPanel from "./AuthenticationPanel"; import {Link} from "@rea...
// Copyright © 2015-2019 Esko Luontola // This software is released under the Apache License 2.0. // The license text is at http://www.apache.org/licenses/LICENSE-2.0 /* @flow */ import "./defaultStyles"; import * as React from 'react'; import AuthenticationPanel from "./AuthenticationPanel"; import {Link} from "@rea...
Remove unneeded import and format class
/* * Copyright 2002-2018 Barcelona Supercomputing Center (www.bsc.es) * * 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 ...
/* * Copyright 2002-2018 Barcelona Supercomputing Center (www.bsc.es) * * 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 ...
Use ; instead of , for Shibboleth multi value fields This corresponds to what mod_shibboleth does.
from pylons import config def get_userbadge_mapping(config=config): mapping = config.get('adhocracy.shibboleth.userbadge_mapping', u'') return (line.strip().split(u' ') for line in mapping.strip().split(u'\n') if line is not u'') def _attribute_equals(request, key, value): """ ...
from pylons import config def get_userbadge_mapping(config=config): mapping = config.get('adhocracy.shibboleth.userbadge_mapping', u'') return (line.strip().split(u' ') for line in mapping.strip().split(u'\n') if line is not u'') def _attribute_equals(request, key, value): """ ...
Add example for multiple references
var _ = require('lodash') ; var flatten = require('./flatten') ; //Some structural examples var objInput = { number: 44, bool: true, string: "foobar", object: {child:true}, array: ['chi', 'ld'], buffer: new Buffer("buffer") }; console.log(flatten.flatten(objInput)); var arr...
var _ = require('lodash') ; var flatten = require('./flatten') ; //Some structural examples var objInput = { number: 44, bool: true, string: "foobar", object: {child:true}, array: ['chi', 'ld'], buffer: new Buffer("buffer") }; console.log(flatten.flatten(objInput)); var arr...
Change version number, add author email.
from setuptools import setup setup( name='aufmachen', version='0.2.1', url='http://github.com/fdb/aufmachen', license='BSD', author='Frederik & Jan De Bleser', author_email='frederik@burocrazy.com', description='Turns a website\'s HTML into nice, clean objects.', packages=['aufmachen', ...
from setuptools import setup setup( name='aufmachen', version='0.1-dev', url='http://github.com/fdb/aufmachen', license='BSD', author='Frederik & Jan De Bleser', description='Turns a website\'s HTML into nice, clean objects.', packages=['aufmachen', 'aufmachen.websites'], package_data =...
Use Class.forName instead of class loader Class loader seems to be null on the bootclasspath Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
package bd.settings; /** * VmSettings are determined based on Java properties. They are used to configure VM-wide * properties, for instance whether a tool is enabled or not. */ public class VmSettings { public static final boolean DYNAMIC_METRICS; static { Settings s = getSettings(); DYNAMIC_METRICS ...
package bd.settings; /** * VmSettings are determined based on Java properties. They are used to configure VM-wide * properties, for instance whether a tool is enabled or not. */ public class VmSettings { public static final boolean DYNAMIC_METRICS; static { Settings s = getSettings(); DYNAMIC_METRICS ...
Use IPNEnvironment, since that has the constants.
<?php namespace Pippin; use Illuminate\Support\ServiceProvider; use Pippin\IPNValidator; use Pippin\IPNEnvironment; final class PayPalIPNServiceProvider extends ServiceProvider { private function environmentFromConfig() { $appEnvironment = app()->environment(); $sandboxEnvironments = config('pippin.sandbox_en...
<?php namespace Pippin; use Illuminate\Support\ServiceProvider; use Pippin\IPNValidator; final class PayPalIPNServiceProvider extends ServiceProvider { private function environmentFromConfig() { $appEnvironment = app()->environment(); $sandboxEnvironments = config('pippin.sandbox_environments'); if (in_arra...
Include webfont extensions in default filePatterns
var Promise = require('ember-cli/lib/ext/promise'); var chalk = require('chalk'); var yellow = chalk.yellow; var blue = chalk.blue; function applyDefaultConfigIfNecessary(config, prop, defaultConfig, ui){ if (!config[prop]) { var value = defaultConfig[prop]; config[prop] = value; ui.write(blue('| ...
var Promise = require('ember-cli/lib/ext/promise'); var chalk = require('chalk'); var yellow = chalk.yellow; var blue = chalk.blue; function applyDefaultConfigIfNecessary(config, prop, defaultConfig, ui){ if (!config[prop]) { var value = defaultConfig[prop]; config[prop] = value; ui.write(blue('| ...
Fix broken include of Cl\PHPUnitTestCase
<?php // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing')); if (APPLICATION_ENV === 'development') { ini_set('display_errors', true); } define('TEST_PATH', realpath(__DIR__)); chdir(realpath(TEST_PATH . ...
<?php // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing')); if (APPLICATION_ENV === 'development') { ini_set('display_errors', true); } define('TEST_PATH', realpath(__DIR__)); chdir(realpath(TEST_PATH . ...
Comment out @XmlLocation as we load it using Node acquired by XSLT.
package org.jboss.loom.migrators._ext; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlTransient; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode; import org.eclipse.persistence.oxm.annotations.XmlLocation; import org.xml.sax.Locator; /** * ...
package org.jboss.loom.migrators._ext; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlTransient; import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode; import org.eclipse.persistence.oxm.annotations.XmlLocation; import org.xml.sax.Locator; /** * ...
tests/helper-addon: Use alternative blueprint test helpers
'use strict'; var blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers'); var setupTestHooks = blueprintHelpers.setupTestHooks; var emberNew = blueprintHelpers.emberNew; var emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy; var chai = require('ember-cli-blueprint-test-helpers/chai'); var e...
'use strict'; var setupTestHooks = require('ember-cli-blueprint-test-helpers/lib/helpers/setup'); var BlueprintHelpers = require('ember-cli-blueprint-test-helpers/lib/helpers/blueprint-helper'); var generateAndDestroy = BlueprintHelpers.generateAndDestroy; describe('Acceptance: ember generate and destroy helper...
Fix decode error if pad name contains special characters and is sanitized
var padManager = require('../../db/PadManager'); var url = require('url'); exports.expressCreateServer = function (hook_name, args, cb) { //redirects browser to the pad's sanitized url if needed. otherwise, renders the html args.app.param('pad', function (req, res, next, padId) { //ensure the padname is valid ...
var padManager = require('../../db/PadManager'); var url = require('url'); exports.expressCreateServer = function (hook_name, args, cb) { //redirects browser to the pad's sanitized url if needed. otherwise, renders the html args.app.param('pad', function (req, res, next, padId) { //ensure the padname is valid ...
Put checks in on the method params
Meteor.methods({ editableJSON_update: function (collectionName, _id, action) { check(collectionName, String); check(_id, String); check(action, Object); var Collection = Mongo.Collection.get(collectionName); var updated = 0; try { if (!!Package['aldeed:simple-schema'] && !!P...
Meteor.methods({ editableJSON_update: function (collectionName, _id, action) { var Collection = Mongo.Collection.get(collectionName); var updated = 0; try { if (!!Package['aldeed:simple-schema'] && !!Package['aldeed:collection2'] && _.isFunction(Collection.simpleSchema) && Collecti...
Add validate to input for numbers invalid in Go but valid for Number parsing
// +build js package strconv import ( "github.com/gopherjs/gopherjs/js" ) const maxInt32 float64 = 1<<31 - 1 const minInt32 float64 = -1 << 31 // Atoi returns the result of ParseInt(s, 10, 0) converted to type int. func Atoi(s string) (int, error) { const fnAtoi = "Atoi" if len(s) == 0 { return 0, syntaxError(...
// +build js package strconv import ( "github.com/gopherjs/gopherjs/js" ) const maxInt32 float64 = 1<<31 - 1 const minInt32 float64 = -1 << 31 // Atoi returns the result of ParseInt(s, 10, 0) converted to type int. func Atoi(s string) (int, error) { const fnAtoi = "Atoi" if len(s) == 0 { return 0, syntaxError(...
Remove log from build script
const uglifyPlugin = require("rollup-plugin-uglify"); const replace = require("rollup-plugin-replace"); const commonjs = require("rollup-plugin-commonjs"); const resolve = require("rollup-plugin-node-resolve"); module.exports = function(options, env) { const { name, file, input, external = [], gl...
const uglifyPlugin = require("rollup-plugin-uglify"); const replace = require("rollup-plugin-replace"); const commonjs = require("rollup-plugin-commonjs"); const resolve = require("rollup-plugin-node-resolve"); module.exports = function(options, env) { const { name, file, input, external = [], gl...
Add type-hints to Artisan Facade methods props
<?php namespace Illuminate\Support\Facades; /** * @method static void compile(string|null $path = null) * @method static string getPath() * @method static void setPath(string $path) * @method static string compileString(string $value) * @method static string stripParentheses(string $expression) * @method static...
<?php namespace Illuminate\Support\Facades; /** * @method static void compile($path = null) * @method static string getPath() * @method static void setPath($path) * @method static string compileString($value) * @method static string stripParentheses($expression) * @method static void extend(callable $compiler) ...
Add "s" attr for QSettings
# -*- coding: utf-8 -*- import os import contextlib from PyQt5 import QtCore from . import __app_name__ from . import helperutils def _qsettings_group_factory(settings: QtCore.QSettings): @contextlib.contextmanager def qsettings_group_context(group_name: str): settings.beginGroup(group_name) ...
# -*- coding: utf-8 -*- import os import contextlib from PyQt5 import QtCore from . import __app_name__ from . import helperutils def _qsettings_group_factory(settings: QtCore.QSettings): @contextlib.contextmanager def qsettings_group_context(group_name: str): settings.beginGroup(group_name) ...
Raise exception if unable to find a usable key in property mapping dict
from types import UnicodeType, StringType class PropertyMappingFailedException(Exception): pass def get_transformed_properties(source_properties, prop_map): results = {} for key, value in prop_map.iteritems(): if type(value) in (StringType, UnicodeType): if value in source_properties: ...
from types import UnicodeType, StringType class PropertyMappingFailedException(Exception): pass def get_transformed_properties(source_properties, prop_map): results = {} for key, value in prop_map.iteritems(): if type(value) in (StringType, UnicodeType): if value in source_properties: ...
Format parsed month-year inputs as unambiguous data format for input Avoid pushing user towards ambiguous input formats
'use strict'; angular.module('ddsApp').directive('ddsDateMonthYear', function() { return { require: 'ngModel', link: function(scope, elm, attrs, ctrl) { ctrl.$parsers.push(function(viewValue) { var result = moment(viewValue, ['MM/YY', 'MM/YYYY', 'MMMM YYYY', 'L', 'DD/MM/...
'use strict'; angular.module('ddsApp').directive('ddsDateMonthYear', function() { return { require: 'ngModel', link: function(scope, elm, attrs, ctrl) { ctrl.$parsers.push(function(viewValue) { var result = moment(viewValue, ['MM/YY', 'MM/YYYY', 'MMMM YYYY', 'L', 'DD/MM/...
ADD readback.name in iuv_gap to fix speck save prob
from ophyd import PVPositionerPC, EpicsSignal, EpicsSignalRO from ophyd import Component as Cpt # Undulator class Undulator(PVPositionerPC): readback = Cpt(EpicsSignalRO, '-LEnc}Gap') setpoint = Cpt(EpicsSignal, '-Mtr:2}Inp:Pos') actuate = Cpt(EpicsSignal, '-Mtr:2}Sw:Go') actuate_value = 1 stop_si...
from ophyd import PVPositionerPC, EpicsSignal, EpicsSignalRO from ophyd import Component as Cpt # Undulator class Undulator(PVPositionerPC): readback = Cpt(EpicsSignalRO, '-LEnc}Gap') setpoint = Cpt(EpicsSignal, '-Mtr:2}Inp:Pos') actuate = Cpt(EpicsSignal, '-Mtr:2}Sw:Go') actuate_value = 1 stop_si...
Remove comment for running under uwsgi
#!/usr/bin/env python import os from flask_script import Manager, Server from flask_script.commands import ShowUrls, Clean from mothership import create_app from mothership.models import db # default to dev config because no one should use this in # production anyway env = os.environ.get('MOTHERSHIP_ENV', 'dev') app...
#!/usr/bin/env python import os from flask_script import Manager, Server from flask_script.commands import ShowUrls, Clean from mothership import create_app from mothership.models import db # default to dev config because no one should use this in # production anyway env = os.environ.get('MOTHERSHIP_ENV', 'dev') app...
Fix PHPDocs for proper IDE completion
<?php namespace Behat\Symfony2Extension\Context; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /* * This file is part of the Behat\Symfony2Extension. * (c) Konstantin Kudryashov <ever.zet@gmail.com> * * For the full copyright and license informati...
<?php namespace Behat\Symfony2Extension\Context; use Symfony\Component\HttpKernel\KernelInterface; /* * This file is part of the Behat\Symfony2Extension. * (c) Konstantin Kudryashov <ever.zet@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with ...
Revert "Push to Travis CI" This reverts commit 05547a47fa7b7c0f3ae3d7d5b14b112902b2825a.
package mail import ( "bytes" "text/template" ) const emailTemplate = `{{range .Headers}}{{.}} {{end}}From: {{.From}}{{if .ReplyTo}} Reply-To: {{.ReplyTo}}{{end}} To: {{.To}} Subject: {{.Subject}} MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="our-content-boundary" {{.Body}}` type Message ...
package mail import ( "bytes" "text/template" ) const emailTemplate = `{{range .Headers}}{{.}} {{end}}From: {{.From}}{{if .ReplyTo}} Reply-To: {{.ReplyTo}}{{end}} To: {{.To}} Subject: {{.Subject}} MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="our-content-boundary" {{.Body}}` type Message ...
Add scrollPosition function call on messages template ready
if (Meteor.isClient) { Template.messages.rendered = function () { scrollPosition(); }; Accounts.ui.config({ passwordSignupFields: 'USERNAME_ONLY' }); Template.messages.helpers({ messages: function() { return Messages.find({}, { sort: { time: 1}}); } }); var scrollPositio...
if (Meteor.isClient) { Accounts.ui.config({ passwordSignupFields: 'USERNAME_ONLY' }); Template.messages.helpers({ messages: function() { return Messages.find({}, { sort: { time: 1}}); } }); var scrollPosition = function() { $('.messageBox').scrollTop($('.messageBox')[0].scrol...
SimonStewart: Clean up the driver instance once the large tests for the support classes are done r16955
/* Copyright 2011 Selenium committers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
/* Copyright 2011 Selenium committers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
Add 1.13 to the test matrix
module.exports = { scenarios: [ { name: 'default', dependencies: { } }, { name: 'ember 1.13', dependencies: { 'ember': '1.13.8' }, resolutions: { 'ember': '1.13.8' } }, { name: 'ember-release', dependencies: { 'ember': '...
module.exports = { scenarios: [ { name: 'default', dependencies: { } }, { name: 'ember-release', dependencies: { 'ember': 'components/ember#release' }, resolutions: { 'ember': 'release' } }, { name: 'ember-beta', dependencies: {...
Use more robust check before using noConflict() mode Basically detect the case when L is already the same Leaflet library instance that was loaded by some other extension, in which case there is no need to use noConflict. This does not address the problem of plugins assuming single global L when there are several diff...
// Load css require('leaflet/dist/leaflet.css'); require('leaflet-draw/dist/leaflet.draw.css'); require('leaflet.markercluster/dist/MarkerCluster.css'); require('leaflet.markercluster/dist/MarkerCluster.Default.css'); require('leaflet-measure/dist/leaflet-measure.css'); require('leaflet-fullscreen/dist/leaflet.fullscre...
// Load css require('leaflet/dist/leaflet.css'); require('leaflet-draw/dist/leaflet.draw.css'); require('leaflet.markercluster/dist/MarkerCluster.css'); require('leaflet.markercluster/dist/MarkerCluster.Default.css'); require('leaflet-measure/dist/leaflet-measure.css'); require('leaflet-fullscreen/dist/leaflet.fullscre...
Fix click event handler so it works under firefox
'use strict'; Template.notification.helpers({ notificationColor: function(notificationType) { return Notifications.getNotificationClass(notificationType); } }); Template.notification.events = { 'click': function (event) { if (this.userCloseable || this.expires < new Date()) { /...
'use strict'; Template.notification.helpers({ notificationColor: function(notificationType) { return Notifications.getNotificationClass(notificationType); } }); Template.notification.events = { 'click': function () { if (this.userCloseable || this.expires < new Date()) { // mus...
Fix Example to not show the original error (which is go version dependent)
// The original error message returned by stdlib changed with go1.8. // We only test the latest release. // //+build go1.8 forcego1.8 package jsonptrerror_test import ( "fmt" "strings" "github.com/dolmen-go/jsonptrerror" ) func ExampleDecoder() { decoder := jsonptrerror.NewDecoder(strings.NewReader( `{"key": ...
// The original error message returned by stdlib changed with go1.8. // We only test the latest release. // //+build go1.8 forcego1.8 package jsonptrerror_test import ( "fmt" "strings" "github.com/dolmen-go/jsonptrerror" ) func ExampleDecoder() { decoder := jsonptrerror.NewDecoder(strings.NewReader( `{"key": ...
Use cloudfront link to store drawings
import cuid from 'cuid'; import tinify from 'tinify'; import awsConfig from '@/config/tinify-aws'; import firebase from '@/config/firebase-admin'; tinify.key = process.env.TINYPNG_API_KEY; export default function putImages(req, res) { const drawingId = cuid(); const base64Data = req.body.source.split(','...
import cuid from 'cuid'; import tinify from 'tinify'; import awsConfig from '@/config/tinify-aws'; import firebase from '@/config/firebase-admin'; tinify.key = process.env.TINYPNG_API_KEY; export default function putImages(req, res) { const drawingId = cuid(); const base64Data = req.body.source.split(','...
Add div for image "cut"
<?php namespace FormKit\Widget; use FormKit\Element; /** * * $input = new ImageFileInput('image'); * $input->image->align = 'right'; * $input->image->src = '.....'; * $input->imageWrapper->setAttributeValues(....); * $input->render(); * */ class ImageFileInput extends FileInput { public $type = 'file'; ...
<?php namespace FormKit\Widget; use FormKit\Element; /** * * $input = new ImageFileInput('image'); * $input->image->align = 'right'; * $input->image->src = '.....'; * $input->imageWrapper->setAttributeValues(....); * $input->render(); * */ class ImageFileInput extends FileInput { public $type = 'file'; ...
Move fuel "burn time" string down, to vertically center it more
package mezz.jei.plugins.vanilla.furnace; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.awt.Color; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.item....
package mezz.jei.plugins.vanilla.furnace; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.awt.Color; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.item....
Call widgetManager when data received
/* jshint browser: true, jquery: true */ /* global AgileSprint:false, console:false */ var AgileSprintManager = function(options) { // if(options.server === null || options.server === undefined) { // return null; // } this.widgetManager = (options.widgetManager !== null && options.widgetManager !== undefine...
/* jshint browser: true, jquery: true */ /* global AgileSprint:false, console:false */ var AgileSprintManager = function(options) { // if(options.server === null || options.server === undefined) { // return null; // } this.widgetManager = (options.widgetManager !== null && options.widgetManager !== undefine...
Update export items command for dataset
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from django.db.models import Q from digest.management.commands.create_dataset import create_dataset from digest.models import Item class Command(BaseCommand): help = 'Create dataset' def handle(self, *args, **options): """ ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand from django.db.models import Q from digest.management.commands.create_dataset import create_dataset from digest.models import Item class Command(BaseCommand): help = 'Create dataset' def hand...
Add license tag line. Remove unused imports. VIVO-222
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ package edu.cornell.mannlib.vitro.webapp.filestorage.uploadrequest; import javax.servlet.http.HttpServletRequest; import org.apache.commons.fileupload.servlet.ServletFileUpload; /** * Wrapping ServletRequest that does multipart. I...
package edu.cornell.mannlib.vitro.webapp.filestorage.uploadrequest; import java.io.IOException; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons...
Fix cut 'n' paster error RawDBPreset -> RawEvidenceNamedPreset. Code tidy.
package uk.ac.ebi.quickgo.client.service.loader.presets.evidence; import org.springframework.batch.item.ItemProcessor; import org.springframework.batch.item.validator.ValidationException; import static uk.ac.ebi.quickgo.client.service.loader.presets.PresetsValidationHelper.checkIsNullOrEmpty; /** * Validates the {@...
package uk.ac.ebi.quickgo.client.service.loader.presets.evidence; import org.springframework.batch.item.ItemProcessor; import org.springframework.batch.item.validator.ValidationException; import static uk.ac.ebi.quickgo.client.service.loader.presets.PresetsValidationHelper.checkIsNullOrEmpty; /** * Validates the {@...
Use `charCodeAt` instead of `charAt` `charCodeAt` is faster in general. Ref. #4.
/*! http://mths.be/endswith v0.1.0 by @mathias */ if (!String.prototype.endsWith) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var toString = {}.toString; String.prototype.endsWith = function(search) { var string = String(this); if ( this == null || (sea...
/*! http://mths.be/endswith v0.1.0 by @mathias */ if (!String.prototype.endsWith) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var toString = {}.toString; String.prototype.endsWith = function(search) { var string = String(this); if ( this == null || (sea...
Remove is_autheticated check as by default all the endpoints are authenticated
from rest_framework import throttling class ThrottlingBySession(throttling.SimpleRateThrottle): """ Limits the rating of facility service to only 10 per day per IP. This rate is configurable at the DRF settings.DEFAULT_THROTTLE_RATES. The rate will apply to both the publc user and other authenticated...
from rest_framework import throttling class ThrottlingBySession(throttling.SimpleRateThrottle): """ Limits the rating of facility service to only 10 per day per IP. This rate is configurable at the DRF settings.DEFAULT_THROTTLE_RATES. The rate will apply to both the publc user and other authenticated...
Use dropdown list for test data.
import React, { Component } from 'react'; import { faintBlack, cyan500 } from 'material-ui/styles/colors'; import MenuItem from 'material-ui/MenuItem'; import IconMenu from 'material-ui/IconMenu'; import IconButton from 'material-ui/IconButton/IconButton'; import ActionHelpOutline from 'material-ui/svg-icons/action/hel...
import React, { Component } from 'react'; import Popover from 'material-ui/Popover'; import { faintBlack, cyan500 } from 'material-ui/styles/colors'; import ActionHelpOutline from 'material-ui/svg-icons/action/help-outline'; const TEST_CARD_NUMBER = '01-2167-30-92545'; export default class TestCardNumber extends Comp...
Change installing message in composer dependency
<?php namespace WP_CLI; use \Composer\DependencyResolver\Rule; use \Composer\EventDispatcher\Event; use \Composer\EventDispatcher\EventSubscriberInterface; use \Composer\Script\PackageEvent; use \Composer\Script\ScriptEvents; use \WP_CLI; /** * A Composer Event subscriber so we can keep track of what's happening in...
<?php namespace WP_CLI; use \Composer\DependencyResolver\Rule; use \Composer\EventDispatcher\Event; use \Composer\EventDispatcher\EventSubscriberInterface; use \Composer\Script\PackageEvent; use \Composer\Script\ScriptEvents; use \WP_CLI; /** * A Composer Event subscriber so we can keep track of what's happening in...
Fix gulp install to add new files inside directories (was avoiding overwritin dir)
var path = require('path'), fs = require('fs'), defaults = require('./defaults') ; module.exports = { del: { silent : true }, minify: { processImport : false, keepSpecialComments : 0 }, uglify: { mangle : true }, prefix: { browsers: [ 'last 2 version', ...
var path = require('path'), fs = require('fs'), defaults = require('./defaults') ; module.exports = { del: { silent : true }, minify: { processImport : false, keepSpecialComments : 0 }, uglify: { mangle : true }, prefix: { browsers: [ 'last 2 version', ...