text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Clean up the logging ofr PAWS
import logging from tornado.websocket import WebSocketHandler from zmq.eventloop.zmqstream import ZMQStream clients = [] class PanWebSocket(WebSocketHandler): def open(self, channel): """ Client opening connection to unit """ if channel is None: channel = self.settings['name'] ...
from tornado.websocket import WebSocketHandler from zmq.eventloop.zmqstream import ZMQStream from pocs.utils.logger import get_logger clients = [] class PanWebSocket(WebSocketHandler): logger = get_logger(self) def open(self, channel): """ Client opening connection to unit """ if channel i...
Fix logic of enrollment actions
<div class="btn-group"> {{-- Show button to exchange shift, if exchanges period is active --}} @if ($settings->withinExchangePeriod()) <button type="button" class="btn btn-secondary btn-sm">Exchange shift</button> @endif {{-- Show enrollment actions, if enrollments period is active --}} @if...
<div class="btn-group"> @if (! Auth::user()->student->isEnrolledInCourse($course)) {{-- Show button to enroll in course. --}} <form action="{{ route('enrollments.create') }}" method="post"> {{ csrf_field() }} <input type="hidden" name="course_id" value="{{ $course->id }}"> ...
Fix quarkus.test.arg-line multiple args handling The split is intended to happen on a whitespace character, not the comma character used by properties Fixes: #19623
package io.quarkus.test.junit.launcher; import static io.quarkus.test.junit.IntegrationTestUtil.DEFAULT_WAIT_TIME_SECONDS; import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.OptionalLong; import org.eclipse.microprofile.config.Config; public ...
package io.quarkus.test.junit.launcher; import static io.quarkus.test.junit.IntegrationTestUtil.DEFAULT_WAIT_TIME_SECONDS; import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.OptionalLong; import org.eclipse.microprofile.config.Config; public ...
Use prepared data, rather than the object last action date, to determine boost
from datetime import datetime from councilmatic_core.haystack_indexes import BillIndex from django.conf import settings from haystack import indexes import pytz from chicago.models import ChicagoBill app_timezone = pytz.timezone(settings.TIME_ZONE) class ChicagoBillIndex(BillIndex, indexes.Indexable): topics...
from datetime import datetime from councilmatic_core.haystack_indexes import BillIndex from django.conf import settings from haystack import indexes import pytz from chicago.models import ChicagoBill app_timezone = pytz.timezone(settings.TIME_ZONE) class ChicagoBillIndex(BillIndex, indexes.Indexable): topics...
Update URL patterns for Django >= 1.8
# pylint: disable=no-value-for-parameter from django.conf import settings from django.conf.urls import patterns, url, include from django.contrib import admin from django.views.generic import RedirectView # Enable admin. admin.autodiscover() ADMIN_URLS = False urlpatterns = patterns('') # pylint: disable=C0103 if ...
# pylint: disable=no-value-for-parameter from django.conf import settings from django.conf.urls import patterns, url, include from django.contrib import admin from django.views.generic import RedirectView # Enable admin. admin.autodiscover() ADMIN_URLS = False urlpatterns = patterns('') # pylint: disable=C0103 if ...
Use full pathname to perf_expectations in test. BUG=none TEST=none Review URL: http://codereview.chromium.org/266055 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@28770 0039d316-1c4b-4281-b951-d872f2087c98
#!/usr/bin/python # Copyright (c) 2009 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. """Presubmit script for perf_expectations. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on ...
#!/usr/bin/python # Copyright (c) 2009 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. """Presubmit script for perf_expectations. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on ...
Fix off-by-one error in match highlighter
function MatchHighlighter() { 'use strict'; const mergeRanges = function(indexes) { return indexes.reduce(function(obj, index, pos) { const prevIndex = indexes[pos - 1] || 0; const currentIndex = indexes[pos]; const nextIndex = indexes[pos + 1] || 0; if ...
function MatchHighlighter() { 'use strict'; const mergeRanges = function(indexes) { return indexes.reduce(function(obj, index, pos) { const prevIndex = indexes[pos - 1] || 0; const currentIndex = indexes[pos]; const nextIndex = indexes[pos + 1] || 0; if ...
[improve] Use a logger instead of System.out, display the class name
package com.nokia.springboot.training.d04.s01.service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.concurrent.ListenableFuture; import java.util.concurrent.Complet...
package com.nokia.springboot.training.d04.s01.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.concurrent.ListenableFuture; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionExceptio...
Add some Czech character to test, too
# -*- coding: utf-8 -*- from ella.articles.models import Article from example_project.tests.test_newman.helpers import NewmanTestCase class TestArticleBasics(NewmanTestCase): def test_article_template_saving(self): s = self.selenium # go to article adding s.click(self.elements['navigati...
# -*- coding: utf-8 -*- from ella.articles.models import Article from example_project.tests.test_newman.helpers import NewmanTestCase class TestArticleBasics(NewmanTestCase): def test_article_template_saving(self): s = self.selenium # go to article adding s.click(self.elements['navigati...
Fix for Pokedex defaulting to [], not {}
FullScreenPokemon.FullScreenPokemon.settings.statistics = { "prefix": "FullScreenPokemon::", "defaults": { "storeLocally": true }, "values": { "gameStarted": { "valueDefault": false }, "map": { "valueDefault": "" }, "area": { ...
FullScreenPokemon.FullScreenPokemon.settings.statistics = { "prefix": "FullScreenPokemon::", "defaults": { "storeLocally": true }, "values": { "gameStarted": { "valueDefault": false }, "map": { "valueDefault": "" }, "area": { ...
Fix get authentication type failed
<?php namespace Concrete\Core\Authentication; use Concrete\Core\Logging\Channels; use Concrete\Core\Logging\LoggerAwareInterface; use Concrete\Core\Logging\LoggerAwareTrait; use Concrete\Core\User\User; use Page; use Controller; use Concrete\Core\Support\Facade\Application; abstract class AuthenticationTypeControlle...
<?php namespace Concrete\Core\Authentication; use Concrete\Core\Logging\Channels; use Concrete\Core\Logging\LoggerAwareInterface; use Concrete\Core\Logging\LoggerAwareTrait; use Concrete\Core\User\User; use Page; use Controller; use Concrete\Core\Support\Facade\Application; abstract class AuthenticationTypeControlle...
Add fuzzywuzzy and python-Levenshtein as depends
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
CRM-341: Create workflow widget for entity page - fixed JS minification
var Oro = Oro || {}; Oro.widget = Oro.widget || {}; Oro.widget.Buttons = Oro.widget.Abstract.extend({ options: _.extend( _.extend({}, Oro.widget.Abstract.prototype.options), { cssClass: 'pull-left btn-group icons-holder', type: 'buttons' } ), initialize: fun...
var Oro = Oro || {}; Oro.widget = Oro.widget || {}; Oro.widget.Buttons = Oro.widget.Abstract.extend({ options: _.extend( _.extend({}, Oro.widget.Abstract.prototype.options), { class: 'pull-left btn-group icons-holder', type: 'buttons' } ), initialize: functi...
Enable ending pg pool, and some tidying
'use strict'; const pg = require('pg'); function transaction(client) { return { commit() { return client.query('COMMIT;').then(() => { client.release(); }).catch((err) => this.rollback().then(() => { throw err; })); }, rollback() { return client.query('ROLLBACK;'...
'use strict'; const _ = require('lodash'); const pg = require('pg'); function transaction(client) { return { commit() { return client.query('COMMIT;').then(() => { client.release(); }).catch((err) => { return this.rollback().then(() => { throw err; }); }); ...
Exclude tests and devtools when packaging
#!/usr/bin/env python from setuptools import setup, find_packages def readme(): with open('README.md') as f: return f.read() setup(name='subvenv', version='1.0.0', description=('A tool for creating virtualenv-friendly ' 'Sublime Text project files'), long_description...
from setuptools import setup, find_packages def readme(): with open('README.md') as f: return f.read() setup(name='subvenv', version='1.0.0', description=('A tool for creating virtualenv-friendly ' 'Sublime Text project files'), long_description=readme(), classi...
Fix exception when SSH key is not found
<?php namespace Platformsh\Cli\Command\SshKey; use Platformsh\Cli\Command\CommandBase; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class SshKeyDeleteCommand extends CommandBase { protected function co...
<?php namespace Platformsh\Cli\Command\SshKey; use Platformsh\Cli\Command\CommandBase; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class SshKeyDeleteCommand extends CommandBase { protected function co...
Implement ShuweeAdmin help extension example
<?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * Class PostType * @package AppBundle\Form */ class PostType extends AbstractType { /** * @param FormBuilderInterfa...
<?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * Class PostType * @package AppBundle\Form */ class PostType extends AbstractType { /** * @param FormBuilderInterfa...
Fix next activities on start date and not end date
(function ($) { 'use strict'; setNextActivities(); function setNextActivities() { $.ajax({ url: "/next_activities" }).done(function (data) { var count = 0; var str = ''; $.each(data, function (index, activity) { if(new Date(a...
(function ($) { 'use strict'; setNextActivities(); function setNextActivities() { $.ajax({ url: "/next_activities" }).done(function (data) { var count = 0; var str = ''; $.each(data, function (index, activity) { if(new Date(a...
Remove trailing slash from comment blocks
var _ = require('lodash'); var COMMENT_START = /^\s*\/\*\*/, COMMENT_END = /^\s*\*\//; /** * This service reads LESS files and extract jsdoc styles comments. * It doesn't parse tags inside comments. */ module.exports = function lessFileReader(log) { return { name: 'lessFileReader', defaultPattern: /\.l...
var _ = require('lodash'); var COMMENT_START = /^\s*\/\*\*/, COMMENT_END = /^\s*\*\//; /** * This service reads LESS files and extract jsdoc styles comments. * It doesn't parse tags inside comments. */ module.exports = function lessFileReader(log) { return { name: 'lessFileReader', defaultPattern: /\.l...
Make the WS URL configurable Also store it outside of the state.
import React, { Component } from 'react'; import './App.css'; import Table from './Table'; class App extends Component { constructor () { super(); let ws_url = process.env.REACT_APP_WS_URL if (!ws_url) { const proto = (location.protocol === "https:")? "wss://" : "ws://" ws_url = proto + loc...
import React, { Component } from 'react'; import './App.css'; import Table from './Table'; class App extends Component { constructor () { super(); const ws = new WebSocket('ws://localhost:42745/websocket') this.state = { ws: ws } ws.onopen = () => console.log("OPENED") }; login = (even...
Refactor to use DOM API instead of embedded HTML strings
var autocompleter = { look_up: function(value) { if(value == "") { this.clear_popup(); } else { var self = this; $.ajax("/autocomplete", { data: { "query":value } }).done(function(data) { if(data.length > 0) { var container = $("#autocomplete").empty(); ...
var autocompleter = { look_up: function(value) { if(value == "") { this.clear_popup(); } else { var self = this; $.ajax("/autocomplete", { data: { "query":value } }).done(function(data) { if(data.length > 0) { var html = "", $input = $('#input'); ...
Add iteration to log message
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.maintenance; import com.yahoo.log.LogLevel; import com.yahoo.vespa.config.server.ApplicationRepository; import com.yahoo.vespa.curator.Curator; import com.yahoo.vespa.f...
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.maintenance; import com.yahoo.log.LogLevel; import com.yahoo.vespa.config.server.ApplicationRepository; import com.yahoo.vespa.curator.Curator; import com.yahoo.vespa.f...
Allow optional callbacks for Listeners
from copy import deepcopy from threading import Lock import rospy from arc_utilities.ros_helpers import wait_for class Listener: def __init__(self, topic_name, topic_type, wait_for_data=False, callback=None): """ Listener is a wrapper around a subscriber where the callback simply records the late...
from copy import deepcopy from threading import Lock import rospy from arc_utilities.ros_helpers import wait_for class Listener: def __init__(self, topic_name, topic_type, wait_for_data=False): """ Listener is a wrapper around a subscriber where the callback simply records the latest msg. ...
Update Schedule endpoints to use mock data
package ulcrs.scheduler; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import ulcrs.data.DataStore; import ulcrs.models.schedule.Schedule; import java.io.InputStream; import java.io.InputStreamReader; import java.time.LocalDateTime; import ...
package ulcrs.scheduler; import ulcrs.models.schedule.Schedule; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; public class Scheduler { private static List<Schedule> generatedSchedules; private static boolean isScheduling = false; private static LocalDateTim...
Change TimeStampType to not accept negative values This is to work around a Python bug (http://bugs.python.org/issue1777412)
from __future__ import absolute_import import datetime from time import mktime try: from dateutil.tz import tzutc, tzlocal except ImportError: raise ImportError( 'Using the datetime fields requires the dateutil library. ' 'You can obtain dateutil from http://labix.org/python-dateutil' ) f...
from __future__ import absolute_import import datetime from time import mktime try: from dateutil.tz import tzutc, tzlocal except ImportError: raise ImportError( 'Using the datetime fields requires the dateutil library. ' 'You can obtain dateutil from http://labix.org/python-dateutil' ) f...
Fix adv-meta custum values ignored
<?php include '../../passwd/analytics-key.inc.php'; // Override any of the default settings below: $config['site_title'] = 'schmitt.co'; // Site title $config['theme'] = 'pico-pure'; // Set the theme (defaults to "default") $config['pages_order_by'] = 'date '; ...
<?php include '../../passwd/analytics-key.inc.php'; // Override any of the default settings below: $config['site_title'] = 'schmitt.co'; // Site title $config['theme'] = 'pico-pure'; // Set the theme (defaults to "default") $config['pages_order_by'] = 'date '; ...
Add setup-db and setup-doc targets.
var cly = require('cly'), Couchpenter = require('./couchpenter').Couchpenter, p = require('path'); function exec() { var options = { url: { string: '-u url', help: 'CouchDB URL, default: http://localhost:5984' }, file: { string: '-f file', help: 'Path to configuration file, d...
var cly = require('cly'), Couchpenter = require('./couchpenter').Couchpenter, p = require('path'); function exec() { var options = { url: { string: '-u url', help: 'CouchDB URL, default: http://localhost:5984' }, file: { string: '-f file', help: 'Path to configuration file, d...
Update coverage values to match current
'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', } }, ...
UPDATE: Throw exception if we are going to divide by 0
<?php /** * This file is part of the Statistical Classifier package. * * (c) Cam Spiers <camspiers@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Camspiers\StatisticalClassifier\Transform; /** * @author C...
<?php /** * This file is part of the Statistical Classifier package. * * (c) Cam Spiers <camspiers@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Camspiers\StatisticalClassifier\Transform; /** * @author C...
Update code to use new classes
<?php namespace Grav\Plugin; use Grav\Common\Plugin; use Grav\Common\Grav; use Grav\Common\Page\Page; use Grav\Common\Page\Pages; use RocketTheme\Toolbox\Event\Event; class ErrorPlugin extends Plugin { /** * @return array */ public static function getSubscribedEvents() { return [ ...
<?php namespace Grav\Plugin; use Grav\Common\Plugin; use Grav\Common\Grav; use Grav\Common\Page\Page; use Grav\Common\Page\Pages; use Grav\Component\EventDispatcher\Event; class ErrorPlugin extends Plugin { /** * @return array */ public static function getSubscribedEvents() { return [ ...
Fix typo in methods example.
# Example: How to get the currently activated payment methods. # import os from mollie.api.client import Client from mollie.api.error import Error def main(): try: # # Initialize the Mollie API library with your API key. # # See: https://www.mollie.com/dashboard/settings/profile...
# Example: How to get the currently activated payment methods. # import os from mollie.api.client import Client from mollie.api.error import Error def main(): try: # # Initialize the Mollie API library with your API key. # # See: https://www.mollie.com/dashboard/settings/profile...
system: Add require statement for the abstract L10nProvider
<?php /** * Factory class for providing Localization implementations * @author M2Mobi, Heinz Wiesinger */ class L10nFactory { /** * Instance of the L10nProvider * @var array */ private static $lprovider; /** * Constructor */ public function __construct() { } ...
<?php /** * Factory class for providing Localization implementations * @author M2Mobi, Heinz Wiesinger */ class L10nFactory { /** * Instance of the L10nProvider * @var array */ private static $lprovider; /** * Constructor */ public function __construct() { } ...
Fix "Trying to get property of non-object" when mentioning at your own submission
<?php namespace App\Traits; use App\Notifications\UsernameMentioned; use App\User; use Auth; trait UsernameMentions { /** * Handles all the mentions in the comment. (sends notifications to mentioned usernames). * * @param \App\Comment $comment * @param \App\Submission $submission * @p...
<?php namespace App\Traits; use App\Notifications\UsernameMentioned; use App\User; use Auth; trait UsernameMentions { /** * Handles all the mentions in the comment. (sends notifications to mentioned usernames). * * @param \App\Comment $comment * @param \App\Submission $submission * @p...
Implement remainder of the write plugin
var File = require('vinyl'); var mix = require('mix'); var path = require('path'); var rimraf = require('rimraf'); var vfs = require('vinyl-fs'); module.exports = function (dir) { var pending = []; function schedule(work) { pending.push(work); if (pending.length === 1) { performNex...
var File = require('vinyl'); var mix = require('mix'); var path = require('path'); var rimraf = require('rimraf'); var vfs = require('vinyl-fs'); module.exports = function (dir) { var pending = []; function schedule(work) { pending.push(work); if (pending.length === 1) { performNex...
Change argument names for thenable for clarity
'use strict'; var Promise = require('bluebird'); var sinon = require('sinon'); function thenable (promiseFactory) { return Object.getOwnPropertyNames(Promise.prototype) .filter(function (method) { return method !== 'then'; }) .reduce(function (acc, method) { acc[method] = function () { ...
'use strict'; var Promise = require('bluebird'); var sinon = require('sinon'); function thenable (promiseFactory) { return Object.getOwnPropertyNames(Promise.prototype) .filter(function (method) { return method !== 'then'; }) .reduce(function (acc, method) { acc[method] = function () { ...
Use more descriptive variable name
import View from 'girder/views/View'; import { SORT_ASC, SORT_DESC } from 'girder/constants'; import SortCollectionWidgetTemplate from 'girder/templates/widgets/sortCollectionWidget.pug'; import 'bootstrap/js/dropdown'; /** * This widget is used to provide a consistent widget for sorting * pages of a Collection by...
import View from 'girder/views/View'; import { SORT_ASC, SORT_DESC } from 'girder/constants'; import SortCollectionWidgetTemplate from 'girder/templates/widgets/sortCollectionWidget.pug'; import 'bootstrap/js/dropdown'; /** * This widget is used to provide a consistent widget for sorting * pages of a Collection by...
Replace boolean "forcexunit" with string "test-command"
package org.eobjects.build; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Parameter; public abstract class AbstractDotnetTestMojo extends AbstractDotnetMojo { @Parameter(property = "dotne...
package org.eobjects.build; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Parameter; public abstract class AbstractDotnetTestMojo extends AbstractDotnetMojo { @Parameter(property = "dotne...
TST: Make sure there is an error field
import pytest import log_parser import os @pytest.fixture def parsed_log(): logname = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'build.log') gen = list(log_parser.read_log_from_script(logname)) parsed = {built_name: log_parser.parse_conda_build(lines) ...
import pytest import log_parser import os @pytest.fixture def parsed_log(): logname = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'build.log') gen = list(log_parser.read_log_from_script(logname)) parsed = {built_name: log_parser.parse_conda_build(lines) ...
Add Dependencies and Dependents formula
(function (env) { "use strict"; env.ddg_spice_homebrew = function(api_result){ if (!api_result || api_result.error) { return Spice.failed('homebrew'); } Spice.add({ id: "homebrew", name: "Formula", data: api_result, meta: { ...
(function (env) { "use strict"; env.ddg_spice_homebrew = function(api_result){ if (!api_result || api_result.error) { return Spice.failed('homebrew'); } Spice.add({ id: "homebrew", name: "Formula", data: api_result, meta: { ...
Change _connect to connect, so that it can be used from within other modules
''' Module to provide MySQL compatibility to salt. In order to connect to MySQL, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like: mysql.host: 'localhost' mysql.port: 3306 mysql.user: 'root' mysql.pass: '' mysql.db: 'mysql' ''' import MySQLdb __opts...
''' Module to provide MySQL compatibility to salt. In order to connect to MySQL, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like: mysql.host: 'localhost' mysql.port: 3306 mysql.user: 'root' mysql.pass: '' mysql.db: 'mysql' ''' import MySQLdb __opts...
Remove question, and minor correction
var data = { "title": "Programmeringspraxis", "questions": [ { "description": "En funktion som har bieffekter kan ej anses vara korrekt", "alternatives": ["Sant", "Falskt"], "answer": "Falskt" }, { "description": "En enradskommentar ska beskriva va...
var data = { "title": "Programmeringspraxis", "questions": [ { "description": "En funktion som har bieffekter kan ej anses vara korrekt", "alternatives": ["Sant", "Falskt"], "answer": "Falskt" }, { "description": "Något annat än indata, utdata och ...
Change all js to point to krisk repo
from collections import OrderedDict from IPython.display import Javascript import json from krisk.util import join_current_dir ECHARTS_URL = 'https://cdnjs.cloudflare.com/ajax/libs/echarts/3.2.0/' ECHARTS_FILE = 'echarts.min' d_paths = OrderedDict({}) THEMES = ['dark','vintage','roma','shine','infographic','macarons'...
from collections import OrderedDict from IPython.display import Javascript import json from krisk.util import join_current_dir ECHARTS_URL = 'https://cdnjs.cloudflare.com/ajax/libs/echarts/3.2.0/' ECHARTS_FILE = 'echarts.min' d_paths = OrderedDict({}) THEMES = ['dark','vintage','roma','shine','infographic','macarons'...
Fix JSON encoding of empty field
function submit_item_form(controls, url) { var data = { }; for(var i=0; i<controls.length; ++i) { var control = controls[i]; var element = $("#"+control); var encoder = window["encode_"+element.data("rm-type")]; var value = null; if(typeof(encoder) != "undefined") { ...
function submit_item_form(controls, url) { var data = { }; for(var i=0; i<controls.length; ++i) { var control = controls[i]; var element = $("#"+control); var encoder = window["encode_"+element.data("rm-type")]; var value = null; if(typeof(encoder) != "undefined") { ...
Deploy Travis CI build 717 to GitHub
#!/usr/bin/env python """Setup script for PythonTemplateDemo.""" import setuptools from demo import __project__, __version__ try: README = open("README.rst").read() CHANGELOG = open("CHANGELOG.rst").read() except IOError: LONG_DESCRIPTION = NotImplemented else: LONG_DESCRIPTION = README + '\n' + CHA...
#!/usr/bin/env python """Setup script for PythonTemplateDemo.""" import setuptools from demo import __project__, __version__ try: README = open("README.rst").read() CHANGELOG = open("CHANGELOG.rst").read() except IOError: LONG_DESCRIPTION = "Coming soon..." else: LONG_DESCRIPTION = README + '\n' + C...
Add text domain to translatable string
<?php /** * NOTE: Keep code in this file compatible with PHP 5.2 */ define('MINIMUM_PHP', '7.0'); define('MINIMUM_WP', '4.7'); if (version_compare(PHP_VERSION, MINIMUM_PHP, '<') || version_compare(get_bloginfo('version'), MINIMUM_WP, '<') ) { add_action('admin_notices', 'printJentilReqNotice'); deacti...
<?php /** * NOTE: Keep code in this file compatible with PHP 5.2 */ define('MINIMUM_PHP', '7.0'); define('MINIMUM_WP', '4.7'); if (version_compare(PHP_VERSION, MINIMUM_PHP, '<') || version_compare(get_bloginfo('version'), MINIMUM_WP, '<') ) { add_action('admin_notices', 'printJentilReqNotice'); deacti...
Update to use chronicle bytes - there are a number of tests that are failing and are marked with ignore.
/* * Copyright (C) 2015 higherfrequencytrading.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License. * * This program is distr...
/* * Copyright (C) 2015 higherfrequencytrading.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License. * * This program is distr...
Make code compatible with PHP < 8
<?php declare(strict_types = 1); namespace Rebing\GraphQL\Tests\Unit\Console; use Rebing\GraphQL\Console\SchemaConfigMakeCommand; use Rebing\GraphQL\Tests\Support\Traits\MakeCommandAssertionTrait; use Rebing\GraphQL\Tests\TestCase; class SchemaConfigMakeCommandTest extends TestCase { use MakeCommandAssertionTrai...
<?php declare(strict_types = 1); namespace Rebing\GraphQL\Tests\Unit\Console; use Rebing\GraphQL\Console\SchemaConfigMakeCommand; use Rebing\GraphQL\Tests\Support\Traits\MakeCommandAssertionTrait; use Rebing\GraphQL\Tests\TestCase; class SchemaConfigMakeCommandTest extends TestCase { use MakeCommandAssertionTrai...
Modify the people role enum
/** * Copyright (c) 2005-2012 https://github.com/zhangkaitao * * Licensed under the Apache License, Version 2.0 (the "License"); */ package com.huntering.common.plugin.entity; /** * <p>实体实现该接口,表示需要进行状态管理 */ public interface Stateable<T extends Enum<? extends Stateable.Status>> { public void setStatus(T stat...
/** * Copyright (c) 2005-2012 https://github.com/zhangkaitao * * Licensed under the Apache License, Version 2.0 (the "License"); */ package com.huntering.common.plugin.entity; /** * <p>实体实现该接口,表示需要进行状态管理 */ public interface Stateable<T extends Enum<? extends Stateable.Status>> { public void setStatus(T stat...
Disable SSL verification in requests.get
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from future.builtins.disabled import * import base64 import atexit import requests # disable warnings try: requests.packages.urllib3.disable_warnings() except AttributeErro...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from future.builtins.disabled import * import base64 import atexit import requests # disable warnings try: requests.packages.urllib3.disable_warnings() except AttributeErro...
Add event smoke test, not automated (yet)
var window = Ti.UI.createWindow({ theme: "Theme.AppCompat.Light" }); var section = Ti.UI.createListSection({}); var list = require('power-templates').createListView({ templates: { "simple": { properties: { // use functions for property evaluation! itemId: '[ id ]', }, childTe...
var window = Ti.UI.createWindow({ theme: "Theme.AppCompat.Light" }); var section = Ti.UI.createListSection({}); var list = require('power-templates').createListView({ templates: { "simple": { properties: { // use functions for property evaluation! itemId: '[ id ]', }, childTe...
Use Norwegian 'og', not 'and'
const Job = ({ locations, deadline, companyImage, companyName, jobTitle, ingress, jobName }) => { if (locations.length >= 2) { locations = `${locations.slice(0, -1).join(', ')} og ${locations[locations.length - 1]}`; } else if (locations.length === 0) { locations = 'Ikke spesifisert'; } return ( <a...
const Job = ({ locations, deadline, companyImage, companyName, jobTitle, ingress, jobName }) => { if (locations.length >= 2) { locations = `${locations.slice(0, -1).join(', ')} and ${locations[locations.length - 1]}`; } else if (locations.length === 0) { locations = 'Ikke spesifisert'; } return ( <...
Add "lib" to typescript defs
var gulp = require('gulp'); var gulpTypescript = require('gulp-typescript'); var typescript = require('typescript'); var header = require('gulp-header'); var merge = require('merge2'); var pkg = require('./package.json'); var headerTemplate = '// <%= pkg.name %> v<%= pkg.version %>\n'; gulp.task('default', tscTask); ...
var gulp = require('gulp'); var gulpTypescript = require('gulp-typescript'); var typescript = require('typescript'); var header = require('gulp-header'); var merge = require('merge2'); var pkg = require('./package.json'); var headerTemplate = '// <%= pkg.name %> v<%= pkg.version %>\n'; gulp.task('default', tscTask); ...
Remove the source maps link from the bundles We don’t serve the maps, and their absence generates a 404 error sometimes
/* eslint-env node */ const webpack = require('webpack'); const packageJson = require('./package.json'); const isProduction = process.env.NODE_ENV === 'production'; function getLicenseComment(version) { return [ 'Likely $version by Ilya Birman (ilyabirman.net)', 'Rewritten sans jQuery by Evgeny S...
/* eslint-env node */ const webpack = require('webpack'); const packageJson = require('./package.json'); const isProduction = process.env.NODE_ENV === 'production'; function getLicenseComment(version) { return [ 'Likely $version by Ilya Birman (ilyabirman.net)', 'Rewritten sans jQuery by Evgeny S...
Add trigger to navigate() calls
define(['jquery', 'underscore', 'backbone', 'views'], function($ , _ , Backbone , View ) { var AppRouter = Backbone.Router.extend({ routes: { '': 'showHome', 'about': 'showAbout', 'projects': 'showProjects', 'resume': 'showResume', ...
define(['jquery', 'underscore', 'backbone', 'views'], function($ , _ , Backbone , View ) { var AppRouter = Backbone.Router.extend({ routes: { '': 'showHome', 'about': 'showAbout', 'projects': 'showProjects', 'resume': 'showResume', ...
Add docs to the ConfigCache.
import json import threading import uuid class ConfigCache(object): """ The ConfigCache class stores an in-memory version of each feed's configuration. As there may be multiple systems using Thoonk with the same Redis server, and each with its own ConfigCache instance, each ConfigCache has a self...
import json import threading import uuid from thoonk.consts import * class ConfigCache(object): def __init__(self, pubsub): self._feeds = {} self.pubsub = pubsub self.lock = threading.Lock() self.instance = uuid.uuid4().hex def __getitem__(self, feed): with self.lock:...
Check for null while checking for rows in grid children If grid contains falsy children, i should be skipped
/* @flow */ 'use strict'; import React, {Component} from 'react'; import {View, TouchableOpacity} from 'react-native'; import computeProps from '../Utils/computeProps'; import _ from 'lodash'; import Col from './Col'; import Row from './Row'; export default class GridNB extends Component { prepareRootProps() { ...
/* @flow */ 'use strict'; import React, {Component} from 'react'; import {View, TouchableOpacity} from 'react-native'; import computeProps from '../Utils/computeProps'; import _ from 'lodash'; import Col from './Col'; import Row from './Row'; export default class GridNB extends Component { prepareRootProps() { ...
Refactor to call getDetail on componentDidMount rather than on constructor
import React from 'react'; import {List, ListItem} from 'material-ui/List'; import Divider from 'material-ui/Divider'; import Subheader from 'material-ui/Subheader'; class ConferenceDetail extends React.Component { constructor(props) { super(props); this.state = {}; } componentDidMount(){ // Initial...
import React from 'react'; import {List, ListItem} from 'material-ui/List'; import Divider from 'material-ui/Divider'; import Subheader from 'material-ui/Subheader'; class ConferenceDetail extends React.Component { constructor(props) { super(props); this.state = {}; // Initialize this.props.getDetail...
Improve loading of payload from json
from flask import Blueprint, request, json from alfred_db.models import Repository, Commit from .database import db from .helpers import parse_hook_data webhooks = Blueprint('webhooks', __name__) @webhooks.route('/', methods=['POST']) def handler(): payload = request.form.get('payload') try: payloa...
from flask import Blueprint, request, json from alfred_db.models import Repository, Commit from .database import db from .helpers import parse_hook_data webhooks = Blueprint('webhooks', __name__) @webhooks.route('/', methods=['POST']) def handler(): payload = request.form.get('payload', '') try: pa...
Allow commands to define internal options So those options don't appear in the help output
var command = { command: "help", description: "List all commands or provide information about a specific command", help: { usage: "truffle help [<command>]", options: [ { option: "<command>", description: "Name of the command to display information for." } ] }, buil...
var command = { command: "help", description: "List all commands or provide information about a specific command", help: { usage: "truffle help [<command>]", options: [ { option: "<command>", description: "Name of the command to display information for." } ] }, buil...
Add default prop for page
/** * @jsx React.DOM */ var React = require('react'); var Pdf = React.createClass({ getInitialState: function() { return {}; }, componentDidMount: function() { var self = this; PDFJS.getDocument(this.props.file).then(function(pdf) { pdf.getPage(self.props.page).then(function(page) { ...
/** * @jsx React.DOM */ var React = require('react'); var Pdf = React.createClass({ getInitialState: function() { return {}; }, componentDidMount: function() { var self = this; PDFJS.getDocument(this.props.file).then(function(pdf) { pdf.getPage(self.props.page).then(function(page) { ...
Add a comment (Test commit for codecov)
package com.smp.rxplayround.sample; import com.smp.rxplayround.BasePlayground; import org.junit.Test; import lombok.extern.slf4j.Slf4j; import rx.Observable; import rx.Observer; /** * Created by myungpyo.shim on 2016. 4. 25.. * Simple observable test. just emit some strings. */ @Slf4j public class Play1_EmitFrom...
package com.smp.rxplayround.sample; import com.smp.rxplayround.BasePlayground; import org.junit.Test; import lombok.extern.slf4j.Slf4j; import rx.Observable; import rx.Observer; /** * Created by myungpyo.shim on 2016. 4. 25.. */ @Slf4j public class Play1_EmitFromStringArray extends BasePlayground { @Test ...
Remove json_encode() on array keys
<?php namespace LiteCQRS\Plugin\Doctrine\EventStore; use LiteCQRS\DomainEvent; use LiteCQRS\EventStore\EventStoreInterface; use LiteCQRS\EventStore\SerializerInterface; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Schema\Schema; /** * Store events in a database table using Doctrine DBAL. */ class TableEventSto...
<?php namespace LiteCQRS\Plugin\Doctrine\EventStore; use LiteCQRS\DomainEvent; use LiteCQRS\EventStore\EventStoreInterface; use LiteCQRS\EventStore\SerializerInterface; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Schema\Schema; /** * Store events in a database table using Doctrine DBAL. */ class TableEventSto...
Support fallback for restPrefix blueprint configuration This will look for restPrefix first, then prefix if defined
/** * Adds support for count blueprint and binds :model/count route for each RESTful model. */ var _ = require('lodash'); var actionUtil = require('./actionUtil'); var pluralize = require('pluralize'); const defaultCountBlueprint = function(req, res) { var Model = actionUtil.parseModel(req); var countQuery = M...
/** * Adds support for count blueprint and binds :model/count route for each RESTful model. */ var _ = require('lodash'); var actionUtil = require('./actionUtil'); var pluralize = require('pluralize'); const defaultCountBlueprint = function(req, res) { var Model = actionUtil.parseModel(req); var countQuery = M...
Add annotations to document some changes between 2.0.1 and 2.0.2 git-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@14479 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3
package bugIdeas; import edu.umd.cs.findbugs.annotations.ExpectWarning; import edu.umd.cs.findbugs.annotations.NoWarning; public class Ideas_2009_01_14 { @NoWarning("SF") static String getNameCorrect(int value) { String result = ""; switch (value) { case 0: result = "zero"...
package bugIdeas; public class Ideas_2009_01_14 { // static String getNameCorrect(int value) { // String result = ""; // switch (value) { // case 0: // result = "zero"; // break; // case 1: // result = "one"; // break; // case 2: // result = "two"; // break; // case...
Put a blank line among main suites
# -*- coding: utf-8 -*- from clint.textui import indent, puts, colored from mamba import spec class DocumentationFormatter(object): def __init__(self): self.has_failed_tests = False self.total_specs = 0 self.total_seconds = .0 def format(self, item): puts() puts(colo...
# -*- coding: utf-8 -*- from clint.textui import indent, puts, colored from mamba import spec class DocumentationFormatter(object): def __init__(self): self.has_failed_tests = False self.total_specs = 0 self.total_seconds = .0 def format(self, item): puts(colored.white(item....
Add support for minLength and limit in AutoComplete
import {bindable, customAttribute} from 'aurelia-templating'; import {inject} from 'aurelia-dependency-injection'; import {fireEvent} from '../common/events'; @customAttribute('md-autocomplete') @inject(Element) export class MdAutoComplete { input = null; @bindable() values = {}; @bindable() minLength =...
import {bindable, customAttribute} from 'aurelia-templating'; import {inject} from 'aurelia-dependency-injection'; import {fireEvent} from '../common/events'; @customAttribute('md-autocomplete') @inject(Element) export class MdAutoComplete { input = null; @bindable() values = {}; constructor(element) ...
Increase waiting time for MapR standalone
package com.splicemachine.test; import com.splicemachine.concurrent.Threads; import java.io.IOException; import java.net.Socket; import java.util.concurrent.TimeUnit; import static java.lang.String.format; /** * Waits for connections on a given host+port to be available. */ public class SpliceTestPlatformWait { ...
package com.splicemachine.test; import com.splicemachine.concurrent.Threads; import java.io.IOException; import java.net.Socket; import java.util.concurrent.TimeUnit; import static java.lang.String.format; /** * Waits for connections on a given host+port to be available. */ public class SpliceTestPlatformWait { ...
Add lazy flag to avoid circular reference
<?php namespace Finite\Bundle\FiniteBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\DependencyInject...
<?php namespace Finite\Bundle\FiniteBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\DependencyInject...
Fix nierozpoznawania bledu gracza w pierwszym ruchu
from game import Game from input_con import InputCon from output_con import OutputCon class Harness(): def __init__(self, output, inputs): self._game = Game() self._output = output self._inputs = inputs def Start(self): self._output.show_welcome() while True: self._outpu...
from game import Game from input_con import InputCon from output_con import OutputCon class Harness(): def __init__(self, output, inputs): self._game = Game() self._output = output self._inputs = inputs def Start(self): self._output.show_welcome() while True: self._outpu...
Set callback param to false
<?php use Proud\Core; class AgencyMenu extends Core\ProudWidget { function __construct() { parent::__construct( 'agency_menu', // Base ID __( 'Agency menu', 'wp-agency' ), // Name array( 'description' => __( "Display an agency menu", 'wp-agency' ), ) // Args ); } function initialize(...
<?php use Proud\Core; class AgencyMenu extends Core\ProudWidget { function __construct() { parent::__construct( 'agency_menu', // Base ID __( 'Agency menu', 'wp-agency' ), // Name array( 'description' => __( "Display an agency menu", 'wp-agency' ), ) // Args ); } function initialize(...
Change function name to Camel
#!/usr/bin/env python def Parser(roman): ''' This function receives a Roman Numeral String and convert it to an Arabic Number. parameters: --------------------------------- roman: Roman Numearl string input''' roman_dic = {'M': 1000, 'C': 100, 'L': 50, 'D': 500, 'X': 10, ...
#!/usr/bin/env python def parser(roman): ''' This function receives a Roman Numeral String and convert it to an Arabic Number. parameters: --------------------------------- roman: Roman Numearl string input''' roman_dic = {'M': 1000, 'C': 100, 'L': 50, 'D': 500, 'X': 10, ...
Update job properties in sendJobState
'use strict'; var url = require('url'); var lodash = require('lodash'); var Promise = require('digdug/node_modules/dojo/Promise'); var DigdugSauceLabsTunnel = require('digdug/SauceLabsTunnel'); module.exports = function(options) { return { _tunnel: null, updateCapabilities: function(caps) { return l...
'use strict'; var url = require('url'); var lodash = require('lodash'); var Promise = require('digdug/node_modules/dojo/Promise'); var DigdugSauceLabsTunnel = require('digdug/SauceLabsTunnel'); module.exports = function(options) { return { _tunnel: null, updateCapabilities: function(caps) { return l...
Add locales link for project show
import React, { PropTypes } from 'react' import { List, ListItem } from 'material-ui/List'; import { Link } from 'react-router'; export default class Project extends React.Component { static propTypes = { project: PropTypes.object.isRequired, locales: PropTypes.array.isRequired } render() ...
import React, { PropTypes } from 'react' import { List, ListItem } from 'material-ui/List'; export default class Project extends React.Component { static propTypes = { project: PropTypes.object.isRequired, locales: PropTypes.array.isRequired } render() { return ( <div> ...
Return /api/endpoints data as array instead of dict
<?php namespace OParl\Website\API\Controllers; use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Http\Request; use Symfony\Component\Yaml\Yaml; class EndpointApiController { public function index(Request $request, Filesystem $fs) { $page = 0; $itemsPerPage = 25; if ($req...
<?php namespace OParl\Website\API\Controllers; use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Http\Request; use Symfony\Component\Yaml\Yaml; class EndpointApiController { public function index(Request $request, Filesystem $fs) { $page = 0; $itemsPerPage = 25; if ($req...
Add trial period days option to initial plans.
import decimal from django.conf import settings from django.core.management.base import BaseCommand import stripe class Command(BaseCommand): help = "Make sure your Stripe account has the plans" def handle(self, *args, **options): stripe.api_key = settings.STRIPE_SECRET_KEY for plan in set...
import decimal from django.conf import settings from django.core.management.base import BaseCommand import stripe class Command(BaseCommand): help = "Make sure your Stripe account has the plans" def handle(self, *args, **options): stripe.api_key = settings.STRIPE_SECRET_KEY for plan in set...
Add use_decimal=True for json encoding
from urlparse import parse_qs import DQXUtils import simplejson import responders def application(environ, start_response): returndata = dict((k,v[0]) for k,v in parse_qs(environ['QUERY_STRING']).items()) request_type = returndata['datatype'] tm = DQXUtils.Timer() try: resp_func =...
from urlparse import parse_qs import DQXUtils import simplejson import responders def application(environ, start_response): returndata = dict((k,v[0]) for k,v in parse_qs(environ['QUERY_STRING']).items()) request_type = returndata['datatype'] tm = DQXUtils.Timer() try: resp_func =...
Increase timeout of CLI tests to let the update notifier do the job.
var cp = require('child_process'); var expect = require('expect.js'); module.exports = function () { describe('CLI', function () { this.timeout(10000); // Increase the timeout to let the update-notifier do it's job it('should error if task file does not exist', function (done) { cp...
var cp = require('child_process'); var expect = require('expect.js'); module.exports = function () { describe('CLI', function () { it('should error if task file does not exist', function (done) { cp.exec('node bin/automaton something-that-will-never-exist', function (err, stdout, stderr) { ...
Revert "fix ES5 shim test" This reverts commit ae8728dc7bbdec7109b70c07a97333ffac4662a3.
define('implementations', [], function () { 'use strict'; return { 'es5': [ { isAvailable: function () { // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/es5/array.js return !(Array.prototype && Array.prototype.every && Array.prototy...
define('implementations', [], function () { 'use strict'; return { 'es5': [ { isAvailable: function () { // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/es5/array.js return !!(Array.prototype && Array.prototype.every && Array.protot...
FIX return format of client Fixed a bug which ignored the 'fmt' parameter. Therefore the response of this interface were always json.
<?php namespace xeased\giphy; /** * The Client sends the request to the giphy api. If no "api_key" is set, the public beta key will be used. */ class Client { const GIPHY_API_URL = 'http://api.giphy.com'; const API_KEY = 'dc6zaTOxFJmzC'; // public beta key /** * Performs a call to giphy. * @p...
<?php namespace xeased\giphy; /** * The Client sends the request to the giphy api. If no "api_key" is set, the public beta key will be used. */ class Client { const GIPHY_API_URL = 'http://api.giphy.com'; const API_KEY = 'dc6zaTOxFJmzC'; // public beta key /** * Performs a call to giphy. * @p...
Remove the observer on $destroy Thanks @heavysixer!
angular.module('eee-c.angularBindPolymer', []). directive('bindPolymer', function() { 'use strict'; return { restrict: 'A', link: function(scope, element, attrs) { var attrMap = {}; for (var prop in attrs.$attr) { if (prop != 'bindPolymer') { var _attr = attrs.$attr[prop]; ...
angular.module('eee-c.angularBindPolymer', []). directive('bindPolymer', function() { return { restrict: 'A', link: function(scope, element, attrs) { var attrMap = {}; for (var prop in attrs.$attr) { if (prop != 'bindPolymer') { var _attr = attrs.$attr[prop]; var _match...
Add site number and application type to properties. For better filtering of new and old biz.
import csv import datetime class Row(dict): def __init__(self, *args, **kwargs): super(Row, self).__init__(*args, **kwargs) self._start_date = None self._end_date = None def _cast_date(self, s): if not s: return None return datetime.datetime.strptime(s, '%...
import csv import datetime class Row(dict): def __init__(self, *args, **kwargs): super(Row, self).__init__(*args, **kwargs) self._start_date = None self._end_date = None def _cast_date(self, s): if not s: return None return datetime.datetime.strptime(s, '%...
[Admin] Set an Invalid message for ChangePassword confirmation
<?php // src/Corvus/AdminBundle/Form/Type/ChangePasswordType.php namespace Corvus\AdminBundle\Form\Type; use Symfony\Component\Form\AbstractType, Symfony\Component\Form\FormBuilderInterface, Symfony\Component\Security\Core\Validator\Constraints\UserPassword, Symfony\Component\OptionsResolver\OptionsResolv...
<?php // src/Corvus/AdminBundle/Form/Type/ChangePasswordType.php namespace Corvus\AdminBundle\Form\Type; use Symfony\Component\Form\AbstractType, Symfony\Component\Form\FormBuilderInterface, Symfony\Component\Security\Core\Validator\Constraints\UserPassword, Symfony\Component\OptionsResolver\OptionsResolv...
Fix issue with HP ProCurve stacks and multiple hit enter to continue messages
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
Break up 'default' task into 'default' and 'watch', so that traditional build processes can work
module.exports = function(grunt){ grunt.loadNpmTasks('grunt-contrib-coffee'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.initConfig({ coffee:{ compileJoined: { options: { join: true }, files: { ...
module.exports = function(grunt){ grunt.loadNpmTasks('grunt-contrib-coffee'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.initConfig({ coffee:{ compileJoined: { options: { join: true }, files: { ...
Handle null case for client id
"use strict"; var restify = require('restify'); var async = require('async'); var Anyfetch = require('anyfetch'); module.exports.get = function get(req, res, next) { if(!req.query.context) { return next(new restify.ConflictError("Missing query parameter")); } async.waterfall([ function getDocuments(cb)...
"use strict"; var restify = require('restify'); var async = require('async'); var Anyfetch = require('anyfetch'); module.exports.get = function get(req, res, next) { if(!req.query.context) { return next(new restify.ConflictError("Missing query parameter")); } async.waterfall([ function getDocuments(cb)...
Update of sorted merge step test case git-svn-id: 51b39fcfd0d3a6ea7caa15377cad4af13b9d2664@4016 5fb7f6ec-07c1-534a-b4ca-9155e429e800
package org.pentaho.di.run.sortedmerge; import junit.framework.TestCase; import org.pentaho.di.core.Result; import org.pentaho.di.core.logging.LogWriter; import org.pentaho.di.run.AllRunTests; import org.pentaho.di.run.TimedTransRunner; public class RunSortedMerge extends TestCase { public void test_S...
package org.pentaho.di.run.sortedmerge; import junit.framework.TestCase; import org.pentaho.di.core.Result; import org.pentaho.di.core.logging.LogWriter; import org.pentaho.di.run.AllRunTests; import org.pentaho.di.run.TimedTransRunner; public class RunSortedMerge extends TestCase { public void test_S...
Use f.read() instead of filter() for reading requirements filter() has changed in Python 3 which breaks this.
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst')) as f: readme = f.read() with open(os.path.join(here, 'requirements.txt')) as f: requires = f.read().split('\n') with open(os.path.join(here, 'requirements-dev.t...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst')) as f: readme = f.read() with open(os.path.join(here, 'requirements.txt')) as f: requires = filter(None, f.readlines()) with open(os.path.join(here, 'requirement...
Fix undefined window in worker.
var version = function () { return '(loading)'; }; var compileJSON = function () { return ''; }; var missingInputs = []; module.exports = function (self) { self.addEventListener('message', function (e) { var data = e.data; switch (data.cmd) { case 'loadVersion': delete self.Module; vers...
var version = function () { return '(loading)'; }; var compileJSON = function () { return ''; }; var missingInputs = []; module.exports = function (self) { self.addEventListener('message', function (e) { var data = e.data; switch (data.cmd) { case 'loadVersion': delete window.Module; ve...
Add example of test instructions in sample plugin
var hydra = require('hydra'), HydraHeadStatic = hydra.heads.HydraHeadStatic, HydraHead = hydra.heads.HydraHead; exports.getBodyParts = function(config, modules) { var assert = modules.assert; return { name: "testBasic", tests: { firstTestFoo: { ...
var hydra = require('hydra'), HydraHeadStatic = hydra.heads.HydraHeadStatic, HydraHead = hydra.heads.HydraHead; exports.getBodyParts = function(config, modules) { var assert = modules.assert; return { name: "testBasic", tests: { firstTestFoo: { ...
Update API URLs in web UI
var default_settings = { /* Topology settings */ show_unused_interfaces: true, show_disconnected_hosts: true, show_topology: true, topology_transformation: 'translate(0,0) scale(1)', /* Map settings */ show_map: true, map_opacity: 0.4, map_center: [-97.8445676, 35.3...
var default_settings = { /* Topology settings */ show_unused_interfaces: true, show_disconnected_hosts: true, show_topology: true, topology_transformation: 'translate(0,0) scale(1)', /* Map settings */ show_map: true, map_opacity: 0.4, map_center: [-97.8445676, 35.3...
Use the Python 3 print function.
#!/usr/bin/env python from __future__ import print_function import os import subprocess import sys def build(pkgpath): os.chdir(pkgpath) targets = [ 'build', 'package', 'install', 'clean', 'clean-depends', ] for target in targets: p = subprocess.Popen(...
#!/usr/bin/env python import os import subprocess import sys def build(pkgpath): os.chdir(pkgpath) targets = [ 'build', 'package', 'install', 'clean', 'clean-depends', ] for target in targets: p = subprocess.Popen( ['bmake', target], ...
Add previous exception to the stack
<?php /* * This file is part of the shopery/error-bundle package. * * Copyright (c) 2015 Shopery.com * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Shopery\Bundle\ErrorBundle\Listener; use Symfony\Component\HttpFounda...
<?php /* * This file is part of the shopery/error-bundle package. * * Copyright (c) 2015 Shopery.com * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Shopery\Bundle\ErrorBundle\Listener; use Symfony\Component\HttpFounda...
TEST allink_apps subtree - pulling
# -*- coding: utf-8 -*- from django.contrib import admin from django import forms from parler.admin import TranslatableTabularInline from adminsortable.admin import SortableTabularInline from cms.admin.placeholderadmin import PlaceholderAdminMixin from allink_core.allink_base.admin import AllinkBaseAdminSortable from...
# -*- coding: utf-8 -*- from django.contrib import admin from django import forms from django.utils.translation import ugettext_lazy as _ from parler.admin import TranslatableTabularInline from adminsortable.admin import SortableTabularInline from cms.admin.placeholderadmin import PlaceholderAdminMixin from allink_cor...
Add bodytemplate.md to build artifacts
from setuptools import setup, find_packages if __name__ == "__main__": import falafel setup( name=falafel.NAME, version=falafel.VERSION, description="Insights Application Programming Interface", packages=find_packages(), package_data={"": ["*.json", "RELEASE", "COMMIT",...
from setuptools import setup, find_packages if __name__ == "__main__": import falafel setup( name=falafel.NAME, version=falafel.VERSION, description="Insights Application Programming Interface", packages=find_packages(), package_data={"": ["*.json", "RELEASE", "COMMIT"]...
Fix for localized dates (month names with unicode)
<?php class CRM_Logviewer_Page_LogViewer extends CRM_Core_Page { public function run() { $this->assign('currentTime', date('Y-m-d H:i:s')); $file_log = CRM_Core_Error::createDebugLogger(); $logFileName = $file_log->_filename; $file_log->close(); $this->assign('fileName', $logFileName); $entr...
<?php class CRM_Logviewer_Page_LogViewer extends CRM_Core_Page { public function run() { $this->assign('currentTime', date('Y-m-d H:i:s')); $file_log = CRM_Core_Error::createDebugLogger(); $logFileName = $file_log->_filename; $file_log->close(); $this->assign('fileName', $logFileName); $entr...
Fix not swapping global plugin anonymous consumer id to username
import invariant from 'invariant'; const getConsumerById = (id, consumers) => { const consumer = consumers.find(x => x._info.id === id); invariant(consumer, `Unable to find a consumer for ${id}`); return consumer; }; export default state => { const fixPluginAnonymous = ({ name, attributes: { config,...
import invariant from 'invariant'; const getConsumerById = (id, consumers) => { const consumer = consumers.find(x => x._info.id === id); invariant(consumer, `Unable to find a consumer for ${id}`); return consumer; }; export default state => { const fixPluginAnonymous = ({ name, attributes: { config,...
Fix sourcemaps when in a directory
var autoprefixer = require('autoprefixer-core'); module.exports = function(less) { function AutoprefixProcessor(options) { this.options = options || {}; }; AutoprefixProcessor.prototype = { process: function (css, extra) { var options = this.options; var sourceMap =...
var autoprefixer = require('autoprefixer-core'); module.exports = function(less) { function AutoprefixProcessor(options) { this.options = options || {}; }; AutoprefixProcessor.prototype = { process: function (css, extra) { var options = this.options; var sourceMap =...
Add Inject to default task.
'use strict'; require('dotenv').load(); var pkg = require('./package.json'), path = require('path'); var gulp = require('gulp'), gutil = require('gulp-util'), inject = require('gulp-inject'), plumber = require('gulp-plumber'), pgbuild = require('gulp-phonegap-build'), bowerFiles = require('ma...
'use strict'; require('dotenv').load(); var pkg = require('./package.json'), path = require('path'); var gulp = require('gulp'), gutil = require('gulp-util'), inject = require('gulp-inject'), plumber = require('gulp-plumber'), pgbuild = require('gulp-phonegap-build'), bowerFiles = require('ma...
Fix IDEA warning about unchecked assignment
package com.nirima.jenkins.plugins.docker; import hudson.Extension; import hudson.model.Describable; import hudson.model.Descriptor; import jenkins.model.Jenkins; /** * A simple template storage. */ public class DockerSimpleTemplate extends DockerTemplateBase implements Describable<DockerSimpleTemplate> { publi...
package com.nirima.jenkins.plugins.docker; import hudson.Extension; import hudson.model.Describable; import hudson.model.Descriptor; import jenkins.model.Jenkins; /** * A simple template storage. */ public class DockerSimpleTemplate extends DockerTemplateBase implements Describable<DockerSimpleTemplate> { publi...
Fix userinfo api command (send ok=True)
from twisted.internet import defer import bnw_core.bnw_objects as objs @defer.inlineCallbacks def cmd_userinfo(request, user=''): if not user: defer.returnValue(dict(ok=False, desc='Username required.')) user_obj = yield objs.User.find_one({'name': user}) subscribers = yield objs.Subscription.fin...
from twisted.internet import defer import bnw_core.bnw_objects as objs @defer.inlineCallbacks def cmd_userinfo(request, user=''): if not user: defer.returnValue(dict(ok=False, desc='Username required.')) user_obj = yield objs.User.find_one({'name': user}) subscribers = yield objs.Subscription.fin...