text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Input: Fix movement using the "S" key to go down (typo!) | var Player = Entity.extend({
init: function() {
this._super();
this.width = 32;
this.height = 18;
this.setCoord(9, 2);
this.sprite = Gfx.load('hero');
this.spriteShadow = Gfx.load('hero_shadow');
},
update: function() {
if (Keyboard.isKeyDown(KeyEv... | var Player = Entity.extend({
init: function() {
this._super();
this.width = 32;
this.height = 18;
this.setCoord(9, 2);
this.sprite = Gfx.load('hero');
this.spriteShadow = Gfx.load('hero_shadow');
},
update: function() {
if (Keyboard.isKeyDown(KeyEv... |
Fix handling broken daily endpoint | <h3>{{ trans('achievement.daily.type.'.$type) }}</h3>
<ul class="itemList">
@foreach($daily->achievements->{$type} as $achievement)
@if(isset($achievement->achievement))
<li>
{{ $achievement->achievement->link(32, null, $achievement->name[$language]) }}
<span clas... | <h3>{{ trans('achievement.daily.type.'.$type) }}</h3>
<ul class="itemList">
@foreach($daily->achievements->{$type} as $achievement)
@if(isset($achievement->achievement))
<li>
{{ $achievement->achievement->link(32, null, $achievement->name[$language]) }}
<span clas... |
Add check for no records. | var AWS = require('aws-sdk');
var s3 = new AWS.S3();
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
if(event.Records.length == 0) {
//Nothing to do
console.log('Got no records.');
context.succeed();
return;
}
var firstRecord =... | var AWS = require('aws-sdk');
var s3 = new AWS.S3();
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
var stackName = context.functionName.split("-")[0];
var accountId = event.Records[0].eventSourceARN.split(":")[4];
var s3Bucket = stackName + "-eventarchive-" ... |
Fix input submit, now clear itself after submit | (function (angular){
'use strict';
angular.module('app')
.controller('counterController', counterController)
.controller('todoController', todoController)
counterController.$inject = []
todoController.$inject = []
function counterController(){
this.counter = 0;
this.add = functi... | (function (angular){
'use strict';
angular.module('app')
.controller('counterController', counterController)
.controller('todoController', todoController)
counterController.$inject = []
todoController.$inject = []
function counterController(){
this.counter = 0;
this.add = functi... |
Apply a default timer name | <?php
namespace SamBenne\Execute;
/**
* Class Timer
* @package Execute
*/
class Timer
{
/**
* @var \SamBenne\Execute\Timer|null
*/
protected static $instance = null;
/**
* @var array $timers
*/
private static $timers = ... | <?php
namespace SamBenne\Execute;
/**
* Class Timer
* @package Execute
*/
class Timer
{
/**
* @var \SamBenne\Execute\Timer|null
*/
protected static $instance = null;
/**
* @var array $timers
*/
private static $timers = ... |
Fix displaying undefined for episode. | angular.module('proxtop').controller('MainController', ['$scope', 'ipc', '$state', 'notification', '$mdToast', function($scope, ipc, $state, notification, $mdToast) {
ipc.on('check-login', function(result) {
if(result) {
ipc.send('watchlist-update');
$state.go('profile');
} e... | angular.module('proxtop').controller('MainController', ['$scope', 'ipc', '$state', 'notification', '$mdToast', function($scope, ipc, $state, notification, $mdToast) {
ipc.on('check-login', function(result) {
if(result) {
ipc.send('watchlist-update');
$state.go('profile');
} e... |
Add css to add-option button | /* global $ */
(function (window, document, $) {
'use strict';
var LiveEditorToolbar = function LiveEditorToolbar (params) {
this.init(params);
};
LiveEditorToolbar.prototype.init = function (params) {
this.$appendTo = params.$appendTo;
this.create();
};
LiveEditorToo... | /* global $ */
(function (window, document, $) {
'use strict';
var LiveEditorToolbar = function LiveEditorToolbar (params) {
this.init(params);
};
LiveEditorToolbar.prototype.init = function (params) {
this.$appendTo = params.$appendTo;
this.create();
};
LiveEditorToo... |
Fix empty history issue, when we never could go back | phoxy._ClickHook =
{
_: {},
};
phoxy._ClickHook._.click =
{
InitClickHook: function()
{
document.querySelector('body').addEventListener('click', function(event)
{
var target = event.target;
while (true)
{
if (target === null)
return;
if (targe... | phoxy._ClickHook =
{
_: {},
};
phoxy._ClickHook._.click =
{
InitClickHook: function()
{
document.querySelector('body').addEventListener('click', function(event)
{
var target = event.target;
while (true)
{
if (target === null)
return;
if (targe... |
Add linebreak to improve readability | package seedu.ezdo.model.todo;
import seedu.ezdo.commons.exceptions.IllegalValueException;
/**
* Represents the due date of a todo.
*/
public class DueDate {
public static final String MESSAGE_DUEDATE_CONSTRAINTS =
"Due dates should be in the format DD/MM/YYYY, and it should not be blank";
p... | package seedu.ezdo.model.todo;
import seedu.ezdo.commons.exceptions.IllegalValueException;
/**
* Represents the due date of a todo.
*/
public class DueDate {
public static final String MESSAGE_DUEDATE_CONSTRAINTS =
"Due dates should be in the format DD/MM/YYYY, and it should not be blank";
p... |
Abort if privileges can't be dropped | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
os.setgid(group.gr_gid)
os.initgroups(passwd.pw_name, group.gr_gid)
os.setui... | import grp
import logging
import os
import pwd
import sys
from hades.common.cli import (
ArgumentParser, parser as common_parser, setup_cli_logging,
)
logger = logging.getLogger(__name__)
def drop_privileges(passwd, group):
if os.geteuid() != 0:
logger.error("Can't drop privileges (EUID != 0)")
... |
Make the exception message check for malformed UTF-8 source looser so that SyntaxError triggered from UnicodeDecodeError is also acceptable. | # This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
import unittest
from test import support
class PEP3120Test(unittest.TestCase):
def test_pep3120(self):
self.assertEqual(
"Питон".encode("utf-8"),
b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
)
... | # This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
import unittest
from test import support
class PEP3120Test(unittest.TestCase):
def test_pep3120(self):
self.assertEqual(
"Питон".encode("utf-8"),
b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
)
... |
Add status messages when model gets destroyed | exports.definition = {
config: {
columns: {
"name": "text",
"captured": "integer",
"url": "text",
"capturedLat": "real",
"capturedLon": "real"
},
"defaults": {
"name": "",
"captured": 0,
"url": "",
"capturedLat": "",
"capturedLon": ""
},
adapter: {
... | exports.definition = {
config: {
columns: {
"name": "text",
"captured": "integer",
"url": "text",
"capturedLat": "real",
"capturedLon": "real"
},
"defaults": {
"name": "",
"captured": 0,
"url": "",
"capturedLat": "",
"capturedLon": ""
},
adapter: {
... |
Hide Blog button for now | import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { StaticQuery, graphql } from 'gatsby';
import { ThemeProvider } from 'styled-components';
import Logo from '../Logo';
import Breadcrumb from '../Breadcrumb';
import PageTransition from '../PageTransition';
// impo... | import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { StaticQuery, graphql } from 'gatsby';
import { ThemeProvider } from 'styled-components';
import Logo from '../Logo';
import Breadcrumb from '../Breadcrumb';
import PageTransition from '../PageTransition';
import ... |
Use sha1 module from core in generator package | (function () {
'use strict';
var assert = require('assert');
var _ = require('underscore');
var summarizer = require('../src/summarizer');
var sha1 = require('mathsync/src/sha1');
var utils = require('./utils_typedarrays');
function assertThatSetOfArrayEquals(arr1, arr2) {
assert.equal(arr1.lenght, ... | (function () {
'use strict';
var assert = require('assert');
var _ = require('underscore');
var summarizer = require('../src/summarizer');
var sha1 = require('../src/sha1');
var utils = require('./utils_typedarrays');
function assertThatSetOfArrayEquals(arr1, arr2) {
assert.equal(arr1.lenght, arr2.l... |
Add a function to get user & user orgs | <?php
namespace OrgManager\ApiClient;
use GuzzleHttp\Client;
class OrgManager
{
/** @var \GuzzleHttp\Client */
protected $client;
/** @var string */
protected $baseUrl;
/**
* @param \GuzzleHttp\Client $client
* @param string $apiToken
* @param string $root... | <?php
namespace OrgManager\ApiClient;
use GuzzleHttp\Client;
class OrgManager
{
/** @var \GuzzleHttp\Client */
protected $client;
/** @var string */
protected $baseUrl;
/**
* @param \GuzzleHttp\Client $client
* @param string $apiToken
* @param string $root... |
Enable easy login through browsable API (discovery through serializer_class) | from django.contrib.auth import logout
from django.middleware.csrf import get_token as generate_csrf_token_for_frontend
from rest_framework import status, viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from yunity.api.serializers import UserSerializer, AuthLoginSe... | from django.contrib.auth import logout
from django.middleware.csrf import get_token as generate_csrf_token_for_frontend
from rest_framework import status, viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from yunity.api.serializers import UserSerializer, AuthLoginSe... |
Add renderware to generated apps | module.exports = (function() {
"use strict";
const Nodal = require('nodal');
const zlib = require('zlib');
class GzipRenderware extends Nodal.Renderware {
exec(controller, data, callback) {
let contentType = controller.getHeader('Content-Type', '').split(';')[0];
let acceptEncoding = contr... | module.exports = (function() {
"use strict";
const Nodal = require('nodal');
const zlib = require('zlib');
class GzipMiddleware extends Nodal.Middleware {
exec(controller, data, callback) {
let contentType = controller.getHeader('Content-Type', '').split(';')[0];
let acceptEncoding = contr... |
[Client] Fix active link in menu when sub item is displayed | import React from 'react'
import {Link, withRouter} from 'react-router-dom'
import { Image, Menu } from 'semantic-ui-react'
import logo from '../logo.svg'
import './MainHeader.css'
const MainHeader = ({location}) => {
return (
<Menu fixed='top' inverted>
<Menu.Item as='a' header>
<Image
s... | import React from 'react'
import {Link, withRouter} from 'react-router-dom'
import { Image, Menu } from 'semantic-ui-react'
import logo from '../logo.svg'
import './MainHeader.css'
const MainHeader = ({location}) => {
console.log('location', location)
return (
<Menu fixed='top' inverted>
<Menu.Item as='a... |
Rename offset in body weight mapper with UTC | package org.openmhealth.shim.fitbit.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import org.openmhealth.schema.domain.omh.BodyWeight;
import org.openmhealth.schema.domain.omh.DataPoint;
import org.openmhealth.schema.domain.omh.MassUnit;
import org.openmhealth.schema.domain.omh.MassUnitValue;
import java.ti... | package org.openmhealth.shim.fitbit.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import org.openmhealth.schema.domain.omh.BodyWeight;
import org.openmhealth.schema.domain.omh.DataPoint;
import org.openmhealth.schema.domain.omh.MassUnit;
import org.openmhealth.schema.domain.omh.MassUnitValue;
import java.ti... |
Fix building queries with more than one parameter | <?php
namespace Keyteq\Keymedia\API;
use Keyteq\Keymedia\API\Configuration;
use Keyteq\Keymedia\Util\RequestSigner;
use Keyteq\Keymedia\Util\RequestWrapper;
class RestConnector
{
protected $config;
protected $signer;
protected $wrapper;
public function __construct(Configuration $config)
{
... | <?php
namespace Keyteq\Keymedia\API;
use Keyteq\Keymedia\API\Configuration;
use Keyteq\Keymedia\Util\RequestSigner;
use Keyteq\Keymedia\Util\RequestWrapper;
class RestConnector
{
protected $config;
protected $signer;
protected $wrapper;
public function __construct(Configuration $config)
{
... |
Add bind auto method (bind without key) | <?php
namespace DB\Driver;
/**
* Interface for all database driver. Any database driver must implement
* this class.
*
* @package DB\Driver
*/
interface IDriver
{
/**
* Connect to selected database host
*
* @param string $host Database ho... | <?php
namespace DB\Driver;
/**
* Interface for all database driver. Any database driver must implement
* this class.
*
* @package DB\Driver
*/
interface IDriver
{
/**
* Connect to selected database host
*
* @param string $host Database ho... |
[drush] Improve drush command, make stand alone command | <?php
/**
* @file
* Contains \Drupal\Console\Command\DrushCommand.
*/
namespace Drupal\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Drupal\Console\Command\Command;
class DrushComma... | <?php
/**
* @file
* Contains \Drupal\Console\Command\DrushCommand.
*/
namespace Drupal\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class DrushCommand extends ContainerAwareCommand
{
... |
BB-1413: Cover validation by unit tests
- fix spaces | <?php
namespace Oro\Bundle\EntityExtendBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Oro\Bundle\EntityExtendBundle\Model\EnumValue as EnumValueEntity;
use Oro\Bundle... | <?php
namespace Oro\Bundle\EntityExtendBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Oro\Bundle\EntityExtendBundle\Model\EnumValue as EnumValueEntity;
use Oro\Bundle... |
Fix problem with detecting step lines with failed steps | <?php
namespace Tests\Concerns;
use PHPUnit\Framework\Assert;
class ArtisanResult
{
private $output;
private $status;
private $parameters;
public function __construct($parameters, $output, $status)
{
$this->output = $output;
$this->status = $status;
$this->parameters = $p... | <?php
namespace Tests\Concerns;
use PHPUnit\Framework\Assert;
class ArtisanResult
{
private $output;
private $status;
private $parameters;
public function __construct($parameters, $output, $status)
{
$this->output = $output;
$this->status = $status;
$this->parameters = $p... |
Add a future repsonse class for handle dispatcher for asynchronous command | <?php
namespace M6Web\Bundle\CassandraBundle\Cassandra;
use Cassandra\Future;
use M6Web\Bundle\CassandraBundle\EventDispatcher\CassandraEvent;
/**
* Class FutureResponse
*
* Handle future response for dispatching event when request is complete
*/
class FutureResponse implements Future
{
/**
* @var EventD... | <?php
namespace M6Web\Bundle\CassandraBundle\Cassandra;
use Cassandra\Future;
use M6Web\Bundle\CassandraBundle\EventDispatcher\CassandraEvent;
/**
* Class FutureResponse
*
* Handle future response for dispatching event when request is complete
*/
class FutureResponse implements Future
{
/**
* @var EventD... |
Make the view List only remove Create | from rest_framework import generics
from rest_framework import permissions
from rest_framework.response import Response
from rest_framework.decorators import api_view
from django.views.decorators.clickjacking import xframe_options_exempt
from api.webview.models import Document
from api.webview.serializers import Docum... | from rest_framework import generics
from rest_framework import permissions
from rest_framework.response import Response
from rest_framework.decorators import api_view
from django.views.decorators.clickjacking import xframe_options_exempt
from api.webview.models import Document
from api.webview.serializers import Docum... |
Implement a very basic http server | package net.zephyrizing.http_server;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class HttpServer {
public static void main(String[] args) throws Exception {
int portNumber;
if (args.lengt... | package net.zephyrizing.http_server;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class HttpServer {
public static void main(String[] args) throws Exception {
int portNumber = Integer.parseInt(args... |
janitoring: Use print as a statement
- Let's be Python 3 compatible.
Signed-off-by: mr.Shu <8e7be411ad89ade93d144531f3925d0bb4011004@shu.io> | import wikipedia
import sys
import random
import re
import nltk.data
def process_file(f):
names = {}
with open(f) as file:
for line in file:
l = line.strip().split('\t')
if len(l) != 2:
continue
(k, v) = l
names[k] = v
return names
... | import wikipedia
import sys
import random
import re
import nltk.data
def process_file(f):
names = {}
with open(f) as file:
for line in file:
l = line.strip().split('\t')
if len(l) != 2:
continue
(k, v) = l
names[k] = v
return names
... |
Exclude 'keep-alive' as a proxied response header. | package com.netflix.zuul.util;
import com.netflix.client.http.HttpResponse;
import com.netflix.zuul.context.HttpRequestMessage;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
/**
* User: michaels@netflix.com
* ... | package com.netflix.zuul.util;
import com.netflix.client.http.HttpResponse;
import com.netflix.zuul.context.HttpRequestMessage;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
/**
* User: michaels@netflix.com
* ... |
Add a default message to ensure that logs are written | package com.volkhart.feedback.utils;
import android.util.Log;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import timber.log.Timber;
public final class FeedbackTree extends Timber.DebugTree {
public static final FeedbackTree INSTANCE = new Feedba... | package com.volkhart.feedback.utils;
import android.util.Log;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import timber.log.Timber;
public final class FeedbackTree extends Timber.DebugTree {
public static final FeedbackTree INSTANCE = new Feedba... |
Fix constructor test, since constructor does not append / at the end | import os, sys
sys.path.append(os.path.abspath('..'))
import unittest
from mock import patch
from pynexus import api_client
class NexusTest(unittest.TestCase):
def test_constructor_appends_base(self):
n = api_client.ApiClient('http://test.com', 'testuser', 'testpwd')
self.assertEquals(n.uri, 'htt... | import os, sys
sys.path.append(os.path.abspath('..'))
import unittest
from mock import patch
from pynexus import api_client
class NexusTest(unittest.TestCase):
def test_constructor_appends_base(self):
n = api_client.ApiClient('http://test.com', 'testuser', 'testpwd')
self.assertEquals(n.uri, 'htt... |
[ECS] Add shortcut for config file | <?php declare(strict_types=1);
namespace Symplify\EasyCodingStandard\Console;
use Jean85\PrettyVersions;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
final class Application extends SymfonyApplic... | <?php declare(strict_types=1);
namespace Symplify\EasyCodingStandard\Console;
use Jean85\PrettyVersions;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
final class Application extends SymfonyApplic... |
Fix broken import of socket errors | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connected, or ... | from sockets.socket_closed_exception import SocketClosedException
from sockets.stream_socket import StreamSocket
import socket.error
from groundstation import settings
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class PeerSocket(StreamSocket):
"""Wrapper for a peer who just connect... |
Add lint and reformat target.
This is part of the ground work to have a consistent style to the template
JSON documents. Two targets are defined.
* Lint - verify all JSON templates follow the approved style.
* Reformat - modify all JSON templates to follow the approved style.
The lint target will be used to gate ... | var grunt = require('grunt');
require('load-grunt-tasks')(grunt);
var files = ['test/*.js'];
var templates = ['**/*.json'];
grunt.initConfig({
mochacli: {
options: {
reporter: 'spec',
bail: false
},
all: files
},
jshint: {
files: files,
options: {
jshi... | var grunt = require('grunt');
require('load-grunt-tasks')(grunt);
var files = ['test/*.js'];
grunt.initConfig({
mochacli: {
options: {
reporter: 'spec',
bail: false
},
all: files
},
jshint: {
files: files,
options: {
jshintrc: '.jshintrc'
}
},
... |
Add test gruntfile to jshint checks | module.exports = function( grunt ) {
"use strict";
grunt.initConfig({
bump: {
options: {
files: [ "package.json" ],
// Commit
commit: true,
commitMessage: "Release v%VERSION%",
commitFiles: [ "package.json" ],
... | module.exports = function( grunt ) {
"use strict";
grunt.initConfig({
bump: {
options: {
files: [ "package.json" ],
// Commit
commit: true,
commitMessage: "Release v%VERSION%",
commitFiles: [ "package.json" ],
... |
Append .jpg to screenshot filename | (function() {
'use strict';
angular.module('chaise.viewer')
.controller('OSDController', ['image', '$window', function OSDController(image, $window) {
var vm = this;
var iframe = $window.frames[0];
var origin = $window.location.origin;
vm.image = image;
vm.downloadV... | (function() {
'use strict';
angular.module('chaise.viewer')
.controller('OSDController', ['image', '$window', function OSDController(image, $window) {
var vm = this;
var iframe = $window.frames[0];
var origin = $window.location.origin;
vm.image = image;
vm.downloadV... |
Change how GUI and logger is created. Initialize logger after we get
console parameters and only then initialize logger. | package com.fatico.winthing;
import com.fatico.winthing.gui.WindowGui;
import com.fatico.winthing.messaging.Engine;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Application {
private static final Application app = new Ap... | package com.fatico.winthing;
import com.fatico.winthing.gui.WindowGui;
import com.fatico.winthing.messaging.Engine;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Application {
private boolean debug = false;
private st... |
Update edit form for StockItem
- Disallow direct quantity editing (must perform stocktake)
- Add notes field to allow editing | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from InvenTree.forms import HelperForm
from .models import StockLocation, StockItem
class EditStockLocationForm(HelperForm):
class Meta:
model = StockLocation
fields = [
'name',
'par... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from InvenTree.forms import HelperForm
from .models import StockLocation, StockItem
class EditStockLocationForm(HelperForm):
class Meta:
model = StockLocation
fields = [
'name',
'par... |
Add any/every, and optimize some functions (knowing it's empty string) | package ceylon.language;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Ignore;
@Ignore
@Ceylon(major = 1)
class StringOfNone extends String implements None<Character> {
static StringOfNone instance = new StringOfNone();
private StringOfNone()... | package ceylon.language;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Ignore;
@Ignore
@Ceylon(major = 1)
class StringOfNone extends String implements None<Character> {
static StringOfNone instance = new StringOfNone();
private StringOfNone()... |
Add ResponseInterface return type to request methods | <?php
namespace Jsor\HalClient;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
interface HalClientInterface
{
/**
* @return UriInterface
*/
public function getRootUrl();
/**
* @param string
* @return string[]
*/
public function getHeader($name);
... | <?php
namespace Jsor\HalClient;
use Psr\Http\Message\UriInterface;
interface HalClientInterface
{
/**
* @return UriInterface
*/
public function getRootUrl();
/**
* @param string
* @return string[]
*/
public function getHeader($name);
/**
* @param string
* @par... |
Remove duplicate trove classifier for Python
Alphabetize list to help catch potential future duplication. | #!/usr/bin/env python
import os
from setuptools import setup
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as fp:
return fp.read()
setup(
name='django-decorator-include',
version='1.3',
license='BSD',
description='Include Django URL patterns with decorators... | #!/usr/bin/env python
import os
from setuptools import setup
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as fp:
return fp.read()
setup(
name='django-decorator-include',
version='1.3',
license='BSD',
description='Include Django URL patterns with decorators... |
Fix JS error preventing newly created dictionary items from opening automatically
(cherry picked from commit 59f90bd08be677817133584fc877f4a53a349359) | /**
* @ngdoc controller
* @name Umbraco.Editors.Dictionary.CreateController
* @function
*
* @description
* The controller for creating dictionary items
*/
function DictionaryCreateController($scope, $location, dictionaryResource, navigationService, notificationsService, formHelper, appState) {
var vm = th... | /**
* @ngdoc controller
* @name Umbraco.Editors.Dictionary.CreateController
* @function
*
* @description
* The controller for creating dictionary items
*/
function DictionaryCreateController($scope, $location, dictionaryResource, navigationService, notificationsService, formHelper, appState) {
var vm = th... |
Update class name validator implementation. | <?php
namespace PhpSpec\Console\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class DescribeCommand e... | <?php
namespace PhpSpec\Console\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class DescribeCommand e... |
Add test for signup success | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for, session
from app import app
class BucketListTest(TestCase):
def setUp(self):
app.config['SECRET_KEY'] = 'seasasaskrit!'
# creates a test client
self.cli... | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.testing = True
... |
Clean the variable space by unsetting $data and $shared | <?php
/**
* This file is part of endobox.
*
* (c) 2015-2016 YouniS Bensalah <younis.bensalah@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace endobox;
/**
*
*/
class EvalRendererDecorator extends RendererDe... | <?php
/**
* This file is part of endobox.
*
* (c) 2015-2016 YouniS Bensalah <younis.bensalah@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace endobox;
/**
*
*/
class EvalRendererDecorator extends RendererDe... |
Call an update method to manage incoming jobs | # Import third party libs
import urwid
# Import sconsole libs
import sconsole.cmdbar
import sconsole.static
import sconsole.jidtree
FOOTER = [
('title', 'Salt Console'), ' ',
('key', 'UP'), ' ',
('key', 'DOWN'), ' ']
class Manager(object):
def __init__(self, opts):
self.opts =... | # Import third party libs
import urwid
# Import sconsole libs
import sconsole.cmdbar
import sconsole.static
import sconsole.jidtree
FOOTER = [
('title', 'Salt Console'), ' ',
('key', 'UP'), ' ',
('key', 'DOWN'), ' ']
class Manager(object):
def __init__(self, opts):
self.opts =... |
Add a statement that info search is not currently implemented | <?php
namespace App\Repositories;
use App\Work;
use App\Type;
use DB;
use Response;
class WorksRepository {
/**
* Queries database for all works based on catID
*
*/
public function getallworks($catID) {
return Work::join('types','works.typeID','=','types.typeID')
->select('workID','catID','... | <?php
namespace App\Repositories;
use App\Work;
use App\Type;
use DB;
use Response;
class WorksRepository {
/**
* Queries database for all works based on catID
*
*/
public function getallworks($catID) {
return Work::join('types','works.typeID','=','types.typeID')
->select('workID','catID','... |
Fix relation from feed to user | "use strict";
var
uuid = require('node-uuid');
module.exports = function(sequelize, DataTypes) {
var UserFeed = sequelize.define("UserFeed", {
name : {
type : DataTypes.STRING,
allowNull : false,
},
feed_token : {
type : DataTypes.STRING,
allowNull : false,
},
... | "use strict";
var
uuid = require('node-uuid');
module.exports = function(sequelize, DataTypes) {
var UserFeed = sequelize.define("UserFeed", {
name : {
type : DataTypes.STRING,
allowNull : false,
},
feed_token : {
type : DataTypes.STRING,
allowNull : false,
},
... |
Fix typo in stream_get_contents() call | <?php
namespace MongoDB\Tests\GridFS;
use MongoDB\Collection;
use MongoDB\GridFS\Bucket;
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
/**
* Base class for GridFS functional tests.
*/
abstract class FunctionalTestCase extends BaseFunctionalTestCase
{
protected $bucket;
protected $chunksCo... | <?php
namespace MongoDB\Tests\GridFS;
use MongoDB\Collection;
use MongoDB\GridFS\Bucket;
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
/**
* Base class for GridFS functional tests.
*/
abstract class FunctionalTestCase extends BaseFunctionalTestCase
{
protected $bucket;
protected $chunksCo... |
Fix junit utf-8 output to file | # -*- coding: utf-8 -*-
import json
from junit_xml import TestSuite, TestCase
class JunitFormatter(object):
def __init__(self, project_cfg, project_result):
"""Initialize the stuff"""
self.testcases = {
unicode(item["id"]): item for item in project_cfg["testcases"]
}
... | import json
from junit_xml import TestSuite, TestCase
class JunitFormatter(object):
def __init__(self, project_cfg, project_result):
"""Initialize the stuff"""
self.testcases = {
str(item["id"]): item for item in project_cfg["testcases"]
}
test_cases = []
for ... |
Change 'jpg' to be the default extension type for 'image/jpeg' | <?php
/**
* This file is part of the Imbo package
*
* (c) Christer Edvartsen <cogo@starzinger.net>
*
* For the full copyright and license information, please view the LICENSE file that was
* distributed with this source code.
*/
namespace Imbo\Image\OutputConverter;
/**
* Basic output converter that supports ... | <?php
/**
* This file is part of the Imbo package
*
* (c) Christer Edvartsen <cogo@starzinger.net>
*
* For the full copyright and license information, please view the LICENSE file that was
* distributed with this source code.
*/
namespace Imbo\Image\OutputConverter;
/**
* Basic output converter that supports ... |
Improve ParseableFormatter to be more like pylint
Add an E in front of the rule ID so that pylint detects
it as an error.
Fixes #154 | class Formatter(object):
def format(self, match):
formatstr = u"[{0}] {1}\n{2}:{3}\n{4}\n"
return formatstr.format(match.rule.id,
match.message,
match.filename,
match.linenumber,
... | class Formatter(object):
def format(self, match):
formatstr = u"[{0}] {1}\n{2}:{3}\n{4}\n"
return formatstr.format(match.rule.id,
match.message,
match.filename,
match.linenumber,
... |
Use new bucket that has properly sized SVG assets | import React from "react"; // eslint-disable-line no-unused-vars
class CountryMap extends React.Component {
constructor(props) {
super(props);
this.state = { SVG: "" };
}
componentWillMount() {
let component = this;
// TODO move to country-specific bucket or at least folder
if (this.props.cou... | import React from "react"; // eslint-disable-line no-unused-vars
class CountryMap extends React.Component {
constructor(props) {
super(props);
this.state = { SVG: "" };
}
componentWillMount() {
let component = this;
// TODO move to country-specific bucket or at least folder
if (this.props.cou... |
Check existence of the user with appropriate email address | from django.core.management.base import BaseCommand
from utils.create_random_data import create_items, create_users, create_orders
from saleor.userprofile.models import User
class Command(BaseCommand):
help = 'Populate database with test objects'
placeholders_dir = r'saleor/static/placeholders/'
def ad... | from django.core.management.base import BaseCommand
from utils.create_random_data import create_items, create_users, create_orders
from saleor.userprofile.models import User
class Command(BaseCommand):
help = 'Populate database with test objects'
placeholders_dir = r'saleor/static/placeholders/'
def ad... |
Fix Meta init and from_dict | from collections import OrderedDict
from malcolm.core.serializable import Serializable
@Serializable.register("malcolm:core/Meta:1.0")
class Meta(Serializable):
"""Meta class for describing Blocks"""
def __init__(self, name, description, *args):
super(Meta, self).__init__(name, *args)
self.d... | from collections import OrderedDict
from malcolm.core.serializable import Serializable
@Serializable.register("malcolm:core/Meta:1.0")
class Meta(Serializable):
"""Meta class for describing Blocks"""
def __init__(self, name, description):
super(Meta, self).__init__(name)
self.description = d... |
Add not enough characters condition | # coding: utf8
from io import StringIO
from collections import deque
class StreamReader:
def __init__(self, *args, stream_class=StringIO, **kwargs):
self.streamClass = stream_class
self.args = args
self.kwargs = kwargs
def read(self, parsing_pipeline):
parsing_pipeline.reset(... | # coding: utf8
from io import StringIO
from collections import deque
class StreamReader:
def __init__(self, *args, stream_class=StringIO, **kwargs):
self.streamClass = stream_class
self.args = args
self.kwargs = kwargs
def read(self, parsing_pipeline):
parsing_pipeline.reset(... |
Update nl2br to work with None as input | from jinja2 import escape, Markup, evalcontextfilter
from radar.lib.utils import date_to_datetime, is_date
def strftime(dt, dt_format):
if dt is None:
return ''
else:
return dt.strftime(dt_format)
def year_format(dt):
if dt is None:
return ''
else:
return '%04d' % dt... | from jinja2 import escape, Markup, evalcontextfilter
from radar.lib.utils import date_to_datetime, is_date
def strftime(dt, dt_format):
if dt is None:
return ''
else:
return dt.strftime(dt_format)
def year_format(dt):
if dt is None:
return ''
else:
return '%04d' % dt... |
Change sort of cars and add aditional params to query | define(["underscore", "jquery", "app"], function(_, $, app) {
return function () {
var public = {};
var private = {};
private.createObject = function (averageCartype) {
var queryObject = {
c: [],
ecol: [],
sc: null,
p: null,
psz: 100,
ll: null,
... | define(["underscore", "jquery", "app"], function(_, $, app) {
return function () {
var public = {};
var private = {};
private.createObject = function (averageCartype) {
var queryObject = {
c: [],
ecol: [],
sc: null,
p: null,
psz: 100,
ll: null,
... |
Fix an issue with the tetris max level | /**
* The Level Class
*/
class Level {
/**
* The Level constructor
* @param {Number} maxLevels
*/
constructor(maxLevels) {
this.levelerElem = document.querySelector(".leveler");
this.maxLevels = maxLevels;
this.level = 1;
}
/**
... | /**
* The Level Class
*/
class Level {
/**
* The Level constructor
* @param {Number} maxLevels
*/
constructor(maxLevels) {
this.levelerElem = document.querySelector(".leveler");
this.maxLevels = maxLevels;
this.level = 1;
}
/**
... |
Replace method getName() in form types with "getBlockPrefix()". | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\Utils\Form\Type;
... | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\Utils\Form\Type;
... |
Support for anonymous saved versions
This fixes a case when de API sends a version without user. There was a
bug allowing to create anonymous versions in the application and we
have to support the old data.
The problem here is that SnapshotInfo classes are inflated from json
via Gson. This method does not call any co... | package uk.ac.ic.wlgitbridge.snapshot.getsavedvers;
import uk.ac.ic.wlgitbridge.util.Util;
/**
* Created by Winston on 06/11/14.
*/
public class SnapshotInfo implements Comparable<SnapshotInfo> {
private int versionId;
private String comment;
private WLUser user;
private String createdAt;
publ... | package uk.ac.ic.wlgitbridge.snapshot.getsavedvers;
import uk.ac.ic.wlgitbridge.util.Util;
/**
* Created by Winston on 06/11/14.
*/
public class SnapshotInfo implements Comparable<SnapshotInfo> {
private int versionId;
private String comment;
private WLUser user;
private String createdAt;
publ... |
Truncate Log messages to 4000 chars. | <?php
namespace LiteCQRS\Plugin\Monolog;
use LiteCQRS\Bus\MessageHandlerInterface;
use LiteCQRS\Bus\MessageInterface;
use LiteCQRS\DomainEvent;
use LiteCQRS\Command;
use Exception;
use Monolog\Logger;
/**
* Logs all commands or events and their sucess/failure status
* into a logger. The input data is json seriali... | <?php
namespace LiteCQRS\Plugin\Monolog;
use LiteCQRS\Bus\MessageHandlerInterface;
use LiteCQRS\Bus\MessageInterface;
use LiteCQRS\DomainEvent;
use LiteCQRS\Command;
use Exception;
use Monolog\Logger;
/**
* Logs all commands or events and their sucess/failure status
* into a logger. The input data is json seriali... |
Fix nullable username in user integrations table | <?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateUsersIntegrationsTable extends AbstractMigration
{
public function change(): void
{
$table = $this->table('nl2_users_integrations');
$table
->addColumn('user_id', 'integer', ['length' => 11])
... | <?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateUsersIntegrationsTable extends AbstractMigration
{
public function change(): void
{
$table = $this->table('nl2_users_integrations');
$table
->addColumn('user_id', 'integer', ['length' => 11])
... |
Exclude libraries as object (eg. _.find()) | 'use strict';
module.exports = {
meta: {
docs: {
description: 'Forbid methods added in ES6'
},
schema: []
},
create(context) {
return {
CallExpression(node) {
const objectExceptions = ['_'];
if(node.callee && node.callee.property && objectExceptions.indexOf(node.callee... | 'use strict';
module.exports = {
meta: {
docs: {
description: 'Forbid methods added in ES6'
},
schema: []
},
create(context) {
return {
CallExpression(node) {
if(node.callee && node.callee.property) {
const functionName = node.callee.property.name;
const e... |
Revert "Last codestyle fix (I hope)"
This reverts commit 79c42c9bff7390fbc649578b89dcbef93633f33c. | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework;
use PHPUnit\Util\Test as TestUtil;
/... | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework;
use PHPUnit\Util\Test as TestUtil;
/... |
Refactor login code to handle JSON return values for api_key method. | package com.humbughq.android;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.SharedPreferences.Editor;
import android.util.Log;
import android.widget.TextView;
class AsyncLogin extends HumbugAsyncPushTask {
public AsyncLogin(HumbugActivity humbugActivity, String username,
... | package com.humbughq.android;
import android.content.SharedPreferences.Editor;
import android.util.Log;
import android.widget.TextView;
class AsyncLogin extends HumbugAsyncPushTask {
public AsyncLogin(HumbugActivity humbugActivity, String username,
String password) {
super(humbugActivity);
... |
Update mock Account in tests. | """ Test that the All Mail folder is enabled for Gmail. """
import pytest
from inbox.auth.gmail import GmailAuthHandler
from inbox.basicauth import GmailSettingError
from inbox.crispin import GmailCrispinClient
class AccountStub(object):
id = 0
email_address = 'bob@bob.com'
access_token = None
imap_e... | """ Test that the All Mail folder is enabled for Gmail. """
import pytest
from inbox.auth.gmail import GmailAuthHandler
from inbox.basicauth import GmailSettingError
from inbox.crispin import GmailCrispinClient
class AccountStub(object):
id = 0
email_address = 'bob@bob.com'
access_token = None
imap_e... |
Fix referencing of oauth flow.
@gtrogers
@robyoung | import httplib2
import json
import itertools
from collections import defaultdict
from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.client import flow_from_clientsecrets
from oauth2client.tools import run
class Locations(object):
CLIENT_SECRETS_FILE = 'client_secrets.jso... | import httplib2
import json
import itertools
from collections import defaultdict
from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.client import flow_from_clientsecrets
from oauth2client.tools import run
class Locations(object):
CLIENT_SECRETS_FILE = 'client_secrets.jso... |
Fix a display bug when two dates are the same day. | (function init() {
var input1 = document.getElementById("input1");
var input2 = document.getElementById("input2");
var searchParams = new URLSearchParams(window.location.search);
if (input1.value === "") {
input1.value = searchParams.get("startDate");
}
if (input2.value === "") {
... | (function init() {
var input1 = document.getElementById("input1");
var input2 = document.getElementById("input2");
var searchParams = new URLSearchParams(window.location.search);
if (input1.value === "") {
input1.value = searchParams.get("startDate");
}
if (input2.value === "") {
... |
Add pycurl as an extras | import setuptools
CLASSIFIERS = ['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :... | import setuptools
CLASSIFIERS = ['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :... |
Tweak stars size on retina devices | (function () {
function initTwinklingStars(devicePixelRatio) {
particlesJS('stars', {
particles: {
number: {
value: 180,
density: {
enable: true,
value_area: 600
}
... | (function () {
function initTwinklingStars() {
particlesJS('stars', {
particles: {
number: {
value: 180,
density: {
enable: true,
value_area: 600
}
},
... |
Use unique identifier name for ASGIApp type
Due to collision with ASGIApp class decorator | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp as ASGIAppType, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for... | __all__ = ["ASGIMiddleware"]
import rollbar
try:
from starlette.types import ASGIApp, Receive, Scope, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
# Optional class annotations must be statically declared because
# IDEs cannot infer type hinting for arbitrary dyna... |
Fix wrong serviceLocator property name | <?php
/**
* @author Evgeny Shpilevsky <evgeny@shpilevsky.com>
*/
namespace EnliteMonolog\Service;
use Monolog\Logger;
use RuntimeException;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
trait MonologServiceAwareTrait
{
/**
* @var Logger
*/
... | <?php
/**
* @author Evgeny Shpilevsky <evgeny@shpilevsky.com>
*/
namespace EnliteMonolog\Service;
use Monolog\Logger;
use RuntimeException;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
trait MonologServiceAwareTrait
{
/**
* @var Logger
*/
... |
Allow parallelNode to accept cases of textual | package io.digdag.util;
import com.fasterxml.jackson.databind.JsonNode;
import io.digdag.client.config.Config;
import io.digdag.client.config.ConfigException;
public class ParallelControl
{
public static ParallelControl of(Config config)
{
return new ParallelControl(config);
}
private final b... | package io.digdag.util;
import com.fasterxml.jackson.databind.JsonNode;
import io.digdag.client.config.Config;
import io.digdag.client.config.ConfigException;
public class ParallelControl
{
public static ParallelControl of(Config config)
{
return new ParallelControl(config);
}
private final b... |
Add option to forcefully delete task and scale app | var qajaxWrapper = require("../helpers/qajaxWrapper");
var config = require("../config/config");
var AppDispatcher = require("../AppDispatcher");
var TasksEvents = require("../events/TasksEvents");
var TasksActions = {
deleteTasks: function (appId, taskIds = []) {
this.request({
method: "POST",
data... | var qajaxWrapper = require("../helpers/qajaxWrapper");
var config = require("../config/config");
var AppDispatcher = require("../AppDispatcher");
var TasksEvents = require("../events/TasksEvents");
var TasksActions = {
deleteTasks: function (appId, taskIds = []) {
this.request({
method: "POST",
data... |
Remove monkey patching in favor of inheritance for SpatialReference | """Spatial reference systems"""
from osgeo import osr
class BaseSpatialReference(osr.SpatialReference):
"""Base class for extending osr.SpatialReference."""
def __repr__(self):
return self.wkt
@property
def srid(self):
"""Returns the EPSG ID as int if it exists."""
epsg_id = ... | """Spatial reference systems"""
from osgeo import osr
# Monkey patch SpatialReference since inheriting from SWIG classes is a hack
def srid(self):
"""Returns the EPSG ID as int if it exists."""
epsg_id = (self.GetAuthorityCode('PROJCS') or
self.GetAuthorityCode('GEOGCS'))
try:
retu... |
Add pagination support for api('groups')->members | <?php
namespace Gitlab\Api;
class Groups extends AbstractApi
{
public function all($page = 1, $per_page = self::PER_PAGE)
{
return $this->get('groups', array(
'page' => $page,
'per_page' => $per_page
));
}
public function show($id)
{
... | <?php
namespace Gitlab\Api;
class Groups extends AbstractApi
{
public function all($page = 1, $per_page = self::PER_PAGE)
{
return $this->get('groups', array(
'page' => $page,
'per_page' => $per_page
));
}
public function show($id)
{
... |
Set session variables, cleaned up code | Template.body.events({
"submit .results": function (event) {
Session.set('searchingresults', false);
Session.set('resultsloaded', false);
var movie = document.querySelector('input[name="movie"]:checked').value;
var id = document.querySelector('input[name="movie"]:checked').i... | Template.results.events({
'submit form': function(event){
var movie = document.querySelector('input[name="movie"]:checked').value;
var id = document.querySelector('input[name="movie"]:checked').id;
if (Movies.findOne({text: movie}) == undefined) {
var mg = '<p>Movie was successfu... |
Add the declaration for the should cache class service | <?php
namespace EdpSuperluminal;
use Zend\Console\Request as ConsoleRequest;
use Zend\Mvc\MvcEvent;
/**
* Create a class cache of all classes used.
*
* @package EdpSuperluminal
*/
class Module
{
/**
* Attach the cache event listener
*
* @param MvcEvent $e
*/
public function onBootstra... | <?php
namespace EdpSuperluminal;
use Zend\Console\Request as ConsoleRequest;
use Zend\Mvc\MvcEvent;
/**
* Create a class cache of all classes used.
*
* @package EdpSuperluminal
*/
class Module
{
/**
* Attach the cache event listener
*
* @param MvcEvent $e
*/
public function onBootstra... |
Remove empty string from requirements list
When we moved to Python 3 we used this simpler method to read the requirements
file. However we need to remove the empty/Falsey elements from the list.
This fixes the error:
```
Failed building wheel for molo.commenting
``` | 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 = [req for req in f.read().split('\n') if req]
with open(os.path.join(h... | 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... |
Comment out some boilerplate code, to prevent failures | """"
Boilerplate Adventure
Author: Ignacio Avas (iavas@sophilabs.com)
"""
import codecs
import io
import sys
import unittest
from story.adventures import AdventureVerificationError, BaseAdventure
from story.translation import gettext as _
class TestOutput(unittest.TestCase):
"""Variables Adventure test"""
de... | """"
Boilerplate Adventure
Author: Ignacio Avas (iavas@sophilabs.com)
"""
import codecs
import io
import sys
import unittest
from story.adventures import AdventureVerificationError, BaseAdventure
from story.translation import gettext as _
class TestOutput(unittest.TestCase):
"""Variables Adventure test"""
de... |
Fix the registration page redirection | <?php
function getReferralID() {
global $_GET;
if (empty($_GET['r'])) {
return null;
}
return intval($_GET['r']);
}
function hasValidReferralData() {
$referralID = getReferralID();
return ($referralID > 0);
}
function hasReferralCookie() {
global $_COOKIE;
$referralCookieK... | <?php
function getReferralID() {
global $_GET;
if (empty($_GET['r'])) {
return null;
}
return intval($_GET['r']);
}
function hasValidReferralData() {
$referralID = getReferralID();
return ($referralID > 0);
}
function hasReferralCookie() {
global $_COOKIE;
$referralCookieK... |
Change JecpApllication class in JECP-SE | package com.annimon.jecp.se;
import com.annimon.jecp.ApplicationListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
/**
*
* @author aNNiMON
*/
public abstract class JecpApplication extends JFrame implements Wi... | package com.annimon.jecp.se;
import com.annimon.jecp.ApplicationListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
/**
*
* @author aNNiMON
*/
public abstract class JecpApplication extends JFrame implements Ap... |
Update spec to take in account null fields in context model | define(['backbone', 'cilantro', 'text!/mock/fields.json'], function (Backbone, c, fieldsJSON) {
var fields = new Backbone.Collection(JSON.parse(fieldsJSON));
describe('FieldControl', function() {
var control;
describe('Base', function() {
beforeEach(function() {
con... | define(['backbone', 'cilantro', 'text!/mock/fields.json'], function (Backbone, c, fieldsJSON) {
var fields = new Backbone.Collection(JSON.parse(fieldsJSON));
describe('FieldControl', function() {
var control;
describe('Base', function() {
beforeEach(function() {
con... |
Add constraint from name method | from whylog.constraints import DifferentConstraint, IdenticalConstraint, TimeConstraint
from whylog.constraints.exceptions import UnsupportedConstraintTypeError
class ConstraintRegistry(object):
CONSTRAINTS = {
'identical': IdenticalConstraint,
'time': TimeConstraint,
'different': Differen... | from whylog.constraints import DifferentConstraint, IdenticalConstraint, TimeConstraint
from whylog.constraints.exceptions import UnsupportedConstraintTypeError
class ConstraintRegistry(object):
CONSTRAINTS = {
'identical': IdenticalConstraint,
'time': TimeConstraint,
'different': Differen... |
Handle a non-existent field in an array
This was giving me an error, since I had several records for which a particular field was not defined. Since I use a schema-less DB (MongoDB), this field doesn't even exist with a null value. `data_get` performs an `array_key_exists` check before attempting to use `$part` as a... | <?php
namespace Nayjest\Grids;
use Exception;
use RuntimeException;
class ObjectDataRow extends DataRow
{
/**
* @param string $fieldName
* @return mixed
* @throws Exception
*/
protected function extractCellValue($fieldName)
{
if (strpos($fieldName, '.') !== false) {
... | <?php
namespace Nayjest\Grids;
use Exception;
use RuntimeException;
class ObjectDataRow extends DataRow
{
/**
* @param string $fieldName
* @return mixed
* @throws Exception
*/
protected function extractCellValue($fieldName)
{
if (strpos($fieldName, '.') !== false) {
... |
Add hasSidebar to LoggedInView to use the drag gesture to reveal the menu | import { View, __, Sidebar, ViewManager, NavBar } from 'erste';
import MainView from '../main-view';
class LoggedInView extends View {
constructor() {
super();
this.navBar = new NavBar({
title: __('Welcome to beveteran'),
hasMenuButton: true,
hasBackButton: true... | import { View, __, Sidebar, ViewManager, NavBar } from 'erste';
import MainView from '../main-view';
class LoggedInView extends View {
constructor() {
super();
this.navBar = new NavBar({
title: __('Welcome to beveteran'),
hasMenuButton: true,
hasBackButton: true... |
Add x and y field for laralytics_custme table migration | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateLaralyticsCustomTable
*/
class CreateLaralyticsCustomTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public funct... | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateLaralyticsCustomTable
*/
class CreateLaralyticsCustomTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public funct... |
Change TerminalNotifier's test image to be a URL | <?php
use BryanCrowe\Growl\Builder\TerminalNotifierBuilder;
class TerminalNotifierBuilderTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
parent::setUp();
$this->TerminalNotifierBuilder = new TerminalNotifierBuilder();
}
public function tearDown()
{
unset... | <?php
use BryanCrowe\Growl\Builder\TerminalNotifierBuilder;
class TerminalNotifierBuilderTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
parent::setUp();
$this->TerminalNotifierBuilder = new TerminalNotifierBuilder();
}
public function tearDown()
{
unset... |
Add timeout for requests to jenkins masters | var request = require('request').defaults({ timeout: 1000 });
var async = require('async');
function SuperMaster(masters){
this.cache = {};
this.masters = masters;
// Initialize cache with empty list for each master
masters.forEach((master) => { this.cache[master.name] = [] });
}
SuperMaster.prototyp... | var request = require('request');
var async = require('async');
function SuperMaster(masters){
this.cache = {};
this.masters = masters;
// Initialize cache with empty list for each master
masters.forEach((master) => { this.cache[master.name] = [] });
}
SuperMaster.prototype.getJobs = function(callbac... |
Fix date parsing having wrong offset | from datetime import datetime
import pytz
DATE_PREFIX = '/Date('
DATE_SUFFIX = ')/'
ELVIS_TIMEZONE = pytz.timezone('Europe/Tallinn')
UTC = pytz.timezone('UTC')
def decode_elvis_timestamp(timestamp: str):
"""Try to convert the argument to timestamp using ELVIS rules, return it unmodified if impossible"""
str... | from datetime import datetime, timedelta
import pytz
DATE_PREFIX = '/Date('
DATE_SUFFIX = ')/'
ELVIS_TIMEZONE = pytz.timezone('Europe/Tallinn')
def decode_elvis_timestamp(timestamp: str):
"""Try to convert the argument to timestamp using ELVIS rules, return it unmodified if impossible"""
str_timestamp = str... |
Remove NipypeTester from doc generation.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1373 ead46cd0-7350-4e37-8683-fc4c6f79bf00 | #!/usr/bin/env python
"""Script to auto-generate interface docs.
"""
# stdlib imports
import os
import sys
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
sys.path.insert(1,nipypepath)
# local imports
from inte... | #!/usr/bin/env python
"""Script to auto-generate interface docs.
"""
# stdlib imports
import os
import sys
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
sys.path.insert(1,nipypepath)
# local imports
from inte... |
Use try-with-resources to close as application code should. | package com.paritytrading.nassau.binaryfile;
import static com.paritytrading.nassau.binaryfile.BinaryFILEStatus.*;
import static java.util.Arrays.*;
import static org.junit.Assert.*;
import com.paritytrading.nassau.Messages;
import com.paritytrading.nassau.Strings;
import java.io.InputStream;
import org.junit.After;
... | package com.paritytrading.nassau.binaryfile;
import static com.paritytrading.nassau.binaryfile.BinaryFILEStatus.*;
import static java.util.Arrays.*;
import static org.junit.Assert.*;
import com.paritytrading.nassau.Messages;
import com.paritytrading.nassau.Strings;
import java.io.InputStream;
import org.junit.After;
... |
Update flake8 requirement from <3.6.0,>=3.5.0 to >=3.5.0,<3.8.0
Updates the requirements on [flake8](https://gitlab.com/pycqa/flake8) to permit the latest version.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.5.0...3.7.7)
Signed-off-by: dependabot[bot] ... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.1",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approve... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.1",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approve... |
Fix breaking changes regarding symfony 5 | <?php
namespace App\Exceptions;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $do... | <?php
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $do... |
Fix traceback because outputter expects data in {'host', data.. } format | '''
Execute overstate functions
'''
# Import salt libs
import salt.overstate
import salt.output
def over(env='base', os_fn=None):
'''
Execute an overstate sequence to orchestrate the executing of states
over a group of systems
'''
stage_num = 0
overstate = salt.overstate.OverState(__opts__, e... | '''
Execute overstate functions
'''
# Import salt libs
import salt.overstate
import salt.output
def over(env='base', os_fn=None):
'''
Execute an overstate sequence to orchestrate the executing of states
over a group of systems
'''
stage_num = 0
overstate = salt.overstate.OverState(__opts__, e... |
Change JS parser to only look for 200 success code not the actual "OK".
Oddly, in production, Chrome returns request.status as 'parsererror'
rather than "OK", which is what we get when running against a dev server.
The 'parseerror' is actually fairly reasonable -- we send back JSON
with our script-buster prefix of })]... | var XSSI_PREFIX = ")]}'";
function parseJson(s) {
return JSON.parse(s.replace(XSSI_PREFIX, ""));
}
$(function(){
$('div[data-delete-url]').each(function(index, element){
var groupName = $(element).data('group-name');
var button = $('<button id="delete-' + groupName + '" ' +
'class="gcb-list__icon ... | var XSSI_PREFIX = ")]}'";
function parseJson(s) {
return JSON.parse(s.replace(XSSI_PREFIX, ""));
}
$(function(){
$('div[data-delete-url]').each(function(index, element){
var groupName = $(element).data('group-name');
var button = $('<button id="delete-' + groupName + '" ' +
'class="gcb-list__icon ... |
Fix React missing key iterator warning | import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { logoutUser } from '../../redux/actions';
const NavBar = ({ isAuthenticated, logoutUser }) => (
<ul className="navbar">
<li key={0} className="navbar__link"><Link to="/">Home</Link></li>
... | import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { logoutUser } from '../../redux/actions';
const NavBar = ({ isAuthenticated, logoutUser }) => (
<ul className="navbar">
<li className="navbar__link"><Link to="/">Home</Link></li>
{ is... |
Remove now unnecessary "load" event listener | export default (shower) => {
const { container } = shower;
const { fullModeClass, listModeClass } = shower.options;
if (container.classList.contains(fullModeClass)) {
shower.enterFullMode();
} else {
container.classList.add(listModeClass);
}
const getScale = () => {
con... | export default (shower) => {
const { container } = shower;
const { fullModeClass, listModeClass } = shower.options;
if (container.classList.contains(fullModeClass)) {
shower.enterFullMode();
} else {
container.classList.add(listModeClass);
}
const getScale = () => {
con... |
Fix complex case to use syntax
"domain.com/test/*": {
path: './directory',
target: '[1]'
} | var nodeStatic = require('node-static');
var DispatchTable = require('../DispatchTable');
var regexpHelper = require('../regexpHelper');
module.exports = {
middleware: function(config) {
if (!config.static) return;
return new DispatchTable({
config: config.static,
requestHandler: function(req,... | var nodeStatic = require('node-static');
var DispatchTable = require('../DispatchTable');
var regexpHelper = require('../regexpHelper');
module.exports = {
middleware: function(config) {
if (!config.static) return;
return new DispatchTable({
config: config.static,
requestHandler: function(req,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.