text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Allow presents to be placed inside container items
package net.mcft.copy.betterstorage.item.tile; import java.util.List; import net.mcft.copy.betterstorage.tile.entity.TileEntityPresent; import net.mcft.copy.betterstorage.utils.StackUtils; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import n...
package net.mcft.copy.betterstorage.item.tile; import java.util.List; import net.mcft.copy.betterstorage.tile.entity.TileEntityPresent; import net.mcft.copy.betterstorage.utils.StackUtils; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import n...
Use date_url for .dates(), as Django 1.6 doesn't like DateTimeField here
from django import template from django.utils import timezone from blanc_basic_news.news import get_post_model from blanc_basic_news.news.models import Category register = template.Library() @register.assignment_tag def get_news_categories(): return Category.objects.all() @register.assignment_tag def get_news_...
from django import template from django.utils import timezone from blanc_basic_news.news import get_post_model from blanc_basic_news.news.models import Category register = template.Library() @register.assignment_tag def get_news_categories(): return Category.objects.all() @register.assignment_tag def get_news_...
Make the whole div clickable
import { default as React, Component } from 'react' import { render } from 'react-dom' export class List extends Component { constructor(props) { super(props); } render() { let items = this.props.items; var itemsComponent = [] Object.keys(items).forEach(function (key) { itemsComponent.push(...
import { default as React, Component } from 'react' import { render } from 'react-dom' export class List extends Component { constructor(props) { super(props); } render() { let items = this.props.items; var itemsComponent = [] Object.keys(items).forEach(function (key) { itemsComponent.push(...
Make autopagination functions work for listLineItems and listUpcomingLineItems
'use strict'; const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ path: 'invoices', includeBasic: ['create', 'del', 'list', 'retrieve', 'update'], finalizeInvoice: stripeMethod({ method: 'POST', path: '{id}/finalize'...
'use strict'; const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ path: 'invoices', includeBasic: ['create', 'del', 'list', 'retrieve', 'update'], finalizeInvoice: stripeMethod({ method: 'POST', path: '{id}/finalize'...
Remove index on field that no longer exists [skip ci]
# Indices that need to be added manually: # # invoke shell --no-transaction from pymongo import ASCENDING, DESCENDING db['user'].create_index([ ('emails', ASCENDING), ]) db['user'].create_index([ ('emails', ASCENDING), ('username', ASCENDING), ]) db['node'].create_index([ ('is_deleted', ASCENDING),...
# Indices that need to be added manually: # # invoke shell --no-transaction from pymongo import ASCENDING, DESCENDING db['nodelog'].create_index([ ('__backrefs.logged.node.logs', ASCENDING), ]) db['user'].create_index([ ('emails', ASCENDING), ]) db['user'].create_index([ ('emails', ASCENDING), ('us...
Make turbinia-psq the default pubsub queue name
# Copyright 2016 Google Inc. # # 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,...
# Copyright 2016 Google Inc. # # 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,...
Jenkins: Test für den Email-Versand angepasst
package de.pentasys.SilverPen.util.test; import javax.mail.MessagingException; import org.junit.BeforeClass; import org.junit.Test; import de.pentasys.SilverPen.util.Email; public class EmailTest { private static String mailHost = "127.0.0.1"; private static Email email; @BeforeClass public sta...
package de.pentasys.SilverPen.util.test; import javax.mail.MessagingException; import org.junit.BeforeClass; import org.junit.Test; import de.pentasys.SilverPen.util.Email; public class EmailTest { private static String mailHost = "172.30.2.29"; private static Email email; @BeforeClass...
Load spritesheet middleware for atlas support
import settings from './settings'; import { SCALE_MODES } from './const'; import { is_webgl_supported } from './utils/index'; import { loader_use_procs } from 'engine/registry'; import WebGLRenderer from './renderers/WebGLRenderer'; import texture_parser from 'engine/textures/texture_parser'; import spritesheet_parser ...
import settings from './settings'; import { SCALE_MODES } from './const'; import { is_webgl_supported } from './utils/index'; import { loader_use_procs } from 'engine/registry'; import WebGLRenderer from './renderers/WebGLRenderer'; import texture_parser from 'engine/textures/texture_parser'; // Texture parser is mand...
Update Sami theme as default.
<?php use Sami\Sami; use Sami\Version\GitVersionCollection; use Symfony\Component\Finder\Finder; $iterator = Finder::create() ->files() ->name('*.php') ->exclude('Resources') ->in($dir = 'src'); $versions = GitVersionCollection::create($dir) ->add('develop', 'develop branch') ->add('master', ...
<?php use Sami\Sami; use Sami\Version\GitVersionCollection; use Symfony\Component\Finder\Finder; $iterator = Finder::create() ->files() ->name('*.php') ->exclude('Resources') ->in($dir = 'src'); $versions = GitVersionCollection::create($dir) ->add('develop', 'develop branch') ->add('master', ...
Fix PeriodicTask interval sleep calculation
from ..vtask import VTask import time from ..sparts import option from threading import Event class PeriodicTask(VTask): INTERVAL = None interval = option('interval', type=float, metavar='SECONDS', default=lambda cls: cls.INTERVAL, help='How often this task should ...
from ..vtask import VTask import time from ..sparts import option from threading import Event class PeriodicTask(VTask): INTERVAL = None interval = option('interval', type=float, metavar='SECONDS', default=lambda cls: cls.INTERVAL, help='How often this task should ...
Add a guard to better express the intention Also added a name to the handler to avoid anonymous function in stack traces.
import Em from 'ember'; import HrefTo from 'ember-href-to/href-to'; let hrefToClickHandler; function closestLink(el) { if (el.closest) { return el.closest('a'); } else { el = el.parentElement; while (el && el.tagName !== 'A') { el = el.parentElement; } return el; } } export default { ...
import Em from 'ember'; import HrefTo from 'ember-href-to/href-to'; let hrefToClickHandler; function closestLink(el) { if (el.closest) { return el.closest('a'); } else { el = el.parentElement; while (el && el.tagName !== 'A') { el = el.parentElement; } return el; } } export default { ...
Update Jest test setup to add mock document.createRance method and refactor global exposed methods
/* * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/li...
/* * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/li...
Add a login svc and url
/** * Created by kelvin on 3/12/2014. */ (function () { angular.module('fc.login').config([ '$stateProvider', '$urlRouterProvider', routeConfig ]).config([ "authSvcProvider", svcConfig ]); function routeConfig($stateProvider, $urlRouterProvider) { $urlR...
/** * Created by Caleb on 9/25/2014. */ (function () { angular.module('fc.login').config([ '$stateProvider', '$urlRouterProvider', routeConfig ]); function routeConfig($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/'); $stateProvider.state('l...
Set explicit caching when watching
var path = require('path'); var webpackConfig = require('../webpack.config.js'); var defaultResolve = webpackConfig.resolve; function noddyClone(obj) { return JSON.parse(JSON.stringify(obj)); } var buildResolve = noddyClone(defaultResolve); buildResolve.modules.push('src/'); var testConfig = { entry: './tests/r...
var path = require('path'); var webpackConfig = require('../webpack.config.js'); var defaultResolve = webpackConfig.resolve; function noddyClone(obj) { return JSON.parse(JSON.stringify(obj)); } var buildResolve = noddyClone(defaultResolve); buildResolve.modules.push('src/'); var testConfig = { entry: './tests/r...
Fix detecting class access of descriptor. Set name on attr, not env class!
import os class env(object): def __init__(self, default=None): self.name = None self.default = default def __get__(self, obj, cls=None): if not obj: return self return os.environ.get(self.name.upper(), self.default) class MetaConfig(type): '''Quickly tell the...
import os class env(object): def __init__(self, default=None): self.name = None self.default = default def __get__(self, obj, cls=None): if cls: return os.environ.get(self.name.upper(), self.default) class MetaConfig(type): '''Quickly tell the env attrs their names.'...
Upgrade ParameterEscaper. Fix some issues by translate.
<?php namespace Exercise\GoogleTranslateBundle; class ParametersEscaper { /** @var \ArrayObject */ protected $parametersArray; /** @var \ArrayIterator */ protected $iterator; public function escapeParameters($string) { $this->parametersArray = new \ArrayObject(); return preg...
<?php namespace Exercise\GoogleTranslateBundle; class ParametersEscaper { /** @var \ArrayObject */ protected $parametersArray; /** @var \ArrayIterator */ protected $iterator; public function escapeParameters($string) { $this->parametersArray = new \ArrayObject(); return preg...
Fix integration test for 'component:checkbox-for'
import Ember from 'ember'; import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('checkbox-for', 'Integration | Component | checkbox for', { integration: true }); test('it renders', function(assert) { this.render(hbs`{{checkbox-for}}`); assert....
import Ember from 'ember'; import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('checkbox-for', 'Integration | Component | checkbox for', { integration: true }); test('it renders', function(assert) { this.render(hbs`{{checkbox-for}}`); assert....
Fix module packaging thanks to landscape.io hint
# -*- encoding: utf-8 -*- # # In here you will find all the handlers that are tasked with handling the # requests specified in the API. # # From these handlers we will be instantiating models objects that will take care # of our business logic and the generation of the output to be sent to GLClient. # # In here we are ...
# -*- encoding: utf-8 -*- # # In here you will find all the handlers that are tasked with handling the # requests specified in the API. # # From these handlers we will be instantiating models objects that will take care # of our business logic and the generation of the output to be sent to GLClient. # # In here we are ...
Set only one view for all request which always return index.html
/** * Module dependencies */ var express = require('express'), http = require('http'), path = require('path'); var app = module.exports = express(); /** * Configuration */ // all environments app.set('port', process.env.PORT || 3000); app.locals({rootUrl: process.env.ROOTURL || '/'}); app.use(express.logger...
/** * Module dependencies */ var express = require('express'), http = require('http'), path = require('path'); var app = module.exports = express(); /** * Configuration */ // all environments app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); a...
Fix decimal limit of total to 2 Decimal limit is fixed to 2 as earlier at some values the decimal limit were crossing this limit
function update_price($this){ var id = $this.data('id'); // Calculate price for row var value = $this.val(); var price = $('#price_' + id).text(); $('#total_row_' + id).text((value * price).toFixed(2)); // Calculate total price var total = 0; $('.total_row').each(function( index ) { ...
function update_price($this){ var id = $this.data('id'); // Calculate price for row var value = $this.val(); var price = $('#price_' + id).text(); $('#total_row_' + id).text((value * price).toFixed(2)); // Calculate total price var total = 0; $('.total_row').each(function( index ) { ...
Change shebang to /usr/bin/env for better venv support
#!/usr/bin/env python3 """Setup.py for dirbrowser.""" from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encodin...
#!/usr/bin/python3 """Setup.py for dirbrowser.""" from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='u...
Support loading env file from custom file path
// Copyright 2014 GoIncremental Limited. 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 b...
// Copyright 2014 GoIncremental Limited. 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 b...
Revert use rememberToken() because not possible to chain the return value at the moment. Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class OrchestraAuthAddRememberTokenToUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $tab...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class OrchestraAuthAddRememberTokenToUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $tab...
Fix reticle render order and depthTest
(function(){ /** * Reticle 3D Sprite * @param {THREE.Color} [color=0xfffff] - Color of the reticle sprite * @param {string} [url=PANOLENS.DataImage.Reticle] - Image asset url */ PANOLENS.Reticle = function ( color, url ) { var map, material; color = color || 0xffffff; url = url || PANOLENS.DataImage...
(function(){ /** * Reticle 3D Sprite * @param {THREE.Color} [color=0xfffff] - Color of the reticle sprite * @param {string} [url=PANOLENS.DataImage.Reticle] - Image asset url */ PANOLENS.Reticle = function ( color, url ) { var map, material; color = color || 0xffffff; url = url || PANOLENS.DataImage...
Add Mac OS X stub for rdpLaunchNative.
// The MIT License (MIT) // // Copyright (c) 2015 Douglas Thrift // // 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, ...
// The MIT License (MIT) // // Copyright (c) 2015 Douglas Thrift // // 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, ...
Fix issue - load README.md, not .rst
from codecs import open as codecs_open from setuptools import setup, find_packages # Get the long description from the relevant file with codecs_open('README.md', encoding='utf-8') as f: long_description = f.read() setup(name='borica', version='0.0.1', description=u"Python integration for Borica", ...
from codecs import open as codecs_open from setuptools import setup, find_packages # Get the long description from the relevant file with codecs_open('README.rst', encoding='utf-8') as f: long_description = f.read() setup(name='borica', version='0.0.1', description=u"Python integration for Borica", ...
Correct comment about codepoints in Dashycode unit tests
'use strict'; const assert = require('assert'); const Dashycode = require('./../../.lib-dist/dashycode'); describe('Dashycode', function () { // Technically we should be testing for values up to 0x10FFFF, but since // node.js uses UTF-16, codepoints higher than 0xFFFF would be represented // as surrogate pairs, ma...
'use strict'; const assert = require('assert'); const Dashycode = require('./../../.lib-dist/dashycode'); describe('Dashycode', function () { // Technically we should be testing for values up to 0x10FFFF, but we will // never see any above 0xFFFF because of how SockJS works. const codepoints = Array.from({length: ...
Add auto-reading from Hacker News Every hour, read the best ~20 posts from the past 24 hours from Hacker News.
//var queue = new PowerQueue(); var hn = Meteor.require('hacker-news-api'); var readHn = function () { "use strict"; console.log('Reading last 24 hours of Hacker News'); var now = Date.now() / 1000; var query = 'search?tags=story&numericFilters=created_at_i>' + (now - 86400) + ',created_at_i<' + now; h...
//var queue = new PowerQueue(); var hn = Meteor.require('hacker-news-api'); Meteor.methods({ "readHn": function () { "use strict"; hn.getStories(Meteor.bindEnvironment( function (error, data) { if (error) { throw error; } _(data.hits).forEach(function (item) { ...
Update to use env port
var webpack = require('webpack'); var webpackDevMiddleware = require('webpack-dev-middleware'); var webpackHotMiddleware = require('webpack-hot-middleware'); var app = require('express')(); var server = require('http').Server(app); var io = require('socket.io')(server); var config = require('./webpack.config'); var po...
var webpack = require('webpack'); var webpackDevMiddleware = require('webpack-dev-middleware'); var webpackHotMiddleware = require('webpack-hot-middleware'); var app = require('express')(); var server = require('http').Server(app); var io = require('socket.io')(server); var config = require('./webpack.config'); var po...
Set error message at the bottom, if input field is filled.
/** * Created by elisahilprecht on 09/04/15. */ (function(){ var clickOnErrorMessage = function(e) { e.toElement.setAttribute('class','help-inline display-none'); document.getElementById(e.toElement.id.replace('ErrorText','')).focus(); }; var clickOnInputField = function(e){ document.getElementById...
/** * Created by elisahilprecht on 09/04/15. */ (function(){ var clickOnErrorMessage = function(e) { e.toElement.setAttribute('class','help-inline display-none'); document.getElementById(e.toElement.id.replace('ErrorText','')).focus(); }; var clickOnInputField = function(e){ document.getElementById...
Use new dev server instead of staging, because we don't know the staging version number any more.
'use strict'; define(["angular", "app/services/LoginChecker", "app/services/FileLoader", "app/services/FigureUploader", "app/services/SnippetLoader", "app/services/TagLoader", "app/services/IdLoader"], function() { /* Services */ angular.module('scooter.services', []) .constant('Repo', { owner: "ucam-cl-dtg", ...
'use strict'; define(["angular", "app/services/LoginChecker", "app/services/FileLoader", "app/services/FigureUploader", "app/services/SnippetLoader", "app/services/TagLoader", "app/services/IdLoader"], function() { /* Services */ angular.module('scooter.services', []) .constant('Repo', { owner: "ucam-cl-dtg", ...
Generalize adding a data source Instead of using data source specific methods for DataManager, use just one: add_datasource(). The type of data source is defined by the keyword argument 'type'.
import logging from collections import OrderedDict from egpackager.datasources import GspreadDataSource class DataManager(object): def __init__(self, debug=False): # Set up logging if debug: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=...
import logging from collections import OrderedDict from egpackager.datasources import GspreadDataSource class DataManager(object): def __init__(self, debug=False): # Set up logging if debug: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=...
Add comment on header component
import React from 'react'; import styled from 'styled-components'; import {Link} from 'react-router'; import Wrapper from './Wrapper'; import Navigation from './Navigation'; // Main Header Component Styles const MainHeader = styled.header` padding: 1em 0; border-bottom: 1px solid #C5C5C5; overflow: auto; zoom:...
import React from 'react'; import styled from 'styled-components'; import {Link} from 'react-router'; import Wrapper from './Wrapper'; import Navigation from './Navigation'; // Main Header Component Styles const MainHeader = styled.header` padding: 1em 0; border-bottom: 1px solid #C5C5C5; overflow: auto; zoom:...
Raise DRF ValidationError to get APIException base
from django.core.exceptions import ValidationError as DjangoValidationError from rest_framework import serializers from apps.approval.models import CommitteeApplication, CommitteePriority class CommitteeSerializer(serializers.ModelSerializer): group_name = serializers.SerializerMethodField(source='group') c...
from rest_framework import serializers from apps.approval.models import CommitteeApplication, CommitteePriority class CommitteeSerializer(serializers.ModelSerializer): group_name = serializers.SerializerMethodField(source='group') class Meta(object): model = CommitteePriority fields = ('grou...
Add name to the required inputs
/* * Licensed to Cloudkick, Inc ('Cloudkick') under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * Cloudkick licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not us...
/* * Licensed to Cloudkick, Inc ('Cloudkick') under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * Cloudkick licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not us...
Put door monitoring in a function, use channels.
package main import ( "fmt" "github.com/stianeikeland/go-rpio" "net/http" ) type DoorStatus int const ( OPEN DoorStatus = iota CLOSED ) type StatusRequest struct { resultChan chan DoorStatus } func main() { statusChan := make(chan *StatusRequest) go doorMonitor(statusChan) http.Handle("/", &StatusPage{st...
package main import ( "fmt" "github.com/stianeikeland/go-rpio" "net/http" "os" ) var ( pin = rpio.Pin(23) ) func main() { // Open and map memory to access gpio, check for errors if err := rpio.Open(); err != nil { fmt.Println(err) os.Exit(1) } // Pull up pin pin.PullUp() // Unmap gpio memory when do...
Fix escapeTag for non-string values
// https://docs.influxdata.com/influxdb/v1.5/write_protocols/line_protocol_tutorial/#special-characters-and-keywords export function stringifyPoints(points) { return points.map(_stringifyPoint).join("\n"); } export function _stringifyPoint({ measurement, values, tags, timestamp }) { const tagsString = Object.entr...
// https://docs.influxdata.com/influxdb/v1.5/write_protocols/line_protocol_tutorial/#special-characters-and-keywords export function stringifyPoints(points) { return points.map(_stringifyPoint).join("\n"); } export function _stringifyPoint({ measurement, values, tags, timestamp }) { const tagsString = Object.entr...
Fix Account import in management command
from django.core.management.base import BaseCommand, CommandError from backend.models.account import Account from backend.tasks import get_all_contributions class Command(BaseCommand): help = 'Closes the specified poll for voting' def add_arguments(self, parser): parser.add_argument('--username', des...
from django.core.management.base import BaseCommand, CommandError from backend.models import Account from backend.tasks import get_all_contributions class Command(BaseCommand): help = 'Closes the specified poll for voting' def add_arguments(self, parser): parser.add_argument('--username', dest='usern...
Update payload to match new parser for file relationship
import OsfSerializer from 'ember-osf/serializers/osf-serializer'; export default OsfSerializer.extend({ serialize(snapshot) { // Normal OSF serializer strips out relationships. We need to add back primaryFile for this endpoint let res = this._super(...arguments); res.data.relationships = { ...
import OsfSerializer from 'ember-osf/serializers/osf-serializer'; export default OsfSerializer.extend({ serialize(snapshot) { // Normal OSF serializer strips out relationships. We need to add back primaryFile for this endpoint let res = this._super(...arguments); res.data.relationships = { ...
Comment out unused buildHeader code in taskItemView
jsio('from shared.javascript import Class') jsio('import fan.ui.Button') jsio('import fan.ui.RadioButtons') jsio('import fan.tasks.views.View') exports = Class(fan.tasks.views.View, function(supr) { this._className += ' TaskItemView' this._minWidth = 390 this._maxWidth = 740 this._headerHeight = 0 this.init =...
jsio('from shared.javascript import Class') jsio('import fan.ui.Button') jsio('import fan.ui.RadioButtons') jsio('import fan.tasks.views.View') exports = Class(fan.tasks.views.View, function(supr) { this._className += ' TaskItemView' this._minWidth = 390 this._maxWidth = 740 this._headerHeight = 0 this.init =...
Embed Reference interface in NetworkReference
/* Copyright (c) 2014 VMware, 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 (c) 2014 VMware, 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...
Use approrpiate transform implementation in canvas backend.
/** * Copyright 2010 The PlayN Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
/** * Copyright 2010 The PlayN Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
Fix issue where ENABLED is not defined
import re from django_seo_js import settings from django_seo_js.backends import SelectedBackend from django_seo_js.helpers import request_should_be_ignored import logging logger = logging.getLogger(__name__) class UserAgentMiddleware(SelectedBackend): def __init__(self, *args, **kwargs): super(UserAgentM...
import re from django_seo_js import settings from django_seo_js.backends import SelectedBackend from django_seo_js.helpers import request_should_be_ignored import logging logger = logging.getLogger(__name__) class UserAgentMiddleware(SelectedBackend): def __init__(self, *args, **kwargs): super(UserAgentM...
Change comments to reflect changes in PSR
<?php declare(strict_types=1); namespace Onion\Framework\Http\Middleware; use Interop\Http\Middleware\DelegateInterface; use Interop\Http\Middleware\ServerMiddlewareInterface; use Psr\Http\Message; final class Delegate implements DelegateInterface { /** * @var ServerMiddlewareInterface */ protected ...
<?php declare(strict_types=1); namespace Onion\Framework\Http\Middleware; use Interop\Http\Middleware\DelegateInterface; use Interop\Http\Middleware\ServerMiddlewareInterface; use Psr\Http\Message; final class Delegate implements DelegateInterface { /** * @var MiddlewareInterface|ServerMiddlewareInterface ...
Fix event delegation on mouseover events
function recipeSearch(input) { $.ajax({ url: "/recipes", data: input, }).done(function(recipeItemPartial) { $(recipeItemPartial).appendTo(".main-searchbar"); }); } var throttledSearch = _.throttle(recipeSearch, 300); $( document ).ready(function() { $(".form-control").keyup(function(event){ ...
function recipeSearch(input) { $.ajax({ url: "/recipes", data: input, }).done(function(recipeItemPartial) { $(recipeItemPartial).appendTo(".main-searchbar"); }); } var throttledSearch = _.throttle(recipeSearch, 300); $( document ).ready(function() { $(".form-control").keyup(function(event){ ...
Switch debug mode from configuration
package com.bukkit.plugin.java.Component; import java.util.logging.Logger; import org.bukkit.plugin.Plugin; /** * Provide multi type log function * @author Decker * */ public class PluginLogger { Plugin ProvidePlugin; Logger PluginLogger; Boolean IsDebug; private PluginLogger(Plu...
package com.bukkit.plugin.java.Component; import java.util.logging.Logger; import org.bukkit.plugin.Plugin; /** * Provide multi type log function * @author Decker * */ public class PluginLogger { Plugin ProvidePlugin; Logger PluginLogger; private PluginLogger(Plugin plugin) { t...
Use tornado settings, webapp deprecated
# Configuration file for ipython-notebook. c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 # Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded- # For headerssent by the upstream reverse proxy. Necessary if the proxy handles # SSL c.Notebo...
# Configuration file for ipython-notebook. c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 # Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded- # For headerssent by the upstream reverse proxy. Necessary if the proxy handles # SSL c.Notebo...
vtgate/buffer: Add matching for errno 1290 if no error message is present. The error message can be omitted if -queryserver-config-terse-errors is enabled.
package buffer import ( "strings" log "github.com/golang/glog" "github.com/youtube/vitess/go/vt/vterrors" vtrpcpb "github.com/youtube/vitess/go/vt/proto/vtrpc" ) // This function is in a separate file to make it easier to swap out an // open-source implementation with any internal Google-only implementation. ...
package buffer import ( "strings" log "github.com/golang/glog" "github.com/youtube/vitess/go/vt/vterrors" vtrpcpb "github.com/youtube/vitess/go/vt/proto/vtrpc" ) // This function is in a separate file to make it easier to swap out an // open-source implementation with any internal Google-only implementation. ...
[tools] Format codepoints according to the Namelist spec.
#!/usr/bin/env python # Copyright 2015, Google Inc. # Author: Dave Crossland (dave@understandinglimited.com) # # 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....
#!/usr/bin/env python # Copyright 2015, Google Inc. # Author: Dave Crossland (dave@understandinglimited.com) # # 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....
Change xfail to skipIf. The exact condition is really difficult to get right and doesn't add much signal. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@340574 91177308-0d34-0410-b5e6-96231b3b80d8
# coding=utf8 import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.decorators import * class TestUnicodeSymbols(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIf(compiler="clang", compiler_version=['<', '7.0']) def test_union_members(...
# coding=utf8 import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.decorators import * class TestUnicodeSymbols(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureAll(compiler="clang", compiler_version=['<', '7.0']) def test_un...
Fix display of full user name at least on current user's settings page
""" byceps.services.user.transfer.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from __future__ import annotations from dataclasses import dataclass from datetime import date from typing import Any, Optional from .......
""" byceps.services.user.transfer.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from __future__ import annotations from dataclasses import dataclass from datetime import date from typing import Any, Optional from .......
Add babel polyfills as a direct dependency
/** * Main application file of Fittable * - Requires React.js to be loaded before loading this * * @author Marián Hlaváč */ // https://babeljs.io/docs/usage/polyfill/ require('babel/polyfill'); import React from 'react'; import Fittable from './components/Fittable.component'; import Counterpart from 'counterp...
/** * Main application file of Fittable * - Requires React.js to be loaded before loading this * * @author Marián Hlaváč */ import React from 'react'; import Fittable from './components/Fittable.component'; import Counterpart from 'counterpart'; import Moment from 'moment'; import Momentcslocale from 'moment/l...
Include timestamp in audit logs
import cherrypy import datetime import logging from girder import auditLogger from girder.models.model_base import Model from girder.api.rest import getCurrentUser class Record(Model): def initialize(self): self.name = 'audit_log_record' def validate(self, doc): return doc class AuditLogHan...
import cherrypy import logging from girder import auditLogger from girder.models.model_base import Model from girder.api.rest import getCurrentUser class Record(Model): def initialize(self): self.name = 'audit_log_record' def validate(self, doc): return doc class AuditLogHandler(logging.Han...
Make test cover header/footer too.
/** * Copyright 2008 Matthew Hillsdon * * 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 agre...
/** * Copyright 2008 Matthew Hillsdon * * 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 agre...
Use Boolean type in conditional
/* * Believe it or not, you can declare and use functions in EJS templates too. */ var ejs = require('../') , read = require('fs').readFileSync , join = require('path').join , path = join(__dirname, '/functions.ejs') , data = { users: [ { name: 'Tobi', age: 2, species: 'ferret' } , { name...
/* * Believe it or not, you can declare and use functions in EJS templates too. */ var ejs = require('../') , read = require('fs').readFileSync , join = require('path').join , path = join(__dirname, '/functions.ejs') , data = { users: [ { name: 'Tobi', age: 2, species: 'ferret' } , { name...
Set angular as default in blueprint
// jshint node:true // For details on each option run `ember help release` module.exports = { // ember style guide: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#commit-tagging // angular style guide: https://github.com/angular/angular.js/blob/v1.4.8/CONTRIBUTING.md#commit // jquery style guid...
// jshint node:true // For details on each option run `ember help release` module.exports = { // ember style guide: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#commit-tagging // angular style guide: https://github.com/angular/angular.js/blob/v1.4.8/CONTRIBUTING.md#commit // jquery style guid...
Remove connected prooperty from client
/** * 24.05.2017 * TCP Chat using NodeJS * https://github.com/PatrikValkovic/TCPChat * Created by patri */ 'use strict' let counter = 0 /** * Represent connected client * @type {Client} */ module.exports = class Client { constructor(socket) { this.socket = socket this.name = 'anonymous' ...
/** * 24.05.2017 * TCP Chat using NodeJS * https://github.com/PatrikValkovic/TCPChat * Created by patri */ 'use strict' let counter = 0 /** * Represent connected client * @type {Client} */ module.exports = class Client { constructor(socket) { this.socket = socket this.name = 'anonymous' ...
[TwitchIO] Use f-string for define command
from twitchio.ext import commands @commands.cog() class Words: def __init__(self, bot): self.bot = bot @commands.command() async def audiodefine(self, ctx, word): url = f"http://api.wordnik.com:80/v4/word.json/{word}/audio" params = {"useCanonical": "false", "limit": 1, "api_key": self.bot.WORDNIK_API_KE...
from twitchio.ext import commands @commands.cog() class Words: def __init__(self, bot): self.bot = bot @commands.command() async def audiodefine(self, ctx, word): url = f"http://api.wordnik.com:80/v4/word.json/{word}/audio" params = {"useCanonical": "false", "limit": 1, "api_key": self.bot.WORDNIK_API_KE...
Fix test for Laravel 7
<?php namespace Code16\Sharp\Tests\Feature; use Code16\Sharp\Tests\Feature\Api\BaseApiTest; class AssetViewComposerTest extends BaseApiTest { /** @test */ public function we_can_define_assets_to_render_in_views() { $this->withoutExceptionHandling(); $this->buildTheWorld(); $this-...
<?php namespace Code16\Sharp\Tests\Feature; use Code16\Sharp\Tests\Feature\Api\BaseApiTest; class AssetViewComposerTest extends BaseApiTest { /** @test */ public function we_can_define_assets_to_render_in_views() { $this->withoutExceptionHandling(); $this->buildTheWorld(); $this-...
DBServer: Change BDB test to match naming scheme
#!/usr/bin/env python2 import unittest from socket import * from common import * from testdc import * from test_dbserver import DatabaseBaseTests CONFIG = """\ messagedirector: bind: 127.0.0.1:57123 general: dc_files: - %r roles: - type: database control: 777 generate: min: ...
#!/usr/bin/env python2 import unittest from socket import * from common import * from testdc import * from test_dbserver import DatabaseBaseTests CONFIG = """\ messagedirector: bind: 127.0.0.1:57123 general: dc_files: - %r roles: - type: database control: 777 generate: min: ...
Fix call to super for py2.7
from django.views.debug import SafeExceptionReporterFilter from raven.contrib.django.client import DjangoClient class SensitiveDjangoClient(DjangoClient): """ Hide sensitive request data from being logged by Sentry. Borrowed from http://stackoverflow.com/a/23966581/240995 """ def get_data_from_re...
from django.views.debug import SafeExceptionReporterFilter from raven.contrib.django.client import DjangoClient class SensitiveDjangoClient(DjangoClient): """ Hide sensitive request data from being logged by Sentry. Borrowed from http://stackoverflow.com/a/23966581/240995 """ def get_data_from_re...
Make Transfer Consistent w/ Views
import * as http_data from "./http-data"; import * as urlModule from "url"; function transfer(request) { // url - the resource URI to send a message to // options.method - the method to use for transferring // options.form - the Form API object representing the form data submission // ...
import * as http_data from "./http-data"; import * as urlModule from "url"; const transferrers = {}; function transfer(request) { // url - the resource URI to send a message to // options.method - the method to use for transferring // options.form - the Form API object representing the form data submission...
Add log of total counts
console.log('hello') const css = require('../style/app.scss'); import _ from 'lodash'; import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { constructor(props) { super(props); this.state = { input: '', cardinality: 0, counts: {} }; } cou...
console.log('hello') const css = require('../style/app.scss'); import _ from 'lodash'; import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { constructor(props) { super(props); this.state = { input: '', cardinality: 0 }; } cardinality(str) { ...
Replace apostrophe to proper HTML char
<h2>#Laravel IRC Chat</h2> @if(Auth::check() or Session::has('userLazilyOptsOutOfAuthOnChat')) <iframe src="https://kiwiirc.com/client/irc.freenode.net/?&nick={{ Auth::check() ? Auth::user()->name : 'laravelnewbie'}}#laravel" style="border:0; width:100%; height:450px;"></iframe> <a href="http://irclogs.laravel.io" t...
<h2>#Laravel IRC Chat</h2> @if(Auth::check() or Session::has('userLazilyOptsOutOfAuthOnChat')) <iframe src="https://kiwiirc.com/client/irc.freenode.net/?&nick={{ Auth::check() ? Auth::user()->name : 'laravelnewbie'}}#laravel" style="border:0; width:100%; height:450px;"></iframe> <a href="http://irclogs.laravel.io" t...
Add error log on bundling error
module.exports = function(config) { 'use strict'; config.set({ browsers: ['Chrome'], reporters: ['progress', 'notify'], frameworks: ['browserify' ,'mocha', 'chai-sinon', 'sinon'], // list of files / patterns to load in the browser files: ['tests-index.js'], pr...
module.exports = function(config) { 'use strict'; config.set({ browsers: ['Chrome'], reporters: ['progress', 'notify'], frameworks: ['browserify' ,'mocha', 'chai-sinon', 'sinon'], // list of files / patterns to load in the browser files: ['tests-index.js'], pr...
Return value is an array
<?php namespace phtamas\yii2\imagecontroller; use yii\web\CompositeUrlRule; class UrlRule extends CompositeUrlRule { /** * @var string */ public $controllerId; public $prefix; protected function createRules() { $rules = []; $controller = \Yii::$app->createController($th...
<?php namespace phtamas\yii2\imagecontroller; use yii\web\CompositeUrlRule; class UrlRule extends CompositeUrlRule { /** * @var string */ public $controllerId; public $prefix; protected function createRules() { $rules = []; $controller = \Yii::$app->createController($th...
Make 'UserRegistrationRequest' order by 'created_at'
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\UserRegistrationRequest; class UserRegistrationRequestController extends Controller { public function __construct() { $this->middleware('auth:api'); $this->middleware('admin'); } public function index(Request $request) { ...
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\UserRegistrationRequest; class UserRegistrationRequestController extends Controller { public function __construct() { $this->middleware('auth:api'); $this->middleware('admin'); } public function index(Request $request) { ...
Fix error in node v0.10 missing Promises.
'use strict'; var Promise = require('bluebird'), extractCss = require('extract-css'), inlineCss = require('./inline-css'); module.exports = function inlineContent(src, options) { return new Promise(function (resolve, reject) { var content; if (!options.url) { reject('options.u...
'use strict'; var extractCss = require('extract-css'), inlineCss = require('./inline-css'); module.exports = function inlineContent(src, options) { return new Promise(function (resolve, reject) { var content; if (!options.url) { reject('options.url is required'); } ...
Add ratio as a config option
import React from 'react'; import Chartist from 'chartist'; export default class Chart extends React.Component { componentDidMount() { this.updateChart(this.props); } componentWillReceiveProps(newProps) { this.updateChart(newProps); } componentWillUnmount() { this.chartist && this.chartist.deta...
import React from 'react'; import Chartist from 'chartist'; export default class Chart extends React.Component { componentDidMount() { this.updateChart(this.props); } componentWillReceiveProps(newProps) { this.updateChart(newProps); } componentWillUnmount() { this.chartist && this.chartist.deta...
Add a comment for robin
import re from htmlentitydefs import name2codepoint # From http://wiki.python.org/moin/EscapingHtml _HTMLENT_CODEPOINT_RE = re.compile('&({0}|#\d+);'.format( '|'.join(name2codepoint.keys()))) def recodeText(text): """Parses things like &amp; and &#8020; into real characters.""" def _entToUnichr(mat...
import re from htmlentitydefs import name2codepoint # From http://wiki.python.org/moin/EscapingHtml _HTMLENT_CODEPOINT_RE = re.compile('&({0}|#\d+);'.format( '|'.join(name2codepoint.keys()))) def recodeText(text): def _entToUnichr(match): ent = match.group(1) try: if ent.sta...
Store binding as local variable
package com.chaos.databinding.activities; import android.databinding.DataBindingUtil; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.chaos.databinding.R; import com.chaos.databinding.models.User; import com.chaos.databinding.databinding.ActivityMainBinding; public class MainAct...
package com.chaos.databinding.activities; import android.databinding.DataBindingUtil; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.chaos.databinding.R; import com.chaos.databinding.models.User; import com.chaos.databinding.databinding.ActivityMainBinding; public class MainAct...
Add missing dependency on darwin
// +build !linux /* Copyright 2017 Gravitational, Inc. 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...
// +build !linux /* Copyright 2017 Gravitational, Inc. 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...
Add coverage the Hello World client example. This is now free-standing and also covers edge cases like timestamps. b/124437335 Change-Id: I9496504b638ae6af3885a20aeedf18e267aca683 GitOrigin-RevId: b7c8694f2f920371ee228bb53a6e499e3b727783
package com.cloudrobotics.hello_world_client; import cloudrobotics.hello_world.v1alpha1.K8sHelloWorldGrpc; import cloudrobotics.hello_world.v1alpha1.Service; import io.grpc.ManagedChannelBuilder; import java.util.logging.Logger; /** */ final class Main { private static final Logger logger = Logger.getLogger(Main.c...
package com.cloudrobotics.hello_world_client; import cloudrobotics.hello_world.v1alpha1.K8sHelloWorldGrpc; import cloudrobotics.hello_world.v1alpha1.Service; import io.grpc.ManagedChannelBuilder; import java.util.logging.Logger; /** */ final class Main { private static final Logger logger = Logger.getLogger(Main.c...
Fix ValidatedTextFieldListCell to use the actual edited text
package org.hildan.fx.components; import java.util.function.Predicate; import javafx.scene.control.*; import javafx.scene.control.cell.TextFieldListCell; import javafx.util.StringConverter; import org.hildan.fxlog.themes.Css; public class ValidatingTextFieldListCell<T> extends TextFieldListCell<T> { private fi...
package org.hildan.fx.components; import java.util.function.Predicate; import javafx.scene.control.cell.TextFieldListCell; import javafx.util.StringConverter; import org.hildan.fxlog.themes.Css; public class ValidatingTextFieldListCell<T> extends TextFieldListCell<T> { private final Predicate<String> validator...
Use ActiveRecord from root namespace for param typehint
<?php namespace Emergence\CMS; use ActiveRecord; class Page extends AbstractContent { // ActiveRecord configuration public static $defaultClass = __CLASS__; public static $singularNoun = 'page'; public static $pluralNoun = 'pages'; public static $collectionRoute = '/pages'; public static $f...
<?php namespace Emergence\CMS; class Page extends AbstractContent { // ActiveRecord configuration public static $defaultClass = __CLASS__; public static $singularNoun = 'page'; public static $pluralNoun = 'pages'; public static $collectionRoute = '/pages'; public static $fields = array( ...
Remove the beacon for now
from .game_manager import GameManager from .robot_controller import RobotController from .snake_board import SnakeBoard from .snake_robot import SnakeRobot from .snake_beacon import SnakeBeacon def launch_robot(robot_module, myrobot, board_size=(8,16)): ''' Creates a robot controller, a board, and sets th...
from .game_manager import GameManager from .robot_controller import RobotController from .snake_board import SnakeBoard from .snake_robot import SnakeRobot from .snake_beacon import SnakeBeacon def launch_robot(robot_module, myrobot, board_size=(8,16)): ''' Creates a robot controller, a board, and sets th...
Fix path to where views are published. Larval will automatically pick up overwrites from `resources/views/vendor/<package-name>/` (where `<package-name>` is set as the second parameter of `$this->loadViewsFrom()`). Signed-off-by: Micheal Mand <4a52646cf58d42dd1882775751ea450b8cf7f96f@kmdwebdesigns.com>
<?php namespace Gaaarfild\LaravelNotifications; use Illuminate\Support\ServiceProvider; class LaravelNotificationsServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { $this->publishes([ __D...
<?php namespace Gaaarfild\LaravelNotifications; use Illuminate\Support\ServiceProvider; class LaravelNotificationsServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { $this->publishes([ __D...
webhook: Fix "logging before flag.Parse" errors Fixes #932 Signed-off-by: Benjamin Staffin <7ff02effd2e7aa57491d2da194ef1ab398b1a4cf@gmail.com>
/* Copyright 2018 The Jetstack cert-manager contributors. 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 The Jetstack cert-manager contributors. 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...
Fix deprecation notice in PHP 8 for libxml_disable_entity_loader PHP 8 [deprecates `libxml_disable_entity_loader`](https://php.watch/versions/8.0/libxml_disable_entity_loader-deprecation) function, and this fixes the deprecation notice by not calling the function on libxml 2.9, where external entity loader is disabled...
<?php namespace DiDom; class Errors { /** * @var bool */ protected static $internalErrors; /** * @var bool */ protected static $disableEntities; /** * Disable error reporting. */ public static function disable() { self::$internalErrors = libxml_use_i...
<?php namespace DiDom; class Errors { /** * @var bool */ protected static $internalErrors; /** * @var bool */ protected static $disableEntities; /** * Disable error reporting. */ public static function disable() { self::$internalErrors = libxml_use_i...
Update pinback URL and reporter message
const Report = require('./Report'); const Notification = require('./Notification'); async function Reporter( request, reply ) { // Params https://sites.google.com/a/webpagetest.org/docs/advanced-features/webpagetest-restful-apis const base = process.env.BASE || 'http://localhost:8080'; const pinback = `${base}/v...
const Report = require('./Report'); const Notification = require('./Notification'); async function Reporter( request, reply ) { // Params https://sites.google.com/a/webpagetest.org/docs/advanced-features/webpagetest-restful-apis const base = process.env.BASE || 'http://localhost:8080'; const result = await new R...
Add unique constraints to Enum definitions
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import from enum import Enum, unique @unique class Context(Enum): DUP_DATABASE = 1 CONVERT_CONFIG = 5 INDEX_LIST = 10 ADD_PRIMARY_KEY_NAME = 15 TYPE_INFERENCE = 19 TYPE_...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import from enum import Enum class Context(Enum): DUP_DATABASE = 1 CONVERT_CONFIG = 5 INDEX_LIST = 10 ADD_PRIMARY_KEY_NAME = 15 TYPE_INFERENCE = 19 TYPE_HINT_HEADER = 20...
Fix return error correctly in NewSharedStateSink
package core import ( "fmt" ) // writer points a shared state. sharedStateSink will point to the same shared state // even after the state is removed from the context. type sharedStateSink struct { writer Writer } // NewSharedStateSink creates a sink that writes to SharedState. func NewSharedStateSink(ctx *Context...
package core import ( "fmt" ) // writer points a shared state. sharedStateSink will point to the same shared state // even after the state is removed from the context. type sharedStateSink struct { writer Writer } // NewSharedStateSink creates a sink that writes to SharedState. func NewSharedStateSink(ctx *Context...
Add a few more cases of "not value"
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest import pep8 class UtilTestCase(unittest.TestCase): def test_normalize_paths(self): cwd = os.getcwd() self.assertEquals(pep8.normalize_paths(''), []) self.assertEquals(pep8.normalize_paths([]), []) self.assert...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest import pep8 class UtilTestCase(unittest.TestCase): def test_normalize_paths(self): cwd = os.getcwd() self.assertEquals(pep8.normalize_paths(''), []) self.assertEquals(pep8.normalize_paths(['foo']), ['foo']) s...
Create test-results folder, to make Jenkins happy
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import print_function import gen_csharp import gen_docs_json import gen_java import gen_python import gen_thrift import bindings import sys, os sys.path.insert(0, "../../scripts") import run # Create results folder, where H2OCloud stores its logs, and .....
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import print_function import gen_csharp import gen_docs_json import gen_java import gen_python import gen_thrift import bindings import sys, os sys.path.insert(0, "../../scripts") import run # Create results/ folder, where H2OCloud stores its logs if not...
Change subject and content of registration email.
from celery import task from django.core.mail import EmailMessage from webparticipation.apps.ureporter.models import delete_user_from_rapidpro as delete_from @task() def send_verification_token(ureporter): if ureporter.token: subject = 'U-Report Registration' body = 'Thank you for registering with...
from celery import task from django.core.mail import EmailMessage from webparticipation.apps.ureporter.models import delete_user_from_rapidpro as delete_from @task() def send_verification_token(ureporter): if ureporter.token: subject = 'Hello' body = 'Welcome to ureport. To complete the registrati...
Add email to demonstrate spam capabilities ... lol
<?php // Check for empty fields if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $name = $_POST['name']; $email_address = $_POST['e...
<?php // Check for empty fields if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $name = $_POST['name']; $email_address = $_POST['e...
Add the ability to send logs to syslog
package main import ( "flag" "fmt" log "github.com/Sirupsen/logrus" logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" "github.com/bobtfish/AWSnycast/daemon" "log/syslog" "os" ) var ( debug = flag.Bool("debug", false, "Enable debugging") f = flag.String("f", "/etc/awsnycast.yaml", "Con...
package main import ( "flag" "fmt" log "github.com/Sirupsen/logrus" "github.com/bobtfish/AWSnycast/daemon" "os" ) var ( debug = flag.Bool("debug", false, "Enable debugging") f = flag.String("f", "/etc/awsnycast.yaml", "Configration file") oneshot = flag.Bool("oneshot", false, "Run route...
Fix Metadata serialization (serialize null values)
/* * Copyright 2013-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
/* * Copyright 2013-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
Update output parameters for Click to Call
<?php /** * Click to Call * * @url https://platform.x-onweb.com/#clicktocall */ require __DIR__ . '/../vendor/autoload.php'; /** * Your API Token */ $token = 'ExampleTokenHere'; /** * Required Parameters * - destination * - target */ $destinationPhoneNumber = '0333 332 0000'; $target = 'U0050'; $guzzle ...
<?php /** * Click to Call * * @url https://platform.x-onweb.com/#clicktocall */ require __DIR__ . '/../vendor/autoload.php'; /** * Your API Token */ $token = 'ExampleTokenHere'; /** * Required Parameters * - destination * - target */ $destinationPhoneNumber = '0333 332 0000'; $target = 'U0050'; $guzzle ...
Add TcpSocketReceiverTest into Test Suite
package com.dianping.cat; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; import com.dianping.cat.message.spi.core.HtmlMessageCodecTest; import com.dianping.cat.message.spi.core.TcpSocketReceiverTest; import com.dianping.cat.message.spi.core.Waterf...
package com.dianping.cat; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; import com.dianping.cat.message.spi.core.HtmlMessageCodecTest; import com.dianping.cat.message.spi.core.WaterfallMessageCodecTest; import com.dianping.cat.storage.dump.LocalM...
Add Windows 6.3 (8.1) to the list of known versions. Change-Id: I4989605776cf6dbbc8a8852d88f0fc6262f08f0b Reviewed-by: Jake Petroules <2d627e1cecd5435752fa500bacbe05f7cc90c369@petroules.com> Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@digia.com>
function characterSetDefines(charset) { var defines = []; if (charset === "unicode") defines.push("UNICODE", "_UNICODE"); else if (charset === "mbcs") defines.push("_MBCS"); return defines; } function isValidWindowsVersion(systemVersion) { // Add new Windows versions to this list wh...
function characterSetDefines(charset) { var defines = []; if (charset === "unicode") defines.push("UNICODE", "_UNICODE"); else if (charset === "mbcs") defines.push("_MBCS"); return defines; } function isValidWindowsVersion(systemVersion) { // Add new Windows versions to this list wh...
Add radii mean and standard deviation
from __future__ import division import numpy as np import FreeCAD as FC import Part import Draft import os doc = FC.newDocument("ellipses") folder = os.path.dirname(__file__) #+ "/.." fname = folder + "/vor_ellipses.txt" data = np.loadtxt(fname) shapes = [] area = 0 radii = [] for ellipse in data: cx, cy, b, a, a...
from __future__ import division import numpy as np import FreeCAD as FC import Part import Draft import os doc = FC.newDocument("ellipses") folder = os.path.dirname(__file__) + ".\.." fname = folder + "/vor_ellipses.txt" data = np.loadtxt(fname) shapes = [] area = 0 for ellipse in data: cx, cy, b, a, ang = ellips...
FIX sparse OneClassSVM was using the wrong parameter
import numpy as np import scipy.sparse from abc import ABCMeta, abstractmethod from ..base import BaseLibSVM class SparseBaseLibSVM(BaseLibSVM): __metaclass__ = ABCMeta @abstractmethod def __init__(self, impl, kernel, degree, gamma, coef0, tol, C, nu, epsilon, shrinking, probability, ca...
import numpy as np import scipy.sparse from abc import ABCMeta, abstractmethod from ..base import BaseLibSVM class SparseBaseLibSVM(BaseLibSVM): __metaclass__ = ABCMeta @abstractmethod def __init__(self, impl, kernel, degree, gamma, coef0, tol, C, nu, epsilon, shrinking, probability, ca...
Move the clone function closer to it's usage.
export default class FlatMetaData { static to(data) { return buildMetaData(data); } } function buildMetaData(all) { const items = buildItems(extractAllItems(all)); return {items: items}; } function extractAllItems(all) { const groups = all.groups; let extractedItems = {}; for (let groupName in group...
export default class FlatMetaData { static to(data) { return buildMetaData(data); } } function buildMetaData(all) { const items = buildItems(extractAllItems(all)); return {items: items}; } function extractAllItems(all) { const groups = all.groups; let extractedItems = {}; for (let groupName in group...
Remove ranking from denormalization command
from django.core.management.base import ( BaseCommand, ) from apps.api.models import ( Convention, Contest, Contestant, Performance, ) class Command(BaseCommand): help = "Command to denormailze data." def handle(self, *args, **options): vs = Convention.objects.all() for v...
from django.core.management.base import ( BaseCommand, ) from apps.api.models import ( Convention, Contest, Contestant, Performance, ) class Command(BaseCommand): help = "Command to denormailze data." def handle(self, *args, **options): vs = Convention.objects.all() for v...
Update services by gsim aesthetics
import React, { PropTypes } from 'react' import { connectFromRoute } from '../routes' import { sparqlConnect } from '../sparql/configure-sparql' import { LOADED } from 'sparql-connect' import ServiceList from './service-list.js' function ServicesByGsimInputOrOutput({ loaded, services }){ if (loaded !== LOADED) retur...
import React, { PropTypes } from 'react' import { connectFromRoute } from '../routes' import { sparqlConnect } from '../sparql/configure-sparql' import { LOADED } from 'sparql-connect' import ServiceList from './service-list.js' function ServicesByGsimInputOrOutput({ loaded, services }){ if (loaded !== LOADED) retur...
Correct instructions for setting the view script
<?php /** * An alternative view script for the 'home' template * * This view script renders predefined page properties as JSON. This view can * be triggered by specifying view programmatically or by requesting the page * with GET param 'view': * * Option A: (via $view object) $view->script = 'json'; * Option...
<?php /** * An alternative view script for the 'home' template * * This view script renders predefined page properties as JSON. This view can * be triggered by specifying view programmatically or by requesting the page * with GET param 'view': * * Option A: (via $view object) $view->view = 'json'; * Option B...
Create path if it doesnt exists
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json,os from datetime import datetime from scrapy.exporters import JsonLinesItemExporter path = "downloads" class Onl...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json from datetime import datetime from scrapy.exporters import JsonLinesItemExporter class Onlineparticipationdataset...
Set the secure flag for both our cookies
from .base import * DEBUG = False ALLOWED_HOSTS = ['selling-online-overseas.export.great.gov.uk'] ADMINS = (('David Downes', 'david@downes.co.uk'),) MIDDLEWARE_CLASSES += [ 'core.middleware.IpRestrictionMiddleware', ] INSTALLED_APPS += [ 'raven.contrib.django.raven_compat' ] RAVEN_CONFIG = { 'dsn': os.e...
from .base import * DEBUG = False ALLOWED_HOSTS = ['selling-online-overseas.export.great.gov.uk'] ADMINS = (('David Downes', 'david@downes.co.uk'),) MIDDLEWARE_CLASSES += [ 'core.middleware.IpRestrictionMiddleware', ] INSTALLED_APPS += [ 'raven.contrib.django.raven_compat' ] RAVEN_CONFIG = { 'dsn': os.e...
Fix running individual tests with 'test' task Undo overwriting of existing 'test' task from commit 3d70678, while preserving intention of linting before tests.
/* * grunt-contrib-watch * http://gruntjs.com/ * * Copyright (c) 2014 "Cowboy" Ben Alman, contributors * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { grunt.initConfig({ jshint: { all: [ 'Gruntfile.js', 'tasks/**/*.js', '<%= nodeunit.test...
/* * grunt-contrib-watch * http://gruntjs.com/ * * Copyright (c) 2014 "Cowboy" Ben Alman, contributors * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { grunt.initConfig({ jshint: { all: [ 'Gruntfile.js', 'tasks/**/*.js', '<%= nodeunit.test...