text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Adjust FIJI script for applying CLAHE to a directory | #!/usr/bin/env jython
from ij import IJ
import os
from mpicbg.ij.clahe import Flat
from ij.process import ImageConverter
# http://fiji.sc/wiki/index.php/Enhance_Local_Contrast_(CLAHE)
# http://fiji.sc/cgi-bin/gitweb.cgi?p=mpicbg.git;a=blob;f=mpicbg/ij/clahe/PlugIn.java;h=663153764493547de560c08ee11f2e6b1e7e1a32;hb=H... | #!/usr/bin/env jython
from ij import IJ
import os
from mpicbg.ij.clahe import Flat
from ij.process import ImageConverter
# http://fiji.sc/wiki/index.php/Enhance_Local_Contrast_(CLAHE)
# http://fiji.sc/cgi-bin/gitweb.cgi?p=mpicbg.git;a=blob;f=mpicbg/ij/clahe/PlugIn.java;h=663153764493547de560c08ee11f2e6b1e7e1a32;hb=H... |
Add support to define custom messages.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php namespace Orchestra\Http;
use Orchestra\Support\Traits\ValidationTrait;
use Illuminate\Foundation\Http\FormRequest as Request;
class FormRequest extends Request
{
use ValidationTrait;
/**
* Get validation rules.
*
* @return array
*/
public function getValidationRules()
{
... | <?php namespace Orchestra\Http;
use Orchestra\Support\Traits\ValidationTrait;
use Illuminate\Foundation\Http\FormRequest as Request;
class FormRequest extends Request
{
use ValidationTrait;
/**
* Get validation rules.
*
* @return array
*/
public function getValidationRules()
{
... |
Change "Sklearn" to "Scikit-learn" in error message | """
Machine Learning module for NeuroImaging in python
==================================================
See http://nisl.github.com for complete documentation.
"""
"""
try:
import numpy
except ImportError:
print 'Numpy could not be found, please install it properly to use nisl.'
try:
import scipy
except... | """
Machine Learning module for NeuroImaging in python
==================================================
See http://nisl.github.com for complete documentation.
"""
"""
try:
import numpy
except ImportError:
print 'Numpy could not be found, please install it properly to use nisl.'
try:
import scipy
except... |
Use available base command service provider.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php namespace Orchestra\View;
use Orchestra\View\Console\DetectCommand;
use Orchestra\View\Console\ActivateCommand;
use Orchestra\View\Console\OptimizeCommand;
use Orchestra\Support\Providers\CommandServiceProvider as ServiceProvider;
class CommandServiceProvider extends ServiceProvider
{
/**
* The command... | <?php namespace Orchestra\View;
use Illuminate\Support\ServiceProvider;
use Orchestra\View\Console\DetectCommand;
use Orchestra\View\Console\ActivateCommand;
use Orchestra\View\Console\OptimizeCommand;
class CommandServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferr... |
Remove name unique constraint, move to email | const bcrypt = require('bcrypt')
module.exports = function (sequelize, DataTypes) {
const User = sequelize.define('User', {
id: {
primaryKey: true,
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4
},
name: {
type: DataTypes.STRING,
allowNull: false,
validate: {
... | const bcrypt = require('bcrypt')
module.exports = function (sequelize, DataTypes) {
const User = sequelize.define('User', {
id: {
primaryKey: true,
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4
},
name: {
unique: true,
type: DataTypes.STRING,
allowNull: false,
... |
Sort for testing. Fix for test failures introduced in r3557.
git-svn-id: 4b387fe5ada7764508e2ca96c335714e4c1692c6@3563 0d517254-b314-0410-acde-c619094fa49f | package edu.northwestern.bioinformatics.studycalendar.dao.reporting;
import edu.northwestern.bioinformatics.studycalendar.dao.StudyCalendarDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.c... | package edu.northwestern.bioinformatics.studycalendar.dao.reporting;
import edu.northwestern.bioinformatics.studycalendar.dao.StudyCalendarDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframe... |
Add JS for close alerts | ;(function($) {
$(function(){
/*!
-- @ Close alerts @ --
*/
$('.alert .close').on('click',function(e){
e.preventDefault();
$(this).parent().fadeOut(500,function(){
$(this).remove();
});
});
/*!
--... | ;(function($) {
/*
@name : checkRadio
@function : check or uncheck checkbox & radio inputs
@params : no params
*/
function checkRadio() {
if($('input[type="radio"], input[type="checkbox"]').length) {
$('input[type="radio"], input[type="checkbox"]').each(function(... |
Add defaults to guild type playlist settings | package com.avairebot.orion.database.transformers;
import com.avairebot.orion.contracts.database.transformers.Transformer;
import com.avairebot.orion.database.collection.DataRow;
import com.google.gson.Gson;
public class GuildTypeTransformer extends Transformer {
private static final Gson GSON = new Gson();
... | package com.avairebot.orion.database.transformers;
import com.avairebot.orion.contracts.database.transformers.Transformer;
import com.avairebot.orion.database.collection.DataRow;
import com.google.gson.Gson;
public class GuildTypeTransformer extends Transformer {
private static final Gson GSON = new Gson();
... |
Fix UI filters on Feature Flags page | hqDefine('toggle_ui/js/flags', [
'jquery',
'knockout',
'reports/js/config.dataTables.bootstrap',
'hqwebapp/js/components.ko', // select toggle widget
], function (
$,
ko,
datatablesConfig
) {
var dataTableElem = '.datatable';
var viewModel = {
tagFilter: ko.observable(null... | hqDefine('toggle_ui/js/flags', [
'jquery',
'knockout',
'reports/js/config.dataTables.bootstrap',
'hqwebapp/js/components.ko', // select toggle widget
], function (
$,
ko,
datatablesConfig
) {
var dataTableElem = '.datatable';
var viewModel = {
tagFilter: ko.observable(null... |
Add conditional PDO statement for sqlsrv
Add conditional check for PDO driver and added an edited PDO statement to address limit issue with sqlsrv PDO driver . | <?php
/*
* This file is part of Slim HTTP Basic Authentication middleware
*
* Copyright (c) 2013-2014 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* https://github.com/tuupola/slim-basic-auth
*
*/
namespace Slim\Middleware\HttpB... | <?php
/*
* This file is part of Slim HTTP Basic Authentication middleware
*
* Copyright (c) 2013-2014 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* https://github.com/tuupola/slim-basic-auth
*
*/
namespace Slim\Middleware\HttpB... |
Make calendar not editbale for actors | from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.db.models import DateTimeField, BooleanField, OneToOneField
from agenda.models import Calendar
class Actor(models.Model):
"""
An actor is an entity playing a role in your system. It can be anything that
belon... | from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.db.models import DateTimeField, BooleanField, OneToOneField
from agenda.models import Calendar
class Actor(models.Model):
"""
An actor is an entity playing a role in your system. It can be anything that
belon... |
Quit with error code when log('throw') is called | var colors = require('colors');
var CargoLog = function () {
var scope = this;
this.verbose = false;
return function (cargo) {
scope.cargo = cargo;
return scope.log;
};
};
/**
* Log to the console
* @return null
*/
CargoLog.prototype.log = function () {
var args = Array.prototyp... | var colors = require('colors');
var CargoLog = function () {
var scope = this;
this.verbose = false;
return function (cargo) {
scope.cargo = cargo;
return scope.log;
};
};
/**
* Log to the console
* @return null
*/
CargoLog.prototype.log = function () {
var args = Array.prototyp... |
Add comma after array item | <?php
namespace Hackzilla\Bundle\TicketBundle\TwigExtension;
use Symfony\Component\DependencyInjection\ContainerInterface;
class TicketGlobalExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
{
/**
* @var \Symfony\Component\DependencyInjection\ContainerInterface
*/
prote... | <?php
namespace Hackzilla\Bundle\TicketBundle\TwigExtension;
use Symfony\Component\DependencyInjection\ContainerInterface;
class TicketGlobalExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
{
/**
* @var \Symfony\Component\DependencyInjection\ContainerInterface
*/
prote... |
Add build as available environment | """Create IAM Instance Profiles, Roles, Users, and Groups."""
import argparse
import logging
from .create_iam import create_iam_resources
LOG = logging.getLogger(__name__)
def main():
"""Command to create IAM Instance Profiles, Roles, Users, and Groups."""
logging.basicConfig()
parser = argparse.Argume... | """Create IAM Instance Profiles, Roles, Users, and Groups."""
import argparse
import logging
from .create_iam import create_iam_resources
LOG = logging.getLogger(__name__)
def main():
"""Command to create IAM Instance Profiles, Roles, Users, and Groups."""
logging.basicConfig()
parser = argparse.Argume... |
Fix title comment on Italian locale js | /**
* Italian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["it-IT"] = {
font_styles: {
normal: "Testo normale",
h1: "Titolo 1",
h2: "Titolo 2"
},
emphasis: {
bold: "Grassetto",
italic: "Cors... | /**
* Uruguayan spanish translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["it-IT"] = {
font_styles: {
normal: "Testo normale",
h1: "Titolo 1",
h2: "Titolo 2"
},
emphasis: {
bold: "Grassetto",
ita... |
Add a logging statement in TimestampProvider | package com.thinkaurelius.titan.diskstorage.util;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class AbstractTimestampProvider implements TimestampProvider {
private static final Logger log =
LoggerFactory.getLogger(AbstractTimestampP... | package com.thinkaurelius.titan.diskstorage.util;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class AbstractTimestampProvider implements TimestampProvider {
private static final Logger log =
LoggerFactory.getLogger(AbstractTimestampP... |
Add exception for unregistred IDs | /**
* Jatabase
*
* @author Gabriel Jacinto <gamjj74@hotmail.com>
* @license MIT License
* @package jatabase
*/
'use strict';
var utils = require('../utils');
module.exports = function (Model) {
return function (where) {
let db = require(Model.file),
collection = db[Model.collection];
if (typeo... | /**
* Jatabase
*
* @author Gabriel Jacinto <gamjj74@hotmail.com>
* @license MIT License
* @package jatabase
*/
'use strict';
var utils = require('../utils');
module.exports = function (Model) {
return function (where) {
let db = require(Model.file),
collection = db[Model.collection];
if (typeo... |
Remove more SSL verification (ugh) | <?php
namespace Scat\Service;
class Ordure
{
public $url;
public $key;
public $static_url;
public function __construct(Config $config) {
$this->url= $config->get('ordure.url');
$this->key= $config->get('ordure.key');
$this->static_url= $config->get('ordure.static_url');
}
public function mark... | <?php
namespace Scat\Service;
class Ordure
{
public $url;
public $key;
public $static_url;
public function __construct(Config $config) {
$this->url= $config->get('ordure.url');
$this->key= $config->get('ordure.key');
$this->static_url= $config->get('ordure.static_url');
}
public function mark... |
Return name instead of unicode in autocomplete API | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... | import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from tx_highered.models import Institution
class ApiView(View):
def get(self, request, *args, **kwargs):
data = self.get_content_data()
content = json.... |
Fix IllegalStateException if we recreate Activities
We do not need to unregister `WifiBroadcastReceiver` if some Activities still need to monitor Wi-Fi. | package cl.monsoon.s1next.widget;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
public final class AppActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
/**
* Forked from http://stackoverflow.com/a/13809991
... | package cl.monsoon.s1next.widget;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
public final class AppActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
/**
* Forked from http://stackoverflow.com/a/13809991
... |
Add bundles to the kernel | <?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\Sec... | <?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\Sec... |
Use options resolver defaults instead of normalizer in form types. | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2016, 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\UserBundle\Form\T... | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2016, 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\UserBundle\Form\T... |
docs(project): Fix module docstring for url config | # pylint: disable=C0111
"""All available endpoints of the chaospizza web project."""
from django.conf import settings
from django.conf.urls import include, url
# from django.conf.urls.static import static
from django.contrib import admin
from django.http import HttpResponse
# from django.views.generic import TemplateVi... | """All available endpoints of the chaospizza web project."""
# pylint: disable=C0111
from django.conf import settings
from django.conf.urls import include, url
# from django.conf.urls.static import static
from django.contrib import admin
from django.http import HttpResponse
# from django.views.generic import TemplateVi... |
Change direct message warning to match upstream | import React from 'react';
import Motion from 'flavours/glitch/util/optional_motion';
import spring from 'react-motion/lib/spring';
import { defineMessages, FormattedMessage } from 'react-intl';
// This is the spring used with our motion.
const motionSpring = spring(1, { damping: 35, stiffness: 400 });
// Messages.... | import React from 'react';
import Motion from 'flavours/glitch/util/optional_motion';
import spring from 'react-motion/lib/spring';
import { defineMessages, FormattedMessage } from 'react-intl';
// This is the spring used with our motion.
const motionSpring = spring(1, { damping: 35, stiffness: 400 });
// Messages.... |
Use Process(array) instead of Process(string) | <?php
declare(strict_types=1);
namespace Marein\Nchan\Tests\TestServer;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
use PHPUnit\Framework\TestSuite;
use Symfony\Component\Process\Process;
final class PhpUnitStartServerListener implements TestListener
{
use TestLis... | <?php
declare(strict_types=1);
namespace Marein\Nchan\Tests\TestServer;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
use PHPUnit\Framework\TestSuite;
use Symfony\Component\Process\Process;
final class PhpUnitStartServerListener implements TestListener
{
use TestLis... |
Simplify database query when looking up an alias | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import ShortURL
from .m... | from __future__ import unicode_literals
import base32_crockford
import logging
from django.db.models import F
from django.http import Http404
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from .models import ShortURL
from .m... |
Add test for schema generation on nested objects. | var schemaGenerator = require("./schema-generator.js");
describe("Schema Generation", function(){
it("Knows that strings should use the string Editor", function(){
var data = {
greeting: "hi"
};
var schema = schemaGenerator.generateSchema(data);
expect(schema.greeting.e... | var schemaGenerator = require("./schema-generator.js");
describe("Schema Generation", function(){
it("Knows that strings should use the string Editor", function(){
var data = {
greeting: "hi"
};
var schema = schemaGenerator.generateSchema(data);
expect(schema.greeting.e... |
Add moon (Q405) to the list of globes
Change-Id: I2dd9f87fcb1d748bff94328575f8439dc36035e3 | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... |
Add square brackets [] to list of special characters that are not escaped | <?php
namespace {
if (!function_exists('mb_parse_url')) {
/**
* UTF-8 aware parse_url() replacement.
*
* Taken from php.net manual comments {@link http://php.net/manual/en/function.parse-url.php#114817}
*
* @param string $url The URL to parse
* ... | <?php
namespace {
if (!function_exists('mb_parse_url')) {
/**
* UTF-8 aware parse_url() replacement.
*
* Taken from php.net manual comments {@link http://php.net/manual/en/function.parse-url.php#114817}
*
* @param string $url The URL to parse
* ... |
Create prompt if no config file found | const
fs = require('fs'),
inquirer = require('inquirer');
const
configFilePath = process.env.HOME + '/.gitauthors.json',
authors = loadConfig(),
choices = createChoices(authors);
if (authors) {
inquirer.prompt([
{
name: 'q1',
message: 'Which author details would... | const
fs = require('fs'),
inquirer = require('inquirer');
const
configFilePath = process.env.HOME + '/.gitauthors.json',
authors = loadConfig(),
choices = createChoices(authors);
if (authors) {
inquirer.prompt([
{
name: 'q1',
message: 'Which author details would... |
Fix big preventing some JS from executing | <?php if (!$_SKIP_HEADER) {?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width... | <?php if (!$_SKIP_HEADER) {?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width... |
Fix logins on VK and FB | module.exports = {
title: 'Andrey Prokopyuk',
summary: [
"Hello! My name is Andrey. I'm a developer in",
'<a href="https://yandex.com" target="_blank">Yandex</a>,',
'working on Search Engine Result Page'
].join(' '),
socialNetworks: [
{
title: 'GitHub',
... | module.exports = {
title: 'Andrey Prokopyuk',
summary: [
"Hello! My name is Andrey. I'm a developer in",
'<a href="https://yandex.com" target="_blank">Yandex</a>,',
'working on Search Engine Result Page'
].join(' '),
socialNetworks: [
{
title: 'GitHub',
... |
Make attendance report verify the correct right.
Addresses issue #24. | package org.kumoricon.site.report.attendees;
import com.vaadin.navigator.View;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.spring.annotation.ViewScope;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import org.kumoricon.site.report.ReportVi... | package org.kumoricon.site.report.attendees;
import com.vaadin.navigator.View;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.spring.annotation.ViewScope;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import org.kumoricon.site.report.ReportVi... |
Fix python 2.6 default string formatting | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in iter(d.items()):
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... | import imp
import json
import os
import sys
class Dot(dict):
def __init__(self, d):
super(dict, self).__init__()
for k, v in iter(d.items()):
if isinstance(v, dict):
self[k] = Dot(v)
else:
self[k] = v
def __getattr__(self, attr):
... |
Refactor code to improve readability | <?php
function mergeKeys( $config, $configLocal ) {
if ( !is_array( $config ) ) {
return $configLocal;
}
foreach ( $config as $key => $value ) {
if ( isset( $configLocal[ $key ] ) ) {
$config[ $key ] = mergeKeys( $config[ $key ], $configLocal[ $key ] )... | <?php
function mergeKeys( $config, $configLocal ) {
if ( !is_array( $config ) ) {
return $configLocal;
}
foreach ( $config as $key => $value ) {
if ( isset( $configLocal[ $key ] ) ) {
$config[ $key ] = mergeKeys( $config[ $key ], $configLocal[ $key ] )... |
Remove redundant type parameter from custom assertion assertMismatch. | package com.mistraltech.smog.examples.utils;
import java.util.regex.Pattern;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.StringDescription;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public... | package com.mistraltech.smog.examples.utils;
import java.util.regex.Pattern;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.StringDescription;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public... |
Fix regression with deep linking | import window from 'global';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
// this component renders an iframe, which gets updates via post-messages
export class IFrame extends Component {
iframe = null;
componentDidMount() {
const { id } = this.props;
this.iframe = window.... | import window from 'global';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
// this component renders an iframe, which gets updates via post-messages
export class IFrame extends Component {
iframe = null;
componentDidMount() {
const { id } = this.props;
this.iframe = window.... |
Fix some tests that required Object instances due to 'to equal', and now esprima uses other classes. | /*global describe, it*/
var expect = require('./unexpected-with-plugins').clone();
var parseExpression = require('../lib/parseExpression');
describe('parseExpression', function () {
expect.addAssertion('to parse as', function (expect, subject, value) {
expect(parseExpression(subject), 'to exhaustively sati... | /*global describe, it*/
var expect = require('./unexpected-with-plugins').clone();
var parseExpression = require('../lib/parseExpression');
describe('parseExpression', function () {
expect.addAssertion('to parse as', function (expect, subject, value) {
expect(parseExpression(subject), 'to equal', value);
... |
Revert "temporary fix for lightbox interruption of animation"
This reverts commit 8d55ec105855a6c48a9aaea6509a7dc59fdd3240. | // page refresh always brings user to top of page
$(window).on('beforeunload', function() {
$(window).scrollTop(0);
});
// scroll animation
window.addEventListener('scroll', function() {
// something to support older browsers
var scroll = window.requestAnimationFrame ||
function(callback){ window.setTim... | // page refresh always brings user to top of page
$(window).on('beforeunload', function() {
$(window).scrollTop(0);
});
// scroll animation
window.addEventListener('scroll', function() {
// something to support older browsers
var scroll = window.requestAnimationFrame ||
function(callback){ window.setTim... |
Call wraps on the restoring_chdir decorator. | import os
from functools import wraps
def restoring_chdir(fn):
@wraps(fn)
def decorator(*args, **kw):
try:
path = os.getcwd()
return fn(*args, **kw)
finally:
os.chdir(path)
return decorator
class BaseBuilder(object):
"""
The Base for all Builder... | import os
def restoring_chdir(fn):
def decorator(*args, **kw):
try:
path = os.getcwd()
return fn(*args, **kw)
finally:
os.chdir(path)
return decorator
class BaseBuilder(object):
"""
The Base for all Builders. Defines the API for subclasses.
"""... |
Update syntax to work with elixir version 3 / Laravel 5.1
- reference: https://github.com/laravel/elixir/releases/tag/3.0.0
- tested: in homestead with `gulp`, passed
ps
Need to use this for our site, this will really help us with our IE fixes, thanks! | var gulp = require('gulp');
var bless = require('gulp-bless');
var notify = require('gulp-notify');
var path = require('path');
var Elixir = require('laravel-elixir');
var Task = Elixir.Task;
Elixir.extend('bless', function(src, outputDir, options) {
src = src || './public/css/**/*.css';
if (typeof outputDir... | var gulp = require('gulp');
var bless = require('gulp-bless');
var notify = require('gulp-notify');
var elixir = require('laravel-elixir');
var path = require('path');
elixir.extend('bless', function(src, outputDir, options) {
src = src || './public/css/**/*.css';
if (typeof outputDir == 'object') {
o... |
Update to use the static Brain.init() | import logging
import os
from brain import Brain
from cmdparse import Command
log = logging.getLogger("hal")
class InitCommand(Command):
def __init__(self):
Command.__init__(self, "init", summary="Initialize a new brain")
self.add_option("", "--force", action="store_true")
self.add_opt... | import logging
import os
import brain
from cmdparse import Command
log = logging.getLogger("hal")
class InitCommand(Command):
def __init__(self):
Command.__init__(self, "init", summary="Initialize a new brain")
self.add_option("", "--force", action="store_true")
self.add_option("", "--... |
Implement ftp_site MKDIR command for g4/storage - refactor | <?php
namespace G4\Storage\Ftp;
class Directory
{
private $connection;
private $directoryPath;
private $pathParts;
private $useFtpSiteCommand;
public function __construct($connection, $filePath, $useFtpSiteCommand = false)
{
$this->connection = $connection;
$this->di... | <?php
namespace G4\Storage\Ftp;
class Directory
{
private $connection;
private $directoryPath;
private $pathParts;
private $useFtpSiteCommand;
public function __construct($connection, $filePath, $useFtpSiteCommand = false)
{
$this->connection = $connection;
$this->di... |
Update suggest + fetch tags methods to return arrays
- prev was using `Set` but it cannot be simply serialized to a primitive to send over the web ext interscript messaging API | import index from './'
import { keyGen, removeKeyType } from './util'
/**
* @param {string} [query=''] Plaintext query string to match against start of tag names.
* eg. 'wo' would match 'work', 'women' (assuming both these tags exist).
* @param {number} [limit=10] Max number of suggestions to return.
* @returns {... | import index from './'
import { keyGen, removeKeyType } from './util'
/**
* @param {string} [query=''] Plaintext query string to match against start of tag names.
* eg. 'wo' would match 'work', 'women' (assuming both these tags exist).
* @param {number} [limit=10] Max number of suggestions to return.
* @returns {... |
Remove Singletone Test of FileModel | package model;
import org.junit.Test;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;
import static org.junit.Assert.*;
/**
* Created by Elliad on 2016-05-08.
*/
public class FileModelTest {
@Test
public void fileR... | package model;
import org.junit.Test;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;
import static org.junit.Assert.*;
/**
* Created by Elliad on 2016-05-08.
*/
public class FileModelTest {
@Test
public void singl... |
Replace for loop with foreach | <?php
namespace BinSoul\Net\Mqtt;
/**
* Matches a topic filter with an actual topic.
*
* @author Alin Eugen Deac <ade@vestergaardcompany.com>
*/
class TopicMatcher
{
/**
* Check if the given topic matches the filter.
*
* @param string $filter e.g. A/B/+, A/B/#
* @param string $topic e.g.... | <?php
namespace BinSoul\Net\Mqtt;
/**
* Matches a topic filter with an actual topic.
*
* @author Alin Eugen Deac <ade@vestergaardcompany.com>
*/
class TopicMatcher
{
/**
* Check if the given topic matches the filter.
*
* @param string $filter e.g. A/B/+, A/B/#
* @param string $topic e.g.... |
Set up Travis test environment (cont. 3)
Autowatch didn't help. Seeing if `singleRun = true` causes
it to stop after running the tests. | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
var configuration = {
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma... | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
var configuration = {
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma... |
Include campaign overview page in nav | <nav class="navigation -white -floating">
<a class="navigation__logo" href="/"><span>DoSomething.org</span></a>
<div class="navigation__menu">
@if (Auth::user())
<ul class="navigation__primary">
<li>
<a href="/campaigns">
<strong cl... | <nav class="navigation -white -floating">
<a class="navigation__logo" href="/"><span>DoSomething.org</span></a>
<div class="navigation__menu">
@if (Auth::user())
<ul class="navigation__primary">
<li>
<a href="#">
<strong class="navi... |
Add missing space for curly. NOTE: Last commit comment was truncated from typo, basically was a fix for Firefox and an escaping bug with window.location.hash. | function uriSync(method, model, options) {
var resp = null,
S4 = function() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
},
guid = function() {
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
},
URI = {
... | function uriSync(method, model, options) {
var resp = null,
S4 = function() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
},
guid = function() {
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
},
URI = {
... |
Switch condition order to support PHP 8 | <?php declare(strict_types=1);
namespace Invoker\ParameterResolver;
use ReflectionFunctionAbstract;
use ReflectionNamedType;
/**
* Inject entries using type-hints.
*
* Tries to match type-hints with the parameters provided.
*/
class TypeHintResolver implements ParameterResolver
{
public function getParameter... | <?php declare(strict_types=1);
namespace Invoker\ParameterResolver;
use ReflectionFunctionAbstract;
use ReflectionNamedType;
/**
* Inject entries using type-hints.
*
* Tries to match type-hints with the parameters provided.
*/
class TypeHintResolver implements ParameterResolver
{
public function getParameter... |
Fix a python3 import . | try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
import datetime
import multiprocessing
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand, CommandEr... | import urllib
import datetime
import multiprocessing
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand, CommandError
from core.models import URL, Cron
def request_url(url):
urllib.urlopen... |
fix: Add missing semicolon in crawler controller | <?php
namespace Mini\Model\TypeCrawler;
use \Mini\Model\TypeCrawler\Storage\StorageFactory;
//TODO disable crawlers if the type is disabled in the DB.
class TypeCrawlerController {
/** @var array */
private $crawlers;
/** @var StorageFactory */
private $storage;
function __construct(StorageFacto... | <?php
namespace Mini\Model\TypeCrawler;
use \Mini\Model\TypeCrawler\Storage\StorageFactory;
//TODO disable crawlers if the type is disabled in the DB.
class TypeCrawlerController {
/** @var array */
private $crawlers;
/** @var StorageFactory */
private $storage;
function __construct(StorageFacto... |
Make the delay longer so that test passes more consistently. | define(["pat-masonry"], function(pattern) {
describe("pat-masonry", function() {
beforeEach(function() {
$("<div/>", {id: "lab"}).appendTo(document.body);
});
afterEach(function() {
$("#lab").remove();
});
it("Sets class masonry-ready on the element ... | define(["pat-masonry"], function(pattern) {
describe("pat-masonry", function() {
beforeEach(function() {
$("<div/>", {id: "lab"}).appendTo(document.body);
});
afterEach(function() {
$("#lab").remove();
});
it("Sets class masonry-ready on the element ... |
Set max-age=0 for CacheControl on profile image S3 uploads | const s3 = require('aws-sdk').S3;
const s3Bucket = require('../../../config')('/aws/s3Bucket');
const logger = require('../../lib/logger');
module.exports = () => ({
uploadImageStream(stream, key) {
const contentType = (stream.hapi && stream.hapi.headers['content-type']) ?
stream.hapi.headers['content-type... | const s3 = require('aws-sdk').S3;
const s3Bucket = require('../../../config')('/aws/s3Bucket');
const logger = require('../../lib/logger');
module.exports = () => ({
uploadImageStream(stream, key) {
const contentType = (stream.hapi && stream.hapi.headers['content-type']) ?
stream.hapi.headers['content-type... |
Make some change in the annotation | <?php
namespace AppBundle\Model;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\Type;
/**
* Class EmployeesResponse
* @package AppBundle\Model
* @ExclusionPolicy("all")
*/
class EmployeesResponse
{
/**... | <?php
namespace AppBundle\Model;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\Type;
/**
* Class EmployeesResponse
* @package AppBundle\Model
* @ExclusionPolicy("all")
*/
class EmployeesResponse
{
/**... |
Print everything out in csv and use tableau to do calculation | import os
from utils import Reader
import code
import sys
def extract_authors(tweets):
for t in tweets:
if t.is_post():
actor = t.actor()
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
... | import os
from utils import Reader
import code
import sys
author_dict = dict()
def extract_authors(tweets):
# code.interact(local=dict(globals(), **locals()))
for t in tweets:
if t.is_post():
actor = t.actor()
create_key(actor['id'])
increment_author(actor, t.is_p... |
Fix race condition in detumbling experiment test
In detumbling experiment test, experiment was commanded to run for 4
hours. After that OBC time was advanced also by 4 hours, however it was
not enough as during next mission loop OBC time was few milliseconds
before scheduled experiment end. | from datetime import timedelta, datetime
import telecommand
from obc.experiments import ExperimentType
from system import auto_power_on
from tests.base import BaseTest
from utils import TestEvent
class TestExperimentDetumbling(BaseTest):
@auto_power_on(auto_power_on=False)
def __init__(self, *args... | from datetime import timedelta, datetime
import telecommand
from obc.experiments import ExperimentType
from system import auto_power_on
from tests.base import BaseTest
from utils import TestEvent
class TestExperimentDetumbling(BaseTest):
@auto_power_on(auto_power_on=False)
def __init__(self, *args... |
Remove legacy check from diskreport migration | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Capsule\Manager as Capsule;
class Diskreport extends Migration
{
public function up()
{
$capsule = new Capsule();
$capsule::schema()->create('diskreport', function (Blueprint $... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Capsule\Manager as Capsule;
class Diskreport extends Migration
{
public function up()
{
$capsule = new Capsule();
$legacy_migration_version = $capsule::table('migration')
... |
Fix Style CI unused import | <?php
declare(strict_types=1);
namespace Tests;
use App\Commands\FakeDefaultCommand;
use App\Commands\FakeFooCommand;
use App\HiddenCommands\FakeHiddenCommand;
use App\OtherCommands\FakeOtherCommand;
use Illuminate\Support\Facades\Artisan;
final class LoadConfigurationsTest extends TestCase
{
public function te... | <?php
declare(strict_types=1);
namespace Tests;
use App\Commands\FakeDefaultCommand;
use App\Commands\FakeFooCommand;
use App\HiddenCommands\FakeHiddenCommand;
use App\OtherCommands\FakeOtherCommand;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\File;
final class LoadConfigurationsTest exte... |
Handle topics with zero elements | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
resp = req.get('http://localhost:5000/api/topic/{}'.format(topic))\
d... | from datetime import datetime
import requests as req
from pymongo import MongoClient
from pypocketexplore.config import MONGO_URI
from time import sleep
def extract_topic_items(topic):
db = MongoClient(MONGO_URI).get_default_database()
data = req.get('http://localhost:5000/api/topic/{}'.format(topic)).json()... |
Change test method name to better match | import unittest
from collections import namedtuple
# TODO: Move this code to a module so we don't depend on PYTHONPATH and that sort
# of ugliness.
from jarvis import convert_file_to_json, get_tags
JarvisSettings = namedtuple('JarvisSettings', ['tags_directory'])
class TestJarvis(unittest.TestCase):
def setUp(se... | import unittest
from collections import namedtuple
# TODO: Move this code to a module so we don't depend on PYTHONPATH and that sort
# of ugliness.
from jarvis import convert_file_to_json, get_tags
JarvisSettings = namedtuple('JarvisSettings', ['tags_directory'])
class TestJarvis(unittest.TestCase):
def setUp(se... |
Allow PiSense readings to be toggled on/off | #!/usr/bin/env python3
from Sensor import SenseController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
import time
DEVICE = "PiSense"
DELAY = 0.25
class Handler:
def __init__(self, display, logger, sensor):
self.display = display
self.l... | #!/usr/bin/env python3
from Sensor import SenseController
from KeyDispatcher import KeyDispatcher
from Display import Display
from DataLogger import SQLiteLogger
import time
DEVICE = "PiSense"
DELAY = 0.0
class Handler:
def __init__(self, display, logger, sensor):
self.display = display
self.lo... |
Add vendor directory to dist | var gulp = require('gulp');
var clean = require('gulp-clean');
var zip = require('gulp-zip');
var bases = {
root: 'dist/'
};
var paths = [
'core/**',
'!core/data',
'!core/data/**/*',
'!core/logs/**/*.txt',
'!core/logs/**/*.pdf',
'!core/logs/**/*.html',
'!core/tests',
'!core/tests/... | var gulp = require('gulp');
var clean = require('gulp-clean');
var zip = require('gulp-zip');
var bases = {
root: 'dist/'
};
var paths = [
'core/**',
'!core/data',
'!core/data/**/*',
'!core/logs/**/*.txt',
'!core/logs/**/*.pdf',
'!core/logs/**/*.html',
'!core/tests',
'!core/tests/... |
Make sure that the error code is returned properly | from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs a... | from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs a... |
Clarify that self_chosen_courses == enrolled
Fixes #75. | from django import forms
from django.utils.translation import ugettext_lazy as _
from dal import autocomplete
from .models import Course, Options
class OptionsForm(forms.ModelForm):
"""
A form solely used for autocompleting Courses in the admin,
using django-autocomplete-light,
"""
self_chosen_c... | from django import forms
from django.utils.translation import ugettext_lazy as _
from dal import autocomplete
from .models import Course, Options
class OptionsForm(forms.ModelForm):
"""
A form solely used for autocompleting Courses in the admin,
using django-autocomplete-light,
"""
self_chosen_c... |
Fix ExpressionNode names that changed in django 1.5 | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... |
Add a fancy log mode. | # logger module
from datetime import datetime
import os
logfile = None
logbuf = []
def init(analysis_path):
global logfile
if not os.path.isdir(analysis_path):
log("logger: analysis_path missing:", analysis_path)
use_log_dir = False
if use_log_dir:
logdir = os.path.join(analysis_path,... | # logger module
from datetime import datetime
import os
logfile = None
logbuf = []
def init(analysis_path):
global logfile
if not os.path.isdir(analysis_path):
log("logger: analysis_path missing:", analysis_path)
use_log_dir = False
if use_log_dir:
logdir = os.path.join(analysis_path,... |
Make compilable under Java 1.5. | package org.junit.experimental.categories;
import java.util.ArrayList;
import java.util.List;
import org.junit.internal.Classes;
import org.junit.runner.FilterFactory;
import org.junit.runner.FilterFactoryParams;
import org.junit.runner.manipulation.Filter;
/**
* Implementation of FilterFactory for Categ... | package org.junit.experimental.categories;
import java.util.ArrayList;
import java.util.List;
import org.junit.internal.Classes;
import org.junit.runner.FilterFactory;
import org.junit.runner.FilterFactoryParams;
import org.junit.runner.manipulation.Filter;
/**
* Implementation of FilterFactory for Categ... |
Debug thing pushing to adw.. | (function () {
'use strict';
angular
.module('dpDataSelection')
.component('dpDataSelectionFormatter', {
bindings: {
variables: '<',
formatter: '@',
useInline: '<'
},
templateUrl: 'modules/data-selection/compone... | (function () {
'use strict';
angular
.module('dpDataSelection')
.component('dpDataSelectionFormatter', {
bindings: {
variables: '<',
formatter: '@',
useInline: '<'
},
templateUrl: 'modules/data-selection/compone... |
Move labels to api for future translation | 'use strict';
var D3 = require('d3');
var Queries = require('../../helpers/queries');
var Utils = require('../../helpers/utils');
var OverviewParser = require('../../helpers/overview_parser');
exports.showPage = {
handler: function(request, reply) {
return reply.view('performance/overview');
}
};
exp... | 'use strict';
var D3 = require('d3');
var Queries = require('../../helpers/queries');
var Utils = require('../../helpers/utils');
var OverviewParser = require('../../helpers/overview_parser');
exports.showPage = {
handler: function(request, reply) {
return reply.view('performance/overview');
}
};
exp... |
Update to work with new Geostore API | define([
'Class', 'uri', 'bluebird',
'map/services/DataService'
], function(Class, UriTemplate, Promise, ds) {
'use strict';
var GET_REQUEST_ID = 'GeostoreService:get',
SAVE_REQUEST_ID = 'GeostoreService:save';
var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}';
var GeostoreService = Clas... | define([
'Class', 'uri', 'bluebird',
'map/services/DataService'
], function(Class, UriTemplate, Promise, ds) {
'use strict';
var GET_REQUEST_ID = 'GeostoreService:get',
SAVE_REQUEST_ID = 'GeostoreService:save';
var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}';
var GeostoreService = Clas... |
Add missing comma in apimanagement mapper | /*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'... | /*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'... |
Allow to pass other things that string in args | <?php
namespace DICIT;
class ReferenceResolver
{
const CONTAINER_REFERENCE = '$container';
/**
*
* @var Container
*/
private $container;
public function __construct(Container $container)
{
$this->container = $container;
}
public function resolve($reference)
{
... | <?php
namespace DICIT;
class ReferenceResolver
{
const CONTAINER_REFERENCE = '$container';
/**
*
* @var Container
*/
private $container;
public function __construct(Container $container)
{
$this->container = $container;
}
public function resolve($reference)
{
... |
Update geocoder interface to reflect that geocoders can send back results that destinations of type Rectangle or Cartesian3 | /*global define*/
define([
'./defineProperties',
'./DeveloperError'
], function(
defineProperties,
DeveloperError) {
'use strict';
/**
* @typedef {Object} GeocoderResult
* @property {String} displayName The display name for a location
* @property {Rectangle|Cartesian3... | /*global define*/
define([
'./defineProperties',
'./DeveloperError'
], function(
defineProperties,
DeveloperError) {
'use strict';
/**
* @typedef {Object} GeocoderResult
* @property {String} displayName The display name for a location
* @property {Rectangle} rectangle... |
Fix name field change & deprecated sf3.4 | <?php
/**
* @author: Gabriel BONDAZ <gabriel.bondaz@idci-consulting.fr>
* @license: MIT
*/
namespace IDCI\Bundle\ExtraFormBundle\Form;
use IDCI\Bundle\ExtraFormBundle\Form\Type\TagsType;
use IDCI\Bundle\ExtraFormBundle\Model\ConfiguredType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Form... | <?php
/**
* @author: Gabriel BONDAZ <gabriel.bondaz@idci-consulting.fr>
* @license: MIT
*/
namespace IDCI\Bundle\ExtraFormBundle\Form;
use IDCI\Bundle\ExtraFormBundle\Model\ConfiguredType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResol... |
Change priority of output converters | <?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 ... |
Clear message textbox after message is sent. | var CHAT_SERVER = "http://localhost:7000"
var DEFAULT_USERNAME = "Guest";
$(document).ready(function(){
var socket = io.connect(CHAT_SERVER);
socket.on('welcome', showGreetings);
socket.on('message', showIncomingMessage);
socket.on('info', showSystemInfo);
addWaterMark();
sendButtonOnClick();
changeBut... | var CHAT_SERVER = "http://localhost:7000"
var DEFAULT_USERNAME = "Guest";
$(document).ready(function(){
var socket = io.connect(CHAT_SERVER);
socket.on('welcome', showGreetings);
socket.on('message', showIncomingMessage);
socket.on('info', showSystemInfo);
addWaterMark();
sendButtonOnClick();
changeBut... |
test: Use the correct option when dumping dependent libraries. | from __future__ import print_function
import sys
import subprocess
import os
@given('a system executable {exe}')
def step_impl(context, exe):
binary = None
if sys.platform.startswith('win'):
try:
binary = subprocess.check_output(["where", exe]).decode('utf8').strip()
except:
... | from __future__ import print_function
import sys
import subprocess
import os
@given('a system executable {exe}')
def step_impl(context, exe):
binary = None
if sys.platform.startswith('win'):
try:
binary = subprocess.check_output(["where", exe]).decode('utf8').strip()
except:
... |
Add coveralls to karma plugins list. | module.exports = function(config){
config.set({
basePath : './',
files : [
'app/bower_components/angular/angular.min.js',
'app/bower_components/angular-ui-router/release/angular-ui-router.min.js',
'app/bower_components/angular-resource/angular-resource.min.js',
'app/bower_components/... | module.exports = function(config){
config.set({
basePath : './',
files : [
'app/bower_components/angular/angular.min.js',
'app/bower_components/angular-ui-router/release/angular-ui-router.min.js',
'app/bower_components/angular-resource/angular-resource.min.js',
'app/bower_components/... |
Remove import from java.lang package | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package nl.nelen_schuurmans.aquo;
import org.apache.log4j.Logger;
/**
*
* @author carsten.byrman@nelen-schuurmans.nl
*/
public class Aquo {
private static final Logger logger = Logger.getLogger(Aquo.class);
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package nl.nelen_schuurmans.aquo;
import java.lang.Class;
import org.apache.log4j.Logger;
/**
*
* @author carsten.byrman@nelen-schuurmans.nl
*/
public class Aquo {
private static final Logger logger = Logger.ge... |
Remove include header from entry view | @extends('admin.layout.master')
@section('content')
<table class="table table-hover">
<thead>
<tr>
<th>Created at</th>
<th>Name</th>
<th>Phone</th>
<th>Email</th>
<th>Video</th>
<th>Article</th>
... | @extends('admin.layout.master')
@section('content')
@include('admin.layout.header')
<table class="table table-hover">
<thead>
<tr>
<th>Created at</th>
<th>Name</th>
<th>Phone</th>
<th>Email</th>
<th>Video</th>
... |
Change parameters of updateProjects service | <?php
namespace AppBundle\API\Edit;
use AppBundle\API\Webservice;
use AppBundle\AppBundle;
use AppBundle\Entity\FennecUser;
use AppBundle\Entity\WebuserData;
use AppBundle\Service\DBVersion;
use Symfony\Component\HttpFoundation\ParameterBag;
class UpdateProject
{
private $manager;
/**
* UpdateProject ... | <?php
namespace AppBundle\API\Edit;
use AppBundle\API\Webservice;
use AppBundle\AppBundle;
use AppBundle\Entity\FennecUser;
use AppBundle\Entity\WebuserData;
use AppBundle\Service\DBVersion;
use Symfony\Component\HttpFoundation\ParameterBag;
class UpdateProject
{
private $manager;
/**
* UpdateProject ... |
Update to newest snapshot, including a few changes stemming from this. | package dk.statsbiblioteket.medieplatform.newspaper.statistics;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import dk.statsbiblioteket.medieplatform.autonomous.Batch;
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector;
import dk.statsbiblioteket.medieplatform.autonomo... | package dk.statsbiblioteket.medieplatform.newspaper.statistics;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import dk.statsbiblioteket.medieplatform.autonomous.Batch;
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector;
import dk.statsbiblioteket.medieplatform.autonomo... |
Disable more interaction with the map | import api from '../api';
import style from './style';
export default () => {
let map = new google.maps.Map(document.getElementsByClassName('map')[0], {
center: {lat: -34.397, lng: 150.644},
zoom: 3,
disableDefaultUI: true,
disableDoubleClickZoom: true,
draggable: false,
... | import api from '../api';
import style from './style';
export default () => {
let map = new google.maps.Map(document.getElementsByClassName('map')[0], {
center: {lat: -34.397, lng: 150.644},
zoom: 3,
disableDefaultUI: true,
scrollwheel: false,
styles: style,
});
api... |
Use Amplify to handle modal.andLoad and modal.onUnload | /*
* Place copyright or other info here...
*/
(function(global, $){
// Define core
var codiad = global.codiad,
scripts= document.getElementsByTagName('script'),
path = scripts[scripts.length-1].src.split('?')[0],
curpath = path.split('/').slice(0, -1).join('/')+'/';
// Inst... | /*
* Place copyright or other info here...
*/
(function(global, $){
// Define core
var codiad = global.codiad,
scripts= document.getElementsByTagName('script'),
path = scripts[scripts.length-1].src.split('?')[0],
curpath = path.split('/').slice(0, -1).join('/')+'/';
// Inst... |
Change help link to help.are.na | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import Link from 'react/components/UserDropdown/components/Link';
const SmallLink = styled(Link).attrs({
f: 2,
fontWeight: 'normal',
})`
`;
export default class SecondaryLinks extends Component {... | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import Link from 'react/components/UserDropdown/components/Link';
const SmallLink = styled(Link).attrs({
f: 2,
fontWeight: 'normal',
})`
`;
export default class SecondaryLinks extends Component {... |
Add missing function getName to the interface | <?php
/**
* @author: Thomas Prelot <tprelot@gmail.com>
* @license: MIT
*/
namespace IDCI\Bundle\StepBundle\Step;
use IDCI\Bundle\StepBundle\Step\StepInterface;
interface StepInterface
{
/**
* Get the configuration.
*
* @return array The configuration.
*/
public function getConfigurat... | <?php
/**
* @author: Thomas Prelot <tprelot@gmail.com>
* @license: MIT
*/
namespace IDCI\Bundle\StepBundle\Step;
use IDCI\Bundle\StepBundle\Step\StepInterface;
interface StepInterface
{
/**
* Get the configuration.
*
* @return array The configuration.
*/
public function getConfigurat... |
Fix check on error when getting camera picture | Template.messageInput.events({
'submit form': function (event, template) {
event.preventDefault();
var messageInput = event.currentTarget.elements['message'];
if (messageInput.value === "") return;
Messages.insert({
createdAt: new Date(),
author: Meteor.u... | Template.messageInput.events({
'submit form': function (event, template) {
event.preventDefault();
var messageInput = event.currentTarget.elements['message'];
if (messageInput.value === "") return;
Messages.insert({
createdAt: new Date(),
author: Meteor.u... |
Check if extension is .js before prepending | "use strict";
var ConcatSource = require('webpack-sources/lib/ConcatSource');
var fs = require('fs');
class PrependPlugin {
constructor(args) {
if (typeof args !== 'object') {
throw new TypeError('Argument "args" must be an object.');
}
this.filePath = args.hasOwnProperty('file... | "use strict";
var ConcatSource = require('webpack-sources/lib/ConcatSource');
var fs = require('fs');
class PrependPlugin {
constructor(args) {
if (typeof args !== 'object') {
throw new TypeError('Argument "args" must be an object.');
}
this.filePath = args.hasOwnProperty('file... |
Fix test See company details page | <?php
namespace Test;
use App\User;
use App\Company;
use TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class CompanyDetailsTest extends TestCase
{
use DatabaseTransactions;
pub... | <?php
namespace Test;
use App\User;
use App\Company;
use TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class CompanyDetailsTest extends TestCase
{
use DatabaseTransactions;
pub... |
Enforce requirement of email field on member invite | from __future__ import absolute_import
from django import forms
from django.db import transaction, IntegrityError
from sentry.models import (
AuditLogEntry, AuditLogEntryEvent, OrganizationMember
)
class InviteOrganizationMemberForm(forms.ModelForm):
# override this to ensure the field is required
email... | from __future__ import absolute_import
from django import forms
from django.db import transaction, IntegrityError
from sentry.models import (
AuditLogEntry, AuditLogEntryEvent, OrganizationMember
)
class InviteOrganizationMemberForm(forms.ModelForm):
class Meta:
fields = ('email', 'role')
mo... |
Stop using weak references to keep track of subscribers
It turns out that we don't actually reference them elsewhere in some cases where
they're still needed, so the UI was pretty much completely non-functional in the
emulator. | package com.alangpierce.lambdacalculusplayground.drag;
import android.view.MotionEvent;
import android.view.View;
import com.google.common.collect.ImmutableList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import autovalue.shaded.com.google.common.common.... | package com.alangpierce.lambdacalculusplayground.drag;
import android.view.MotionEvent;
import android.view.View;
import com.google.common.collect.ImmutableList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import rx.Observable;
import rx.Subscriber;
publ... |
Fix import issue in h5py.py | """Objects for datasets serialized in HDF5 format (.h5)."""
import warnings
try:
import h5py
except ImportError:
warnings.warn("Could not import h5py")
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
class HDF5Dataset(DenseDesignMatrix):
"""Dense dataset loaded from an HDF5 file."""
... | """Objects for datasets serialized in HDF5 format (.h5)."""
import h5py
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
class HDF5Dataset(DenseDesignMatrix):
"""Dense dataset loaded from an HDF5 file."""
def __init__(self, filename, X=None, topo_view=None, y=None, **kwargs):
"""
... |
Fix bug for IE (firefox can deal with anonymous node for null, not ie)
git-svn-id: 4cd2d1688610a87757c9f4de95975a674329c79f@740 b8ca103b-dd03-488c-9448-c80b36131af2 | var XML = {
serialize:function(el){
if(window.XMLSerializer)
return (new XMLSerializer()).serializeToString(el);
return el.xml;
},
makesoup:function(xml_str){
return $n("div").set('html', xml_str);//.getFirst(); //dont <null><br/><box/></null>
}
};
function transformer_xslt(xsl_lnk){
th... | var XML = {
serialize:function(el){
if(window.XMLSerializer)
return (new XMLSerializer()).serializeToString(el);
return el.xml;
},
makesoup:function(xml_str){
return $n("div").set('html', xml_str).getFirst();
}
};
function transformer_xslt(xsl_lnk){
this.xsl_xml = xsl_lnk;
if(Browse... |
Add typescript tasks for conversion | var fs = require('fs'),
gulp = require('gulp'),
rename = require('gulp-rename'),
browserify = require('gulp-browserify'),
header = require('gulp-header'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
ts = require('gulp-typescript');
console.log(fs.readFileSync('./LICENS... | var fs = require('fs'),
gulp = require('gulp'),
rename = require('gulp-rename'),
browserify = require('gulp-browserify'),
header = require('gulp-header'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');
console.log(fs.readFileSync('./LICENSE', 'utf8'));
gulp.task('browserify'... |
Remove hiro timeline context in redis test | import unittest
import datetime
import hiro
import redis
from sifr.span import Minute, Day
from sifr.storage import MemoryStorage, RedisStorage
class RedisStorageTests(unittest.TestCase):
def setUp(self):
self.redis = redis.Redis()
self.redis.flushall()
def test_incr_simple_minute(self):
... | import unittest
import datetime
import hiro
import redis
from sifr.span import Minute, Day
from sifr.storage import MemoryStorage, RedisStorage
class RedisStorageTests(unittest.TestCase):
def setUp(self):
self.redis = redis.Redis()
self.redis.flushall()
def test_incr_simple_minute(self):
... |
Add starting date to habit model | package ca.antonious.habittracker.models;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* Created by George on 2016-09-01.
*/
public class Habit {
private String id;
private String name;
private Date startDate;
private List<Days> daysToComplete ... | package ca.antonious.habittracker.models;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* Created by George on 2016-09-01.
*/
public class Habit {
private String id;
private String name;
private List<Days> daysToComplete = new ArrayList<>();
private List<HabitCompleti... |
Fix decode bug in Process() failures | import subprocess as sub
import logbook
from piper.logging import SEPARATOR
class Process(object):
"""
Helper class for running processes
"""
def __init__(self, ns, cmd, parent_key):
self.ns = ns
self.cmd = cmd
self.popen = None
self.success = None
self.log... | import subprocess as sub
import logbook
from piper.logging import SEPARATOR
class Process(object):
"""
Helper class for running processes
"""
def __init__(self, ns, cmd, parent_key):
self.ns = ns
self.cmd = cmd
self.popen = None
self.success = None
self.log... |
Implement the reset function of the data collector | <?php
namespace Common\DataCollector;
use SpoonDatabase;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class DatabaseDataCollector extends DataCollector
{
/**
* @var SpoonDatabase
*/
private... | <?php
namespace Common\DataCollector;
use SpoonDatabase;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class DatabaseDataCollector extends DataCollector
{
/**
* @var SpoonDatabase
*/
private... |
Fix for the sorted merge step
git-svn-id: 51b39fcfd0d3a6ea7caa15377cad4af13b9d2664@4014 5fb7f6ec-07c1-534a-b4ca-9155e429e800 | package org.pentaho.di.run.sortedmerge;
import junit.framework.TestCase;
import org.pentaho.di.core.Result;
import org.pentaho.di.core.logging.LogWriter;
import org.pentaho.di.run.AllRunTests;
import org.pentaho.di.run.TimedTransRunner;
public class RunSortedMerge extends TestCase
{
public void test_S... | package org.pentaho.di.run.sortedmerge;
import junit.framework.TestCase;
import org.pentaho.di.core.Result;
import org.pentaho.di.core.logging.LogWriter;
import org.pentaho.di.run.AllRunTests;
import org.pentaho.di.run.TimedTransRunner;
public class RunSortedMerge extends TestCase
{
public void test_S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.