text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix case in repo urls | #!/usr/bin/env php
<?php
set_time_limit(0);
$vendorDir = __DIR__;
$deps = array(
array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
array('knp-menu', 'http://github.com/KnpLabs/KnpMenu.git', 'origin/master'),
);
foreach (... | #!/usr/bin/env php
<?php
set_time_limit(0);
$vendorDir = __DIR__;
$deps = array(
array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
array('knp-menu', 'http://github.com/knplabs/KnpMenu.git', 'origin/master'),
);
foreach (... |
Update the example to j2c the new 0.8+ API.
`j2c.scoped` is gone, Class names are now localized unless `:global()` -ized | import React from 'react';
import j2c from 'j2c';
const styles = j2c.sheet({
'.container': {
'text-align': 'center'
},
'.button': {
'background-color': '#ff0000',
width: '320px',
padding: '20px',
'border-radius': '5px',
border: 'none',
outline: 'none',
':hover': {
color: '#f... | import React from 'react';
import j2c from 'j2c';
const styles = j2c.scoped({
container: {
'text-align': 'center'
},
button: {
'background-color': '#ff0000',
width: '320px',
padding: '20px',
'border-radius': '5px',
border: 'none',
outline: 'none',
':hover': {
color: '#fff',
... |
Add site footer to each documentation generator | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-font-weight/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-font-weight/tachyons-font-weight.min.css', 'utf8')
var ... | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-font-weight/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-font-weight/tachyons-font-weight.min.css', 'utf8')
var ... |
Move javadoc after package to avoid warnings | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you m... | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you m... |
Remove unnecessary cast left over from netty 4 conversion. | package org.apollo.net.codec.game;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import java.util.List;
import org.apollo.game.event.Event;
import org.apollo.net.release.EventDecoder;
import org.apollo.net.release.Release;
/**
* A {@link OneToOneDecoder} that... | package org.apollo.net.codec.game;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import java.util.List;
import org.apollo.game.event.Event;
import org.apollo.net.release.EventDecoder;
import org.apollo.net.release.Release;
/**
* A {@link OneToOneDecoder} that... |
Use weight terminology instead of karma
Signed-off-by: Paul de Wouters <a027184a55211cd23e3f3094f1fdc728df5e0500@hmn.md> | (function ( $ ) {
"use strict";
$(function () {
// catch the upvote/downvote action
$( 'div.comment-weight-container' ).on( 'click', 'span > a', function( e ){
e.preventDefault();
var value = 0;
var comment_id = $(this).data('commentId');
if ( $(this).hasClass( 'vote-up' ) ) {
value = 1;
} el... | (function ( $ ) {
"use strict";
$(function () {
// catch the upvote/downvote action
$( 'div.karma' ).on( 'click', 'span > a', function( e ){
e.preventDefault();
var value = 0;
var comment_id = $(this).data('commentId');
if ( $(this).hasClass( 'add-karma' ) ) {
value = 1;
} else if( $(this).ha... |
Add a wait for component render to webdriver tests | package org.auraframework.perf.test.components;
import org.auraframework.def.ComponentDef;
import org.auraframework.def.DefDescriptor;
import org.auraframework.perf.core.ComponentPerfAbstractTestCase;
import org.openqa.selenium.By;
import java.net.URLEncoder;
import java.util.logging.Logger;
public final class PerfL... | package org.auraframework.perf.test.components;
import java.net.URLEncoder;
import java.util.logging.Logger;
import org.auraframework.def.ComponentDef;
import org.auraframework.def.DefDescriptor;
import org.auraframework.perf.core.ComponentPerfAbstractTestCase;
public final class PerfLoadComponentTest extends Compon... |
Make sure delay/ttr are passed to the adapter | <?php
/**
* This file is part of PMG\Queue
*
* Copyright (c) 2013 PMG Worldwide
*
* @package PMGQueue
* @copyright 2013 PMG Worldwide
* @license http://opensource.org/licenses/MIT MIT
*/
namespace PMG\Queue\Test;
use PMG\Queue\Producer;
class ProducerTest extends \PHPUnit_Framework_TestCase
{
p... | <?php
/**
* This file is part of PMG\Queue
*
* Copyright (c) 2013 PMG Worldwide
*
* @package PMGQueue
* @copyright 2013 PMG Worldwide
* @license http://opensource.org/licenses/MIT MIT
*/
namespace PMG\Queue\Test;
use PMG\Queue\Producer;
class ProducerTest extends \PHPUnit_Framework_TestCase
{
p... |
Stop data flowing off graph | const chart = require('ascii-chart');
function pointsFromBandwidthData(values, numPoints) {
// Define vars
const len = values.length;
const points = [];
let i = 0;
let size;
// Split values into n points
if(numPoints < 2) {
points.push(values);
} else {
if(len % numPoints === 0) {
size ... | const chart = require('ascii-chart');
function pointsFromBandwidthData(values, numPoints) {
// Define vars
const len = values.length;
const points = [];
let i = 0;
let size;
// Split values into n points
if(numPoints < 2) {
points.push(values);
} else {
if(len % numPoints === 0) {
size ... |
[Android] Move content_browsertests to main waterfall/trybots.
It's passing consistently on android_fyi_dbg trybots and on FYI waterfall bots running ICS.
BUG=270144
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/22299007
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@216442 0039d316-1c4b-4281-... | # Copyright (c) 2013 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.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
]
... | # Copyright (c) 2013 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.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
... |
Remove unnessary comments and add author. | /*!
* jQuery Expandable Input Plugin v1.0
* https://github.com/armmer1/expandable-input
*
* Copyright 2014, Nattawat Nonsung
*/
/**
* Use immediately Invoked Function Expression to
* - Prevent conflicting with other libary on alias $
* - Scode varaible to be private
*/
(function( $ ) {
$.fn.expandable = functi... | /**
* Use immediately Invoked Function Expression to
* - Prevent conflicting with other libary on alias $
* - Scode varaible to be private
*/
(function( $ ) {
$.fn.expandable = function(options) {
// Define default setting
var settings = $.extend({
width: 150,
duration: 300
}, options );
var width =... |
Make NameTag available to modules | /*
* Copyright 2014 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | /*
* Copyright 2014 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
Update file transfer example to match updates to filestream | var dropkick = require('dropkick');
var quickconnect = require('rtc-quickconnect');
var fileReader = require('filestream/read');
var fileReceiver = require('filestream/write');
var createDataStream = require('..');
var channels = [];
var peers = [];
var inbound = {};
function prepStream(dc, id) {
createDataStream(dc... | var dropkick = require('dropkick');
var quickconnect = require('rtc-quickconnect');
var fileReader = require('filestream/read');
var fileReceiver = require('filestream/write');
var createDataStream = require('..');
var channels = [];
var peers = [];
var inbound = {};
function prepStream(dc, id) {
createDataStream(dc... |
Edit error message to include ✨ emoji. V important | 'use strict';
const characters = require('./characters');
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json()); //support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true})); //support encoded bodies.
//must say {extended: t... | 'use strict';
const characters = require('./characters');
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json()); //support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true})); //support encoded bodies.
//must say {extended: t... |
Change required privilege of QueryJobQueueAction (SERVER_OPERATION -> PROCESS_MANAGE) | <?php
class QueryJobQueueAction extends ApiActionBase
{
protected static $required_privileges = array(
Auth::PROCESS_MANAGE
);
protected function execute($params)
{
$jobs = Job::select(
array('status >=' => Job::JOB_NOT_ALLOCATED),
array('order' => array('registered_at'))
);
$job_lis... | <?php
class QueryJobQueueAction extends ApiActionBase
{
protected static $required_privileges = array(
Auth::SERVER_OPERATION
);
protected function execute($params)
{
$jobs = Job::select(
array('status >=' => Job::JOB_NOT_ALLOCATED),
array('order' => array('registered_at'))
);
$job_l... |
Modify to pass args to the base class constructor | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import sqlite3
from typing import Optional
from tabledata import NameValidationError # noqa: W0611
class DatabaseError(sqlite3.DatabaseError):
"""
Exception raised for errors that are related to the database.
.. seealso::
... |
Put table into container on admin | <?php
$rank = 1;
include 'includes/sqllogin.php';
$result = mysqli_query($con,"SELECT * FROM `Top Player` ORDER BY Distance DESC");
echo "<div class='container'><table class='table table-striped'>
<tr>
<th>ID</th>
<th>Rank</th>
<th>Player Name</th>
<th>Distance</th>
<th>Edit</th>
<t... | <?php
$rank = 1;
include 'includes/sqllogin.php';
$result = mysqli_query($con,"SELECT * FROM `Top Player` ORDER BY Distance DESC");
echo "<table class='table table-striped'>
<tr>
<th>ID</th>
<th>Rank</th>
<th>Player Name</th>
<th>Distance</th>
<th>Edit</th>
<th>Delete</th>
</tr>... |
Implement UpperCamelCase name check for protocols | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... |
Use getTableName() so it works with prefixes
Installs that use a table prefix like "mage_" do not work with the current code. It produces the following error...
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'core_config_data' doesn't exist | <?php
/**
* Amazon Payments
*
* @category Amazon
* @package Amazon_Payments
* @copyright Copyright (c) 2014 Amazon.com
* @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
*/
$installer = $this;
$installer->startSetup();
$db = $installer->getConnection();
// Encrypt... | <?php
/**
* Amazon Payments
*
* @category Amazon
* @package Amazon_Payments
* @copyright Copyright (c) 2014 Amazon.com
* @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
*/
$installer = $this;
$installer->startSetup();
$db = $installer->getConnection();
// Encrypt... |
Move getPrediction function to controller | const Model = require('../../database/models/model.js');
const Redis = require('../../database/redis/redis.js')
const axios = require('axios');
module.exports = {
getHistoricalData: (req, res) => {
Model.historicalGraphData.findOne({where: {currency: req.query[0]}})
.then(graph => {
const reformatted =... | const Model = require('../../database/models/model.js');
const Redis = require('../../database/redis/redis.js')
const axios = require('axios');
module.exports = {
getHistoricalData: (req, res) => {
Model.historicalGraphData.findOne({where: {currency: req.query[0]}})
.then(graph => {
const reformatted =... |
Fix hard coded site URL in @username mention | <?php
namespace Phosphorum\Markdown;
use Ciconia\Common\Text;
use Ciconia\Extension\ExtensionInterface;
use Ciconia\Markdown;
use Phalcon\DI\Injectable;
/**
* Class MentionExtension
*
* @package Phosphorum\Markdown
*/
class MentionExtension extends Injectable implements ExtensionInterface
{
/**
* {@inh... | <?php
namespace Phosphorum\Markdown;
use Ciconia\Common\Text;
use Ciconia\Extension\ExtensionInterface;
use Ciconia\Markdown;
/**
* Class MentionExtension
*
* @package Phosphorum\Markdown
*/
class MentionExtension implements ExtensionInterface
{
/**
* {@inheritdoc}
*/
public function register(... |
Exclude tests from coverage reports | <?php
PHPUnit_Util_Filter::addDirectoryToFilter(__DIR__ . '/..');
//require_once(dirname(__FILE__) . '/importexport.php');
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__) . '/../../src/jackalope/autoloader.php';
abstract class jackalope_baseSuite extends PHPUnit_Framework_TestSuite {
protecte... | <?php
//require_once(dirname(__FILE__) . '/importexport.php');
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__) . '/../../src/jackalope/autoloader.php';
abstract class jackalope_baseSuite extends PHPUnit_Framework_TestSuite {
protected $path = '';
protected $configKeys = array('jcr.url', 'j... |
Use threaded_map to speed up refunds | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
from gratipay.billing.payday import threaded_map
import csv, os, requests
import threading
url = 'https://api.balancedpayments.com/debits/{}/refunds'
balanced_api_secret = os.environ['BALANCED_API_SECRET']
inp... | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
balanced_api_secret = os.environ['BALANCED_API_SECRET']
inp = csv.reader(open('refunds.csv'))
out = csv.writer(open('refunds.... |
Use connection string returned by PHP, to match mailbox name properly | <?php
namespace Ddeboer\Imap;
class Server
{
protected $hostname;
protected $port;
protected $connection;
protected $mailboxes;
public function __construct($hostname, $port = '993')
{
$this->server = '{' . $hostname . ':' . $port . '/imap}';
}
public function authenticate($us... | <?php
namespace Ddeboer\Imap;
class Server
{
protected $hostname;
protected $port;
protected $connection;
protected $mailboxes;
public function __construct($hostname, $port = '993')
{
$this->server = '{' . $hostname . ':' . $port . '/imap}';
}
public function authenticate($us... |
Fix 12PM/AM displaying as 00 | import React from 'react';
var Time = (props) => {
let time = props.time;
let hour = time.hour;
if (!props.hourFormat24 && time.pm) {
let pad = function (n) {
return (n < 10) ? `0${n}` : n.toString();
};
hour -= 12;
hour = pad(hour === 0 ? 12 : hour);
}
... | import React from 'react';
var Time = (props) => {
let time = props.time;
let hour = time.hour;
if (!props.hourFormat24 && time.pm) {
let pad = function (n) {
return (n < 10) ? `0${n}` : n.toString();
};
hour = pad(hour -= 12);
}
return (
<h1 classNa... |
Fix bug in prefilling IDE. | "use strict";
var ace = require('brace');
require('brace/theme/tomorrow');
require('brace/mode/javascript');
var React = require('react/addons');
var IdeComponent = React.createClass({
editor: null,
componentDidMount: function () {
this.editor = ace.edit(this.refs.ide.getDOMNode());
this.editor.setTheme(... | "use strict";
var ace = require('brace');
require('brace/theme/tomorrow');
require('brace/mode/javascript');
var React = require('react/addons');
var IdeComponent = React.createClass({
editor: null,
componentDidMount: function () {
this.editor = ace.edit(this.refs.ide.getDOMNode());
this.editor.setTheme(... |
Print the header at the right place. | package main
import (
"bsearch/index"
"bsearch/ops"
"fmt"
"os"
"flag"
)
func usage() {
fmt.Fprintf(os.Stderr, "usage: bsearch <path to index blob>\n")
flag.PrintDefaults()
os.Exit(1)
}
func main() {
flag.Parse()
if flag.NArg() != 1 {
usage()
}
dbname := flag.Arg(0)
in, err := index.Open(dbname)
if er... | package main
import (
"bsearch/index"
"bsearch/ops"
"fmt"
"os"
"flag"
)
func usage() {
fmt.Fprintf(os.Stderr, "usage: bsearch <path to index blob>\n")
flag.PrintDefaults()
os.Exit(1)
}
func main() {
flag.Parse()
if flag.NArg() != 1 {
usage()
}
dbname := flag.Arg(0)
in, err := index.Open(dbname)
if er... |
Add a drop table for testing. | import os
from flask import Flask
import psycopg2
from urllib.parse import urlparse
url = urlparse(os.environ["DATABASE_URL"])
# Connect to a database
conn = psycopg2.connect(
database=url.path[1:],
user=url.username,
password=url.password,
host=url.hostname,
port=url.port
)
# Open a cursor to pe... | import os
from flask import Flask
import psycopg2
from urllib.parse import urlparse
url = urlparse(os.environ["DATABASE_URL"])
# Connect to a database
conn = psycopg2.connect(
database=url.path[1:],
user=url.username,
password=url.password,
host=url.hostname,
port=url.port
)
# Open a cursor to pe... |
Add language href to link | <?php
/**
* Class LanguageLink | LanguageLink.php
* @package Faulancer\View\Helper
* @author Florian Knapp <office@florianknapp.de>
*/
namespace Faulancer\View\Helper;
use Faulancer\Service\Config;
use Faulancer\View\AbstractViewHelper;
/**
* Class LanguageLink
*/
class LanguageLink extends AbstractViewHelper
... | <?php
/**
* Class LanguageLink | LanguageLink.php
* @package Faulancer\View\Helper
* @author Florian Knapp <office@florianknapp.de>
*/
namespace Faulancer\View\Helper;
use Faulancer\Service\Config;
use Faulancer\View\AbstractViewHelper;
/**
* Class LanguageLink
*/
class LanguageLink extends AbstractViewHelper
... |
Add correct flag to render different layout. | import React, { PropTypes } from 'react';
import { tile as tileConstants } from './constants';
const styles = {
wrapper: {
width: tileConstants.width,
height: tileConstants.height,
border: '1px solid #FFD1AA',
position: 'absolute',
display: 'flex',
flexDirection: 'column',
justifyContent... | import React, { PropTypes } from 'react';
import { tile as tileConstants } from './constants';
const styles = {
wrapper: {
width: tileConstants.width,
height: tileConstants.height,
border: '1px solid #FFD1AA',
backgroundColor: '#226666',
position: 'absolute',
display: 'flex',
flexDirecti... |
Fix invalid ref, improve error message | /** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
var patches = require('./patches');
var clone = require('./clone');
var InvalidPatchOperationError = require('./InvalidPatchOperationError');
exports.apply = patch;
exports.applyInPlac... | /** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
var patches = require('./patches');
var clone = require('./clone');
var InvalidPatchOperationError = require('./InvalidPatchOperationError');
exports.apply = patch;
exports.applyInPlac... |
Use normal exports here, not messing with the modules.exports | /*
* Licensed to Cloudkick, Inc ('Cloudkick') under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Cloudkick licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not us... | /*
* Licensed to Cloudkick, Inc ('Cloudkick') under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Cloudkick licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not us... |
fix(envify): Apply envify globally so that local react files get processed by it. | const babelify = require('babelify')
const envify = require('envify/custom')
const markdown = require('browserify-markdown')
const through = require('through2')
const YAML = require('yamljs')
const babelConfig = require('./babel-config')
const util = require('./util')
module.exports = function transform ({
config,
... | const babelify = require('babelify')
const envify = require('envify/custom')
const markdown = require('browserify-markdown')
const through = require('through2')
const YAML = require('yamljs')
const babelConfig = require('./babel-config')
const util = require('./util')
module.exports = function transform ({
config,
... |
Fix non-chanops not being able to query the topic | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class TopicLockMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "TopicLoc... |
[core] GraphQL: Remove special handling of 404 in graphql list command | module.exports = async function listApisAction(args, context) {
const {apiClient, output, chalk} = context
const client = apiClient({
requireUser: true,
requireProject: true
})
let endpoints
try {
endpoints = await client.request({
url: `/apis/graphql`,
method: 'GET'
})
} catch... | module.exports = async function listApisAction(args, context) {
const {apiClient, output, chalk} = context
const client = apiClient({
requireUser: true,
requireProject: true
})
let endpoints
try {
endpoints = await client.request({
url: `/apis/graphql`,
method: 'GET'
})
} catch... |
Fix snippet URL rules to use mountpoints' endpoint suffix | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... |
Add initial default plugin options | /*
* grunt-xcode
* https://github.com/matiassingers/grunt-xcode
*
* Copyright (c) 2014 Matias Singers
* Licensed under the MIT license.
*/
'use strict';
var Promise = require('bluebird');
var exec = Promise.promisify(require('child_process').exec);
String.prototype.format = function() {
var formatted = this... | /*
* grunt-xcode
* https://github.com/matiassingers/grunt-xcode
*
* Copyright (c) 2014 Matias Singers
* Licensed under the MIT license.
*/
'use strict';
var Promise = require('bluebird');
var exec = Promise.promisify(require('child_process').exec);
String.prototype.format = function() {
var formatted = this... |
Add socket check to avoid uninstantiated error | import config from '../config';
import createQueryString from './createQueryString';
import WebSocketClient from 'websocket.js';
let socket;
export function sendMessage(type, payload) {
if (socket) {
if (socket.ws.readyState === 0) {
socket.onopen = () => {
socket.send(`${type}:${payload}`);
... | import config from '../config';
import createQueryString from './createQueryString';
import WebSocketClient from 'websocket.js';
let socket;
export function sendMessage(type, payload) {
if (socket.ws.readyState === 0) {
socket.onopen = () => {
socket.send(`${type}:${payload}`);
};
} else if (socket.... |
Add Repository.triggers backref to look up Triggers | from __future__ import unicode_literals
from django.db import models
TRIGGER_TYPES = (
('manual', 'Manual'),
('commit', 'Commit'),
('tag', 'Tag'),
('pr', 'Pull Request'),
)
class Trigger(models.Model):
name = models.CharField(max_length=255)
repo = models.ForeignKey('github.Repository', relat... | from __future__ import unicode_literals
from django.db import models
TRIGGER_TYPES = (
('manual', 'Manual'),
('commit', 'Commit'),
('tag', 'Tag'),
('pr', 'Pull Request'),
)
class Trigger(models.Model):
name = models.CharField(max_length=255)
repo = models.ForeignKey('github.Repository')
t... |
Exclude 'Intl' from new-cap exception | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
extends: 'airbnb-base',
// required to lint *.vue files
plugins: [
'html'
],
// check if imports actually resolve
'settings': {
'import/resolver': {
'webpack': {
'config': 'build... | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
extends: 'airbnb-base',
// required to lint *.vue files
plugins: [
'html'
],
// check if imports actually resolve
'settings': {
'import/resolver': {
'webpack': {
'config': 'build... |
Use existing method to create an AddFileInterface | // 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.filedistribution;
import com.google.inject.Inject;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.application.api.FileRegistry;
import com.ya... | // 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.filedistribution;
import com.google.inject.Inject;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.application.api.FileRegistry;
import com.ya... |
Reorder source and author links | import React, { Component, PropTypes } from 'react'
import { Link } from 'react-router'
import 'normalize.css/normalize.css'
import '../styles/defaults.scss'
import classNames from './App.scss'
import { trackTiming } from '../analytics'
import { APP_NAME, AUTHOR_URL, SOURCE_URL, SEPARATOR } from '../config'
export de... | import React, { Component, PropTypes } from 'react'
import { Link } from 'react-router'
import 'normalize.css/normalize.css'
import '../styles/defaults.scss'
import classNames from './App.scss'
import { trackTiming } from '../analytics'
import { APP_NAME, AUTHOR_URL, SOURCE_URL, SEPARATOR } from '../config'
export de... |
Add warning for unimplemented adapter methods | var get = Ember.get;
DS.Serializer = Ember.Object.extend({
toJSON: function(record, options) {
options = options || {};
var hash = {};
this.addAttributes(hash, record);
if (options.includeId) {
this.addId(hash, record);
}
this.addRelationships(hash, record);
return hash;
},
... | var get = Ember.get;
DS.Serializer = Ember.Object.extend({
toJSON: function(record, options) {
options = options || {};
var hash = {};
this.addAttributes(hash, record);
if (options.includeId) {
this.addId(hash, record);
}
this.addRelationships(hash, record);
return hash;
},
... |
Rename object to entity in interface. | /*
* Copyright 2019 Google LLC. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | /*
* Copyright 2019 Google LLC. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... |
Replace parsing with Python's ast
Allows greater flexibility and syntax checks | #!/usr/bin/env python
# vim: set fileencoding=UTF-8 :
import ast
from ..semantics import mpq
from .common import OPERATORS, ADD_OP, MULTIPLY_OP
def try_to_number(s):
try:
return mpq(s)
except (ValueError, TypeError):
return s
OPERATOR_MAP = {
ast.Add: ADD_OP,
ast.Mult: MULTIPLY_OP... | #!/usr/bin/env python
# vim: set fileencoding=UTF-8 :
from ..semantics import mpq
from .common import OPERATORS, ADD_OP, MULTIPLY_OP
def try_to_number(s):
try:
return mpq(s)
except (ValueError, TypeError):
return s
def _parse_r(s):
s = s.strip()
bracket_level = 0
operator_pos =... |
Correct logic for is isCategoryNameValidForCategory()
Long.equals(Long) isn't equals to (Long == Long)?
OPEN - task 54: Create Category CRUD packages
http://github.com/DevOpsDistilled/OpERP/issues/issue/54 | package devopsdistilled.operp.server.data.service.items.impl;
import javax.inject.Inject;
import org.springframework.stereotype.Service;
import devopsdistilled.operp.server.data.entity.items.Category;
import devopsdistilled.operp.server.data.repo.items.CategoryRepository;
import devopsdistilled.operp.server.data.ser... | package devopsdistilled.operp.server.data.service.items.impl;
import javax.inject.Inject;
import org.springframework.stereotype.Service;
import devopsdistilled.operp.server.data.entity.items.Category;
import devopsdistilled.operp.server.data.repo.items.CategoryRepository;
import devopsdistilled.operp.server.data.ser... |
Add json reader/writer for websocket connection | package websocket
import(
"net/http"
"log"
"github.com/gorilla/websocket"
)
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
return true
},
}
type WebSocketHandler struct {}
type Data struct {
Id int `json:"id"`
Test interface{} `json:"test"`
}
func N... | package websocket
import(
"net/http"
"log"
"github.com/gorilla/websocket"
)
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
return true
},
}
type WebSocketHandler struct {}
func NewWebSocketHandler() *WebSocketHandler {
return &WebSocketHandler{}
}
func ... |
Fix to count 0 on empty files and (amount of line-breaks + 1) on non-empty files | package bogush;
import java.io.*;
import java.nio.file.Path;
class LineCounter {
static int count(Path file) throws IOException {
try (InputStream is = new BufferedInputStream(new FileInputStream(file.toFile()))) {
boolean empty = true;
byte bytes[] = new byte[1024];
in... | package bogush;
import java.io.*;
import java.nio.file.Path;
class LineCounter {
static int count(Path file) throws IOException {
try (InputStream is = new BufferedInputStream(new FileInputStream(file.toFile()))) {
boolean empty = true;
byte bytes[] = new byte[1024];
in... |
Fix typo on last commit | <?php
namespace RocketTheme\Toolbox\ArrayTraits;
/**
* Implements getters and setters.
*
* @package RocketTheme\Toolbox\ArrayTraits
* @author RocketTheme
* @license MIT
*/
trait NestedArrayAccessWithGetters
{
use NestedArrayAccess;
/**
* Magic setter method
*
* @param mixed $offset Asset ... | <?php
namespace RocketTheme\Toolbox\ArrayTraits;
/**
* Implements getters and setters.
*
* @package RocketTheme\Toolbox\ArrayTraits
* @author RocketTheme
* @license MIT
*/
trait Getters
{
use NestedArrayAccess;
/**
* Magic setter method
*
* @param mixed $offset Asset name value
* @pa... |
Update icat API functions to new location. Fix made by someone else. | <?php
require_once 'icat.php';
?>
<!doctype html>
<html>
<head>
<title>Scoreboard</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="katalyze/css/katalyze.css" />
<meta charset="utf-8">
<style type="text/css">
h1 { text-align: center; margin: 0; }
</style>
... | <?php
require_once 'icat.php';
?>
<!doctype html>
<html>
<head>
<title>Scoreboard</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="katalyze/css/katalyze.css" />
<meta charset="utf-8">
<style type="text/css">
h1 { text-align: center; margin: 0; }
</style>
... |
Refactor create english superset code to create english superset dictionaries in batches of 10K. Also re-include untranslated words. | import optparse
import os
optparser = optparse.OptionParser()
optparser.add_option("-d", "--directory", dest="directory", default="dictionaries/", help="Directory with dictionaries")
(opts, _) = optparser.parse_args()
full_path = os.path.abspath(opts.directory)
all_english_words = set()
for filename in os.listdir(fu... | import optparse
import os
optparser = optparse.OptionParser()
optparser.add_option("-d", "--directory", dest="directory", default="dictionaries/", help="Directory with dictionaries")
(opts, _) = optparser.parse_args()
full_path = os.path.abspath(opts.directory)
all_english_words = set()
for filename in os.listdir(fu... |
Add long description for PyPI | #!/usr/bin/env python
from os import environ
from setuptools import Extension, find_packages, setup
# Opt-in to building the C extensions for Python 2 by setting the
# ENABLE_DJB_HASH_CEXT environment variable
if environ.get('ENABLE_DJB_HASH_CEXT'):
ext_modules = [
Extension('cdblib._djb_hash', sources=['... | #!/usr/bin/env python
from os import environ
from setuptools import Extension, find_packages, setup
# Opt-in to building the C extensions for Python 2 by setting the
# ENABLE_DJB_HASH_CEXT environment variable
if environ.get('ENABLE_DJB_HASH_CEXT'):
ext_modules = [
Extension('cdblib._djb_hash', sources=['... |
Fix date to epoch converter to timestamp at exactly midnight | # For now I am assuming the investment date will be returned from the db
# as a string yyyy-mm-dd, representing the day the trend was purchased in UTC time
#!/usr/bin/env python3
from datetime import datetime, timezone, timedelta
import pytz
def get_start_times(date):
"""
date: an epoch integer representin... | # For now I am assuming the investment date will be returned from the db
# as a string yyyy-mm-dd, representing the day the trend was purchased in UTC time
#!/usr/bin/env python3
from datetime import datetime, timedelta
import pytz
def get_start_times(date):
"""
date: an epoch integer representing the date... |
Fix test due to addition of coeff property
Address #49
Add fftshift to test coefficients as model.coeff now returns the
shifted real versions. | from pymks import MKSRegressionModel
import numpy as np
def test():
Nbin = 2
Nspace = 81
Nsample = 400
def filter(x):
return np.where(x < 10,
np.exp(-abs(x)) * np.cos(x * np.pi),
np.exp(-abs(x - 20)) * np.cos((x - 20) * np.pi))
coeff = np.l... | from pymks import MKSRegressionModel
import numpy as np
def test():
Nbin = 2
Nspace = 81
Nsample = 400
def filter(x):
return np.where(x < 10,
np.exp(-abs(x)) * np.cos(x * np.pi),
np.exp(-abs(x - 20)) * np.cos((x - 20) * np.pi))
coeff = np.l... |
Set brand to 'New Item', set barcode if given, link to vendor items | <?
include '../scat.php';
include '../lib/item.php';
$code= $_REQUEST['code'];
$name= $_REQUEST['name'];
$msrp= $_REQUEST['retail_price'];
if (!$code)
die_jsonp('Must specify a code.');
if (!$name)
die_jsonp('Must specify a name.');
if (!$msrp)
die_jsonp('Must specify a price.');
$code= $db->escape($code);
$na... | <?
include '../scat.php';
include '../lib/item.php';
$code= $_REQUEST['code'];
$name= $_REQUEST['name'];
$msrp= $_REQUEST['retail_price'];
if (!$code)
die_jsonp('Must specify a code.');
if (!$name)
die_jsonp('Must specify a name.');
if (!$msrp)
die_jsonp('Must specify a price.');
$code= $db->escape($code);
$na... |
Add more precise type annotation | <?php declare(strict_types=1);
namespace Imjoehaines\Flowder\Loader;
final class CachingLoader implements LoaderInterface
{
/**
* The array of cached data
*
* @var array<string, array<string, iterable>>
*/
private $cache = [];
/**
* A "real" loader instance that actually does the... | <?php declare(strict_types=1);
namespace Imjoehaines\Flowder\Loader;
final class CachingLoader implements LoaderInterface
{
/**
* The array of cached data
*
* @var array
*/
private $cache = [];
/**
* A "real" loader instance that actually does the loading
*
* @var Loade... |
Fix IE bug when calculating displayName
IE does not have Function.prototype.bind. Supply a super-generic
fallback of "Component" so that a String is always returned. | import React, { PropTypes } from "react"
export const nameWithContext = (Lower, prop = "name") => {
const getDisplayName = (component) => component.displayName || component.name || "Component"
const buildInputName = (namespaces, name = "") => (
[ ...namespaces, name ].map((field, index) => ( index === 0 ? fi... | import React, { PropTypes } from "react"
export const nameWithContext = (Lower, prop = "name") => {
const getDisplayName = (Lower) => ((Lower.displayName || Lower.name).replace(/Tag$/, ""))
const buildInputName = (namespaces, name = "") => (
[ ...namespaces, name ].map((field, index) => ( index === 0 ? field... |
Rename program to string in tokenize | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(string):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x ... | # Kimi language interpreter in Python 3
# Anjana Vakil
# http://www.github.com/vakila/kimi
import sys
def tokenize(program):
'''Take a Kimi program as a string, return the tokenized program as a list of strings.
>>> tokenize("(+ 1 2)")
['(', '+', '1', '2', ')']
>>> tokenize("(define square (lambda x... |
Fix warning ActionBarActivity is deprecated. Replace ActionBarActivity from new project template with AppCompatActivity.
References
http://stackoverflow.com/questions/29890530/actionbaractivity-is-deprecated-android-studio?rq=1
http://android-developers.blogspot.com/2015/04/android-support-library-221.html | package com.beepscore.android.sunshine;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
public class DetailActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCr... | package com.beepscore.android.sunshine;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class DetailActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCr... |
Copy service worker to root path. | var baseConfig = require('./webpack.config.common.js');
var webpack = require('webpack');
const merge = require('webpack-merge');
var path = require('path');
var OfflinePlugin = require('offline-plugin');
module.exports = merge(baseConfig, {
output: {
path: path.resolve(__dirname, './dist/static/'),
filenam... | var baseConfig = require('./webpack.config.common.js');
var webpack = require('webpack');
const merge = require('webpack-merge');
var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var OfflinePlugin = require('offline-plugin');
module.exports = merge(baseConfig, {
output: {
path... |
Use category, not category title for list_filter | # -*- coding: utf-8 -*-
from django.contrib import admin
from blanc_pages.admin import BlancPageAdminMixin
from .models import Category, Event
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
search_fields = ('title',)
prepopulated_fields = {
'slug': ('title',)
}
@admin.regist... | # -*- coding: utf-8 -*-
from django.contrib import admin
from blanc_pages.admin import BlancPageAdminMixin
from .models import Category, Event
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
search_fields = ('title',)
prepopulated_fields = {
'slug': ('title',)
}
@admin.regist... |
Use error response when request fails | package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"regexp"
"time"
)
func main() {
fmt.Println("Verifying URLs..")
readmeFile, err := ioutil.ReadFile("README.md")
if err != nil {
fmt.Println("Could not find README!")
os.Exit(1)
}
fileContent := string(readmeFile)
urlElementRegex := regexp.MustC... | package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"regexp"
"time"
)
func main() {
fmt.Println("Verifying URLs..")
readmeFile, err := ioutil.ReadFile("README.md")
if err != nil {
fmt.Println("Could not find README!")
os.Exit(1)
}
fileContent := string(readmeFile)
urlElementRegex := regexp.MustC... |
Prepare once plug-ins are loaded
With the new version of the listen hook. | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... |
Add function to get list of objects having only userNames | const sqlite3 = require('sqlite3').verbose()
const dbName = 'chat.sqlite'
const db = new sqlite3.Database(dbName)
db.serialize(() => {
const sql = `
CREATE TABLE IF NOT EXISTS users
(id integer primary key AUTOINCREMENT, phoneNumber, userName)
`;
db.run(sql)
})
class Users {
static all (cb) {
db.all('S... | const sqlite3 = require('sqlite3').verbose()
const dbName = 'chat.sqlite'
const db = new sqlite3.Database(dbName)
db.serialize(() => {
const sql = `
CREATE TABLE IF NOT EXISTS users
(id integer primary key AUTOINCREMENT, phoneNumber, userName)
`;
db.run(sql)
})
class Users {
static all(cb) {
db.all('SE... |
test: Write test to catch invalid inserts | 'use strict';
const assert = require('assert');
const Event = require('../db/models/Event');
describe('Validation of User records', () => {
// Tests that records for which no `name` property is defined are marked invalid
// and return a validation fallback message:
it('should require a name for every event', ... | 'use strict';
const assert = require('assert');
const Event = require('../db/models/Event');
describe('Validation of User records', () => {
it('should require a name for every event', () => {
const validationEvt = new Event({ name: undefined }),
validationResult = validationEvt.validateSync(),
... |
Make sure we can add activities to initiatives in admin | from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from bluebottle.fsm.effects import Effect
from bluebottle.activities.models import Organizer, OrganizerContribution
class CreateOrganizer(Effect):
"Create an organizer for the activity"
display = False
def po... | from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from bluebottle.fsm.effects import Effect
from bluebottle.activities.models import Organizer, OrganizerContribution
class CreateOrganizer(Effect):
"Create an organizer for the activity"
def post_save(self, **kwarg... |
Remove support for deprecated `captureError` (now `...Exception`) | 'use strict'
var raven = require('raven')
exports.register = function (server, options, next) {
var client = new raven.Client(options.dsn, options.client)
server.expose('client', client)
server.on('request-error', function (request, err) {
client.captureException(err, {
extra: {
timestamp: req... | 'use strict'
var raven = require('raven')
exports.register = function (server, options, next) {
var client = new raven.Client(options.dsn, options.client)
server.expose('client', client)
server.on('request-error', function (request, err) {
(client.captureException || client.captureError).call(client, err, {... |
Fix missing parameter in docs of setChannel function | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Channel\Model;
use Sylius\Component\Resource\Model\CodeAwareInterface;
use... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Channel\Model;
use Sylius\Component\Resource\Model\CodeAwareInterface;
use... |
[ALIEN-2755] Allow specific handling of docker image artifact update in the editor, util fix. | package org.alien4cloud.tosca.utils;
import static alien4cloud.utils.AlienUtils.safe;
import java.util.Map;
import java.util.Optional;
import org.alien4cloud.tosca.model.definitions.ImplementationArtifact;
import org.alien4cloud.tosca.model.definitions.Interface;
import org.alien4cloud.tosca.model.definitions.Operat... | package org.alien4cloud.tosca.utils;
import org.alien4cloud.tosca.model.definitions.ImplementationArtifact;
import org.alien4cloud.tosca.model.definitions.Interface;
import org.alien4cloud.tosca.model.definitions.Operation;
import java.util.Map;
import java.util.Optional;
import static alien4cloud.utils.AlienUtils.s... |
Add debugging info to the main test | package main_test
import (
"os"
"os/exec"
"path"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestMain(t *testing.T) {
RegisterFailHandler(Fail)
dir, err := os.Getwd()
Expect(err).NotTo(HaveOccurred())
cmd := exec.Command("go", "build", "-o", path.Join(dir, "..", "fixtures", "pl... | package main_test
import (
"os"
"os/exec"
"path"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestMain(t *testing.T) {
RegisterFailHandler(Fail)
dir, err := os.Getwd()
Expect(err).NotTo(HaveOccurred())
cmd := exec.Command("go", "build", "-o", path.Join(dir, "..", "fixtures", "pl... |
Simplify assertion from to.not.be.empty to to.exist | import {List} from 'immutable';
import {expect} from 'chai';
import {createPlayer} from '../src/core';
describe('createPlayer', () => {
it('sets name properly', () => {
const name = 'someName';
const player = createPlayer(name);
expect(player.name).to.equal(name);
... | import {List} from 'immutable';
import {expect} from 'chai';
import {createPlayer} from '../src/core';
describe('createPlayer', () => {
it('sets name properly', () => {
const name = 'someName';
const player = createPlayer(name);
expect(player.name).to.equal(name);
... |
Bump version to 1.0.1 for unit test fix. | import os.path
VERSION = (1, 0, 1, 'stable')
def get_version():
"""
Return the version as a string. If this is flagged as a development
release and mercurial can be loaded the specifics about the changeset
will be appended to the version string.
"""
if 'dev' in VERSION:
t... | import os.path
VERSION = (1, 0, 0, 'stable')
def get_version():
"""
Return the version as a string. If this is flagged as a development
release and mercurial can be loaded the specifics about the changeset
will be appended to the version string.
"""
if 'dev' in VERSION:
t... |
Remove useless comment about returning a null mouse. Access mouse through ForPlay.mouse().
git-svn-id: 53b953c7be2d47dd5cb9b5c1ab101a1158da7762@77 a6a9a2b1-fcd7-f629-9329-86f1cfbb9621 | /**
* Copyright 2010 The ForPlay Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | /**
* Copyright 2010 The ForPlay Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
Allow deprecated warning to have one prop
and not a new prop | /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
/* eslint-disable import/no-mutable-exports */
// This function will deliver an error message to the browser console about the removal of a property.
import warning fro... | /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
/* eslint-disable import/no-mutable-exports */
// This function will deliver an error message to the browser console about the removal of a property.
import warning fro... |
Set svn:eol-style='native' on some text files that were lacking it.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@855475 13f79535-47bb-0310-9956-ffa450edef68 | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) file>" % sys.arg... | #
# strip-po-charset.py
#
import sys, string
def strip_po_charset(inp, out):
out.write(string.replace(inp.read(),
"\"Content-Type: text/plain; charset=UTF-8\\n\"\n",""))
def main():
if len(sys.argv) != 3:
print "Usage: %s <input (po) file> <output (spo) fi... |
Remove printStackTrace from Ant task
Change StopZapTask to remove the call to Throwable.printStackTrace(),
the exception is wrapped and thrown for the caller to handle (e.g. Ant
which already outputs the stack trace). | /*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* Copyright 2011 The Zed Attack Proxy Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... | /*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* Copyright 2011 The Zed Attack Proxy Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... |
Check that reasons length is greater than 0 | 'use strict';
/* Controllers */
angular.module('nodeCheck.controllers', []).
controller('AppCtrl', function($scope, $http) {
$scope.website = {url: ''};
$scope.displayResult = false;
$scope.displayError = false;
$scope.check = function() {
var url = $scope.website.url;
if (url !== "") {
... | 'use strict';
/* Controllers */
angular.module('nodeCheck.controllers', []).
controller('AppCtrl', function($scope, $http) {
$scope.website = {url: ''};
$scope.displayResult = false;
$scope.displayError = false;
$scope.check = function() {
var url = $scope.website.url;
if (url !== "") {
... |
Update to use all the test | import numpy as np
import pandas as pd
import sys
import os
from sklearn.externals import joblib
from sklearn.ensemble import RandomForestClassifier
scriptpath = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../'
sys.path.append(os.path.abspath(scriptpath))
import utils
parameter_str = '_'.join(['top', str(utils... | import numpy as np
import pandas as pd
import sys
import os
from sklearn.externals import joblib
from sklearn.ensemble import RandomForestClassifier
scriptpath = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../'
sys.path.append(os.path.abspath(scriptpath))
import utils
parameter_str = '_'.join(['top', str(utils... |
[API][Promotion] Index coupons only for requested promotion | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Promotion\Repository;
use Doctrine\ORM\QueryBuil... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Promotion\Repository;
use Doctrine\ORM\QueryBuil... |
Update the background printer widget to handle the new system | // command: 'cat ./stolaf-base/printer-data-url.txt | xargs curl --silent',
command: 'bash ./stolaf-base/snmpGet.sh',
refreshFrequency: 60000,
lastUpdateTime: undefined,
style: [
"bottom: 0",
"left: 75%",
"width: 25%",
"text-align: center",
"border: 0",
"height: 3%",
"vertical-align: middle",
"color: rgba(255... | // command: 'cat ./stolaf-base/printer-data-url.txt | xargs curl --silent',
command: 'cat ./stolaf-base/printerstatus.csv',
refreshFrequency: 60000,
lastUpdateTime: undefined,
style: [
"bottom: 0",
"left: 75%",
"width: 25%",
"text-align: center",
"border: 0",
"height: 3%",
"vertical-align: middle",
"color: rg... |
Make NavigationTree expand by default | package devopsdistilled.operp.client.main;
import javax.inject.Inject;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import devopsdistilled.operp.client.abstrac... | package devopsdistilled.operp.client.main;
import javax.inject.Inject;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import devopsdistilled.operp.client.abstrac... |
test: Check handling duplicate key for instance links | """Verifies that instance_links are being retrieved properly from LINKS. Verifies that app_data.json.j2
contains the instance link information"""
from unittest import mock
from foremast.plugin_manager import PluginManager
MANAGER = PluginManager('app', 'aws')
PLUGIN = MANAGER.load()
@mock.patch('foremast.app.aws.ba... | """Verifies that instance_links are being retrieved properly from LINKS. Verifies that app_data.json.j2
contains the instance link information"""
from unittest import mock
from foremast.plugin_manager import PluginManager
MANAGER = PluginManager('app', 'aws')
PLUGIN = MANAGER.load()
@mock.patch('foremast.app.aws.ba... |
Make sure expression operator precedence is correct | #
# Copyright (C) 2014-2017 S[&]T, The Netherlands.
#
from __future__ import absolute_import, division, print_function
import logging
import muninn
from .utils import create_parser, parse_args_and_run
def pull(args):
with muninn.open(args.archive) as archive:
verify_hash = True if args.verify_hash els... | #
# Copyright (C) 2014-2017 S[&]T, The Netherlands.
#
from __future__ import absolute_import, division, print_function
import logging
import muninn
from .utils import create_parser, parse_args_and_run
def pull(args):
with muninn.open(args.archive) as archive:
verify_hash = True if args.verify_hash els... |
Use fafault values as a constats | package kfs.springutils;
import java.io.IOException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
*
* @author pavedrim
*/
public class RunApp {
public static String defaultContextFile = "appContext.xml";
public static String defaultPidFilePropertyName = "pidfile";
... | package kfs.springutils;
import java.io.IOException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
*
* @author pavedrim
*/
public class RunApp {
public static void run(String profileName) {
run(profileName, "pidfile", "appContext.xml");
}
public static voi... |
Fix: Add type id attribute in modeling | package sizebay.catalog.client.model;
import java.util.*;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.*;
@Getter
@Setter
public class Modeling {
private Long id;
private String name;
private Gender gender;
private String gMerchantBrandName;
private String gMerchantAgeGroup;
priv... | package sizebay.catalog.client.model;
import java.util.*;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.*;
@Getter
@Setter
public class Modeling {
private Long id;
private String name;
private Gender gender;
private String gMerchantBrandName;
private String gMerchantAgeGroup;
priv... |
Revert "Make SFC test a python call to main()"
This reverts commit d5820bef80ea4bdb871380dbfe41db12290fc5f8.
Robot test runs before SFC test and it imports
https://github.com/robotframework/SSHLibrary
which does a monkey patching in
the python runtime / paramiko.
Untill now sfc run in a new python process (clean)
be... | #!/usr/bin/python
#
# Copyright (c) 2016 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import functest.core.feature_base... | #!/usr/bin/python
#
# Copyright (c) 2016 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import functest.core.feature_base... |
Fix ToolbarIcon does not trigger onClick | import React from 'react';
import PropTypes from 'prop-types';
export default class QuillDynamicToolbarIcon extends React.Component {
constructor(props) {
super(props);
this.onClick = this.onClick.bind(this);
}
onClick() {
const { onClick } = this.props;
if (onClick) onClick();
}
render() ... | import React from 'react';
import PropTypes from 'prop-types';
export default class QuillDynamicToolbarIcon extends React.Component {
constructor(props) {
super(props);
this.onClick = this.onClick.bind(this);
}
onClick() {
const { onClick } = this.props;
if (onClick) onClick();
}
render() ... |
[FIX] mass_mailing_partner: Add sudo() to prevent user without mailing access try to merge contacts | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... |
Include Aspell JavaScript in initial load to save extra request | //= requires "editor"
/*
* Includes the Aspell plugin (kindly ported from FCKeditor by Christian
* Boisjoli) which provides spell checking without relying on any
* browser plugins or third-party web services.
*
* Note: you must add this to the toolbar as 'SpellCheck' rather than
* the usual 'SpellChecker' in or... | //= requires "editor"
/*
* Includes the Aspell plugin (kindly ported from FCKeditor by Christian
* Boisjoli) which provides spell checking without relying on any
* browser plugins or third-party web services.
*
* Note: you must add this to the toolbar as 'SpellCheck' rather than
* the usual 'SpellChecker' in or... |
Convert string concat to template string | import * as Pluggable from "../../pluggable";
import resolve from "../../resolve";
const createModule = Pluggable.sync(function createModule (overrides) {
return Object.assign({
path: null,
ns: null,
nsPath: null,
nsRoot: null,
rawSource: null,
ast: null,
requireNodes: null,
dependenc... | import * as Pluggable from "../../pluggable";
import resolve from "../../resolve";
const createModule = Pluggable.sync(function createModule (overrides) {
return Object.assign({
path: null,
ns: null,
nsPath: null,
nsRoot: null,
rawSource: null,
ast: null,
requireNodes: null,
dependenc... |
Fix up pinout tests so they work with new structure | from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
str = type('')
import pytest
from gpiozero.cli.pinout import main
def test_args_incorrect():
with pytest.raises(SystemExit) as ex:
main(['pinout', '--nonexistentarg'])
def test_args_color():
... | from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
str = type('')
import pytest
from gpiozero.cli import pinout
def test_args_incorrect():
with pytest.raises(SystemExit) as ex:
pinout.parse_args(['--nonexistentarg'])
def test_args_color():
a... |
Fix tests not correctly dropping plpgsql functions. | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const config = require('../../config');
// This swaps us to the test database for running test.
// TODO: Fix up c... | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const config = require('../../config');
// This swaps us to the test database for running test.
// TODO: Fix up c... |
Add function to NLP namespace | 'use strict';
/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
// MAIN //
/**
* Top-level namespace.
*
* @namespace nlp
*/
var nlp = {};
/**
* @name expand... | 'use strict';
/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
// MAIN //
/**
* Top-level namespace.
*
* @namespace nlp
*/
var nlp = {};
/**
* @name lda
* ... |
Fix : functional tests fail with 404 error | <?php
use Illuminate\Support\Facades\Artisan;
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $baseUrl = 'http://localhost:8000';
/**
* Creates the application.
*
* @re... | <?php
use Illuminate\Support\Facades\Artisan;
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $baseUrl = 'http://localhost/collababor8/api';
/**
* Creates the application.
*... |
Change url to get stable version number | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
from urllib2 import Request, urlopen
from distutils.version import LooseVersion
BRANCH = 'stable'
REPO = 'git@github.com:roramirez/qpanel.git'
URL_STABLE_VERSION = 'https://rodrigoramirez.com/qpanel/version/' + BR... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
from urllib2 import Request, urlopen
from distutils.version import LooseVersion
BRANCH = 'stable'
REPO = 'git@github.com:roramirez/qpanel.git'
URL_STABLE_VERSION = 'https://raw.githubusercontent.com/roramirez/qpan... |
Remove 0.0 from ings line | from django.db import models
# Create your models here.
class Ingredient(models.Model):
name = models.CharField(max_length=100)
abv = models.FloatField()
type = models.CharField(max_length=25)
def __str__(self):
return self.name
class Admin:
list_display = ('name')
class Meta... | from django.db import models
# Create your models here.
class Ingredient(models.Model):
name = models.CharField(max_length=100)
abv = models.FloatField()
type = models.CharField(max_length=25)
def __str__(self):
return self.name
class Admin:
list_display = ('name')
class Meta... |
Increment the max length of random strings. | #!/usr/bin/env python
from fastcomp import compare
import random
import string
def randomstr(minlen=5, maxlen=8):
charset = '01'
length = random.randint(minlen, maxlen)
return ''.join(random.choice(charset) for i in range(length))
if __name__ == "__main__":
import timeit
# Set up conditions
... | #!/usr/bin/env python
from fastcomp import compare
import random
import string
def randomstr(minlen=5, maxlen=7):
charset = '01'
length = random.randint(minlen, maxlen)
return ''.join(random.choice(charset) for i in range(length))
if __name__ == "__main__":
import timeit
# Set up conditions
... |
Use etc relative to sys.prefix | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
... |
Add 'getDataTable' function from old template. | function applyChanges(data, url, showResult) {
var success = false;
$.ajax({
type : "POST",
url : url,
data : JSON.stringify(data),// now data come in this function
contentType : "application/json; charset=utf-8",
crossDomain : true,
dataType : "json",
success : function(data, status, jqXHR) {
... | function applyChanges(data, url, showResult) {
var success = false;
$.ajax({
type : "POST",
url : url,
data : JSON.stringify(data),// now data come in this function
contentType : "application/json; charset=utf-8",
crossDomain : true,
dataType : "json",
success : function(data, status, jqXHR) {
... |
Upgrade tangled from 0.1a5 to 0.1a8 | from setuptools import setup
setup(
name='tangled.contrib',
version='0.1a4.dev0',
description='Tangled namespace for contributed packages',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.contrib/tags',
aut... | from setuptools import setup
setup(
name='tangled.contrib',
version='0.1a4.dev0',
description='Tangled namespace for contributed packages',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.contrib/tags',
aut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.