text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix function declaration for fuzz task | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... | import redis
from celery import Celery
from .Fuzzer import Fuzzer
import os
import time
import driller.config as config
import logging
l = logging.getLogger("fuzzer.tasks")
backend_url = "redis://%s:%d" % (config.REDIS_HOST, config.REDIS_PORT)
app = Celery('fuzzer', broker=config.BROKER_URL, backend=backend_url)
@... |
Fix hotel restart on OS X | const fs = require('fs')
const path = require('path')
const mkdirp = require('mkdirp')
const startup = require('user-startup')
const common = require('../common')
const conf = require('../conf')
const uninstall = require('../scripts/uninstall')
module.exports = {
start,
stop
}
// Start daemon in background
functi... | const fs = require('fs')
const path = require('path')
const mkdirp = require('mkdirp')
const startup = require('user-startup')
const common = require('../common')
const conf = require('../conf')
const uninstall = require('../scripts/uninstall')
module.exports = {
start,
stop
}
// Start daemon in background
functi... |
Drop runtime flag from karma webpack options | /* eslint-env node */
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
'test/**/*.js'
],
preprocessors: {
'test/**/*.js': ['webpack', 'sourcemap']
},
webpack: {
devtool: 'inline-source-map',
module: {
loaders:... | /* eslint-env node */
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
'test/**/*.js'
],
preprocessors: {
'test/**/*.js': ['webpack', 'sourcemap']
},
webpack: {
devtool: 'inline-source-map',
module: {
loaders:... |
Disable icon temporarily and adjust the debug print statements | import gntp
import Growl
class GNTPRegister(gntp.GNTPRegister):
def send(self):
print 'Sending Local Registration'
growl = Growl.GrowlNotifier(
applicationName = self.headers['Application-Name'],
notifications = self.notifications,
defaultNotifications = self.defaultNotifications,
)
growl.registe... | import gntp
import Growl
class GNTPRegister(gntp.GNTPRegister):
def send(self):
print 'Sending Registration'
growl = Growl.GrowlNotifier(
applicationName = self.headers['Application-Name'],
notifications = self.notifications,
defaultNotifications = self.defaultNotifications,
)
growl.register()
... |
Change the name template component to view component | 'use strict';
var createComponent = require('./src/component');
var createTemplateComponent = require('./src/template-component');
var createAdapter = require('./src/rx/adapter');
var React = require('react');
var RxAdapter = createAdapter();
var Cycle = {
/**
* The component's definition function.
*
* @ca... | 'use strict';
var createComponent = require('./src/component');
var createTemplateComponent = require('./src/template-component');
var createAdapter = require('./src/rx/adapter');
var React = require('react');
var RxAdapter = createAdapter();
var Cycle = {
/**
* The component's definition function.
*
* @ca... |
Refactor body DOM selector to the body prop | import ReactDOM from 'react-dom';
import React, { PropTypes } from 'react';
import { Provider } from 'react-redux';
import createStore from '../../app/store/configureStore';
import InjectCardDepView from '../../app/containers/InjectCardDepView';
import InjectCardDepViewToggler from '../../app/containers/InjectCardDepV... | import ReactDOM from 'react-dom';
import React, { PropTypes } from 'react';
import { Provider } from 'react-redux';
import createStore from '../../app/store/configureStore';
import InjectCardDepView from '../../app/containers/InjectCardDepView';
import InjectCardDepViewToggler from '../../app/containers/InjectCardDepV... |
Add test for duplicate rooms | import unittest
from src.dojo import Dojo
class TestCreateRoom (unittest.TestCase):
def setUp(self):
self.dojo = Dojo()
self.test_office = self.dojo.create_room("office", "test")
self.test_living_space = self.dojo.create_room("living_space", "test living space")
def test_create_room_... | import unittest
from src.dojo import Dojo
class TestCreateRoom (unittest.TestCase):
def setUp(self):
self.dojo = Dojo()
self.test_office = self.dojo.create_room("office", "test")
self.test_living_space = self.dojo.create_room("living_space", "test living space")
def test_create_room_... |
Use find_packages instead of an explicit list of packages for easier maintenance. | from setuptools import find_packages, setup
setup(
name="balrog",
version="1.0",
description="Mozilla's Update Server",
author="Ben Hearsum",
author_email="ben@hearsum.ca",
packages=find_packages(exclude=["vendor"]),
include_package_data=True,
install_requires=[
"flask==0.10.1"... | from setuptools import setup
setup(
name="balrog",
version="1.0",
description="Mozilla's Update Server",
author="Ben Hearsum",
author_email="ben@hearsum.ca",
packages=[
"auslib",
"auslib.admin",
"auslib.admin.views",
"auslib.blobs",
"auslib.migrate",
... |
Make the dark theme for JavaScript look a bit like Monokai. | module.exports = {
name: 'dark-syntax-theme',
installInto: function (pen) {
pen.installTheme('html', {
jsComment: 'gray',
jsFunctionName: 'jsKeyword',
jsKeyword: '#F92672', // red
jsNumber: [],
jsPrimitive: 'white',
jsRegexp: '#E6DB... | module.exports = {
name: 'dark-syntax-theme',
installInto: function (pen) {
pen.installTheme('html', {
jsComment: 'gray',
jsFunctionName: 'jsKeyword',
jsKeyword: '#FFAA27',
jsNumber: [],
jsPrimitive: 'white',
jsRegexp: '#C6FF3C',
... |
Add a TODO to make a client for my API | import { call, put, takeEvery } from 'redux-saga/effects';
import _ from 'lodash';
import { sumPlayerRanks } from './utils';
import {
PLAYERS_FETCH_REQUESTED,
PLAYERS_FETCH_SUCCEEDED,
PLAYERS_FETCH_FAILED,
PLAYER_COLUMNS
} from './constants';
import request from 'superagent';
//TODO: Make a client for my API... | import { call, put, takeEvery } from 'redux-saga/effects';
import _ from 'lodash';
import { sumPlayerRanks } from './utils';
import {
PLAYERS_FETCH_REQUESTED,
PLAYERS_FETCH_SUCCEEDED,
PLAYERS_FETCH_FAILED,
PLAYER_COLUMNS
} from './constants';
import request from 'superagent';
const playerUrl = 'http://127.0.... |
Add an event emitter to I/O. | var stream = require('stream'),
events = require('events'),
run = require('./run'),
exit = require('./exit'),
slice = [].slice
function createStream (s) {
return s || new stream.PassThrough
}
module.exports = function (module, source, program) {
if (typeof source == 'function') {
progr... | var stream = require('stream'),
run = require('./run'),
exit = require('./exit'),
slice = [].slice
function createStream (s) {
return s || new stream.PassThrough
}
module.exports = function (module, source, program) {
if (typeof source == 'function') {
program = source
source = mod... |
Change modfied variable to true | # -*- coding: utf-8 -*-
"""
This class represents an interface of an image processing algorithm.
The class abstracts algorithm interface from user so he can fully focus on his
algorithm implementation.
"""
__author__ = "p.shkadzko@gmail.com"
class Algorithm:
def __init__(self):
"""
Algorithm cla... | # -*- coding: utf-8 -*-
"""
This class represents an interface of an image processing algorithm.
The class abstracts algorithm interface from user so he can fully focus on his
algorithm implementation.
"""
__author__ = "p.shkadzko@gmail.com"
class Algorithm:
def __init__(self):
"""
Algorithm cla... |
Fix test break for windows: better error handling | // +build windows
package buf
import (
"syscall"
)
func checkReadVConstraint(conn syscall.RawConn) (bool, error) {
var isSocketReady = false
var reason error
/*
In Windows, WSARecv system call only support socket connection.
It it required to check if the given fd is of a socket type
Fix https://github.co... | // +build windows
package buf
import (
"syscall"
)
func checkReadVConstraint(conn syscall.RawConn) (bool, error) {
var isSocketReady = false
var reason error
/*
In Windows, WSARecv system call only support socket connection.
It it required to check if the given fd is of a socket type
Fix https://github... |
Update download URL to match current version / tag. | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.0',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.2.0',
... | from setuptools import setup
setup(name='pagerduty_events_api',
version='0.2.0',
description='Python wrapper for Pagerduty Events API',
url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api',
download_url='https://github.com/BlasiusVonSzerencsi/pagerduty-events-api/tarball/0.1.1',
... |
Fix tabbar for requests and expertise | /**
* fills the righthandside flexTab-Bar with the relevant tools
* @see packages/rocketchat-livechat/client/ui.js
* @see packages/rocketchat-lib/client/defaultTabBars.js
*/
RocketChat.TabBar.addGroup('starred-messages', ['request', 'expertise']);
RocketChat.TabBar.addGroup('push-notifications', ['request', 'exper... | /**
* fills the righthandside flexTab-Bar with the relevant tools
* @see packages/rocketchat-livechat/client/ui.js
* @see packages/rocketchat-lib/client/defaultTabBars.js
*/
RocketChat.TabBar.addGroup('starred-messages', ['request', 'expertise']);
RocketChat.TabBar.addGroup('push-notifications', ['request', 'exper... |
casper: Fix waiting condition in message deletion tests.
We now specifically wait for the length to decrease by one. This seems
like a more deterministic condition to wait on.
Previously we were waiting till the id of the deleted message remained
visible; intuitively, this should have worked but it seems that there
i... | var common = require('../casper_lib/common.js').common;
common.start_and_log_in();
var last_message_id;
var msgs_qty;
casper.then(function () {
casper.waitUntilVisible("#zhome");
});
casper.then(function () {
msgs_qty = this.evaluate(function () {
return $('#zhome .message_row').length;
});
... | var common = require('../casper_lib/common.js').common;
common.start_and_log_in();
var last_message_id;
var msgs_qty;
casper.then(function () {
casper.waitUntilVisible("#zhome");
});
casper.then(function () {
msgs_qty = this.evaluate(function () {
return $('#zhome .message_row').length;
});
... |
Make the detection of Node.js environments on Electron strict.
The main process and its child processes should be detected as Node.js environments. | /* Copyright 2018 Mozilla Foundation
*
* 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... | /* Copyright 2018 Mozilla Foundation
*
* 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... |
Rename the loadGroups method to loadCategories | package org.monospark.actioncontrol.category;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
import org.monospark.actioncontrol.config.ConfigParseException;
import org.monospark.actioncontrol.config.Co... | package org.monospark.actioncontrol.category;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
import org.monospark.actioncontrol.config.ConfigParseException;
import org.monospark.actioncontrol.config.Co... |
Return password when it contains =
Fixes #3 |
// Code based largely on this module:
// https://www.npmjs.org/package/git-credential
function parseOutput(data, callback) {
var output = {};
if (data) {
output = data.toString('utf-8')
.split('\n')
.map(function (line) {
var index = line.indexOf('=');
... |
// Code based largely on this module:
// https://www.npmjs.org/package/git-credential
function parseOutput(data, callback) {
var output = {};
if (data) {
output = data.toString('utf-8')
.split('\n')
.map(function (line) {
return line.split('=');
})
... |
Add CSV folder setting comment | import os
import re
from imap import EmailCheckError, EmailServer
from postgresql import DatabaseServer
# If this is set to a valid path, all CSV files extracted from emails will be
# stored in sub-folders within it.
CSV_FOLDER = os.getcwd()
# Values come from `EMAIL_SUBJECT_RE`.
CSV_NAME_FORMAT = '{year}-{month}-{... | import os
import re
from imap import EmailCheckError, EmailServer
from postgresql import DatabaseServer
CSV_FOLDER = os.getcwd()
# Values come from `EMAIL_SUBJECT_RE`.
CSV_NAME_FORMAT = '{year}-{month}-{day}T{hour}{minute}.csv'
# Restrict emails by sender.
EMAIL_FROM = 'sender@example.com'
# Restrict emails by su... |
Include classes and interfaces with generics | <?hh // strict
namespace HHVM\UserDocumentation;
use FredEmmott\DefinitionFinder\ScannedBase;
use FredEmmott\DefinitionFinder\ScannedFunctionAbstract;
use FredEmmott\DefinitionFinder\HasScannedGenerics;
abstract final class ScannedDefinitionFilters {
public static function IsHHSpecific(ScannedBase $def): bool {
... | <?hh // strict
namespace HHVM\UserDocumentation;
use FredEmmott\DefinitionFinder\ScannedBase;
use FredEmmott\DefinitionFinder\ScannedFunctionAbstract;
abstract final class ScannedDefinitionFilters {
public static function IsHHSpecific(ScannedBase $def): bool {
$is_hh_specific =
strpos($def->getName(), 'H... |
Use some PHP 5.4 constants unconditionally | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Translation\Dumper;
use Symfony\Component\Translation... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Translation\Dumper;
use Symfony\Component\Translation... |
Modify Zika fasta fields to match default VIPRBRC ordering. | import os, re, time, datetime, csv, sys
import rethinkdb as r
from Bio import SeqIO
from vdb_upload import vdb_upload
from vdb_upload import parser
class Zika_vdb_upload(vdb_upload):
def __init__(self, fasta_fields, fasta_fname, database, virus, source, locus=None, vsubtype=None, authors=None, path=None, auth_ke... | import os, re, time, datetime, csv, sys
import rethinkdb as r
from Bio import SeqIO
from vdb_upload import vdb_upload
from vdb_upload import parser
class Zika_vdb_upload(vdb_upload):
def __init__(self, fasta_fields, fasta_fname, database, virus, source, locus=None, vsubtype=None, authors=None, path=None, auth_ke... |
Fix EventEmitter on Node 0.10 | 'use strict';
var acquire = require('acquire'),
mapKeys = require('map-keys'),
camelCase = require('camel-case');
var fs = require('fs'),
path = require('path'),
EventEmitter = require('events').EventEmitter;
module.exports = function (repl, dir) {
var ee = new EventEmitter;
process.nextTick(fu... | 'use strict';
var acquire = require('acquire'),
mapKeys = require('map-keys'),
camelCase = require('camel-case');
var fs = require('fs'),
path = require('path'),
EventEmitter = require('events');
module.exports = function (repl, dir) {
var ee = new EventEmitter;
process.nextTick(function () {
... |
Make expand hints underline on mouseenter | function expandInfo(elem) {
$(elem).children('.section-expand-hint').slideUp();
$(elem).children('.section-hidden-text').slideDown();
}
function retractInfo(elem) {
$(elem).children('.section-expand-hint').slideDown();
$(elem).children('.section-hidden-text').slideUp();
}
$(document).ready( function()... | function expandInfo(elem) {
$(elem).children('.section-expand-hint').slideUp();
$(elem).children('.section-hidden-text').slideDown();
}
function retractInfo(elem) {
$(elem).children('.section-expand-hint').slideDown();
$(elem).children('.section-hidden-text').slideUp();
}
$(document).ready( function()... |
Fix extra spaces after callstack print | package aya;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Stack;
import aya.instruction.variable.GetVariableInstruction;
/**
* Utility class for tracing function calls during Aya execution
* @author npaul
*
*/
public class CallStack {
private Stack<GetVariableInstruction> _stack;
... | package aya;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Stack;
import aya.instruction.variable.GetVariableInstruction;
/**
* Utility class for tracing function calls during Aya execution
* @author npaul
*
*/
public class CallStack {
private Stack<GetVariableInstruction> _stack;
... |
Stop bot after 30 consecutive failed API calls | var _ = require('underscore');
var async = require('async');
var logger = require('./loggingservice.js');
var api = require('./api.js');
var downloader = function(refreshInterval){
this.refreshInterval = refreshInterval;
this.noTradesCount = 0;
_.bindAll(this, 'start', 'stop', 'processTrades');
};
//---Event... | var _ = require('underscore');
var async = require('async');
var logger = require('./loggingservice.js');
var api = require('./api.js');
var downloader = function(refreshInterval){
this.refreshInterval = refreshInterval;
_.bindAll(this, 'start', 'stop', 'processTrades');
};
//---EventEmitter Setup
var Util = r... |
Change the default sort to be by name | Meteor.methods({
groupsList: function(nameFilter, limit, sort) {
if (!Meteor.userId()) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'groupsList' });
}
let options = {
fields: { name: 1 },
sort: { name: 1 }
};
//Verify the limit param is a number
if (_.isNumber(limit))... | Meteor.methods({
groupsList: function(nameFilter, limit, sort) {
if (!Meteor.userId()) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'groupsList' });
}
let options = {
fields: { name: 1 },
sort: { msgs: -1 }
};
//Verify the limit param is a number
if (_.isNumber(limit)... |
Fix artisan error for empty module | <?php namespace Pingpong\Modules;
use Illuminate\Foundation\Application;
use Illuminate\Support\Str;
class ModuleFinder
{
/**
* @var \Illuminate\Foundation\Application
*/
protected $app;
/**
* Constructor.
*
* @param \Illuminate\Foundation\Application $app
*/
public function __construct(Application $... | <?php namespace Pingpong\Modules;
use Illuminate\Foundation\Application;
use Illuminate\Support\Str;
class ModuleFinder
{
/**
* @var \Illuminate\Foundation\Application
*/
protected $app;
/**
* Constructor.
*
* @param \Illuminate\Foundation\Application $app
*/
public function __construct(Application $... |
Test that there is only one entry in the DB. | package javaeems.chapter1.model;
import static org.junit.Assert.*;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class ModelEJBTest {
private ModelEJB e... | package javaeems.chapter1.model;
import static org.junit.Assert.*;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class ModelEJBTest {
private ModelEJB e... |
Fix inverted array read check | package us.myles.ViaVersion.api.type.types;
import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf;
import us.myles.ViaVersion.api.type.Type;
public class ByteArrayType extends Type<byte[]> {
public ByteArrayType() {
super(byte[].class);
}
@Override
public void write(Byte... | package us.myles.ViaVersion.api.type.types;
import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf;
import us.myles.ViaVersion.api.type.Type;
public class ByteArrayType extends Type<byte[]> {
public ByteArrayType() {
super(byte[].class);
}
@Override
public void write(Byte... |
Use Math to transform duration to seconds | 'use strict'
const sanitize = require('sanitize-html')
exports.html = html
exports.duration = duration
const allowedTags = [
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'li',
'b', 'i', 'strong', 'em', 'code', 'br', 'div', 'pre'
]
function html (str) {
if (typeof str !== 'string') r... | 'use strict'
const sanitize = require('sanitize-html')
exports.html = html
exports.duration = duration
const allowedTags = [
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'li',
'b', 'i', 'strong', 'em', 'code', 'br', 'div', 'pre'
]
function html (str) {
if (typeof str !== 'string') r... |
Set a https url because firefox was being a little bitch. | var streamURL = "https://half-shot.uk/stream.json";
var player = document.querySelector("audio#stream_player");
var streamended = true;
var player_interval;
function getStream(){
var rstatus = new Request(streamURL);
fetch(rstatus).then(function(response) {
return response.json()
}).then(function(streamdata)... | var streamURL = "http://half-shot.uk:8000/status-json.xsl";
var player = document.querySelector("audio#stream_player");
var streamended = true;
var player_interval;
function getStream(){
var rstatus = new Request(streamURL);
fetch(rstatus).then(function(response) {
return response.json()
}).then(function(str... |
Make sure that an empty time component does not trigger infinite onChange events. | import moment from 'moment';
import TextFieldComponent from '../textfield/TextField';
export default class TimeComponent extends TextFieldComponent {
static schema(...extend) {
return TextFieldComponent.schema({
type: 'time',
label: 'Time',
key: 'time',
inputType: 'time',
format: 'H... | import moment from 'moment';
import TextFieldComponent from '../textfield/TextField';
export default class TimeComponent extends TextFieldComponent {
static schema(...extend) {
return TextFieldComponent.schema({
type: 'time',
label: 'Time',
key: 'time',
inputType: 'time',
format: 'H... |
Change standalone module tester to use arguments as input | package com.equalize.xpi.af.modules.tester;
import java.util.Hashtable;
import com.equalize.xpi.tester.util.ParameterHelper;
public class ModuleTesterMain {
public static void main(String[] args) {
try {
// Sample arguments:-
// arg0 - com.equalize.xpi.af.modules.FormatConversionBean
// arg1 - C:\Users\... | package com.equalize.xpi.af.modules.tester;
import java.util.Hashtable;
import com.equalize.xpi.tester.util.ParameterHelper;
public class ModuleTesterMain {
public static void main(String[] args) {
try {
// Default files
String inputFile = "C:\\Users\\ksap086\\Desktop\\Excel2XML_Scenario1.xlsx";
String ... |
Update chosen theme in ChangeThemeView on theme change | pageflow.ChangeThemeView = Backbone.Marionette.ItemView.extend({
template: 'templates/change_theme',
ui: {
changeThemeButton: '.change_theme',
labelText: 'label .name'
},
events: {
'click .change_theme': function() {
pageflow.ChangeThemeDialogView.open({
model: this.model,
th... | pageflow.ChangeThemeView = Backbone.Marionette.ItemView.extend({
template: 'templates/change_theme',
ui: {
changeThemeButton: '.change_theme',
labelText: 'label .name'
},
events: {
'click .change_theme': function() {
pageflow.ChangeThemeDialogView.open({
model: this.model,
th... |
Enable custom map loaders to setOwnedTextures when not residing in
the *.tiled namespace | package com.badlogic.gdx.maps.tiled;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.maps.Map;
import com.badlogic.gdx.utils.Array;
/**
* @brief Represents a tiled map, adds the concept of tiles and tilesets
*
* @see Map
*/
public class TiledMap exte... | package com.badlogic.gdx.maps.tiled;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.maps.Map;
import com.badlogic.gdx.utils.Array;
/**
* @brief Represents a tiled map, adds the concept of tiles and tilesets
*
* @see Map
*/
public class TiledMap exte... |
Use workspace.root() instead of workspace.path() | var Watcher = require('large-watcher');
module.exports = function(codebox) {
var events = codebox.events;
codebox.logger.log("Starting the file watcher");
var watcher = Watcher(codebox.workspace.root(), 2).start();
// Handle deleted files
watcher.on('deleted', function(files) {
codebox.... | var Watcher = require('large-watcher');
module.exports = function(codebox) {
var events = codebox.events;
codebox.logger.log("Starting the file watcher");
codebox.workspace.path()
.then(function(path) {
var watcher = Watcher(path, 2).start();
// Handle deleted files
watcher.... |
Test if the DOI was actually created on DataCite | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-doi
# Created by the Natural History Museum in London, UK
import time
import nose
from ckanext.doi.lib.api import DataciteClient
from ckantest.models import TestBase
from datacite.errors import DataCiteError
import constants
class TestAPI(Tes... | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-doi
# Created by the Natural History Museum in London, UK
import nose
from ckanext.doi.lib.api import DataciteClient
from ckantest.models import TestBase
from datacite.errors import DataCiteError
import constants
class TestAPI(TestBase):
p... |
Fix case mismatch bug on AeriaMetabox | <?php
// Fix case mismatch bug on AeriaMetabox
class_alias('AeriaMetabox','AeriaMetaBox',false);
if(!function_exists('array_merge_replace')) {
function array_merge_replace () {
$arrays = func_get_args();
$base = array_shift($arrays);
if(!is_array($base)) $base = empty($base) ? array() : array($base);
foreach... | <?php
if(!function_exists('array_merge_replace')) {
function array_merge_replace () {
$arrays = func_get_args();
$base = array_shift($arrays);
if(!is_array($base)) $base = empty($base) ? array() : array($base);
foreach($arrays as $append) {
if(!is_array($append)) $append = array($append);
foreach($appen... |
Remove experimental flag from the authenticator system 🚀 | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Core\Signature;
use Psr\Cache\CacheItemPoolI... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Core\Signature;
use Psr\Cache\CacheItemPoolI... |
Adjust POST_LOGIN_VIEW and POST_LOGOUT_VIEW test | # -*- coding: utf-8 -*-
"""
test_configuration
~~~~~~~~~~~~~~~~~~
Basic configuration tests
"""
import base64
import pytest
from utils import authenticate, logout
@pytest.mark.settings(
logout_url='/custom_logout',
login_url='/custom_login',
post_login_view='/post_login',
post_logout_v... | # -*- coding: utf-8 -*-
"""
test_configuration
~~~~~~~~~~~~~~~~~~
Basic configuration tests
"""
import base64
import pytest
from utils import authenticate, logout
@pytest.mark.settings(
logout_url='/custom_logout',
login_url='/custom_login',
post_login_view='/post_login',
post_logout_v... |
Update package name and increment version | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy-nightly'
__version__ = '2.0.0a1'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython'... | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
__title__ = 'spacy'
__version__ = '2.0.0a0'
__summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython'
__uri__... |
Revert "Import spareice per default."
This reverts commit d54042d41b981b3479adb140f2534f76c967fa1c. | # -*- coding: utf-8 -*-
from .version import __version__
try:
__TYPHON_SETUP__
except:
__TYPHON_SETUP__ = False
if not __TYPHON_SETUP__:
from . import arts
from . import atmosphere
from . import config
from . import constants
from . import files
from . import geodesy
from . import... | # -*- coding: utf-8 -*-
from .version import __version__
try:
__TYPHON_SETUP__
except:
__TYPHON_SETUP__ = False
if not __TYPHON_SETUP__:
from . import arts
from . import atmosphere
from . import config
from . import constants
from . import files
from . import geodesy
from . import... |
Insert unused import to test pyflakes in travis | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... |
Make sure cookie-service gets enabled | /* load after build_application.js */
window.app.builders.CookieManager || ( window.app.builders.CookieManager = {} );
/**
* @param {Object} service the service description of the according service on the host side
*/
window.app.builders.CookieManager["1.0"] = function(service)
{
var namespace = cls... | /* load after build_application.js */
window.app.builders.CookieManager || ( window.app.builders.CookieManager = {} );
/**
* @param {Object} service the service description of the according service on the host side
*/
window.app.builders.CookieManager["1.0"] = function(service)
{
var namespace = cls... |
Drop attributes on oc_share table
Signed-off-by: Julius Härtl <bf353fa4999f2f148afcc6d8ee6cb1ee74cc07c3@bitgrid.net> | <?php
declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version21000Date20201120141228 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $opti... | <?php
declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version21000Date20201120141228 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $opti... |
Update HTML Webpack Plugin to use index.html as template | const path = require('path')
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const HtmlWebpackPlugin = require('html-webpack-plugin')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: resolve('src/index.js'),
output: {
path: resolve('dist'),
fil... | const path = require('path')
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const HtmlWebpackPlugin = require('html-webpack-plugin')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: resolve('src/index.js'),
output: {
path: resolve('dist'),
fil... |
Include static assets in pakage_data | from setuptools import setup, find_packages
setup(
name='django-treemenus',
version='0.8.8-pre',
description='Tree-structured menuing application for Django.',
author='Julien Phalip',
author_email='julien@julienphalip.com',
url='http://github.com/jphalip/django-treemenus/',
packages=find_pa... | from setuptools import setup, find_packages
setup(
name='django-treemenus',
version='0.8.8-pre',
description='Tree-structured menuing application for Django.',
author='Julien Phalip',
author_email='julien@julienphalip.com',
url='http://github.com/jphalip/django-treemenus/',
packages=find_pa... |
Prepare for test PyPI upload | import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in... | import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in... |
Add regression test against options evaluation during import in cli. | """
Tests for `kolibri.utils.cli` module.
These tests deliberately omit `@pytest.mark.django_db` from the tests,
so that any attempt to access the Django database during the running
of these cli methods will result in an error and test failure.
"""
from __future__ import absolute_import
from __future__ import print_fun... | """
Tests for `kolibri.utils.cli` module.
These tests deliberately omit `@pytest.mark.django_db` from the tests,
so that any attempt to access the Django database during the running
of these cli methods will result in an error and test failure.
"""
from __future__ import absolute_import
from __future__ import print_fun... |
Revert "OLMIS-3533: Added javadoc for Reason type priority field"
This reverts commit e5ccc08d57d538b6d6a4c6a8fd099f50e3a769af. | /*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, e... | /*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, e... |
Update main Lcd import and init, and fix help msg | #!/usr/bin/env python
import sys
from getopt import getopt, GetoptError
from .api import Server
from .lcd import Lcd
USAGE = """\
Usage %s [-h|--help] [-f|--fake]
\t-h or --help\tThis help message
\t-f or --fake\tIf on RPi, use FakeHw
"""
def get_args(args):
arg0 = args[0]
try:
opts, args = getopt(... | #!/usr/bin/env python
import sys
from getopt import getopt, GetoptError
from .api import Server
from .fake import FakeLcdApi
USAGE = """\
Usage %s [-h|--help]
\t-h or --help\tThis help message
"""
def get_args(args):
try:
opts, args = getopt(args[1:], 'hf', ['help', 'fake'])
except GetoptError as e... |
Use new headers method to avoid apache specific functions | <?php
namespace Bolt\Api\Request;
class Headers extends \Bolt\Base
{
private $headers;
public function __construct($auto = false)
{
if ($auto === true)
{
$this->parse();
}
}
public function __get($name)
{
return $this->$name;
}
public function __isset($name)
{
return isset($t... | <?php
namespace Bolt\Api\Request;
class Headers extends \Bolt\Base
{
private $headers;
public function __construct($auto = false)
{
if ($auto === true)
{
$this->parse();
}
}
public function __get($name)
{
return $this->$name;
}
public function __isset($name)
{
return isset($t... |
Use logHelper instead of console.warn | /*
Copyright 2017 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | /*
Copyright 2017 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... |
Fix admin not being able to access reqs | var OwerRequestModel = require('../models/requests/owerRequest.js')
, error = require('../utils/error.js');
var allOwerRequests = function(req, res) {
var type = req.query.type;
var facebookId;
if (req.user && req.user.facebookId) {
facebookId = req.user.facebookId;
}
if (type && facebookI... | var OwerRequestModel = require('../models/requests/owerRequest.js')
, error = require('../utils/error.js');
var allOwerRequests = function(req, res) {
var facebookId = req.user.facebookId
, type = req.query.type;
if (type) {
if (type === 'received') {
conditions.to = facebookId;
... |
Change default time between images | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 60
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fr... | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 3
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_height = 972
image_width = 1296
total_fra... |
Revert "Save .travis.yml into build properties"
The data is > 1024 so no dice.
This reverts commit 10960fd1465afb8de92e8fd35b1affca4f950e27. | from buildbot.process import buildstep
from buildbot.process.buildstep import SUCCESS, FAILURE, EXCEPTION
from buildbot.process.properties import Properties
from twisted.internet import defer
from ..travisyml import TravisYml
class ConfigurableStep(buildstep.LoggingBuildStep):
"""
Base class for a step whic... | from buildbot.process import buildstep
from buildbot.process.buildstep import SUCCESS, FAILURE, EXCEPTION
from buildbot.process.properties import Properties
from twisted.internet import defer
from ..travisyml import TravisYml
class ConfigurableStep(buildstep.LoggingBuildStep):
"""
Base class for a step whic... |
Hide sidenav when selecting team | const Backbone = require('backbone');
require('backbone.marionette');
const Repository = require('../../domain/repository');
const TeamItemViewTemplate = require('../template/team-item-view-template.hbs');
const Template = require('../template/sidenav-view-template.hbs');
const TeamItemView = Backbone.Marionette.View.... | const Backbone = require('backbone');
require('backbone.marionette');
const Repository = require('../../domain/repository');
const TeamItemViewTemplate = require('../template/team-item-view-template.hbs');
const Template = require('../template/sidenav-view-template.hbs');
const TeamItemView = Backbone.Marionette.View.... |
Fix a bug in BufferUtils | 'use strict';
const VAL32 = 0xFFFFFFFF;
class BufferUtils {
static readUInt64BE(buffer, offset) {
let hi = buffer.readUInt32BE(offset);
let value = buffer.readUInt32BE(offset + 4);
if (hi > 0) {
value += hi * (VAL32 + 1);
}
return value;
}
static write... | 'use strict';
const VAL32 = 0xFFFFFFFF;
class BufferUtils {
static readUInt64BE(buffer, offset) {
let hi = buffer.readUInt32BE(offset);
let value = buffer.readUInt32BE(offset + 4);
if (hi > 0) {
value += hi * VAL32;
}
return value;
}
static writeUInt64... |
Change primitive to object in task model | package com.github.solairerove.woodstock.domain;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
/**
* Created by krivitski-no on 10/1/16.
*/
@Data... | package com.github.solairerove.woodstock.domain;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
/**
* Created by krivitski-no on 10/1/16.
*/
@Data... |
Add children handling to visibility queue | /* ***********************************************************************************************
Unify Project
Homepage: unify-project.org
License: MIT + Apache (V2)
Copyright: 2012, Sebastian Fastner, Mainz, Germany, http://unify-training.com
*******************************************************... | /* ***********************************************************************************************
Unify Project
Homepage: unify-project.org
License: MIT + Apache (V2)
Copyright: 2012, Sebastian Fastner, Mainz, Germany, http://unify-training.com
*******************************************************... |
Update label for US CT | const Command = require('../Command');
module.exports = Command.extend({
commandName: 'time',
commandAliases: ['now'],
moment: null,
Discord: null,
dependencies: {
'moment': 'moment',
'Discord': 'Discord',
},
processMessage: function (message, tokens) {
const now = t... | const Command = require('../Command');
module.exports = Command.extend({
commandName: 'time',
commandAliases: ['now'],
moment: null,
Discord: null,
dependencies: {
'moment': 'moment',
'Discord': 'Discord',
},
processMessage: function (message, tokens) {
const now = t... |
Revert "Add access log for logserver container " | // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.vespa.model.container.ContainerCluster;... | // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.vespa.model.container.ContainerCluster;... |
[CHORE] Remove ripple rest fom package.json. | var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
function GatewayProcessManager() {
this.processNames = [
"deposits",
"outgoing",
"incoming",
"withdrawals",
"webapp"
];
this.processes = {};
}
GatewayProcessManager.prototype.start = function() {
var ... | var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
function GatewayProcessManager() {
this.processNames = [
"ripple_rest",
"deposits",
"outgoing",
"incoming",
"withdrawals",
"webapp"
];
this.processes = {};
}
GatewayProcessManager.prototype.start = f... |
Add - Simplest code to turn the Given into concrete actions (HTTP request to check that a POST resource exists) | /*
We use the output messages from the cucumber runner to create Step Definitions:
the glue between features written in Gherkin and the actual system under test.
Use Given, When, Then.
*/
let request = require('request');
const {defineSupportCode} = require('cucumber');
defineSupportCode(function({Given, Then, When... | /*
We use the output messages from the cucumber runner to create Step Definitions:
the glue between features written in Gherkin and the actual system under test.
Use Given, When, Then.
*/
let request = require('request');
const {defineSupportCode} = require('cucumber');
defineSupportCode(function({Given, Then, When}... |
Enable filtering when scaling NPOT textures; minor optimizations | package com.rabenauge.gl;
import android.graphics.Bitmap;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
/*
* Wrapper class for 2D texture objects.
*/
public class Texture2D extends Texture {
public Texture2D(GL11 gl) {
super(gl, GL10.GL_TEXTURE_2D, GL1... | package com.rabenauge.gl;
import android.graphics.Bitmap;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
/*
* Wrapper class for 2D texture objects.
*/
public class Texture2D extends Texture {
public Texture2D(GL11 gl) {
super(gl, GL10.GL_TEXTURE_2D, GL1... |
Fix pytest when pyfakefs + future is installed
`python-future` is notorious for breaking modules which use `try:` / `except:`
to import modules based on version. In this case, `pyfakefs` imported the
backported `builtins` module which changes the semantics of the `open()`
function. `pyfakefs` then monkeypatches `lin... | """A pytest plugin for using pyfakefs as a fixture
When pyfakefs is installed, the "fs" fixture becomes available.
:Usage:
def my_fakefs_test(fs):
fs.create_file('/var/data/xx1.txt')
assert os.path.exists('/var/data/xx1.txt')
"""
import linecache
import sys
import py
import pytest
from pyfakefs.fake_files... | """A pytest plugin for using pyfakefs as a fixture
When pyfakefs is installed, the "fs" fixture becomes available.
:Usage:
def my_fakefs_test(fs):
fs.create_file('/var/data/xx1.txt')
assert os.path.exists('/var/data/xx1.txt')
"""
import linecache
import py
import pytest
from pyfakefs.fake_filesystem_unitt... |
Add charset to connect mysql | import MySQLdb
import MySQLdb.cursors
from hakoblog.config import CONFIG
class DB():
def __init__(self):
self.conn = MySQLdb.connect(
db=CONFIG.DATABASE,
host=CONFIG.DATABASE_HOST,
user=CONFIG.DATABASE_USER,
password=CONFIG.DATABASE_PASS,
cursorc... | import MySQLdb
import MySQLdb.cursors
from hakoblog.config import CONFIG
class DB():
def __init__(self):
self.conn = MySQLdb.connect(
db=CONFIG.DATABASE,
host=CONFIG.DATABASE_HOST,
user=CONFIG.DATABASE_USER,
password=CONFIG.DATABASE_PASS,
cursorc... |
Use readable stream instead of pass through | 'use strict'
const stream = require('stream')
const Transform = stream.Transform
const Readable = stream.Readable
/**
* Returns a transform stream that branches
* the input stream to several streams given by argument.
*/
module.exports = function selectTask (config) {
/**
* (inputStream) -> transform -> each ... | 'use strict'
const stream = require('stream')
const Transform = stream.Transform
const PassThrough = stream.PassThrough
/**
* Returns a transform stream that branches
* the input stream to several streams given by argument.
*/
module.exports = function selectTask (config) {
/**
* (inputStream) -> transform ->... |
Call getResults() instead of accessing the get() method manually for the IteratorAggregate and Countable functions | <?php namespace Elegant\Relations;
use Countable;
use ArrayIterator;
use IteratorAggregate;
use Elegant\Model;
use Elegant\Result;
use Elegant\Row;
abstract class Relation implements Countable, IteratorAggregate {
protected $parent;
protected $related;
function __construct(Model $parent, Model $related)
{
$th... | <?php namespace Elegant\Relations;
use Countable;
use ArrayIterator;
use IteratorAggregate;
use Elegant\Model;
use Elegant\Result;
use Elegant\Row;
abstract class Relation implements Countable, IteratorAggregate {
protected $parent;
protected $related;
protected $related_items = null;
function __construct(Mode... |
Use IRC server on localhost by default | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_... | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'irc.freenode.net',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
... |
Remove unnecessary assignment and cast | package heroku.template.service;
import heroku.template.model.Person;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.criteria.CriteriaQuery;
im... | package heroku.template.service;
import heroku.template.model.Person;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import org.springframework.stereotype.Service;
im... |
Allow meta and debug tasks to not be named
Fixes #176 | # Copyright (c) 2016 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... | # Copyright (c) 2016 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... |
Improve wording of screen reader text so the user knows how to switch to a table view | $(window).on('load', function() {
if ($('.timeseries__chart').length == 0) {
// Enhance markdown charts
$('.highcharts-container').each(function () {
highchartsAccessibilityAttrs($(this), 'Chart representing data available in following XLS or CSV download');
});
} else {
... | $(window).on('load', function() {
if ($('.timeseries__chart').length == 0) {
// Enhance markdown charts
$('.highcharts-container').each(function () {
highchartsAccessibilityAttrs($(this), 'Chart representing data available in following XLS or CSV download');
});
} else {
... |
Use registration form to prevent duplicate emails
Fixes #725.
We enforce this both at the database level, and here, using django
registration's ready-made form class. | from django.conf.urls import patterns
from django.conf.urls import include
from django.conf.urls import url
from django.views.generic.base import TemplateView
from registration.forms import RegistrationFormUniqueEmail
from views import RegistrationView, ActivationView
urlpatterns = patterns('',
url(r'^activate/... | from django.conf.urls import patterns
from django.conf.urls import include
from django.conf.urls import url
from django.views.generic.base import TemplateView
from views import RegistrationView, ActivationView
urlpatterns = patterns('',
url(r'^activate/complete/$',
TemplateView.as_view(template_name='regi... |
Allow root access for mock jdk in introduce variable test | package org.jetbrains.plugins.scala.refactoring.introduceVariable;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.JavaSdk;
import com.intellij.openapi.projectRoots.Sdk;
import com.intelli... | package org.jetbrains.plugins.scala.refactoring.introduceVariable;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.JavaSdk;
import com.intellij.openapi.projectRoots.Sdk;
import junit.frame... |
Add pacman (commit missing file) | var gulp = require('gulp');
var notify = require('gulp-notify'); // unused
var browserSync = require('browser-sync').create();
var projectName;
// projectName = 'flappy-bird';
projectName = 'space-hipster';
// projectName = 'tank';
// projectName = 'webfont';
// projectName = 'flappy-bird-2';
// projectNam... | var gulp = require('gulp');
var notify = require('gulp-notify'); // unused
var browserSync = require('browser-sync').create();
var projectName;
// projectName = 'flappy-bird';
projectName = 'space-hipster';
// projectName = 'tank';
// projectName = 'webfont';
// projectName = 'flappy-bird-2';
// projectNam... |
packet: Add all submodules to import *
You can now access pox.lib.packet.icmp as pox.lib.packet.ICMP if
you import the whole package (e.g., import pox.lib.packet as pkg).
--HG--
extra : rebase_source : b48d05949977468a669bdd55caab7ac898689441 | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... | """
The POX packet library for packet parsing and creation.
This is based heavily on NOX's packet library, though it has undergone
some signficant change, particularly with regard to making packet
assembly easier.
Could still use more work.
"""
# None of this is probably that big, and almost all of it gets loaded
# ... |
Make widget independent from jquery | (function() {
// Success handler
var successHandler = function(status){
if (window.console != undefined) {
console.log("Purchase completed successfully: ", status);
}
window.location = document.getElementById('google-wallet-id').getAttribute('data-success-url');
};
... |
// Success handler
var successHandler = function(status){
if (window.console != undefined) {
console.log("Purchase completed successfully: ", status);
}
window.location = $('input#google-wallet-id').data('success-url');
};
// Failure handler
var failureHandler = function(status){
if (window.co... |
Fix for the "More at..." link to correct lineId
The sourceUrl link which controls the "More at tfl.gov.uk" href is now
fixed to link to the correct anchor for the line in question. This will
open the further information accordion and zoom the SVG map to the
correct line. (There appears to be an issue with the lineIds ... | (function (env) {
"use strict";
env.ddg_spice_tfl_status = function(api_result){
Spice.add({
id: "tfl_status",
name: "Travel",
data: api_result,
meta: {
sourceName: "tfl.gov.uk",
sourceUrl: 'http://tfl.gov.uk/tube-dlr-overground/stat... | (function (env) {
"use strict";
env.ddg_spice_tfl_status = function(api_result){
Spice.add({
id: "tfl_status",
name: "Travel",
data: api_result,
meta: {
sourceName: "tfl.gov.uk",
sourceUrl: 'http://tfl.gov.uk/tube-dlr-overground/stat... |
Use promise installer when using CLI | #!/usr/bin/env node
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory t... | #!/usr/bin/env node
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory t... |
Add utility function for executable checking | # -*- coding: utf-8 -*-
"""
pytest_pipeline.utils
~~~~~~~~~~~~~~~~~~~~~
General utilities.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
import gzip
import hashlib
import os
def file_md5sum(fname, unzip=False, mode="r", blocksize=65536):
if unzip:
opener... | # -*- coding: utf-8 -*-
"""
pytest_pipeline.utils
~~~~~~~~~~~~~~~~~~~~~
General utilities.
:copyright: (c) 2014 Wibowo Arindrarto <bow@bow.web.id>
:license: BSD
"""
import gzip
import hashlib
def file_md5sum(fname, unzip=False, mode="r", blocksize=65536):
if unzip:
opener = gzip.op... |
Add a deprecation message to the docstring of image_bytes() | """
Functions for displaying images inline in iTerm2.
See https://iterm2.com/images.html.
"""
from __future__ import print_function, division, absolute_import
import sys
import os
import base64
IMAGE_CODE = '\033]1337;File={file};inline={inline};size={size}:{base64_img}\a'
def display_image_bytes(b, filename=None, ... | """
Functions for displaying images inline in iTerm2.
See https://iterm2.com/images.html.
"""
from __future__ import print_function, division, absolute_import
import sys
import os
import base64
IMAGE_CODE = '\033]1337;File={file};inline={inline};size={size}:{base64_img}\a'
def display_image_bytes(b, filename=None, ... |
Make sure constant name is not renamed | goog.require('app');
goog.provide('app.constants');
/**
* @const
* Constants for the module.
* Access them like app.constants.SCREEN
*/
app.module.constant('constants', app.constants);
app.constants = {
SCREEN: {
SMARTPHONE : 620,
TABLET : 1099,
DEKTOP : 1400
},
STEPS: {
'climbing_outdoor' ... | goog.require('app');
goog.provide('app.constants');
/**
* @const
* Constants for the module.
* Access them like app.constants.SCREEN
*/
app.module.constant('constants', app.constants);
app.constants = {
SCREEN : {
SMARTPHONE : 620,
TABLET : 1099,
DEKTOP : 1400
},
STEPS : {
'climbing_outdoor... |
Replace Meteor.call with Meteor.apply for supposedly synchronous behavior | Keys = new Mongo.Collection("keys");
KeySchema = new SimpleSchema({
keyID: {
type: Number,
label: "Key ID",
min: 0
},
vCode: {
type: String,
label: "Verification Code",
regEx: /^[0-9a-zA-Z]+$/,
custom: function() {
if (this.field("keyID").isSet === false) return "keyIDMissing";
... | Keys = new Mongo.Collection("keys");
KeySchema = new SimpleSchema({
keyID: {
type: Number,
label: "Key ID",
min: 0
},
vCode: {
type: String,
label: "Verification Code",
regEx: /^[0-9a-zA-Z]+$/,
custom: function() {
if (this.field("keyID").isSet === false) return "keyIDMissing";
... |
Add questions having access to results |
importScripts("/app/bower_components/videogular-questions/questions-worker.js");
loadAnnotations({
"first-question": {
time: 4,
questions: [
{
id: "first-question",
type: "single",
question: "What is the moon made of?",
options: [
{
name: "cheese"
},
{
name: "cheeese... |
importScripts("/app/bower_components/videogular-questions/questions-worker.js");
loadAnnotations({
"first-question": {
time: 8,
questions: [
{
id: "first-question",
type: "single",
question: "What is the moon made of?",
options: [
{
name: "cheese"
},
{
name: "cheeese... |
Fix reading of admin status for users | import { usingConnect, sql } from './pg-helpers'
import Promise from 'bluebird';
import crypto from 'crypto';
import scmp from 'scmp'
const pbkdf2 = Promise.promisify(crypto.pbkdf2, crypto);
class User {
constructor(userData) {
this.id = userData.id;
this.email = userData.email;
this.passwordHash = user... | import { usingConnect, sql } from './pg-helpers'
import Promise from 'bluebird';
import crypto from 'crypto';
import scmp from 'scmp'
const pbkdf2 = Promise.promisify(crypto.pbkdf2, crypto);
class User {
constructor(userData) {
this.id = userData.id;
this.email = userData.email;
this.passwordHash = user... |
Update forEach in load function | var fs = require('fs');
/**
* Parses vn-license-plates.csv and creates a nodes for fast lookups
* @return object nodes list of license plates
*/
function load() {
var data = fs.readFileSync(__dirname + '/vn-license-plates.csv', 'utf8');
var lines = data.split('\r\n');
var nodes = {};
lines.forEach(fu... | var fs = require('fs');
/**
* Parses vn-license-plates.csv and creates a nodes for fast lookups
* @return object nodes list of license plates
*/
function load() {
var data = fs.readFileSync(__dirname + '/vn-license-plates.csv', 'utf8');
var lines = data.split('\r\n');
var nodes = {};
lines.forEach(fu... |
Use location.hash instead of url query params | function getLogin(){
return window.location.hash.slice(1)
}
var foundTemplate = $('#template').html();
Mustache.parse(foundTemplate);
var loadData = function(login, cb){
if(login){
var searchURL = 'https://api.github.com/search/issues?q=type:pr+author:'+login+'&sort=created&order=asc&per_page=1'
$.getJSON... | function getQueryVariable(variable){
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
var login = getQueryVariable('login')
var... |
Use React from root project to avoid duplicate React problem | var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/st... | var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/st... |
Handle graceful exit and timeout
Timeout was refactored and the defaults work correctly here. | # MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
import atexit
import asyncio
import aiohttp
connector = aiohttp.TCPConnector(limit=20)
__all__ = ['session', 'HTTPError']
class HTTPError(Exception):
def __init__(self, code, message, response):
self.code = code
self.m... | # MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
import atexit
import aiohttp
connector = aiohttp.TCPConnector(limit=20)
__all__ = ['session', 'HTTPError']
class HTTPError(Exception):
def __init__(self, code, message, response):
self.code = code
self.message = messag... |
Add guards for null values. Move address formatting to internal pr | DDG.require('maps',function(){
ddg_spice_maps_maps = function(response) {
if (!response || !response.features || !response.features.length) { return Spice.failed('maps'); }
// Mapbox sends back a bunch of places, just want the first one for now
response = response.features[0];
... | DDG.require('maps',function(){
ddg_spice_maps_maps = function(response) {
if (!response) { return Spice.failed('maps'); }
// OSM sends back a bunch of places, just want the first one for now
response = response.features[0];
response.address=response.place_name;
... |
Make .profile.d scripts and hooks compatible
- hooks should come before writing to .profile.d directory
[#145118801]
Signed-off-by: Dave Goddard <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@goddard.id.au> | package main
import (
"golang/finalize"
_ "golang/hooks"
"os"
"github.com/cloudfoundry/libbuildpack"
)
type config struct {
Config struct {
GoVersion string `yaml:"GoVersion"`
VendorTool string `yaml:"VendorTool"`
Godep string `yaml:"Godep"`
} `yaml:"config"`
}
func main() {
stager, err := libbui... | package main
import (
"golang/finalize"
_ "golang/hooks"
"os"
"github.com/cloudfoundry/libbuildpack"
)
type config struct {
Config struct {
GoVersion string `yaml:"GoVersion"`
VendorTool string `yaml:"VendorTool"`
Godep string `yaml:"Godep"`
} `yaml:"config"`
}
func main() {
stager, err :... |
Optimize gRPC connection keepalive between services | // Copyright 2018 The OpenPitrix Authors. All rights reserved.
// Use of this source code is governed by a Apache license
// that can be found in the LICENSE file.
package manager
import (
"context"
"fmt"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"openpitrix.io/openpitrix/pkg/logger"
... | // Copyright 2018 The OpenPitrix Authors. All rights reserved.
// Use of this source code is governed by a Apache license
// that can be found in the LICENSE file.
package manager
import (
"context"
"fmt"
"google.golang.org/grpc"
"openpitrix.io/openpitrix/pkg/logger"
)
func NewClient(ctx context.Context, host ... |
Use Leaflet container for positioning map controls. | import React from 'react'
import { Map, TileLayer } from 'react-leaflet'
import NavigationContainer from '../navigation/NavigationContainer'
import MarkerCluster from './MarkerCluster'
import Search from './Search'
const MapComponent = ({ places, position, zoom, apiKey }) => (
<div className="map-container">
<di... | import React from 'react'
import { Map, TileLayer } from 'react-leaflet'
import NavigationContainer from '../navigation/NavigationContainer'
import MarkerCluster from './MarkerCluster'
import Search from './Search'
const MapComponent = ({ places, position, zoom, apiKey }) => (
<div className="map-container">
<di... |
Make getById() reject the promise if User is not found
Use user id to get the orders | /**
* New node file
*/
module.exports = function (app, dao) {
var util = require('../util');
var db = app.db;
var P = app.Promise;
var Order = {};
Order.getById = function (id, t) {
return db.Order.find(util.addTrans(t, {where: {id: id}}))
.then(function(order) {
if (!order) util.throwEr... | /**
* New node file
*/
module.exports = function (app, dao) {
var util = require('../util');
var db = app.db;
var P = app.Promise;
var Order = {};
Order.getById = function (id, t) {
return db.Order.find(util.addTrans(t, {where: {id: id}}));
}
Order.getUserOrders = function (username, options, t) ... |
Add a function for questions to the survey resource | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... | from djangorestframework import views
from djangorestframework import resources
from . import models
class RatingResource (resources.ModelResource):
model = models.Rating
class RatingInstanceView (views.InstanceModelView):
resource = RatingResource
class RatingListView (views.ListOrCreateModelView):
reso... |
Fix "sprintf()" args in metadata pool. | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\AdminBundle\Metad... | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\AdminBundle\Metad... |
Allow multiple arguments for quantifiers | """
Define the names making up the domain specific language
"""
from .expectation import (
Expectation, ExpectationNot,
ExpectationAll, ExpectationAny,
ExpectationNone, OPERATOR_OR
)
# Create instances to be used with the overloaded | operator
should = Expectation(deferred=True)
should_not = E... | """
Define the names making up the domain specific language
"""
from .expectation import (
Expectation, ExpectationNot,
ExpectationAll, ExpectationAny,
ExpectationNone, OPERATOR_OR
)
# Create instances to be used with the overloaded | operator
should = Expectation(deferred=True)
should_not = E... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.