text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Enhance view with button to next setup: vacancies
@extends('app') @section('content') <div class="container"> <div class="row"> <div class="col-md-10 col-md-offset-1"> <div class="panel panel-default"> <div class="panel-heading">{{ trans('manager.services.index.title') }}</div> <div class="panel-body"> ...
@extends('app') @section('content') <div class="container"> <div class="row"> <div class="col-md-10 col-md-offset-1"> <div class="panel panel-default"> <div class="panel-heading">{{ trans('manager.services.index.title') }}</div> <div class="panel-body"> ...
Install npm packages with unsafe permissions
<?php namespace Opifer\CmsBundle\Composer; use Composer\Script\Event; class ScriptHandler { public static function installAssets(Event $event) { $event->getIO()->write('<info>Installing CmsBundle assets</info>'); $currentDirectory = getcwd(); $cmdDirectory = __DIR__.'/..'; ...
<?php namespace Opifer\CmsBundle\Composer; use Composer\Script\Event; class ScriptHandler { public static function installAssets(Event $event) { $event->getIO()->write('<info>Installing CmsBundle assets</info>'); $currentDirectory = getcwd(); $cmdDirectory = __DIR__.'/..'; ...
Load conda tab at startup if url points there
define(function(require) { var $ = require('jquery'); var IPython = require('base/js/namespace'); var models = require('./models'); var views = require('./views'); function load() { if (!IPython.notebook_list) return; var base_url = IPython.notebook_list.base_url; $('head')....
define(function(require) { var $ = require('jquery'); var IPython = require('base/js/namespace'); var models = require('./models'); var views = require('./views'); function load() { if (!IPython.notebook_list) return; var base_url = IPython.notebook_list.base_url; $('head')....
Use trailing if last param starts with a semicolon
let MessageTags = require('./messagetags'); module.exports = class IrcMessage { constructor(command, ...args) { this.tags = Object.create(null); this.prefix = ''; this.nick = ''; this.ident = ''; this.hostname = ''; this.command = command || ''; this.params =...
let MessageTags = require('./messagetags'); module.exports = class IrcMessage { constructor(command, ...args) { this.tags = Object.create(null); this.prefix = ''; this.nick = ''; this.ident = ''; this.hostname = ''; this.command = command || ''; this.params =...
Correct error where && was used instead of and
from argparse import ArgumentParser from matplotlib import pyplot as plt from graph import Greengraph def process(): parser = ArgumentParser( description="Produce graph quantifying the amount of green land between two locations") parser.add_argument("--start", nargs="+", help="...
from argparse import ArgumentParser from matplotlib import pyplot as plt from graph import Greengraph def process(): parser = ArgumentParser( description="Produce graph quantifying the amount of green land between two locations") parser.add_argument("--start", nargs="+", help="...
Improve vector property error message
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six from .base import Property from . import vmath class Vector(Property): """class properties.Vector Vector property, using properties.vmath.Vector ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six from .base import Property from . import vmath class Vector(Property): """class properties.Vector Vector property, using properties.vmath.Vector ...
Use Cython version of toolz Usage of activitysim within popultionsim fails with missing module cytoolz - i believe that activitysim is using cytoolz internally rather than toolz
from ez_setup import use_setuptools use_setuptools() # nopep8 from setuptools import setup, find_packages import os import re with open(os.path.join('activitysim', '__init__.py')) as f: info = re.search(r'__.*', f.read(), re.S) exec(info[0]) setup( name='activitysim', version=__versio...
from ez_setup import use_setuptools use_setuptools() # nopep8 from setuptools import setup, find_packages import os import re with open(os.path.join('activitysim', '__init__.py')) as f: info = re.search(r'__.*', f.read(), re.S) exec(info[0]) setup( name='activitysim', version=__versio...
Check if relation objects are class of SerializeMixin
from collections.abc import Iterable from .inspection import InspectionMixin class SerializeMixin(InspectionMixin): """Mixin to make model serializable.""" __abstract__ = True def to_dict(self,nested = False, hybrid_attributes = False, exclude = None): """Return dict object with model's data. ...
from collections.abc import Iterable from .inspection import InspectionMixin class SerializeMixin(InspectionMixin): """Mixin to make model serializable.""" __abstract__ = True def to_dict(self,nested = False, hybrid_attributes = False, exclude = None): """Return dict object with model's data. ...
Add metadata to event payloads
'use strict'; const { getReason } = require('../../error'); const { MODEL_TYPES } = require('../../constants'); const { defaultFormat } = require('../../formats'); // Builds requestinfo from request mInput const buildRequestinfo = function ({ requestid, timestamp, responsetime, ip, protocol, url, origin...
'use strict'; const { getReason } = require('../../error'); const { MODEL_TYPES } = require('../../constants'); const { defaultFormat } = require('../../formats'); // Builds requestinfo from request mInput const buildRequestinfo = function ({ requestid, timestamp, responsetime, ip, protocol, url, origin...
[BUGFIX] Correct extension manager dependencies to match composer requirements
<?php /* * This file is part of the package bk2k/bootstrap-package. * * For the full copyright and license information, please read the * LICENSE file that was distributed with this source code. */ $EM_CONF[$_EXTKEY] = [ 'title' => 'Bootstrap Package', 'description' => 'Bootstrap Package delivers a full ...
<?php /* * This file is part of the package bk2k/bootstrap-package. * * For the full copyright and license information, please read the * LICENSE file that was distributed with this source code. */ $EM_CONF[$_EXTKEY] = [ 'title' => 'Bootstrap Package', 'description' => 'Bootstrap Package delivers a full ...
Use relative_to instead of string manipulation
#!/usr/bin/env python3 """Remake the ziptestdata.zip file. Run this to rebuild the importlib_resources/tests/data/ziptestdata.zip file, e.g. if you want to add a new file to the zip. This will replace the file with the new build, but it won't commit anything to git. """ import contextlib import os import pathlib fr...
#!/usr/bin/env python3 """Remake the ziptestdata.zip file. Run this to rebuild the importlib_resources/tests/data/ziptestdata.zip file, e.g. if you want to add a new file to the zip. This will replace the file with the new build, but it won't commit anything to git. """ import contextlib import os import pathlib fr...
Fix issue where options['param'] can be None.
import imp from django.conf import settings from django.core.management.base import BaseCommand from django.utils.importlib import import_module from optparse import make_option class Command(BaseCommand): help = 'Generates sample data.' option_list = BaseCommand.option_list + ( make_option('--with'...
import imp from django.conf import settings from django.core.management.base import BaseCommand from django.utils.importlib import import_module from optparse import make_option class Command(BaseCommand): help = 'Generates sample data.' option_list = BaseCommand.option_list + ( make_option('--with'...
Fix scanning page for phone numbers after reload/restart.
(function() { 'use strict'; window.widgets = {}; $(function() { var defaults = { platformUrl: 'https://partner.voipgrid.nl/', c2d: 'true', }; for(var key in defaults) { if(defaults.hasOwnProperty(key)) { if(storage.get(key) === n...
(function() { 'use strict'; window.widgets = {}; $(function() { var defaults = { platformUrl: 'https://partner.voipgrid.nl/', c2d: 'true', }; for(var key in defaults) { if(defaults.hasOwnProperty(key)) { if(storage.get(key) === n...
Adjust LPA cost from 110 GBP to 82 GBP
<?php namespace Opg\Lpa\DataModel\Lpa\Payment; use Opg\Lpa\DataModel\Lpa\Lpa; class Calculator { const STANDARD_FEE = 82; /** * Calculate LPA payment amount * * @param Lpa $lpa * @return NULL|Payment */ public static function calculate(Lpa $lpa) { if (!$lpa->payment i...
<?php namespace Opg\Lpa\DataModel\Lpa\Payment; use Opg\Lpa\DataModel\Lpa\Lpa; class Calculator { const STANDARD_FEE = 110; /** * Calculate LPA payment amount * * @param Lpa $lpa * @return NULL|Payment */ static public function calculate(Lpa $lpa) { if(!($lpa->payment ...
Add include property to babel loader
'use strict'; const NODE_ENV = process.env.NODE_ENV || 'development'; const webpack = require('webpack'); const path = require('path'); const PATHS = { app: path.join(__dirname, 'app'), build: path.join(__dirname, 'build') }; module.exports = { entry: { app: PATHS.app }, output: { ...
'use strict'; const NODE_ENV = process.env.NODE_ENV || 'development'; const webpack = require('webpack'); const path = require('path'); const PATHS = { app: path.join(__dirname, 'app'), build: path.join(__dirname, 'build') }; module.exports = { entry: { app: PATHS.app }, output: { ...
Bump version for next release
from distutils.core import setup setup(name='pyresttest', version='1.6.1.dev', description='Python RESTful API Testing & Microbenchmarking Tool', long_description='Python RESTful API Testing & Microbenchmarking Tool \n Documentation at https://github.com/svanoort/pyresttest', maintainer='Sam Va...
from distutils.core import setup setup(name='pyresttest', version='1.6.0', description='Python RESTful API Testing & Microbenchmarking Tool', long_description='Python RESTful API Testing & Microbenchmarking Tool \n Documentation at https://github.com/svanoort/pyresttest', maintainer='Sam Van Oo...
Fix rotation doubles text for free response bug
package org.adaptlab.chpir.android.survey.QuestionFragments; import org.adaptlab.chpir.android.survey.QuestionFragment; import org.adaptlab.chpir.android.survey.R; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; import android.util.Log; import android.view.ViewGroup; impo...
package org.adaptlab.chpir.android.survey.QuestionFragments; import org.adaptlab.chpir.android.survey.QuestionFragment; import org.adaptlab.chpir.android.survey.R; import android.text.Editable; import android.text.TextWatcher; import android.view.ViewGroup; import android.widget.EditText; public class FreeResponseQu...
Fix !events always returning no events
'use strict'; const Promise = require('bluebird'); const i18next = Promise.promisifyAll(require('i18next')); const MentionableCommandMiddleware = require('../../middleware/MentionableCommandMiddleware'); const RestrictChannelsMiddleware = require('../../middleware/RestrictChannelsMiddleware'); const CommandDatabaseSc...
'use strict'; const Promise = require('bluebird'); const i18next = Promise.promisifyAll(require('i18next')); const MentionableCommandMiddleware = require('../../middleware/MentionableCommandMiddleware'); const RestrictChannelsMiddleware = require('../../middleware/RestrictChannelsMiddleware'); const CommandDatabaseSc...
Update the function which return the unique colors
<?php class Database_operations { private $database; private $bird_db; // Class constructor function __construct($bird) { try { $this->bird_db = $bird; $this->database = new PDO( 'mysql:host=localho...
<?php class Database_operations { private $database; private $bird_db; // Class constructor function __construct($bird) { try { $this->bird_db = $bird; $this->database = new PDO( 'mysql:host=localho...
Add WordPress thema as package type
<?php namespace BeanstalkSatisGen\File; class Composer extends Json { /** * Returns whether or not this composer file is a satis package based on the * contents. * * @return boolean */ public function isComposerPackage() { return ! empty($this->content) && ...
<?php namespace BeanstalkSatisGen\File; class Composer extends Json { /** * Returns whether or not this composer file is a satis package based on the * contents. * * @return boolean */ public function isComposerPackage() { return ! empty($this->content) && ...
Make check function a static function so it works better with Composer scripts
<?php namespace Kielabokkie\DotenvCheck; use League\CLImate\CLImate; class DotenvCheck { public static function check() { $cli = new CLImate; $file = fopen(".env", "r"); $env = []; while (feof($file) === false) { $line = fgets($file); $lineAry = expl...
<?php namespace Kielabokkie\DotenvCheck; use League\CLImate\CLImate; class DotenvCheck { private $cli; public function __construct() { $this->cli = new CLImate; } public function check() { $file = fopen(".env", "r"); $env = []; while (feof($file) === false) { ...
Add AAT.stringifyResults to console.log the failures
'use strict'; describe("Accessibility Test", function () { var originalTimeout; var testcasesHTML = window.__html__; for (var testFile in testcasesHTML) { (function (testFile) { describe("\"" + testFile + "\"", function () { beforeEach(function () { ...
'use strict'; describe("Accessibility Test", function () { var originalTimeout; var testcasesHTML = window.__html__; for (var testFile in testcasesHTML) { (function (testFile) { describe("\"" + testFile + "\"", function () { beforeEach(function () { ...
Add trace option for Sass.
// Compile SCSS files to CSS module.exports = function(grunt) { grunt.config('sass', { dev: { options: { sourcemap: true, trace: false, style: 'nested', precision: 5 }, files: [{ expand: true...
// Compile SCSS files to CSS module.exports = function(grunt) { grunt.config('sass', { dev: { options: { sourcemap: true, style: 'nested', precision: 5 }, files: [{ expand: true, cwd: 'scss',...
Add type filter by slug
from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter from falmer.events.models import Curator from . import models class EventFilterSet(FilterSet): class Meta: model = models.Event fields = ( 'title', 'venue', 't...
from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter from falmer.events.models import Curator from . import models class EventFilterSet(FilterSet): class Meta: model = models.Event fields = ( 'title', 'venue', 't...
Fix wrong privacy for attributes
<?php namespace HiPay\Fullservice\Gateway\Model; use HiPay\Fullservice\Gateway\Model\AbstractTransaction; /** * * @package HiPay\Fullservice * @author Kassim Belghait <kassim@sirateck.com> * @copyright Copyright (c) 2016 - HiPay * @license http://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 License * @link h...
<?php namespace HiPay\Fullservice\Gateway\Model; use HiPay\Fullservice\Gateway\Model\AbstractTransaction; /** * * @package HiPay\Fullservice * @author Kassim Belghait <kassim@sirateck.com> * @copyright Copyright (c) 2016 - HiPay * @license http://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 License * @link h...
Fix pylint presubmit check, related to buildbot 0.8.x vs 0.7.x TBR=nsylvain@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/7631036 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@97254 0039d316-1c4b-4281-b951-d872f2087c98
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from buildbot.scheduler import Scheduler # This is due to buildbot 0.7.12 being used for the presubmit check. from buildbot.changes.filter import ChangeF...
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from buildbot.scheduler import Scheduler from buildbot.changes.filter import ChangeFilter from master.factory import syzygy_factory def win(): retur...
Make url column data clickable
@extends('layouts.master') @section('content') @if ($message !== null) <div class="alert alert-success alert-dismissible" role="alert">{{ $message }}</div> @endif <div class="container-fluid"> <div class="row"> <table class="table table-striped table-bordered table-condensed"> <thead> ...
@extends('layouts.master') @section('content') @if ($message !== null) <div class="alert alert-success alert-dismissible" role="alert">{{ $message }}</div> @endif <div class="container-fluid"> <div class="row"> <table class="table table-striped table-bordered table-condensed"> <thead> ...
Add third graph for Totals plugin
# Copyright 2013 John Reese # Licensed under the MIT license from ..lib import is_bot from ..ent import Message from ..graphs import NetworkKeyComparison, NetworkUserComparison from .base import Plugin class Totals(Plugin): """Gathers total message type statistics, broken down by channel, day and user.""" ...
# Copyright 2013 John Reese # Licensed under the MIT license from ..lib import is_bot from ..ent import Message from ..graphs import NetworkKeyComparison, NetworkUserComparison from .base import Plugin class Totals(Plugin): """Gathers total message type statistics, broken down by channel, day and user.""" ...
Add __repr__ for elements for easier debugging
try: from StringIO import StringIO except ImportError: from io import StringIO from inspect import isgenerator class Element(object): tag = '' self_closing = False def __init__(self, *children, **attrs): if children and isinstance(children[0], dict): self.attrs = children[0] ...
try: from StringIO import StringIO except ImportError: from io import StringIO from inspect import isgenerator class Element(object): tag = '' self_closing = False def __init__(self, *children, **attrs): if children and isinstance(children[0], dict): self.attrs = children[0] ...
Add a nested class for nested menus
"use strict"; angular.module('arethusa.relation').directive('nestedMenu', [ '$compile', 'relation', function($compile, relation) { return { restrict: 'A', scope: { relObj: '=', labelObj: '=', label: '=', property: '=', ancestors: '=' }, link: fu...
"use strict"; angular.module('arethusa.relation').directive('nestedMenu', [ '$compile', 'relation', function($compile, relation) { return { restrict: 'A', scope: { relObj: '=', labelObj: '=', label: '=', property: '=', ancestors: '=' }, link: fu...
Fix for user PS analysis.
'use strict'; var User = require('../models/user'); var Person = require('../models/person'); var OperationalNumber = require('../models/psquare/op-number'); var _ = require('underscore'); var express = require('express'); var pSquare = require('../psquare_module/main'); function getUser(analystId) { return User...
'use strict'; var User = require('../models/user'); var Person = require('../models/person'); var OperationalNumber = require('../models/psquare/op-number'); var express = require('express'); var pSquare = require('../psquare_module/main'); function getUser(analystId) { return User .find({analystId: anal...
Fix test for output skeleton plot
import os import pytest import tempfile import pandas from skan import pipe @pytest.fixture def image_filename(): rundir = os.path.abspath(os.path.dirname(__file__)) datadir = os.path.join(rundir, 'data') return os.path.join(datadir, 'retic.tif') def test_pipe(image_filename): data = pipe.process_im...
import os import pytest import tempfile import pandas from skan import pipe @pytest.fixture def image_filename(): rundir = os.path.abspath(os.path.dirname(__file__)) datadir = os.path.join(rundir, 'data') return os.path.join(datadir, 'retic.tif') def test_pipe(image_filename): data = pipe.process_im...
Remove stray Git conflict markers
'use strict'; module.exports = { name: 'singleLinePerSelector', nodeTypes: ['ruleset'], message: 'Each selector should be on its own line.', lint: function singleLinePerSelectorLinter (config, node) { var report = false; var results = []; var self = this; node.forEach(...
'use strict'; module.exports = { name: 'singleLinePerSelector', nodeTypes: ['ruleset'], message: 'Each selector should be on its own line.', lint: function singleLinePerSelectorLinter (config, node) { var report = false; var results = []; var self = this; node.forEach(...
[UPADTE] Change router to history mode
import Vue from 'vue' import Router from 'vue-router' import Home from '@/components/Home' import Team from '@/components/Team' import Events from '@/components/Events' import Timeline from '@/components/Timeline' import Blog from '@/components/Blog' import Post from '@/components/Post' import Linit from '@/components/...
import Vue from 'vue' import Router from 'vue-router' import Home from '@/components/Home' import Team from '@/components/Team' import Events from '@/components/Events' import Timeline from '@/components/Timeline' import Blog from '@/components/Blog' import Post from '@/components/Post' import Linit from '@/components/...
Add id field to quotes table Specify names for insert fields
import sqlite3 import shelve def connect_db(name): """ Open a connection to the database used to store quotes. :param name: (str) Name of database file :return: (shelve.DbfilenameShelf) """ try: return shelve.open(name) except Exception: raise Exception('Unable to connect...
import sqlite3 import shelve def connect_db(name): """ Open a connection to the database used to store quotes. :param name: (str) Name of database file :return: (shelve.DbfilenameShelf) """ try: return shelve.open(name) except Exception: raise Exception('Unable to connect...
Update image every 0.5s till button gets pressed again
#! /usr/bin/python3 import sys import time from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QLabel, QApplication, QPushButton) from PyQt5.QtGui import QPixmap from PyQt5.QtCore import QObject class FreakingQtImageViewer(QWidget): def __init__(self, function): super().__init__() self...
#! /usr/bin/python3 import sys from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QLabel, QApplication, QPushButton) from PyQt5.QtGui import QPixmap from PyQt5.QtCore import QObject class FreakingQtImageViewer(QWidget): def __init__(self, function): super().__init__() self.function = ...
Update docs for prometheus path config
package io.quarkus.micrometer.runtime.config; import java.util.Optional; import io.quarkus.runtime.annotations.ConfigGroup; import io.quarkus.runtime.annotations.ConfigItem; @ConfigGroup public class PrometheusConfigGroup implements MicrometerConfig.CapabilityEnabled { /** * Support for export to Prometheus...
package io.quarkus.micrometer.runtime.config; import java.util.Optional; import io.quarkus.runtime.annotations.ConfigGroup; import io.quarkus.runtime.annotations.ConfigItem; @ConfigGroup public class PrometheusConfigGroup implements MicrometerConfig.CapabilityEnabled { /** * Support for export to Prometheus...
Make a real json response.
from flask import Flask, abort, jsonify from flask_caching import Cache from flask_cors import CORS import main app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) @app.route('/') def display_available(): content = ('<html>' + ...
import json from flask import abort from flask import Flask from flask_caching import Cache from flask_cors import CORS import main app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) @app.route('/') def display_available(): conten...
Update accept header according to Github API documentation
const Request = require('request'); const env2 = require('env2'); const HapiCookie = require('hapi-auth-cookie'); env2('./config.env'); module.exports = { path: '/welcome', method: 'GET', handler: (req, rep) => { const accessUrl = `https://github.com/login/oauth/access_token`; Request.post({ heade...
const Request = require('request'); const env2 = require('env2'); const HapiCookie = require('hapi-auth-cookie'); env2('./config.env'); module.exports = { path: '/welcome', method: 'GET', handler: (req, rep) => { const accessUrl = `https://github.com/login/oauth/access_token`; Request.post({ heade...
Add in overwrite output file
from os import chmod, unlink, stat, makedirs from os.path import isfile, split, exists from shutil import copyfile def move_verify_delete(in_file, out_file, overwrite=False): ''' Moves in_file to out_file, verifies that the filesizes are the same and then does a chmod 666 ''' if not exists(split(ou...
from os import chmod, unlink, stat, makedirs from os.path import isfile, split, exists from shutil import copyfile def move_verify_delete(in_file, out_file): ''' Moves in_file to out_file, verifies that the filesizes are the same and then does a chmod 666 ''' if not exists(split(out_file)[0]): ...
Exclude some wide categories for faster generation
<?php get_header(); if (have_posts()) { while (have_posts()) { the_post(); ?> <div class="blogPost"> <?php the_content(); ?> <?php if (is_page("tags")) { ?> <ul class="tagList"> <?php wp_list_categories( array( "hierarchical" => 1, ...
<?php get_header(); if (have_posts()) { while (have_posts()) { the_post(); ?> <div class="blogPost"> <?php the_content(); ?> <?php if (is_page("tags")) { ?> <ul class="tagList"> <?php wp_list_categories( array( "hierarchical" => 1, ...
Add watch to grunt defaults
/*jslint node:true */ /*globals module:false */ "use strict"; module.exports = function (grunt) { var files = { allSource: ['Gruntfile.js', 'package.json', 'lib/**/*.js', 'test/**/*.js'], tests: ['test/**/*.js'] }; grunt.initConfig({ pkg: grunt.file.readJSON('package...
/*jslint node:true */ /*globals module:false */ "use strict"; module.exports = function (grunt) { var files = { allSource: ['Gruntfile.js', 'package.json', 'lib/**/*.js', 'test/**/*.js'], tests: ['test/**/*.js'] }; grunt.initConfig({ pkg: grunt.file.readJSON('package...
Change to courses page in stead of lecture 1 when logging in
(function() { 'use strict'; angular .module('lecturer') .controller('LoginCtrl', LoginController); /* @ngInject */ function LoginController(lecturerFactory, $location) { console.log('Ready (Login Controller)'); angular.element('#login-btn').addClass('active'); ...
(function() { 'use strict'; angular .module('lecturer') .controller('LoginCtrl', LoginController); /* @ngInject */ function LoginController(lecturerFactory, $location) { console.log('Ready (Login Controller)'); angular.element('#login-btn').addClass('active'); ...
Make the timing tasks parallel aware.
package com.lhkbob.entreri.task; import java.util.Collections; import java.util.Set; import com.lhkbob.entreri.ComponentData; import com.lhkbob.entreri.EntitySystem; public final class Timers { public static Task fixedDelta(double dt) { return new FixedDeltaTask(dt); } public static Task measur...
package com.lhkbob.entreri.task; import com.lhkbob.entreri.EntitySystem; public final class Timers { public static Task fixedDelta(double dt) { return new FixedDeltaTask(dt); } public static Task measuredDelta() { return new MeasuredDeltaTask(); } private static class FixedDelta...
Fix high scores displaying for more than one board
package com.gunshippenguin.openflood; import android.content.SharedPreferences; public class HighScoreManager { SharedPreferences sp; public HighScoreManager(SharedPreferences sp) { this.sp = sp; } public boolean isHighScore(int boardSize, int numColors, int steps) { if (!highScoreEx...
package com.gunshippenguin.openflood; import android.content.SharedPreferences; public class HighScoreManager { SharedPreferences sp; public HighScoreManager(SharedPreferences sp) { this.sp = sp; } public boolean isHighScore(int boardSize, int numColors, int steps) { if (!highScoreEx...
Add error response to properties resource
package etomica.server.resources; import etomica.meta.SimulationModel; import etomica.meta.properties.Property; import etomica.meta.wrappers.Wrapper; import etomica.server.dao.SimulationStore; import etomica.server.representations.PropertyUpdate; import io.dropwizard.jersey.PATCH; import org.apache.commons.beanutils.B...
package etomica.server.resources; import etomica.meta.SimulationModel; import etomica.meta.properties.Property; import etomica.meta.wrappers.Wrapper; import etomica.server.dao.SimulationStore; import etomica.server.representations.PropertyUpdate; import io.dropwizard.jersey.PATCH; import org.apache.commons.beanutils.B...
Add tools to package data
#!/usr/bin/env python from distutils.core import setup import fedex LONG_DESCRIPTION = open('README.rst').read() CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Op...
#!/usr/bin/env python from distutils.core import setup import fedex LONG_DESCRIPTION = open('README.rst').read() CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Op...
Add forgotten piece of eventlet executor
# Copyright 2013 Red Hat, Inc. # Copyright 2013 New Dream Network, LLC (DreamHost) # # 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-...
# Copyright 2013 Red Hat, Inc. # Copyright 2013 New Dream Network, LLC (DreamHost) # # 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-...
Add all optional dependencies to version info dict
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides tools to return the installed astropy and photutils versions. """ from datetime import datetime, timezone import sys def _get_version_info(): """ Return a dictionary of the installed version numbers for photutils and ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides tools to return the installed astropy and photutils versions. """ from datetime import datetime, timezone def _get_version_info(): """ Return a dictionary of the installed version numbers for photutils and its depende...
Replace q with native Promises
/** * Chai-Mugshot Plugin * * @param mugshot - Mugshot instance * @param testRunnerCtx - Context of the test runner where the assertions are * done */ module.exports = function(mugshot, testRunnerCtx) { return function(chai) { var Assertion = chai.Assertion; function composeMessage(message) { ...
var Q = require('q'); /** * Chai-Mugshot Plugin * * @param mugshot - Mugshot instance * @param testRunnerCtx - Context of the test runner where the assertions are * done */ module.exports = function(mugshot, testRunnerCtx) { return function(chai) { var Assertion = chai.Assertion; function composeMe...
Remove measurement on-end event listener that was preventing the measurement result from being displayed
import Measurement from 'esri/dijit/Measurement'; import React, { Component, PropTypes } from 'react'; export default class InfoWindow extends Component { static contextTypes = { map: PropTypes.object.isRequired } initialized = false componentWillUpdate(prevProps) { if ( this.context.map.lo...
import Measurement from 'esri/dijit/Measurement'; import React, { Component, PropTypes } from 'react'; export default class InfoWindow extends Component { static contextTypes = { map: PropTypes.object.isRequired } initialized = false componentWillUpdate(prevProps) { if ( this.context.map.lo...
Remove hard coded experiment description. Remove done field and add status field since that is what we get from the backend.
export class ExperimentStep { constructor(title, _type) { this.id = ''; this.title = title; this._type = _type; this.steps = []; this.description = ''; this.flags = { important: false, review: false, error: false, done: ...
export class ExperimentStep { constructor(title, _type) { this.id = ''; this.title = title; this._type = _type; this.steps = []; this.description = ''; this.flags = { important: false, review: false, error: false, done: ...
[FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client
<?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\DomCrawler\Test\Constraint; use PHPUnit\Framework\Con...
<?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\DomCrawler\Test\Constraint; use PHPUnit\Framework\Con...
[TASK] Raise allowed TYPO3 version to 9.5.99
<?php /* * This file is part of the package bk2k/bootstrap-package. * * For the full copyright and license information, please read the * LICENSE file that was distributed with this source code. */ $EM_CONF[$_EXTKEY] = [ 'title' => 'Bootstrap Package', 'description' => 'Bootstrap Package delivers a full ...
<?php /* * This file is part of the package bk2k/bootstrap-package. * * For the full copyright and license information, please read the * LICENSE file that was distributed with this source code. */ $EM_CONF[$_EXTKEY] = [ 'title' => 'Bootstrap Package', 'description' => 'Bootstrap Package delivers a full ...
Swap ndcms for generic T3 string.
from lobster import cmssw from lobster.core import * storage = StorageConfiguration( output=[ "hdfs:///store/user/matze/test_shuffle_take29", "file:///hadoop/store/user/matze/test_shuffle_take29", "root://T3_US_NotreDame/store/user/matze/test_shuffle_take29", "sr...
from lobster import cmssw from lobster.core import * storage = StorageConfiguration( output=[ "hdfs:///store/user/matze/test_shuffle_take29", "file:///hadoop/store/user/matze/test_shuffle_take29", "root://ndcms.crc.nd.edu//store/user/matze/test_shuffle_take29", "...
Update coverage values to match existing
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
Use the python MBox class rather than parsing the mailbox manually
#!/usr/bin/env python """ Simple Python module to parse a Thunderbird mail file and scan each email message with ClamAV in order to detect suspect messages. """ import pyclamav import os import email import argparse import sys import tempfile import mailbox def print_message(parsed, signature=None): ...
#!/usr/bin/env python """ Simple Python module to parse a Thunderbird mail file and scan each email message with ClamAV in order to detect suspect messages. """ import pyclamav import os import re import email import argparse import sys import tempfile mail_split_re = re.compile(r'\s(?=From -)') def pr...
Fix for test in IE. Conditions were passing, but due to IE's JS implementation of named functions, it didn't recognise the equality test as equal. Further info in test.
/*jslint*/ (function(){ var testElement = '<div id="testElement">'+ '<a class="link"><a class="sub-link"></a></a>'+ '</div>'; function teardown() { $('#testElement').remove(); } function setup() { $('body').append(testElement); } ...
/*jslint*/ (function(){ var testElement = '<div id="testElement">'+ '<a class="link"><a class="sub-link"></a></a>'+ '</div>'; function teardown() { $('#testElement').remove(); } function setup() { $('body').append(testElement); } ...
Fix value is "" hand value being None in prepare
from __future__ import absolute_import from enum import Enum from typing import TypeVar, Optional, Any, Type # noqa from odin.exceptions import ValidationError from . import Field __all__ = ("EnumField",) ET = TypeVar("ET", Enum, Enum) class EnumField(Field): """ Field for handling Python enums. """...
from __future__ import absolute_import from enum import Enum from typing import TypeVar, Optional, Any, Type # noqa from odin.exceptions import ValidationError from . import Field __all__ = ("EnumField",) ET = TypeVar("ET", Enum, Enum) class EnumField(Field): """ Field for handling Python enums. """...
Drop old django version support (1.10)
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'django_summernote.db', } } MIDDLEWARE = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib...
import django DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'django_summernote.db', } } __MIDDLEWARE__ = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', ...
Sort Metrics displayed in ASCII Table
<?php declare(strict_types=1); namespace Wnx\LaravelStats\ShareableMetrics; use Illuminate\Support\Collection; class MetricsCollection extends Collection { public function toAsciiTableFormat(): array { $projectMetrics = $this->items['project_metrics'] ->map(function ($metric) { ...
<?php declare(strict_types=1); namespace Wnx\LaravelStats\ShareableMetrics; use Illuminate\Support\Collection; class MetricsCollection extends Collection { public function toAsciiTableFormat(): array { $projectMetrics = $this->items['project_metrics'] ->map(function ($metric) { ...
Initialize the color picker on startup but hide it, so the editor get the correct color.
var session = null; // instead of windows.onload $(document).ready( function() { // hide iphone/ipad URL bar setTimeout(function() { window.scrollTo(0, 1) }, 100); // initialize zoness session = new Session( SESSION_TYPE_DRAW, function() { //console.log("page_draw/ready: se...
var session = null, picker; // instead of windows.onload $(document).ready( function() { // hide iphone/ipad URL bar setTimeout(function() { window.scrollTo(0, 1) }, 100); // initialize zoness session = new Session( SESSION_TYPE_DRAW, function() { //console.log("page_draw/r...
Remove width and height when the overlay is invisible
import React from 'react'; import { Animated, StyleSheet, View, Dimensions, TouchableHighlight } from 'react-native'; const DEFAULT_ANIMATE_TIME = 300; const styles = StyleSheet.create({ fullOverlay: { top: 0, bottom: 0, left: 0, right: 0, backgroundColor: 'transpa...
import React from 'react'; import { Animated, StyleSheet, View, Dimensions, TouchableHighlight } from 'react-native'; const DEFAULT_ANIMATE_TIME = 300; const styles = StyleSheet.create({ fullOverlay: { top: 0, bottom: 0, left: 0, right: 0, backgroundColor: 'transpa...
Allow symbolic values for vpc
import hc2002.plugin as plugin import hc2002.config as config plugin.register_for_resource(__name__, 'hc2002.resource.instance') _prefixes = ('availability-zone:', 'image:', 'kernel:', 'key:', 'load-balancers:', 'ramdisk:', 'security-groups:', 'spot-price:', 'subnet:', 'vpc:') def apply(instance): ...
import hc2002.plugin as plugin import hc2002.config as config plugin.register_for_resource(__name__, 'hc2002.resource.instance') _prefixes = ('availability-zone:', 'image:', 'kernel:', 'key:', 'load-balancers:', 'ramdisk:', 'security-groups:', 'spot-price:', 'subnet:') def apply(instance): def re...
Add clarifying(?) comment about uid caching
import tornado from tornado import gen import json import os BASE_PATH = '.' base_url = '/paws/public/' @gen.coroutine def uid_for_user(user): url = 'https://meta.wikimedia.org/w/api.php?' + \ 'action=query&meta=globaluserinfo' + \ '&format=json&formatversion=2' + \ '&guiuser={}'....
import tornado from tornado import gen import json import os BASE_PATH = '.' base_url = '/paws/public/' @gen.coroutine def uid_for_user(user): url = 'https://meta.wikimedia.org/w/api.php?' + \ 'action=query&meta=globaluserinfo' + \ '&format=json&formatversion=2' + \ '&guiuser={}'....
Add region parameter to geocoding by query function
(function () { angular .module("ng-geocoder") .factory("ngGeocoderService", ngGeocoderService); ngGeocoderService.$inject = ["$q"]; function ngGeocoderService ($q) { var geocoder = new google.maps.Geocoder(); var service = { "geocodeById": geocodeById, "geocodeByQuery": geocodeByQue...
(function () { angular .module("ng-geocoder") .factory("ngGeocoderService", ngGeocoderService); ngGeocoderService.$inject = ["$q"]; function ngGeocoderService ($q) { var geocoder = new google.maps.Geocoder(); var service = { "geocodeById": geocodeById, "geocodeByQuery": geocodeByQue...
Fix getting request body for non-form data; now uses function that doesn't require a php.ini setting
<?php namespace Raygun4php { class RaygunRequestMessage { public $hostName; public $url; public $httpMethod; public $ipAddress; // public $queryString; public $headers; public $data; public $form; public $rawData; public fu...
<?php namespace Raygun4php { class RaygunRequestMessage { public $hostName; public $url; public $httpMethod; public $ipAddress; // public $queryString; public $headers; public $data; public $form; public $rawData; public fu...
Use the pillow master branch directly.
# -*- coding: utf-8 -*- # # setup.py # colorific # """ Package information for colorific. """ import sys # check for the supported Python version version = tuple(sys.version_info[:2]) if version != (2, 7): sys.stderr.write('colorific requires Python 2.7 (you have %d.%d)\n' % version) sys.stderr...
# -*- coding: utf-8 -*- # # setup.py # colorific # """ Package information for colorific. """ import sys # check for the supported Python version version = tuple(sys.version_info[:2]) if version != (2, 7): sys.stderr.write('colorific requires Python 2.7 (you have %d.%d)\n' %\ version) sys.stder...
Update to use inheritance for GameObject
from flask import request from flask.views import MethodView from flask_helpers.build_response import build_response from flask_helpers.ErrorHandler import ErrorHandler from Game.GameObject import GameObject class GameModes(MethodView): def get(self): textonly = request.args.get('textmode', None) ...
from flask import request from flask.views import MethodView from flask_helpers.build_response import build_response from flask_helpers.ErrorHandler import ErrorHandler from python_cowbull_game.GameObject import GameObject class GameModes(MethodView): def get(self): textonly = request.args.get('textmode',...
Add a test for a numeric reference
<?php namespace adrianclay\git; use adrianclay\git\References\ReferencesArray; use PHPUnit\Framework\TestCase; class RevisionResolverTest extends TestCase { private $sha = "abcdefabcdefabcdefabcdefabcdefabcdefabcd"; public function testFullSHA() { $this->assertEqualSHA( $this->getResolver( [], $...
<?php namespace adrianclay\git; use adrianclay\git\References\ReferencesArray; use PHPUnit\Framework\TestCase; class RevisionResolverTest extends TestCase { private $sha = "abcdefabcdefabcdefabcdefabcdefabcdefabcd"; public function testFullSHA() { $this->assertEqualSHA( $this->getResolver( [], $...
Move to the correct catch
import DataLoader from 'dataloader'; import cache from '../cache'; import timer from '../timer'; import { throttled } from '../throttle'; import { error, verbose } from '../loggers'; export default api => { return new DataLoader(keys => Promise.all(keys.map(key => { const clock = timer(key); clock.start(); ...
import DataLoader from 'dataloader'; import cache from '../cache'; import timer from '../timer'; import { throttled } from '../throttle'; import { error, verbose } from '../loggers'; export default api => { return new DataLoader(keys => Promise.all(keys.map(key => { const clock = timer(key); clock.start(); ...
Fix issue in flat list
/* @flow */ import React from 'react' import {TouchableOpacity, View, FlatList} from 'react-native' export default class NodeView extends React.PureComponent { componentWillMount = () => { let rootChildren = this.props.getChildren(this.props.node) if (rootChildren) { rootChildren = rootChildren.m...
/* @flow */ import React from 'react' import {TouchableOpacity, View, FlatList} from 'react-native' export default class NodeView extends React.PureComponent { componentWillMount = () => { let rootChildren = this.props.getChildren(this.props.node) if (rootChildren) { rootChildren = rootChildren.m...
Add method to retrieve the next tick mark
package io.sigpipe.sing.dataset; import java.util.Iterator; import java.util.NavigableSet; import java.util.TreeSet; import io.sigpipe.sing.dataset.feature.Feature; public class Quantizer { private NavigableSet<Feature> ticks = new TreeSet<>(); public Quantizer(Object start, Object end, Object step) { ...
package io.sigpipe.sing.dataset; import java.util.Iterator; import java.util.NavigableSet; import java.util.TreeSet; import io.sigpipe.sing.dataset.feature.Feature; public class Quantizer { private NavigableSet<Feature> ticks = new TreeSet<>(); public Quantizer(Object start, Object end, Object step) { ...
Add primitive server option for easier debugging
import optparse, os, pickle config = {'charity':False, 'propagate_factor':2, 'accept_latency':2000} def setup(): parser = optparse.OptionParser() parser.add_option('-c', '--charity', dest='charity', default=None, a...
import optparse, os, pickle config = {'charity':False, 'propagate_factor':2, 'accept_latency':2000} def setup(): parser = optparse.OptionParser() parser.add_option('-c', '--charity', dest='charity', default=None, a...
Put back changes in observer after unsuccessful commit.
const expect = require('chai').expect; import { TopicObserver } from "../topic-observer"; describe('topic observer', () => { const observer = new TopicObserver(); const fn1 = () => {}; it('should observe all', function() { observer.observe(fn1); expect(observer.observers['__all__'].leng...
const expect = require('chai').expect; import { TopicObserver } from "../topic-observer"; describe('topic observer', () => { const observer = new TopicObserver(); const fn1 = () => {}; it('should observe all', function() { observer.observe(fn1); expect(observer.observers['__all__'].leng...
Change the inherited classes of hoomd.filter.CustomFilter CustomFilter inherits now from Hashable and Callable
"""Contains a class for custom particle filters in Python.""" from abc import ABC, abstractmethod from collections.abc import Hashable, Callable class CustomFilter(Hashable, Callable): """Abstract base class for custom particle filters. The class allows the definition of particle filters in Python (see `h...
"""Contains a class for custom particle filters in Python.""" from abc import ABCMeta, abstractmethod class CustomFilter(metaclass=ABCMeta): """Abstract base class for custom particle filters. The class allows the definition of particle filters in Python (see `hoomd.filter.ParticleFilter`. """ @ab...
Change some name variables improving readability The calling `diff.toString()` was made only for `blessed` compatibility. It seems that it doesn't deal too much with real integers.
var util = require('util'); var hits = require('./hits'); var moment = require('moment'); var duration = require('moment-duration-format'); var _ = require('lodash'); var leave = { collectHits: function (hits, matchDay) { var filteredHits = []; hits.forEach(function (hit){ var isSame = moment(hit.i...
var util = require('util'); var hits = require('./hits'); var moment = require('moment'); var duration = require('moment-duration-format'); var _ = require('lodash'); var leave = { collectHits: function (hits, matchDay) { var filteredHits = []; hits.forEach(function (hit){ var isSame = moment(hit.i...
Add path to theme attributes
<?php namespace Pingpong\Themes; use Illuminate\Filesystem\Filesystem; use Pingpong\Modules\Json; use Symfony\Component\Finder\Finder as SymfonyFinder; class Finder { /** * The symfony finder instance. * * @var SymfonyFinder */ protected $finder; /** * The constructor. * ...
<?php namespace Pingpong\Themes; use Illuminate\Filesystem\Filesystem; use Pingpong\Modules\Json; use Symfony\Component\Finder\Finder as SymfonyFinder; class Finder { /** * The symfony finder instance. * * @var SymfonyFinder */ protected $finder; /** * The constructor. * ...
Change full coverage report to short text summary
module.exports = function karma(config) { config.set({ browsers: ['PhantomJS'], frameworks: ['mocha', 'chai', 'sinon'], files: ['tests.webpack.js'], plugins: [ 'karma-phantomjs-launcher', 'karma-mocha', 'karma-chai', 'karma-sinon', 'karma-sourcemap-loader', 'karma-w...
module.exports = function karma(config) { config.set({ browsers: ['PhantomJS'], frameworks: ['mocha', 'chai', 'sinon'], files: ['tests.webpack.js'], plugins: [ 'karma-phantomjs-launcher', 'karma-mocha', 'karma-chai', 'karma-sinon', 'karma-sourcemap-loader', 'karma-w...
Fix chess logic in analysis
import { askWorker } from '../../utils'; export default function chessLogic(ctrl) { const worker = new Worker('vendor/scalachessjs.js'); worker.addEventListener('message', function(msg) { const payload = msg.data.payload; switch (msg.data.topic) { case 'dests': ctrl.addDests(payload.dests,...
import { askWorker } from '../../utils'; export default function chessLogic(ctrl) { const worker = new Worker('vendor/scalachessjs.js'); worker.addEventListener('message', function(msg) { const payload = msg.data.payload; switch (msg.data.topic) { case 'dests': ctrl.addDests(payload.dests,...
Remove dependency of app in generated stubs ngMockE2E is currently the only Angular module which is needed for ABE generated stubs
exports.generateDefaultStub = function (data) { angular .module(data['stub-options']['module_name'], [ 'ngMockE2E' ]) .run(function ($httpBackend) { var createStub = function (method, example, $httpBackend) { var httpMethod = method.toUpperCase(), ...
exports.generateDefaultStub = function (data) { angular .module(data['stub-options']['module_name'], [ 'ngMockE2E', 'app' ]) .run(function ($httpBackend) { var createStub = function (method, example, $httpBackend) { var httpMethod = met...
Improve soft-deleting of past events
<?php namespace App\Console\Commands; use Exception; use Illuminate\Console\Command; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; class MarkPastEventsDeleted extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature...
<?php namespace App\Console\Commands; use Exception; use Illuminate\Console\Command; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; class MarkPastEventsDeleted extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature...
Add form success message + cast amount profile to integer
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2019, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Profile Faker / Form /...
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2019, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Profile Faker / Form /...
Add re import for regex
from flask import request, flash, render_template import re import bcrypt from app import app, helpers @app.route('/create_user', methods=['GET', 'POST']) def create_user(): if request.method == 'POST': username = request.form.get('username', None).strip() # Aa09_.- allowed password = request.fo...
from flask import request, flash, render_template import bcrypt from app import app, helpers @app.route('/create_user', methods=['GET', 'POST']) def create_user(): if request.method == 'POST': username = request.form.get('username', None).strip() # Aa09_.- allowed password = request.form.get('pa...
Enhance exception handling in transformation pipeline
package fr.insee.pogues.transforms; import org.apache.commons.io.IOUtils; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; import java.util.Map; public class PipeLine { private String output; private List<Runnable> t...
package fr.insee.pogues.transforms; import org.apache.commons.io.IOUtils; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; import java.util.Map; public class PipeLine { private String output; private List<Runnable> t...
Fix units on wallet info screen
'use strict'; angular.module('copayApp.controllers').controller('walletInfoController', function ($scope, $rootScope, $timeout, profileService, configService, lodash, coloredCoins, walletService) { function initAssets(assets) { if (!assets) { this.assets = []; return; } this.assets = lod...
'use strict'; angular.module('copayApp.controllers').controller('walletInfoController', function ($scope, $rootScope, $timeout, profileService, configService, lodash, coloredCoins, walletService) { function initAssets(assets) { if (!assets) { this.assets = []; return; } this.assets = lod...
Fix swiftmailer not using the correct transport
<?php namespace Common\Mailer; use PDOException; use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\DependencyInjection\ContainerInterface; use Common\ModulesSettings; class Configurator { /** * @var ModulesSettings */...
<?php namespace Common\Mailer; use PDOException; use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\DependencyInjection\ContainerInterface; use Common\ModulesSettings; class Configurator { /** * @var ModulesSettings */...
Make _runQuery to fail if the query fails, but still hide the execution messages
from fabric.api import sudo, hide from braid import package from pipes import quote def install(): package.install(['postgresql-9.1', 'postgresql-server-dev-9.1']) def _runQuery(query): with hide('running', 'output'): return sudo('psql --no-align --no-readline --no-password --quiet ' ...
from fabric.api import sudo, quiet from braid import package from pipes import quote def install(): package.install(['postgresql-9.1', 'postgresql-server-dev-9.1']) def _runQuery(query): with quiet(): return sudo('psql --no-align --no-readline --no-password --quiet ' '--tuples-on...
[IMP] Order document topics by name
# -*- coding: utf-8 -*- from odoo import api, fields, models class DocumentTopic(models.Model): _name = 'tmc.document_topic' _description = 'document_topic' _inherit = 'tmc.category' _order = 'name' first_parent_id = fields.Many2one( comodel_name='tmc.document_topic', compute='_...
# -*- coding: utf-8 -*- from odoo import api, fields, models class DocumentTopic(models.Model): _name = 'tmc.document_topic' _description = 'document_topic' _inherit = 'tmc.category' first_parent_id = fields.Many2one( comodel_name='tmc.document_topic', compute='_compute_first_parent...
Change the input entry to 'lib/index.js'
import path from 'path'; export default { cache: true, target: 'web', entry: path.resolve(__dirname, 'lib/index.js'), output: { path: path.join(__dirname, 'dist'), filename: 'react-sortable.js', libraryTarget: 'umd', library: 'SortableMixin' }, externals: { ...
import path from 'path'; export default { cache: true, target: 'web', entry: path.resolve(__dirname, 'src/index.jsx'), output: { path: path.join(__dirname, 'dist'), filename: 'react-sortable.js', libraryTarget: 'umd', library: 'SortableMixin' }, externals: { ...
Add 'and Contributors' to Author
#!/usr/bin/env python from setuptools import find_packages, setup setup( name="pylast", version="2.2.0.dev0", author="Amr Hassan <amr.hassan@gmail.com> and Contributors", install_requires=['six'], tests_require=['mock', 'pytest', 'coverage', 'pycodestyle', 'pyyaml', 'pyflakes', ...
#!/usr/bin/env python from setuptools import find_packages, setup setup( name="pylast", version="2.2.0.dev0", author="Amr Hassan <amr.hassan@gmail.com>", install_requires=['six'], tests_require=['mock', 'pytest', 'coverage', 'pycodestyle', 'pyyaml', 'pyflakes', 'flaky'], des...
Fix trade signs on Bitfinex * Trades from all other exchanges are presented with positive amounts (with the trade type indicating direction). On Bitfinex, sells were arriving negative and buys positive.
package info.bitrich.xchangestream.bitfinex.dto; import com.fasterxml.jackson.annotation.JsonFormat; import org.knowm.xchange.bitfinex.v1.dto.marketdata.BitfinexTrade; import java.math.BigDecimal; /** * Created by Lukas Zaoralek on 7.11.17. */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) public class BitfinexWebSoc...
package info.bitrich.xchangestream.bitfinex.dto; import com.fasterxml.jackson.annotation.JsonFormat; import org.knowm.xchange.bitfinex.v1.dto.marketdata.BitfinexTrade; import java.math.BigDecimal; /** * Created by Lukas Zaoralek on 7.11.17. */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) public class BitfinexWebSoc...
Add angular service for VariableCategory
angular.module('dplaceServices', ['ngResource']) .factory('LanguageClass', function ($resource) { return $resource( '/api/v1/language_classes/:id', {page_size: 1000}, { query: { method: 'GET', isArray: true, ...
angular.module('dplaceServices', ['ngResource']) .factory('LanguageClass', function ($resource) { return $resource( '/api/v1/language_classes/:id', {page_size: 1000}, { query: { method: 'GET', isArray: true, ...
Add ibutton when importing old people
from django.core.management.base import BaseCommand, CommandError from barsystem_base.models import Person, Token class Command(BaseCommand): args = '<filename>' help = 'Import list of people' csv_columns = 'id,first_name,last_name,nick_name,amount,type,token'.split(',') def handle(self, *args, **kwa...
from django.core.management.base import BaseCommand, CommandError from barsystem_base.models import Person class Command(BaseCommand): args = '<filename>' help = 'Import list of people' csv_columns = 'id,first_name,last_name,nick_name,amount,type,token'.split(',') def handle(self, *args, **kwargs): ...
Bump version number for another release with ducktyping in it
VERSION = (1, 0, 'alpha', 12) def get_version(join=' ', short=False): """ Return the version of this package as a string. The version number is built from a ``VERSION`` tuple, which should consist of integers, or trailing version information (such as 'alpha', 'beta' or 'final'). For example: ...
VERSION = (1, 0, 'alpha', 11) def get_version(join=' ', short=False): """ Return the version of this package as a string. The version number is built from a ``VERSION`` tuple, which should consist of integers, or trailing version information (such as 'alpha', 'beta' or 'final'). For example: ...
Replace "reloadPage" AJAX response class constructor argument with "redirectUrl".
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\Utils\HttpFoundat...
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\Utils\HttpFoundat...
Test the ability to append new email address to the person
from copy import copy from unittest import TestCase from address_book import Person class PersonTestCase(TestCase): def test_get_groups(self): pass def test_add_address(self): basic_address = ['Russian Federation, Kemerovo region, Kemerovo, Kirova street 23, apt. 42'] person = Pers...
from copy import copy from unittest import TestCase from address_book import Person class PersonTestCase(TestCase): def test_get_groups(self): pass def test_add_address(self): basic_address = ['Russian Federation, Kemerovo region, Kemerovo, Kirova street 23, apt. 42'] person = Pers...
Make the passed arguments to sysctlbyname convertible to c_char_p. In python3, the default type of strings are unicode which cannot be converted to c_char_p, resulting a type error from sysctlbyname, using a b prefix for the string makes it convertible to c_char_p.
import sys, resource from ctypes import * import ctypes.util if sys.platform == "darwin": def available_memory(): libc = cdll.LoadLibrary(ctypes.util.find_library("libc")) mem = c_uint64(0) size = c_size_t(sizeof(mem)) libc.sysctlbyname.argtypes = [ c_char_p, c_void_p, c...
import sys, resource from ctypes import * import ctypes.util if sys.platform == "darwin": def available_memory(): libc = cdll.LoadLibrary(ctypes.util.find_library("libc")) mem = c_uint64(0) size = c_size_t(sizeof(mem)) libc.sysctlbyname.argtypes = [ c_char_p, c_void_p, c...
Remove redundant ClientException handling from generic throwable handler
package uk.gov.register.providers; import org.glassfish.jersey.server.ParamException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.gov.register.views.ViewFactory; import uk.gov.register.views.representations.ExtraMediaType; import javax.inject.Inject; import javax.ws.rs.ClientErrorException; imp...
package uk.gov.register.providers; import org.glassfish.jersey.server.ParamException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.gov.register.views.ViewFactory; import uk.gov.register.views.representations.ExtraMediaType; import javax.inject.Inject; import javax.ws.rs.ClientErrorException; imp...
Include error message in node status endpoint
var PSQL = require('cartodb-psql'); function AnalysisStatusBackend() { } module.exports = AnalysisStatusBackend; AnalysisStatusBackend.prototype.getNodeStatus = function (params, callback) { var nodeId = params.nodeId; var statusQuery = [ 'SELECT node_id, status, updated_at, last_error_message as e...
var PSQL = require('cartodb-psql'); function AnalysisStatusBackend() { } module.exports = AnalysisStatusBackend; AnalysisStatusBackend.prototype.getNodeStatus = function (params, callback) { var nodeId = params.nodeId; var statusQuery = 'SELECT node_id, status, updated_at FROM cdb_analysis_catalog where no...