text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Change audition recommendations on auditions page | <div class="row">
<div class="small-12 columns">
<h1>Auditions</h1>
<p>Auditions for Partial Credit are held once per semester. Come check
us out at the activities fair to sign up for an audition time or look
for fliers posted around campus for information about audition
opportunities!</p>
... | <div class="row">
<div class="small-12 columns">
<h1>Auditions</h1>
<p>Auditions for Partial Credit are held once per semester. Come check
us out at the activities fair to sign up for an audition time or look
for fliers posted around campus for information about audition
opportunities!</p>
... |
Update tests with diacritical cases | const expect = require('chai').expect;
const path = require('path');
const _ = require(path.join(__dirname, '../../dist/lodash-addons'));
describe('slugify', function() {
it('exists', function() {
expect(_.slugify).to.be.a('function');
});
it('converts invalid types to strings', function() {
... | const expect = require('chai').expect;
const path = require('path');
const _ = require(path.join(__dirname, '../../dist/lodash-addons'));
describe('slugify', function() {
it('exists', function() {
expect(_.slugify).to.be.a('function');
});
it('converts invalid types to strings', function() {
... |
Use wildcard in Gulp minify task. | 'use strict';
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
minifyCSS = require('gulp-minify-css'),
rename = require('gulp-rename'),
concat = require('gulp-concat');
function restartTime () {
function checkTime(i) {
return (i < 10... | 'use strict';
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
minifyCSS = require('gulp-minify-css'),
rename = require('gulp-rename'),
concat = require('gulp-concat');
function restartTime () {
function checkTime(i) {
return (i < 10... |
[test] Add `deviceName` field for Android | 'use strict';
const sauceBrowsers = require('sauce-browsers');
const run = require('sauce-test');
const path = require('path');
const pkg = require('../package');
const platforms = sauceBrowsers([
{ name: 'android', version: ['oldest', 'latest'] },
{ name: 'chrome', version: ['oldest', 'latest'] },
{ name: 'fi... | 'use strict';
const sauceBrowsers = require('sauce-browsers');
const run = require('sauce-test');
const path = require('path');
const pkg = require('../package');
const platforms = sauceBrowsers([
{ name: 'android', version: ['oldest', 'latest'] },
{ name: 'chrome', version: ['oldest', 'latest'] },
{ name: 'fi... |
Remove @Override annotation for Java5 compatibility | /*--------------------------------------------------------------------------
* Copyright 2011 Taro L. Saito
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://ww... | /*--------------------------------------------------------------------------
* Copyright 2011 Taro L. Saito
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://ww... |
Fix for submit for approval button not always showing. Ensure event lookup uses consistent uri format. | function getLastEditedEvent(collection, page) {
var uri = page;
if (uri.charAt(0) !== '/') {
uri = "/" + uri;
}
var pageEvents = collection.eventsByUri[uri];
var lastEditedEvent = _.chain(pageEvents)
.filter(function (event) {
return event.type === 'EDITED'
})
.sortBy(function (event)... | function getLastEditedEvent(collection, page) {
var pageEvents = collection.eventsByUri[page];
var lastEditedEvent = _.chain(pageEvents)
.filter(function (event) {
return event.type === 'EDITED'
})
.sortBy(function (event) {
return event.date;
})
.last()
.value();
return last... |
Change database url for create_engine() | from sqlalchemy import create_engine, Column, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def db_connect():
"""
Performs database connection
Returns sqlalchemy engine instance
"""
return create_engine('postgres://fbcmeskynsvati:aURfAdENt6-kumO0j224GuX... | from sqlalchemy import create_engine, Column, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def db_connect():
"""
Performs database connection
Returns sqlalchemy engine instance
"""
return create_engine('postgres://avvcurseaphtxf:X0466JySVtLq6nyq_5pb7BQ... |
Correct name to LoggingCleanupSuite in SetUp methods | // Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package testbase
import (
"flag"
"github.com/juju/loggo"
"github.com/juju/testing"
gc "launchpad.net/gocheck"
)
// LoggingSuite redirects the juju logger to the test logger
// when embedded in a gocheck suite type... | // Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package testbase
import (
"flag"
"github.com/juju/loggo"
"github.com/juju/testing"
gc "launchpad.net/gocheck"
)
// LoggingSuite redirects the juju logger to the test logger
// when embedded in a gocheck suite type... |
Fix layout bug by properly closing SPAN element
The "E-mail" label ended up right of the "Real name" label earlier. | <?php
if (is_guest()) {
echo('<p class="qmText">The guest account does not have a profile. If you register a personal account ');
echo('you will be able to create you own quizzes and see your user information plus statistics here!</p>');
echo('<br><br><br><br><br><br><br><br>');
die;
}
# PREPROCE... | <?php
if (is_guest()) {
echo('<p class="qmText">The guest account does not have a profile. If you register a personal account ');
echo('you will be able to create you own quizzes and see your user information plus statistics here!</p>');
echo('<br><br><br><br><br><br><br><br>');
die;
}
# PREPROCE... |
Add sample date into migration script | <?php
class m131226_162226_create_user_table extends CDbMigration
{
public function up()
{
date_default_timezone_set('Europe/Berlin');
$this->createTable('tbl_user', array(
'id' => 'pk',
'email' => 'varchar(128) NOT NULL',
'password' => 'varchar(128) NOT NULL... | <?php
class m131226_162226_create_user_table extends CDbMigration
{
public function up()
{
$this->createTable('tbl_user', array(
'id' => 'pk',
'email' => 'varchar(128) NOT NULL',
'password' => 'varchar(128) NOT NULL',
'create_time' => 'int NOT NULL',
... |
Add qunit task for failing test. | /* eslint-disable */
'use strict';
var gulp = require('gulp'),
eslint = require('gulp-eslint'),
mocha = require('gulp-mocha'),
qunit = require('./index');
var paths = {
scripts: ['./*.js', '!./gulpfile.js']
};
gulp.task('lint', function() {
return gulp.src(paths.scripts)
.pipe(eslint())
... | /* eslint-disable */
'use strict';
var gulp = require('gulp'),
eslint = require('gulp-eslint'),
mocha = require('gulp-mocha'),
qunit = require('./index');
var paths = {
scripts: ['./*.js', '!./gulpfile.js']
};
gulp.task('lint', function() {
return gulp.src(paths.scripts)
.pipe(eslint())
... |
Add support for 16-bit fixed point | define(function() {
'use strict';
return {
fromInt32: function(i32) {
var frac = 0;
for (var i = 0; i < 16; i++) {
if (i32 & (0x8000 >> i)) {
frac += 1 / (2 << i);
}
}
return (i32 >>> 16) + frac;
},
fromInt32_2_30: function(i32) {
var frac = 0;... | define(function() {
'use strict';
return {
fromInt32: function(i32) {
var frac = 0;
for (var i = 0; i < 16; i++) {
if (i32 & (0x8000 >> i)) {
frac += 1 / (2 << i);
}
}
return (i32 >>> 16) + frac;
},
fromInt32_2_30: function(i32) {
var frac = 0;... |
Add date as part of the log messages. | package main
import (
"flag"
"github.com/alinpopa/barvin/handlers/slack"
"github.com/op/go-logging"
"os"
"sync"
)
func main() {
userID := flag.String("userid", "", "The privileged slack userid.")
token := flag.String("token", "", "Slack token to connect.")
flag.Parse()
var format = logging.MustStringFormatt... | package main
import (
"flag"
"github.com/alinpopa/barvin/handlers/slack"
"github.com/op/go-logging"
"os"
"sync"
)
func main() {
userID := flag.String("userid", "", "The privileged slack userid.")
token := flag.String("token", "", "Slack token to connect.")
flag.Parse()
var format = logging.MustStringFormatt... |
Add mute param to generate mute video | <?php
ini_set("display_errors", 0);
$thumbdir = 'clip/';
$uuid = uniqid();
$start = floatval($_GET['t']) - 0.9;
$duration = 3;
$anilistID = rawurldecode($_GET['anilist_id']);
$season = rawurldecode($_GET['season']); // deprecated
$anime = rawurldecode($_GET['anime']); // deprecated
$file = rawurldecode($_G... | <?php
ini_set("display_errors", 0);
$thumbdir = 'clip/';
$uuid = uniqid();
$start = floatval($_GET['t']) - 0.9;
$duration = 3;
$anilistID = rawurldecode($_GET['anilist_id']);
$season = rawurldecode($_GET['season']); // deprecated
$anime = rawurldecode($_GET['anime']); // deprecated
$file = rawurldecode($_G... |
Test against phpunit version, not php version | <?php
namespace EngineWorks\DBAL\Tests;
use EngineWorks\DBAL\DBAL;
use PHPUnit\Framework\Error\Notice;
use PHPUnit\Runner\Version;
/* @var $this \EngineWorks\DBAL\Tests\TestCaseWithDatabase */
trait TransactionsWithExceptionsTestTrait
{
/** @return DBAL */
abstract protected function getDbal();
private ... | <?php
namespace EngineWorks\DBAL\Tests;
use EngineWorks\DBAL\DBAL;
use PHPUnit\Framework\Error\Notice;
/* @var $this \EngineWorks\DBAL\Tests\TestCaseWithDatabase */
trait TransactionsWithExceptionsTestTrait
{
/** @return DBAL */
abstract protected function getDbal();
public function testCommitThrowsWarn... |
Debug Google Cloud Run support | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... |
Update to latest api change | /*
* Copyright 2014 Red Hat, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/le... | /*
* Copyright 2014 Red Hat, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/le... |
:ambulance: Fix caching of app fragments | /**
* @license
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be f... | /**
* @license
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be f... |
Fix missing return in loadPrivateKey | package main
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"encoding/pem"
"errors"
"io/ioutil"
"os"
)
func generatePrivateKey(file string) (crypto.PrivateKey, error) {
privateKey, err := ecdsa.GenerateKey(elliptic.P384(), rand.Reader)
if err != nil {
return nil, err
}
... | package main
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"encoding/pem"
"errors"
"io/ioutil"
"os"
)
func generatePrivateKey(file string) (crypto.PrivateKey, error) {
privateKey, err := ecdsa.GenerateKey(elliptic.P384(), rand.Reader)
if err != nil {
return nil, err
}
... |
Switch from filter to backdrop-filter to blur background | // Show message
// ---------------------------------------------------------------------
class Message
{
show(msg, timing, animations, new_game_btn, field)
{
if (new_game_btn === undefined)
{
new_game_btn = false;
}
$('#msg_new_game').off('click');
var msg_box = $('#message_box');
msg_box.hide();
... | // Show message
// ---------------------------------------------------------------------
class Message
{
show(msg, timing, animations, new_game_btn, field)
{
if (new_game_btn === undefined)
{
new_game_btn = false;
}
$('#msg_new_game').off('click');
var msg_box = $('#message_box');
msg_box.hide();
... |
Add SavedSarch to project defaults | from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
class SavedSearch(Model):
"""
A saved search query.
"""
__core__ = True
project = FlexibleForeignKey('sentry.Pr... | from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
class SavedSearch(Model):
"""
A saved search query.
"""
__core__ = True
project = FlexibleForeignKey('sentry.Pr... |
Clean up sample city file | from bs4 import BeautifulSoup
import datetime
import pytz
from geodata import GeoData
# The URL for the page where the parking lots are listed
data_url = "http://example.com"
# Name of the city, just in case it contains umlauts which this filename shouldn't
city_name = "Sample City"
# Name of this file (without '.py... | from bs4 import BeautifulSoup
import json
import datetime
import pytz
# The URL for the page where the parking lots are listed
data_url = "http://example.com"
# Name of the city, just in case it contains umlauts which this filename shouldn't
city_name = "Sample City"
# Name of this file (without '.py'), sorry for ne... |
Add success message for saving project settings. | <?php
class ProjectsController extends Controller {
public function show(Project $project)
{
$currentSprint = $project->currentSprint();
return $currentSprint ? App::make('SprintsController')->show($currentSprint)
: View::make('project.view', compact('project'));
}
public function in... | <?php
class ProjectsController extends Controller {
public function show(Project $project)
{
$currentSprint = $project->currentSprint();
return $currentSprint ? App::make('SprintsController')->show($currentSprint)
: View::make('project.view', compact('project'));
}
public function in... |
Sort items by votes annd created at | import { connect } from "react-redux"
import _ from 'lodash'
import * as trackActions from '../actions/trackActions'
import * as playlistActions from '../actions/playlistActions'
import VideoFeed from './VideoFeed'
const mapStateToProps = (state) => ({
activeFeedId: state.main.show,
items: _.orderBy(state[state... | import { connect } from "react-redux"
import * as trackActions from '../actions/trackActions'
import * as playlistActions from '../actions/playlistActions'
import VideoFeed from './VideoFeed'
const mapStateToProps = (state) => ({
activeFeedId: state.main.show,
items: state[state.main.show].items,
selectedId: ... |
Print eval results in test | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... | import unittest
import time
import pandas as pd
from bert_trainer import BERTTrainer
from utils import *
class TestBERT(unittest.TestCase):
def test_init(self):
trainer = BERTTrainer()
def test_train(self):
output_dir = 'test_{}'.format(str(int(time.time())))
trainer = BERTTrainer(out... |
Adjust the description of Config | package adapt
// Config represents a configuration of the algorithm.
type Config struct {
// The refinement rate of the algorithm. The parameter specifies the
// fraction of the nodes queued for refinement to be taken from the queue at
// each iteration.
Rate float64 // ⊆ (0, 1]
// The minimum level of interpola... | package adapt
// Config represents a configuration of the algorithm.
type Config struct {
// The refinement rate of the algorithm. The parameter specifies the
// fraction of the nodes queued for refinement to be taken from the queue at
// each iteration.
Rate float64 // ⊆ (0, 1]
// The minimal level of interpola... |
Add the good old middleware | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 by Florian Mounier, Kozea
# This file is part of pystil, licensed under a 3-clause BSD license.
"""
pystil - An elegant site web traffic analyzer
"""
from pystil import app, config
import werkzeug.contrib.fixers
import sys
config.freeze()
if 'soup' in... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 by Florian Mounier, Kozea
# This file is part of pystil, licensed under a 3-clause BSD license.
"""
pystil - An elegant site web traffic analyzer
"""
from pystil import app, config
import werkzeug.contrib
import sys
config.freeze()
if 'soup' in sys.ar... |
Support the AutoPagerize in the click event | $(document).ready(function() {
$(document).on('click', '.star', function(e) {
// Toggle a display of star
$(this).toggleClass('favorited');
var isFavorited = $(this).hasClass('favorited');
// Get a page info
var id = $(this).attr('honyomi-id');
var page_no = $(this).attr('honyomi-page-no');
... | $(document).ready(function() {
$('.star').click(function() {
// Toggle a display of star
$(this).toggleClass('favorited');
var isFavorited = $(this).hasClass('favorited');
// Get a page info
var id = $(this).attr('honyomi-id');
var page_no = $(this).attr('honyomi-page-no');
// ajax
$... |
Refactor and change signature of the method that returns an empty profile | package sizebay.catalog.client.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
@Accessors(chain = true)
@NoArgsConstruc... | package sizebay.catalog.client.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
@Accessors(chain = true)
@NoArgsConstruc... |
Use just newline for file terminator. | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... | import pypyodbc
import csv
conn = pypyodbc.connect("DSN=HOSS_DB")
cur = conn.cursor()
tables = []
cur.execute("select * from sys.tables")
for row in cur.fetchall():
tables.append(row[0])
for table in tables:
print(table)
cur.execute("select * from {}".format(table))
column_names = []
for d i... |
Add some more tests for isympy -a | """Tests of tools for setting up interactive IPython sessions. """
from sympy.interactive.session import init_ipython_session, enable_automatic_symbols
from sympy.core import Symbol
from sympy.external import import_module
from sympy.utilities.pytest import raises
# TODO: The code below could be made more granular w... | """Tests of tools for setting up interactive IPython sessions. """
from sympy.interactive.session import init_ipython_session, enable_automatic_symbols
from sympy.core import Symbol
from sympy.external import import_module
from sympy.utilities.pytest import raises
# TODO: The code below could be made more granular w... |
Use relative paths for emitted files | var path = require('path');
var DtsCreator = require('typed-css-modules');
var loaderUtils = require('loader-utils');
module.exports = function(source, map) {
this.cacheable && this.cacheable();
this.addDependency(this.resourcePath);
var callback = this.async();
// Pass on query parameters as an options objec... | var DtsCreator = require('typed-css-modules');
var loaderUtils = require('loader-utils');
module.exports = function(source, map) {
this.cacheable && this.cacheable();
this.addDependency(this.resourcePath);
var callback = this.async();
// Pass on query parameters as an options object to the DtsCreator. This le... |
Remove default error log file | 'use strict';
var defaultLogAdapter = require('./adapter/logger/winston');
var defaultFsAdapter = require('./adapter/fs/fs');
function logger(logDirectory, adapters)
{
logDirectory = typeof logDirectory !== 'undefined' ? logDirectory : '/tmp/sonumi-logs';
adapters = typeof adapters !== 'undefined' ? adapters ... | 'use strict';
var defaultLogAdapter = require('./adapter/logger/winston');
var defaultFsAdapter = require('./adapter/fs/fs');
function logger(logDirectory, adapters)
{
logDirectory = typeof logDirectory !== 'undefined' ? logDirectory : '/tmp/sonumi-logs';
adapters = typeof adapters !== 'undefined' ? adapters ... |
Improve the ability for developers to extend or modify | # -*- coding: utf-8 -*-
from django import forms
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .widgets import AppHookConfigWidget
class AppHookConfigFormField(forms.ModelChoiceField):
def __init__(self, queryset, empty_label="---------", required=True,
wi... | # -*- coding: utf-8 -*-
from django import forms
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .widgets import AppHookConfigWidget
class AppHookConfigField(models.ForeignKey):
def __init__(self, *args, **kwargs):
kwargs.update({'help_text': _(u'When selecting ... |
Fix module export of new instance of merlin class | const { Configuration } = require('@schul-cloud/commons');
const request = require('request-promise-native');
class MerlinTokenGenerator {
setup(app) {
this.app = app;
}
async FIND(data) {
const { merlinReference } = data.query;
const url = await this.getMerlinUrl(merlinReference);
return url;
}
async g... | const { Configuration } = require('@schul-cloud/commons');
const request = require('request-promise-native');
class MerlinTokenGenerator {
setup(app) {
this.app = app;
}
async FIND(data) {
const { merlinReference } = data.query;
const url = await this.getMerlinUrl(merlinReference);
return url;
}
async g... |
Fix template path after moving it to init | package handlers
import (
"encoding/json"
"fmt"
html "html/template"
"net/http"
)
var helloTemplate *html.Template
func init() {
fmt.Println("Try: /hello/world")
var err error
helloTemplate, err = html.ParseFiles("../templates/hello.html")
if err != nil {
panic(err)
}
}
func HelloWorld(w http.ResponseWri... | package handlers
import (
"encoding/json"
"fmt"
html "html/template"
"net/http"
)
var helloTemplate *html.Template
func init() {
fmt.Println("Try: /hello/world")
var err error
helloTemplate, err = html.ParseFiles("templates/hello.html")
if err != nil {
panic(err)
}
}
func HelloWorld(w http.ResponseWriter... |
Return custom icon for custom events | package com.alexstyl.specialdates.events.peopleevents;
import com.alexstyl.specialdates.R;
import com.alexstyl.resources.StringResources;
import com.alexstyl.specialdates.events.database.EventColumns;
public class CustomEventType implements EventType {
private final String name;
public CustomEventType(Strin... | package com.alexstyl.specialdates.events.peopleevents;
import com.alexstyl.specialdates.R;
import com.alexstyl.resources.StringResources;
import com.alexstyl.specialdates.events.database.EventColumns;
public class CustomEventType implements EventType {
private final String name;
public CustomEventType(Strin... |
Fix version typo in grunt task | 'use strict';
var grunt = require('grunt');
// Check that the version we're exporting is the same one we expect in the
// package. This is not an ideal way to do this, but makes sure that we keep
// them in sync.
var reactVersionExp = /\bReact\.version\s*=\s*['"]([^'"]+)['"];/;
module.exports = function() {
var r... | 'use strict';
var grunt = require('grunt');
// Check that the version we're exporting is the same one we expect in the
// package. This is not an ideal way to do this, but makes sure that we keep
// them in sync.
var reactVersionExp = /\bReact\.version\s*=\s*['"]([^'"]+)['"];/;
module.exports = function() {
var r... |
Move functionality into a createModel method. Allows for model instantiation outside of this static class. Creating getters for model retrieval. | // ### Part of the [Rosy Framework](http://github.com/ff0000/rosy)
/* site.js */
// ## The RED Namespace
var RED = RED || {};
// ## Local Namespace
// Example Site object, controls global functionality and instantiates the Example Default Page.
// You should replace the namespace "Example" with your own Site namespac... | // ### Part of the [Rosy Framework](http://github.com/ff0000/rosy)
/* site.js */
// ## The RED Namespace
var RED = RED || {};
// ## Local Namespace
// Example Site object, controls global functionality and instantiates the Example Default Page.
// You should replace the namespace "Example" with your own Site namespac... |
Fix for dir being ignored when supplied and files always saved to cwd. | const createUrl = require('./lib/create-url');
const downloadAndSave = require('./lib/download-and-save');
const parsePage = require('./lib/parse-page');
module.exports = save;
/**
* @param {string} urlOrMediaId
* @return {Promise}
*/
function save(urlOrMediaId, dir) {
return new Promise((resolve, reject) => {
... | const createUrl = require('./lib/create-url');
const downloadAndSave = require('./lib/download-and-save');
const parsePage = require('./lib/parse-page');
module.exports = save;
/**
* @param {string} urlOrMediaId
* @return {Promise}
*/
function save(urlOrMediaId, dir) {
return new Promise((resolve, reject) => {
... |
Remove default constructor to ensure that consumers understand this is a remote service | package wtf.password;
import retrofit.RestAdapter;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.POST;
/**
* @author <a href="mailto:erik.beeson@gmail.com">Erik Beeson</a>
*/
public class ZxcvbnRemote {
private final ZxcvbnRemoteService service;
public ZxcvbnRemote(String ... | package wtf.password;
import retrofit.RestAdapter;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.POST;
/**
* @author <a href="mailto:erik.beeson@gmail.com">Erik Beeson</a>
*/
public class ZxcvbnRemote {
private final ZxcvbnRemoteService service;
public ZxcvbnRemote() {
t... |
Fix format error in RemoveCtrl | package controller;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import boundary.PlayerApplication;
import model.Move;
import model.PlayerModel;
import model.PlayerState;
import model.Point;
import model.Variation;
/**
* @author Nick Chaput
*/
public class PlayerRemoveCtrl implements Ac... | package controller;
import boundary.PlayerApplication;
import model.Move;
import model.PlayerModel;
import model.Point;
import model.Variation;
/**
* @author Nick Chaput
*/
public class PlayerRemoveCtrl {
PlayerApplication app;
PlayerModel model;
public PlayerRemoveCtrl(PlayerApplication app, PlayerModel mod... |
Store clinical track fields with null values in session | package org.cbioportal.web.parameter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@JsonIgnoreProperties(i... | package org.cbioportal.web.parameter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@JsonIgnoreProperties(i... |
Deploy: Use call API to call generate console | var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config... | var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
/*
var generate = function(callback){
spawn({
command: hexo.core_dir + 'bin/hexo',
args: ['generate'... |
[Telemetry] Fix browser restart in TimelineBasedPageTest
The TimelineBasedPageTest constructor was passing in error a string where
its parent constructor expects a Boolean value for the
needs_browser_restart_after_each_page option.
BUG=504368
Review URL: https://codereview.chromium.org/1206323002
Cr-Commit-Position... | # Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page_test
class TimelineBasedPageTest(page_test.PageTest):
"""Page test that collects metrics with TimelineBasedMeasurement... | # Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page_test
class TimelineBasedPageTest(page_test.PageTest):
"""Page test that collects metrics with TimelineBasedMeasurement... |
Add back button support back in | document.observe("dom:loaded", function()
{
function get_index()
{
var index = parseInt(location.hash.substr(1));
if(isNaN(index)) index = 0;
return index;
}
function go_next_page()
{
var index = get_index();
index += 1;
if(index >= pages.length) index = pages.length - 1;
loc... | document.observe("dom:loaded", function()
{
function get_index()
{
var index = parseInt(location.hash.substr(1));
if(isNaN(index)) index = 0;
return index;
}
function go_next_page()
{
var index = get_index();
index += 1;
if(index >= pages.length) index = pages.length - 1;
loc... |
Move query to line 33 | // Bulk Operation
exports.updateOperation = (id, actionType, contentType, connection) => {
return connection(contentType)
.where(`${contentType}.id`, '=', id)
.update(`${contentType}.status`, actionType)
.then((result) => {
return connection(contentType)
.select()
})
}
exports.deleteOperation = (id, ... | // Bulk Operation
exports.updateOperation = (id, actionType, contentType, connection) => {
return connection(contentType)
.where(`${contentType}.id`, '=', id)
.update(`${contentType}.status`, actionType)
.then((result) => {
return connection(contentType)
.select()
})
}
exports.deleteOperation = (id, ... |
Simplify code by passing an Observer | package arez.doc.examples.at_observe2;
import arez.Observer;
import arez.SafeProcedure;
import arez.annotations.ArezComponent;
import arez.annotations.CascadeDispose;
import arez.annotations.Observe;
import elemental2.dom.DomGlobal;
import elemental2.dom.Element;
import javax.annotation.Nonnull;
@ArezComponent
public... | package arez.doc.examples.at_observe2;
import arez.Observer;
import arez.SafeProcedure;
import arez.annotations.Action;
import arez.annotations.ArezComponent;
import arez.annotations.CascadeDispose;
import arez.annotations.Observe;
import arez.annotations.ObserverRef;
import arez.annotations.OnDepsChange;
import eleme... |
Remove unnecessary protection against using "default" as a subdomainconf
Thanks to Jannis Leidel <jezdez@enn.io> for the pointer.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com> | from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
def patterns(*args):
subdomains = SortedDict()
for x in args:
name = x['name']
if name in subdomains:
raise ImproperlyConfigured("Duplicate subdomain name: %s" % name)
... | from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
def patterns(*args):
subdomains = SortedDict()
for x in args:
name = x['name']
if name in subdomains:
raise ImproperlyConfigured("Duplicate subdomain name: %s" % name)
... |
Use of thumb and icon method | <div class="clearfix well media @if($errors->has($field))has-error @endif">
@if($model->$field)
{{ $model->present()->icon(2, $field) }}
@endif
<div>
{{ Form::label($field, trans('validation.attributes.' . $field), array('class' => 'control-lab... | <div class="clearfix well media @if($errors->has($field))has-error @endif">
@if($model->$field)
<div>
<span class="fa fa-file-text-o fa-3x"></span>
<a href="/uploads/{{ $model->getTable() }}/{{ $model->$field }}">{{ $model->$field }}</a>
</div>... |
Add DatePart invalid date unit test | <?php
namespace ZBateson\MailMimeParser\Header\Part;
use PHPUnit_Framework_TestCase;
use DateTime;
/**
* Description of DateTest
*
* @group HeaderParts
* @group DatePart
* @covers ZBateson\MailMimeParser\Header\Part\DatePart
* @author Zaahid Bateson
*/
class DatePartTest extends PHPUnit_Framework_TestCase
{
... | <?php
namespace ZBateson\MailMimeParser\Header\Part;
use PHPUnit_Framework_TestCase;
use DateTime;
/**
* Description of DateTest
*
* @group HeaderParts
* @group DatePart
* @covers ZBateson\MailMimeParser\Header\Part\DatePart
* @author Zaahid Bateson
*/
class DatePartTest extends PHPUnit_Framework_TestCase
{
... |
Update get pretty date in clienside |
module.exports.getPrettyDate = function(date) {
var month = addLeadingZero(date.getMonth() + 1);
var day = addLeadingZero(date.getDate());
return month + "/" + day + "/" + date.getFullYear();
};
var addLeadingZero = function (number) {
if (number < 10) {
return '0' + number;
}
return number;
};
m... |
module.exports.getPrettyDate = function(date) {
var month = date.getMonth() + 1;
var day = date.getDate();
if (month < 10) {
month = "0" + month;
}
if (day < 10) {
day = "0" + day;
}
return month + "/" + day + "/" + date.getFullYear();
};
module.exports.roundNumber = function (val) {
re... |
Improve logging of invalid JSON data. | (function () {
'use strict';
define(
[
],
function () {
return function (string) {
try {
return JSON.parse(string);
} catch (e) {
if (console && typeof console.error === 'function') {
... | (function () {
'use strict';
define(
[
],
function () {
return function (string) {
try {
return JSON.parse(string);
} catch (e) {
if (console && typeof console.error === 'function') {
... |
Remove following array on auth redux state | import * as types from './authActions';
const initialState = {
isAuthenticated: false,
isFetching: false,
user: {},
};
export default (state = initialState, action) => {
switch (action.type) {
case types.LOGIN_REQUEST:
return Object.assign({}, state, {
isFetching: true,
isAuthenticat... | import * as types from './authActions';
const initialState = {
isAuthenticated: false,
isFetching: false,
user: {},
following: [],
followingIsLoading: true,
};
export default (state = initialState, action) => {
switch (action.type) {
case types.LOGIN_REQUEST:
return Object.assign({}, state, {
... |
Fix typing for JSONInput and JSONInputBin. | from pathlib import Path
from typing import Union, Dict, Any, List, Tuple
from collections import OrderedDict
# fmt: off
FilePath = Union[str, Path]
# Superficial JSON input/output types
# https://github.com/python/typing/issues/182#issuecomment-186684288
JSONOutput = Union[str, int, float, bool, None, Dict[str, Any]... | from pathlib import Path
from typing import Union, Dict, Any, List, Tuple
from collections import OrderedDict
# fmt: off
FilePath = Union[str, Path]
# Superficial JSON input/output types
# https://github.com/python/typing/issues/182#issuecomment-186684288
JSONOutput = Union[str, int, float, bool, None, Dict[str, Any]... |
Access to all accounts only for superusers | from django.contrib import admin
from bejmy.categories.models import Category
from mptt.admin import MPTTModelAdmin
@admin.register(Category)
class CategoryAdmin(MPTTModelAdmin):
list_display = (
'name',
'user',
'transaction_type',
)
list_filter = (
'user',
'trans... | from django.contrib import admin
from bejmy.categories.models import Category
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
list_display = (
'name',
'user',
'transaction_type',
)
list_filter = (
'user',
'transaction_type',
)
search_fields... |
Fix people transfer when previous week was empty | <?php namespace TmlpStats\Reports\Arrangements;
class TeamMembersByQuarter extends BaseArrangement
{
/*
* Builds an array of TDO attendance for each team member
*/
public function build($data)
{
$teamMembersData = $data['teamMembersData'];
$reportData = [
'team1' ... | <?php namespace TmlpStats\Reports\Arrangements;
class TeamMembersByQuarter extends BaseArrangement
{
/*
* Builds an array of TDO attendance for each team member
*/
public function build($data)
{
$teamMembersData = $data['teamMembersData'];
$reportData = [];
foreach ($team... |
Add temporary selection of time range
While we still don't have the time range filter | import _ from 'lodash';
import {API_PATH} from 'power-ui/conf';
import {urlToRequestObjectWithHeaders, isTruthy} from 'power-ui/utils';
// Handle all HTTP networking logic of this page
function PeoplePageHTTP(sources) {
const PEOPLE_URL = `${API_PATH}/people/`;
const atomicResponse$ = sources.HTTP
.filter(res... | import _ from 'lodash';
import {API_PATH} from 'power-ui/conf';
import {urlToRequestObjectWithHeaders, isTruthy} from 'power-ui/utils';
// Handle all HTTP networking logic of this page
function PeoplePageHTTP(sources) {
const PEOPLE_URL = `${API_PATH}/people/`;
const atomicResponse$ = sources.HTTP
.filter(res... |
Use Mongoose to find user and pass to show page | const express = require('express'),
router = express.Router(),
db = require('../models');
router.get('/', function(req, res, next) {
res.render('index');
});
router.get('/new', function(req, res, next) {
res.render('users/new');
});
router.get('/:username', function(req, res, next) {
db.User.find({... | const express = require('express'),
router = express.Router(),
db = require('../models');
router.get('/', function(req, res, next) {
res.render('index');
});
router.get('/new', function(req, res, next) {
res.render('users/new');
});
router.get('/:username', function(req, res, next) {
// db.User.fin... |
Update body class for drawer. | <?php
use Roots\Sage\Setup;
use Roots\Sage\Wrapper;
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<?php get_template_part('templates/head'); ?>
<body <?php body_class('has-drawer'); ?>>
<!--[if IE]>
<div class="alert alert-warning">
<?php _e('You are using an <strong>outdated</stron... | <?php
use Roots\Sage\Setup;
use Roots\Sage\Wrapper;
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<?php get_template_part('templates/head'); ?>
<body <?php body_class(); ?>>
<!--[if IE]>
<div class="alert alert-warning">
<?php _e('You are using an <strong>outdated</strong> browser. ... |
Make makeDelayedTask return fn with same signature
- now returns a Promise returning fn that resolves to whatever the original function does
- allow any args to be passed to the delayed function | /**
* Higher order function to make another function only be invoked when user is deemed idle.
* Wraps around the web extension browser.idle API.
*
* @param {(any) => Promise<any>} task Async or sync function to run after idle.
* @param {number} [idleTimeout=15] Number of seconds to consider user idle (min is 15)
... | /**
* Higher order function to make another function only be invoked when user is deemed idle.
* Wraps around the web extension browser.idle API.
*
* @param {function} task Async or sync function to run after idle.
* @param {number} [idleTimeout=15] Number of seconds to consider user idle (min is 15)
*/
export co... |
Add unit test for LogAutoConfiguration | package com.github.vbauer.herald.ext.spring;
import com.github.vbauer.herald.core.BasicTest;
import com.github.vbauer.herald.ext.spring.bean.CheckerBean;
import com.github.vbauer.herald.ext.spring.context.SpringBootTestContext;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.fa... | package com.github.vbauer.herald.ext.spring;
import com.github.vbauer.herald.core.BasicTest;
import com.github.vbauer.herald.ext.spring.bean.CheckerBean;
import com.github.vbauer.herald.ext.spring.context.SpringBootTestContext;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.fa... |
Allow conroller to set editable state | var _ = require('underscore'),
ControlBones = require('./ControlBones'),
AmountEntry = require('../model/AmountEntry'),
AmountEntryCollection = require('../model/AmountEntryCollection'),
ParticularsModel = require('../model/ParticularsModel'),
StatementCollection = require('../model/StatementCollect... | var _ = require('underscore'),
ControlBones = require('./ControlBones'),
AmountEntry = require('../model/AmountEntry'),
AmountEntryCollection = require('../model/AmountEntryCollection'),
ParticularsModel = require('../model/ParticularsModel'),
StatementCollection = require('../model/StatementCollect... |
Update the documentation link for doc migration
This patch is proposed according to the Direction 10 of doc
migration(https://etherpad.openstack.org/p/doc-migration-tracking).
Change-Id: I62ae28d10f70d63ba693ac0ab6581faf85f1bf6e | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
Fix bug: log dir path: set it thru file location, not current working path | #!/usr/bin/python
import shlex, os
from subprocess import Popen, PIPE
#from time import sleep
import threading
def exe_cmd(log_name, command_line):
args = shlex.split(command_line)
log_dir=os.path.join(os.path.dirname(__file__),"..", "log")
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
file_... | #!/usr/bin/python
import shlex, os
from subprocess import Popen, PIPE
#from time import sleep
import threading
def exe_cmd(log_name, command_line):
args = shlex.split(command_line)
log_dir=os.path.join(os.getcwd(),"..", "log")
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
file_name= os.path.... |
Fix hook => command typo | <?php declare(strict_types=1);
/**
* This file is part of CaptainHook.
*
* (c) Sebastian Feldmann <sf@sebastian.feldmann.info>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CaptainHook\App;
/**
* Class Hooks
*
* Def... | <?php declare(strict_types=1);
/**
* This file is part of CaptainHook.
*
* (c) Sebastian Feldmann <sf@sebastian.feldmann.info>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CaptainHook\App;
/**
* Class Hooks
*
* Def... |
Fix issue where black boarders would appear on thumbnail | import io
import logging
import PIL.Image
import selenium.webdriver
def fetch_screen_capture(uri, size):
browser = selenium.webdriver.PhantomJS()
browser.set_window_size(*size)
browser.get(uri)
return browser.get_screenshot_as_png()
def toast(uri):
logging.info("Toasting %s",uri)
toast_imag... | import io
import logging
import PIL.Image
import selenium.webdriver
def fetch_screen_capture(uri, size):
browser = selenium.webdriver.PhantomJS()
browser.set_window_size(*size)
browser.get(uri)
return browser.get_screenshot_as_png()
def toast(uri):
logging.info("Toasting %s",uri)
toast_imag... |
Remove unneeded null check, format | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
Fix test setUp method signatures | <?php
namespace Enqueue\Bundle\Tests\Functional;
use Enqueue\Bundle\Tests\Functional\App\AppKernel;
use Enqueue\Client\TraceableProducer;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\DependencyInjection\ContainerInterface;
ab... | <?php
namespace Enqueue\Bundle\Tests\Functional;
use Enqueue\Bundle\Tests\Functional\App\AppKernel;
use Enqueue\Client\TraceableProducer;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\DependencyInjection\ContainerInterface;
ab... |
Fix logger level isIn bug | // Copyright 2014, Renasar Technologies Inc.
/* jshint: node:true */
'use strict';
var di = require('di');
module.exports = loggingProtocolFactory;
di.annotate(loggingProtocolFactory, new di.Provide('Protocol.Logging'));
di.annotate(loggingProtocolFactory,
new di.Inject(
'Assert',
'Constants',
... | // Copyright 2014, Renasar Technologies Inc.
/* jshint: node:true */
'use strict';
var di = require('di');
module.exports = loggingProtocolFactory;
di.annotate(loggingProtocolFactory, new di.Provide('Protocol.Logging'));
di.annotate(loggingProtocolFactory,
new di.Inject(
'Assert',
'Constants',
... |
ADD - TDD for POST employees endpoint without employee data | var chakram = require('chakram'),
expect = chakram.expect;
describe("mPayroll API", function() {
const empRec = {
"name": 'Harry Hourly',
"type": 'H',
"rate": '10.00'
};
it("should have POST employees endpoint", function () {
this.timeout(4000);
expect(chakram.p... | var chakram = require('chakram'),
expect = chakram.expect;
describe("mPayroll API", function() {
const empRec = {
"name": 'Harry Hourly',
"type": 'H',
"rate": '10.00'
};
it("should have POST employees endpoint", function () {
this.timeout(4000);
expect(chakram.p... |
Create models dir and copy user model for mongodb generator | import { join } from 'path';
import { replaceCode, mkdirs, copy, appendFile, addNpmPackage } from '../utils';
async function generateMongodbDatabase(params) {
const build = join(__base, 'build', params.uuid);
switch (params.framework) {
case 'express':
const app = join(build, 'app.js');
const mong... | import { join } from 'path';
import { replaceCode, appendFile, addNpmPackage } from '../utils';
async function generateMongodbDatabase(params) {
switch (params.framework) {
case 'express':
const app = join(__base, 'build', params.uuid, 'app.js');
const mongooseRequire = join(__base, 'modules', 'datab... |
Add some extra redirect logic for root path | const TYPES = [
'communities',
'featured-users',
'recent',
'recommended',
'trending',
]
const getComponents = (location, cb) => {
cb(null, require('../../containers/discover/Discover').default)
}
const bindOnEnter = path => (nextState, replace) => {
const type = nextState.params.type
// redirect back... | const TYPES = [
'communities',
'featured-users',
'recent',
'recommended',
'trending',
]
const getComponents = (location, cb) => {
cb(null, require('../../containers/discover/Discover').default)
}
const bindOnEnter = path => (nextState, replace) => {
const type = nextState.params.type
// redirect back... |
Make the bound value more perdictable.
If the file input is set to multiple, always bind an array. If it's not set to multiple is gets the single file. | //
// angular-file-model
// ==================
//
// Directive that makes the inputs with type `file` to be
// available in the `$scope` and be assigned to a model.
//
(function () {
'use strict';
angular.module('file-model', [])
.directive('fileModel', [
'$parse',
function ($parse) {
return {
... | //
// angular-file-model
// ==================
//
// Directive that makes the inputs with type `file` to be
// available in the `$scope` and be assigned to a model.
//
(function () {
'use strict';
angular.module('file-model', [])
.directive('fileModel', [
'$parse',
function ($parse) {
return {
... |
Disable analysis and subscription from the Indonesia Forest Area layer as requested | /**
* The Indonesian Forest Area layer module. (based on IdnPlantationsLayerBySpecies.js)
* More info @ https://basecamp.com/3063126/projects/10726176/todos/303918841
* @return IdnForestArea class (extends CartoDBLayerClass)
*/
// 'text!map/cartocss/IdnForestArea.cartocss'], function(CartoDBLayerClass, ) {
defi... | /**
* The Indonesian Forest Area layer module. (based on IdnPlantationsLayerBySpecies.js)
* More info @ https://basecamp.com/3063126/projects/10726176/todos/303918841
* @return IdnForestArea class (extends CartoDBLayerClass)
*/
// 'text!map/cartocss/IdnForestArea.cartocss'], function(CartoDBLayerClass, ) {
defi... |
Add empty string check to prevent tooltip creation for empty strings | package io.bisq.gui.components;
import javafx.scene.control.Labeled;
import javafx.scene.control.SkinBase;
import javafx.scene.control.Tooltip;
import javafx.scene.text.Text;
public class TooltipUtil {
public static void showTooltipIfTruncated(SkinBase skinBase, Labeled labeled) {
for (Object node : skin... | package io.bisq.gui.components;
import javafx.scene.control.Labeled;
import javafx.scene.control.SkinBase;
import javafx.scene.control.Tooltip;
import javafx.scene.text.Text;
public class TooltipUtil {
public static void showTooltipIfTruncated(SkinBase skinBase, Labeled labeled) {
for (Object node : skin... |
Add testcase that fails old code. | package util
import (
"testing"
)
func TestNormalizeName(t *testing.T) {
packages := map[string]string{
"github.com/Masterminds/cookoo/web/io/foo": "github.com/Masterminds/cookoo",
`github.com\Masterminds\cookoo\web\io\foo`: "github.com/Masterminds/cookoo",
"golang.org/x/crypto/ssh": "golang.... | package util
import (
"testing"
)
func TestNormalizeName(t *testing.T) {
packages := map[string]string{
"github.com/Masterminds/cookoo/web/io/foo": "github.com/Masterminds/cookoo",
"golang.org/x/crypto/ssh": "golang.org/x/crypto",
"incomplete/example": "incomplete/exampl... |
Fix bug in the PyQt4 binding selection logic. | #------------------------------------------------------------------------------
# Copyright (c) 2010, Enthought Inc
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
#
# Author: Enthought Inc
# Description: Qt API selector. Can be used to switch between pyQt and ... | #------------------------------------------------------------------------------
# Copyright (c) 2010, Enthought Inc
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
#
# Author: Enthought Inc
# Description: Qt API selector. Can be used to switch between pyQt and ... |
Add rba url, since it's normally taken from the config | # Filename: test_srv.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
from km3pipe.testing import TestCase, patch
from km3pipe.dataclasses import Table
from km3pipe.srv import srv_event
__author__ = "Tamas Gal"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license_... | # Filename: test_srv.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
from km3pipe.testing import TestCase, patch
from km3pipe.dataclasses import Table
from km3pipe.srv import srv_event
__author__ = "Tamas Gal"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license_... |
Add version constraint for reactive-obj | /*global Package*/
Package.describe({
name: 'dschnare:meteor-components-ioc-plugin',
version: '0.2.0',
// Brief, one-line summary of the package.
summary: 'A plugin for Meteor Components that integrates IOC Containers.',
// URL to the Git repository containing the source code for this package.
git: 'https:/... | /*global Package*/
Package.describe({
name: 'dschnare:meteor-components-ioc-plugin',
version: '0.2.0',
// Brief, one-line summary of the package.
summary: 'A plugin for Meteor Components that integrates IOC Containers.',
// URL to the Git repository containing the source code for this package.
git: 'https:/... |
[attachments] Send error details when there's "Corrupt image" | "use strict";
var models = require('../../../models')
, formidable = require('formidable')
, AttachmentSerializer = models.AttachmentSerializer
exports.addController = function(app) {
var AttachmentsController = function() {
}
AttachmentsController.create = function(req, res) {
if (!req.user)
ret... | "use strict";
var models = require('../../../models')
, formidable = require('formidable')
, AttachmentSerializer = models.AttachmentSerializer
exports.addController = function(app) {
var AttachmentsController = function() {
}
AttachmentsController.create = function(req, res) {
if (!req.user)
ret... |
Fix tests with different length strings to look for undefined result, rather than zero. | var compute = require('./hamming').compute;
describe('Hamming', function () {
it('no difference between identical strands', function () {
expect(compute('A', 'A')).toEqual(0);
});
xit('complete hamming distance for single nucleotide strand', function () {
expect(compute('A','G')).toEqual(1);
});
x... | var compute = require('./hamming').compute;
describe('Hamming', function () {
it('no difference between identical strands', function () {
expect(compute('A', 'A')).toEqual(0);
});
xit('complete hamming distance for single nucleotide strand', function () {
expect(compute('A','G')).toEqual(1);
});
x... |
FIX: Remove a bunch of unnecessary import | #!/usr/bin/python3
# -*- coding: utf8 -*
import sys
# Fix for file paths errors
import os
PATH = os.path.dirname(os.path.realpath(__file__))
# Import other files from the project
from game import Game
from idlerpg import IdleRPG
from logger import log, story
# Import Graphic Lib
from PyQt5.QtWidgets import QApplica... | #!/usr/bin/python3
# -*- coding: utf8 -*
import sys
# Fix for file paths errors
import os
PATH = os.path.dirname(os.path.realpath(__file__))
# Import other files from the project
from game import Game
from idlerpg import IdleRPG
from logger import log, story
# Import Graphic Lib
from PyQt5.QtWidgets import (QApplic... |
Use open context to load readme (per best practices) | #!/usr/bin/env python
from setuptools import setup, find_packages
with open('VERSION') as version_stream:
version = version_stream.read().strip()
with open('README.rst') as readme_stream:
readme = readme_stream.read()
setup(
name='PlayerPiano',
version=version,
description='Amazes your friends b... | #!/usr/bin/env python
from setuptools import setup, find_packages
with open('VERSION') as version_stream:
version = version_stream.read().strip()
setup(
name='PlayerPiano',
version=version,
description='Amazes your friends by running Python doctests in a fake interactive shell.',
author='Peter Fe... |
Fix Filename Errors
Module folder had changed at some point in the past, fixed the file
path so it could find the CSV | import os
import csv
abilityList = {}
def loadAbilities():
global abilityList
fileName = "FF4P/FF4P_Abil.csv"
if not os.path.exists(fileName):
fileName = "FF4P_Abil.csv"
with open(fileName, 'r') as csvFile:
abilityReader = csv.reader(csvFile, delimiter=',', quotechar='|')
i... | import csv
abilityList = {}
def loadAbilities():
global abilityList
with open('FF4/FF4Abil.csv', 'r') as csvFile:
abilityReader = csv.reader(csvFile, delimiter=',', quotechar='|')
i = 0
for row in abilityReader:
abilityList[i] = row
i += 1
def reloadAbilities():... |
Fix KeyError: 'version' due to 403 Forbidden error | import json
import sys
import requests
def py_version():
if sys.version_info < (3, 0, 0):
print(sys.version)
print('You must use Python 3.x to run this application.')
sys.exit(1)
def get_version(endpoint):
r = requests.get('https://{}'.format(endpoint))
es_version = json.loads(r.... | import json
import sys
import requests
def py_version():
if sys.version_info < (3, 0, 0):
print(sys.version)
print('You must use Python 3.x to run this application.')
sys.exit(1)
def get_version(endpoint):
r = requests.get('https://{}'.format(endpoint))
es_version = json.loads(r.... |
Increase timeouts in attempt to get windows CI build working! | "use strict";
var path = require("path");
var _ = require("lodash");
var assert = require("chai").assert;
var request = require("supertest");
var fork = require("child_process").fork;
var index = path.resolve( __dirname + "/../../../index.js");
describe("E2E CLI Snippet test", function () {
this.... | "use strict";
var path = require("path");
var _ = require("lodash");
var assert = require("chai").assert;
var request = require("supertest");
var fork = require("child_process").fork;
var index = path.resolve( __dirname + "/../../../index.js");
describe("E2E CLI Snippet test", function () {
var b... |
Remove hard coding the 401 and instead give it a readable name. | // apikey module validates the apikey argument used in the call. It
// caches the list of users to make lookups faster.
var http = require('http');
var httpStatus = require('http-status');
module.exports = function(apikeyCache) {
'use strict';
// validateAPIKey Looks up the apikey. If none is specified, or a
... | // apikey module validates the apikey argument used in the call. It
// caches the list of users to make lookups faster.
var http = require('http');
module.exports = function(apikeyCache) {
'use strict';
// validateAPIKey Looks up the apikey. If none is specified, or a
// bad key is passed then abort the cal... |
[lib] Use hook instead of connect function in MessageHandler
Test Plan: Checked if onMessage still fired and worked correcly on web and native
Reviewers: palys-swm, ashoat, atul
Reviewed By: ashoat
Subscribers: ashoat, KatPo, zrebcu411, Adrian, atul
Differential Revision: https://phabricator.ashoat.com/D828 | // @flow
import * as React from 'react';
import { useDispatch } from 'react-redux';
import { processMessagesActionType } from '../actions/message-actions';
import {
type ServerSocketMessage,
serverSocketMessageTypes,
type SocketListener,
} from '../types/socket-types';
type Props = {|
+addListener: (listener... | // @flow
import PropTypes from 'prop-types';
import * as React from 'react';
import { processMessagesActionType } from '../actions/message-actions';
import {
type ServerSocketMessage,
serverSocketMessageTypes,
type SocketListener,
} from '../types/socket-types';
import type { DispatchActionPayload } from '../ut... |
Fix possible exception by using empty object for options | /**
* @providesModule MusicControl
* @flow
*/
'use strict';
import { NativeModules, DeviceEventEmitter } from 'react-native';
const NativeMusicControl = NativeModules.MusicControlManager;
/**
* High-level docs for the MusicControl iOS API can be written here.
*/
var handlers = { };
var subscription = null;
var ... | /**
* @providesModule MusicControl
* @flow
*/
'use strict';
import { NativeModules, DeviceEventEmitter } from 'react-native';
const NativeMusicControl = NativeModules.MusicControlManager;
/**
* High-level docs for the MusicControl iOS API can be written here.
*/
var handlers = { };
var subscription = null;
var ... |
Fix passed id of state add | "use strict";
var LocalStorageUtils = require("./utils/LocalStorageUtils");
var StateIds = require("./states/States");
var InitializeState = require("./states/InitializeState");
var MenuState = require("./states/MenuState");
var SettingsState = require("./states/SettingsState");
var LoadingState = require("./states/L... | "use strict";
var LocalStorageUtils = require("./utils/LocalStorageUtils");
var StateIds = require("./states/States");
var InitializeState = require("./states/InitializeState");
var MenuState = require("./states/MenuState");
var SettingsState = require("./states/SettingsState");
var LoadingState = require("./states/L... |
Remove isSupported check: cookie fallback appears to be automatic
From the https://github.com/grevory/angular-local-storage#get docs:
> If local storage is not supported, use cookies instead. | 'use strict';
/**
* @ngdoc directive
* @name vlui.directive:modal
* @description
* # modal
*/
angular.module('vlui')
.directive('welcomeModal', function (Modals, localStorageService) {
return {
templateUrl: 'welcomemodal/welcomemodal.html',
restrict: 'E',
transclude: true,
scope: tru... | 'use strict';
/**
* @ngdoc directive
* @name vlui.directive:modal
* @description
* # modal
*/
angular.module('vlui')
.directive('welcomeModal', function (Modals, localStorageService) {
return {
templateUrl: 'welcomemodal/welcomemodal.html',
restrict: 'E',
transclude: true,
scope: tru... |
Remove undefined version from CLI | import 'babel-polyfill';
import fs from 'fs';
import readline from 'readline';
import program from 'commander';
import { observer as globalObserver } from '../../common/utils/observer';
import { createInterpreter } from './CliTools';
const log = (...args) => console.log(`${new Date().toLocaleTimeString()}:`, ...args);... | import 'babel-polyfill';
import fs from 'fs';
import readline from 'readline';
import program from 'commander';
import { observer as globalObserver } from '../../common/utils/observer';
import { version } from '../../../package.json';
import { createInterpreter } from './CliTools';
const log = (...args) => console.log... |
Make sure base tag is not added | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
... | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-contr... |
Test for pydbus instead of dbus on startup | from __future__ import unicode_literals
import os
from mopidy import config, exceptions, ext
__version__ = '1.4.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-MPRIS'
ext_name = 'mpris'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__... | from __future__ import unicode_literals
import os
from mopidy import config, exceptions, ext
__version__ = '1.4.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-MPRIS'
ext_name = 'mpris'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__... |
Fix formatting for hours greater than 9 | function pad(num, size) {
var s = '0000' + num
return s.substring(s.length - size)
}
function capitalize(s) {
return s[0].toUpperCase() + s.slice(1)
}
export function formatTime(time) {
let h, m, s, ms = 0
var newTime = ''
h = Math.floor( time / (60 * 60) )
time = time % (60 * 60)
m = Math.floor( t... | function pad(num, size) {
var s = '0000' + num
return s.substring(s.length - size)
}
function capitalize(s) {
return s[0].toUpperCase() + s.slice(1)
}
export function formatTime(time) {
let h, m, s, ms = 0
var newTime = ''
h = Math.floor( time / (60 * 60) )
time = time % (60 * 60)
m = Math.floor( t... |
Use django TestCase in tutorial send email test
It was using regular Python unittest.TestCase for some
reason, resulting in leaving old BulkEmail objects in
the database that other tests weren't expecting. | """Test for the tutorials.utils package"""
import datetime
from mock import patch
from django.template import Template
from django.test import TestCase
from pycon.bulkemail.models import BulkEmail
from ..utils import queue_email_message
today = datetime.date.today()
class TestSendEmailMessage(TestCase):
@p... | """Test for the tutorials.utils package"""
import datetime
import unittest
from mock import patch
from django.template import Template
from pycon.bulkemail.models import BulkEmail
from ..utils import queue_email_message
today = datetime.date.today()
class TestSendEmailMessage(unittest.TestCase):
@patch('dj... |
Add requirements for developers necessary for tests | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.1.2dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/windpowerlib',
author='oe... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.1.2dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/windpowerlib',
author='oe... |
Use golang parser for .hxx and .cxx files | package plaintext
import (
"strings"
)
// returns the mimetype of the full filename if none
func getSuffix(filename string) string {
idx := strings.LastIndex(filename, ".")
if idx == -1 || idx+1 == len(filename) {
return filename
}
return filename[idx+1:]
}
// ExtractorByFilename returns an plaintext extracto... | package plaintext
import (
"strings"
)
// returns the mimetype of the full filename if none
func getSuffix(filename string) string {
idx := strings.LastIndex(filename, ".")
if idx == -1 || idx+1 == len(filename) {
return filename
}
return filename[idx+1:]
}
// ExtractorByFilename returns an plaintext extracto... |
Use card display store from Guild ball app | import { createReducer } from 'redux-immutablejs';
import { createSelector } from 'reselect';
import Immutable from 'immutable';
import constants from './constants';
// Constants
const {
CHANGE_CARD,
FLIP_CARD,
} = constants;
// Initial State
const initialState = Immutable.fromJS({
playerName: '',
showFr... | import { createReducer } from 'redux-immutablejs';
import { createSelector } from 'reselect';
import Immutable from 'immutable';
import constants from './constants';
// Constants
const {
FLIP_CARD,
} = constants;
// Initial State
const initialState = Immutable.fromJS({
showFront: false,
});
// Selectors
const... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.